diff options
| author | tim b <timb@camcompu.home> | 2010-04-07 18:59:50 -0700 |
|---|---|---|
| committer | tim b <timb@camcompu.home> | 2010-04-07 18:59:50 -0700 |
| commit | 6440348618ade4fbcb541c40473074833a47d198 (patch) | |
| tree | 537ab7e4f0af7deba51bbfb360fe490968d651f8 | |
| parent | 4f09c8a882e8ae2ad1c7944a8c2a5939c9c9f7ad (diff) | |
| parent | 42df4633bb7588e8632e45013880ee4fc2bc3d6c (diff) | |
fixing merge conflicts
474 files changed, 9696 insertions, 19972 deletions
diff --git a/src/cloud.clj b/src/cloud.clj new file mode 100644 index 0000000..eacb5c9 --- /dev/null +++ b/src/cloud.clj @@ -0,0 +1,13 @@ + + +(def *user* "sbostler@gmail.com") +(def *pw* "F2X5216c463w21q8ly") + +(def container-id-map (ref {})) + +(defn list-containers [] + ) + +(defn create-container [name] + ()) + diff --git a/src/email.clj b/src/email.clj index 2a68e7b..2fd22e1 100644 --- a/src/email.clj +++ b/src/email.clj @@ -1,6 +1,6 @@ (ns email (:import org.antlr.stringtemplate.StringTemplateGroup) - (:require [clojure.contrib.str-utils2 :as str-utils2])) + (:require [clojure.contrib.str-utils2 :as s])) (defn base-mail [& m] (let [mail (apply hash-map m) @@ -34,10 +34,10 @@ (javax.mail.Message$RecipientType/TO) (javax.mail.internet.InternetAddress/parse to))) (.setSubject msg (:subject mail)) - (.setText msg (:text mail)) + (.setContent msg (:text mail) (:mime mail)) (javax.mail.Transport/send msg)))) -(def mail-templates (new StringTemplateGroup "dumpfm-mail" "template/mail")) +(def mail-templates (StringTemplateGroup. "dumpfm-mail" "template/mail" )) (.setRefreshInterval mail-templates 3) (defn parse-mail-template [temp props] @@ -48,19 +48,28 @@ [(.trim (.replaceFirst s "SUBJECT: " "")) (.trim b)]))) +(defn classify-mimetype [text] + (if (and (re-find #"(?i)<html>" text) + (re-find #"(?i)</html>" text)) + "text/html" + "text/plain")) + (defn dump-mail [to subject text] (base-mail :user "info@dump.fm" - :password "dumprulez7" - :host "smtpout.secureserver.net" - :port 25 - :ssl false - :to to - :subject subject - :text text)) + :password "dumprulez7" + :host "smtpout.secureserver.net" + :port 25 + :ssl false + :to to + :subject subject + :text text + :mime (classify-mimetype text))) -(defn send-registration-email [nick email] - (let [[s b] (parse-mail-template "welcome" {"nick" nick})] - (dump-mail [email] s b))) +(defn send-registration-email + ([nick email] (send-registration-email nick email "welcome")) + ([nick email temp] + (let [[s b] (parse-mail-template temp {"nick" nick})] + (dump-mail [email] s b)))) (defn send-reset-email [nick email key] (let [[s b] (parse-mail-template "reset" {"nick" nick "key" key})] diff --git a/src/site.clj b/src/site.clj index 9759462..713dc9d 100644 --- a/src/site.clj +++ b/src/site.clj @@ -8,6 +8,7 @@ org.apache.commons.codec.digest.DigestUtils javax.servlet.http.Cookie org.antlr.stringtemplate.StringTemplateGroup) + (:require [clojure.contrib.str-utils2 :as s]) (:use clojure.xml clojure.contrib.command-line clojure.contrib.duck-streams @@ -90,6 +91,11 @@ (.setTimeZone df (TimeZone/getTimeZone "GMT")) (.format df dt)))) +;; 404 + +(defn unknown-page [] + [404 "Page not Found"]) + ;; User authentication (def nick-regex #"^[A-Za-z0-9\-_∆˚†]*$") @@ -236,12 +242,12 @@ (defn fetch-public-message-by-id [id] - (let [query (str "SELECT m.content, m.created_on, m.user_id, u.nick, u.avatar - FROM messages m, users u, rooms r - WHERE m.user_id = u.user_id - AND r.room_id = m.room_id - AND r.admin_only = false - AND m.message_id = ?")] + (let [query "SELECT m.content, m.created_on, m.user_id, u.nick, u.avatar + FROM messages m, users u, rooms r + WHERE m.user_id = u.user_id + AND r.room_id = m.room_id + AND r.admin_only = false + AND m.message_id = ?"] (first (do-select [query (maybe-parse-int id -1)])))) (defn build-room-map-from-db [room-db] @@ -255,22 +261,11 @@ :topic (ref nil) }) -;; Templates - -;; TODO: avoid exception -(defn fetch-template [template session] - (let [st (.getInstanceOf template-group template)] - (if (session :nick) - (do (.setAttribute st "user_nick" (session :nick)) - (if (non-empty-string? (session :avatar)) (.setAttribute st "user_avatar" (session :avatar))) - (.setAttribute st "isadmin" (session :is_admin)))) - st)) - -(defn serve-template [template session] - (.toString (fetch-template template session))) - ;; Login code +(defn is-vip? [session] + (session :is_admin)) + (defn session-map-from-db [user-info] {:user_id (user-info :user_id) @@ -282,10 +277,26 @@ [user-info] (session-assoc :user_id (user-info :user_id) :nick (user-info :nick) + :email (user-info :email) :is_admin (user-info :is_admin) :avatar (user-info :avatar) :password_login true)) +;; Templates + +;; TODO: avoid exception +(defn fetch-template [template session] + (let [st (.getInstanceOf template-group template)] + (if (session :nick) + (do (.setAttribute st "user_email" (session :email)) + (.setAttribute st "user_nick" (session :nick)) + (if (non-empty-string? (session :avatar)) (.setAttribute st "user_avatar" (session :avatar))) + (.setAttribute st "isadmin" (is-vip? session)))) + st)) + +(defn serve-template [template session] + (.toString (fetch-template template session))) + ;; login-token functions (defn logged-in? @@ -309,7 +320,7 @@ (let [db-info (fetch-nick nick) computed-hash (sha1-hash (db-info :hash) expiry)] (if (= token-hash computed-hash) - (select-keys db-info [:user_id :nick :is_admin :avatar])))))) + (select-keys db-info [:user_id :nick :email :is_admin :avatar])))))) (defn make-login-token [{nick :nick hash :hash}] @@ -473,7 +484,7 @@ (defn directory [session offset] (let [st (fetch-template "directory" session) - users (to-array (directory-search offset))] + users (directory-search offset)] (.setAttribute st "users" users) (cond (= offset 0) (.setAttribute st "prev" false) (= offset 1) (.setAttribute st "prev" "") @@ -517,10 +528,10 @@ "maker" (topic :maker)})) (defn validate-topic-list [session] - (if (session :is_admin) + (if (is-vip? session) (let [st (fetch-template "topic_list" session)] (.setAttribute st "rooms" - (to-array (map topic-map-from-room (vals @rooms)))) + (map topic-map-from-room (vals @rooms))) (.toString st)) [404 "UNKNOWN_ROOM"])) @@ -538,7 +549,7 @@ topic (params :topic) deadline (params :deadline) maker (params :maker)] - (cond (not (session :is_admin)) (resp-error "NOT_VIP") + (cond (not (is-vip? session)) (resp-error "NOT_VIP") (not (valid-topic? topic)) (resp-error "INVALID_TOPIC") (not (valid-deadline? deadline)) (resp-error "INVALID_DEADLINE") (not room) (resp-error "INVALID_ROOM") @@ -549,7 +560,7 @@ (defn validate-end-topic [session params] (let [room (@rooms (params :room))] - (cond (not (session :is_admin)) (resp-error "NOT_VIP") + (cond (not (is-vip? :is_admin)) (resp-error "NOT_VIP") (not room) (resp-error "INVALID_ROOM") :else (do (end-topic! room) @@ -561,7 +572,7 @@ (let [room (@rooms room-key)] (and room (or (not (room :admin_only)) - (session :is_admin))))) + (is-vip? session))))) ;; 3/20/10: add template so multiple chat urls for ryder (defn chat [session room template] @@ -575,7 +586,7 @@ (if nick (dosync (login-user (user-struct-from-session session) room))) - (let [user-list (to-array (prepare-user-list room))] + (let [user-list (prepare-user-list room)] (.setAttribute st "users" user-list)) (.setAttribute st "messages" message-list) (.setAttribute st "roomkey" (room :key)) @@ -665,7 +676,7 @@ (if nick (dosync (login-user (user-struct-from-session session) room))) - (let [user-list (to-array (prepare-user-list room))] + (let [user-list (prepare-user-list room)] (.setAttribute st "users" user-list)) (.setAttribute st "roomkey" (room :key)) (.setAttribute st "isadminroom" (room :admin_only)) @@ -766,7 +777,7 @@ (is-image-invalid? f))) (defn do-upload [session image room] - (if-let [err (validate-upload (image :tempfile) (session :is_admin))] + (if-let [err (validate-upload (image :tempfile) (is-vip? session))] (resp-error err) (let [filename (format-filename (:filename image) (session :nick)) date (today) @@ -807,10 +818,47 @@ (not (session :nick)) [200 "NOT_LOGGED_IN"] :else (do-upload-avatar session image)))) -;; 404 +;; Debug Page + +(defn exception-to-string [e] + (let [sw (java.io.StringWriter.) + pw (java.io.PrintWriter. sw)] + (.printStackTrace e pw) + (.toString sw))) + +(defn lookup-templates [dir selected] + (for [f (.listFiles (File. dir)) + :when (and (.isFile f) (.endsWith (.getName f) ".st"))] + (let [n (s/butlast (.getName f) 3)] + {"template" n + "selected" (= selected n)}))) + +(defn debug-page [session flash] + (if (is-vip? session) + (let [st (fetch-template "debug" session)] + (.setAttribute st "flash" (:msg flash)) + (.setAttribute st "mailtemps" (lookup-templates "template/mail" "welcome")) + (.toString st)) + (unknown-page))) + +(defn debug-commmand! [session params] + (if (is-vip? session) + (let [action (:action params) + msg (try + (cond (= action "regemail") + (do (send-registration-email (params :nick) (params :to) (params :template)) + (str "Sent registration mail to " (params :to))) + :else (str "Unknown action: " action)) + (catch Exception e + (str "<h2 color=\"red\">Caught Exception in " action " --" + (.getMessage e) + "</h2><br><pre>" + (exception-to-string e) + "</pre>")))] + [(flash-assoc :msg msg) + (redirect-to "/debug")]) + (unknown-page))) -(defn unknown-page [params] - [404 "Page not Found"]) ;; Compojure Routes @@ -877,6 +925,8 @@ (GET "/reset" (reset-page session)) (POST "/reset-request" (reset-account-request! session params)) (POST "/reset/:key" (reset-account! session (-> request :route-params :key))) + (GET "/debug" (debug-page session flash)) + (POST "/debug" (debug-commmand! session params)) (GET "/about_us" (serve-template "about_us" session)) (GET "/goodies" (serve-template "goodies" session)) (GET "/help" (serve-template "help" session)) diff --git a/static/trash/favicon2.ico b/static/1favicon.ico Binary files differindex c64876f..588d51e 100755..100644 --- a/static/trash/favicon2.ico +++ b/static/1favicon.ico diff --git a/static/20bar7.png b/static/20bar7.png Binary files differdeleted file mode 100644 index b33d3b1..0000000 --- a/static/20bar7.png +++ /dev/null diff --git a/static/4a.gif b/static/4a.gif Binary files differdeleted file mode 100644 index 7efbee8..0000000 --- a/static/4a.gif +++ /dev/null diff --git a/static/4chanbeta.gif b/static/4chanbeta.gif Binary files differdeleted file mode 100644 index 4bd5499..0000000 --- a/static/4chanbeta.gif +++ /dev/null diff --git a/static/4chanbeta.png b/static/4chanbeta.png Binary files differdeleted file mode 100644 index 913fc65..0000000 --- a/static/4chanbeta.png +++ /dev/null diff --git a/static/Gifbin.gif b/static/Gifbin.gif Binary files differdeleted file mode 100644 index a034529..0000000 --- a/static/Gifbin.gif +++ /dev/null diff --git a/static/LCD.gif b/static/LCD.gif Binary files differdeleted file mode 100644 index 9537ae0..0000000 --- a/static/LCD.gif +++ /dev/null diff --git a/static/LCD.png b/static/LCD.png Binary files differdeleted file mode 100644 index ff51073..0000000 --- a/static/LCD.png +++ /dev/null diff --git a/static/about.html b/static/about.html deleted file mode 100755 index 9824b2e..0000000 --- a/static/about.html +++ /dev/null @@ -1,236 +0,0 @@ -</html><head> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> - <script type="text/javascript" src="/static/js/underscore-min.js"></script> - <script type="text/javascript" src="/static/js/sha1.js"></script> - <script type="text/javascript" src="/static/js/pichat.js"></script> - <script type="text/javascript" src="/static/js/home.js"></script> - - <script> -$(document).ready(initLoginForm); - - </script> - <link rel="stylesheet" type="text/css" href="static/css/reset.css"> - - <link rel="shortcut icon" href="static/favicon.ico"> - - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dump.fm</title></head> - - -<style type="text/css"> - - -<!-- -.white a:link { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:visited { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:hover { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - background-color:#e3e3e3; - - color: #fff; -} -.white a:active { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} - -#main { - width:660px; - margin: 0px auto -1px auto; - height:672px; -padding-top:12; - border-top-left-radius:15px; - border-top-right-radius:15px; - -webkit-border-top-left-radius:15px; - -webkit-border-top-right-radius:15px; - -moz-border-radius-topleft:15px; - -moz-border-radius-topright:15px; - border-bottom-left-radius:15px; - border-bottom-right-radius:15px; - -webkit-border-bottom-left-radius:15px; - -webkit-border-bottom-right-radius:15px; - -moz-border-radius-bottomleft:15px; - -moz-border-radius-bottomright:15px; - border:solid 1px #fff; - position: relative; - box-shadow: 5px 5px 100px #c8cbce; --webkit-box-shadow: 5px 5px 100px #c8cbce; --moz-box-shadow: 5px 5px 100px #c8cbce; -} -#horse { - width:460px; -opacity:0.9; - height:372px; -padding-top:1; - position: relative; -background:url(/static/flyhorse.gif); - background-position:right -10; - background-repeat:no-repeat; - -} -#babe { - width:460px; -opacity:0.9; - height:372px; -padding-top:1; - - position: relative; -background:url(/static/wowalk.gi); - background-position:77 120; - background-repeat:no-repeat; - -} -#bottombar{ - top: 69px; - left:0px; - position:absolute; - width: 100%; - height: 20px; - z-index: 1000; -} -p { - font-family: Arial, Helvetica, sans-serif; - font-size: 24px; -} -td { - font-family: Arial, Helvetica, sans-serif; - letter-spacing:-1px; - font-size: 12px; - color: #000000; -} -.btnav { border: 0px #000000 solid;} -body { - background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; - background-repeat:repeat-x; - background-position:top; - -margin:5%; -} -.submit { - - text-shadow: -1px 1px 1px #ccc; - font-size:15px; -} -.feild { - height:40px; - width:300px; - border:3px #000; - background:#e3e3e3; - margin:10px; - color:#000; - - font-size:30px; - -} -.txt { - font-family:Arial, Helvetica, sans-serif; - font-size:14px; -line-height:1.2; - text-shadow:1px 1px 0.5px #ccc; - word-spacing: 3px; -} - .line { - font-family:Arial, Helvetica, sans-serif; - letter-spacing:0px; -line-height:-1; - - color:#000; - font-size:17px; -} -#nickInput {color:#000; -} -.no-cursor { cursor: none; } -.invisible { display: none !important; } -#cursor-big { position: absolute; z-index: 1000; } - -#signin-submit { - display:inline-block; - width:300px; -height:37px; -font-size:20px; -background-image:url(/static/btngrad1.png); -font-weight:bold; -word-spacing:7; -padding-top:6px; - text-align:center; - z-index:100; - font-size:18px; - color:#fff; - text-shadow:1px 1px 3px rgba(0,0,0,1); - border-top-left-radius:5px; - border-top-right-radius:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; - border:solid 1px #eee; -} - ---> - - -</style> - -<body> -<div id="rapper7"> -<div id="header7"> - <div id="bottombar"></div> - <div align="center"> -<br> - </div> - - <div class="white"></div> - <div align="center"><br /></div> -</div> -</div> -</div> -<div id="main" align="center"> - - <p align="center"> - - <div id="registerbox"> - <div align="center"><img src="/static/dumpteam.png"></div> - </p> - - <p align="center" class="line">Talk with pictures!</p> - <div align="right" class="txt"> -<br> - <div align="center">dump.fm is fun website that lets people talk to each other using pictures.<br> - A team of four dudes are working on it... they are known as Brokencyde.... <br> - </div> - </div> - <h1 align="center"> </h1> - <h1 align="center"> - - <p align="center"> </p> - <p> </p> - - <div align="center"></div> - </div> -</div> - </div></div> - -</div> - </h1> - </div> -</div> - - - -</body> -</html> diff --git a/static/ako.gif b/static/ako.gif Binary files differdeleted file mode 100644 index 3f94cfa..0000000 --- a/static/ako.gif +++ /dev/null diff --git a/static/answer_good.gif b/static/answer_good.gif Binary files differdeleted file mode 100644 index b99b33d..0000000 --- a/static/answer_good.gif +++ /dev/null diff --git a/static/aol_suck.gif b/static/aol_suck.gif Binary files differdeleted file mode 100644 index c21eecf..0000000 --- a/static/aol_suck.gif +++ /dev/null diff --git a/static/awave.gif b/static/awave.gif Binary files differdeleted file mode 100644 index bcdd2f2..0000000 --- a/static/awave.gif +++ /dev/null diff --git a/static/babe_bluebikini.gif b/static/babe_bluebikini.gif Binary files differdeleted file mode 100644 index d272d7c..0000000 --- a/static/babe_bluebikini.gif +++ /dev/null diff --git a/static/background.js b/static/background.js deleted file mode 100755 index edbe5b1..0000000 --- a/static/background.js +++ /dev/null @@ -1,31 +0,0 @@ -var bgImages = ['shaq.gif','background4.gif','background13.gif','wayne.gif','blink.gif','rhianamoney.gif','britglobe2.gif','gaga.gif']; -var bgIndex = -1; - -function killBackground() { - document.getElementsByTagName('html')[0].style.background = 'none'; -} - -function setBackground(i) { - document.getElementsByTagName('html')[0].style.background = (bgImages[i].indexOf('#')+1?bgImages[i]:'#222 url(/static/'+bgImages[i]+(bgImages[i].indexOf('.gif')==-1?'.jpg':'')+') 50% 50%'); -} - -function getBackground() { - if (++bgIndex>=bgImages.length) bgIndex = 0; - setBackground(bgIndex); -} - -window.onload = function() { - var nAV = navigator.appVersion.toLowerCase(); - if (nAV.match(/msie 5/) || nAV.match(/msie 6/)) return false; - var items = document.getElementsByClassName('dialog','div'); - for (var i=0,j=items.length; i<j; i++) { - widgets[widgets.length] = new DialogWidget(items[i],i); - } - var d = document.createElement('div'); - d.style.cssText = 'position:fixed;bottom:3px;right:3px;font-size:xx-small;z-index:10'; - d.innerHTML = '<button onclick="getBackground()" title="Rotate background image" style="font-size:xx-small">1</button><button id="animation-demo" onclick="doAnimationDemo()" title="Cheap demo: Adjust width, height and margins, showing fluidity" style="font-size:xx-small">2</button>'; - document.body.appendChild(d); - document.getElementById('animation-demo').style.display = 'block'; - getBackground(); - // window.onresize = handleResize; -}
\ No newline at end of file diff --git a/static/background17.gif b/static/background17.gif Binary files differdeleted file mode 100644 index b9a8b11..0000000 --- a/static/background17.gif +++ /dev/null diff --git a/static/beingpostednow.png b/static/beingpostednow.png Binary files differdeleted file mode 100644 index 5087009..0000000 --- a/static/beingpostednow.png +++ /dev/null diff --git a/static/bg-btn-red.gif b/static/bg-btn-red.gif Binary files differdeleted file mode 100644 index cbca69d..0000000 --- a/static/bg-btn-red.gif +++ /dev/null diff --git a/static/bg-btn-red.png b/static/bg-btn-red.png Binary files differdeleted file mode 100644 index f931fad..0000000 --- a/static/bg-btn-red.png +++ /dev/null diff --git a/static/bgnav.jpg b/static/bgnav.jpg Binary files differdeleted file mode 100755 index 0913e21..0000000 --- a/static/bgnav.jpg +++ /dev/null diff --git a/static/black.gif b/static/black.gif Binary files differdeleted file mode 100644 index a627750..0000000 --- a/static/black.gif +++ /dev/null diff --git a/static/black.png b/static/black.png Binary files differdeleted file mode 100644 index 597d919..0000000 --- a/static/black.png +++ /dev/null diff --git a/static/blockbg.gif b/static/blockbg.gif Binary files differdeleted file mode 100644 index d087dad..0000000 --- a/static/blockbg.gif +++ /dev/null diff --git a/static/browser.png b/static/browser.png Binary files differdeleted file mode 100644 index a2e22c0..0000000 --- a/static/browser.png +++ /dev/null diff --git a/static/browsertool.gif b/static/browsertool.gif Binary files differdeleted file mode 100644 index 05a3379..0000000 --- a/static/browsertool.gif +++ /dev/null diff --git a/static/btngrad1.png b/static/btngrad1.png Binary files differdeleted file mode 100644 index 2519e34..0000000 --- a/static/btngrad1.png +++ /dev/null diff --git a/static/bwdump.gif b/static/bwdump.gif Binary files differdeleted file mode 100644 index 4702c11..0000000 --- a/static/bwdump.gif +++ /dev/null diff --git a/static/bwdump.png b/static/bwdump.png Binary files differdeleted file mode 100644 index a60e719..0000000 --- a/static/bwdump.png +++ /dev/null diff --git a/static/cambutton.png b/static/cambutton.png Binary files differdeleted file mode 100644 index 3cb942e..0000000 --- a/static/cambutton.png +++ /dev/null diff --git a/static/chanbg.png b/static/chanbg.png Binary files differdeleted file mode 100644 index 331f4eb..0000000 --- a/static/chanbg.png +++ /dev/null diff --git a/static/chatbar.html b/static/chatbar.html deleted file mode 100755 index 0a27996..0000000 --- a/static/chatbar.html +++ /dev/null @@ -1,57 +0,0 @@ -<html> - <head> - <title>dump.fm</title> - <link rel="stylesheet" type="text/css" href="/static/css/reset.css"> - <link rel="stylesheet" type="text/css" href="/static/css/pichat.css"> - - <link rel="shortcut icon" href="favicon.ico"> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/js/sha1.js"></script> - <script type="text/javascript" src="static/js/pichat.js"></script> - <script> - jQuery(document).ready(initChat); - var Nick = $json_user_nick$; - </script> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><style type="text/css"> -<!-- -a { - font-size: 12px; - color: #000; -} -a:link { - text-decoration: none; -} -a:visited { - text-decoration: none; - color: #000; -} -a:hover { - text-decoration: none; - color: #00F; -} -a:active { - text-decoration: none; - color: #000; -} -#msgInputDiv{position:fixed; -bottom:17px; -} - ---> -</style></head> - -<body> -<div id="chatrap"> - $if(user_nick)$ - <div id="msgInputDiv"> - <input id="msgInput" class="msgInput" type="input" /> - <input id="msgSubmit" type="submit" value="Send Image URL" - /> - </div> - $endif$ - </div> - </div> - - - </body> -</html> diff --git a/static/clearbg.png b/static/clearbg.png Binary files differdeleted file mode 100644 index c257704..0000000 --- a/static/clearbg.png +++ /dev/null diff --git a/static/clearbg2.png b/static/clearbg2.png Binary files differdeleted file mode 100644 index a9d6ac7..0000000 --- a/static/clearbg2.png +++ /dev/null diff --git a/static/clearred.png b/static/clearred.png Binary files differdeleted file mode 100644 index f6c5019..0000000 --- a/static/clearred.png +++ /dev/null diff --git a/static/cloudbar.png b/static/cloudbar.png Binary files differdeleted file mode 100644 index e4e6893..0000000 --- a/static/cloudbar.png +++ /dev/null diff --git a/static/cloudbar2.png b/static/cloudbar2.png Binary files differdeleted file mode 100644 index ac4d1c8..0000000 --- a/static/cloudbar2.png +++ /dev/null diff --git a/static/cloudbar3.png b/static/cloudbar3.png Binary files differdeleted file mode 100644 index aca0f05..0000000 --- a/static/cloudbar3.png +++ /dev/null diff --git a/static/cloudz.gif b/static/cloudz.gif Binary files differdeleted file mode 100644 index 0e708fa..0000000 --- a/static/cloudz.gif +++ /dev/null diff --git a/static/computer_blue.gif b/static/computer_blue.gif Binary files differdeleted file mode 100644 index 6b736e6..0000000 --- a/static/computer_blue.gif +++ /dev/null diff --git a/static/const_landscape.gif b/static/const_landscape.gif Binary files differdeleted file mode 100644 index d54f9a9..0000000 --- a/static/const_landscape.gif +++ /dev/null diff --git a/static/css/ChatBubble-simple.css b/static/css/ChatBubble-simple.css index 02ec152..0e3c319 100644 --- a/static/css/ChatBubble-simple.css +++ b/static/css/ChatBubble-simple.css @@ -4,6 +4,16 @@ ChatBubble is based on "Even more rounded corners with CSS": http://www.schillmania.com/content/projects/even-more-rounded-corners/ */ +#questions{ +position:absolute; +padding-left:300; +} + +#table{ +position:fixed; +top:20; +left:20; +} div.CBmsg { display: table; margin-bottom: 0.5em; @@ -67,35 +77,35 @@ div.CBiconL > img { .CBblueR .CBt, .CBblueR .CBb, .CBblueR .CBb div { - background:transparent url(/static/BubbleBlueR800x1600.png) no-repeat top right; + background:transparent url(/static/img/BubbleBlueR800x1600.png) no-repeat top right; } .CBpinkL .CBcontent, .CBpinkL .CBt, .CBpinkL .CBb, .CBpinkL .CBb div { - background:transparent url(/static/BubblePinkL800x1600.png) no-repeat top right; + background:transparent url(/static/img/BubblePinkL800x1600.png) no-repeat top right; } .CBpinkR .CBcontent, .CBpinkR .CBt, .CBpinkR .CBb, .CBpinkR .CBb div { - background:transparent url(/static/BubblePinkR800x1600.png) no-repeat top right; + background:transparent url(/static/img/BubblePinkR800x1600.png) no-repeat top right; } .CBltgreyL .CBcontent, .CBltgreyL .CBt, .CBltgreyL .CBb, .CBltgreyL .CBb div { - background:transparent url(/static/BubbleLtGreyL800x1600.png) no-repeat top right; + background:transparent url(/static/img/BubbleLtGreyL800x1600.png) no-repeat top right; } .CBltgreyR .CBcontent, .CBltgreyR .CBt, .CBltgreyR .CBb, .CBltgreyR .CBb div { - background:transparent url(/static/BubbleLtGreyR800x1600.png) no-repeat top right; + background:transparent url(/static/img/BubbleLtGreyR800x1600.png) no-repeat top right; } .CBtxt .CBcontent { diff --git a/static/css/browser.css b/static/css/browser.css index fcf48f2..ce5600a 100755 --- a/static/css/browser.css +++ b/static/css/browser.css @@ -391,7 +391,7 @@ background-color:#f3f3f3; min-width:72px; line-height:15px; background-color:#F2F2F2; - background-image:/static/footer.png; + background-image:/static/img/footer.png; background-position:bottom; border:solid 1px #0f1e31; z-index:4; diff --git a/static/css/datePicker.css b/static/css/datePicker.css deleted file mode 100644 index f3836dc..0000000 --- a/static/css/datePicker.css +++ /dev/null @@ -1,129 +0,0 @@ - - -table.jCalendar { - border: 1px solid #000; - background: #aaa; - border-collapse: separate; - border-spacing: 2px; -} -table.jCalendar th { - background: #333; - color: #fff; - font-weight: bold; - padding: 3px 5px; -} - -table.jCalendar td { - background: #ccc; - color: #000; - padding: 3px 5px; - text-align: center; -} -table.jCalendar td.other-month { - background: #ddd; - color: #aaa; -} -table.jCalendar td.today { - background: #666; - color: #fff; -} -table.jCalendar td.selected { - background: #f66; - color: #fff; -} -table.jCalendar td.selected.dp-hover { - background: #f33; - color: #fff; -} -table.jCalendar td.dp-hover, -table.jCalendar tr.activeWeekHover td { - background: #fff; - color: #000; -} -table.jCalendar tr.selectedWeek td { - background: #f66; - color: #fff; -} -table.jCalendar td.disabled, table.jCalendar td.disabled.dp-hover { - background: #bbb; - color: #888; -} -table.jCalendar td.unselectable, -table.jCalendar td.unselectable:hover, -table.jCalendar td.unselectable.dp-hover { - background: #bbb; - color: #888; -} - -/* For the popup */ - -/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */ - -div.dp-popup { - position: relative; - background: #ccc; - font-size: 10px; - font-family: arial, sans-serif; - padding: 2px; - width: 171px; - line-height: 1.2em; -} -div#dp-popup { - position: absolute; - z-index: 199; -} -div.dp-popup h2 { - font-size: 12px; - text-align: center; - margin: 2px 0; - padding: 0; -} -a#dp-close { - font-size: 11px; - padding: 4px 0; - text-align: center; - display: block; -} -a#dp-close:hover { - text-decoration: underline; -} -div.dp-popup a { - color: #000; - text-decoration: none; - padding: 3px 2px 0; -} -div.dp-popup div.dp-nav-prev { - position: absolute; - top: 2px; - left: 4px; - width: 100px; -} -div.dp-popup div.dp-nav-prev a { - float: left; -} -/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */ -div.dp-popup div.dp-nav-prev a, div.dp-popup div.dp-nav-next a { - cursor: pointer; -} -div.dp-popup div.dp-nav-prev a.disabled, div.dp-popup div.dp-nav-next a.disabled { - cursor: default; -} -div.dp-popup div.dp-nav-next { - position: absolute; - top: 2px; - right: 4px; - width: 100px; -} -div.dp-popup div.dp-nav-next a { - float: right; -} -div.dp-popup a.disabled { - cursor: default; - color: #aaa; -} -div.dp-popup td { - cursor: pointer; -} -div.dp-popup td.disabled { - cursor: default; -}
\ No newline at end of file diff --git a/static/css/directory.css b/static/css/directory.css index 0ca097d..2a4d5f1 100644 --- a/static/css/directory.css +++ b/static/css/directory.css @@ -31,7 +31,7 @@ margin-bottom:15; #logavatar{ margin-left:-85; height:25; -background-image:url(/static/leftarrow.png); +background-image:url(/static/img/leftarrow.png); width:70; background-repeat:no-repeat; background-position:59 4; diff --git a/static/css/dump.css b/static/css/dump.css index 36739a4..101f7f5 100755 --- a/static/css/dump.css +++ b/static/css/dump.css @@ -67,7 +67,7 @@ bottom:68; z-index:1111; right:38; font-size:15; -color:#000; +color:#999; text-shadow: #000 1px 1px 1px; } diff --git a/static/css/header.css b/static/css/header.css index e3a3653..2e6a3e6 100755 --- a/static/css/header.css +++ b/static/css/header.css @@ -35,7 +35,7 @@ margin-right:80%; } #header7{ - background-image:url(/static/dblue2.png); + background-image:url(/static/img/dblue2.png); background-attachment:inherit; margin: 0px auto -1px auto; top: 0px; @@ -157,7 +157,6 @@ color:#fff; top:0px; position:absolute; font-family: Arial, Helvetica, sans-serif; - background-image:url(/static/20bar7.ng); font-size: 12px; height:30; word-spacing:2; @@ -257,7 +256,7 @@ font-weight:bold; #cursor-big { position: absolute; z-index: 1000; } #iesucks{ -background-image:url(/static/ieburnbtn.gif); font-size:40;color:white;height:100%;width:100%;z-index:1000000000000000000000000000000;padding-top:100; +background-image:url(/static/img/ieburnbtn.gif); font-size:40;color:white;height:100%;width:100%;z-index:1000000000000000000000000000000;padding-top:100; padding-right:400;padding-left:50; font-weight:bold; diff --git a/static/css/jScrollPane.css b/static/css/jScrollPane.css deleted file mode 100644 index 1d9cf92..0000000 --- a/static/css/jScrollPane.css +++ /dev/null @@ -1,65 +0,0 @@ - -.jScrollPaneContainer { - position: relative; - overflow: hidden; - z-index: 1; -} - -.jScrollPaneTrack { - position: absolute; - cursor: pointer; - right: 0; - top: 0; - height: 100%; - background:url(/static/spatter.jpg); -} -.jScrollPaneDrag { - position: absolute; - background:url(/static/background17.gif); - cursor: pointer; - overflow: hidden; -} -.jScrollPaneDragTop { - position: absolute; - top: 0; - left: 0; - overflow: hidden; -} -.jScrollPaneDragBottom { - position: absolute; - bottom: 0; - left: 0; - overflow: hidden; -} -a.jScrollArrowUp { - display: block; - position: absolute; - z-index: 1; - top: 0; - right: 0; - text-indent: -2000px; - overflow: hidden; - /*background-color: #666;*/ - height: 9px; -} -a.jScrollArrowUp:hover { - /*background-color: #f60;*/ -} - -a.jScrollArrowDown { - display: block; - position: absolute; - z-index: 1; - bottom: 0; - right: 0; - text-indent: -2000px; - overflow: hidden; - /*background-color: #666;*/ - height: 9px; -} -a.jScrollArrowDown:hover { - /*background-color: #f60;*/ -} -a.jScrollActiveArrowButton, a.jScrollActiveArrowButton:hover { - /*background-color: #f00;*/ -}
\ No newline at end of file diff --git a/static/css/jquery-ui-1.7.2.custom.css b/static/css/jquery-ui-1.7.2.custom.css deleted file mode 100755 index 9d7aa08..0000000 --- a/static/css/jquery-ui-1.7.2.custom.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/static/css/log.css b/static/css/log.css index 94acd19..10b8e99 100644 --- a/static/css/log.css +++ b/static/css/log.css @@ -31,7 +31,7 @@ margin-bottom:15; #logavatar{ margin-left:-85; height:25; -background-image:url(/static/leftarrow.png); +background-image:url(/static/img/leftarrow.png); width:70; background-repeat:no-repeat; background-position:59 4; diff --git a/static/css/pichat.css b/static/css/pichat.css deleted file mode 100755 index 92ea9fb..0000000 --- a/static/css/pichat.css +++ /dev/null @@ -1,420 +0,0 @@ -/* pichat.css */ - -body { -background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; - margin:0; - background-repeat:repeat-x; - background-position:top; -overflow:hidden; - -} - #topic { - z-index: 5000; - display: inline; - background-color: white; - } -#content{ - z-index: 3; - overflow: auto; - min-width:600px; -} - -#chatboxx { - position: fixed; - top:80px; -} - -#rapper { - top: 0px; -} -#trophy{ -position:fixed; -right:2; -bottom:30; - -} -#footerc -{ - text-align:center; - position:fixed; - width:100%; - bottom:0px; -line-height:3.1; - font-size:11px; -word-spacing:6px; -height:28px; - color: #000; - -} -#footerc a { - font-size: 11px; - color: #000; -} -#footerc a:link { - text-decoration: none; - font-size: 11px; -color:000; -} - -#footerc a:hover { - text-decoration:none; - font-size: 11px; - color: #f0e; -} - - -#messagePane { - border: 2px solid #c8cbce; -top:40px; -bottom:65px; - position:fixed; - width: 99.3%; - background-color:#FFF; -left:0.2%; - z-index:5; -} - -#messageList { - height: 100%; - width: 100%; - overflow-y: auto; - overflow-x: hidden; -} -#messagetabs { - height: 40px; - padding: 5px; - position: fixed; - width: 80%; - max-width:1500px; - overflow-y: hidden; - overflow-x: hidden; - top:48px; - left:0px; - z-index:1; -} - -#msgInputDiv { - position:relative; - min-width:500px; - z-index:100; -left:1px; -bottom:10px; - width: 100%; -} - -#msgInput { - width: 99.7%; - z-index:100; - background-color:#FFF; - margin-top: 16px; - left:-3px; - position:relative; - border:2px solid #c8cbce; -height:35px; -font-size:20px; - min-width:500px; - box-shadow: 2px 3px 4px #eee; -} -.msgInput { - min-width:500px; - z-index:100; -} -#msginputrapper{ -margin-right:374; - -} -#msgSubmit { - - position:absolute; - display:inline-block; - width:120px; -height:35px; -right:260px; -font-size:20px; -background-image:url(/static/urlbutton.png); -text-indent:27; - -top:15px; - text-align:center; - z-index:100; - cursor:pointer; - background-color:red; - font-size:12px; - color:#fff; - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-upload{ - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:20; -top:15px; -padding-bottom:1; -text-indent:28; - text-align:center; - z-index:100; - cursor:pointer; -background-color:yellow; - font-size:12px; - color:#fff; -background-image:url(/static/cambutton.png); - - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-snap{ - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:20; -top:15px; -padding-bottom:4; - text-align:center; - z-index:100; - cursor:pointer; -background-color:yellow; - font-size:17px; - color:#fff; -background-image:url(/static/bg-btn-red.png); - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-snap.blink{ - color:#4f4; -} - - -#webcam-button-close { /* 16 x 14 */ - position: fixed; - bottom: 330px; /* 240 + 68 - (16 / 2) */ - right: 335px; /* 320 - (14 / 2) */ - z-index: 5001; -border:1px solid #000; - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 4px 4px #c8cbce; - cursor: pointer; -} - -#webcam-preview { - position:fixed; - bottom: 82; -opacity:0.9; - right:30; - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 3px 4px #c8cbce; - border-top-right-radius:5px; - background-color:#FFF; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; -border:1px solid #999; - z-index:5000; -} -#upload { - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:140; -top:15px; -padding-bottom:1; -text-indent:24; - text-align:center; - z-index:100; - cursor:pointer; -background-color:blue; - font-size:12px; - color:#fff; -background-image:url(/static/upbutton.png); - - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -.msgDiv img{ - max-width:650px; - width: expression(this.width > 650 ? 650: true); - max-height:400px; - height: expression(this.width > 400 ? 400: true); - max-width:400px; -margin:-2; - z-index: 1; -} -.msgDiv {padding:2px; -} -.oldmsg { - color: #666; -} - -#userList { - overflow-x: hidden; - overflow-y:auto; - max-height: 55%; - margin: 0px; - position: absolute; - padding: 5px; - top:85px; - min-width: 200px; - width:11%; - float:right; - right: 6.2%; - font-family: Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight:420; - border-top-left-radius:5px; - border-top-right-radius:5px; - -webkit-border-top-left-radius:5px; - background-color:#FFF; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; -border-right:2px solid #c8cbce; -border-bottom:2px solid #c8cbce; - - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 3px 4px #c8cbce; -filter: progid:DXImageTransform.Microsoft.dropShadow(color=#c8cbce, offX=3, offY=4, positive=true); - text-overflow:ellipsis; -opacity:0.87; - z-index:18; - text-align: left; -} -.username{height:30px; -margin-top:6px; -line-height:20px; -text-indent:6px; -z-index:18; -min-width:90px; -overflow:hidden; - -} -.username a { -display:block; -width:100%; -height:100%; -text-decoration:none; -} -.username a:hover { -display:block; -width:100%; -height:100%; -background-image:url(/static/moverc.png); -background-repeat:repeat-x; -color:#fff; -text-decoration:none; -background-color:#f3f3f3; - border-top-right-radius:5px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; -} -#userList img{ - max-width:30px; - width: expression(this.width > 30 ? 30: true); - max-height:30px; - height: expression(this.width > 30 ? 30: true); - max-width:30px; - - float:right; - right:1px; - z-index:77; - height:30px; - border-top-left-radius:3px; - border-top-right-radius:3px; - -webkit-border-top-left-radius:3px; - -webkit-border-top-right-radius:3px; - -moz-border-radius-topleft:3px; - -moz-border-radius-topright:3px; - border-bottom-left-radius:3px; - border-bottom-right-radius:3px; - -webkit-border-bottom-left-radius:3px; - -webkit-border-bottom-right-radius:3px; - -moz-border-radius-bottomleft:3px; - -moz-border-radius-bottomright:3px; -} - -#userListicon { - overflow: auto; - height: 70%; - margin: 0px; - position: fixed; - padding: 5px; - top:48px; - width: 7%; - float:right; - right: 35px; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-transform: uppercase; - min-width:72px; - line-height:13px; - z-index:1; - font-weight: bold; - font-family: Arial, Helvetica, sans-serif; - color: #666; - text-transform:none; - -} -#avatar -{ - right:1px; - float:right; - text-align:left; - width:auto; - -} -#mgsavatar{ -left:0; -} -#binfo { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; - bottom -} - -#preload { - position: absolute; - left: 0px; - top: 0px; -} - -.invisible { display: none !important; }
\ No newline at end of file diff --git a/static/css/profile.css b/static/css/profile.css index 520639f..24c9af1 100755 --- a/static/css/profile.css +++ b/static/css/profile.css @@ -64,7 +64,7 @@ margin-bottom:15; #logavatar{ margin-left:-49; height:22; -background-image:url(/static/leftarrow.png); +background-image:url(/static/img/leftarrow.png); background-repeat:no-repeat; background-position:22 1; margin-top:-22; diff --git a/static/css/register.css b/static/css/register.css new file mode 100644 index 0000000..c6ed8ff --- /dev/null +++ b/static/css/register.css @@ -0,0 +1,184 @@ + + +<!-- + + +<!-- +.white a:link { + text-decoration: none; + text-shadow: -1px 1px 1px #ccc; + color: #504F61; +} +.white a:visited { + text-decoration: none; + text-shadow: -1px 1px 1px #ccc; + color: #504F61; +} +.white a:hover { + text-decoration: none; + text-shadow: -1px 1px 1px #ccc; + background-color:#e3e3e3; + + color: #fff; +} +.white a:active { + text-decoration: none; + text-shadow: -1px 1px 1px #ccc; + color: #504F61; +} +#main { + background-position:center; + width:460px; + margin: 0px auto -1px auto; +padding:25; +padding-top:5; + z-index:2; + opacity:0.9; + border-top-left-radius:10px; + border-top-right-radius:10px; + -webkit-border-top-left-radius:10px; + -webkit-border-top-right-radius:10px; + -moz-border-radius-topleft:10px; + -moz-border-radius-topright:10px; + border-bottom-left-radius:10px; + border-bottom-right-radius:10px; + -webkit-border-bottom-left-radius:10px; + -webkit-border-bottom-right-radius:10px; + -moz-border-radius-bottomleft:10px; + -moz-border-radius-bottomright:10px; + border:solid 2px #000; + position: relative; + background-color: #FFF; + background-position:center; + background-repeat:no-repeat; + box-shadow: 5px 5px 100px #c8cbce; +-webkit-box-shadow: 5px 5px 100px #c8cbce; +-moz-box-shadow: 5px 5px 100px #c8cbce; +} +#main img{margin-left:100; + +} +#logout7{ + top:5px; + position:relative; + font-size:13px; + margin-right: 10px; + float:right; + z-index: 999; + font-family: "Times New Roman", Times, serif; +} +#logo7{ + top:20px; + margin-left: 10%; + margin-right: 10%; + z-index:1000; + float:left; +} +#rapper7{ + top: 0px; + left:0px; + position:absolute; + width: 100%; + height: 78px; + z-index: 1000; +} +#bottombar{ + top: 69px; + left:0px; + position:absolute; + width: 100%; + height: 20px; + z-index: 1000; +} +p { + font-family: Arial, Helvetica, sans-serif; + font-size: 24px; +} +td { + font-family: Arial, Helvetica, sans-serif; + letter-spacing:-1px; + font-size: 12px; + color: #000000; +} +.btnav { border: 0px #000000 solid;} +body { + background:#EEF2FF url(/static/img/fade-blue.png) top center repeat-x; + background-repeat:repeat-x; + background-position:top; + overflow:hidden; +margin:8%; +} +body a{border:0; +text-decoration:none; +} +.submit { + + + text-shadow: -1px 1px 1px #ccc; + + font-size:15px; +} +.field { + height:40px; + width:300px; + border:3px #000; + background:#e3e3e3; + margin:10px; + color:#000; + + font-size:30px; + +} +.txt { + font-family:Arial, Helvetica, sans-serif; + font-size:14px; +line-height:1.2; + text-shadow:1px 1px 0.5px #ccc; + word-spacing: 3px; +} + .line { + font-family:Arial, Helvetica, sans-serif; + letter-spacing: 1px; +line-height:1; + text-shadow:0px 1px 50px #999; + color:#000; + font-size:19px; +} +#nickInput {color:#000; +} +.no-cursor { cursor: none; } +.invisible { display: none !important; } +#cursor-big { position: absolute; z-index: 1000; } + +#submit { + + + display:inline-block; + width:300px; +height:35px; +margin-top:-5; +font-size:14px; +background-image:url(/static/img/btngrad1.png); +margin-left:140; +top:15px; + text-align:center; + z-index:100; + font-size:18px; + color:#fff; + text-shadow:1px 1px 1px rgba(0,0,0,1); + border-top-left-radius:5px; + border-top-right-radius:5px; + -webkit-border-top-left-radius:5px; + -webkit-border-top-right-radius:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + border-bottom-left-radius:5px; + border-bottom-right-radius:5px; + -webkit-border-bottom-left-radius:5px; + -webkit-border-bottom-right-radius:5px; + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + border:solid 1px #fff; +} + +--> diff --git a/static/date.js b/static/date.js deleted file mode 100644 index 2312284..0000000 --- a/static/date.js +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Date prototype extensions. Doesn't depend on any - * other code. Doens't overwrite existing methods. - * - * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear, - * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear, - * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods - * - * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) - * - * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString - - * I've added my name to these methods so you know who to blame if they are broken! - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * An Array of day names starting with Sunday. - * - * @example dayNames[0] - * @result 'Sunday' - * - * @name dayNames - * @type Array - * @cat Plugins/Methods/Date - */ -Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; - -/** - * An Array of abbreviated day names starting with Sun. - * - * @example abbrDayNames[0] - * @result 'Sun' - * - * @name abbrDayNames - * @type Array - * @cat Plugins/Methods/Date - */ -Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; - -/** - * An Array of month names starting with Janurary. - * - * @example monthNames[0] - * @result 'January' - * - * @name monthNames - * @type Array - * @cat Plugins/Methods/Date - */ -Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; - -/** - * An Array of abbreviated month names starting with Jan. - * - * @example abbrMonthNames[0] - * @result 'Jan' - * - * @name monthNames - * @type Array - * @cat Plugins/Methods/Date - */ -Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - -/** - * The first day of the week for this locale. - * - * @name firstDayOfWeek - * @type Number - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ -Date.firstDayOfWeek = 1; - -/** - * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc). - * - * @name format - * @type String - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ -Date.format = 'dd/mm/yyyy'; -//Date.format = 'mm/dd/yyyy'; -//Date.format = 'yyyy-mm-dd'; -//Date.format = 'dd mmm yy'; - -/** - * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear - * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes. - * - * @name format - * @type String - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ -Date.fullYearStart = '20'; - -(function() { - - /** - * Adds a given method under the given name - * to the Date prototype if it doesn't - * currently exist. - * - * @private - */ - function add(name, method) { - if( !Date.prototype[name] ) { - Date.prototype[name] = method; - } - }; - - /** - * Checks if the year is a leap year. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.isLeapYear(); - * @result true - * - * @name isLeapYear - * @type Boolean - * @cat Plugins/Methods/Date - */ - add("isLeapYear", function() { - var y = this.getFullYear(); - return (y%4==0 && y%100!=0) || y%400==0; - }); - - /** - * Checks if the day is a weekend day (Sat or Sun). - * - * @example var dtm = new Date("01/12/2008"); - * dtm.isWeekend(); - * @result false - * - * @name isWeekend - * @type Boolean - * @cat Plugins/Methods/Date - */ - add("isWeekend", function() { - return this.getDay()==0 || this.getDay()==6; - }); - - /** - * Check if the day is a day of the week (Mon-Fri) - * - * @example var dtm = new Date("01/12/2008"); - * dtm.isWeekDay(); - * @result false - * - * @name isWeekDay - * @type Boolean - * @cat Plugins/Methods/Date - */ - add("isWeekDay", function() { - return !this.isWeekend(); - }); - - /** - * Gets the number of days in the month. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getDaysInMonth(); - * @result 31 - * - * @name getDaysInMonth - * @type Number - * @cat Plugins/Methods/Date - */ - add("getDaysInMonth", function() { - return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]; - }); - - /** - * Gets the name of the day. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getDayName(); - * @result 'Saturday' - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getDayName(true); - * @result 'Sat' - * - * @param abbreviated Boolean When set to true the name will be abbreviated. - * @name getDayName - * @type String - * @cat Plugins/Methods/Date - */ - add("getDayName", function(abbreviated) { - return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()]; - }); - - /** - * Gets the name of the month. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getMonthName(); - * @result 'Janurary' - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getMonthName(true); - * @result 'Jan' - * - * @param abbreviated Boolean When set to true the name will be abbreviated. - * @name getDayName - * @type String - * @cat Plugins/Methods/Date - */ - add("getMonthName", function(abbreviated) { - return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()]; - }); - - /** - * Get the number of the day of the year. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getDayOfYear(); - * @result 11 - * - * @name getDayOfYear - * @type Number - * @cat Plugins/Methods/Date - */ - add("getDayOfYear", function() { - var tmpdtm = new Date("1/1/" + this.getFullYear()); - return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000); - }); - - /** - * Get the number of the week of the year. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.getWeekOfYear(); - * @result 2 - * - * @name getWeekOfYear - * @type Number - * @cat Plugins/Methods/Date - */ - add("getWeekOfYear", function() { - return Math.ceil(this.getDayOfYear() / 7); - }); - - /** - * Set the day of the year. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.setDayOfYear(1); - * dtm.toString(); - * @result 'Tue Jan 01 2008 00:00:00' - * - * @name setDayOfYear - * @type Date - * @cat Plugins/Methods/Date - */ - add("setDayOfYear", function(day) { - this.setMonth(0); - this.setDate(day); - return this; - }); - - /** - * Add a number of years to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addYears(1); - * dtm.toString(); - * @result 'Mon Jan 12 2009 00:00:00' - * - * @name addYears - * @type Date - * @cat Plugins/Methods/Date - */ - add("addYears", function(num) { - this.setFullYear(this.getFullYear() + num); - return this; - }); - - /** - * Add a number of months to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addMonths(1); - * dtm.toString(); - * @result 'Tue Feb 12 2008 00:00:00' - * - * @name addMonths - * @type Date - * @cat Plugins/Methods/Date - */ - add("addMonths", function(num) { - var tmpdtm = this.getDate(); - - this.setMonth(this.getMonth() + num); - - if (tmpdtm > this.getDate()) - this.addDays(-this.getDate()); - - return this; - }); - - /** - * Add a number of days to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addDays(1); - * dtm.toString(); - * @result 'Sun Jan 13 2008 00:00:00' - * - * @name addDays - * @type Date - * @cat Plugins/Methods/Date - */ - add("addDays", function(num) { - //this.setDate(this.getDate() + num); - this.setTime(this.getTime() + (num*86400000) ); - return this; - }); - - /** - * Add a number of hours to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addHours(24); - * dtm.toString(); - * @result 'Sun Jan 13 2008 00:00:00' - * - * @name addHours - * @type Date - * @cat Plugins/Methods/Date - */ - add("addHours", function(num) { - this.setHours(this.getHours() + num); - return this; - }); - - /** - * Add a number of minutes to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addMinutes(60); - * dtm.toString(); - * @result 'Sat Jan 12 2008 01:00:00' - * - * @name addMinutes - * @type Date - * @cat Plugins/Methods/Date - */ - add("addMinutes", function(num) { - this.setMinutes(this.getMinutes() + num); - return this; - }); - - /** - * Add a number of seconds to the date object. - * - * @example var dtm = new Date("01/12/2008"); - * dtm.addSeconds(60); - * dtm.toString(); - * @result 'Sat Jan 12 2008 00:01:00' - * - * @name addSeconds - * @type Date - * @cat Plugins/Methods/Date - */ - add("addSeconds", function(num) { - this.setSeconds(this.getSeconds() + num); - return this; - }); - - /** - * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant. - * - * @example var dtm = new Date(); - * dtm.zeroTime(); - * dtm.toString(); - * @result 'Sat Jan 12 2008 00:01:00' - * - * @name zeroTime - * @type Date - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ - add("zeroTime", function() { - this.setMilliseconds(0); - this.setSeconds(0); - this.setMinutes(0); - this.setHours(0); - return this; - }); - - /** - * Returns a string representation of the date object according to Date.format. - * (Date.toString may be used in other places so I purposefully didn't overwrite it) - * - * @example var dtm = new Date("01/12/2008"); - * dtm.asString(); - * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy' - * - * @name asString - * @type Date - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ - add("asString", function(format) { - var r = format || Date.format; - if (r.split('mm').length>1) { // ugly workaround to make sure we don't replace the m's in e.g. noveMber - r = r.split('mmmm').join(this.getMonthName(false)) - .split('mmm').join(this.getMonthName(true)) - .split('mm').join(_zeroPad(this.getMonth()+1)) - } else { - r = r.split('m').join(this.getMonth()+1); - } - r = r.split('yyyy').join(this.getFullYear()) - .split('yy').join((this.getFullYear() + '').substring(2)) - .split('dd').join(_zeroPad(this.getDate())) - .split('d').join(this.getDate()); - return r; - }); - - /** - * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object - * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere) - * - * @example var dtm = Date.fromString("12/01/2008"); - * dtm.toString(); - * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy' - * - * @name fromString - * @type Date - * @cat Plugins/Methods/Date - * @author Kelvin Luck - */ - Date.fromString = function(s) - { - var f = Date.format; - - var d = new Date('01/01/1970'); - - if (s == '') return d; - - s = s.toLowerCase(); - var matcher = ''; - var order = []; - var r = /(dd?d?|mm?m?|yy?yy?)+([^(m|d|y)])?/g; - var results; - while ((results = r.exec(f)) != null) - { - switch (results[1]) { - case 'd': - case 'dd': - case 'm': - case 'mm': - case 'yy': - case 'yyyy': - matcher += '(\\d+\\d?\\d?\\d?)+'; - order.push(results[1].substr(0, 1)); - break; - case 'mmm': - matcher += '([a-z]{3})'; - order.push('M'); - break; - } - if (results[2]) { - matcher += results[2]; - } - - } - var dm = new RegExp(matcher); - var result = s.match(dm); - for (var i=0; i<order.length; i++) { - var res = result[i+1]; - switch(order[i]) { - case 'd': - d.setDate(res); - break; - case 'm': - d.setMonth(Number(res)-1); - break; - case 'M': - for (var j=0; j<Date.abbrMonthNames.length; j++) { - if (Date.abbrMonthNames[j].toLowerCase() == res) break; - } - d.setMonth(j); - break; - case 'y': - d.setYear(res); - break; - } - } - - return d; - }; - - // utility method - var _zeroPad = function(num) { - var s = '0'+num; - return s.substring(s.length-2) - //return ('0'+num).substring(-2); // doesn't work on IE :( - }; - -})();
\ No newline at end of file diff --git a/static/dblue2.png b/static/dblue2.png Binary files differdeleted file mode 100755 index 3b5c667..0000000 --- a/static/dblue2.png +++ /dev/null diff --git a/static/directory.gif b/static/directory.gif Binary files differdeleted file mode 100644 index d66a2bf..0000000 --- a/static/directory.gif +++ /dev/null diff --git a/static/door2.gif b/static/door2.gif Binary files differdeleted file mode 100644 index da0cca1..0000000 --- a/static/door2.gif +++ /dev/null diff --git a/static/doorway.gif b/static/doorway.gif Binary files differdeleted file mode 100644 index 15e1c94..0000000 --- a/static/doorway.gif +++ /dev/null diff --git a/static/dot.gif b/static/dot.gif Binary files differdeleted file mode 100644 index 339faf7..0000000 --- a/static/dot.gif +++ /dev/null diff --git a/static/dot_green.gif b/static/dot_green.gif Binary files differdeleted file mode 100644 index 70badab..0000000 --- a/static/dot_green.gif +++ /dev/null diff --git a/static/druida.gif b/static/druida.gif Binary files differdeleted file mode 100644 index a6043ee..0000000 --- a/static/druida.gif +++ /dev/null diff --git a/static/duh.gif b/static/duh.gif Binary files differdeleted file mode 100644 index d39158e..0000000 --- a/static/duh.gif +++ /dev/null diff --git a/static/dump.css b/static/dump.css deleted file mode 100755 index f8bbe30..0000000 --- a/static/dump.css +++ /dev/null @@ -1,458 +0,0 @@ -/* pichat.css */ - -body { - -background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; - margin:0; - - background-repeat:repeat-x; - background-position:top; -overflow:hidden; - -} - -a { - font-size: 12px; - color: #000; -} -a:link { - text-decoration: none; -} -a:visited { - text-decoration: none; - color: #000; -} -a:hover { - text-decoration: none; - color: #00F; -} -a:active { - text-decoration: none; - color: #000; -} -.white a:link { - text-decoration: none; - font-size:14px; - - color: #fff; -} -.white a:visited { - text-decoration: none; - font-size:14px; - color: #fff; -} -#content{ - z-index: 3; - overflow: auto; - min-width:600px; -} - -#chatboxx { - position: fixed; - top:80px; -} - -#rapper { - top: 0px; -} -#trophy{ -position:fixed; -right:2; -bottom:30; - -} -#effects-msg{ -position:fixed; -bottom:68; -z-index:1111; -right:38; -font-size:15; -color:#fff; -text-shadow: #000 1px 1px 1px; - -} -#footerc -{ - text-align:center; - position:fixed; - width:100%; - bottom:0px; -line-height:3.1; - font-size:11px; -word-spacing:6px; -height:28px; - color: #000; - -} -#footerc a { - font-size: 11px; - color: #000; -} -#footerc a:link { - text-decoration: none; - font-size: 11px; -color:000; -} - -#footerc a:hover { - text-decoration:none; - font-size: 11px; - color: #f0e; -} - - -#messagePane { - border: 2px solid #c8cbce; -top:40px; -bottom:65px; - position:fixed; - width: 99.3%; - background-color:#FFF; -left:0.2%; - z-index:5; -} - -#messageList { - height: 100%; - width: 100%; - overflow-y: auto; - overflow-x: hidden; -} -#messagetabs { - height: 40px; - padding: 5px; - position: fixed; - width: 80%; - max-width:1500px; - overflow-y: hidden; - overflow-x: hidden; - top:48px; - left:0px; - z-index:1; -} - -#msgInputDiv { - position:relative; - min-width:500px; - z-index:100; -left:1px; -bottom:10px; - width: 100%; -} - -#msgInput { - width: 99.7%; - z-index:100; - background-color:#FFF; - margin-top: 16px; - left:-3px; - position:relative; - border:2px solid #c8cbce; -height:35px; -font-size:20px; - min-width:500px; - box-shadow: 2px 3px 4px #eee; -} -.msgInput { - min-width:500px; - z-index:100; -} -#msginputrapper{ -margin-right:374; - -} -#msgSubmit { - - position:absolute; - display:inline-block; - width:120px; -height:35px; -right:260px; -font-size:20px; -background-image:url(/static/urlbutton.png); -text-indent:27; - -top:15px; - text-align:center; - z-index:100; - cursor:pointer; - background-color:#0c8fff; - font-size:12px; - color:#fff; - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-upload{ - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:20; -top:15px; -padding-bottom:1; -text-indent:28; - text-align:center; - z-index:100; - cursor:pointer; -background-color:#0c8fff; - font-size:12px; - color:#fff; -background-image:url(/static/cambutton.png); - - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-snap{ - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:20; -top:15px; -padding-bottom:4; - text-align:center; - z-index:100; - cursor:pointer; -background-color:yellow; - font-size:17px; - color:#fff; -background-image:url(/static/bg-btn-red.png); - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -#webcam-button-snap.blink{ - color:#4f4; -} - - -#webcam-button-close { /* 16 x 14 */ - position: fixed; - bottom: 330px; /* 240 + 68 - (16 / 2) */ - right: 335px; /* 320 - (14 / 2) */ - z-index: 5001; -border:1px solid #000; - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 4px 4px #c8cbce; - cursor: pointer; -} - -#webcam-preview { - position:fixed; - bottom: 82; -opacity:0.9; - right:30; - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 3px 4px #c8cbce; - border-top-right-radius:5px; - background-color:#FFF; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; -border:1px solid #999; - z-index:5000; -} -#upload { - border-top-right-radius:10px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; - border-radius:5px; - position:absolute; - display:inline-block; - width:120px; -height:35px; -background-position:center; -right:140; -top:15px; -padding-bottom:1; -text-indent:24; - text-align:center; - z-index:100; - cursor:pointer; -background-color:#0c8fff; - font-size:12px; - color:#fff; -background-image:url(/static/upbutton.png); - - text-shadow:1px 1px 3px rgba(0,0,0,1); -} -.msgDiv img{ - max-width:650px; - width: expression(this.width > 650 ? 650: true); - max-height:400px; - height: expression(this.width > 400 ? 400: true); - max-width:400px; -margin:-2; - z-index: 1; -} -.msgDiv {padding:2px; -} -.oldmsg { - color: #666; -} - -#userList { - overflow-x: hidden; - overflow-y:auto; - max-height: 55%; - margin: 0px; - position: absolute; - padding: 5px; - top:85px; - min-width: 200px; - width:11%; - float:right; - right: 6.2%; - font-family: Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight:420; - border-top-left-radius:5px; - border-top-right-radius:5px; - -webkit-border-top-left-radius:5px; - background-color:#FFF; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; -border-right:2px solid #c8cbce; -border-bottom:2px solid #c8cbce; - - box-shadow: 3px 4px 4px #c8cbce; --webkit-box-shadow: 3px 4px 4px #c8cbce; --moz-box-shadow: 3px 3px 4px #c8cbce; -filter: progid:DXImageTransform.Microsoft.dropShadow(color=#c8cbce, offX=3, offY=4, positive=true); - text-overflow:ellipsis; -opacity:0.87; - z-index:18; - text-align: left; -} -.username{height:30px; -margin-top:6px; -line-height:20px; -text-indent:6px; -z-index:18; -min-width:90px; -overflow:hidden; - -} -.username a { -display:block; -width:100%; -height:100%; -text-decoration:none; -} -.username a:hover { -display:block; -width:100%; -height:100%; -background-image:url(/static/moverc.png); -background-repeat:repeat-x; -color:#fff; -text-decoration:none; -background-color:#f3f3f3; - border-top-right-radius:5px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topright:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomright:5px; -} -#userList img{ - max-width:30px; - width: expression(this.width > 30 ? 30: true); - max-height:30px; - height: expression(this.width > 30 ? 30: true); - max-width:30px; - - float:right; - right:1px; - z-index:77; - height:30px; - border-top-left-radius:3px; - border-top-right-radius:3px; - -webkit-border-top-left-radius:3px; - -webkit-border-top-right-radius:3px; - -moz-border-radius-topleft:3px; - -moz-border-radius-topright:3px; - border-bottom-left-radius:3px; - border-bottom-right-radius:3px; - -webkit-border-bottom-left-radius:3px; - -webkit-border-bottom-right-radius:3px; - -moz-border-radius-bottomleft:3px; - -moz-border-radius-bottomright:3px; -} - -#userListicon { - overflow: auto; - height: 70%; - margin: 0px; - position: fixed; - padding: 5px; - top:48px; - width: 7%; - float:right; - right: 35px; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-transform: uppercase; - min-width:72px; - line-height:13px; - z-index:1; - font-weight: bold; - font-family: Arial, Helvetica, sans-serif; - color: #666; - text-transform:none; - -} -#avatar -{ - right:1px; - float:right; - text-align:left; - width:auto; - -} -#mgsavatar{ -left:0; -} -#binfo { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; - bottom -} - -#preload { - position: absolute; - left: 0px; - top: 0px; -} - -.invisible { display: none !important; }
\ No newline at end of file diff --git a/static/dumpcandy.png b/static/dumpcandy.png Binary files differdeleted file mode 100644 index a364b3e..0000000 --- a/static/dumpcandy.png +++ /dev/null diff --git a/static/dumpcats2.png b/static/dumpcats2.png Binary files differdeleted file mode 100644 index 34768f4..0000000 --- a/static/dumpcats2.png +++ /dev/null diff --git a/static/dumpclouds.png b/static/dumpclouds.png Binary files differdeleted file mode 100644 index c0fbd6d..0000000 --- a/static/dumpclouds.png +++ /dev/null diff --git a/static/dumpcopy.png b/static/dumpcopy.png Binary files differdeleted file mode 100644 index 41f6f59..0000000 --- a/static/dumpcopy.png +++ /dev/null diff --git a/static/dumpdown1.gif b/static/dumpdown1.gif Binary files differdeleted file mode 100644 index 25f7ca4..0000000 --- a/static/dumpdown1.gif +++ /dev/null diff --git a/static/dumpfun.png b/static/dumpfun.png Binary files differdeleted file mode 100644 index 29a5f74..0000000 --- a/static/dumpfun.png +++ /dev/null diff --git a/static/dumpfunover.gif b/static/dumpfunover.gif Binary files differdeleted file mode 100644 index 25d5e77..0000000 --- a/static/dumpfunover.gif +++ /dev/null diff --git a/static/dumpmod1.png b/static/dumpmod1.png Binary files differdeleted file mode 100644 index 4e5fd6e..0000000 --- a/static/dumpmod1.png +++ /dev/null diff --git a/static/dumpmod2.png b/static/dumpmod2.png Binary files differdeleted file mode 100644 index c5140ff..0000000 --- a/static/dumpmod2.png +++ /dev/null diff --git a/static/dumppreview.gif b/static/dumppreview.gif Binary files differdeleted file mode 100644 index 3bb83f0..0000000 --- a/static/dumppreview.gif +++ /dev/null diff --git a/static/dumppreview.png b/static/dumppreview.png Binary files differdeleted file mode 100644 index 0e3c52d..0000000 --- a/static/dumppreview.png +++ /dev/null diff --git a/static/dumpprivacy.pdf b/static/dumpprivacy.pdf Binary files differdeleted file mode 100644 index 1b6b6aa..0000000 --- a/static/dumpprivacy.pdf +++ /dev/null diff --git a/static/dumpteam.gif b/static/dumpteam.gif Binary files differdeleted file mode 100644 index 28e7b5b..0000000 --- a/static/dumpteam.gif +++ /dev/null diff --git a/static/dumpteam.png b/static/dumpteam.png Binary files differdeleted file mode 100755 index f879d01..0000000 --- a/static/dumpteam.png +++ /dev/null diff --git a/static/dumpterms.pdf b/static/dumpterms.pdf Binary files differdeleted file mode 100644 index 961b386..0000000 --- a/static/dumpterms.pdf +++ /dev/null diff --git a/static/dumpup1.gif b/static/dumpup1.gif Binary files differdeleted file mode 100644 index 5e5c6aa..0000000 --- a/static/dumpup1.gif +++ /dev/null diff --git a/static/editprofilehelp.png b/static/editprofilehelp.png Binary files differdeleted file mode 100644 index f1233f0..0000000 --- a/static/editprofilehelp.png +++ /dev/null diff --git a/static/email_anim.gif b/static/email_anim.gif Binary files differdeleted file mode 100644 index 7623c88..0000000 --- a/static/email_anim.gif +++ /dev/null diff --git a/static/ewdump.png b/static/ewdump.png Binary files differdeleted file mode 100644 index 81e9800..0000000 --- a/static/ewdump.png +++ /dev/null diff --git a/static/fade-blue.png b/static/fade-blue.png Binary files differdeleted file mode 100644 index 4bab239..0000000 --- a/static/fade-blue.png +++ /dev/null diff --git a/static/favicon.ico b/static/favicon.ico Binary files differindex 588d51e..932df2b 100644 --- a/static/favicon.ico +++ b/static/favicon.ico diff --git a/static/favicon4.ico b/static/favicon4.ico Binary files differdeleted file mode 100644 index 5d63dd0..0000000 --- a/static/favicon4.ico +++ /dev/null diff --git a/static/flyhorse.gif b/static/flyhorse.gif Binary files differdeleted file mode 100644 index ae9d2ad..0000000 --- a/static/flyhorse.gif +++ /dev/null diff --git a/static/funlogobg.png b/static/funlogobg.png Binary files differdeleted file mode 100644 index 79ae683..0000000 --- a/static/funlogobg.png +++ /dev/null diff --git a/static/g_green_anim.gif b/static/g_green_anim.gif Binary files differdeleted file mode 100644 index de09ed8..0000000 --- a/static/g_green_anim.gif +++ /dev/null diff --git a/static/gem_red.gif b/static/gem_red.gif Binary files differdeleted file mode 100644 index 4cd34a0..0000000 --- a/static/gem_red.gif +++ /dev/null diff --git a/static/geocities.gif b/static/geocities.gif Binary files differdeleted file mode 100644 index cb8dd65..0000000 --- a/static/geocities.gif +++ /dev/null diff --git a/static/globe.gif b/static/globe.gif Binary files differdeleted file mode 100644 index 4907a42..0000000 --- a/static/globe.gif +++ /dev/null diff --git a/static/grad2.png b/static/grad2.png Binary files differdeleted file mode 100755 index c9f0c0d..0000000 --- a/static/grad2.png +++ /dev/null diff --git a/static/grey.gif b/static/grey.gif Binary files differdeleted file mode 100644 index f8bcc13..0000000 --- a/static/grey.gif +++ /dev/null diff --git a/static/gritter/css/jquery.gritter.css b/static/gritter/css/jquery.gritter.css index 0982790..177765a 100755 --- a/static/gritter/css/jquery.gritter.css +++ b/static/gritter/css/jquery.gritter.css @@ -48,14 +48,12 @@ color:#000; background:url('.'); /* ie7/8 fix */ } .gritter-top { - background:url(../images/gritter.png0) no-repeat left -30px; height:10px; } .hover .gritter-top { background-position:right -30px; } .gritter-bottom { - background:url(../images/gritter.png0) no-repeat left bottom; height:0px; margin:0; } @@ -64,7 +62,6 @@ color:#000; } .gritter-item { display:block; - background:url(../images/gritter.png0) no-repeat left -40px; background-color:#eee; color:#000; height:auto; @@ -88,7 +85,7 @@ height:auto; -webkit-box-shadow: 5px 7px 10px #c8cbce; -moz-box-shadow: 5px 7px 10px #c8cbce; border:0px solid #999; - background:url(/static/gritterbg.png) + background:url(/static/gritter/gritterbg.png) } .gritter-item a{color:#000; } @@ -106,7 +103,7 @@ right:0; position:absolute; top:-5px; right:-12px; - background:url(../images/gritter.png) no-repeat left top; + background:url(/static/gritter/gritterclose.png) no-repeat left top; cursor:pointer; width:30px; height:30px; @@ -117,7 +114,7 @@ right:0; color:#000; display:block; } -.gritter-title a{color:#000; +.gritter-title a:link{color:#000; } .gritter-image { width:48px; diff --git a/static/gritterbg.png b/static/gritter/gritterbg.png Binary files differindex eea2c8c..eea2c8c 100644 --- a/static/gritterbg.png +++ b/static/gritter/gritterbg.png diff --git a/static/guarantee_risk_free.png b/static/guarantee_risk_free.png Binary files differdeleted file mode 100644 index 9bf34aa..0000000 --- a/static/guarantee_risk_free.png +++ /dev/null diff --git a/static/guaranteed_customer_satisfaction.gif b/static/guaranteed_customer_satisfaction.gif Binary files differdeleted file mode 100644 index 976d686..0000000 --- a/static/guaranteed_customer_satisfaction.gif +++ /dev/null diff --git a/static/hand_right.gif b/static/hand_right.gif Binary files differdeleted file mode 100644 index f6013b3..0000000 --- a/static/hand_right.gif +++ /dev/null diff --git a/static/hearts.gif b/static/hearts.gif Binary files differdeleted file mode 100644 index 4a345cb..0000000 --- a/static/hearts.gif +++ /dev/null diff --git a/static/help.html b/static/help.html deleted file mode 100644 index 9a1c28e..0000000 --- a/static/help.html +++ /dev/null @@ -1,265 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-<title>dump.fm help</title>
-<link rel="stylesheet" href="/static/css/ChatBubble-simple.css" media="screen" />
-</head>
-
-<body style="width:475px; font-family: Arial, Helvetica, sans-serif;">
-
-<div class="CBmsg CBmsgR CBblueR">
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- How do I post a picture on dump.fm?
- </div>
- <div class="CBb"><div></div></div>
- </div>
- <div class="CBiconR"><img src="/static/gagaq.png"></div>
-</div>
-
-<br clear=all>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-Oh hai Gaga! Its Easy! Here are some ways...<br>
-
-
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-
-<b>Copy Image Location</b> Just copy the location(URL) of any image online and paste it into dump.fm's input bar, the image will show up like magic! You can also paste strings of image URLs to make montage.
-<br>
-<img src="/static/copydump.png"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-<b>Image Search</b> The image search tool is probably the easiest way to post. Simply enter a search term and see images. When you find one you like, just click "Dump This!" and the image will post.
-<br><img src="/static/imagesearchhelp.png"><br>
-You can also narrow down your search criteria by clicking on 'options' and choosing where the images come from, the file type, size..etc.
-<br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-<b>Upload</b> an existing photo from your hard drive with the upload tool.
-<br><img src="/static/uploadbuttonhelp.png"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-<b>Webcam</b> Select the webcam tool and take a photo of yourself. We wanna see!
-<br><img src="/static/webcambuttonhelp.png"><br>
-
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-
-
-<div class="CBmsg CBmsgR CBblueR">
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-Oh awesome! But how can I find cool images??
- </div>
- <div class="CBb"><div></div></div>
- </div>
- <div class="CBiconR"><img src="/static/gagaq.png"></div>
-</div>
-
-
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- <b>Google Image Search</b> Duh... but Gaga, there are plenty of tricks for Google images search too!<br>
- For instance, you can search all the images on a site by using a 'site:URL' search.
-<br><img src="/static/sitesearchhelp.png"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- <b>Picsearch.com:</b> Looking for some great animated GIFs? This search engine is the bomb. You can narrow down your search by doing an 'advanced search' where you can search only animated GIFs. Picsearch = treasure chest for images.
-<br><img src="/static/Picsearch.gif"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- <b>MySpace.com</b> Unbeknownst to many, myspace offers a wealth of untaped images. All you have to do is to go myspace.com and in the search bar change the drop down option from 'people' to 'images' and enter your search term. You will surely dig up some diamonds.
-<br><img src="/static/myspacehelp.png"><br>
-For extra points try the "m trick"..<br>
-Copy the URL of an image thumb nail in the search results and replace "m" with "l" and the image will show up full sized!
-<br><img src="/static/myspacehelp2.png"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- <b>Facebook.com</b> You'd be surprised how funny your friends pics are you just have to look.
-<br><img src="/static/facebooklol.jpeg"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-<div class="CBmsg CBmsgR CBblueR">
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- How do I set my icon and edit my profile?
- </div>
- <div class="CBb"><div></div></div>
- </div>
- <div class="CBiconR"><img src="/static/gagaq.png"></div>
-</div>
-
-<br clear=all>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-Simply click on profile on the top bar and then hit 'edit profile'<br>
-<img src="/static/editprofile.png">
-
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-
-
-
-
-<div class="CBmsg CBmsgR CBblueR">
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-Cool! I think I now understand the basics of dump.fm..<br>
-But I still dont get.. can I email you about my questions?
- </div>
- <div class="CBb"><div></div></div>
- </div>
- <div class="CBiconR"><img src="/static/gagaq.png"></div>
-</div>
-
-<br clear=all>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
- Gaga, we'd love to hear from you but first jstchill in dump.fm for a while and get the hang of it before emailing us.<br>
-
-
-
- </div>
- <div class="CBb"><div></div></div>
- </div>
-</div>
-
-
-
-
-
-
-
-<div class="CBmsg CBmsgR CBblueR">
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-No no, I have chilled a bunch here......... <br>....now I want to ask if its ok if I send you a bag of money?
-<br><img src="/static/bag_of_money_hg_wht.gif"><br>
- </div>
- <div class="CBb"><div></div></div>
- </div>
- <div class="CBiconR"><img src="/static/gagaq.png"></div>
-</div>
-
-<br clear=all>
-
-<div class="CBmsg CBmsgL CBpinkL">
- <div class="CBiconL"><img src="/static/idontgetit.png"></div>
- <div class="CBtxt">
- <div class="CBcontent">
- <div class="CBt"></div>
-Yes, bags of money are accepted...<br><br> Email us at <a href="mailto:info@dump.fm"> info@dump.fm</a> and we'll arrange for pickup.
-<br><br>
-<b> ~the dump.fm team</b>
-
- </div>
- <div class="CBb"><div></div></div>
- </div>
-
-
-
-</body>
-</html>
diff --git a/static/home4.gif b/static/home4.gif Binary files differdeleted file mode 100644 index baf313f..0000000 --- a/static/home4.gif +++ /dev/null diff --git a/static/html_3_2.gif b/static/html_3_2.gif Binary files differdeleted file mode 100644 index 12ef87f..0000000 --- a/static/html_3_2.gif +++ /dev/null diff --git a/static/htmllogo.gif b/static/htmllogo.gif Binary files differdeleted file mode 100644 index 4ba383d..0000000 --- a/static/htmllogo.gif +++ /dev/null diff --git a/static/hugedump2.png b/static/hugedump2.png Binary files differdeleted file mode 100644 index 8a15277..0000000 --- a/static/hugedump2.png +++ /dev/null diff --git a/static/hugescreen.png b/static/hugescreen.png Binary files differdeleted file mode 100644 index eb0266f..0000000 --- a/static/hugescreen.png +++ /dev/null diff --git a/static/image_draw.gif b/static/image_draw.gif Binary files differdeleted file mode 100644 index aaf947c..0000000 --- a/static/image_draw.gif +++ /dev/null diff --git a/static/imageboard.png b/static/imageboard.png Binary files differdeleted file mode 100644 index 7e917f2..0000000 --- a/static/imageboard.png +++ /dev/null diff --git a/static/images-global/zoom/closebox.png b/static/images-global/zoom/closebox.png Binary files differdeleted file mode 100755 index 4de4396..0000000 --- a/static/images-global/zoom/closebox.png +++ /dev/null diff --git a/static/images-global/zoom/spacer.gif b/static/images-global/zoom/spacer.gif Binary files differdeleted file mode 100755 index 5bfd67a..0000000 --- a/static/images-global/zoom/spacer.gif +++ /dev/null diff --git a/static/images-global/zoom/zoom-caption-fill.png b/static/images-global/zoom/zoom-caption-fill.png Binary files differdeleted file mode 100755 index 1e34153..0000000 --- a/static/images-global/zoom/zoom-caption-fill.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-caption-l.png b/static/images-global/zoom/zoom-caption-l.png Binary files differdeleted file mode 100755 index a63ea48..0000000 --- a/static/images-global/zoom/zoom-caption-l.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-caption-r.png b/static/images-global/zoom/zoom-caption-r.png Binary files differdeleted file mode 100755 index 15980d5..0000000 --- a/static/images-global/zoom/zoom-caption-r.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow1.png b/static/images-global/zoom/zoom-shadow1.png Binary files differdeleted file mode 100755 index 8b48000..0000000 --- a/static/images-global/zoom/zoom-shadow1.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow2.png b/static/images-global/zoom/zoom-shadow2.png Binary files differdeleted file mode 100755 index 09209f3..0000000 --- a/static/images-global/zoom/zoom-shadow2.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow3.png b/static/images-global/zoom/zoom-shadow3.png Binary files differdeleted file mode 100755 index 7636fec..0000000 --- a/static/images-global/zoom/zoom-shadow3.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow4.png b/static/images-global/zoom/zoom-shadow4.png Binary files differdeleted file mode 100755 index c7f148d..0000000 --- a/static/images-global/zoom/zoom-shadow4.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow5.png b/static/images-global/zoom/zoom-shadow5.png Binary files differdeleted file mode 100755 index 2a75b82..0000000 --- a/static/images-global/zoom/zoom-shadow5.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow6.png b/static/images-global/zoom/zoom-shadow6.png Binary files differdeleted file mode 100755 index 65801aa..0000000 --- a/static/images-global/zoom/zoom-shadow6.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow7.png b/static/images-global/zoom/zoom-shadow7.png Binary files differdeleted file mode 100755 index cb44760..0000000 --- a/static/images-global/zoom/zoom-shadow7.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-shadow8.png b/static/images-global/zoom/zoom-shadow8.png Binary files differdeleted file mode 100755 index f1c6acd..0000000 --- a/static/images-global/zoom/zoom-shadow8.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-1.png b/static/images-global/zoom/zoom-spin-1.png Binary files differdeleted file mode 100755 index 5615629..0000000 --- a/static/images-global/zoom/zoom-spin-1.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-10.png b/static/images-global/zoom/zoom-spin-10.png Binary files differdeleted file mode 100755 index 77595db..0000000 --- a/static/images-global/zoom/zoom-spin-10.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-11.png b/static/images-global/zoom/zoom-spin-11.png Binary files differdeleted file mode 100755 index c2147d5..0000000 --- a/static/images-global/zoom/zoom-spin-11.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-12.png b/static/images-global/zoom/zoom-spin-12.png Binary files differdeleted file mode 100755 index cf02724..0000000 --- a/static/images-global/zoom/zoom-spin-12.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-2.png b/static/images-global/zoom/zoom-spin-2.png Binary files differdeleted file mode 100755 index 95eaae8..0000000 --- a/static/images-global/zoom/zoom-spin-2.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-3.png b/static/images-global/zoom/zoom-spin-3.png Binary files differdeleted file mode 100755 index 9e2b9cb..0000000 --- a/static/images-global/zoom/zoom-spin-3.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-4.png b/static/images-global/zoom/zoom-spin-4.png Binary files differdeleted file mode 100755 index a39c0fc..0000000 --- a/static/images-global/zoom/zoom-spin-4.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-5.png b/static/images-global/zoom/zoom-spin-5.png Binary files differdeleted file mode 100755 index 80bea63..0000000 --- a/static/images-global/zoom/zoom-spin-5.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-6.png b/static/images-global/zoom/zoom-spin-6.png Binary files differdeleted file mode 100755 index b962e5f..0000000 --- a/static/images-global/zoom/zoom-spin-6.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-7.png b/static/images-global/zoom/zoom-spin-7.png Binary files differdeleted file mode 100755 index 9b6e489..0000000 --- a/static/images-global/zoom/zoom-spin-7.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-8.png b/static/images-global/zoom/zoom-spin-8.png Binary files differdeleted file mode 100755 index fe147d5..0000000 --- a/static/images-global/zoom/zoom-spin-8.png +++ /dev/null diff --git a/static/images-global/zoom/zoom-spin-9.png b/static/images-global/zoom/zoom-spin-9.png Binary files differdeleted file mode 100755 index b321b1c..0000000 --- a/static/images-global/zoom/zoom-spin-9.png +++ /dev/null diff --git a/static/imagesearchoptions.png b/static/imagesearchoptions.png Binary files differdeleted file mode 100644 index a4f22c6..0000000 --- a/static/imagesearchoptions.png +++ /dev/null diff --git a/static/imageurlbtn.png b/static/imageurlbtn.png Binary files differdeleted file mode 100644 index 1630ea0..0000000 --- a/static/imageurlbtn.png +++ /dev/null diff --git a/static/imageurlbtn1.png b/static/imageurlbtn1.png Binary files differdeleted file mode 100644 index f9845e2..0000000 --- a/static/imageurlbtn1.png +++ /dev/null diff --git a/static/BubbleBlueL800x1600.png b/static/img/BubbleBlueL800x1600.png Binary files differindex 3329e11..3329e11 100755 --- a/static/BubbleBlueL800x1600.png +++ b/static/img/BubbleBlueL800x1600.png diff --git a/static/BubbleBlueR800x1600.png b/static/img/BubbleBlueR800x1600.png Binary files differindex 320a743..320a743 100755 --- a/static/BubbleBlueR800x1600.png +++ b/static/img/BubbleBlueR800x1600.png diff --git a/static/BubbleLtGreyL800x1600.png b/static/img/BubbleLtGreyL800x1600.png Binary files differindex d0728da..d0728da 100755 --- a/static/BubbleLtGreyL800x1600.png +++ b/static/img/BubbleLtGreyL800x1600.png diff --git a/static/BubbleLtGreyR800x1600.png b/static/img/BubbleLtGreyR800x1600.png Binary files differindex 5c8abad..5c8abad 100755 --- a/static/BubbleLtGreyR800x1600.png +++ b/static/img/BubbleLtGreyR800x1600.png diff --git a/static/BubblePinkL800x1600.png b/static/img/BubblePinkL800x1600.png Binary files differindex a2e3ccb..a2e3ccb 100755 --- a/static/BubblePinkL800x1600.png +++ b/static/img/BubblePinkL800x1600.png diff --git a/static/BubblePinkR800x1600.png b/static/img/BubblePinkR800x1600.png Binary files differindex 97c59fb..97c59fb 100755 --- a/static/BubblePinkR800x1600.png +++ b/static/img/BubblePinkR800x1600.png diff --git a/static/Picsearch.gif b/static/img/Picsearch.gif Binary files differindex 292e47e..292e47e 100644 --- a/static/Picsearch.gif +++ b/static/img/Picsearch.gif diff --git a/static/bag_of_money_hg_wht.gif b/static/img/bag_of_money_hg_wht.gif Binary files differindex 4b82d4e..4b82d4e 100644 --- a/static/bag_of_money_hg_wht.gif +++ b/static/img/bag_of_money_hg_wht.gif diff --git a/static/buttonbottom.gif b/static/img/buttonbottom.gif Binary files differindex 158c641..158c641 100644 --- a/static/buttonbottom.gif +++ b/static/img/buttonbottom.gif diff --git a/static/buttontop.gif b/static/img/buttontop.gif Binary files differindex b4540cd..b4540cd 100644 --- a/static/buttontop.gif +++ b/static/img/buttontop.gif diff --git a/static/copydump.png b/static/img/copydump.png Binary files differindex b44aba2..b44aba2 100644 --- a/static/copydump.png +++ b/static/img/copydump.png diff --git a/static/editprofile.png b/static/img/editprofile.png Binary files differindex f1233f0..f1233f0 100644 --- a/static/editprofile.png +++ b/static/img/editprofile.png diff --git a/static/facebooklol.jpeg b/static/img/facebooklol.jpeg Binary files differindex 5da3d43..5da3d43 100644 --- a/static/facebooklol.jpeg +++ b/static/img/facebooklol.jpeg diff --git a/static/trash/footer.png b/static/img/footer.png Binary files differindex d83aafd..d83aafd 100755 --- a/static/trash/footer.png +++ b/static/img/footer.png diff --git a/static/fundump.png b/static/img/fundump.png Binary files differindex e5db562..e5db562 100644 --- a/static/fundump.png +++ b/static/img/fundump.png diff --git a/static/gagaq.png b/static/img/gagaq.png Binary files differindex b6f8f60..b6f8f60 100644 --- a/static/gagaq.png +++ b/static/img/gagaq.png diff --git a/static/idontgetit.png b/static/img/idontgetit.png Binary files differindex f5cda6e..f5cda6e 100644 --- a/static/idontgetit.png +++ b/static/img/idontgetit.png diff --git a/static/ieburnbtn.gif b/static/img/ieburnbtn.gif Binary files differindex 266ccd2..266ccd2 100644 --- a/static/ieburnbtn.gif +++ b/static/img/ieburnbtn.gif diff --git a/static/imagesearchhelp.png b/static/img/imagesearchhelp.png Binary files differindex 09f590b..09f590b 100644 --- a/static/imagesearchhelp.png +++ b/static/img/imagesearchhelp.png diff --git a/static/leftarrow.png b/static/img/leftarrow.png Binary files differindex e432ded..e432ded 100644 --- a/static/leftarrow.png +++ b/static/img/leftarrow.png diff --git a/static/myspacehelp.png b/static/img/myspacehelp.png Binary files differindex 6b18789..6b18789 100644 --- a/static/myspacehelp.png +++ b/static/img/myspacehelp.png diff --git a/static/myspacehelp2.png b/static/img/myspacehelp2.png Binary files differindex a32250c..a32250c 100644 --- a/static/myspacehelp2.png +++ b/static/img/myspacehelp2.png diff --git a/static/share/delishicon.png b/static/img/share/delishicon.png Binary files differindex 3d20478..3d20478 100644 --- a/static/share/delishicon.png +++ b/static/img/share/delishicon.png diff --git a/static/share/fbbutton.png b/static/img/share/fbbutton.png Binary files differindex 4ad2d66..4ad2d66 100644 --- a/static/share/fbbutton.png +++ b/static/img/share/fbbutton.png diff --git a/static/share/fbicon.gif b/static/img/share/fbicon.gif Binary files differindex f13b2bf..f13b2bf 100644 --- a/static/share/fbicon.gif +++ b/static/img/share/fbicon.gif diff --git a/static/share/tumblricon.gif b/static/img/share/tumblricon.gif Binary files differindex 40e2b35..40e2b35 100644 --- a/static/share/tumblricon.gif +++ b/static/img/share/tumblricon.gif diff --git a/static/share/tumblricon.png b/static/img/share/tumblricon.png Binary files differindex 61a8910..61a8910 100644 --- a/static/share/tumblricon.png +++ b/static/img/share/tumblricon.png diff --git a/static/share/twittericon.gif b/static/img/share/twittericon.gif Binary files differindex c6902f6..c6902f6 100644 --- a/static/share/twittericon.gif +++ b/static/img/share/twittericon.gif diff --git a/static/share/twittericon.png b/static/img/share/twittericon.png Binary files differindex 662c731..662c731 100644 --- a/static/share/twittericon.png +++ b/static/img/share/twittericon.png diff --git a/static/sitesearchhelp.png b/static/img/sitesearchhelp.png Binary files differindex c6f810e..c6f810e 100644 --- a/static/sitesearchhelp.png +++ b/static/img/sitesearchhelp.png diff --git a/static/img/thumbs_up_sm.gif b/static/img/thumbs_up_sm.gif Binary files differdeleted file mode 100644 index b039245..0000000 --- a/static/img/thumbs_up_sm.gif +++ /dev/null diff --git a/static/trophyicon.gif b/static/img/trophyicon.gif Binary files differindex faf68ef..faf68ef 100644 --- a/static/trophyicon.gif +++ b/static/img/trophyicon.gif diff --git a/static/uploadbuttonhelp.png b/static/img/uploadbuttonhelp.png Binary files differindex ffc8ebe..ffc8ebe 100644 --- a/static/uploadbuttonhelp.png +++ b/static/img/uploadbuttonhelp.png diff --git a/static/webcambuttonhelp.png b/static/img/webcambuttonhelp.png Binary files differindex 5d98228..5d98228 100644 --- a/static/webcambuttonhelp.png +++ b/static/img/webcambuttonhelp.png diff --git a/static/index.css b/static/index.css deleted file mode 100644 index bae708e..0000000 --- a/static/index.css +++ /dev/null @@ -1,231 +0,0 @@ - - - -body { - background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; - background-repeat:repeat-x; - background-position:top; - margin:6%; -} -#preload { - position: absolute; - left: 0px; - top: 0px; -} -#main { - width:460px; - margin: 0 auto 0 auto; - padding: 19px 0; - border-radius: 15px; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border:solid 2px #000; - position: relative; - box-shadow: 0 0 10px #d8dbde, 0px 0px 10px #d8dbde; - -webkit-box-shadow: 0 0 10px #d8dbde, 0px 0px 10px #d8dbde; - -moz-box-shadow: 0 0 10px #d8dbde, 0px 0px 10px #d8dbde; -} -#logo-and-text { - position: relative; - z-index: 20; - padding-bottom: 20px; -} - -#horse { - position: absolute; - z-index: 10; - top: 12px; - left: 140px; -} -#remember{ - -} -#customer { - position: absolute; - left: -90px; - top: -75px; - z-index: 10; - -} -#info { - width:420px; - margin: 11px auto -1px auto; -opacity:0.9; -height:30; - vertical-align: bottom; -} -#dumpednow{ -position:absolute; -height:50px; -width:420px; -top:0px; -} - -p { - font-family: Arial, Helvetica, sans-serif; - font-size: 24px; -} - -.btnav { border: 0px #000 solid;} - -.submit { - - text-shadow: -1px 1px 1px #ccc; - font-size:15px; -} - -input { - height:40px; - width:300px; - border:3px #000; - background:#e3e3e3; - margin:10px; - color:#000; - font-size:30px; - -} -.txt { - font-family:Arial, Helvetica, sans-serif; - font-size:14px; -line-height:1.2; - text-shadow:1px 1px 0.5px #ccc; - word-spacing: 3px; -} - .line { - font-family:Arial, Helvetica, sans-serif; - letter-spacing:0px; -line-height:-1; - color:#000; - font-size:17px; -} - -.no-cursor { cursor: none; } -.invisible { display: none !important; } -#cursor-big { position: absolute; z-index: 1000; } - -#signin-submit { - display:inline-block; - width:300px; - height:33px; - font-size:20px; - background-image:url(/static/btngrad1.png); - font-weight:bold; - word-spacing:7; - margin-top:12px; - text-align:center; - z-index:100; - font-size:16px; - color:#fff; - text-shadow:1px 1px 3px #000; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px;*/ - border:solid 1px #eee; -} - -#remembermeInput { - width: 15px; - height: 15px; - margin: 1px; -} - -label { - display: block; - width: 300px; - text-align: right; - font-size: 16px; - color: #222; -} - -/*_____________________________________________ Start - Projects - jCarouselLite _____________________________________________*/ - -#jCarouselLite .carousel { - padding: 10px 0 0 0; - margin: 0 0 20px 10px; - position: relative; -} - #jCarouselLite .digg { - position: absolute; - left: 610px; - top: 110px; - } - #jCarouselLite .main { - margin-left: 40px; - } - - #jCarouselLite .demo em { - color: #FF3300; - font-weight: bold; - font-size: 60%; - font-style: normal; - } - #jCarouselLite .carousel button { /*Don't remove this. we still use this for individual demos. only the front pages use images as of now*/ - float: left; - } - #jCarouselLite .carousel a.prev, #jCarouselLite .carousel a.next { - display: block; - float: left; - width: 30px; - height: 143px; - text-decoration: none; - background: url("/image/imageNavLeft.gif") left 60px no-repeat; - } - #jCarouselLite .carousel a.next { - background: url("/image/imageNavRight.gif") right 60px no-repeat; - } - #jCarouselLite .carousel a.next:hover { - background-image: url("/image/imageNavRightHover.gif"); - } - #jCarouselLite .carousel a.prev:hover { - background-image: url("/image/imageNavLeftHover.gif"); - } - #jCarouselLite .carousel a:hover, #jCarouselLite .carousel a:active { - border: none; - outline: none; - } - #jCarouselLite .carousel .jCarouselLite { - border: 1px solid black; - float: left; - background-color: #dfdfdf; - - /* Needed for rendering without flicker */ - position: relative; - visibility: hidden; - left: -5000px; - } - #jCarouselLite .carousel ul { - margin: 0; - } - #jCarouselLite .carousel li img, - #jCarouselLite .carousel li p { - background-color: #fff; - width: 150px; - height: 118px; - margin: 10px; - } - - #jCarouselLite .widget img { - cursor: pointer; - } - #jCarouselLite .mid { - margin-left: 80px; - width: 400px; - height: 300px; - } - #jCarouselLite .vertical { - margin-left: 170px; - } - #jCarouselLite .vertical .jCarouselLite { /* so that in IE 6, the carousel div doesnt expand to fill the space */ - width: 170px; - } - #jCarouselLite .imageSlider li img, - #jCarouselLite .imageSlider li p, - #jCarouselLite .imageSliderExt li img , - #jCarouselLite .imageSliderExt li p { - width: 400px; - height: 300px; - } - -/*_____________________________________________ End - Projects - jCarouselLite _____________________________________________*/ - - diff --git a/static/jewel.gif b/static/jewel.gif Binary files differdeleted file mode 100644 index 8acdebf..0000000 --- a/static/jewel.gif +++ /dev/null diff --git a/static/jewelblu.gif b/static/jewelblu.gif Binary files differdeleted file mode 100644 index 9868b02..0000000 --- a/static/jewelblu.gif +++ /dev/null diff --git a/static/jquery.datePicker.js b/static/jquery.datePicker.js deleted file mode 100644 index 7cc48e1..0000000 --- a/static/jquery.datePicker.js +++ /dev/null @@ -1,1189 +0,0 @@ -/** - * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * . - * $Id: jquery.datePicker.js 84 2009-08-05 17:54:35Z kelvin.luck@gmail.com $ - **/ - -(function($){ - - $.fn.extend({ -/** - * Render a calendar table into any matched elements. - * - * @param Object s (optional) Customize your calendars. - * @option Number month The month to render (NOTE that months are zero based). Default is today's month. - * @option Number year The year to render. Default is today's year. - * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback. - * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT. - * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class. - * @type jQuery - * @name renderCalendar - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('#calendar-me').renderCalendar({month:0, year:2007}); - * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. - * - * @example - * var testCallback = function($td, thisDate, month, year) - * { - * if ($td.is('.current-month') && thisDate.getDay() == 4) { - * var d = thisDate.getDate(); - * $td.bind( - * 'click', - * function() - * { - * alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year); - * } - * ).addClass('thursday'); - * } else if (thisDate.getDay() == 5) { - * $td.html('Friday the ' + $td.html() + 'th'); - * } - * } - * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback}); - * - * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text. - **/ - renderCalendar : function(s) - { - var dc = function(a) - { - return document.createElement(a); - }; - - s = $.extend({}, $.fn.datePicker.defaults, s); - - if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) { - var headRow = $(dc('tr')); - for (var i=Date.firstDayOfWeek; i<Date.firstDayOfWeek+7; i++) { - var weekday = i%7; - var day = Date.dayNames[weekday]; - headRow.append( - jQuery(dc('th')).attr({'scope':'col', 'abbr':day, 'title':day, 'class':(weekday == 0 || weekday == 6 ? 'weekend' : 'weekday')}).html(s.showHeader == $.dpConst.SHOW_HEADER_SHORT ? day.substr(0, 1) : day) - ); - } - }; - - var calendarTable = $(dc('table')) - .attr( - { - 'cellspacing':2 - } - ) - .addClass('jCalendar') - .append( - (s.showHeader != $.dpConst.SHOW_HEADER_NONE ? - $(dc('thead')) - .append(headRow) - : - dc('thead') - ) - ); - var tbody = $(dc('tbody')); - - var today = (new Date()).zeroTime(); - today.setHours(12); - - var month = s.month == undefined ? today.getMonth() : s.month; - var year = s.year || today.getFullYear(); - - var currentDate = (new Date(year, month, 1, 12, 0, 0)); - - - var firstDayOffset = Date.firstDayOfWeek - currentDate.getDay() + 1; - if (firstDayOffset > 1) firstDayOffset -= 7; - var weeksToDraw = Math.ceil(( (-1*firstDayOffset+1) + currentDate.getDaysInMonth() ) /7); - currentDate.addDays(firstDayOffset-1); - - var doHover = function(firstDayInBounds) - { - return function() - { - if (s.hoverClass) { - var $this = $(this); - if (!s.selectWeek) { - $this.addClass(s.hoverClass); - } else if (firstDayInBounds && !$this.is('.disabled')) { - $this.parent().addClass('activeWeekHover'); - } - } - } - }; - var unHover = function() - { - if (s.hoverClass) { - var $this = $(this); - $this.removeClass(s.hoverClass); - $this.parent().removeClass('activeWeekHover'); - } - }; - - var w = 0; - while (w++<weeksToDraw) { - var r = jQuery(dc('tr')); - var firstDayInBounds = s.dpController ? currentDate > s.dpController.startDate : false; - for (var i=0; i<7; i++) { - var thisMonth = currentDate.getMonth() == month; - var d = $(dc('td')) - .text(currentDate.getDate() + '') - .addClass((thisMonth ? 'current-month ' : 'other-month ') + - (currentDate.isWeekend() ? 'weekend ' : 'weekday ') + - (thisMonth && currentDate.getTime() == today.getTime() ? 'today ' : '') - ) - .data('datePickerDate', currentDate.asString()) - .hover(doHover(firstDayInBounds), unHover) - ; - r.append(d); - if (s.renderCallback) { - s.renderCallback(d, currentDate, month, year); - } - // addDays(1) fails in some locales due to daylight savings. See issue 39. - //currentDate.addDays(1); - // set the time to midday to avoid any weird timezone issues?? - currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1, 12, 0, 0); - } - tbody.append(r); - } - calendarTable.append(tbody); - - return this.each( - function() - { - $(this).empty().append(calendarTable); - } - ); - }, -/** - * Create a datePicker associated with each of the matched elements. - * - * The matched element will receive a few custom events with the following signatures: - * - * dateSelected(event, date, $td, status) - * Triggered when a date is selected. event is a reference to the event, date is the Date selected, $td is a jquery object wrapped around the TD that was clicked on and status is whether the date was selected (true) or deselected (false) - * - * dpClosed(event, selected) - * Triggered when the date picker is closed. event is a reference to the event and selected is an Array containing Date objects. - * - * dpMonthChanged(event, displayedMonth, displayedYear) - * Triggered when the month of the popped up calendar is changed. event is a reference to the event, displayedMonth is the number of the month now displayed (zero based) and displayedYear is the year of the month. - * - * dpDisplayed(event, $datePickerDiv) - * Triggered when the date picker is created. $datePickerDiv is the div containing the date picker. Use this event to add custom content/ listeners to the popped up date picker. - * - * @param Object s (optional) Customize your date pickers. - * @option Number month The month to render when the date picker is opened (NOTE that months are zero based). Default is today's month. - * @option Number year The year to render when the date picker is opened. Default is today's year. - * @option String startDate The first date date can be selected. - * @option String endDate The last date that can be selected. - * @option Boolean inline Whether to create the datePicker as inline (e.g. always on the page) or as a model popup. Default is false (== modal popup) - * @option Boolean createButton Whether to create a .dp-choose-date anchor directly after the matched element which when clicked will trigger the showing of the date picker. Default is true. - * @option Boolean showYearNavigation Whether to display buttons which allow the user to navigate through the months a year at a time. Default is true. - * @option Boolean closeOnSelect Whether to close the date picker when a date is selected. Default is true. - * @option Boolean displayClose Whether to create a "Close" button within the date picker popup. Default is false. - * @option Boolean selectMultiple Whether a user should be able to select multiple dates with this date picker. Default is false. - * @option Number numSelectable The maximum number of dates that can be selected where selectMultiple is true. Default is a very high number. - * @option Boolean clickInput If the matched element is an input type="text" and this option is true then clicking on the input will cause the date picker to appear. - * @option Boolean rememberViewedMonth Whether the datePicker should remember the last viewed month and open on it. If false then the date picker will always open with the month for the first selected date visible. - * @option Boolean selectWeek Whether to select a complete week at a time... - * @option Number verticalPosition The vertical alignment of the popped up date picker to the matched element. One of $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM. Default is $.dpConst.POS_TOP. - * @option Number horizontalPosition The horizontal alignment of the popped up date picker to the matched element. One of $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT. - * @option Number verticalOffset The number of pixels offset from the defined verticalPosition of this date picker that it should pop up in. Default in 0. - * @option Number horizontalOffset The number of pixels offset from the defined horizontalPosition of this date picker that it should pop up in. Default in 0. - * @option (Function|Array) renderCallback A reference to a function (or an array of seperate functions) that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Each callback function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. Default is no callback. - * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class. - * @type jQuery - * @name datePicker - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('input.date-picker').datePicker(); - * @desc Creates a date picker button next to all matched input elements. When the button is clicked on the value of the selected date will be placed in the corresponding input (formatted according to Date.format). - * - * @example demo/index.html - * @desc See the projects homepage for many more complex examples... - **/ - datePicker : function(s) - { - if (!$.event._dpCache) $.event._dpCache = []; - - // initialise the date picker controller with the relevant settings... - s = $.extend({}, $.fn.datePicker.defaults, s); - - return this.each( - function() - { - var $this = $(this); - var alreadyExists = true; - - if (!this._dpId) { - this._dpId = $.event.guid++; - $.event._dpCache[this._dpId] = new DatePicker(this); - alreadyExists = false; - } - - if (s.inline) { - s.createButton = false; - s.displayClose = false; - s.closeOnSelect = false; - $this.empty(); - } - - var controller = $.event._dpCache[this._dpId]; - - controller.init(s); - - if (!alreadyExists && s.createButton) { - // create it! - controller.button = $('<a href="#" class="dp-choose-date" title="' + $.dpText.TEXT_CHOOSE_DATE + '">' + $.dpText.TEXT_CHOOSE_DATE + '</a>') - .bind( - 'click', - function() - { - $this.dpDisplay(this); - this.blur(); - return false; - } - ); - $this.after(controller.button); - } - - if (!alreadyExists && $this.is(':text')) { - $this - .bind( - 'dateSelected', - function(e, selectedDate, $td) - { - this.value = selectedDate.asString(); - } - ).bind( - 'change', - function() - { - if (this.value == '') { - controller.clearSelected(); - } else { - var d = Date.fromString(this.value); - if (d) { - controller.setSelected(d, true, true); - } - } - } - ); - if (s.clickInput) { - $this.bind( - 'click', - function() - { - // The change event doesn't happen until the input loses focus so we need to manually trigger it... - $this.trigger('change'); - $this.dpDisplay(); - } - ); - } - var d = Date.fromString(this.value); - if (this.value != '' && d) { - controller.setSelected(d, true, true); - } - } - - $this.addClass('dp-applied'); - - } - ) - }, -/** - * Disables or enables this date picker - * - * @param Boolean s Whether to disable (true) or enable (false) this datePicker - * @type jQuery - * @name dpSetDisabled - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * $('.date-picker').dpSetDisabled(true); - * @desc Prevents this date picker from displaying and adds a class of dp-disabled to it (and it's associated button if it has one) for styling purposes. If the matched element is an input field then it will also set the disabled attribute to stop people directly editing the field. - **/ - dpSetDisabled : function(s) - { - return _w.call(this, 'setDisabled', s); - }, -/** - * Updates the first selectable date for any date pickers on any matched elements. - * - * @param String d A string representing the first selectable date (formatted according to Date.format). - * @type jQuery - * @name dpSetStartDate - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * $('.date-picker').dpSetStartDate('01/01/2000'); - * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the first selectable date for each of these to the first day of the millenium. - **/ - dpSetStartDate : function(d) - { - return _w.call(this, 'setStartDate', d); - }, -/** - * Updates the last selectable date for any date pickers on any matched elements. - * - * @param String d A string representing the last selectable date (formatted according to Date.format). - * @type jQuery - * @name dpSetEndDate - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * $('.date-picker').dpSetEndDate('01/01/2010'); - * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the last selectable date for each of these to the first Janurary 2010. - **/ - dpSetEndDate : function(d) - { - return _w.call(this, 'setEndDate', d); - }, -/** - * Gets a list of Dates currently selected by this datePicker. This will be an empty array if no dates are currently selected or NULL if there is no datePicker associated with the matched element. - * - * @type Array - * @name dpGetSelected - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * alert($('.date-picker').dpGetSelected()); - * @desc Will alert an empty array (as nothing is selected yet) - **/ - dpGetSelected : function() - { - var c = _getController(this[0]); - if (c) { - return c.getSelected(); - } - return null; - }, -/** - * Selects or deselects a date on any matched element's date pickers. Deselcting is only useful on date pickers where selectMultiple==true. Selecting will only work if the passed date is within the startDate and endDate boundries for a given date picker. - * - * @param String d A string representing the date you want to select (formatted according to Date.format). - * @param Boolean v Whether you want to select (true) or deselect (false) this date. Optional - default = true. - * @param Boolean m Whether you want the date picker to open up on the month of this date when it is next opened. Optional - default = true. - * @param Boolean e Whether you want the date picker to dispatch events related to this change of selection. Optional - default = true. - * @type jQuery - * @name dpSetSelected - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * $('.date-picker').dpSetSelected('01/01/2010'); - * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010. - **/ - dpSetSelected : function(d, v, m, e) - { - if (v == undefined) v=true; - if (m == undefined) m=true; - if (e == undefined) e=true; - return _w.call(this, 'setSelected', Date.fromString(d), v, m, e); - }, -/** - * Sets the month that will be displayed when the date picker is next opened. If the passed month is before startDate then the month containing startDate will be displayed instead. If the passed month is after endDate then the month containing the endDate will be displayed instead. - * - * @param Number m The month you want the date picker to display. Optional - defaults to the currently displayed month. - * @param Number y The year you want the date picker to display. Optional - defaults to the currently displayed year. - * @type jQuery - * @name dpSetDisplayedMonth - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-picker').datePicker(); - * $('.date-picker').dpSetDisplayedMonth(10, 2008); - * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010. - **/ - dpSetDisplayedMonth : function(m, y) - { - return _w.call(this, 'setDisplayedMonth', Number(m), Number(y), true); - }, -/** - * Displays the date picker associated with the matched elements. Since only one date picker can be displayed at once then the date picker associated with the last matched element will be the one that is displayed. - * - * @param HTMLElement e An element that you want the date picker to pop up relative in position to. Optional - default behaviour is to pop up next to the element associated with this date picker. - * @type jQuery - * @name dpDisplay - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('#date-picker').datePicker(); - * $('#date-picker').dpDisplay(); - * @desc Creates a date picker associated with the element with an id of date-picker and then causes it to pop up. - **/ - dpDisplay : function(e) - { - return _w.call(this, 'display', e); - }, -/** - * Sets a function or array of functions that is called when each TD of the date picker popup is rendered to the page - * - * @param (Function|Array) a A function or an array of functions that are called when each td is rendered. Each function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. - * @type jQuery - * @name dpSetRenderCallback - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('#date-picker').datePicker(); - * $('#date-picker').dpSetRenderCallback(function($td, thisDate, month, year) - * { - * // do stuff as each td is rendered dependant on the date in the td and the displayed month and year - * }); - * @desc Creates a date picker associated with the element with an id of date-picker and then creates a function which is called as each td is rendered when this date picker is displayed. - **/ - dpSetRenderCallback : function(a) - { - return _w.call(this, 'setRenderCallback', a); - }, -/** - * Sets the position that the datePicker will pop up (relative to it's associated element) - * - * @param Number v The vertical alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM - * @param Number h The horizontal alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT - * @type jQuery - * @name dpSetPosition - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('#date-picker').datePicker(); - * $('#date-picker').dpSetPosition($.dpConst.POS_BOTTOM, $.dpConst.POS_RIGHT); - * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be bottom and right aligned to the #date-picker element. - **/ - dpSetPosition : function(v, h) - { - return _w.call(this, 'setPosition', v, h); - }, -/** - * Sets the offset that the popped up date picker will have from it's default position relative to it's associated element (as set by dpSetPosition) - * - * @param Number v The vertical offset of the created date picker. - * @param Number h The horizontal offset of the created date picker. - * @type jQuery - * @name dpSetOffset - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('#date-picker').datePicker(); - * $('#date-picker').dpSetOffset(-20, 200); - * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be 20 pixels above and 200 pixels to the right of it's default position. - **/ - dpSetOffset : function(v, h) - { - return _w.call(this, 'setOffset', v, h); - }, -/** - * Closes the open date picker associated with this element. - * - * @type jQuery - * @name dpClose - * @cat plugins/datePicker - * @author Kelvin Luck (http://www.kelvinluck.com/) - * - * @example $('.date-pick') - * .datePicker() - * .bind( - * 'focus', - * function() - * { - * $(this).dpDisplay(); - * } - * ).bind( - * 'blur', - * function() - * { - * $(this).dpClose(); - * } - * ); - * @desc Creates a date picker and makes it appear when the relevant element is focused and disappear when it is blurred. - **/ - dpClose : function() - { - return _w.call(this, '_closeCalendar', false, this[0]); - }, - // private function called on unload to clean up any expandos etc and prevent memory links... - _dpDestroy : function() - { - // TODO - implement this? - } - }); - - // private internal function to cut down on the amount of code needed where we forward - // dp* methods on the jQuery object on to the relevant DatePicker controllers... - var _w = function(f, a1, a2, a3, a4) - { - return this.each( - function() - { - var c = _getController(this); - if (c) { - c[f](a1, a2, a3, a4); - } - } - ); - }; - - function DatePicker(ele) - { - this.ele = ele; - - // initial values... - this.displayedMonth = null; - this.displayedYear = null; - this.startDate = null; - this.endDate = null; - this.showYearNavigation = null; - this.closeOnSelect = null; - this.displayClose = null; - this.rememberViewedMonth= null; - this.selectMultiple = null; - this.numSelectable = null; - this.numSelected = null; - this.verticalPosition = null; - this.horizontalPosition = null; - this.verticalOffset = null; - this.horizontalOffset = null; - this.button = null; - this.renderCallback = []; - this.selectedDates = {}; - this.inline = null; - this.context = '#dp-popup'; - this.settings = {}; - }; - $.extend( - DatePicker.prototype, - { - init : function(s) - { - this.setStartDate(s.startDate); - this.setEndDate(s.endDate); - this.setDisplayedMonth(Number(s.month), Number(s.year)); - this.setRenderCallback(s.renderCallback); - this.showYearNavigation = s.showYearNavigation; - this.closeOnSelect = s.closeOnSelect; - this.displayClose = s.displayClose; - this.rememberViewedMonth = s.rememberViewedMonth; - this.selectMultiple = s.selectMultiple; - this.numSelectable = s.selectMultiple ? s.numSelectable : 1; - this.numSelected = 0; - this.verticalPosition = s.verticalPosition; - this.horizontalPosition = s.horizontalPosition; - this.hoverClass = s.hoverClass; - this.setOffset(s.verticalOffset, s.horizontalOffset); - this.inline = s.inline; - this.settings = s; - if (this.inline) { - this.context = this.ele; - this.display(); - } - }, - setStartDate : function(d) - { - if (d) { - this.startDate = Date.fromString(d); - } - if (!this.startDate) { - this.startDate = (new Date()).zeroTime(); - } - this.setDisplayedMonth(this.displayedMonth, this.displayedYear); - }, - setEndDate : function(d) - { - if (d) { - this.endDate = Date.fromString(d); - } - if (!this.endDate) { - this.endDate = (new Date('12/31/2999')); // using the JS Date.parse function which expects mm/dd/yyyy - } - if (this.endDate.getTime() < this.startDate.getTime()) { - this.endDate = this.startDate; - } - this.setDisplayedMonth(this.displayedMonth, this.displayedYear); - }, - setPosition : function(v, h) - { - this.verticalPosition = v; - this.horizontalPosition = h; - }, - setOffset : function(v, h) - { - this.verticalOffset = parseInt(v) || 0; - this.horizontalOffset = parseInt(h) || 0; - }, - setDisabled : function(s) - { - $e = $(this.ele); - $e[s ? 'addClass' : 'removeClass']('dp-disabled'); - if (this.button) { - $but = $(this.button); - $but[s ? 'addClass' : 'removeClass']('dp-disabled'); - $but.attr('title', s ? '' : $.dpText.TEXT_CHOOSE_DATE); - } - if ($e.is(':text')) { - $e.attr('disabled', s ? 'disabled' : ''); - } - }, - setDisplayedMonth : function(m, y, rerender) - { - if (this.startDate == undefined || this.endDate == undefined) { - return; - } - var s = new Date(this.startDate.getTime()); - s.setDate(1); - var e = new Date(this.endDate.getTime()); - e.setDate(1); - - var t; - if ((!m && !y) || (isNaN(m) && isNaN(y))) { - // no month or year passed - default to current month - t = new Date().zeroTime(); - t.setDate(1); - } else if (isNaN(m)) { - // just year passed in - presume we want the displayedMonth - t = new Date(y, this.displayedMonth, 1); - } else if (isNaN(y)) { - // just month passed in - presume we want the displayedYear - t = new Date(this.displayedYear, m, 1); - } else { - // year and month passed in - that's the date we want! - t = new Date(y, m, 1) - } - // check if the desired date is within the range of our defined startDate and endDate - if (t.getTime() < s.getTime()) { - t = s; - } else if (t.getTime() > e.getTime()) { - t = e; - } - var oldMonth = this.displayedMonth; - var oldYear = this.displayedYear; - this.displayedMonth = t.getMonth(); - this.displayedYear = t.getFullYear(); - - if (rerender && (this.displayedMonth != oldMonth || this.displayedYear != oldYear)) - { - this._rerenderCalendar(); - $(this.ele).trigger('dpMonthChanged', [this.displayedMonth, this.displayedYear]); - } - }, - setSelected : function(d, v, moveToMonth, dispatchEvents) - { - if (d < this.startDate || d > this.endDate) { - // Don't allow people to select dates outside range... - return; - } - var s = this.settings; - if (s.selectWeek) - { - d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7); - if (d < this.startDate) // The first day of this week is before the start date so is unselectable... - { - return; - } - } - if (v == this.isSelected(d)) // this date is already un/selected - { - return; - } - if (this.selectMultiple == false) { - this.clearSelected(); - } else if (v && this.numSelected == this.numSelectable) { - // can't select any more dates... - return; - } - if (moveToMonth && (this.displayedMonth != d.getMonth() || this.displayedYear != d.getFullYear())) { - this.setDisplayedMonth(d.getMonth(), d.getFullYear(), true); - } - this.selectedDates[d.asString()] = v; - this.numSelected += v ? 1 : -1; - var selectorString = 'td.' + (d.getMonth() == this.displayedMonth ? 'current-month' : 'other-month'); - var $td; - $(selectorString, this.context).each( - function() - { - if ($(this).data('datePickerDate') == d.asString()) { - $td = $(this); - if (s.selectWeek) - { - $td.parent()[v ? 'addClass' : 'removeClass']('selectedWeek'); - } - $td[v ? 'addClass' : 'removeClass']('selected'); - } - } - ); - $('td', this.context).not('.selected')[this.selectMultiple && this.numSelected == this.numSelectable ? 'addClass' : 'removeClass']('unselectable'); - - if (dispatchEvents) - { - var s = this.isSelected(d); - $e = $(this.ele); - var dClone = Date.fromString(d.asString()); - $e.trigger('dateSelected', [dClone, $td, s]); - $e.trigger('change'); - } - }, - isSelected : function(d) - { - return this.selectedDates[d.asString()]; - }, - getSelected : function() - { - var r = []; - for(s in this.selectedDates) { - if (this.selectedDates[s] == true) { - r.push(Date.fromString(s)); - } - } - return r; - }, - clearSelected : function() - { - this.selectedDates = {}; - this.numSelected = 0; - $('td.selected', this.context).removeClass('selected').parent().removeClass('selectedWeek'); - }, - display : function(eleAlignTo) - { - if ($(this.ele).is('.dp-disabled')) return; - - eleAlignTo = eleAlignTo || this.ele; - var c = this; - var $ele = $(eleAlignTo); - var eleOffset = $ele.offset(); - - var $createIn; - var attrs; - var attrsCalendarHolder; - var cssRules; - - if (c.inline) { - $createIn = $(this.ele); - attrs = { - 'id' : 'calendar-' + this.ele._dpId, - 'class' : 'dp-popup dp-popup-inline' - }; - - $('.dp-popup', $createIn).remove(); - cssRules = { - }; - } else { - $createIn = $('body'); - attrs = { - 'id' : 'dp-popup', - 'class' : 'dp-popup' - }; - cssRules = { - 'top' : eleOffset.top + c.verticalOffset, - 'left' : eleOffset.left + c.horizontalOffset - }; - - var _checkMouse = function(e) - { - var el = e.target; - var cal = $('#dp-popup')[0]; - - while (true){ - if (el == cal) { - return true; - } else if (el == document) { - c._closeCalendar(); - return false; - } else { - el = $(el).parent()[0]; - } - } - }; - this._checkMouse = _checkMouse; - - c._closeCalendar(true); - $(document).bind( - 'keydown.datepicker', - function(event) - { - if (event.keyCode == 27) { - c._closeCalendar(); - } - } - ); - } - - if (!c.rememberViewedMonth) - { - var selectedDate = this.getSelected()[0]; - if (selectedDate) { - selectedDate = new Date(selectedDate); - this.setDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear(), false); - } - } - - $createIn - .append( - $('<div></div>') - .attr(attrs) - .css(cssRules) - .append( -// $('<a href="#" class="selecteee">aaa</a>'), - $('<h2></h2>'), - $('<div class="dp-nav-prev"></div>') - .append( - $('<a class="dp-nav-prev-year" href="#" title="' + $.dpText.TEXT_PREV_YEAR + '"><<</a>') - .bind( - 'click', - function() - { - return c._displayNewMonth.call(c, this, 0, -1); - } - ), - $('<a class="dp-nav-prev-month" href="#" title="' + $.dpText.TEXT_PREV_MONTH + '"><</a>') - .bind( - 'click', - function() - { - return c._displayNewMonth.call(c, this, -1, 0); - } - ) - ), - $('<div class="dp-nav-next"></div>') - .append( - $('<a class="dp-nav-next-year" href="#" title="' + $.dpText.TEXT_NEXT_YEAR + '">>></a>') - .bind( - 'click', - function() - { - return c._displayNewMonth.call(c, this, 0, 1); - } - ), - $('<a class="dp-nav-next-month" href="#" title="' + $.dpText.TEXT_NEXT_MONTH + '">></a>') - .bind( - 'click', - function() - { - return c._displayNewMonth.call(c, this, 1, 0); - } - ) - ), - $('<div class="dp-calendar"></div>') - ) - .bgIframe() - ); - - var $pop = this.inline ? $('.dp-popup', this.context) : $('#dp-popup'); - - if (this.showYearNavigation == false) { - $('.dp-nav-prev-year, .dp-nav-next-year', c.context).css('display', 'none'); - } - if (this.displayClose) { - $pop.append( - $('<a href="#" id="dp-close">' + $.dpText.TEXT_CLOSE + '</a>') - .bind( - 'click', - function() - { - c._closeCalendar(); - return false; - } - ) - ); - } - c._renderCalendar(); - - $(this.ele).trigger('dpDisplayed', $pop); - - if (!c.inline) { - if (this.verticalPosition == $.dpConst.POS_BOTTOM) { - $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset); - } - if (this.horizontalPosition == $.dpConst.POS_RIGHT) { - $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset); - } -// $('.selectee', this.context).focus(); - $(document).bind('mousedown.datepicker', this._checkMouse); - } - - }, - setRenderCallback : function(a) - { - if (a == null) return; - if (a && typeof(a) == 'function') { - a = [a]; - } - this.renderCallback = this.renderCallback.concat(a); - }, - cellRender : function ($td, thisDate, month, year) { - var c = this.dpController; - var d = new Date(thisDate.getTime()); - - // add our click handlers to deal with it when the days are clicked... - - $td.bind( - 'click', - function() - { - var $this = $(this); - if (!$this.is('.disabled')) { - c.setSelected(d, !$this.is('.selected') || !c.selectMultiple, false, true); - if (c.closeOnSelect) { - c._closeCalendar(); - } - // TODO: Instead of this which doesn't work in IE anyway we should find the next focusable element in the document - // and pass the focus onto that. That would allow the user to continue on the form as expected... - if (!$.browser.msie) - { - $(c.ele).trigger('focus', [$.dpConst.DP_INTERNAL_FOCUS]); - } - } - } - ); - if (c.isSelected(d)) { - $td.addClass('selected'); - if (c.settings.selectWeek) - { - $td.parent().addClass('selectedWeek'); - } - } else if (c.selectMultiple && c.numSelected == c.numSelectable) { - $td.addClass('unselectable'); - } - - }, - _applyRenderCallbacks : function() - { - var c = this; - $('td', this.context).each( - function() - { - for (var i=0; i<c.renderCallback.length; i++) { - $td = $(this); - c.renderCallback[i].apply(this, [$td, Date.fromString($td.data('datePickerDate')), c.displayedMonth, c.displayedYear]); - } - } - ); - return; - }, - // ele is the clicked button - only proceed if it doesn't have the class disabled... - // m and y are -1, 0 or 1 depending which direction we want to go in... - _displayNewMonth : function(ele, m, y) - { - if (!$(ele).is('.disabled')) { - this.setDisplayedMonth(this.displayedMonth + m, this.displayedYear + y, true); - } - ele.blur(); - return false; - }, - _rerenderCalendar : function() - { - this._clearCalendar(); - this._renderCalendar(); - }, - _renderCalendar : function() - { - // set the title... - $('h2', this.context).html((new Date(this.displayedYear, this.displayedMonth, 1)).asString($.dpText.HEADER_FORMAT)); - - // render the calendar... - $('.dp-calendar', this.context).renderCalendar( - $.extend( - {}, - this.settings, - { - month : this.displayedMonth, - year : this.displayedYear, - renderCallback : this.cellRender, - dpController : this, - hoverClass : this.hoverClass - }) - ); - - // update the status of the control buttons and disable dates before startDate or after endDate... - // TODO: When should the year buttons be disabled? When you can't go forward a whole year from where you are or is that annoying? - if (this.displayedYear == this.startDate.getFullYear() && this.displayedMonth == this.startDate.getMonth()) { - $('.dp-nav-prev-year', this.context).addClass('disabled'); - $('.dp-nav-prev-month', this.context).addClass('disabled'); - $('.dp-calendar td.other-month', this.context).each( - function() - { - var $this = $(this); - if (Number($this.text()) > 20) { - $this.addClass('disabled'); - } - } - ); - var d = this.startDate.getDate(); - $('.dp-calendar td.current-month', this.context).each( - function() - { - var $this = $(this); - if (Number($this.text()) < d) { - $this.addClass('disabled'); - } - } - ); - } else { - $('.dp-nav-prev-year', this.context).removeClass('disabled'); - $('.dp-nav-prev-month', this.context).removeClass('disabled'); - var d = this.startDate.getDate(); - if (d > 20) { - // check if the startDate is last month as we might need to add some disabled classes... - var st = this.startDate.getTime(); - var sd = new Date(st); - sd.addMonths(1); - if (this.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) { - $('.dp-calendar td.other-month', this.context).each( - function() - { - var $this = $(this); - if (Date.fromString($this.data('datePickerDate')).getTime() < st) { - $this.addClass('disabled'); - } - } - ); - } - } - } - if (this.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) { - $('.dp-nav-next-year', this.context).addClass('disabled'); - $('.dp-nav-next-month', this.context).addClass('disabled'); - $('.dp-calendar td.other-month', this.context).each( - function() - { - var $this = $(this); - if (Number($this.text()) < 14) { - $this.addClass('disabled'); - } - } - ); - var d = this.endDate.getDate(); - $('.dp-calendar td.current-month', this.context).each( - function() - { - var $this = $(this); - if (Number($this.text()) > d) { - $this.addClass('disabled'); - } - } - ); - } else { - $('.dp-nav-next-year', this.context).removeClass('disabled'); - $('.dp-nav-next-month', this.context).removeClass('disabled'); - var d = this.endDate.getDate(); - if (d < 13) { - // check if the endDate is next month as we might need to add some disabled classes... - var ed = new Date(this.endDate.getTime()); - ed.addMonths(-1); - if (this.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) { - $('.dp-calendar td.other-month', this.context).each( - function() - { - var $this = $(this); - var cellDay = Number($this.text()); - if (cellDay < 13 && cellDay > d) { - $this.addClass('disabled'); - } - } - ); - } - } - } - this._applyRenderCallbacks(); - }, - _closeCalendar : function(programatic, ele) - { - if (!ele || ele == this.ele) - { - $(document).unbind('mousedown.datepicker'); - $(document).unbind('keydown.datepicker'); - this._clearCalendar(); - $('#dp-popup a').unbind(); - $('#dp-popup').empty().remove(); - if (!programatic) { - $(this.ele).trigger('dpClosed', [this.getSelected()]); - } - } - }, - // empties the current dp-calendar div and makes sure that all events are unbound - // and expandos removed to avoid memory leaks... - _clearCalendar : function() - { - // TODO. - $('.dp-calendar td', this.context).unbind(); - $('.dp-calendar', this.context).empty(); - } - } - ); - - // static constants - $.dpConst = { - SHOW_HEADER_NONE : 0, - SHOW_HEADER_SHORT : 1, - SHOW_HEADER_LONG : 2, - POS_TOP : 0, - POS_BOTTOM : 1, - POS_LEFT : 0, - POS_RIGHT : 1, - DP_INTERNAL_FOCUS : 'dpInternalFocusTrigger' - }; - // localisable text - $.dpText = { - TEXT_PREV_YEAR : 'Previous year', - TEXT_PREV_MONTH : 'Previous month', - TEXT_NEXT_YEAR : 'Next year', - TEXT_NEXT_MONTH : 'Next month', - TEXT_CLOSE : 'Close', - TEXT_CHOOSE_DATE : 'Choose date', - HEADER_FORMAT : 'mmmm yyyy' - }; - // version - $.dpVersion = '$Id: jquery.datePicker.js 84 2009-08-05 17:54:35Z kelvin.luck@gmail.com $'; - - $.fn.datePicker.defaults = { - month : undefined, - year : undefined, - showHeader : $.dpConst.SHOW_HEADER_SHORT, - startDate : undefined, - endDate : undefined, - inline : false, - renderCallback : null, - createButton : true, - showYearNavigation : true, - closeOnSelect : true, - displayClose : false, - selectMultiple : false, - numSelectable : Number.MAX_VALUE, - clickInput : false, - rememberViewedMonth : true, - selectWeek : false, - verticalPosition : $.dpConst.POS_TOP, - horizontalPosition : $.dpConst.POS_LEFT, - verticalOffset : 0, - horizontalOffset : 0, - hoverClass : 'dp-hover' - }; - - function _getController(ele) - { - if (ele._dpId) return $.event._dpCache[ele._dpId]; - return false; - }; - - // make it so that no error is thrown if bgIframe plugin isn't included (allows you to use conditional - // comments to only include bgIframe where it is needed in IE without breaking this plugin). - if ($.fn.bgIframe == undefined) { - $.fn.bgIframe = function() {return this; }; - }; - - - // clean-up - $(window) - .bind('unload', function() { - var els = $.event._dpCache || []; - for (var i in els) { - $(els[i].ele)._dpDestroy(); - } - }); - - -})(jQuery); diff --git a/static/jquery.tipsy.js b/static/jquery.tipsy.js deleted file mode 100755 index 03ae8e4..0000000 --- a/static/jquery.tipsy.js +++ /dev/null @@ -1,60 +0,0 @@ -(function($) { - $.fn.tipsy = function(opts) { - - opts = $.extend({fade: false, gravity: 'n'}, opts || {}); - var tip = null, cancelHide = false; - - this.hover(function() { - - $.data(this, 'cancel.tipsy', true); - - var tip = $.data(this, 'active.tipsy'); - if (!tip) { - tip = $('<div class="tipsy"><div class="tipsy-inner">' + $(this).attr('title') + '</div></div>'); - tip.css({position: 'absolute', zIndex: 100000}); - $(this).attr('title', ''); - $.data(this, 'active.tipsy', tip); - } - - var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight}); - tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); - var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight; - - switch (opts.gravity.charAt(0)) { - case 'n': - tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north'); - break; - case 's': - tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south'); - break; - case 'e': - tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east'); - break; - case 'w': - tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west'); - break; - } - - if (opts.fade) { - tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 1}); - } else { - tip.css({visibility: 'visible'}); - } - - }, function() { - $.data(this, 'cancel.tipsy', false); - var self = this; - setTimeout(function() { - if ($.data(this, 'cancel.tipsy')) return; - var tip = $.data(self, 'active.tipsy'); - if (opts.fade) { - tip.stop().fadeOut(function() { $(this).remove(); }); - } else { - tip.remove(); - } - }, 100); - - }); - - }; -})(jQuery); diff --git a/static/js-global/FancyZoom.js b/static/js-global/FancyZoom.js deleted file mode 100755 index 42d71ce..0000000 --- a/static/js-global/FancyZoom.js +++ /dev/null @@ -1,761 +0,0 @@ -// FancyZoom.js - v1.1 - http://www.fancyzoom.com -// -// Copyright (c) 2008 Cabel Sasser / Panic Inc -// All rights reserved. -// -// Requires: FancyZoomHTML.js -// Instructions: Include JS files in page, call setupZoom() in onLoad. That's it! -// Any <a href> links to images will be updated to zoom inline. -// Add rel="nozoom" to your <a href> to disable zooming for an image. -// -// Redistribution and use of this effect in source form, with or without modification, -// are permitted provided that the following conditions are met: -// -// * USE OF SOURCE ON COMMERCIAL (FOR-PROFIT) WEBSITE REQUIRES ONE-TIME LICENSE FEE PER DOMAIN. -// Reasonably priced! Visit www.fancyzoom.com for licensing instructions. Thanks! -// -// * Non-commercial (personal) website use is permitted without license/payment! -// -// * Redistribution of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution of source code and derived works cannot be sold without specific -// written prior permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -var includeCaption = true; // Turn on the "caption" feature, and write out the caption HTML -var zoomTime = 5; // Milliseconds between frames of zoom animation -var zoomSteps = 15; // Number of zoom animation frames -var includeFade = 1; // Set to 1 to fade the image in / out as it zooms -var minBorder = 90; // Amount of padding between large, scaled down images, and the window edges -var shadowSettings = '0px 5px 25px rgba(0, 0, 0, '; // Blur, radius, color of shadow for compatible browsers - -var zoomImagesURI = '/images-global/zoom/'; // Location of the zoom and shadow images - -// Init. Do not add anything below this line, unless it's something awesome. - -var myWidth = 0, myHeight = 0, myScroll = 0; myScrollWidth = 0; myScrollHeight = 0; -var zoomOpen = false, preloadFrame = 1, preloadActive = false, preloadTime = 0, imgPreload = new Image(); -var preloadAnimTimer = 0; - -var zoomActive = new Array(); var zoomTimer = new Array(); -var zoomOrigW = new Array(); var zoomOrigH = new Array(); -var zoomOrigX = new Array(); var zoomOrigY = new Array(); - -var zoomID = "ZoomBox"; -var theID = "ZoomImage"; -var zoomCaption = "ZoomCaption"; -var zoomCaptionDiv = "ZoomCapDiv"; - -if (navigator.userAgent.indexOf("MSIE") != -1) { - var browserIsIE = true; -} - -// Zoom: Setup The Page! Called in your <body>'s onLoad handler. - -function setupZoom() { - prepZooms(); - insertZoomHTML(); - zoomdiv = document.getElementById(zoomID); - zoomimg = document.getElementById(theID); -} - -// Zoom: Inject Javascript functions into hrefs pointing to images, one by one! -// Skip any href that contains a rel="nozoom" tag. -// This is done at page load time via an onLoad() handler. - -function prepZooms() { - if (! document.getElementsByTagName) { - return; - } - var links = document.getElementsByTagName("a"); - for (i = 0; i < links.length; i++) { - if (links[i].getAttribute("href")) { - if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi) != -1) { - if (links[i].getAttribute("rel") != "nozoom") { - links[i].onclick = function (event) { return zoomClick(this, event); }; - links[i].onmouseover = function () { zoomPreload(this); }; - } - } - } - } -} - -// Zoom: Load an image into an image object. When done loading, function sets preloadActive to false, -// so other bits know that they can proceed with the zoom. -// Preloaded image is stored in imgPreload and swapped out in the zoom function. - -function zoomPreload(from) { - - var theimage = from.getAttribute("href"); - - // Only preload if we have to, i.e. the image isn't this image already - - if (imgPreload.src.indexOf(from.getAttribute("href").substr(from.getAttribute("href").lastIndexOf("/"))) == -1) { - preloadActive = true; - imgPreload = new Image(); - - // Set a function to fire when the preload is complete, setting flags along the way. - - imgPreload.onload = function() { - preloadActive = false; - } - - // Load it! - imgPreload.src = theimage; - } -} - -// Zoom: Start the preloading animation cycle. - -function preloadAnimStart() { - preloadTime = new Date(); - document.getElementById("ZoomSpin").style.left = (myWidth / 2) + 'px'; - document.getElementById("ZoomSpin").style.top = ((myHeight / 2) + myScroll) + 'px'; - document.getElementById("ZoomSpin").style.visibility = "visible"; - preloadFrame = 1; - document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png'; - preloadAnimTimer = setInterval("preloadAnim()", 100); -} - -// Zoom: Display and ANIMATE the jibber-jabber widget. Once preloadActive is false, bail and zoom it up! - -function preloadAnim(from) { - if (preloadActive != false) { - document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png'; - preloadFrame++; - if (preloadFrame > 12) preloadFrame = 1; - } else { - document.getElementById("ZoomSpin").style.visibility = "hidden"; - clearInterval(preloadAnimTimer); - preloadAnimTimer = 0; - zoomIn(preloadFrom); - } -} - -// ZOOM CLICK: We got a click! Should we do the zoom? Or wait for the preload to complete? -// todo?: Double check that imgPreload src = clicked src - -function zoomClick(from, evt) { - - var shift = getShift(evt); - - // Check for Command / Alt key. If pressed, pass them through -- don't zoom! - if (! evt && window.event && (window.event.metaKey || window.event.altKey)) { - return true; - } else if (evt && (evt.metaKey|| evt.altKey)) { - return true; - } - - // Get browser dimensions - getSize(); - - // If preloading still, wait, and display the spinner. - if (preloadActive == true) { - // But only display the spinner if it's not already being displayed! - if (preloadAnimTimer == 0) { - preloadFrom = from; - preloadAnimStart(); - } - } else { - // Otherwise, we're loaded: do the zoom! - zoomIn(from, shift); - } - - return false; - -} - -// Zoom: Move an element in to endH endW, using zoomHost as a starting point. -// "from" is an object reference to the href that spawned the zoom. - -function zoomIn(from, shift) { - - zoomimg.src = from.getAttribute("href"); - - // Determine the zoom settings from where we came from, the element in the <a>. - // If there's no element in the <a>, or we can't get the width, make stuff up - - if (from.childNodes[0].width) { - startW = from.childNodes[0].width; - startH = from.childNodes[0].height; - startPos = findElementPos(from.childNodes[0]); - } else { - startW = 50; - startH = 12; - startPos = findElementPos(from); - } - - hostX = startPos[0]; - hostY = startPos[1]; - - // Make up for a scrolled containing div. - // TODO: This HAS to move into findElementPos. - - if (document.getElementById('scroller')) { - hostX = hostX - document.getElementById('scroller').scrollLeft; - } - - // Determine the target zoom settings from the preloaded image object - - endW = imgPreload.width; - endH = imgPreload.height; - - // Start! But only if we're not zooming already! - - if (zoomActive[theID] != true) { - - // Clear everything out just in case something is already open - - if (document.getElementById("ShadowBox")) { - document.getElementById("ShadowBox").style.visibility = "hidden"; - } else if (! browserIsIE) { - - // Wipe timer if shadow is fading in still - if (fadeActive["ZoomImage"]) { - clearInterval(fadeTimer["ZoomImage"]); - fadeActive["ZoomImage"] = false; - fadeTimer["ZoomImage"] = false; - } - - document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)'; - } - - document.getElementById("ZoomClose").style.visibility = "hidden"; - - // Setup the CAPTION, if existing. Hide it first, set the text. - - if (includeCaption) { - document.getElementById(zoomCaptionDiv).style.visibility = "hidden"; - if (from.getAttribute('title') && includeCaption) { - // Yes, there's a caption, set it up - document.getElementById(zoomCaption).innerHTML = from.getAttribute('title'); - } else { - document.getElementById(zoomCaption).innerHTML = ""; - } - } - - // Store original position in an array for future zoomOut. - - zoomOrigW[theID] = startW; - zoomOrigH[theID] = startH; - zoomOrigX[theID] = hostX; - zoomOrigY[theID] = hostY; - - // Now set the starting dimensions - - zoomimg.style.width = startW + 'px'; - zoomimg.style.height = startH + 'px'; - zoomdiv.style.left = hostX + 'px'; - zoomdiv.style.top = hostY + 'px'; - - // Show the zooming image container, make it invisible - - if (includeFade == 1) { - setOpacity(0, zoomID); - } - zoomdiv.style.visibility = "visible"; - - // If it's too big to fit in the window, shrink the width and height to fit (with ratio). - - sizeRatio = endW / endH; - if (endW > myWidth - minBorder) { - endW = myWidth - minBorder; - endH = endW / sizeRatio; - } - if (endH > myHeight - minBorder) { - endH = myHeight - minBorder; - endW = endH * sizeRatio; - } - - zoomChangeX = ((myWidth / 2) - (endW / 2) - hostX); - zoomChangeY = (((myHeight / 2) - (endH / 2) - hostY) + myScroll); - zoomChangeW = (endW - startW); - zoomChangeH = (endH - startH); - - // Shift key? - - if (shift) { - tempSteps = zoomSteps * 7; - } else { - tempSteps = zoomSteps; - } - - // Setup Zoom - - zoomCurrent = 0; - - // Setup Fade with Zoom, If Requested - - if (includeFade == 1) { - fadeCurrent = 0; - fadeAmount = (0 - 100) / tempSteps; - } else { - fadeAmount = 0; - } - - // Do It! - - zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')", zoomTime); - zoomActive[theID] = true; - } -} - -// Zoom it back out. - -function zoomOut(from, evt) { - - // Get shift key status. - // IE events don't seem to get passed through the function, so grab it from the window. - - if (getShift(evt)) { - tempSteps = zoomSteps * 7; - } else { - tempSteps = zoomSteps; - } - - // Check to see if something is happening/open - - if (zoomActive[theID] != true) { - - // First, get rid of the shadow if necessary. - - if (document.getElementById("ShadowBox")) { - document.getElementById("ShadowBox").style.visibility = "hidden"; - } else if (! browserIsIE) { - - // Wipe timer if shadow is fading in still - if (fadeActive["ZoomImage"]) { - clearInterval(fadeTimer["ZoomImage"]); - fadeActive["ZoomImage"] = false; - fadeTimer["ZoomImage"] = false; - } - - document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)'; - } - - // ..and the close box... - - document.getElementById("ZoomClose").style.visibility = "hidden"; - - // ...and the caption if necessary! - - if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") { - // fadeElementSetup(zoomCaptionDiv, 100, 0, 5, 1); - document.getElementById(zoomCaptionDiv).style.visibility = "hidden"; - } - - // Now, figure out where we came from, to get back there - - startX = parseInt(zoomdiv.style.left); - startY = parseInt(zoomdiv.style.top); - startW = zoomimg.width; - startH = zoomimg.height; - zoomChangeX = zoomOrigX[theID] - startX; - zoomChangeY = zoomOrigY[theID] - startY; - zoomChangeW = zoomOrigW[theID] - startW; - zoomChangeH = zoomOrigH[theID] - startH; - - // Setup Zoom - - zoomCurrent = 0; - - // Setup Fade with Zoom, If Requested - - if (includeFade == 1) { - fadeCurrent = 0; - fadeAmount = (100 - 0) / tempSteps; - } else { - fadeAmount = 0; - } - - // Do It! - - zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+startX+", "+zoomChangeX+", "+startY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDone(zoomID, theID)')", zoomTime); - zoomActive[theID] = true; - } -} - -// Finished Zooming In - -function zoomDoneIn(zoomdiv, theID) { - - // Note that it's open - - zoomOpen = true; - zoomdiv = document.getElementById(zoomdiv); - - // Position the table shadow behind the zoomed in image, and display it - - if (document.getElementById("ShadowBox")) { - - setOpacity(0, "ShadowBox"); - shadowdiv = document.getElementById("ShadowBox"); - - shadowLeft = parseInt(zoomdiv.style.left) - 13; - shadowTop = parseInt(zoomdiv.style.top) - 8; - shadowWidth = zoomdiv.offsetWidth + 26; - shadowHeight = zoomdiv.offsetHeight + 26; - - shadowdiv.style.width = shadowWidth + 'px'; - shadowdiv.style.height = shadowHeight + 'px'; - shadowdiv.style.left = shadowLeft + 'px'; - shadowdiv.style.top = shadowTop + 'px'; - - document.getElementById("ShadowBox").style.visibility = "visible"; - fadeElementSetup("ShadowBox", 0, 100, 5); - - } else if (! browserIsIE) { - // Or, do a fade of the modern shadow - fadeElementSetup("ZoomImage", 0, .8, 5, 0, "shadow"); - } - - // Position and display the CAPTION, if existing - - if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") { - // setOpacity(0, zoomCaptionDiv); - zoomcapd = document.getElementById(zoomCaptionDiv); - zoomcapd.style.top = parseInt(zoomdiv.style.top) + (zoomdiv.offsetHeight + 15) + 'px'; - zoomcapd.style.left = (myWidth / 2) - (zoomcapd.offsetWidth / 2) + 'px'; - zoomcapd.style.visibility = "visible"; - // fadeElementSetup(zoomCaptionDiv, 0, 100, 5); - } - - // Display Close Box (fade it if it's not IE) - - if (!browserIsIE) setOpacity(0, "ZoomClose"); - document.getElementById("ZoomClose").style.visibility = "visible"; - if (!browserIsIE) fadeElementSetup("ZoomClose", 0, 100, 5); - - // Get keypresses - document.onkeypress = getKey; - -} - -// Finished Zooming Out - -function zoomDone(zoomdiv, theID) { - - // No longer open - - zoomOpen = false; - - // Clear stuff out, clean up - - zoomOrigH[theID] = ""; - zoomOrigW[theID] = ""; - document.getElementById(zoomdiv).style.visibility = "hidden"; - zoomActive[theID] == false; - - // Stop getting keypresses - - document.onkeypress = null; - -} - -// Actually zoom the element - -function zoomElement(zoomdiv, theID, zoomCurrent, zoomStartW, zoomChangeW, zoomStartH, zoomChangeH, zoomStartX, zoomChangeX, zoomStartY, zoomChangeY, zoomSteps, includeFade, fadeAmount, execWhenDone) { - - // console.log("Zooming Step #"+zoomCurrent+ " of "+zoomSteps+" (zoom " + zoomStartW + "/" + zoomChangeW + ") (zoom " + zoomStartH + "/" + zoomChangeH + ") (zoom " + zoomStartX + "/" + zoomChangeX + ") (zoom " + zoomStartY + "/" + zoomChangeY + ") Fade: "+fadeAmount); - - // Test if we're done, or if we continue - - if (zoomCurrent == (zoomSteps + 1)) { - zoomActive[theID] = false; - clearInterval(zoomTimer[theID]); - - if (execWhenDone != "") { - eval(execWhenDone); - } - } else { - - // Do the Fade! - - if (includeFade == 1) { - if (fadeAmount < 0) { - setOpacity(Math.abs(zoomCurrent * fadeAmount), zoomdiv); - } else { - setOpacity(100 - (zoomCurrent * fadeAmount), zoomdiv); - } - } - - // Calculate this step's difference, and move it! - - moveW = cubicInOut(zoomCurrent, zoomStartW, zoomChangeW, zoomSteps); - moveH = cubicInOut(zoomCurrent, zoomStartH, zoomChangeH, zoomSteps); - moveX = cubicInOut(zoomCurrent, zoomStartX, zoomChangeX, zoomSteps); - moveY = cubicInOut(zoomCurrent, zoomStartY, zoomChangeY, zoomSteps); - - document.getElementById(zoomdiv).style.left = moveX + 'px'; - document.getElementById(zoomdiv).style.top = moveY + 'px'; - zoomimg.style.width = moveW + 'px'; - zoomimg.style.height = moveH + 'px'; - - zoomCurrent++; - - clearInterval(zoomTimer[theID]); - zoomTimer[theID] = setInterval("zoomElement('"+zoomdiv+"', '"+theID+"', "+zoomCurrent+", "+zoomStartW+", "+zoomChangeW+", "+zoomStartH+", "+zoomChangeH+", "+zoomStartX+", "+zoomChangeX+", "+zoomStartY+", "+zoomChangeY+", "+zoomSteps+", "+includeFade+", "+fadeAmount+", '"+execWhenDone+"')", zoomTime); - } -} - -// Zoom Utility: Get Key Press when image is open, and act accordingly - -function getKey(evt) { - if (! evt) { - theKey = event.keyCode; - } else { - theKey = evt.keyCode; - } - - if (theKey == 27) { // ESC - zoomOut(this, evt); - } -} - -//////////////////////////// -// -// FADE Functions -// - -function fadeOut(elem) { - if (elem.id) { - fadeElementSetup(elem.id, 100, 0, 10); - } -} - -function fadeIn(elem) { - if (elem.id) { - fadeElementSetup(elem.id, 0, 100, 10); - } -} - -// Fade: Initialize the fade function - -var fadeActive = new Array(); -var fadeQueue = new Array(); -var fadeTimer = new Array(); -var fadeClose = new Array(); -var fadeMode = new Array(); - -function fadeElementSetup(theID, fdStart, fdEnd, fdSteps, fdClose, fdMode) { - - // alert("Fading: "+theID+" Steps: "+fdSteps+" Mode: "+fdMode); - - if (fadeActive[theID] == true) { - // Already animating, queue up this command - fadeQueue[theID] = new Array(theID, fdStart, fdEnd, fdSteps); - } else { - fadeSteps = fdSteps; - fadeCurrent = 0; - fadeAmount = (fdStart - fdEnd) / fadeSteps; - fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15); - fadeActive[theID] = true; - fadeMode[theID] = fdMode; - - if (fdClose == 1) { - fadeClose[theID] = true; - } else { - fadeClose[theID] = false; - } - } -} - -// Fade: Do the fade. This function will call itself, modifying the parameters, so -// many instances can run concurrently. Can fade using opacity, or fade using a box-shadow. - -function fadeElement(theID, fadeCurrent, fadeAmount, fadeSteps) { - - if (fadeCurrent == fadeSteps) { - - // We're done, so clear. - - clearInterval(fadeTimer[theID]); - fadeActive[theID] = false; - fadeTimer[theID] = false; - - // Should we close it once the fade is complete? - - if (fadeClose[theID] == true) { - document.getElementById(theID).style.visibility = "hidden"; - } - - // Hang on.. did a command queue while we were working? If so, make it happen now - - if (fadeQueue[theID] && fadeQueue[theID] != false) { - fadeElementSetup(fadeQueue[theID][0], fadeQueue[theID][1], fadeQueue[theID][2], fadeQueue[theID][3]); - fadeQueue[theID] = false; - } - } else { - - fadeCurrent++; - - // Now actually do the fade adjustment. - - if (fadeMode[theID] == "shadow") { - - // Do a special fade on the webkit-box-shadow of the object - - if (fadeAmount < 0) { - document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (Math.abs(fadeCurrent * fadeAmount)) + ')'; - } else { - document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (100 - (fadeCurrent * fadeAmount)) + ')'; - } - - } else { - - // Set the opacity depending on if we're adding or subtracting (pos or neg) - - if (fadeAmount < 0) { - setOpacity(Math.abs(fadeCurrent * fadeAmount), theID); - } else { - setOpacity(100 - (fadeCurrent * fadeAmount), theID); - } - } - - // Keep going, and send myself the updated variables - clearInterval(fadeTimer[theID]); - fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15); - } -} - -//////////////////////////// -// -// UTILITY functions -// - -// Utility: Set the opacity, compatible with a number of browsers. Value from 0 to 100. - -function setOpacity(opacity, theID) { - - var object = document.getElementById(theID).style; - - // If it's 100, set it to 99 for Firefox. - - if (navigator.userAgent.indexOf("Firefox") != -1) { - if (opacity == 100) { opacity = 99.9999; } // This is majorly awkward - } - - // Multi-browser opacity setting - - object.filter = "alpha(opacity=" + opacity + ")"; // IE/Win - object.opacity = (opacity / 100); // Safari 1.2, Firefox+Mozilla - -} - -// Utility: Math functions for animation calucations - From http://www.robertpenner.com/easing/ -// -// t = time, b = begin, c = change, d = duration -// time = current frame, begin is fixed, change is basically finish - begin, duration is fixed (frames), - -function linear(t, b, c, d) -{ - return c*t/d + b; -} - -function sineInOut(t, b, c, d) -{ - return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; -} - -function cubicIn(t, b, c, d) { - return c*(t/=d)*t*t + b; -} - -function cubicOut(t, b, c, d) { - return c*((t=t/d-1)*t*t + 1) + b; -} - -function cubicInOut(t, b, c, d) -{ - if ((t/=d/2) < 1) return c/2*t*t*t + b; - return c/2*((t-=2)*t*t + 2) + b; -} - -function bounceOut(t, b, c, d) -{ - if ((t/=d) < (1/2.75)){ - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)){ - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)){ - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } -} - - -// Utility: Get the size of the window, and set myWidth and myHeight -// Credit to quirksmode.org - -function getSize() { - - // Window Size - - if (self.innerHeight) { // Everyone but IE - myWidth = window.innerWidth; - myHeight = window.innerHeight; - myScroll = window.pageYOffset; - } else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict - myWidth = document.documentElement.clientWidth; - myHeight = document.documentElement.clientHeight; - myScroll = document.documentElement.scrollTop; - } else if (document.body) { // Other IE, such as IE7 - myWidth = document.body.clientWidth; - myHeight = document.body.clientHeight; - myScroll = document.body.scrollTop; - } - - // Page size w/offscreen areas - - if (window.innerHeight && window.scrollMaxY) { - myScrollWidth = document.body.scrollWidth; - myScrollHeight = window.innerHeight + window.scrollMaxY; - } else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac - myScrollWidth = document.body.scrollWidth; - myScrollHeight = document.body.scrollHeight; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - myScrollWidth = document.body.offsetWidth; - myScrollHeight = document.body.offsetHeight; - } -} - -// Utility: Get Shift Key Status -// IE events don't seem to get passed through the function, so grab it from the window. - -function getShift(evt) { - var shift = false; - if (! evt && window.event) { - shift = window.event.shiftKey; - } else if (evt) { - shift = evt.shiftKey; - if (shift) evt.stopPropagation(); // Prevents Firefox from doing shifty things - } - return shift; -} - -// Utility: Find the Y position of an element on a page. Return Y and X as an array - -function findElementPos(elemFind) -{ - var elemX = 0; - var elemY = 0; - do { - elemX += elemFind.offsetLeft; - elemY += elemFind.offsetTop; - } while ( elemFind = elemFind.offsetParent ) - - return Array(elemX, elemY); -}
\ No newline at end of file diff --git a/static/js-global/FancyZoomHTML.js b/static/js-global/FancyZoomHTML.js deleted file mode 100755 index 7644a9a..0000000 --- a/static/js-global/FancyZoomHTML.js +++ /dev/null @@ -1,318 +0,0 @@ -// FancyZoomHTML.js - v1.0 -// Used to draw necessary HTML elements for FancyZoom -// -// Copyright (c) 2008 Cabel Sasser / Panic Inc -// All rights reserved. - -function insertZoomHTML() { - - // All of this junk creates the three <div>'s used to hold the closebox, image, and zoom shadow. - - var inBody = document.getElementsByTagName("body").item(0); - - // WAIT SPINNER - - var inSpinbox = document.createElement("div"); - inSpinbox.setAttribute('id', 'ZoomSpin'); - inSpinbox.style.position = 'absolute'; - inSpinbox.style.left = '10px'; - inSpinbox.style.top = '10px'; - inSpinbox.style.visibility = 'hidden'; - inSpinbox.style.zIndex = '525'; - inBody.insertBefore(inSpinbox, inBody.firstChild); - - var inSpinImage = document.createElement("img"); - inSpinImage.setAttribute('id', 'SpinImage'); - inSpinImage.setAttribute('src', zoomImagesURI+'zoom-spin-1.png'); - inSpinbox.appendChild(inSpinImage); - - // ZOOM IMAGE - // - // <div id="ZoomBox"> - // <a href="javascript:zoomOut();"><img src="/images/spacer.gif" id="ZoomImage" border="0"></a> <!-- THE IMAGE --> - // <div id="ZoomClose"> - // <a href="javascript:zoomOut();"><img src="/images/closebox.png" width="30" height="30" border="0"></a> - // </div> - // </div> - - var inZoombox = document.createElement("div"); - inZoombox.setAttribute('id', 'ZoomBox'); - - inZoombox.style.position = 'absolute'; - inZoombox.style.left = '10px'; - inZoombox.style.top = '10px'; - inZoombox.style.visibility = 'hidden'; - inZoombox.style.zIndex = '499'; - - inBody.insertBefore(inZoombox, inSpinbox.nextSibling); - - var inImage1 = document.createElement("img"); - inImage1.onclick = function (event) { zoomOut(this, event); return false; }; - inImage1.setAttribute('src',zoomImagesURI+'spacer.gif'); - inImage1.setAttribute('id','ZoomImage'); - inImage1.setAttribute('border', '0'); - // inImage1.setAttribute('onMouseOver', 'zoomMouseOver();') - // inImage1.setAttribute('onMouseOut', 'zoomMouseOut();') - - // This must be set first, so we can later test it using webkitBoxShadow. - inImage1.setAttribute('style', '-webkit-box-shadow: '+shadowSettings+'0.0)'); - inImage1.style.display = 'block'; - inImage1.style.width = '10px'; - inImage1.style.height = '10px'; - inImage1.style.cursor = 'pointer'; // -webkit-zoom-out? - inZoombox.appendChild(inImage1); - - var inClosebox = document.createElement("div"); - inClosebox.setAttribute('id', 'ZoomClose'); - inClosebox.style.position = 'absolute'; - - // In MSIE, we need to put the close box inside the image. - // It's 2008 and I'm having to do a browser detect? Sigh. - if (browserIsIE) { - inClosebox.style.left = '-1px'; - inClosebox.style.top = '0px'; - } else { - inClosebox.style.left = '-15px'; - inClosebox.style.top = '-15px'; - } - - inClosebox.style.visibility = 'hidden'; - inZoombox.appendChild(inClosebox); - - var inImage2 = document.createElement("img"); - inImage2.onclick = function (event) { zoomOut(this, event); return false; }; - inImage2.setAttribute('src',zoomImagesURI+'closebox.png'); - inImage2.setAttribute('width','30'); - inImage2.setAttribute('height','30'); - inImage2.setAttribute('border','0'); - inImage2.style.cursor = 'pointer'; - inClosebox.appendChild(inImage2); - - // SHADOW - // Only draw the table-based shadow if the programatic webkitBoxShadow fails! - // Also, don't draw it if we're IE -- it wouldn't look quite right anyway. - - if (! document.getElementById('ZoomImage').style.webkitBoxShadow && ! browserIsIE) { - - // SHADOW BASE - - var inFixedBox = document.createElement("div"); - inFixedBox.setAttribute('id', 'ShadowBox'); - inFixedBox.style.position = 'absolute'; - inFixedBox.style.left = '50px'; - inFixedBox.style.top = '50px'; - inFixedBox.style.width = '100px'; - inFixedBox.style.height = '100px'; - inFixedBox.style.visibility = 'hidden'; - inFixedBox.style.zIndex = '498'; - inBody.insertBefore(inFixedBox, inZoombox.nextSibling); - - // SHADOW - // Now, the shadow table. Skip if not compatible, or irrevelant with -box-shadow. - - // <div id="ShadowBox"><table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"> X - // <tr height="25"> - // <td width="27"><img src="/images/zoom-shadow1.png" width="27" height="25"></td> - // <td background="/images/zoom-shadow2.png"> </td> - // <td width="27"><img src="/images/zoom-shadow3.png" width="27" height="25"></td> - // </tr> - - var inShadowTable = document.createElement("table"); - inShadowTable.setAttribute('border', '0'); - inShadowTable.setAttribute('width', '100%'); - inShadowTable.setAttribute('height', '100%'); - inShadowTable.setAttribute('cellpadding', '0'); - inShadowTable.setAttribute('cellspacing', '0'); - inFixedBox.appendChild(inShadowTable); - - var inShadowTbody = document.createElement("tbody"); // Needed for IE (for HTML4). - inShadowTable.appendChild(inShadowTbody); - - var inRow1 = document.createElement("tr"); - inRow1.style.height = '25px'; - inShadowTbody.appendChild(inRow1); - - var inCol1 = document.createElement("td"); - inCol1.style.width = '27px'; - inRow1.appendChild(inCol1); - var inShadowImg1 = document.createElement("img"); - inShadowImg1.setAttribute('src', zoomImagesURI+'zoom-shadow1.png'); - inShadowImg1.setAttribute('width', '27'); - inShadowImg1.setAttribute('height', '25'); - inShadowImg1.style.display = 'block'; - inCol1.appendChild(inShadowImg1); - - var inCol2 = document.createElement("td"); - inCol2.setAttribute('background', zoomImagesURI+'zoom-shadow2.png'); - inRow1.appendChild(inCol2); - // inCol2.innerHTML = '<img src='; - var inSpacer1 = document.createElement("img"); - inSpacer1.setAttribute('src',zoomImagesURI+'spacer.gif'); - inSpacer1.setAttribute('height', '1'); - inSpacer1.setAttribute('width', '1'); - inSpacer1.style.display = 'block'; - inCol2.appendChild(inSpacer1); - - var inCol3 = document.createElement("td"); - inCol3.style.width = '27px'; - inRow1.appendChild(inCol3); - var inShadowImg3 = document.createElement("img"); - inShadowImg3.setAttribute('src', zoomImagesURI+'zoom-shadow3.png'); - inShadowImg3.setAttribute('width', '27'); - inShadowImg3.setAttribute('height', '25'); - inShadowImg3.style.display = 'block'; - inCol3.appendChild(inShadowImg3); - - // <tr> - // <td background="/images/zoom-shadow4.png"> </td> - // <td bgcolor="#ffffff"> </td> - // <td background="/images/zoom-shadow5.png"> </td> - // </tr> - - inRow2 = document.createElement("tr"); - inShadowTbody.appendChild(inRow2); - - var inCol4 = document.createElement("td"); - inCol4.setAttribute('background', zoomImagesURI+'zoom-shadow4.png'); - inRow2.appendChild(inCol4); - // inCol4.innerHTML = ' '; - var inSpacer2 = document.createElement("img"); - inSpacer2.setAttribute('src',zoomImagesURI+'spacer.gif'); - inSpacer2.setAttribute('height', '1'); - inSpacer2.setAttribute('width', '1'); - inSpacer2.style.display = 'block'; - inCol4.appendChild(inSpacer2); - - var inCol5 = document.createElement("td"); - inCol5.setAttribute('bgcolor', '#ffffff'); - inRow2.appendChild(inCol5); - // inCol5.innerHTML = ' '; - var inSpacer3 = document.createElement("img"); - inSpacer3.setAttribute('src',zoomImagesURI+'spacer.gif'); - inSpacer3.setAttribute('height', '1'); - inSpacer3.setAttribute('width', '1'); - inSpacer3.style.display = 'block'; - inCol5.appendChild(inSpacer3); - - var inCol6 = document.createElement("td"); - inCol6.setAttribute('background', zoomImagesURI+'zoom-shadow5.png'); - inRow2.appendChild(inCol6); - // inCol6.innerHTML = ' '; - var inSpacer4 = document.createElement("img"); - inSpacer4.setAttribute('src',zoomImagesURI+'spacer.gif'); - inSpacer4.setAttribute('height', '1'); - inSpacer4.setAttribute('width', '1'); - inSpacer4.style.display = 'block'; - inCol6.appendChild(inSpacer4); - - // <tr height="26"> - // <td width="27"><img src="/images/zoom-shadow6.png" width="27" height="26"</td> - // <td background="/images/zoom-shadow7.png"> </td> - // <td width="27"><img src="/images/zoom-shadow8.png" width="27" height="26"></td> - // </tr> - // </table> - - var inRow3 = document.createElement("tr"); - inRow3.style.height = '26px'; - inShadowTbody.appendChild(inRow3); - - var inCol7 = document.createElement("td"); - inCol7.style.width = '27px'; - inRow3.appendChild(inCol7); - var inShadowImg7 = document.createElement("img"); - inShadowImg7.setAttribute('src', zoomImagesURI+'zoom-shadow6.png'); - inShadowImg7.setAttribute('width', '27'); - inShadowImg7.setAttribute('height', '26'); - inShadowImg7.style.display = 'block'; - inCol7.appendChild(inShadowImg7); - - var inCol8 = document.createElement("td"); - inCol8.setAttribute('background', zoomImagesURI+'zoom-shadow7.png'); - inRow3.appendChild(inCol8); - // inCol8.innerHTML = ' '; - var inSpacer5 = document.createElement("img"); - inSpacer5.setAttribute('src',zoomImagesURI+'spacer.gif'); - inSpacer5.setAttribute('height', '1'); - inSpacer5.setAttribute('width', '1'); - inSpacer5.style.display = 'block'; - inCol8.appendChild(inSpacer5); - - var inCol9 = document.createElement("td"); - inCol9.style.width = '27px'; - inRow3.appendChild(inCol9); - var inShadowImg9 = document.createElement("img"); - inShadowImg9.setAttribute('src', zoomImagesURI+'zoom-shadow8.png'); - inShadowImg9.setAttribute('width', '27'); - inShadowImg9.setAttribute('height', '26'); - inShadowImg9.style.display = 'block'; - inCol9.appendChild(inShadowImg9); - } - - if (includeCaption) { - - // CAPTION - // - // <div id="ZoomCapDiv" style="margin-left: 13px; margin-right: 13px;"> - // <table border="1" cellpadding="0" cellspacing="0"> - // <tr height="26"> - // <td><img src="zoom-caption-l.png" width="13" height="26"></td> - // <td rowspan="3" background="zoom-caption-fill.png"><div id="ZoomCaption"></div></td> - // <td><img src="zoom-caption-r.png" width="13" height="26"></td> - // </tr> - // </table> - // </div> - - var inCapDiv = document.createElement("div"); - inCapDiv.setAttribute('id', 'ZoomCapDiv'); - inCapDiv.style.position = 'absolute'; - inCapDiv.style.visibility = 'hidden'; - inCapDiv.style.marginLeft = 'auto'; - inCapDiv.style.marginRight = 'auto'; - inCapDiv.style.zIndex = '501'; - - inBody.insertBefore(inCapDiv, inZoombox.nextSibling); - - var inCapTable = document.createElement("table"); - inCapTable.setAttribute('border', '0'); - inCapTable.setAttribute('cellPadding', '0'); // Wow. These honestly need to - inCapTable.setAttribute('cellSpacing', '0'); // be intercapped to work in IE. WTF? - inCapDiv.appendChild(inCapTable); - - var inTbody = document.createElement("tbody"); // Needed for IE (for HTML4). - inCapTable.appendChild(inTbody); - - var inCapRow1 = document.createElement("tr"); - inTbody.appendChild(inCapRow1); - - var inCapCol1 = document.createElement("td"); - inCapCol1.setAttribute('align', 'right'); - inCapRow1.appendChild(inCapCol1); - var inCapImg1 = document.createElement("img"); - inCapImg1.setAttribute('src', zoomImagesURI+'zoom-caption-l.png'); - inCapImg1.setAttribute('width', '13'); - inCapImg1.setAttribute('height', '26'); - inCapImg1.style.display = 'block'; - inCapCol1.appendChild(inCapImg1); - - var inCapCol2 = document.createElement("td"); - inCapCol2.setAttribute('background', zoomImagesURI+'zoom-caption-fill.png'); - inCapCol2.setAttribute('id', 'ZoomCaption'); - inCapCol2.setAttribute('valign', 'middle'); - inCapCol2.style.fontSize = '14px'; - inCapCol2.style.fontFamily = 'Helvetica'; - inCapCol2.style.fontWeight = 'bold'; - inCapCol2.style.color = '#ffffff'; - inCapCol2.style.textShadow = '0px 2px 4px #000000'; - inCapCol2.style.whiteSpace = 'nowrap'; - inCapRow1.appendChild(inCapCol2); - - var inCapCol3 = document.createElement("td"); - inCapRow1.appendChild(inCapCol3); - var inCapImg2 = document.createElement("img"); - inCapImg2.setAttribute('src', zoomImagesURI+'zoom-caption-r.png'); - inCapImg2.setAttribute('width', '13'); - inCapImg2.setAttribute('height', '26'); - inCapImg2.style.display = 'block'; - inCapCol3.appendChild(inCapImg2); - } -}
\ No newline at end of file diff --git a/static/js/jquery-1.3.2.min.js b/static/js/jquery-1.3.2.min.js new file mode 100755 index 0000000..b1ae21d --- /dev/null +++ b/static/js/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file diff --git a/static/js/win.js b/static/js/win.js index 7571791..670d6b4 100644 --- a/static/js/win.js +++ b/static/js/win.js @@ -85,7 +85,7 @@ function CreateDropdownWindow( caption, theWidth, canMove, contentSource, startX newdiv.innerHTML = jstrprintf( '<table><tr><td>$1</td>' + '<td style="text-align:right">' + - '<img src="/static/buttontop.gif" class="divTitleButton" id="dragButton$2" ' + + '<img src="/static/img/buttontop.gif" class="divTitleButton" id="dragButton$2" ' + 'onmousedown="javascript:toggleContentWin($2)" /></td>' + '</tr></table>', caption, nextID); @@ -155,14 +155,14 @@ function toggleContentWin(id) { elem.style.display = "block"; // Change the button's image - img.src = "/static/buttontop.gif"; + img.src = "/static/img/buttontop.gif"; } else { // showing, so hide elem.style.display = "none"; // Change the button's image - img.src = "/static/buttonbottom.gif"; + img.src = "/static/img/buttonbottom.gif"; } } diff --git a/static/kilroy.gif b/static/kilroy.gif Binary files differdeleted file mode 100644 index 1c7ccd6..0000000 --- a/static/kilroy.gif +++ /dev/null diff --git a/static/lightlogo.png b/static/lightlogo.png Binary files differdeleted file mode 100644 index 93ab673..0000000 --- a/static/lightlogo.png +++ /dev/null diff --git a/static/linky.gif b/static/linky.gif Binary files differdeleted file mode 100644 index 1721e36..0000000 --- a/static/linky.gif +++ /dev/null diff --git a/static/longcat.png b/static/longcat.png Binary files differdeleted file mode 100644 index 5886d7f..0000000 --- a/static/longcat.png +++ /dev/null diff --git a/static/longcat2.png b/static/longcat2.png Binary files differdeleted file mode 100644 index 1c75c1c..0000000 --- a/static/longcat2.png +++ /dev/null diff --git a/static/modbar.png b/static/modbar.png Binary files differdeleted file mode 100644 index 6522fb8..0000000 --- a/static/modbar.png +++ /dev/null diff --git a/static/modbarover.png b/static/modbarover.png Binary files differdeleted file mode 100644 index 3d3be48..0000000 --- a/static/modbarover.png +++ /dev/null diff --git a/static/moverc.png b/static/moverc.png Binary files differdeleted file mode 100755 index 709f78d..0000000 --- a/static/moverc.png +++ /dev/null diff --git a/static/nav_white.gif b/static/nav_white.gif Binary files differdeleted file mode 100755 index 611d97a..0000000 --- a/static/nav_white.gif +++ /dev/null diff --git a/static/navdown_white.gif b/static/navdown_white.gif Binary files differdeleted file mode 100755 index d3c0865..0000000 --- a/static/navdown_white.gif +++ /dev/null diff --git a/static/new_tiny.gif b/static/new_tiny.gif Binary files differdeleted file mode 100644 index 1fee4b7..0000000 --- a/static/new_tiny.gif +++ /dev/null diff --git a/static/newanim.gif b/static/newanim.gif Binary files differdeleted file mode 100644 index c31f5df..0000000 --- a/static/newanim.gif +++ /dev/null diff --git a/static/news2.html b/static/news2.html deleted file mode 100644 index cf72053..0000000 --- a/static/news2.html +++ /dev/null @@ -1,290 +0,0 @@ - -<head> - -<title>terms</title> - - - -</head> - -<body style="margin:0; width:500px;"> - -<div style="height:600px;width:500px;"> -<DIV class="Part" - -><H1 - align="center" -><FONT size="+2" color="#000000"><B>Accepting the Terms of Servic<FONT size="+2" color="#000000"><B>e -</H1 -><P - -><FONT size="+1"></B>The purpose of this website, <A href="#http://www.dump.fm"> -<FONT color="#031CAA">www.dump.fm</A> - -<FONT color="#000000"> (the “Site”), owned and operated by Dump.Fm, Inc.(“Dump.Fm”), a New York corporation, is to provide web publishing services. Please read these terms of service (“Agreement”) carefully before using the Site or any services provided on theSite (collectively, “Services”). By using or accessing the Services, you agree to become bound by all the terms and conditions of this Agreement. If you do not agree to all the terms and conditions of this Agreement, do not use the Services. The Services are accessed by You (“Subscriber” or “You”) under the following terms and conditions: </P -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>1. Access to the Services </H2 -><P - -><FONT size="+1"></B>Subject to the terms and conditions of this Agreement, Dump.Fm may offer to provide the Services, as described more fully on the Site, and which are selected by Subscriber, solely for Subscriber’s own use, and not for the use or benefit of any third party. Services shall include, but not be limited to, any services Dump.Fm performs for Subscriber, as well as the offering of any Content (as defined below) on the Site. Dump.Fm may change, suspend or discontinue theServices at any time, including the availability of any feature, database, or Content. Dump.Fmmay also impose limits on certain features and services or restrict Subscriber’s access to parts or all of the Services without notice or liability. Dump.Fm reserves the right, at its discretion, to modify these Terms of Service at any time by posting revised Terms of Service on the Site and by providing notice via e-mail, where possible, or on the Site. Subscriber shall be responsible forreviewing and becoming familiar with any such modifications. Use of the Services by Subscriberfollowing such modification constitutes Subscriber's acceptance of the terms and conditions ofthis Agreement as modified. </P -><P - ->Subscriber certifies to Dump.Fm that if Subscriber is an individual (i.e., not a corporate entity),Subscriber is at least 13 years of age. No one under the age of 13 may provide any personalinformation to or on Dump.Fm (including, for example, a name, address, telephone number oremail address). Subscriber also certifies that it is legally permitted to use the Services and accessthe Site, and takes full responsibility for the selection and use of the Services and access of theSite. This Agreement is void where prohibited by law, and the right to access the Site is revoked in such jurisdictions. Dump.Fm makes no claim that the Site may be lawfully viewed or thatContent may be downloaded outside of the United States. Access to the Content may not be legal by certain persons or in certain countries. If You access the Site from outside the United States, You do so at Your own risk and You are responsible for compliance with the laws of Your jurisdiction. </P -><P - ->Dump.Fm will use reasonable efforts to ensure that the Site and Services are available twenty-four hours a day, seven days a week. However, there will be occasions when the Site and/or Services will be interrupted for maintenance, upgrades and repairs or due to failure oftelecommunications links and equipment. Every reasonable step will be taken by Dump.Fm tominimize such disruption where it is within Dump.Fm’s reasonable control. </P -><P - ->You agree that neither Dump.Fm nor the Site will be liable in any event to you or any other partyfor any suspension, modification, discontinuance or lack of availability of the Site, the service,your Subscriber Content or other Content. </P -><P - ->Dump.Fm retains the right to create limits on use and storage in its sole discretion at any timewith or without notice. </P -><P - ->Subscriber shall be responsible for obtaining and maintaining any equipment or ancillaryservices needed to connect to, access the Site or otherwise use the Services, including, withoutlimitation, modems, hardware, software, and long distance or local telephone service. Subscribershall be responsible for ensuring that such equipment or ancillary services are compatible withthe Services. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>2. Site Content</H2 -><P - -><FONT size="+1"></B>The Site and its contents are intended solely for the use of Dump.Fm Subscribers and may onlybe used in accordance with the terms of this Agreement. All materials displayed or performed on the Site, including, but not limited to text, graphics, logos, tools, photographs, images,illustrations, software or source code, audio and video, animations and Themes (as defined below), including without limitation the Dump.Fm Template Code (as defined below) (collectively, “Content”) (other than Content posted by Subscriber (“Subscriber Content”)) are the property of Dump.Fm and/or third parties and are protected by United States andinternational copyright laws. The Dump.Fm API shall be used solely pursuant to the terms of the API Terms of Service. All trademarks, service marks, and trade names are proprietary to Dump.Fm and/or third parties. Subscriber shall abide by all copyright notices, information, andrestrictions contained in any Content accessed through the Services. </P -><P - ->The Site is protected by copyright as a collective work and/or compilation, pursuant to U.S.copyright laws, international conventions, and other copyright laws. Other than as expressly setforth in this Agreement, Subscriber may not copy, modify, publish, transmit, upload, participate in the transfer or sale of, reproduce (except as provided in this Section), create derivative worksbased on, distribute, perform, display, or in any way exploit, any of the Content, software, materials, or Services in whole or in part. </P -><P - ->Subscriber may download or copy the Content, and other items displayed on the Site fordownload, for personal use only, provided that Subscriber maintains all copyright and other notices contained in such Content. Downloading, copying, or storing any Content for other thanpersonal, noncommercial use is expressly prohibited without prior written permission fromDump.Fm, or from the copyright holder identified in such Content's copyright notice. In theevent You download software from the Site, the software, including any files, images incorporated in or generated by the software, and the data accompanying the software(collectively, the “Software”) is licensed to You by Dump.Fm or third party licensors for Your personal, noncommercial use, and no title to the Software shall be transferred to You. You may own the Subscriber Content on which the Software is recorded, but Dump.Fm or third partylicensors retain full and complete title to the Software and all intellectual property rights therein. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>3. Subscriber Content </H2 -><P - -><FONT size="+1"></B>Subscriber shall own all Subscriber Content that Subscriber contributes to the Site, but herebygrants and agrees to grant Dump.Fm a non-exclusive, worldwide, royalty-free, transferable rightand license (with the right to sublicense), to use, copy, cache, publish, display, distribute, modify,create derivative works and store such Subscriber Content and to allow others to do so (“ContentLicense”) in order to provide the Services. On termination of Subscriber’s membership to the Site and use of the Services, Dump.Fm shall make all reasonable efforts to promptly remove from the Site and cease use of the Subscriber Content; however, Subscriber recognizes and agrees that caching of or references to the Subscriber Content may not be immediately removed.Subscriber warrants, represents and agrees Subscriber has the right to grant Dump.Fm and theSite the rights set forth above. Subscriber represents, warrants and agrees that it will notcontribute any Subscriber Content that (a) infringes, violates or otherwise interferes with anycopyright or trademark of another party, (b) reveals any trade secret, unless Subscriber owns the trade secret or has the owner’s permission to post it, (c) infringes any intellectual property right of another or the privacy or publicity rights of another, (d) is libelous, defamatory, abusive, threatening, harassing, hateful, offensive or otherwise violates any law or right of any third party, (e) contains a virus, trojan horse, worm, time bomb or other computer programming routine orengine that is intended to damage, detrimentally interfere with, surreptitiously intercept orexpropriate any system, data or information, or (f) remains posted after Subscriber has beennotified that such Subscriber Content violates any of sections (a) to (e) of this sentence.Dump.Fm reserves the right to remove any Subscriber Content from the Site, suspend orterminate Subscriber’s right to use the Services at any time, or pursue any other remedy or relief available to Dump.Fm and/or the Site under equity or law, for any reason (including, but not limited to, upon receipt of claims or allegations from third parties or authorities relating to suchSubscriber Content or if Dump.Fm is concerned that Subscriber may have breached theimmediately preceding sentence), or for no reason at all. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>4. Themes </H2 -><P - -><FONT size="+1"></B>Dump.Fm makes available specialized HTML tags (“Dump.Fm Template Code”) for the design and layout of blog pages available for use on the Site (“Themes”). You can customize the Dump.Fm Template Code to create your own Themes for use on your blog page (“Custom Theme”). If you choose, you may also contribute Your Custom Themes to the Site for use by other users. Dump.Fm hereby grants you a non-exclusive, non-transferable, non-sublicenseableright and license to access, use, copy, modify and create derivative works of the Dump.Fm Template Code solely as necessary to create Custom Themes for use on the Site. You hereby grant and agree to grant Dump.Fm an exclusive, perpetual, sublicensable irrevocable, royalty-free right and license to use, copy, modify, and create derivative works of any Custom Theme contributed by You to the Site, including the HTML code and media assets therefor. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>5. Restrictions</H2 -><P - -><FONT size="+1"></B>Subscriber is responsible for all of its activity in connection with the Services and accessing theSite. Any fraudulent, abusive, or otherwise illegal activity or any use of the Services or Content in violation of this Agreement may be grounds for termination of Subscriber’s right to Services or to access the Site. Subscriber may not post or transmit, or cause to be posted or transmitted,any communication or solicitation designed or intended to obtain password, account, or privateinformation from any Dump.Fm user. </P -><P - ->Use of the Site or Services to violate the security of any computer network, crack passwords orsecurity encryption codes, transfer or store illegal material including that are deemed threateningor obscene, or engage in any kind of illegal activity is expressly prohibited. Under nocircumstances will Subscriber use the Site or the Service to (a) send unsolicited e-mails, bulkmail, spam or other materials to users of the Site or any other individual, (b) harass, threaten,stalk or abuse any person or party, including other users of the Site, (c) create a false identity or to impersonate another person, or (d) post any false, inaccurate or incomplete material or deleteor revise any material that was not posted by You. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>6. Warranty disclaimer </H2 -><P - -><FONT size="+1"></B>Dump.Fm has no special relationship with or fiduciary duty to Subscriber. Subscriber acknowledges that Dump.Fm has no control over, and no duty to take any action regarding: which users gains access to the Site; which Content Subscriber accesses via the Site; what effects the Content may have on Subscriber; how Subscriber may interpret or use the Content; or whatactions Subscriber may take as a result of having been exposed to the Content. Much of theContent of the Site is provided by and is the responsibility of the user or subscriber who postedthe Content. Dump.Fm does not monitor the Content of the Site and takes no responsibility forsuch Content. Subscriber releases Dump.Fm from all liability for Subscriber having acquired ornot acquired Content through the Site. The Site may contain, or direct Subscriber to sites containing, information that some people may find offensive or inappropriate. Dump.Fm makes no representations concerning any content contained in or accessed through the Site, andDump.Fm will not be responsible or liable for the accuracy, copyright compliance, legality or decency of material contained in or accessed through the Site. </P -><P - ->Although Dump.Fm and the Site will make reasonable efforts to store and preserve the material residing on the Site, neither Dump.Fm nor the Site is responsible or liable in any way for thefailure to store, preserve or access Subscriber Content or other materials you transmit or archiveon the Site. You are strongly urged to take measures to preserve copies of any data, material, content or information you post or upload on the Site. You are solely responsible for creating back-ups of your Subscriber Content. </P -><P - ->The Services, Content, Site and any Software are provided on an "as is" basis, without warrantiesof any kind, either express or implied, including, without limitation, implied warranties ofmerchantability, fitness for a particular purpose or non-infringement. Dump.Fm makes no representations or warranties of any kind with respect to the Site, the Services, including anyrepresentation or warranty that the use of the Site or Services will (a) be timely, uninterrupted or error-free or operate in combination with any other hardware, software, system or data, (b) meet your requirements or expectations, (c) be free from errors or that defects will be corrected, (d) befree of viruses or other harmful components. </P -><P - ->To the fullest extent allowed by law, Dump.Fm disclaims any liability or responsibility for the accuracy, reliability, availability, completeness, legality or operability of the material or services provided on this Site. By using this Site, you acknowledge that Dump.Fm is not responsible orliable for any harm resulting from (1) use of the Site; (2) downloading information contained onthe Site including but not limited to downloads of content posted by subscribers; (3)unauthorized disclosure of images, information or data that results from the upload, download orstorage of content posted by subscribers; (4) the temporary or permanent inability to access orretrieve any Subscriber Content from the Site, including, without limitation, harm caused byviruses, worms, trojan horses, or any similar contamination or destructive program. </P -><P - ->Some states do not allow limitations on how long an implied warranty lasts, so the abovelimitations may not apply to Subscriber. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>7. Third party websites </H2 -><P - -><FONT size="+1"></B>Users of the Site may gain access from the Site to third party sites on the Internet throughhypertext or other computer links on the Site. Third party sites are not within the supervision or control of Dump.Fm or the Site. Unless explicitly otherwise provided, neither Dump.Fm nor theSite make any representation or warranty whatsoever about any third party site that is linked tothe Site, or endorse the products or services offered on such site. Dump.Fm and the Site disclaim: (a) all responsibility and liability for content on third party websites and (b) anyrepresentations or warranties as to the security of any information (including, without limitation,credit card and other personal information) You might be requested to give any third party, and You hereby irrevocably waive any claim against the Site or Dump.Fm with respect to such sites and third party content. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>8. Registration and security</H2 -><P - -><FONT size="+1"></B>As a condition to using Services, Subscriber will be required to register with Dump.Fm andselect a password and Dump.Fm URL. Subscriber shall provide Dump.Fm with accurate,complete, and updated registration information, including Subscriber’s e-mail address. Failure to do so shall constitute a breach of this Agreement, which may result in immediate termination of Subscriber's account. Subscriber may not (a) select or use as a Dump.Fm URL a name of another person with the intent to impersonate that person; or (b) use as a Dump.Fm URL a name subject to any rights of a person other than Subscriber without appropriate authorization. Dump.Fmreserves the right to refuse registration of, or cancel a Dump.Fm URL in its discretion. Subscriber shall be responsible for maintaining the confidentiality of Subscriber's Dump.Fmpassword. Subscriber is solely responsible for any use of or action taken under Subscriber’s password and accepts full responsibility for all activity conducted through Subscriber’s account and agrees to and hereby releases the Site and Dump.Fm from any and all liability concerningsuch activity. Subscriber agrees to notify Dump.Fm immediately of any actual or suspected loss, theft, or unauthorized use of Subscriber’s account or password. The Site will take reasonably security precautions when using the internet, telephone or other means to transport date or other communications, but expressly disclaims any and all liability for the accessing of any such datacommunications by unauthorized persons or entities. </P -><P - -><FONT size="+2"><B>9. Indemnity</P -><P - -><FONT size="+1"></B>Subscriber will indemnify and hold Dump.Fm, its directors, officers and employees, harmless,including costs and attorneys' fees, from any claim or demand made by any third party due to orarising out of Subscriber’s access to the Site, use of the Services, the violation of this Agreement by Subscriber, or the infringement by Subscriber, or any third party using the Subscriber's account, of any intellectual property or other right of any person or entity. </P -><P - -><FONT size="+2"><B>10. Limitation of liability</P -><P - -><FONT size="+1"></B>In no event shall Dump.Fm, its directors, officers, shareholders, employees or members be liablewith respect to the Site or the Services for (a) any indirect, incidental, punitive, or consequentialdamages of any kind whatsoever; (b) damages for loss of use, profits, data, images, SubscriberContent or other intangibles; (c) damages for unauthorized use, non-performance of the Site,errors or omissions; or (d) damages related to downloading or posting Content. Dump.Fm's andthe Site's collective liability under this agreement shall be limited to three hundred United StatesDollars. Some states do not allow the exclusion or limitation of incidental or consequentialdamages, so the above limitations and exclusions may not apply to Subscriber. </P -><P - -><FONT size="+2"><B>11. Fees and payment</P -><P - -><FONT size="+1"></B>Some of the Services require payment of fees. Subscriber shall pay all applicable fees, asdescribed on the Site in connection with such Services selected by Subscriber. Dump.Fm reserves the right to change its pricing and to institute new charges at any time, upon ten (10) days prior notice to Subscriber, which will be posted on the Site and e-mailed to Subscriber along with a link to the modified fee schedule so that You can review it. Use of the Services by Subscriber following such notification constitutes Subscriber's acceptance of any new orincreased charges. </P -><P - -><FONT size="+2"><B>12. Termination </P -><P - -><FONT size="+1"></B>Either party may terminate the Services at any time by notifying the other party by any means.Dump.Fm may also terminate or suspend any and all Services and access to the Siteimmediately, without prior notice or liability, if Subscriber breaches any of the terms or conditions of this Agreement. Upon termination of Subscriber's account, Subscriber’s right to use the Services, access the Site, and any Content will immediately cease. All provisions of this Agreement which by their nature should survive termination shall survive termination, including,without limitation, ownership provisions, warranty disclaimers, and limitations of liability. Termination of Your access to and use of the Site and the Services shall not relieve Subscriber of any obligations arising or accruing prior to such termination or limit any liability which Subscriber otherwise may have to Dump.Fm or the Site, including without limitation anyindemnification obligations contained herein. </P -><P - -><FONT size="+2"><B>13. Privacy</P -><P - -><FONT size="+1"></B>Please review our <A href="#http://www.tumblr.com/privacy_policy"> - -<FONT color="#031CAA">Privacy Policy</A> -<FONT color="#000000">, which governs the use of personal information on the Site andto which Subscriber agrees to be bound as a user of the Site. </P -><P - -><FONT size="+2"><B>14. Meetups</P -><P - -><FONT size="+1"></B>The Site offers a platform for users to organize and attend face-to-face meetings at restaurants, bars and other venues all over the world (“Meetups”). However, Dump.Fm does not sponsor, oversee or in anyway control Meetups. You understand and agree that you organize and participate in Meetups at your own risk and Dump.Fm does not bear any responsibility orliability for the actions of any Dump.Fm users or any third parties who organize, attend or are otherwise involved in any Meetups. </P -><P - ->To the fullest extent permitted under applicable law, Dump.Fm disclaims all liability, regardless of the form of action, for the acts or omissions of other Dump.Fm users or any other third partyand will not be liable for any damages, direct, indirect, incidental and/or consequential arisingout of your organization or attendance at a Meetup or your interactions with any Dump.Fm user or third party you meet at such events. </P -><P - -><FONT size="+2"><B>15. Miscellaneous</P -><P - -><FONT size="+1"></B>This Agreement (including the Privacy Policy), as modified from time to time, constitutes the entire agreement between You, the Site and Dump.Fm with respect to the subject matter hereof. This Agreement replaces all prior or contemporaneous understandings or agreements, written or oral, regarding the subject matter hereof. The failure of either party to exercise in any respect anyright provided for herein shall not be deemed a waiver of any further rights hereunder. Dump.Fmshall not be liable for any failure to perform its obligations hereunder where such failure resultsfrom any cause beyond Dump.Fm’s reasonable control, including, without limitation, mechanical, electronic or communications failure or degradation. If any provision of thisAgreement is found to be unenforceable or invalid, that provision shall be limited or eliminatedto the minimum extent necessary so that this Agreement shall otherwise remain in full force and effect and enforceable. This Agreement is not assignable, transferable or sublicensable by Subscriber except with Dump.Fm’s prior written consent. Dump.Fm may assign this Agreement in whole or in part at any time without Subscriber’s consent. This Agreement shall be governed by and construed in accordance with the laws of the state of Delaware without regard to theconflict of laws provisions thereof. No agency, partnership, joint venture, or employment is created as a result of this Agreement and Subscriber does not have any authority of any kind to bind Dump.Fm in any respect whatsoever. Any notice to the Site that is required or permitted by this Agreement shall be in writing and shall be deemed effective upon receipt, when sent by confirmed e-mail to info@dump.fm or when delivered in person by nationally recognized overnight courier or mailed by first class, registered or certified mail, postage prepaid, to</P -><P - -><I>Dump.Fm, Inc., 90-11 35th Ave Apt. 1L Jackson Hts, NY, Attn: Legal Dept. </I></P -></DIV -></DIV -><DIV class="Part" - -><H1 - -><FONT size="+2"><B>16. Copyright Policy</H1 -><P - -><FONT size="+1"></B>Dump.Fm has adopted the following policy toward copyright infringement with respect to theSite in accordance with the Digital Millennium Copyright Act, a copy of which is located at <A href="#http://www.loc.gov/copyright/legislation/dmca.pdf"> - -<FONT color="#031CAA">http://www.loc.gov/copyright/legislation/dmca.pdf</A> -<FONT color="#000000">. The address of Dump.Fm's Designated Agent for copyright takedown notices (“Designated Agent”) is listed below. </P -><DIV class="Sect" - -><H2 - -><FONT size="+1"><B>Reporting Copyright Infringements </H2 -><P - -><FONT size="+1"></B>If You believe that content residing or accessible on the Site infringes a copyright, please send a notice of copyright infringement containing the following information to the Designated Agent at the address below: </P -><OL - type="1" -><LI - ->Identification of the work or material being infringed.</P -></LI -><LI - ->Identification of the material that is claimed to be infringing, including its location, withsufficient detail so that Dump.Fm is capable of finding and verifying its existence.</P -></LI -><LI - ->Contact information about the notifying party (the Notifying Party), including name<FONT size="+1"></B>, -address, telephone number and e-mail address. -</P -></LI -><LI - ->A statement that the Notifying Party has a good faith belief that the material is not -authorized by the copyright owner, its agent or law. -</P -></LI -><LI - ->A statement made under penalty of perjury that the information provided in the notice is accurate and that the Notifying Party is authorized to make the complaint on behalf of thecopyright owner. </P -></LI -></OL -><P - ->6. The Notifying Party's physical or electronic signature.After the Designated Agent receives notification of an alleged infringement that meets all of the requirements above, Dump.Fm shall: </P -><OL - type="1" -><LI - ->Disable access to or remove material that it has a reasonable, good faith belief iscopyrighted material that has been illegally copied and distributed by any subscriber tothe Site. </P -></LI -><LI - ->Dump.Fm will then immediately notify the subscriber responsible for the allegedlyinfringing material (the Offending Subscriber) that it has removed or disabled access to the material. </P -></LI -><LI - ->Dump.Fm reserves the right, at its discretion, to immediately terminate the account of anysubscriber who is the subject of repeated takedown notices.</P -></LI -></OL -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+1"><B>Filing Copyright Counterclaims </H2 -><P - -><FONT size="+1"></B>A subscriber who believes they are the wrongful subject of a copyright takedown notice, may filea counter notification with Dump.Fm, by providing the following items in writing to theDesignated Agent at the address below: </P -><UL - type="disc" -><LI - ->The specific URLs of material that Dump.Fm has removed or to which Dump.Fm hasdisabled access. </P -></LI -><LI - ->User’s name, address, telephone number, and email address. </P -></LI -><LI - ->A statement that User consent to the jurisdiction of Federal District Court for the judicial district in which your address is located (or New York County, New York if your address is outside of the United States), and that User will accept service of process from theperson who provided notification under subsection (c)(1)(C) or an agent of such person. </P -></LI -><LI - ->The following statement: "I swear, under penalty of perjury, that I have a good faith beliefthat the material was removed or disabled as a result of a mistake or misidentification of the material to be removed or disabled." </P -></LI -></UL -><P - ->• User’s signature.Upon receipt of a counterclaim, Dump.Fm will forward it to the party who submitted the originalcopyright infringement claim. The original complainant will then have 10 days to notify us that he or she has filed legal action relating to the allegedly infringing material. If Dump.Fm does notreceive any such notification within 10 days, we may restore the material to the Site. </P -></DIV -></DIV> - - - -</div> -</div> -</div> - -</body> -</html> diff --git a/static/noinfo.png b/static/noinfo.png Binary files differdeleted file mode 100644 index a80724a..0000000 --- a/static/noinfo.png +++ /dev/null diff --git a/static/orange.gif b/static/orange.gif Binary files differdeleted file mode 100644 index 2a115a3..0000000 --- a/static/orange.gif +++ /dev/null diff --git a/static/pixelart.gif b/static/pixelart.gif Binary files differdeleted file mode 100644 index cfad07f..0000000 --- a/static/pixelart.gif +++ /dev/null diff --git a/static/posthere.png b/static/posthere.png Binary files differdeleted file mode 100644 index 0e3b8f1..0000000 --- a/static/posthere.png +++ /dev/null diff --git a/static/pow.gif b/static/pow.gif Binary files differdeleted file mode 100644 index dab859d..0000000 --- a/static/pow.gif +++ /dev/null diff --git a/static/preggers.png b/static/preggers.png Binary files differdeleted file mode 100644 index 9e2ef77..0000000 --- a/static/preggers.png +++ /dev/null diff --git a/static/privacy.html b/static/privacy.html deleted file mode 100644 index 2cb4faf..0000000 --- a/static/privacy.html +++ /dev/null @@ -1,164 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> -<!-- Created from PDF via Acrobat SaveAsXML --> -<!-- Mapping table version: 28-February-2003 --> -<HTML> -<HEAD> -<META - name="DC.Title" - content="dumpprivacy" > -<META - name="DC.Contributor" - content="Ryder Ripps" > -<META - name="DC.Creator" - content="Pages" > -<META - name="DC.Date" - content="2010-03-02T22:09:45Z00:00" > -<META - name="DC.Date.Modified" - content="2010-03-02T22:09:45Z00:00" > -</HEAD> -<BODY text=black link=blue vlink=purple alink=fushia > -<DIV class="Part" - -><H1 - -><FONT size="+3" color="000"><B>Privacy Polic<FONT size="+3" color="000"><B>y -</H1 -><P - -><FONT size="+1" color="000"></B>Dump.Fm, Inc. (“Dump.Fm”) takes the private nature of your personal information very seriously. This Privacy Policy (which we adapted from a policy originally provided by <A href="http://www.automattic.com/"> -<FONT color="031CAA">Automattic</A> -<FONT color="000"> (<A href="http://www.wordpress.com/"> -<FONT color="031CAA">WordPress.com</A> -<FONT color="000">)) describes how we treat the information we collect when you visit and use the website available at Dump.Fm (the “Website”) and is made available under the <B>Creative Commons Sharealike</B>license. Please read this notice very carefully. </P -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Website Visitors </H2 -><P - -><FONT size="+1" color="000">Like most website operators, Dump.Fm collects non-personally-identifying information of the sort that web browsers and servers typically make available, such as the browser type, language preference, referring site, and the date and time of each visitor request. Dump.Fm’s purpose in collecting non-personally identifying information is to better understand how Dump.Fm’s visitors use its Website. From time to time, Dump.Fm may release non-personally-identifying information in the aggregate, e.g., by publishing a report on trends in the usage of its Website. </P -><P - ->Dump.Fm also collects potentially personally-identifying information like Internet Protocol (IP) addresses. Dump.Fm does not use such information to identify its visitors, however, and does not disclose such information, other than under the same circumstances that it uses and discloses personally-identifying information, as described below. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Gathering of Personally-Identifying Information </H2 -><P - -><FONT size="+1" color="000">Certain visitors to the Website choose to interact with Dump.Fm in ways that require Dump.Fm to gather personally-identifying information. The amount and type of information that Dump.Fm gathers depends on the nature of the interaction. For example, we ask visitors who sign up for a blog at Dump.Fm.com to provide a username and email address. Those who engage in transactions with Dump.Fm – by purchasing access to the Akismet comment spam prevention service, for example – are asked to provide additional information, including as necessary the personal and financial information required to process those transactions. In each case, Dump.Fm collects such information only insofar as is necessary or appropriate to fulfill the purpose of the visitor’s interaction with Dump.Fm. Dump.Fm does not disclose personally-identifying information other than as described below. And visitors can always refuse to supply personally-identifying information, with the caveat that it may prevent them from engaging in certain website-related activities. </P -><P - ->Dump.Fm does not collect personally identifiable information from children under the age of 13. If you believe that a child has provided Dump.Fm with personally identifiable information without the consent of his or her parent or guardian, please contact us at <A href="mailto:info@dump.fm"> -<FONT color="031CAA">info@dump.fm</A> -<FONT color="000">. If Dump.Fm becomes aware that a child under age 13 has provided us with personally identifiable information, we will delete such information. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Aggregated Statistics </H2 -><P - -><FONT size="+1" color="000">Dump.Fm may collect statistics about the behavior of visitors to the Website. For instance, Dump.Fm may monitor the most popular blogs on the Dump.Fm.com site to help identify spam. Dump.Fm may display this information publicly or provide it to others. However, Dump.Fm does not disclose personally-identifying information other than as described below. </P -><P - -><FONT size="+3" color="000">Protection of Certain Personally-Identifying Information </P -><P - -><FONT size="+1" color="000">Dump.Fm discloses potentially personally-identifying and personally-identifying information only to those of its employees, contractors and affiliated organizations that (i) need to know that information in order to process it on Dump.Fm’s behalf or to provide services available at the Website, and (ii) that have agreed not to disclose it to others. Some of those employees, contractors and affiliated organizations may be located outside of your home country; by using the Website, you consent to the transfer of such information to them. In addition, in some cases we may choose to buy or sell assets. In these types of transactions, user information is typically one of the business assets that is transferred. Moreover, if Dump.Fm or substantially all of its assets were acquired, or in the unlikely event that Dump.Fm goes out of business or enters bankruptcy, user information would be one of the assets that is transferred or acquired by a third party. You acknowledge that such transfers may occur, and that any acquiror of Dump.Fm may continue to use your personal and non-personal information only as set forth in this policy. Otherwise, Dump.Fm will not rent or sell potentially personally-identifying and personally-identifying information to anyone. </P -><P - ->Other than to its employees, contractors and affiliated organizations or as described above, Dump.Fm discloses potentially personally-identifying and personally-identifying information only when required to do so by law, or when Dump.Fm believes in good faith that disclosure is reasonably necessary to protect the property or rights of Dump.Fm, third parties or the public at large. If you are a registered user of the Dump.Fm Website and have supplied your email address, Dump.Fm may occasionally send you an email to tell you about new features, solicit your feedback, or just keep you up to date with what’s going on with Dump.Fm and our products. We primarily use our various product blogs to communicate this type of information, so we expect to keep this type of email to a minimum. If you send us a request (for example via a support email or via one of our feedback mechanisms), we reserve the right to publish it in order to help us clarify or respond to your request or to help us support other users. Dump.Fm takes all measures reasonably necessary to protect against the unauthorized access, use, alteration or destruction of potentially personally-identifying and personally-identifying information. </P -><P - ->You should also be aware that if you submit information to “chat rooms,” “forums” or “message boards” such information becomes public information, meaning that you lose any privacy rights you might have with regards to that information. Such disclosures may also increase your chances of receiving unwanted communications. </P -><P - ->For users outside the United States, please note that any personally-identifiable information you enter into the Website will be transferred out of your country and into the United States. You consent to such transfer through your use of the Website. You also warrant that you have the right to transfer such information outside your country and into the United States. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Links to Third Party Sites </H2 -><P - -><FONT size="+1" color="000">This Privacy Policy only applies to information collected by Dump.Fm. This Privacy Policy does not apply to the practices of companies that Dump.Fm does not own or control, or employees that Dump.Fm does not manage. The Website contains links to third party websites. Any information you provide to, or that is collected by, third-party sites may be subject to the privacy policies of those sites, if any. We encourage you to read such privacy policies of any third-party sites you visit. It is the sole responsibility of such third parties to adhere to any applicable restrictions on the disclosure of your personally-identifying information, and Dump.Fm and its affiliates shall not be liable for wrongful use or disclosure of your personally-identifying information by any third party. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Security </H2 -><P - -><FONT size="+1" color="000">All non-personally-identifying information, potentially personally-identifying and personally identifying-information described above is stored on restricted database servers. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Choice/Opt-out </H2 -><P - -><FONT size="+1" color="000">If we ever send you information by e-mail concerning new products, services or information that you did not expressly request, we will provide you with an e-mail address by which you may request no further notices. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Cookies </H2 -><P - -><FONT size="+1" color="000">A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser provides to the website each time the visitor returns. Dump.Fm uses cookies to help Dump.Fm identify and track visitors, their usage of the Dump.Fm Website, and their Website access preferences. Dump.Fm visitors who do not wish to have cookies placed on their computers should set their browsers to refuse cookies before using the Dump.Fm Website, with the drawback that certain features of Dump.Fm’s Website may not function properly without the aid of cookies. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Address Book Data </H2 -><P - -><FONT size="+1" color="000">Any external address book data (email contacts, etc.) that a user voluntarily gives Dump.Fm access to will only be used for the described feature (looking up friends, etc.), and will not be stored or repurposed. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Privacy Policy Changes </H2 -><P - -><FONT size="+1" color="000">Although most changes are likely to be minor, Dump.Fm may change its Privacy Policy from time to time, and in Dump.Fm’s sole discretion. If we do then we’ll notify you by posting the amended policy on the Website or by emailing you of the nature of the modifications along with a link to the modified document so that you can review it. In all cases, use of information we collect now is subject to the Privacy Policy in effect at the time such information is collected. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Review and Access </H2 -><P - -><FONT size="+1" color="000">Upon your request, we will provide you with a summary of the information we collect about you. You will have the opportunity to correct, update, modify or delete this information by sending an e-mail to <A href="mailto:info@dump.fm"> -<FONT color="031CAA">info@dump.fm</A> -<FONT color="000">. Please note that some information may remain in our records after deletion of your account. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+3" color="000">Contact Us </H2 -><P - -><FONT size="+1" color="000">If you have any questions about this policy or our site in general, please contact us at <A href="mailto:info@dump.fm"> -<FONT color="031CAA">info@dump.fm</A> -<FONT color="000">. </P -></DIV -></DIV -></BODY> -</HTML> diff --git a/static/profile.st b/static/profile.st deleted file mode 100755 index e3f8f44..0000000 --- a/static/profile.st +++ /dev/null @@ -1,149 +0,0 @@ -<html> - <head> - <title>$nick$'s dump.fm</title> - $head()$ - <link rel="stylesheet" type="text/css" media="screen" - href="/static/profile.css"> - <script src="/static/jquery.editinplace.1.0.1.packed.js" - type="text/javascript"></script> - <script src="/static/js/ajaxupload.js"></script> - - <script type="text/javascript" src="/static/jquery.editinplace.1.0.1.packed.js"></script> - <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" /> - - <script> - jQuery(document).ready(initProfile); - </script> - - </head> - <body> - $banner()$ - <div id="chatrap"> - <div id="headerbar"></div> - - <div id="log"> - <div id="loghead"> - </div> - <br> - <div id="posts"> - - <div id="cats"> - - $if(dumps)$ - <div id="lolbanner"> - <img src="/static/welcomebanner.gif"> - </div> - $if(dumps)$ - $dumps:{ d | $logged_dump(dump=d)$ }$ - <div id="profile"> - - <h2>$nick$</h2> - $if(avatar)$ - <img id="avatarPic" src="$avatar$" width="150px"/> - $else$ - <b id="avatarPic"><img src="/static/noinfo.png"></b> - $endif$ - - $if(is_home)$ - <div id="avatar-editing" style="display: none"> - <div id="avatar" class="editable">$avatar$</div> - <input id="upload" value="Upload Icon" type="submit"> - <img id="spinner" src="/static/spinner.gif" style="display: none" /> - </div> - $endif$ - - <h3>contact info</h3> - $if(contact)$ - <div id="contact" class="linkify">$contact$</div> - $else$ - <div><img id="contact" src="/static/noinfo.png"></div> - $endif$ - <br> - - <h3>bio</h3> - $if(bio)$ - <div id="bio" class="linkify">$bio$</div> - $else$ - <div><img id="bio" src="/static/noinfo.png"></div> - $endif$ - - $if(is_home)$ - <br> - <div id="edit-toggle"><a href="#">edit profile</a></div> - $endif$ - - <br> - <div id="date"> - <div type="text" id="datepicker"></div></div> - </div> - - $else$ - <h3> </h3> - <h3> </h3> - <h3> </h3> - <h3> </h3> - <h3> </h3> - <h3> </h3> - <div id="newuser"> - <h2>☺✌ Welcome to dump.fm ✌☺</h2> - <br><br> - - <h1>Step ❶</h1> - <h3>☟ Find a sweet image for your avatar, paste the URL below ☟</h3> - $if(avatar)$ - <img id="avatarPic" src="$avatar$" width="150px"/> - $else$ - <b id="avatarPic"></b> - $endif$ - - $if(is_home)$ - <div id="avatar-editing"> - <div id="avatar" class="editable">$avatar$</div> - <input id="upload" value="Upload" type="submit"> - <img id="spinner" src="/static/spinner.gif" style="display: none" /> - </div> - $endif$ - - <h1>Step ❷</h1> - <h3>☟ Enter some contact info below ☟</h3> - <div id="contact" class="$if(is_home)$editable$else$linkify$endif$">$contact$</div> - <br> - - <h1>Step ❸</h1> - <h3>☟ Enter some personal info below ☟</h3> - <div id="bio" class="$if(is_home)$editable$else$linkify$endif$">$bio$</div> - <br> - <h1>Step ❹</h1> - - <h3> <a href="/chat">Join the ♣ and start posting pictures!</a></h3> - <h3> </h3></div> - <h3> </h3> - <h3> </h3> - <h3> </h3> - <h3> </h3> - <h3> </h3> - $endif$ - - <p> </p> - <div id="pnav"> - - $if(next)$ - <div id="pnavn"><a href="/u/$nick$/$next$">next ☞</a></div> - $endif$ - - - $if(prev)$ - <div id="pnavo"> <a href="/u/$nick$/$prev$">☜ prev</a></div> - $endif$ - - <br><br> - </div> - - <div id="footer"> - $footer()$ - </div> - </div> - </div></div></div> -$preload()$ - </body> -</html> diff --git a/static/purple.gif b/static/purple.gif Binary files differdeleted file mode 100644 index 863aa44..0000000 --- a/static/purple.gif +++ /dev/null diff --git a/static/readyjoin.png b/static/readyjoin.png Binary files differdeleted file mode 100644 index a2b054b..0000000 --- a/static/readyjoin.png +++ /dev/null diff --git a/static/red.gif b/static/red.gif Binary files differdeleted file mode 100644 index 84bfc02..0000000 --- a/static/red.gif +++ /dev/null diff --git a/static/register.html b/static/register.html index 723a657..bbc124d 100644 --- a/static/register.html +++ b/static/register.html @@ -7,202 +7,12 @@ $(document).ready(initRegister); </script> <link rel="stylesheet" type="text/css" href="static/css/reset.css"> - + <link rel="stylesheet" type="text/css" href="static/css/register.css"> <link rel="shortcut icon" href="static/favicon.ico"> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dump.fm</title></head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dump.fm - register</title></head> -<style type="text/css"> - - - -<!-- - - -<!-- -.white a:link { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:visited { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:hover { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - background-color:#e3e3e3; - - color: #fff; -} -.white a:active { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -#main { - background-position:center; - width:460px; - margin: 0px auto -1px auto; -padding:25; -padding-top:5; - z-index:2; - opacity:0.9; - border-top-left-radius:10px; - border-top-right-radius:10px; - -webkit-border-top-left-radius:10px; - -webkit-border-top-right-radius:10px; - -moz-border-radius-topleft:10px; - -moz-border-radius-topright:10px; - border-bottom-left-radius:10px; - border-bottom-right-radius:10px; - -webkit-border-bottom-left-radius:10px; - -webkit-border-bottom-right-radius:10px; - -moz-border-radius-bottomleft:10px; - -moz-border-radius-bottomright:10px; - border:solid 2px #000; - position: relative; - background-color: #FFF; - background-position:center; - background-repeat:no-repeat; - box-shadow: 5px 5px 100px #c8cbce; --webkit-box-shadow: 5px 5px 100px #c8cbce; --moz-box-shadow: 5px 5px 100px #c8cbce; -} -#main img{margin-left:100; - -} -#logout7{ - top:5px; - position:relative; - font-size:13px; - margin-right: 10px; - float:right; - z-index: 999; - font-family: "Times New Roman", Times, serif; -} -#logo7{ - top:20px; - margin-left: 10%; - margin-right: 10%; - z-index:1000; - float:left; -} -#rapper7{ - top: 0px; - left:0px; - position:absolute; - width: 100%; - height: 78px; - z-index: 1000; -} -#bottombar{ - top: 69px; - left:0px; - position:absolute; - width: 100%; - height: 20px; - z-index: 1000; -} -p { - font-family: Arial, Helvetica, sans-serif; - font-size: 24px; -} -td { - font-family: Arial, Helvetica, sans-serif; - letter-spacing:-1px; - font-size: 12px; - color: #000000; -} -.btnav { border: 0px #000000 solid;} -body { - background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; - background-repeat:repeat-x; - background-position:top; - overflow:hidden; -margin:8%; -} -body a{border:0; -text-decoration:none; -} -.submit { - - - text-shadow: -1px 1px 1px #ccc; - - font-size:15px; -} -.field { - height:40px; - width:300px; - border:3px #000; - background:#e3e3e3; - margin:10px; - color:#000; - - font-size:30px; - -} -.txt { - font-family:Arial, Helvetica, sans-serif; - font-size:14px; -line-height:1.2; - text-shadow:1px 1px 0.5px #ccc; - word-spacing: 3px; -} - .line { - font-family:Arial, Helvetica, sans-serif; - letter-spacing: 1px; -line-height:1; - text-shadow:0px 1px 50px #999; - color:#000; - font-size:19px; -} -#nickInput {color:#000; -} -.no-cursor { cursor: none; } -.invisible { display: none !important; } -#cursor-big { position: absolute; z-index: 1000; } - -#submit { - - - display:inline-block; - width:300px; -height:35px; -margin-top:-5; -font-size:14px; -background-image:url(/static/btngrad1.png); -margin-left:140; -top:15px; - text-align:center; - z-index:100; - font-size:18px; - color:#fff; - text-shadow:1px 1px 1px rgba(0,0,0,1); - border-top-left-radius:5px; - border-top-right-radius:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-top-right-radius:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - border-bottom-left-radius:5px; - border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; - border:solid 1px #fff; -} - ---> - - - -</style> <body> <div id="rapper7"> @@ -221,7 +31,7 @@ top:15px; <p align="center"> - <div id="registerbox"> <a href="/"><img src="static/fundump.png"></a> + <div id="registerbox"> <a href="/"><img src="static/img/fundump.png"></a> <div align="right"> <h1> </h1> <h1><span>username</span> diff --git a/static/register2.html b/static/register2.html deleted file mode 100755 index 798a5ae..0000000 --- a/static/register2.html +++ /dev/null @@ -1,256 +0,0 @@ -<html> - -<head> - - <link rel="shortcut icon" href="static/favicon.ico"> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/js/sha1.js"></script> - <script type="text/javascript" src="static/js/register.js"></script> - <script> - $(document).ready(initRegister); - </script> - <link rel="stylesheet" type="text/css" href="static/css/reset.css"> - <link rel="shortcut icon" href="static/favicon.ico"> - - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dump.fm</title></head> -<style type="text/css"> -<!-- -.white a:link { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:visited { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -.white a:hover { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - background-color:#e3e3e3; - - color: #fff; -} -.white a:active { - text-decoration: none; - text-shadow: -1px 1px 1px #ccc; - color: #504F61; -} -#header7{ - background-color:#666; - background-image:url(/static/dblue2.png); - background-attachment:fixed; - margin: 0px auto -1px auto; - top: 0px; - width:100%; - left: 0px; - height: 60px; -} -#bar7{ - top:32px; - position:absolute; - font-family: Arial, Helvetica, sans-serif; - font-weight: bold; - width: 500px; - font-size: 20px; - left: 170px; - margin-left: 10%; - margin-right: 8%; - letter-spacing: -1px; - z-index: 999; -} -#main { - background-position:center; - width:500px; - margin: 0px auto -1px auto; - top:150px; - height:380px; - z-index:2; - opacity:0.9; - border-top-left-radius:10px; - border-top-right-radius:10px; - -webkit-border-top-left-radius:10px; - -webkit-border-top-right-radius:10px; - -moz-border-radius-topleft:10px; - -moz-border-radius-topright:10px; - border-bottom-left-radius:10px; - border-bottom-right-radius:10px; - -webkit-border-bottom-left-radius:10px; - -webkit-border-bottom-right-radius:10px; - -moz-border-radius-bottomleft:10px; - -moz-border-radius-bottomright:10px; - border:solid 4px #F5F5F5; - position: relative; - background-color: #FFF; - background-position:center; - background-repeat:no-repeat; -} -#logout7{ - top:5px; - position:relative; - font-size:13px; - margin-right: 10px; - float:right; - z-index: 999; - font-family: "Times New Roman", Times, serif; -} -#logo7{ - top:20px; - margin-left: 10%; - margin-right: 10%; - z-index:1000; - float:left; -} -#rapper7{ - top: 0px; - left:0px; - position:absolute; - width: 100%; - height: 78px; - z-index: 1000; -} -#bottombar{ - top: 69px; - left:0px; - position:absolute; - width: 100%; - height: 20px; - z-index: 1000; -} - -p { - font-family: Arial, Helvetica, sans-serif; - font-size: 24px; -} -td { - font-family: Arial, Helvetica, sans-serif; - letter-spacing:-1px; - font-size: 12px; - color: #000000; -} -.btnav { border: 0px #000000 solid;} -body { - - background-color:#e3e3e3; - - background-image:url(static/brokenlinkk.gif); - background-position:center; - - background-repeat:no-repeat; - overflow:hidden; -} -.submit { - - - text-shadow: -1px 1px 1px #ccc; - - font-size:15px; -} -.feild { - height:40px; - width:300px; - border:3px #ccc; - background:#e3e3e3; - margin:10px; - font-size:30px; -} -.txt { - font-family:Arial, Helvetica, sans-serif; - font-size:12px; - text-shadow: -1px 1px 1px #ccc; -} - .line { - font-family:Arial, Helvetica, sans-serif; - - letter-spacing: -1px; - color:#000; - font-size:18px; - -} -.line2 { - font-family:Arial, Helvetica, sans-serif; - margin-right:12px; - - - color:#000; - font-size:13px; - -} - - ---> -</style> - -<body> -<div id="rapper7"> -<div id="header7"> - - <div id="bottombar"></div> - - - - <div align="center"> - <p><img src="static/wordlogo2.gif" width="500" height="239"><br> - </p> - </div> - - <div class="white"></div> - <div align="center"><br /> - </div> -</div> -</div> -</div> -<div id="main" align="center"> - - <p align="center"><br /> - </p> - <div id="registerbox"> - <p align="right" class="line"> </p> - <p align="right" class="line"> </p> - <p align="center" class="line">Talk with pictures. - <h1 align="center"><br /> - </h1> - <div id="registerbox"> - <div align="right"> - <h1> </h1> - <h1><span>username</span> - <input type="text" class="feild"id="nickInput" /> - <br /> - - <span>password</span> - <input type="password"class="feild" id="passwordInput" /> - </h1> - <h1><span>email</span> - <input type="text" class="feild"id="emailInput" /> - </h1> - - <h1><span>registration code</span> - <input type="text" class="feild" id="codeInput" /> - </h1> - - <h1> </h1> - <h1> <br /> - - </h1> - <div align="center"> - - <input type="submit" class="submit" id="submit" value="Done" /> - </div> - </div> - </div> - </div> - <div align="center"></div> - </div> -</div> - </div></div> - -</div> - </h1> - </div> -</div> - -<div style="position: fixed; bottom: 3px; right: 3px; font-size: xx-small; z-index: 10;"><button onClick="getBackground()" title="Rotate background image" style="font-size: xx-small;">+</button></div> - -</body> -</html>
\ No newline at end of file diff --git a/static/right.gif b/static/right.gif Binary files differdeleted file mode 100644 index 1196f1b..0000000 --- a/static/right.gif +++ /dev/null diff --git a/static/scroll.js b/static/scroll.js deleted file mode 100755 index 955e188..0000000 --- a/static/scroll.js +++ /dev/null @@ -1,49 +0,0 @@ -// JavaScript Document -var scrollbar = new Control.ScrollBar('scrollbar_content','messagePane'); - -$('scroll_down_50').observe('click',function(event){ - scrollbar.scrollBy(-50); - event.stop(); -}); - -$('scroll_up_50').observe('click',function(event){ - scrollbar.scrollBy(50); - event.stop(); -}); - -$('scroll_top').observe('click',function(event){ - scrollbar.scrollTo('top'); - event.stop(); -}); - -$('scroll_bottom').observe('click',function(event){ - //to animate a scroll operation you can pass true - //or a callback that will be called when scrolling is complete - scrollbar.scrollTo('bottom',function(){ - if(typeof(console) != "undefined") - console.log('Finished scrolling to bottom.'); - }); - event.stop(); -}); - -$('scroll_second').observe('click',function(event){ - //you can pass a number or element to scroll to - //if you pass an element, it will be centered, unless it is - //near the bottom of the container - scrollbar.scrollTo($('second_subhead')); - event.stop(); -}); - -$('scroll_third').observe('click',function(event){ - //passing true will animate the scroll - scrollbar.scrollTo($('third_subhead'),true); - event.stop(); -}); - -$('scroll_insert').observe('click',function(event){ - $('scrollbar_content').insert('<p><b>Inserted: ' + $('repeat').innerHTML + '</b></p>'); - //you only need to call this if ajax or dom operations modify the layout - //this is automatically called when the window resizes - scrollbar.recalculateLayout(); - event.stop(); -});
\ No newline at end of file diff --git a/static/search.html b/static/search.html deleted file mode 100755 index 9f73317..0000000 --- a/static/search.html +++ /dev/null @@ -1,301 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> -<title>dump.fm - image search</title> - -<style type="text/css"> -<!-- -a { - font-size: 12px; - color: #f0e; -} -a:visited { - color: #f0e; -} -a:hover { - color: #f0e; -} -a:active { - color: #f0e; -} ---> -</style></head> - -<div align="center"> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script src="dumpsearch.js" type="text/javascript"></script> - <script type="text/javascript" src="all.js"></script> - <script type="text/javascript" src="cufon-yui.js"></script> - <script src="/static/js-global/FancyZoom.js" type="text/javascript"></script> - <script src="/static/js-global/FancyZoomHTML.js" type="text/javascript"></script> - <script type="text/javascript" src="futura.js"></script> - <style type="text/css"> - - - - - - - - - - - body { - font-size:13; - font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; - - -} -#rapper{ -} - #container { - text-align: left; - font-family: sans-serif; - color: #4E4848; - margin-left: auto; - margin-right: auto; - width: 1200px; - } - #description {display:none;width:790px;} - #description div, .post, .result {margin: -px 270px;width:470px;} - #description p > p,#description p {margin:0;line-height:.1;width:600;} - #description img {float:left;margin:0 12px 32px 0;} -table.search{font-family:Verdana,Arial,Helvetica,sans-serif;text-align:left;font-size:11px;color:#333}.gsc-trailing-more-results,.gsc-resultsHeader,.gsc-search-box{display:none}.gsc-results{padding-left:20px}#searchControl .gsc-control{width:550px;padding:10px;padding-left:20;}select, label{font:bold 11px Arial,Helvetica,sans-serif;color:#003;text-transform:uppercase;margin-right:5px;line-height:.1;}input#q{font:bold 11px Arial,Helvetica,sans-serif;color:#F00;height:2em;padding:3px;border-top:2px solid #999;border-right:2px solid #999;border-bottom:1px solid #999;border-left:1px solid #999;} -#logo{padding-left:20;} -.gsc-control img{ - max-width:500px; - width: expression(this.width > 500 ? 500: true); - max-height:400px; - height: expression(this.width > 500 ? 500: true); - - - </style> - <body onload="setupZoom()"> - -</div> -<form onSubmit="searchImages(); return false;" > <div id="rapper"> - <div align="center"> - <div align="center"> - <table class="search" width="425" border="0" cellpadding="5" cellspacing="0"> - <tr> - <td colspan="2"><p align="center"><img src="dumpsearch.gif" width="500" height="239"> </p> - - <div align="center"> - <input name="q" type="text" id="q" onChange="searchImages();" size="55%"> - <input type="submit" name="submit" id="submit" value="Search Images"> - </div> - <label> - </label> - </p> - <div align="right"></div></td> - </tr> - <table class="search" width="425" border="0" cellpadding="5" cellspacing="0"> - - -<a href="#" id="about">options</a></div> - </table> - - - <div id="description"> - <div align="right"><a href="#" class="closeinfo"></a> - </p> - </div> - <div> - - - <table class="search" width="425" border="0" cellpadding="5" cellspacing="0"> - <tr> - <td colspan="2"> - <p> - <label>where: - <select name="site" id="site" onChange="searchImages();"> - <option value="flickr.com" selected>flickr</option> - <option value="zooomr.com">zooomr</option> - <option value="photobucket.com">photobucket</option> - <option value="myspace.com">myspace</option> - <option value="wordpress.com">wordpress</option> - <option value="blogger.com">blogger</option> - <option value="typepad.com">typepad</option> - <option value="picsearch.com">picsearch</option> - <option value="webshots.com">webshots</option> - <option value="http://i.walmartimages.com/">walmart</option> - <option value="http://www.ibiblio.org">ibiblio</option> - <option value="gov">US Government</option> - <option value="deviantart.com">deviant art</option> - <option value="corbis.com">corbis</option> - <option value="msn.com">msn</option> - - <option value="made-in-china.com">made in china</option> - <option value="0" selected>EVERYWHERE</option> - </select> - </label> - <label> - <input name="showFaces" type="checkbox" onClick="searchImages();"> - Only Faces</label> - ★<label> hot shit</label>★ - <input type="radio" name="safeSearch" id="safeSearch2" value="off" onClick="searchImages();"checked> - Always ON - </p></td> - </tr> - - <tr> - - </tr> - <tr> - <td colspan="2"><p> - <label>File Type</label> - <input type="radio" name="type" value="jpg" onClick="searchImages();"> - JPG - <input name="type" type="radio" value="png" onClick="searchImages();"> - PNG - <input name="type" type="radio" value="bmp" onClick="searchImages();"> - BMP - <input type="radio" name="type" value="gif" onClick="searchImages();"> - GIF - <input type="radio" name="type" value="0" checked onClick="searchImages();"> - Any</p></td> - </tr> - <tr> - <td colspan="2"><p> - <label>Image Size</label> - <input type="radio" name="size" value="small" onClick="searchImages();"> - Small - <input name="size" type="radio" value="medium" onClick="searchImages();"> - Medium - <input type="radio" name="size" value="large" onClick="searchImages();"> - Large - <input type="radio" name="size" value="xlarge" onClick="searchImages();"> - Extra Large - <input type="radio" name="size" value="0" checked onClick="searchImages();"> - All Sizes</p></td> - </tr> - <tr> - <td colspan="2"><p> - <label>Image Color</label> - <input type="radio" name="color" value="bw" onClick="searchImages();"> - Black & White - <input name="color" type="radio" value="gray" onClick="searchImages();"> - Gray - <input type="radio" name="color" value="color" onClick="searchImages();"> - Color - <input type="radio" name="color" value="0" checked onClick="searchImages();"> - Whateva</p></td> - </tr> - </table> - </div> - </div> - - <tr> - <td colspan="2"><div id="searchControl">Loading...</div></td> - </tr> - </table> - </div> -</form> -<div align="center"> -</div> - <script type="text/javascript"> - google.load('search', '1'); - google.setOnLoadCallback(searchImages, true); - - function searchImages() { - var control = new google.search.SearchControl(); - control.setResultSetSize(google.search.Search.LARGE_RESULTSET); - control.setNoResultsString("Sorry but no images match your search criteria. Please modify your search query and try again."); - control.setLinkTarget(google.search.Search.LINK_TARGET_BLANK); - - var options = new google.search.SearcherOptions(); - options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); - - var searcher = new google.search.ImageSearch(); - - for (var i = 0; i < document.forms[0].safeSearch.length; i++) { - if (document.forms[0].safeSearch[i].checked) { - if (document.forms[0].safeSearch[i].value == "off") - searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_OFF); - else if (document.forms[0].safeSearch[i].value == "moderate") - searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_MODERATE); - else if (document.forms[0].safeSearch[i].value == "strict") - searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT); - else - searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, null); - break; - } - } - - for (var i = 0; i < document.forms[0].size.length; i++) { - if (document.forms[0].size[i].checked) { - if (document.forms[0].size[i].value == "small") - searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_SMALL); - else if (document.forms[0].size[i].value == "medium") - searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_MEDIUM); - else if (document.forms[0].size[i].value == "large") - searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_LARGE); - else if (document.forms[0].size[i].value == "xlarge") - searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_EXTRA_LARGE); - else - searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, null); - break; - } - } - - for (var i = 0; i < document.forms[0].type.length; i++) { - if (document.forms[0].type[i].checked) { - if (document.forms[0].type[i].value == "bmp") - searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_BMP); - else if (document.forms[0].type[i].value == "jpg") - searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_JPG); - else if (document.forms[0].type[i].value == "png") - searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_PNG); - else if (document.forms[0].type[i].value == "gif") - searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_GIF); - else - searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, null); - break; - } - } - - for (var i = 0; i < document.forms[0].color.length; i++) { - if (document.forms[0].color[i].checked) { - if (document.forms[0].color[i].value == "bw") - searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_BLACK_AND_WHITE ); - else if (document.forms[0].color[i].value == "gray") - searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_GRAYSCALE); - else if (document.forms[0].color[i].value == "color") - searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_COLOR); - else - searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, null); - break; - } - } - - var list = document.forms[0].site; - if (list.options[list.selectedIndex].value == 0) - searcher.setSiteRestriction(null); - else - searcher.setSiteRestriction(list.options[list.selectedIndex].value); - - for (var i = 0; i < document.forms[0].site.length; i++) { - if (document.forms[0].site[i].checked) { - if (document.forms[0].site[i].value == 0) - searcher.setSiteRestriction(null); - else - searcher.setSiteRestriction(document.forms[0].site[i].value); - break; - } - } - - if (document.forms[0].showFaces.checked) - searcher.setRestriction(GimageSearch.RESTRICT_IMAGETYPE, GimageSearch.IMAGETYPE_FACES); - else - searcher.setRestriction(GimageSearch.RESTRICT_IMAGETYPE); - - control.addSearcher(searcher, options); - control.draw(document.getElementById("searchControl")); - - control.execute(document.getElementById('q').value); - return false; - } - </script> -</div> </div> -</body> -</html>
\ No newline at end of file diff --git a/static/sendurlbtn1.png b/static/sendurlbtn1.png Binary files differdeleted file mode 100644 index 330212a..0000000 --- a/static/sendurlbtn1.png +++ /dev/null diff --git a/static/sendurlbtn2.png b/static/sendurlbtn2.png Binary files differdeleted file mode 100644 index 331b8c2..0000000 --- a/static/sendurlbtn2.png +++ /dev/null diff --git a/static/signin.gif b/static/signin.gif Binary files differdeleted file mode 100644 index 5ab623b..0000000 --- a/static/signin.gif +++ /dev/null diff --git a/static/signinblurb.png b/static/signinblurb.png Binary files differdeleted file mode 100644 index 1ea58dd..0000000 --- a/static/signinblurb.png +++ /dev/null diff --git a/static/simpledumplogo.png b/static/simpledumplogo.png Binary files differdeleted file mode 100644 index 1355e72..0000000 --- a/static/simpledumplogo.png +++ /dev/null diff --git a/static/spatter.jpeg b/static/spatter.jpeg Binary files differdeleted file mode 100644 index cfd37cb..0000000 --- a/static/spatter.jpeg +++ /dev/null diff --git a/static/talkwith.png b/static/talkwith.png Binary files differdeleted file mode 100644 index 7642fca..0000000 --- a/static/talkwith.png +++ /dev/null diff --git a/static/terms.html b/static/terms.html deleted file mode 100644 index c565e38..0000000 --- a/static/terms.html +++ /dev/null @@ -1,275 +0,0 @@ - -<head> - -<title>terms</title> - - - -</head> - -<body style="margin:0; width:500px;"> - -<div style="height:600px;width:500px;"> -<DIV class="Part" - -><H1 - align="center" -><FONT size="+2" color="#000000"><B>Accepting the Terms of Servic<FONT size="+2" color="#000000"><B>e -</H1 -> -<P - -><FONT size="+1"></B>The following Terms of Service agreement has been adapted from the Terms of Service found on <a href="http://www.tumblr.com">Tumblr</a>. The purpose of this website, <A href="http://www.dump.fm" target="_blank"> -<FONT color="#031CAA">www.dump.fm</A> - -<FONT color="#000000"> (the “Site”), owned and operated by Dump.Fm, Inc.(“Dump.Fm”), a New York corporation, is to provide web chat and publishing services. Please read these terms of service (“Agreement”) carefully before using the Site or any services provided on the Site (collectively, “Services”). By using or accessing the Services, you agree to become bound by all the terms and conditions of this Agreement. If you do not agree to all the terms and conditions of this Agreement, do not use the Services. The Services are accessed by You (“Subscriber” or “You”) under the following terms and conditions: </P -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>1. Access to the Services </H2 -><P - -><FONT size="+1"></B>Subject to the terms and conditions of this Agreement, Dump.Fm may offer to provide the Services, as described more fully on the Site, and which are selected by Subscriber, solely for Subscriber’s own use, and not for the use or benefit of any third party. Services shall include, but not be limited to, any services Dump.Fm performs for Subscriber, as well as the offering of any Content (as defined below) on the Site. Dump.Fm may change, suspend or discontinue theServices at any time, including the availability of any feature, database, or Content. Dump.Fmmay also impose limits on certain features and services or restrict Subscriber’s access to parts or all of the Services without notice or liability. Dump.Fm reserves the right, at its discretion, to modify these Terms of Service at any time by posting revised Terms of Service on the Site and by providing notice via e-mail, where possible, or on the Site. Subscriber shall be responsible forreviewing and becoming familiar with any such modifications. Use of the Services by Subscriberfollowing such modification constitutes Subscriber's acceptance of the terms and conditions ofthis Agreement as modified. </P -><P - ->Subscriber certifies to Dump.Fm that if Subscriber is an individual (i.e., not a corporate entity),Subscriber is at least 13 years of age. No one under the age of 13 may provide any personalinformation to or on Dump.Fm (including, for example, a name, address, telephone number oremail address). Subscriber also certifies that it is legally permitted to use the Services and accessthe Site, and takes full responsibility for the selection and use of the Services and access of theSite. This Agreement is void where prohibited by law, and the right to access the Site is revoked in such jurisdictions. Dump.Fm makes no claim that the Site may be lawfully viewed or thatContent may be downloaded outside of the United States. Access to the Content may not be legal by certain persons or in certain countries. If You access the Site from outside the United States, You do so at Your own risk and You are responsible for compliance with the laws of Your jurisdiction. </P -><P - ->Dump.Fm will use reasonable efforts to ensure that the Site and Services are available twenty-four hours a day, seven days a week. However, there will be occasions when the Site and/or Services will be interrupted for maintenance, upgrades and repairs or due to failure oftelecommunications links and equipment. Every reasonable step will be taken by Dump.Fm tominimize such disruption where it is within Dump.Fm’s reasonable control. </P -><P - ->You agree that neither Dump.Fm nor the Site will be liable in any event to you or any other party for any suspension, modification, discontinuance or lack of availability of the Site, the service,your Subscriber Content or other Content. </P -><P - ->Dump.Fm retains the right to create limits on use and storage in its sole discretion at any time with or without notice. </P -><P - ->Subscriber shall be responsible for obtaining and maintaining any equipment or ancillary services needed to connect to, access the Site or otherwise use the Services, including, withoutlimitation, modems, hardware, software, and long distance or local telephone service. Subscribershall be responsible for ensuring that such equipment or ancillary services are compatible withthe Services. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>2. Site Content</H2 -><P - -><FONT size="+1"></B>The Site and its contents are intended solely for the use of Dump.Fm Subscribers and may onlybe used in accordance with the terms of this Agreement. All materials displayed or performed on the Site, including, but not limited to text, graphics, logos, tools, photographs, images,illustrations, software or source code, and animations (other than Content posted by Subscriber (“Subscriber Content”)) are the property of Dump.Fm and/or third parties and are protected by United States and international copyright laws. All trademarks, service marks, and trade names are proprietary to Dump.Fm and/or third parties. Subscriber shall abide by all copyright notices, information, andrestrictions contained in any Content accessed through the Services. </P -><P - ->The Site is protected by copyright as a collective work and/or compilation, pursuant to U.S.copyright laws, international conventions, and other copyright laws. Other than as expressly setforth in this Agreement, Subscriber may not copy, modify, publish, transmit, upload, participate in the transfer or sale of, reproduce (except as provided in this Section), create derivative worksbased on, distribute, perform, display, or in any way exploit, any of the Content, software, materials, or Services in whole or in part. </P -><P - ->Subscriber may download or copy the Content, and other items displayed on the Site for download, for personal use only, provided that Subscriber maintains all copyright and other notices contained in such Content. Downloading, copying, or storing any Content for other thanpersonal, noncommercial use is expressly prohibited without prior written permission fromDump.Fm, or from the copyright holder identified in such Content's copyright notice. In theevent You download software from the Site, the software, including any files, images incorporated in or generated by the software, and the data accompanying the software(collectively, the “Software”) is licensed to You by Dump.Fm or third party licensors for Your personal, noncommercial use, and no title to the Software shall be transferred to You. You may own the Subscriber Content on which the Software is recorded, but Dump.Fm or third partylicensors retain full and complete title to the Software and all intellectual property rights therein. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>3. Subscriber Content </H2 -><P - -><FONT size="+1"></B>Subscriber shall own all Subscriber Content that Subscriber contributes to the Site, but herebygrants and agrees to grant Dump.Fm a non-exclusive, worldwide, royalty-free, transferable right and license (with the right to sublicense), to use, copy, cache, publish, display, distribute, modify,create derivative works and store such Subscriber Content and to allow others to do so (“ContentLicense”) in order to provide the Services. On termination of Subscriber’s membership to the Site and use of the Services, Dump.Fm shall make all reasonable efforts to promptly remove from the Site and cease use of the Subscriber Content; however, Subscriber recognizes and agrees that caching of or references to the Subscriber Content may not be immediately removed.Subscriber warrants, represents and agrees Subscriber has the right to grant Dump.Fm and theSite the rights set forth above. Subscriber represents, warrants and agrees that it will notcontribute any Subscriber Content that (a) infringes, violates or otherwise interferes with anycopyright or trademark of another party, (b) reveals any trade secret, unless Subscriber owns the trade secret or has the owner’s permission to post it, (c) infringes any intellectual property right of another or the privacy or publicity rights of another, (d) is libelous, defamatory, abusive, threatening, harassing, hateful, offensive or otherwise violates any law or right of any third party, (e) contains a virus, trojan horse, worm, time bomb or other computer programming routine orengine that is intended to damage, detrimentally interfere with, surreptitiously intercept orexpropriate any system, data or information, or (f) remains posted after Subscriber has beennotified that such Subscriber Content violates any of sections (a) to (e) of this sentence.Dump.Fm reserves the right to remove any Subscriber Content from the Site, suspend orterminate Subscriber’s right to use the Services at any time, or pursue any other remedy or relief available to Dump.Fm and/or the Site under equity or law, for any reason (including, but not limited to, upon receipt of claims or allegations from third parties or authorities relating to suchSubscriber Content or if Dump.Fm is concerned that Subscriber may have breached theimmediately preceding sentence), or for no reason at all. </P -></DIV -><H2 - -><FONT size="+2"><B>4. Restrictions</H2 -><P - -><FONT size="+1"></B>Subscriber is responsible for all of its activity in connection with the Services and accessing the Site. Any fraudulent, abusive, or otherwise illegal activity or any use of the Services or Content in violation of this Agreement may be grounds for termination of Subscriber’s right to Services or to access the Site. Subscriber may not post or transmit, or cause to be posted or transmitted,any communication or solicitation designed or intended to obtain password, account, or privateinformation from any Dump.Fm user. </P -><P - ->Use of the Site or Services to violate the security of any computer network, crack passwords orsecurity encryption codes, transfer or store illegal material including that are deemed threateningor obscene, or engage in any kind of illegal activity is expressly prohibited. Under nocircumstances will Subscriber use the Site or the Service to (a) send unsolicited e-mails, bulkmail, spam or other materials to users of the Site or any other individual, (b) harass, threaten,stalk or abuse any person or party, including other users of the Site, (c) create a false identity or to impersonate another person, or (d) post any false, inaccurate or incomplete material or deleteor revise any material that was not posted by You. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>5. Warranty disclaimer </H2 -><P - -><FONT size="+1"></B>Dump.Fm has no special relationship with or fiduciary duty to Subscriber. Subscriber acknowledges that Dump.Fm has no control over, and no duty to take any action regarding: which users gains access to the Site; which Content Subscriber accesses via the Site; what effects the Content may have on Subscriber; how Subscriber may interpret or use the Content; or whatactions Subscriber may take as a result of having been exposed to the Content. Much of theContent of the Site is provided by and is the responsibility of the user or subscriber who postedthe Content. Dump.Fm does not monitor the Content of the Site and takes no responsibility forsuch Content. Subscriber releases Dump.Fm from all liability for Subscriber having acquired ornot acquired Content through the Site. The Site may contain, or direct Subscriber to sites containing, information that some people may find offensive or inappropriate. Dump.Fm makes no representations concerning any content contained in or accessed through the Site, andDump.Fm will not be responsible or liable for the accuracy, copyright compliance, legality or decency of material contained in or accessed through the Site. </P -><P - ->Although Dump.Fm and the Site will make reasonable efforts to store and preserve the material residing on the Site, neither Dump.Fm nor the Site is responsible or liable in any way for thefailure to store, preserve or access Subscriber Content or other materials you transmit or archiveon the Site. You are strongly urged to take measures to preserve copies of any data, material, content or information you post or upload on the Site. You are solely responsible for creating back-ups of your Subscriber Content. </P -><P - ->The Services, Content, Site and any Software are provided on an "as is" basis, without warrantiesof any kind, either express or implied, including, without limitation, implied warranties ofmerchantability, fitness for a particular purpose or non-infringement. Dump.Fm makes no representations or warranties of any kind with respect to the Site, the Services, including anyrepresentation or warranty that the use of the Site or Services will (a) be timely, uninterrupted or error-free or operate in combination with any other hardware, software, system or data, (b) meet your requirements or expectations, (c) be free from errors or that defects will be corrected, (d) befree of viruses or other harmful components. </P -><P - ->To the fullest extent allowed by law, Dump.Fm disclaims any liability or responsibility for the accuracy, reliability, availability, completeness, legality or operability of the material or services provided on this Site. By using this Site, you acknowledge that Dump.Fm is not responsible orliable for any harm resulting from (1) use of the Site; (2) downloading information contained onthe Site including but not limited to downloads of content posted by subscribers; (3)unauthorized disclosure of images, information or data that results from the upload, download orstorage of content posted by subscribers; (4) the temporary or permanent inability to access orretrieve any Subscriber Content from the Site, including, without limitation, harm caused byviruses, worms, trojan horses, or any similar contamination or destructive program. </P -><P - ->Some states do not allow limitations on how long an implied warranty lasts, so the abovelimitations may not apply to Subscriber. </P -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>6. Third party websites </H2 -><P - -><FONT size="+1"></B>Users of the Site may gain access from the Site to third party sites on the Internet throughhypertext or other computer links on the Site. Third party sites are not within the supervision or control of Dump.Fm or the Site. Unless explicitly otherwise provided, neither Dump.Fm nor theSite make any representation or warranty whatsoever about any third party site that is linked tothe Site, or endorse the products or services offered on such site. Dump.Fm and the Site disclaim: (a) all responsibility and liability for content on third party websites and (b) anyrepresentations or warranties as to the security of any information (including, without limitation,credit card and other personal information) You might be requested to give any third party, and You hereby irrevocably waive any claim against the Site or Dump.Fm with respect to such sites and third party content. </P -><DIV class="Sect" - -><H2 - -><FONT size="+2"><B>7. Registration and security</H2 -><P - -><FONT size="+1"></B>As a condition to using Services, Subscriber will be required to register with Dump.Fm andselect a password and Dump.Fm URL. Subscriber shall provide Dump.Fm with accurate,complete, and updated registration information, including Subscriber’s e-mail address. Failure to do so shall constitute a breach of this Agreement, which may result in immediate termination of Subscriber's account. Subscriber may not (a) select or use as a Dump.Fm URL a name of another person with the intent to impersonate that person; or (b) use as a Dump.Fm URL a name subject to any rights of a person other than Subscriber without appropriate authorization. Dump.Fmreserves the right to refuse registration of, or cancel a Dump.Fm URL in its discretion. Subscriber shall be responsible for maintaining the confidentiality of Subscriber's Dump.Fmpassword. Subscriber is solely responsible for any use of or action taken under Subscriber’s password and accepts full responsibility for all activity conducted through Subscriber’s account and agrees to and hereby releases the Site and Dump.Fm from any and all liability concerningsuch activity. Subscriber agrees to notify Dump.Fm immediately of any actual or suspected loss, theft, or unauthorized use of Subscriber’s account or password. The Site will take reasonably security precautions when using the internet, telephone or other means to transport date or other communications, but expressly disclaims any and all liability for the accessing of any such datacommunications by unauthorized persons or entities. </P -><P - -><FONT size="+2"><B>8. Indemnity</P -><P - -><FONT size="+1"></B>Subscriber will indemnify and hold Dump.Fm, its directors, officers and employees, harmless,including costs and attorneys' fees, from any claim or demand made by any third party due to orarising out of Subscriber’s access to the Site, use of the Services, the violation of this Agreement by Subscriber, or the infringement by Subscriber, or any third party using the Subscriber's account, of any intellectual property or other right of any person or entity. </P -><P - -><FONT size="+2"><B>9. Limitation of liability</P -><P - -><FONT size="+1"></B>In no event shall Dump.Fm, its directors, officers, shareholders, employees or members be liablewith respect to the Site or the Services for (a) any indirect, incidental, punitive, or consequential damages of any kind whatsoever; (b) damages for loss of use, profits, data, images, SubscriberContent or other intangibles; (c) damages for unauthorized use, non-performance of the Site,errors or omissions; or (d) damages related to downloading or posting Content. Dump.Fm's andthe Site's collective liability under this agreement shall be limited to three hundred United StatesDollars. Some states do not allow the exclusion or limitation of incidental or consequentialdamages, so the above limitations and exclusions may not apply to Subscriber. </P -><P - -><FONT size="+2"><B>10. Fees and payment</P -><P - -><FONT size="+1"></B>Some of the Services require payment of fees. Subscriber shall pay all applicable fees, asdescribed on the Site in connection with such Services selected by Subscriber. Dump.Fm reserves the right to change its pricing and to institute new charges at any time, upon ten (10) days prior notice to Subscriber, which will be posted on the Site and e-mailed to Subscriber along with a link to the modified fee schedule so that You can review it. Use of the Services by Subscriber following such notification constitutes Subscriber's acceptance of any new orincreased charges. </P -><P - -><FONT size="+2"><B>11. Termination </P -><P - -><FONT size="+1"></B>Either party may terminate the Services at any time by notifying the other party by any means. Dump.Fm may also terminate or suspend any and all Services and access to the Siteimmediately, without prior notice or liability, if Subscriber breaches any of the terms or conditions of this Agreement. Upon termination of Subscriber's account, Subscriber’s right to use the Services, access the Site, and any Content will immediately cease. All provisions of this Agreement which by their nature should survive termination shall survive termination, including,without limitation, ownership provisions, warranty disclaimers, and limitations of liability. Termination of Your access to and use of the Site and the Services shall not relieve Subscriber of any obligations arising or accruing prior to such termination or limit any liability which Subscriber otherwise may have to Dump.Fm or the Site, including without limitation anyindemnification obligations contained herein. </P -><P - -><FONT size="+2"><B>12. Privacy</P -><P - -><FONT size="+1"></B>Please review our <A href="http://www.dump.fm/privacy"target="_blank"> - -<FONT color="#031CAA">Privacy Policy</A> -<FONT color="#000000">, which governs the use of personal information on the Site andto which Subscriber agrees to be bound as a user of the Site. </P -><P - -><FONT size="+2"><B>13. Miscellaneous</P -><P - -><FONT size="+1"></B>This Agreement (including the Privacy Policy), as modified from time to time, constitutes the entire agreement between You, the Site and Dump.Fm with respect to the subject matter hereof. This Agreement replaces all prior or contemporaneous understandings or agreements, written or oral, regarding the subject matter hereof. The failure of either party to exercise in any respect anyright provided for herein shall not be deemed a waiver of any further rights hereunder. Dump.Fm shall not be liable for any failure to perform its obligations here under where such failure results from any cause beyond Dump.Fm’s reasonable control, including, without limitation, mechanical, electronic or communications failure or degradation. If any provision of thisAgreement is found to be unenforceable or invalid, that provision shall be limited or eliminatedto the minimum extent necessary so that this Agreement shall otherwise remain in full force and effect and enforceable. This Agreement is not assignable, transferable or sublicensable by Subscriber except with Dump.Fm’s prior written consent. Dump.Fm may assign this Agreement in whole or in part at any time without Subscriber’s consent. This Agreement shall be governed by and construed in accordance with the laws of the state of Delaware without regard to theconflict of laws provisions thereof. No agency, partnership, joint venture, or employment is created as a result of this Agreement and Subscriber does not have any authority of any kind to bind Dump.Fm in any respect whatsoever. Any notice to the Site that is required or permitted by this Agreement shall be in writing and shall be deemed effective upon receipt, when sent by confirmed e-mail to info@dump.fm or when delivered in person by nationally recognized overnight courier or mailed by first class, registered or certified mail, postage prepaid, to</P -><P - -><I>Dump.Fm, Inc., 90-11 35th Ave Apt. 1L Jackson Hts, NY, Attn: Legal Dept. </I></P -> -<p><DIV class="Sect" - -> - <H1 - -><FONT size="+2"><B>14. Copyright Policy</b></H1 -></P -> -<p></B>Dump.Fm has adopted the following policy toward copyright infringement with respect to the Site in accordance with the Digital Millennium Copyright Act, a copy of which is located at <A href="#http://www.loc.gov/copyright/legislation/dmca.pdf"> - -<FONT color="#031CAA">http://www.loc.gov/copyright/legislation/dmca.pdf</A> -<FONT color="#000000">. The address of Dump.Fm's Designated Agent for copyright takedown notices (“Designated Agent”) is listed below. </P -></div> -<DIV class="Sect" - -></p> - <H2 - -><FONT size="+1"><B>Reporting Copyright Infringements </H2 -><P - -><FONT size="+1"></B>If You believe that content residing or accessible on the Site infringes a copyright, please send a notice of copyright infringement containing the following information to the Designated Agent at the address below: </P -><OL - type="1" -><LI - ->Identification of the work or material being infringed.</P -></LI -><LI - ->Identification of the material that is claimed to be infringing, including its location, withsufficient detail so that Dump.Fm is capable of finding and verifying its existence.</P -></LI -><LI - ->Contact information about the notifying party (the Notifying Party), including name<FONT size="+1"></B>, -address, telephone number and e-mail address. -</P -></LI -><LI - ->A statement that the Notifying Party has a good faith belief that the material is not -authorized by the copyright owner, its agent or law. -</P -></LI -> -<LI - ->A statement made under penalty of perjury that the information provided in the notice is accurate and that the Notifying Party is authorized to make the complaint on behalf of the copyright owner. </P -></LI -></OL -><P - ->6. The Notifying Party's physical or electronic signature. After the Designated Agent receives notification of an alleged infringement that meets all of the requirements above, Dump.Fm shall: </P -><OL - type="1" -><LI - ->Disable access to or remove material that it has a reasonable, good faith belief is copyrighted material that has been illegally copied and distributed by any subscriber tothe Site. </P -></LI -><LI - ->Dump.Fm will then immediately notify the subscriber responsible for the allegedly infringing material (the Offending Subscriber) that it has removed or disabled access to the material. </P -></LI -><LI - ->Dump.Fm reserves the right, at its discretion, to immediately terminate the account of anysubscriber who is the subject of repeated takedown notices.</P -></LI -></OL -></DIV -><DIV class="Sect" - -><H2 - -><FONT size="+1"><B>Filing Copyright Counterclaims </H2 -> -<P - -><FONT size="+1"></B>A subscriber who believes they are the wrongful subject of a copyright takedown notice, may filea counter notification with Dump.Fm, by providing the following items in writing to the Designated Agent at the address below: </P -><UL - type="disc" -><LI - ->The specific URLs of material that Dump.Fm has removed or to which Dump.Fm hasdisabled access. </P -></LI -><LI - ->User’s name, address, telephone number, and email address. </P -></LI -><LI - ->A statement that User consent to the jurisdiction of Federal District Court for the judicial district in which your address is located (or New York County, New York if your address is outside of the United States), and that User will accept service of process from theperson who provided notification under subsection (c)(1)(C) or an agent of such person. </P -></LI -><LI - ->The following statement: "I swear, under penalty of perjury, that I have a good faith beliefthat the material was removed or disabled as a result of a mistake or misidentification of the material to be removed or disabled." </P -></LI -></UL -> -<P - ->• User’s signature.Upon receipt of a counterclaim, Dump.Fm will forward it to the party who submitted the original copyright infringement claim. The original complainant will then have 10 days to notify us that he or she has filed legal action relating to the allegedly infringing material. If Dump.Fm does not receive any such notification within 10 days, we may restore the material to the Site. </P -></DIV -></DIV> - -</p> - -</div> -</div> -</div> - -</body> -</html> diff --git a/static/test.html b/static/test.html deleted file mode 100755 index 8cffc8d..0000000 --- a/static/test.html +++ /dev/null @@ -1,36 +0,0 @@ -<html> - <head> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - - <script> - Start = new Date().getTime(); - Timestamp = new Date().getTime(); - - function refresh() { - var onSuccess = function(json) { - Timestamp = json.timestamp; - $('body').prepend('<div>' + (Timestamp - Start) + ": " + json.messages.length + " messages</div>"); - setTimeout(refresh, 1000); - }; - var onError = function(resp, textStatus, errorThrown) { - $('body').prepend('<div style="color: red">' + textStatus + ', ' + errorThrown + '</div>'); - setTimeout(refresh, 1000); - }; - - $.ajax({ - type: 'GET', - timeout: 5000, - url: "/refresh", - data: { 'room': "RoomA", 'since': Timestamp }, - cache: false, - dataType: 'json', - success: onSuccess, - error: onError - }); - } - $(document).ready(refresh); - </script> - </head> - <body> - </body> -</html> diff --git a/static/text.gif b/static/text.gif Binary files differdeleted file mode 100644 index c6958c7..0000000 --- a/static/text.gif +++ /dev/null diff --git a/static/thumbup.gif b/static/thumbup.gif Binary files differdeleted file mode 100644 index 5b50b08..0000000 --- a/static/thumbup.gif +++ /dev/null diff --git a/static/topgrad.png b/static/topgrad.png Binary files differdeleted file mode 100755 index 7fd6345..0000000 --- a/static/topgrad.png +++ /dev/null diff --git a/static/trash/20bar.png b/static/trash/20bar.png Binary files differdeleted file mode 100644 index 1bbd234..0000000 --- a/static/trash/20bar.png +++ /dev/null diff --git a/static/trash/20bar2.png b/static/trash/20bar2.png Binary files differdeleted file mode 100644 index 1bbd234..0000000 --- a/static/trash/20bar2.png +++ /dev/null diff --git a/static/trash/20bar3.png b/static/trash/20bar3.png Binary files differdeleted file mode 100644 index 1b05876..0000000 --- a/static/trash/20bar3.png +++ /dev/null diff --git a/static/trash/20bar4.png b/static/trash/20bar4.png Binary files differdeleted file mode 100644 index 80db403..0000000 --- a/static/trash/20bar4.png +++ /dev/null diff --git a/static/trash/20bar5.png b/static/trash/20bar5.png Binary files differdeleted file mode 100644 index 51f2a2a..0000000 --- a/static/trash/20bar5.png +++ /dev/null diff --git a/static/trash/20bar6.png b/static/trash/20bar6.png Binary files differdeleted file mode 100644 index 93dd55a..0000000 --- a/static/trash/20bar6.png +++ /dev/null diff --git a/static/trash/background13.gif b/static/trash/background13.gif Binary files differdeleted file mode 100755 index d087dad..0000000 --- a/static/trash/background13.gif +++ /dev/null diff --git a/static/trash/background4.gif b/static/trash/background4.gif Binary files differdeleted file mode 100755 index 675add6..0000000 --- a/static/trash/background4.gif +++ /dev/null diff --git a/static/trash/baygrad.png b/static/trash/baygrad.png Binary files differdeleted file mode 100644 index e80c347..0000000 --- a/static/trash/baygrad.png +++ /dev/null diff --git a/static/trash/bg-random.gif b/static/trash/bg-random.gif Binary files differdeleted file mode 100755 index 12ce8c5..0000000 --- a/static/trash/bg-random.gif +++ /dev/null diff --git a/static/trash/bg4.png b/static/trash/bg4.png Binary files differdeleted file mode 100755 index e20fda8..0000000 --- a/static/trash/bg4.png +++ /dev/null diff --git a/static/trash/bg55.png b/static/trash/bg55.png Binary files differdeleted file mode 100755 index f16a548..0000000 --- a/static/trash/bg55.png +++ /dev/null diff --git a/static/trash/bgb.png b/static/trash/bgb.png Binary files differdeleted file mode 100755 index 3a1c5d2..0000000 --- a/static/trash/bgb.png +++ /dev/null diff --git a/static/trash/bgpat.gif b/static/trash/bgpat.gif Binary files differdeleted file mode 100755 index 86edce9..0000000 --- a/static/trash/bgpat.gif +++ /dev/null diff --git a/static/trash/bgto.gif b/static/trash/bgto.gif Binary files differdeleted file mode 100755 index 3411a54..0000000 --- a/static/trash/bgto.gif +++ /dev/null diff --git a/static/trash/blink.gif b/static/trash/blink.gif Binary files differdeleted file mode 100755 index 0776f7f..0000000 --- a/static/trash/blink.gif +++ /dev/null diff --git a/static/trash/bluego.png b/static/trash/bluego.png Binary files differdeleted file mode 100755 index 8bcd35f..0000000 --- a/static/trash/bluego.png +++ /dev/null diff --git a/static/trash/bottoml.png b/static/trash/bottoml.png Binary files differdeleted file mode 100755 index 0f52893..0000000 --- a/static/trash/bottoml.png +++ /dev/null diff --git a/static/trash/bottomr.png b/static/trash/bottomr.png Binary files differdeleted file mode 100755 index 5904272..0000000 --- a/static/trash/bottomr.png +++ /dev/null diff --git a/static/trash/britglobe2.gif b/static/trash/britglobe2.gif Binary files differdeleted file mode 100755 index c972e08..0000000 --- a/static/trash/britglobe2.gif +++ /dev/null diff --git a/static/trash/brokenlink.gif b/static/trash/brokenlink.gif Binary files differdeleted file mode 100755 index 0e18a55..0000000 --- a/static/trash/brokenlink.gif +++ /dev/null diff --git a/static/trash/bubley.png b/static/trash/bubley.png Binary files differdeleted file mode 100755 index fe6eb82..0000000 --- a/static/trash/bubley.png +++ /dev/null diff --git a/static/trash/cat.jpeg b/static/trash/cat.jpeg Binary files differdeleted file mode 100755 index f6bfa16..0000000 --- a/static/trash/cat.jpeg +++ /dev/null diff --git a/static/trash/cloudbg.png b/static/trash/cloudbg.png Binary files differdeleted file mode 100755 index f397899..0000000 --- a/static/trash/cloudbg.png +++ /dev/null diff --git a/static/trash/cloudbg1.png b/static/trash/cloudbg1.png Binary files differdeleted file mode 100755 index f397899..0000000 --- a/static/trash/cloudbg1.png +++ /dev/null diff --git a/static/trash/cloudbg2.png b/static/trash/cloudbg2.png Binary files differdeleted file mode 100755 index a1d2b6e..0000000 --- a/static/trash/cloudbg2.png +++ /dev/null diff --git a/static/trash/d.png b/static/trash/d.png Binary files differdeleted file mode 100755 index 63a7bbb..0000000 --- a/static/trash/d.png +++ /dev/null diff --git a/static/trash/d3d1.gif b/static/trash/d3d1.gif Binary files differdeleted file mode 100755 index 0e88f7b..0000000 --- a/static/trash/d3d1.gif +++ /dev/null diff --git a/static/trash/dblue.png b/static/trash/dblue.png Binary files differdeleted file mode 100755 index 3a99764..0000000 --- a/static/trash/dblue.png +++ /dev/null diff --git a/static/trash/dddump.png b/static/trash/dddump.png Binary files differdeleted file mode 100755 index 593f9a2..0000000 --- a/static/trash/dddump.png +++ /dev/null diff --git a/static/trash/dddump2.png b/static/trash/dddump2.png Binary files differdeleted file mode 100755 index df200c7..0000000 --- a/static/trash/dddump2.png +++ /dev/null diff --git a/static/trash/dfm.png b/static/trash/dfm.png Binary files differdeleted file mode 100755 index 5e8357e..0000000 --- a/static/trash/dfm.png +++ /dev/null diff --git a/static/trash/dumgradbub2.png b/static/trash/dumgradbub2.png Binary files differdeleted file mode 100755 index 1de255d..0000000 --- a/static/trash/dumgradbub2.png +++ /dev/null diff --git a/static/trash/dump.gif b/static/trash/dump.gif Binary files differdeleted file mode 100755 index f1633be..0000000 --- a/static/trash/dump.gif +++ /dev/null diff --git a/static/trash/dumpbgword.gif b/static/trash/dumpbgword.gif Binary files differdeleted file mode 100755 index 27754fa..0000000 --- a/static/trash/dumpbgword.gif +++ /dev/null diff --git a/static/trash/dumpbub.png b/static/trash/dumpbub.png Binary files differdeleted file mode 100755 index 382a25c..0000000 --- a/static/trash/dumpbub.png +++ /dev/null diff --git a/static/trash/dumpd.gif b/static/trash/dumpd.gif Binary files differdeleted file mode 100755 index e571668..0000000 --- a/static/trash/dumpd.gif +++ /dev/null diff --git a/static/trash/dumpd.png b/static/trash/dumpd.png Binary files differdeleted file mode 100755 index 0f56f50..0000000 --- a/static/trash/dumpd.png +++ /dev/null diff --git a/static/trash/dumpl2.png b/static/trash/dumpl2.png Binary files differdeleted file mode 100755 index f0c7263..0000000 --- a/static/trash/dumpl2.png +++ /dev/null diff --git a/static/trash/favicon6.ico b/static/trash/favicon6.ico Binary files differdeleted file mode 100755 index 027dae5..0000000 --- a/static/trash/favicon6.ico +++ /dev/null diff --git a/static/trash/favicon7.ico b/static/trash/favicon7.ico Binary files differdeleted file mode 100755 index 064a3f9..0000000 --- a/static/trash/favicon7.ico +++ /dev/null diff --git a/static/trash/footer1.png b/static/trash/footer1.png Binary files differdeleted file mode 100755 index b471698..0000000 --- a/static/trash/footer1.png +++ /dev/null diff --git a/static/trash/forealz.gif b/static/trash/forealz.gif Binary files differdeleted file mode 100755 index 63723bf..0000000 --- a/static/trash/forealz.gif +++ /dev/null diff --git a/static/trash/fuckit.gif b/static/trash/fuckit.gif Binary files differdeleted file mode 100755 index 9f94cf6..0000000 --- a/static/trash/fuckit.gif +++ /dev/null diff --git a/static/trash/gaga.gif b/static/trash/gaga.gif Binary files differdeleted file mode 100755 index efaf4eb..0000000 --- a/static/trash/gaga.gif +++ /dev/null diff --git a/static/trash/getstarted.gif b/static/trash/getstarted.gif Binary files differdeleted file mode 100755 index b581589..0000000 --- a/static/trash/getstarted.gif +++ /dev/null diff --git a/static/trash/getstarted.html b/static/trash/getstarted.html deleted file mode 100755 index c1ac1b1..0000000 --- a/static/trash/getstarted.html +++ /dev/null @@ -1,95 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title>dump.fm</title> -<link rel="stylesheet" type="text/css" href="main2.css"> - <link rel="stylesheet" type="text/css" href="static/reset.css"> - <link rel="shortcut icon" href="static/favicon.ico"> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/sha1.js"></script> - <script type="text/javascript" src="static/register.js"></script> - - - <script> - $(document).ready(initRegister); - </script> - -<style type="text/css"> -<!-- -a:link { - text-decoration: none; - -} -a:visited { - text-decoration: none; - border: 0px; -} -a:hover { - text-decoration: none; - border: 0px; -} -a:active { - text-decoration: none; - border: 0px; -} -img{border: 0px;} ---> -</style> -</head> -<body> - -<div id="apDiv2"> - <div align="center"><img src="dfm.png" width="384" height="136" /> - </div> - <div id="about"> - <p align="left"><a href="room.html"><img src="try.gif" width="159" height="96" /></a></p> -</div> - <div id="signinbg"></div> - <div id="signin"> - <div align="right"> - <div id="registerbox"> - <h1>Sign Up!<br /> - <span>Nickname</span> - <input type="text" id="nickInput" size="16" /> - <br /> - <span>Email</span> - <input type="text" id="emailInput" size="20" /> - <br /> - <span>Password</span> - <input type="password" id="passwordInput" size="17" /> - <br /> - - <input type="submit" id="submit" value="YEAH!!!" /> - </h1> - </div> - - <div id="confirmationbox" style="display: none"> - <h1>You've registered!</h1> - <span>Please wait as you're redirected to the chat.</span> - </div> -</div> -</div></div> - <div class="info" id="info"> - <div align="center" class="info">* © 2009 dump.fm - * About Us - * Contact - * Blog - * Goodies - - * Help - * Terms - * Privacy</div> - </div> - - -</div> - -<div id="bottom"> - <div align="center"></div> -</div> - -<div id="plane"></div> -<br /> -</body> -</html> diff --git a/static/trash/headerbg.png b/static/trash/headerbg.png Binary files differdeleted file mode 100644 index 9f218f9..0000000 --- a/static/trash/headerbg.png +++ /dev/null diff --git a/static/trash/headerbg1.png b/static/trash/headerbg1.png Binary files differdeleted file mode 100644 index 9f218f9..0000000 --- a/static/trash/headerbg1.png +++ /dev/null diff --git a/static/trash/headerbg2.png b/static/trash/headerbg2.png Binary files differdeleted file mode 100644 index 71eee98..0000000 --- a/static/trash/headerbg2.png +++ /dev/null diff --git a/static/trash/headerbg3.png b/static/trash/headerbg3.png Binary files differdeleted file mode 100644 index 3c8902b..0000000 --- a/static/trash/headerbg3.png +++ /dev/null diff --git a/static/trash/index5.html b/static/trash/index5.html deleted file mode 100755 index b30e42f..0000000 --- a/static/trash/index5.html +++ /dev/null @@ -1,138 +0,0 @@ -<html> - <head> - <title>dump.fm</title> - <link rel="stylesheet" type="text/css" href="static/reset.css"> - <link rel="stylesheet" type="text/css" href="static/pichat.css"> - <link rel="stylesheet" type="text/css" href="static/style.css"> - - - - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/pichat.js"></script> - <link rel="shortcut icon" href="static/favicon.ico"> - -<script type="text/javascript"><!-- - $(document).ready(function() { - - // nav tab animation - var navDuration = 150; //time in miliseconds - var navJumpHeight = "5px"; - - $('#nav1 li').hover(function() { - $(this).animate({ top : "-="+navJumpHeight }, navDuration); - }, function() { - $(this).animate({ top : "15px" }, navDuration); - }); - - - // nav animation2 - $('#nav_move').css({ - width: $('#nav2 li:first a').width()+20, - height: $('#nav2 li:first a').height()+20 - }); - $('#nav2 li:first a').addClass('cur'); - - $('#nav2 a').click(function() { - var offset = $(this).offset(); - var offsetBody = $('#center_wrapper').offset(); //find the offset of the wrapping div - $('#nav_move').animate( - { - width: $(this).width()+20, - height: $(this).height()+20, - left: (offset.left - offsetBody.left - 143) - }, - { duration: 350, easing: 'easeInOutCirc' } - ); - $('.cur').removeClass('cur'); - $(this).addClass('cur'); - return false; - }); - - - // list animation - var fadeDuration = 150; //time in milliseconds - - $('#list1 li a').hover(function() { - $(this).animate({ paddingLeft: '30px' }, fadeDuration); - $(this).children('span').show().animate({ left: -5 }, fadeDuration); - }, function() { - $(this).animate({ paddingLeft: '15px' }, fadeDuration); - $(this).children('span').animate({ left: -35 }, fadeDuration).fadeOut(fadeDuration); - }); - - - $('.see_code').click(function() { - if($(this).parent().next().is(':visible')) { - $(this).html('+ Show Code'); - $(this).parent().next().toggle(); - } else { - $(this).html('- Hide Code'); - $(this).parent().next().toggle(); - } - return false; - }); - - });//doc ready -// --></script> - - - - <script type="text/javascript"> -function showPopup(url) { -newwindow=window.open(url,'name','height=600,width=820,top=30,left=10,resizable'); -if (window.focus) {newwindow.focus()} -} -</script> - </head> - <body> - <div id="content"> - <div id="logo"> -<img src="static/dumpbub.png" width="367" height="95"> - </div> - - <div id="chatbox"> - <div id="welcomebar" style="display: none"> - <span>Welcome, </span> - <span id="nickspan"></span> - </div> - <div id="messagetabs"> - <ul id="nav1"> - - <div align="right"><li style="top: 15px;"><a href="log.h"><img src="static/log4.png" width="97" height="39"></span></a></li> -</div> - </ul> - </div> - <div id="rapper"> - <div id="userListicon"> - - <div align="left"> - <p>UsrLst</p> -</div> - </div> - <div id="popout"> - <div align="right"><a href="http://dump.fm"onClick='showPopup(this.href);return(false);'>popout room</a></div> - </div> - <div id="userList"></div> - - <div id="messagePane"> - - <div id="messageList"></div> - <div id="msgInputDiv"> - <input id="msgInput" type="input" disabled="disabled" /> - <input id="msgSubmit" type="submit" value="Send Image URL" - disabled="disabled" /> - </div> - </div> - </div> - - <div id="lillogo" align="center"> - <div align="center"> - <div id="binfo"> - <p>dump.fm lets you talk with pictures. beta 0.0127! <img src="static/lillogo.png" width="16" height="16"></p> - </div> - </div> - </div> - - <div class="content"> </div> - </body> -</html> diff --git a/static/trash/lil-wayne.jpg b/static/trash/lil-wayne.jpg Binary files differdeleted file mode 100755 index 34c6481..0000000 --- a/static/trash/lil-wayne.jpg +++ /dev/null diff --git a/static/trash/lillogo.png b/static/trash/lillogo.png Binary files differdeleted file mode 100755 index fff9d17..0000000 --- a/static/trash/lillogo.png +++ /dev/null diff --git a/static/trash/log4.png b/static/trash/log4.png Binary files differdeleted file mode 100755 index de76494..0000000 --- a/static/trash/log4.png +++ /dev/null diff --git a/static/trash/logo.png b/static/trash/logo.png Binary files differdeleted file mode 100755 index a52b0c9..0000000 --- a/static/trash/logo.png +++ /dev/null diff --git a/static/trash/lolz.gif b/static/trash/lolz.gif Binary files differdeleted file mode 100755 index ce248c5..0000000 --- a/static/trash/lolz.gif +++ /dev/null diff --git a/static/trash/main.css b/static/trash/main.css deleted file mode 100755 index b3eef67..0000000 --- a/static/trash/main.css +++ /dev/null @@ -1,188 +0,0 @@ -@charset "UTF-8"; -/* CSS Document */ - -#apDiv2 { - position:relative; - top:100px; - width:700px; - margin: 0px auto -1px auto; - height: 300px; - z-index: 3; -} -#info { - position:relative; - top:200px; - width:700px; - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; -} - -#front { - position:fixed; - top:150px; -} -#infopage { - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - font-size: 10px; - - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; -} -#signin { - position:absolute; - left:0px; - width:410px; - height:281px; - - z-index:3; - -} -#signinbg { - position:absolute; - left:0px; - width:410px; - height:281px; - background-image: url(logbg.png); - z-index:1; -} -#about { - position:absolute; - width:300px; - height: 230px; - left:410px; - line-height: 18px; - padding-left: 20px; - ; - font-weight: bold; - color: #000; - z-index:2; - top: 177px; -} -#input { - padding-right:15px; - line-height:28px; - font-size: 24px; - font-weight: bolder; -} -body,td,th { - font-family: Arial, Helvetica, sans-serif; - font-size: 16px; - line-height: 40px; -} -#apDiv1 div #input #form1 label { - font-size: 12px; - color: #333; -} -.re { - font-size: 10px; -} -#apDiv2 #about div { - font-size: 10px; - color: #424143; -} -#top { - position:absolute; - left:0px; - top:0px; - width:100%; - height:32px; - z-index:2; - background-color: #CCC; -} -#apDiv3 { - position:fixed; - left:0px; - top:0px; - width:68px; - height:68px; - background-image: url(topl.png); -} -#apDiv4 { - position:fixed; - top:0px; - width:68px; - height:68px; - - right: 0px; - background-image: url(topr.png); -} -#bottom { - position:absolute; - left:0px; - bottom:0px; - width:100%; - height:10px; - z-index:1; - font-size: 10px; - line-height: 5px; -} -#apDiv5 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - left: 0px; - background-image: url(bottoml.png); -} -#apDiv6 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - right: 0px; - background-image: url(bottomr.png); -} -#bg { - position:absolute; - left:0px; - top:0px; - width:100%; - height:100%; - z-index:2; - background-image:url(grad2.jpg); -} -body { - background-image: url(bg4.png); - background-repeat: repeat-x; - background-attachment:fixed; -} -#plane { - position:fixed; - top:9px; - right:0px; - width:100%; - height:100%; - z-index:1; - background-image: url(cloudbg1.png); - background-repeat: no-repeat; - background-position:center; - - -} -#registerbox { - padding-left:20px; - font-family:Arial, Helvetica, sans-serif; - font-size:12px; - padding-right:85px; - line-height:28px; -} -.form { font-size: 14px; color="#990000"; } -.info { - font-size: 10px; -} -.info { - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; - color: #999; -} diff --git a/static/trash/main2.css b/static/trash/main2.css deleted file mode 100755 index 5eeab65..0000000 --- a/static/trash/main2.css +++ /dev/null @@ -1,364 +0,0 @@ -@charset "UTF-8"; -/* CSS Document */ - -#apDiv2 { - position:relative; - top:30px; - width:700px; - margin: 0px auto -1px auto; - height: 300px; - z-index: 3; -} -.white a:link { - text-decoration: none; - color: #504F61; -} -.white a:visited { - text-decoration: none; - color: #504F61; -} -.white a:hover { - text-decoration: none; - color: #fff; -} -.white a:active { - text-decoration: none; - color: #504F61; -} -#header7{ - background-color:#666; - background-image:url(/static/dblue.png); - background-attachment:fixed; - margin: 0px auto -1px auto; - top: 0px; - width:100%; - left: 0px; - height: 60px; -} -#bar7{ - top:32px; - position:absolute; - font-family: Arial, Helvetica, sans-serif; - font-weight: bold; - width: 500px; - font-size: 20px; - left: 200px; - margin-left: 12%; - margin-right: 10%; - letter-spacing: -1px; - z-index: 999; -} -#logout7{ - top:5px; - position:relative; - font-size:12px; - margin-right: 10px; - float:right; - z-index: 999; - font-family: "Times New Roman", Times, serif; -} -#logo7{ - top:20px; - z-index:1000; -} -#rapper7{ - top: 0px; - left:0px; - position:absolute; - width: 100%; - height: 60px; - z-index: 1000; -} -p { - font-family: "Times New Roman", Times, serif; - font-size: 12px; -} -td { - font-family: Arial, Helvetica, sans-serif; - letter-spacing:-1px; - font-size: 12px; - color: #000000; -} -.btnav { border: 0px #000000 solid;} -body { - background-image: url(/static/bg5.png); - background-repeat: repeat-x; -} - -#txt { - position:absolute; - top:115px; - width:450px; - margin: 0px auto -1px auto; - height: 18px; - z-index: 3; - line-height: 18px; - font-weight: bold; - color: #999; - font-size: 14px; -} -#info { - position:relative; - top:200px; - width:700px; - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; -} -#header { - position:relative; - background:#fff url("cloudbg2.png") no-repeat 0 0; - background-position:center; - width:80%; - margin: 0px auto -1px auto; - top:26px; - height:600px; - z-index:2; - opacity:0.9; - -moz-border-radius-topleft:10px; - -moz-border-radius-bottomleft:10px; - -moz-border-radius-bottomright:10px; - -moz-border-radius-topleft:10px; - -moz-border-radius-topright:10px; - border-top-left-radius:10px; - border-top-right-radius:10px; - min-width: 800px; - border-color: #000; - border: 1px; -} -.round { - -moz-border-radius:5px; - -webkit-border-radius:5px; -} -.round-top-right { - -moz-border-radius-topright:5px; - -webkit-border-top-right-radius:5px; -} -.round-right { - -moz-border-radius-topright:5px; - -moz-border-radius-bottomright:5px; - -webkit-border-top-right-radius:5px; - -webkit-border-bottom-right-radius:5px; -} -.round-bottom-right { - -moz-border-radius-bottomright:5px; - -webkit-border-bottom-right-radius:5px; -} -.round-bottom { - -moz-border-radius-topright:0; - -moz-border-radius-topleft:0; - -moz-border-radius-bottomright:5px; - -moz-border-radius-bottomleft:5px; - -webkit-border-top-right-radius:0; - -webkit-border-top-left-radius:0; - -webkit-border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; -} -.round-bottom-left { - -moz-border-radius-bottomleft:5px; - -webkit-border-bottom-left-radius:5px; -} -.round-left { - -moz-border-radius-topleft:5px; - -moz-border-radius-bottomleft:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-bottom-left-radius:5px; -} -.round-top-left { - -moz-border-radius-topleft:5px; - -webkit-border-top-left-radius:5px; -} -.round-top { - -moz-border-radius-topright:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-bottomright:0; - -moz-border-radius-bottomleft:0; - -webkit-border-top-right-radius:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-bottom-right-radius:0; - -webkit-border-bottom-left-radius:0; -} - -#front { - position:fixed; - top:150px; -} -#infopage { - - - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - font-size: 10px; - - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; -} -#signin { - position:absolute; - left:0px; - width:351px; - height:135px; - font-size:16px; - font-weight:bold; - z-index:3; - top: 143px; -} -#signinbg { - position:absolute; - left:1px; - width:346px; - height:253px; - background-position:right; - background-repeat:no-repeat; - z-index:1; - top: 157px; -} -#about { - position:absolute; - width:240px; - height: 97px; - left:364px; - ; - color: #000; - z-index:2; - line-height: 18px; - top: 168px; - font-size: 12px; - font-family: Arial, Helvetica, sans-serif; -} -#input { - padding-right:15px; - line-height:22px; - font-size: 12px; -} -body{ - font-family: Arial, Helvetica, sans-serif; - font-size: 16px; - line-height: 40px; - overflow-x:hidden; - overflow-y:hidden; -} -#apDiv1 div #input #form1 label { - font-size: 12px; - color: #333; -} -.re { - font-size: 10px; -} -#apDiv2 #about div { - font-size: 10px; - color: #424143; -} -#top { - position:absolute; - left:0px; - top:0px; - width:100%; - height:32px; - z-index:2; - background-color: #CCC; -} -#apDiv3 { - position:fixed; - left:0px; - top:0px; - width:68px; - height:68px; - background-image: url(topl.png); -} -#apDiv4 { - position:fixed; - top:0px; - width:68px; - height:68px; - - right: 0px; - background-image: url(topr.png); -} -#bottom { - position:absolute; - left:0px; - bottom:0px; - width:100%; - height:10px; - z-index:1; - font-size: 10px; - line-height: 5px; -} -#apDiv5 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - left: 0px; - background-image: url(bottoml.png); -} -#apDiv6 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - right: 0px; - background-image: url(bottomr.png); -} - -#plane { - position:fixed; - top:9px; - right:0px; - width:100%; - height:100%; - z-index:1; - background-image: url(cloudbg1.png); - background-repeat: no-repeat; - background-position:center; - -moz-opacity: 0.6; -filter:alpha(opacity=60); - /* CSS3 standard */ - opacity:0.6; - - -} -#registerbox { - padding-left:20px; - font-family:Arial, Helvetica, sans-serif; - padding-right:0px; - line-height:28px; - font-weight: bold; - color: #000; -} -registerbox.form { font-size: 14px; color="#990000"; } -.info { - font-size: 10px; -} -.info { - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; - color: #999; -} -#footer -{ - text-align:center; - position:absolute; - width:100%; - bottom:0px; - font-size:12px; - font-family:"Times New Roman", Times, serif; - background-image:url(/static/footer.png); - background-repeat:repeat-x; - background-position:top; - height:40px; - line-height: 2; - left: 0px; - color: #CCC; - z-index: 111; -} diff --git a/static/trash/mark1.png b/static/trash/mark1.png Binary files differdeleted file mode 100755 index 50566ba..0000000 --- a/static/trash/mark1.png +++ /dev/null diff --git a/static/trash/mask_shaq.jpg b/static/trash/mask_shaq.jpg Binary files differdeleted file mode 100755 index 4c04e8b..0000000 --- a/static/trash/mask_shaq.jpg +++ /dev/null diff --git a/static/trash/mouseover.gif b/static/trash/mouseover.gif Binary files differdeleted file mode 100755 index 2c6ee3e..0000000 --- a/static/trash/mouseover.gif +++ /dev/null diff --git a/static/trash/over.png b/static/trash/over.png Binary files differdeleted file mode 100755 index f80754b..0000000 --- a/static/trash/over.png +++ /dev/null diff --git a/static/trash/rhianamoney.gif b/static/trash/rhianamoney.gif Binary files differdeleted file mode 100755 index 99f348a..0000000 --- a/static/trash/rhianamoney.gif +++ /dev/null diff --git a/static/trash/s.png b/static/trash/s.png Binary files differdeleted file mode 100755 index fdc8c1d..0000000 --- a/static/trash/s.png +++ /dev/null diff --git a/static/trash/shaq.gif b/static/trash/shaq.gif Binary files differdeleted file mode 100755 index cfdaa11..0000000 --- a/static/trash/shaq.gif +++ /dev/null diff --git a/static/trash/shaqg.gif b/static/trash/shaqg.gif Binary files differdeleted file mode 100755 index 6106d3d..0000000 --- a/static/trash/shaqg.gif +++ /dev/null diff --git a/static/trash/slo.png b/static/trash/slo.png Binary files differdeleted file mode 100755 index 6ad74e6..0000000 --- a/static/trash/slo.png +++ /dev/null diff --git a/static/trash/spex.png b/static/trash/spex.png Binary files differdeleted file mode 100755 index fd0231f..0000000 --- a/static/trash/spex.png +++ /dev/null diff --git a/static/trash/spinner.gif b/static/trash/spinner.gif Binary files differdeleted file mode 100755 index 5b33f7e..0000000 --- a/static/trash/spinner.gif +++ /dev/null diff --git a/static/trash/startpage.html b/static/trash/startpage.html deleted file mode 100755 index 85f3350..0000000 --- a/static/trash/startpage.html +++ /dev/null @@ -1,95 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title>dump.fm</title> -<link rel="stylesheet" type="text/css" href="main.css"> - <script type="text/javascript" src="static/sha1.js"></script> - <script type="text/javascript" src="static/pichat.js"></script> -<style type="text/css"> -<!-- -a:link { - text-decoration: none; - -} -a:visited { - text-decoration: none; - border: 0px; -} -a:hover { - text-decoration: none; - border: 0px; -} -a:active { - text-decoration: none; - border: 0px; -} -img{border: 0px;} ---> -</style> -</head> -<body> - -<div id="apDiv2"> - <div align="center"><img src="dfm.png" width="384" height="136" /> - </div> - <div id="about"> - <p>dump.fm lets you talk with pictures.<br /> - <br /> - share images from anywhere on the web or ones stored on your computer, in real time.<br /> - <br /> - </p> -<p align="center"><a href="getstarted.html"><img src="getstarted.gif" width="262" height="94" /></a></p> - <div align="right"></div> - </div> - <div id="signinbg"></div> - <div id="signin"> - <div align="right"> - <p align="center"> </p> - <div id="input"> - <form id="form1" name="form1" method="post" action="" > - <label>username - <input type="text" name="textfield" id="textfield" class="form"/> - <br /> - </label> - </form> - <form id="form1" name="form1" method="post" action=""> - <label>password - <input type="text" name="textfield" id="textfield"class="form" /> - </label> - <br /> - <label> <span class="re">remember me </span> - <input type="checkbox" name="remember" id="remember" /> - </label> - </form> - <form id="form2" name="form2" method="post" action=""> - <label> - <input type="submit" name="Signin" id="Signin" value="Sign In" /> - </label> - </form> - </div> - </div> -</div></div> - <div class="info" id="info"> - <div align="center" class="info">* © 2009 dump.fm - * About Us - * Contact - * Blog - * Goodies - - * Help - * Terms - * Privacy</div> - </div> - - -</div> - -<div id="bottom"> - <div align="center"></div> -</div> - -<div id="plane"></div> -<br /> -</body> -</html> diff --git a/static/trash/startpage1.html b/static/trash/startpage1.html deleted file mode 100755 index dbf5edf..0000000 --- a/static/trash/startpage1.html +++ /dev/null @@ -1,96 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title>dump.fm</title> -<link rel="stylesheet" type="text/css" href="static/main.css"> -<style type="text/css"> -<!-- -a:link { - text-decoration: none; - -} -a:visited { - text-decoration: none; - border: 0px; -} -a:hover { - text-decoration: none; - border: 0px; -} -a:active { - text-decoration: none; - border: 0px; -} -img{border: 0px;} ---> -</style> -</head> -<body> - -<div id="apDiv2"> - - <div id="about"> - <p> </p> - <p>dump.fm lets you talk with pictures.<br /> - </p> - <p><br /> - share images from anywhere on the web or ones stored on your computer, in real time.<br /> - <br /> - </p> - <p align="center"><a href="index.html"><img src="static/getstarted.gif" width="262" height="94" /></a></p> - <div align="right"></div> - </div> - <div id="signinbg"></div> - <div id="signin"> - <div align="right"> - <p align="center"><img src="static/mark1.png" width="329" height="96" /></p> - <div id="input"> - <form id="form1" name="form1" method="post" action="" > - <label>username - <input type="text" name="textfield" id="textfield" class="form"/> - <br /> - </label> - </form> - <form id="form1" name="form1" method="post" action=""> - <label>password - <input type="text" name="textfield" id="textfield"class="form" /> - </label> - <br /> - <label> <span class="re">remember me </span> - <input type="checkbox" name="remember" id="remember" /> - </label> - </form> - <form id="form2" name="form2" method="post" action=""> - <label> - <input type="submit" name="Signin" id="Signin" value="Sign In" /> - </label> - </form> - </div> - </div> - </div> - <div class="info" id="info"> - <div align="center" class="info">* © 2009 dump.fm - * About Us - * Contact - * Blog - * Goodies - - * Help - * Terms - * Privacy</div> - </div> -</div> - -</div> -<div id="apDiv3"></div> -<div id="apDiv4"></div> -<div id="bottom"> - <div align="center"></div> -</div> -<div id="apDiv5"></div> -<div id="apDiv6"></div> -<div id="plane"></div> -<br /> -</body> -</html> diff --git a/static/trash/startpage7.html b/static/trash/startpage7.html deleted file mode 100755 index eea492c..0000000 --- a/static/trash/startpage7.html +++ /dev/null @@ -1,112 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title>dump.fm</title> -<link rel="stylesheet" type="text/css" href="main2.css"> - <link rel="stylesheet" type="text/css" href="static/reset.css"> - <link rel="shortcut icon" href="static/favicon.ico"> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/sha1.js"></script> - <script type="text/javascript" src="static/register.js"></script> - - - <script> - $(document).ready(initRegister); - </script> - -<style type="text/css"> -<!-- -a:link { - text-decoration: none; - -} -a:visited { - text-decoration: none; - border: 0px; -} -a:hover { - text-decoration: none; - border: 0px; -} -a:active { - text-decoration: none; - border: 0px; -} -img{border: 0px;} -#apDiv7 { - position:absolute; - left:151px; - top:-106px; - width:351px; - height:66px; - z-index:4; - font-weight: bold; - line-height: 18px; - font-size: 14px; -} -#apDiv8 { - position:absolute; - left:964px; - top:131px; - width:416px; - height:140px; - z-index:4; -} ---> -</style> -</head> -<body> -<div id="header"> - -<div id="apDiv2"> - <div align="center"><img src="dfm.png" width="384" height="136" /><br /> - - <div id="about"> - <p align="left"><a href="getstarted.html"><img src="getstarted.gif" width="262" height="94" /></a></p> - <p align="left"><br /> - </p> - </div> - <div id="txt"> - <div align="right">Talk with pictures.</div> - </div> - <div id="signin"> - <div align="right"> - <div id="registerbox"> - <h1> Sign In!<br /> - <span>Nickname</span> - <input type="text" id="nickInput" size="17" /> - <br /> - - <span>Password</span> - <input type="password" id="passwordInput" size="17" /> - <br /> - - <input type="submit" id="submit" value="YEAH!!!" /> - </h1> -</div> - - <div id="confirmationbox" style="display: none"> - <h1>You've registered!</h1> - <span>Please wait as you're redirected to the chat.</span> - </div> -</div> - </div> - <div class="info" id="info"> - <div align="center" class="info"> © 2009 dump.fm - * About Us - * Contact - * Blog - * Goodies - - * Help - * Terms - * Privacy</div> - -</div></div> - - -</div></div> -<br /> -</body> -</html> diff --git a/static/trash/starts/bg4.png b/static/trash/starts/bg4.png Binary files differdeleted file mode 100755 index e20fda8..0000000 --- a/static/trash/starts/bg4.png +++ /dev/null diff --git a/static/trash/starts/bottoml.png b/static/trash/starts/bottoml.png Binary files differdeleted file mode 100755 index 0f52893..0000000 --- a/static/trash/starts/bottoml.png +++ /dev/null diff --git a/static/trash/starts/bottomr.png b/static/trash/starts/bottomr.png Binary files differdeleted file mode 100755 index 5904272..0000000 --- a/static/trash/starts/bottomr.png +++ /dev/null diff --git a/static/trash/starts/cloudbg.png b/static/trash/starts/cloudbg.png Binary files differdeleted file mode 100755 index f397899..0000000 --- a/static/trash/starts/cloudbg.png +++ /dev/null diff --git a/static/trash/starts/cloudbg1.png b/static/trash/starts/cloudbg1.png Binary files differdeleted file mode 100755 index f397899..0000000 --- a/static/trash/starts/cloudbg1.png +++ /dev/null diff --git a/static/trash/starts/getstarted.gif b/static/trash/starts/getstarted.gif Binary files differdeleted file mode 100755 index b581589..0000000 --- a/static/trash/starts/getstarted.gif +++ /dev/null diff --git a/static/trash/starts/index.html b/static/trash/starts/index.html deleted file mode 100755 index b309f74..0000000 --- a/static/trash/starts/index.html +++ /dev/null @@ -1,71 +0,0 @@ -<html> - <head> - <title>dump.fm</title> - <link rel="stylesheet" type="text/css" href="static/reset.css"> - <link rel="stylesheet" type="text/css" href="static/pichat.css"> - <link rel="stylesheet" type="text/css" href="static/style.css"> - <link rel="shortcut icon" href="static/favicon.ico"> - - - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> - <script type="text/javascript" src="static/pichat.js"></script> - <script> - $(document).ready(function() { - init(); - }); - </script> - - <script type="text/javascript"> -function showPopup(url) { -newwindow=window.open(url,'name','height=600,width=820,top=30,left=10,resizable'); -if (window.focus) {newwindow.focus()} -} -</script> - </head> - <body> - - <div id="content"> - <div id="logo"><img src="static/bubley.png" width="332" height="113"></div> - - <div id="chatbox"> - <div id="welcomebar" style="display: none"> - <span>Welcome, </span> - <span id="nickspan"></span> - </div> - <div id="messagetabs"> - <div align="right"><a href="log.h"><img src="static/log4.png" width="97" height="39"></a></div> - </div> - <div id="rapper"> - <div id="userListicon"> - - <div align="left"> - <p>UsrLst</p> -</div> - </div> - <div id="popout"> - <div align="right"><a href="http://dump.fm"onClick='showPopup(this.href);return(false);'>popout room</a></div> - </div> - <div id="userList"></div> - - <div id="messagePane"> - - <div id="messageList"></div> - <div id="msgInputDiv"> - <input id="msgInput" type="input" disabled="disabled" /> - <input id="msgSubmit" type="submit" value="Send Image URL" - disabled="disabled" /> - </div> - </div> - </div> - </div> - </div> - <div id="lillogo" align="center"> - <div align="center"> - <div id="binfo"> - <p>dump.fm lets you talk with pictures. beta 0.0127! <img src="static/lillogo.png" width="16" height="16"></p> - </div> - </div> - <div id="plane"></div> - </div> - </body> -</html> diff --git a/static/trash/starts/logbg.png b/static/trash/starts/logbg.png Binary files differdeleted file mode 100755 index 0e41857..0000000 --- a/static/trash/starts/logbg.png +++ /dev/null diff --git a/static/trash/starts/main.css b/static/trash/starts/main.css deleted file mode 100755 index 8503c50..0000000 --- a/static/trash/starts/main.css +++ /dev/null @@ -1,182 +0,0 @@ -@charset "UTF-8"; -/* CSS Document */ - -#apDiv2 { - position:relative; - top:150px; - width:700px; - margin: 0px auto -1px auto; - height: 300px; - z-index: 3; -} -#info { - position:relative; - top:285px; - width:700px; - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - -} -#front { - position:fixed; - top:150px; -} -#infopage { - - - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - font-size: 10px; - - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; -} -#signin { - position:absolute; - left:0px; - width:410px; - height:281px; - - z-index:3; - -} -#signinbg { - position:absolute; - left:0px; - width:410px; - height:281px; - background-image: url(static/starts/logbg.png); - z-index:1; - - -} -#about { - position:absolute; - width:300px; - height: 281px; - left:410px; - line-height: 18px; - padding-left: 20px; - ; - font-weight: bold; - color: #333; - z-index:2; -} -#input { - padding-right:15px; - line-height:22px; - font-size: 12px; -} -body,td,th { - font-family: Arial, Helvetica, sans-serif; - font-size: 16px; - line-height: 40px; -} -#apDiv1 div #input #form1 label { - font-size: 12px; - color: #333; -} -.re { - font-size: 10px; -} -#apDiv2 #about div { - font-size: 10px; - color: #424143; -} -#top { - position:absolute; - left:0px; - top:0px; - width:100%; - height:32px; - z-index:2; - background-color: #CCC; -} -#apDiv3 { - position:fixed; - left:0px; - top:0px; - width:68px; - height:68px; - background-image: url(topl.png); -} -#apDiv4 { - position:fixed; - top:0px; - width:68px; - height:68px; - - right: 0px; - background-image: url(topr.png); -} -#bottom { - position:absolute; - left:0px; - bottom:0px; - width:100%; - height:10px; - z-index:1; - font-size: 10px; - line-height: 5px; -} -#apDiv5 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - left: 0px; - background-image: url(bottoml.png); -} -#apDiv6 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - right: 0px; - background-image: url(bottomr.png); -} -#bg { - position:absolute; - left:0px; - top:0px; - width:100%; - height:100%; - z-index:2; - background-image:url(grad2.jpg); -} -body { - background-image: url(bg4.png); - background-repeat: repeat-x; - background-attachment:fixed; -} -#plane { - position:fixed; - top:9px; - right:0px; - width:100%; - height:100%; - z-index:1; - background-image: url(cloudbg1.png); - background-repeat: no-repeat; - background-position:center; - -} -.form { font-size: 14px; color="#990000"; } -.info { - font-size: 10px; -} -.info { - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; - color: #999; -} diff --git a/static/trash/starts/mark1.png b/static/trash/starts/mark1.png Binary files differdeleted file mode 100755 index 50566ba..0000000 --- a/static/trash/starts/mark1.png +++ /dev/null diff --git a/static/trash/starts/startpage1.html b/static/trash/starts/startpage1.html deleted file mode 100755 index b938eb5..0000000 --- a/static/trash/starts/startpage1.html +++ /dev/null @@ -1,96 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title>dump.fm</title> -<link rel="stylesheet" type="text/css" href="static/starts/main.css"> -<style type="text/css"> -<!-- -a:link { - text-decoration: none; - -} -a:visited { - text-decoration: none; - border: 0px; -} -a:hover { - text-decoration: none; - border: 0px; -} -a:active { - text-decoration: none; - border: 0px; -} -img{border: 0px;} ---> -</style> -</head> -<body> - -<div id="apDiv2"> - - <div id="about"> - <p> </p> - <p>dump.fm lets you talk with pictures.<br /> - </p> - <p><br /> - share images from anywhere on the web or ones stored on your computer, in real time.<br /> - <br /> - </p> - <p align="center"><a href="index.html"><img src="static/starts/getstarted.gif" width="262" height="94" /></a></p> - <div align="right"></div> - </div> - <div id="signinbg"></div> - <div id="signin"> - <div align="right"> - <p align="center"><img src="static/starts/mark1.png" width="329" height="96" /></p> - <div id="input"> - <form id="form1" name="form1" method="post" action="" > - <label>username - <input type="text" name="textfield" id="textfield" class="form"/> - <br /> - </label> - </form> - <form id="form1" name="form1" method="post" action=""> - <label>password - <input type="text" name="textfield" id="textfield"class="form" /> - </label> - <br /> - <label> <span class="re">remember me </span> - <input type="checkbox" name="remember" id="remember" /> - </label> - </form> - <form id="form2" name="form2" method="post" action=""> - <label> - <input type="submit" name="Signin" id="Signin" value="Sign In" /> - </label> - </form> - </div> - </div> - </div> - <div class="info" id="info"> - <div align="center" class="info">* © 2009 dump.fm - * About Us - * Contact - * Blog - * Goodies - - * Help - * Terms - * Privacy</div> - </div> -</div> - -</div> -<div id="apDiv3"></div> -<div id="apDiv4"></div> -<div id="bottom"> - <div align="center"></div> -</div> -<div id="apDiv5"></div> -<div id="apDiv6"></div> -<div id="plane"></div> -<br /> -</body> -</html> diff --git a/static/trash/starts/topl.png b/static/trash/starts/topl.png Binary files differdeleted file mode 100755 index dcfe5b9..0000000 --- a/static/trash/starts/topl.png +++ /dev/null diff --git a/static/trash/starts/topr.png b/static/trash/starts/topr.png Binary files differdeleted file mode 100755 index 9cfab08..0000000 --- a/static/trash/starts/topr.png +++ /dev/null diff --git a/static/trash/style.css b/static/trash/style.css deleted file mode 100755 index 4524037..0000000 --- a/static/trash/style.css +++ /dev/null @@ -1,373 +0,0 @@ -@charset "UTF-8"; -/* CSS Document */ - -#apDiv2 { - position:relative; - top:150px; - width:700px; - margin: 0px auto -1px auto; - height: 300px; - z-index: 3; -} -#info { - position:relative; - top:285px; - width:700px; - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - -} -#front { - position:fixed; - top:150px; -} -#infopage { - - - margin: 0px auto -1px auto; - height: 14px; - color: #999; - bottom:0px; - z-index: 3; - font-size: 10px; - - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; -} -#signin { - position:absolute; - left:0px; - width:410px; - height:281px; - background-image: url(logbg.png); - z-index:2; -} -#about { - position:absolute; - width:300px; - height: 281px; - left:410px; - line-height: 18px; - padding-left: 20px; - ; - font-weight: bold; - color: #333; - z-index:2; -} -#input { - padding-right:15px; - line-height:22px; - font-size: 12px; -} -body,td,th { - font-family: Arial, Helvetica, sans-serif; - font-size: 16px; - line-height: 40px; -} -#apDiv1 div #input #form1 label { - font-size: 12px; - color: #333; -} -.re { - font-size: 10px; -} -#apDiv2 #about div { - font-size: 10px; - color: #424143; -} -#top { - position:absolute; - left:0px; - top:0px; - width:100%; - height:32px; - z-index:2; - background-color: #CCC; -} -#apDiv3 { - position:fixed; - left:0px; - top:0px; - width:68px; - height:68px; - background-image: url(topl.png); -} -#apDiv4 { - position:fixed; - top:0px; - width:68px; - height:68px; - - right: 0px; - background-image: url(topr.png); -} -#bottom { - position:absolute; - left:0px; - bottom:0px; - width:100%; - height:10px; - z-index:1; - font-size: 10px; - line-height: 5px; -} -#apDiv5 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - left: 0px; - background-image: url(bottoml.png); -} -#apDiv6 { - position:fixed; - bottom:0px; - width:60px; - height:68px; - - right: 0px; - background-image: url(bottomr.png); -} -#bg { - position:absolute; - left:0px; - top:0px; - width:100%; - height:100%; - z-index:2; - background-image:url(grad2.jpg); -} -body { - background-image: url(bg4.png); - background-repeat: repeat-x; - background-attachment:fixed; -} - -.form { font-size: 14px; color="#990000"; } -.info { - font-size: 10px; -} -.info { - font-size: 12px; - letter-spacing: 1px; - bottom: 0px; - color: #999; -} - - -.extruder{ - position:fixed; - cursor:default; - background:url("../elements/extruder_blank.png"); -} - -.extruder .header{ - height:27px; -} - -.extruder .content{ - display:none; - background:url("../elements/extruder_bgnd.png") repeat-y bottom left; -} - -.extruder.open .content{ - -moz-box-shadow:#999 2px -2px 2px; - -webkit-box-shadow:#999 2px -2px 2px; -} - - - -.extruder .footer{ - display:block; - spadding:5px; - height:10px; - background:#000; - -moz-border-radius: 0 0 8px 8px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; -} -.extruder.top .flap{ - color:white; - text-shadow: #000 2px 2px 2px; - font:18px/18px Arial, Helvetica, sans-serif; - text-align:center; - display:block; - padding:0 5px 5px 5px; - height:30px; - background:url("../elements/extruder_flap.png") no-repeat top center; - cursor:pointer; -} - -.extruder.left{ - /*position:absolute;*/ - height:100%; - background:url("../elements/extruder_blank.png"); -} - -.extruder.left .content{ - display:block; - border-right:3px solid #000; -} - - -.extruder.left .ext_wrapper{ - height:100%; -} - -.extruder.left .footer{ - display:none; -} - -.extruder.left .flap{ - font-size:18px; - color:white; - top:0; - padding:10px 0px 10px 10px; - background:#000; - width:30px; - /*height:150px;*/ - position:absolute; - /*overflow:hidden;*/ - right:-2px; - -moz-border-radius:0 10px 10px 0; - -webkit-border-top-right-radius:10px; - -webkit-border-bottom-right-radius:10px; - -moz-box-shadow:#666 2px 0px 3px; - -webkit-box-shadow:#666 2px 0px 3px; -} - - -/*Extruder Content*/ - - .extruder .voice{ - font:18px/18px Arial, Helvetica, sans-serif; - color:white; - padding:5px; - padding-left:10px; - height:27px; - border-bottom:1px solid #333; - background:url("../elements/extruder_blank.png") no-repeat bottom left; - text-shadow:#333 2px 2px 2px; - } - .extruder .voice.disabled{ - cursor:default; - } -.extruder .text{ - background:#222; - font:14px/16px Arial, Helvetica, sans-serif; - color:gray; - padding:10px; - border-bottom:1px solid #333; - /*text-shadow:#000 2px 2px 2px;*/ - } - - .extruder .voice.hover{ - background:url("../elements/extruder_voiceHover.png") no-repeat top; - } - - .extruder .voice.sel{ - background:url("../elements/extruder_voiceHover.png") no-repeat top; - } - - .extruder .voice img{ - float:left; - margin-right:15px; - } - - .extruder .voice a.label{ - display:block; - height:30px; - color:white; - padding-top:0px; - text-decoration:none; - } - - .extruder .voice span.label{ - display:block; - height:30px; - color: #d0cfcf; - padding-top:0px; - text-decoration:none; - } - - .extruder .voice{ - position:relative; - } - - .extruder .settingsBtn{ - display:block; - position:absolute; - width:36px; - height:36px; - background: url("../elements/settingsBtn.png") no-repeat bottom; - cursor:pointer; - right:-3px; - top:-4px; - /*z-index:1000;*/ - } - - .extruder .optionsPanel{ - /*background: url("../elements/optionsPanel.png") no-repeat bottom;*/ - background: url("../elements/fuzz.gif"); - display:none; - border-bottom:1px solid #333; - } - - .extruder .voice.sel{ - background: url("../elements/extruder_voiceHover.png") no-repeat top; - } - - - /*Extruder Panel*/ - - .optionsPanel .panelVoice a{ - text-decoration:none; - display:block; - color:#cccccc; - padding:8px; - padding-left:20px; - font-size:16px; - text-shadow:#333 1px 1px 1px; - border-bottom:1px solid #444; - cursor:pointer; - } - .optionsPanel .panelVoice a:hover{ - color:#fff; - /*background: #666666;*/ - background: url("../elements/red_op_50.png"); - } - -:focus { - outline: 0; -} - - - #content #nav1 li, #content #nav1 li a { - position: relative; - float: right; - } - #content #nav1 li { top: 15px; margin: 0; background: none; padding: 0; } - #content #nav1 li a { - display: block; - - - height: 50px; - } - #content #nav1 li a span { - display: block; - position: absolute; - height: 60px; - width: 10px; - - right: 0; - - } - #content #nav1 li a:hover, #content #nav1 li a:hover span { background-position: 0 -194px; color: #3f5f5a; } - #content #nav1 li a:active, #content #nav1 li a:active span { - background-position: 0 -300px; -}
\ No newline at end of file diff --git a/static/trash/topb.png b/static/trash/topb.png Binary files differdeleted file mode 100755 index 51cc4cc..0000000 --- a/static/trash/topb.png +++ /dev/null diff --git a/static/trash/topbg.gif b/static/trash/topbg.gif Binary files differdeleted file mode 100755 index 9432446..0000000 --- a/static/trash/topbg.gif +++ /dev/null diff --git a/static/trash/topbi.gif b/static/trash/topbi.gif Binary files differdeleted file mode 100755 index a032a08..0000000 --- a/static/trash/topbi.gif +++ /dev/null diff --git a/static/trash/topl.png b/static/trash/topl.png Binary files differdeleted file mode 100755 index dcfe5b9..0000000 --- a/static/trash/topl.png +++ /dev/null diff --git a/static/trash/topr.png b/static/trash/topr.png Binary files differdeleted file mode 100755 index 9cfab08..0000000 --- a/static/trash/topr.png +++ /dev/null diff --git a/static/trash/try.gif b/static/trash/try.gif Binary files differdeleted file mode 100755 index cbe2d89..0000000 --- a/static/trash/try.gif +++ /dev/null diff --git a/static/trash/try.png b/static/trash/try.png Binary files differdeleted file mode 100755 index a7021f8..0000000 --- a/static/trash/try.png +++ /dev/null diff --git a/static/trash/uggs.gif b/static/trash/uggs.gif Binary files differdeleted file mode 100755 index a8b763a..0000000 --- a/static/trash/uggs.gif +++ /dev/null diff --git a/static/trash/up.png b/static/trash/up.png Binary files differdeleted file mode 100755 index b13da1c..0000000 --- a/static/trash/up.png +++ /dev/null diff --git a/static/trash/upload1.png b/static/trash/upload1.png Binary files differdeleted file mode 100644 index f46b6a8..0000000 --- a/static/trash/upload1.png +++ /dev/null diff --git a/static/trash/upload2.png b/static/trash/upload2.png Binary files differdeleted file mode 100644 index 10b2237..0000000 --- a/static/trash/upload2.png +++ /dev/null diff --git a/static/trash/upload3.png b/static/trash/upload3.png Binary files differdeleted file mode 100644 index 714acb1..0000000 --- a/static/trash/upload3.png +++ /dev/null diff --git a/static/trash/upload4.png b/static/trash/upload4.png Binary files differdeleted file mode 100644 index 5771bc7..0000000 --- a/static/trash/upload4.png +++ /dev/null diff --git a/static/trash/upload5.png b/static/trash/upload5.png Binary files differdeleted file mode 100644 index 552bab7..0000000 --- a/static/trash/upload5.png +++ /dev/null diff --git a/static/trash/upload6.png b/static/trash/upload6.png Binary files differdeleted file mode 100644 index 413261d..0000000 --- a/static/trash/upload6.png +++ /dev/null diff --git a/static/trash/upload7.png b/static/trash/upload7.png Binary files differdeleted file mode 100644 index b677b26..0000000 --- a/static/trash/upload7.png +++ /dev/null diff --git a/static/trash/upload8.png b/static/trash/upload8.png Binary files differdeleted file mode 100644 index 329b072..0000000 --- a/static/trash/upload8.png +++ /dev/null diff --git a/static/trash/url1.png b/static/trash/url1.png Binary files differdeleted file mode 100644 index 51e0b55..0000000 --- a/static/trash/url1.png +++ /dev/null diff --git a/static/trash/wayne.gif b/static/trash/wayne.gif Binary files differdeleted file mode 100755 index 13dde42..0000000 --- a/static/trash/wayne.gif +++ /dev/null diff --git a/static/trash/wordlogo.gif b/static/trash/wordlogo.gif Binary files differdeleted file mode 100755 index dbef59d..0000000 --- a/static/trash/wordlogo.gif +++ /dev/null diff --git a/static/trash/wordlogo2.gif b/static/trash/wordlogo2.gif Binary files differdeleted file mode 100755 index b6f22da..0000000 --- a/static/trash/wordlogo2.gif +++ /dev/null diff --git a/static/trash/yb.png b/static/trash/yb.png Binary files differdeleted file mode 100755 index af2e410..0000000 --- a/static/trash/yb.png +++ /dev/null diff --git a/static/tvfun.gif b/static/tvfun.gif Binary files differdeleted file mode 100644 index cf18f3e..0000000 --- a/static/tvfun.gif +++ /dev/null diff --git a/static/ui.core.js b/static/ui.core.js deleted file mode 100644 index 5493e0a..0000000 --- a/static/ui.core.js +++ /dev/null @@ -1,519 +0,0 @@ -/* - * jQuery UI 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -;jQuery.ui || (function($) { - -var _remove = $.fn.remove, - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); - -//Helper functions and ui object -$.ui = { - version: "1.7.2", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set || !instance.element[0].parentNode) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - - contains: function(a, b) { - return document.compareDocumentPosition - ? a.compareDocumentPosition(b) & 16 - : a !== b && a.contains(b); - }, - - hasScroll: function(el, a) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ($(el).css('overflow') == 'hidden') { return false; } - - var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', - has = false; - - if (el[scroll] > 0) { return true; } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[scroll] = 1; - has = (el[scroll] > 0); - el[scroll] = 0; - return has; - }, - - isOverAxis: function(x, reference, size) { - //Determines when x coordinate is over "b" element axis - return (x > reference) && (x < (reference + size)); - }, - - isOver: function(y, x, top, left, height, width) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); - }, - - keyCode: { - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38 - } -}; - -// WAI-ARIA normalization -if (isFF2) { - var attr = $.attr, - removeAttr = $.fn.removeAttr, - ariaNS = "http://www.w3.org/2005/07/aaa", - ariaState = /^aria-/, - ariaRole = /^wairole:/; - - $.attr = function(elem, name, value) { - var set = value !== undefined; - - return (name == 'role' - ? (set - ? attr.call(this, elem, name, "wairole:" + value) - : (attr.apply(this, arguments) || "").replace(ariaRole, "")) - : (ariaState.test(name) - ? (set - ? elem.setAttributeNS(ariaNS, - name.replace(ariaState, "aaa:"), value) - : attr.call(this, elem, name.replace(ariaState, "aaa:"))) - : attr.apply(this, arguments))); - }; - - $.fn.removeAttr = function(name) { - return (ariaState.test(name) - ? this.each(function() { - this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); - }) : removeAttr.call(this, name)); - }; -} - -//jQuery plugins -$.fn.extend({ - remove: function() { - // Safari has a native remove event which actually removes DOM elements, - // so we have to use triggerHandler instead of trigger (#3037). - $("*", this).add(this).each(function() { - $(this).triggerHandler("remove"); - }); - return _remove.apply(this, arguments ); - }, - - enableSelection: function() { - return this - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); - }, - - disableSelection: function() { - return this - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); - }, - - scrollParent: function() { - var scrollParent; - if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - } -}); - - -//Additional selectors -$.extend($.expr[':'], { - data: function(elem, i, match) { - return !!$.data(elem, match[3]); - }, - - focusable: function(element) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr(element, 'tabindex'); - return (/input|select|textarea|button|object/.test(nodeName) - ? !element.disabled - : 'a' == nodeName || 'area' == nodeName - ? element.href || !isNaN(tabIndex) - : !isNaN(tabIndex)) - // the element and all of its ancestors must be visible - // the browser may report that the area is hidden - && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; - }, - - tabbable: function(element) { - var tabIndex = $.attr(element, 'tabindex'); - return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); - } -}); - - -// $.widget is a factory to create jQuery plugins -// taking some boilerplate code out of the plugin code -function getter(namespace, plugin, method, args) { - function getMethods(type) { - var methods = $[namespace][plugin][type] || []; - return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); - } - - var methods = getMethods('getter'); - if (args.length == 1 && typeof args[0] == 'string') { - methods = methods.concat(getMethods('getterSetter')); - } - return ($.inArray(method, methods) != -1); -} - -$.widget = function(name, prototype) { - var namespace = name.split(".")[0]; - name = name.split(".")[1]; - - // create plugin method - $.fn[name] = function(options) { - var isMethodCall = (typeof options == 'string'), - args = Array.prototype.slice.call(arguments, 1); - - // prevent calls to internal methods - if (isMethodCall && options.substring(0, 1) == '_') { - return this; - } - - // handle getter methods - if (isMethodCall && getter(namespace, name, options, args)) { - var instance = $.data(this[0], name); - return (instance ? instance[options].apply(instance, args) - : undefined); - } - - // handle initialization and non-getter methods - return this.each(function() { - var instance = $.data(this, name); - - // constructor - (!instance && !isMethodCall && - $.data(this, name, new $[namespace][name](this, options))._init()); - - // method call - (instance && isMethodCall && $.isFunction(instance[options]) && - instance[options].apply(instance, args)); - }); - }; - - // create widget constructor - $[namespace] = $[namespace] || {}; - $[namespace][name] = function(element, options) { - var self = this; - - this.namespace = namespace; - this.widgetName = name; - this.widgetEventPrefix = $[namespace][name].eventPrefix || name; - this.widgetBaseClass = namespace + '-' + name; - - this.options = $.extend({}, - $.widget.defaults, - $[namespace][name].defaults, - $.metadata && $.metadata.get(element)[name], - options); - - this.element = $(element) - .bind('setData.' + name, function(event, key, value) { - if (event.target == element) { - return self._setData(key, value); - } - }) - .bind('getData.' + name, function(event, key) { - if (event.target == element) { - return self._getData(key); - } - }) - .bind('remove', function() { - return self.destroy(); - }); - }; - - // add widget prototype - $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); - - // TODO: merge getter and getterSetter properties from widget prototype - // and plugin prototype - $[namespace][name].getterSetter = 'option'; -}; - -$.widget.prototype = { - _init: function() {}, - destroy: function() { - this.element.removeData(this.widgetName) - .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') - .removeAttr('aria-disabled'); - }, - - option: function(key, value) { - var options = key, - self = this; - - if (typeof key == "string") { - if (value === undefined) { - return this._getData(key); - } - options = {}; - options[key] = value; - } - - $.each(options, function(key, value) { - self._setData(key, value); - }); - }, - _getData: function(key) { - return this.options[key]; - }, - _setData: function(key, value) { - this.options[key] = value; - - if (key == 'disabled') { - this.element - [value ? 'addClass' : 'removeClass']( - this.widgetBaseClass + '-disabled' + ' ' + - this.namespace + '-state-disabled') - .attr("aria-disabled", value); - } - }, - - enable: function() { - this._setData('disabled', false); - }, - disable: function() { - this._setData('disabled', true); - }, - - _trigger: function(type, event, data) { - var callback = this.options[type], - eventName = (type == this.widgetEventPrefix - ? type : this.widgetEventPrefix + type); - - event = $.Event(event); - event.type = eventName; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if (event.originalEvent) { - for (var i = $.event.props.length, prop; i;) { - prop = $.event.props[--i]; - event[prop] = event.originalEvent[prop]; - } - } - - this.element.trigger(event, data); - - return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false - || event.isDefaultPrevented()); - } -}; - -$.widget.defaults = { - disabled: false -}; - - -/** Mouse Interaction Plugin **/ - -$.ui.mouse = { - _mouseInit: function() { - var self = this; - - this.element - .bind('mousedown.'+this.widgetName, function(event) { - return self._mouseDown(event); - }) - .bind('click.'+this.widgetName, function(event) { - if(self._preventClickEvent) { - self._preventClickEvent = false; - event.stopImmediatePropagation(); - return false; - } - }); - - // Prevent text selection in IE - if ($.browser.msie) { - this._mouseUnselectable = this.element.attr('unselectable'); - this.element.attr('unselectable', 'on'); - } - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.unbind('.'+this.widgetName); - - // Restore text selection in IE - ($.browser.msie - && this.element.attr('unselectable', this._mouseUnselectable)); - }, - - _mouseDown: function(event) { - // don't let more than one widget handle mouseStart - // TODO: figure out why we have to use originalEvent - event.originalEvent = event.originalEvent || {}; - if (event.originalEvent.mouseHandled) { return; } - - // we may have missed mouseup (out of window) - (this._mouseStarted && this._mouseUp(event)); - - this._mouseDownEvent = event; - - var self = this, - btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if (!this.mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - self.mouseDelayMet = true; - }, this.options.delay); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = (this._mouseStart(event) !== false); - if (!this._mouseStarted) { - event.preventDefault(); - return true; - } - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(event) { - return self._mouseMove(event); - }; - this._mouseUpDelegate = function(event) { - return self._mouseUp(event); - }; - $(document) - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - // preventDefault() is used to prevent the selection of text here - - // however, in Safari, this causes select boxes not to be selectable - // anymore, so this fix is needed - ($.browser.safari || event.preventDefault()); - - event.originalEvent.mouseHandled = true; - return true; - }, - - _mouseMove: function(event) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !event.button) { - return this._mouseUp(event); - } - - if (this._mouseStarted) { - this._mouseDrag(event); - return event.preventDefault(); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = - (this._mouseStart(this._mouseDownEvent, event) !== false); - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); - } - - return !this._mouseStarted; - }, - - _mouseUp: function(event) { - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - if (this._mouseStarted) { - this._mouseStarted = false; - this._preventClickEvent = (event.target == this._mouseDownEvent.target); - this._mouseStop(event); - } - - return false; - }, - - _mouseDistanceMet: function(event) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - event.pageX), - Math.abs(this._mouseDownEvent.pageY - event.pageY) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function(event) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function(event) {}, - _mouseDrag: function(event) {}, - _mouseStop: function(event) {}, - _mouseCapture: function(event) { return true; } -}; - -$.ui.mouse.defaults = { - cancel: null, - distance: 1, - delay: 0 -}; - -})(jQuery); diff --git a/static/ui.datepicker.js b/static/ui.datepicker.js deleted file mode 100644 index 0ce166e..0000000 --- a/static/ui.datepicker.js +++ /dev/null @@ -1,1636 +0,0 @@ -/* - * jQuery UI Datepicker 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * ui.core.js - */ - -(function($) { // hide the namespace - -$.extend($.ui, { datepicker: { version: "1.7.2" } }); - -var PROP_NAME = 'datepicker'; - -/* Date picker manager. - Use the singleton instance of this class, $.datepicker, to interact with the date picker. - Settings for (groups of) date pickers are maintained in an instance object, - allowing multiple different settings on the same page. */ - -function Datepicker() { - this.debug = false; // Change this to true to start debugging - this._curInst = null; // The current instance in use - this._keyEvent = false; // If the last event was a key event - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division - this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class - this._appendClass = 'ui-datepicker-append'; // The name of the append marker class - this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class - this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class - this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class - this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class - this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class - this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - closeText: 'Done', // Display text for close link - prevText: 'Prev', // Display text for previous month link - nextText: 'Next', // Display text for next month link - currentText: 'Today', // Display text for current month link - monthNames: ['January','February','March','April','May','June', - 'July','August','September','October','November','December'], // Names of months for drop-down and formatting - monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting - dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting - dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting - dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday - dateFormat: 'mm/dd/yy', // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - isRTL: false // True if right-to-left language, false if left-to-right - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: 'focus', // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either - showAnim: 'show', // Name of jQuery animation for popup - showOptions: {}, // Options for enhanced animations - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: '', // Display text following the input box, e.g. showing the format - buttonText: '...', // Text for trigger button - buttonImage: '', // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links - gotoCurrent: false, // True if today link goes back to current selection instead - changeMonth: false, // True if month can be selected directly, false if only prev/next - changeYear: false, // True if year can be selected directly, false if only prev/next - showMonthAfterYear: false, // True if the year select precedes month, false for month then year - yearRange: '-10:+10', // Range of years to display in drop-down, - // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) - showOtherMonths: false, // True to show dates in other months, false to leave blank - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: '+10', // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with '+' for current year + value - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - duration: 'normal', // Duration of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', - // [2] = cell title (optional), e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onChangeMonthYear: null, // Define a callback function when the month or year is changed - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) - stepMonths: 1, // Number of months to step back/forward - stepBigMonths: 12, // Number of months to step back/forward for the big links - altField: '', // Selector for an alternate field to store selected dates into - altFormat: '', // The date format to use for the alternate field - constrainInput: true, // The input is constrained by the current date format - showButtonPanel: false // True to show button panel, false to not show it - }; - $.extend(this._defaults, this.regional['']); - this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>'); -} - -$.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: 'hasDatepicker', - - /* Debug logging (if enabled). */ - log: function () { - if (this.debug) - console.log.apply('', arguments); - }, - - /* Override the default settings for all instances of the date picker. - @param settings object - the new settings to use as defaults (anonymous object) - @return the manager object */ - setDefaults: function(settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* Attach the date picker to a jQuery selection. - @param target element - the target input field or division or span - @param settings object - the new settings to use for this date picker instance (anonymous) */ - _attachDatepicker: function(target, settings) { - // check for settings on the control itself - in namespace 'date:' - var inlineSettings = null; - for (var attrName in this._defaults) { - var attrValue = target.getAttribute('date:' + attrName); - if (attrValue) { - inlineSettings = inlineSettings || {}; - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - var nodeName = target.nodeName.toLowerCase(); - var inline = (nodeName == 'div' || nodeName == 'span'); - if (!target.id) - target.id = 'dp' + (++this.uuid); - var inst = this._newInst($(target), inline); - inst.settings = $.extend({}, settings || {}, inlineSettings || {}); - if (nodeName == 'input') { - this._connectDatepicker(target, inst); - } else if (inline) { - this._inlineDatepicker(target, inst); - } - }, - - /* Create a new instance object. */ - _newInst: function(target, inline) { - var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars - return {id: id, input: target, // associated target - selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection - drawMonth: 0, drawYear: 0, // month being drawn - inline: inline, // is datepicker inline or not - dpDiv: (!inline ? this.dpDiv : // presentation div - $('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}; - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - inst.append = $([]); - inst.trigger = $([]); - if (input.hasClass(this.markerClassName)) - return; - var appendText = this._get(inst, 'appendText'); - var isRTL = this._get(inst, 'isRTL'); - if (appendText) { - inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>'); - input[isRTL ? 'before' : 'after'](inst.append); - } - var showOn = this._get(inst, 'showOn'); - if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked - var buttonText = this._get(inst, 'buttonText'); - var buttonImage = this._get(inst, 'buttonImage'); - inst.trigger = $(this._get(inst, 'buttonImageOnly') ? - $('<img/>').addClass(this._triggerClass). - attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $('<button type="button"></button>').addClass(this._triggerClass). - html(buttonImage == '' ? buttonText : $('<img/>').attr( - { src:buttonImage, alt:buttonText, title:buttonText }))); - input[isRTL ? 'before' : 'after'](inst.trigger); - inst.trigger.click(function() { - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) - $.datepicker._hideDatepicker(); - else - $.datepicker._showDatepicker(target); - return false; - }); - } - input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress). - bind("setData.datepicker", function(event, key, value) { - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key) { - return this._get(inst, key); - }); - $.data(target, PROP_NAME, inst); - }, - - /* Attach an inline date picker to a div. */ - _inlineDatepicker: function(target, inst) { - var divSpan = $(target); - if (divSpan.hasClass(this.markerClassName)) - return; - divSpan.addClass(this.markerClassName).append(inst.dpDiv). - bind("setData.datepicker", function(event, key, value){ - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key){ - return this._get(inst, key); - }); - $.data(target, PROP_NAME, inst); - this._setDate(inst, this._getDefaultDate(inst)); - this._updateDatepicker(inst); - this._updateAlternate(inst); - }, - - /* Pop-up the date picker in a "dialog" box. - @param input element - ignored - @param dateText string - the initial date to display (in the current format) - @param onSelect function - the function(dateText) to call when a date is selected - @param settings object - update the dialog date picker instance's settings (anonymous object) - @param pos int[2] - coordinates for the dialog's position within the screen or - event - with x/y coordinates or - leave empty for default (screen centre) - @return the manager object */ - _dialogDatepicker: function(input, dateText, onSelect, settings, pos) { - var inst = this._dialogInst; // internal instance - if (!inst) { - var id = 'dp' + (++this.uuid); - this._dialogInput = $('<input type="text" id="' + id + - '" size="1" style="position: absolute; top: -100px;"/>'); - this._dialogInput.keydown(this._doKeyDown); - $('body').append(this._dialogInput); - inst = this._dialogInst = this._newInst(this._dialogInput, false); - inst.settings = {}; - $.data(this._dialogInput[0], PROP_NAME, inst); - } - extendRemove(inst.settings, settings || {}); - this._dialogInput.val(dateText); - - this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); - if (!this._pos) { - var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; - var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; - var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; - var scrollY = document.documentElement.scrollTop || document.body.scrollTop; - this._pos = // should use actual width/height below - [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; - } - - // move input on screen for focus, but hidden behind dialog - this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px'); - inst.settings.onSelect = onSelect; - this._inDialog = true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]); - if ($.blockUI) - $.blockUI(this.dpDiv); - $.data(this._dialogInput[0], PROP_NAME, inst); - return this; - }, - - /* Detach a datepicker from its control. - @param target element - the target input field or division or span */ - _destroyDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - $.removeData(target, PROP_NAME); - if (nodeName == 'input') { - inst.append.remove(); - inst.trigger.remove(); - $target.removeClass(this.markerClassName). - unbind('focus', this._showDatepicker). - unbind('keydown', this._doKeyDown). - unbind('keypress', this._doKeyPress); - } else if (nodeName == 'div' || nodeName == 'span') - $target.removeClass(this.markerClassName).empty(); - }, - - /* Enable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _enableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = false; - inst.trigger.filter('button'). - each(function() { this.disabled = false; }).end(). - filter('img').css({opacity: '1.0', cursor: ''}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().removeClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _disableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = true; - inst.trigger.filter('button'). - each(function() { this.disabled = true; }).end(). - filter('img').css({opacity: '0.5', cursor: 'default'}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().addClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - this._disabledInputs[this._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? - @param target element - the target input field or division or span - @return boolean - true if disabled, false if enabled */ - _isDisabledDatepicker: function(target) { - if (!target) { - return false; - } - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] == target) - return true; - } - return false; - }, - - /* Retrieve the instance data for the target control. - @param target element - the target input field or division or span - @return object - the associated instance data - @throws error if a jQuery problem getting data */ - _getInst: function(target) { - try { - return $.data(target, PROP_NAME); - } - catch (err) { - throw 'Missing instance data for this datepicker'; - } - }, - - /* Update or retrieve the settings for a date picker attached to an input field or division. - @param target element - the target input field or division or span - @param name object - the new settings to update or - string - the name of the setting to change or retrieve, - when retrieving also 'all' for all instance settings or - 'defaults' for all global defaults - @param value any - the new value for the setting - (omit if above is an object or to retrieve a value) */ - _optionDatepicker: function(target, name, value) { - var inst = this._getInst(target); - if (arguments.length == 2 && typeof name == 'string') { - return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : - (inst ? (name == 'all' ? $.extend({}, inst.settings) : - this._get(inst, name)) : null)); - } - var settings = name || {}; - if (typeof name == 'string') { - settings = {}; - settings[name] = value; - } - if (inst) { - if (this._curInst == inst) { - this._hideDatepicker(null); - } - var date = this._getDateDatepicker(target); - extendRemove(inst.settings, settings); - this._setDateDatepicker(target, date); - this._updateDatepicker(inst); - } - }, - - // change method deprecated - _changeDatepicker: function(target, name, value) { - this._optionDatepicker(target, name, value); - }, - - /* Redraw the date picker attached to an input field or division. - @param target element - the target input field or division or span */ - _refreshDatepicker: function(target) { - var inst = this._getInst(target); - if (inst) { - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. - @param target element - the target input field or division or span - @param date Date - the new date - @param endDate Date - the new end date for a range (optional) */ - _setDateDatepicker: function(target, date, endDate) { - var inst = this._getInst(target); - if (inst) { - this._setDate(inst, date, endDate); - this._updateDatepicker(inst); - this._updateAlternate(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. - @param target element - the target input field or division or span - @return Date - the current date or - Date[2] - the current dates for a range */ - _getDateDatepicker: function(target) { - var inst = this._getInst(target); - if (inst && !inst.inline) - this._setDateFromField(inst); - return (inst ? this._getDate(inst) : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(event) { - var inst = $.datepicker._getInst(event.target); - var handled = true; - var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); - inst._keyEvent = true; - if ($.datepicker._datepickerShowing) - switch (event.keyCode) { - case 9: $.datepicker._hideDatepicker(null, ''); - break; // hide on tab out - case 13: var sel = $('td.' + $.datepicker._dayOverClass + - ', td.' + $.datepicker._currentClass, inst.dpDiv); - if (sel[0]) - $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); - else - $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); - return false; // don't submit the form - break; // select the value on enter - case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); - break; // hide on escape - case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // next month/year on page down/+ ctrl - case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); - handled = event.ctrlKey || event.metaKey; - break; // clear on ctrl or command +end - case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); - handled = event.ctrlKey || event.metaKey; - break; // current on ctrl or command +home - case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); - handled = event.ctrlKey || event.metaKey; - // -1 day on ctrl or command +left - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +left on Mac - break; - case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // -1 week on ctrl or command +up - case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); - handled = event.ctrlKey || event.metaKey; - // +1 day on ctrl or command +right - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +right - break; - case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // +1 week on ctrl or command +down - default: handled = false; - } - else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - else { - handled = false; - } - if (handled) { - event.preventDefault(); - event.stopPropagation(); - } - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(event) { - var inst = $.datepicker._getInst(event.target); - if ($.datepicker._get(inst, 'constrainInput')) { - var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); - var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); - return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); - } - }, - - /* Pop-up the date picker for a given input field. - @param input element - the input field attached to the date picker or - event - if triggered by focus */ - _showDatepicker: function(input) { - input = input.target || input; - if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger - input = $('input', input.parentNode)[0]; - if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here - return; - var inst = $.datepicker._getInst(input); - var beforeShow = $.datepicker._get(inst, 'beforeShow'); - extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); - $.datepicker._hideDatepicker(null, ''); - $.datepicker._lastInput = input; - $.datepicker._setDateFromField(inst); - if ($.datepicker._inDialog) // hide cursor - input.value = ''; - if (!$.datepicker._pos) { // position below input - $.datepicker._pos = $.datepicker._findPos(input); - $.datepicker._pos[1] += input.offsetHeight; // add the height - } - var isFixed = false; - $(input).parents().each(function() { - isFixed |= $(this).css('position') == 'fixed'; - return !isFixed; - }); - if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled - $.datepicker._pos[0] -= document.documentElement.scrollLeft; - $.datepicker._pos[1] -= document.documentElement.scrollTop; - } - var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; - $.datepicker._pos = null; - inst.rangeStart = null; - // determine sizing offscreen - inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); - $.datepicker._updateDatepicker(inst); - // fix width for dynamic number of date pickers - // and adjust position before showing - offset = $.datepicker._checkOffset(inst, offset, isFixed); - inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? - 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', - left: offset.left + 'px', top: offset.top + 'px'}); - if (!inst.inline) { - var showAnim = $.datepicker._get(inst, 'showAnim') || 'show'; - var duration = $.datepicker._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._datepickerShowing = true; - if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems - $('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4, - height: inst.dpDiv.height() + 4}); - }; - if ($.effects && $.effects[showAnim]) - inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[showAnim](duration, postProcess); - if (duration == '') - postProcess(); - if (inst.input[0].type != 'hidden') - inst.input[0].focus(); - $.datepicker._curInst = inst; - } - }, - - /* Generate the date picker content. */ - _updateDatepicker: function(inst) { - var dims = {width: inst.dpDiv.width() + 4, - height: inst.dpDiv.height() + 4}; - var self = this; - inst.dpDiv.empty().append(this._generateHTML(inst)) - .find('iframe.ui-datepicker-cover'). - css({width: dims.width, height: dims.height}) - .end() - .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') - .bind('mouseout', function(){ - $(this).removeClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .bind('mouseover', function(){ - if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }) - .end() - .find('.' + this._dayOverClass + ' a') - .trigger('mouseover') - .end(); - var numMonths = this._getNumberOfMonths(inst); - var cols = numMonths[1]; - var width = 17; - if (cols > 1) { - inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); - } else { - inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); - } - inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + - 'Class']('ui-datepicker-multi'); - inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + - 'Class']('ui-datepicker-rtl'); - if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst) - $(inst.input[0]).focus(); - }, - - /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { - var dpWidth = inst.dpDiv.outerWidth(); - var dpHeight = inst.dpDiv.outerHeight(); - var inputWidth = inst.input ? inst.input.outerWidth() : 0; - var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft(); - var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop(); - - offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); - offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; - offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - - // now check if datepicker is showing outside window viewport - move to a better place if so. - offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0; - offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0; - - return offset; - }, - - /* Find an object's position on the screen. */ - _findPos: function(obj) { - while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { - obj = obj.nextSibling; - } - var position = $(obj).offset(); - return [position.left, position.top]; - }, - - /* Hide the date picker from view. - @param input element - the input field attached to the date picker - @param duration string - the duration over which to close the date picker */ - _hideDatepicker: function(input, duration) { - var inst = this._curInst; - if (!inst || (input && inst != $.data(input, PROP_NAME))) - return; - if (inst.stayOpen) - this._selectDate('#' + inst.id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - inst.stayOpen = false; - if (this._datepickerShowing) { - duration = (duration != null ? duration : this._get(inst, 'duration')); - var showAnim = this._get(inst, 'showAnim'); - var postProcess = function() { - $.datepicker._tidyDialog(inst); - }; - if (duration != '' && $.effects && $.effects[showAnim]) - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), - duration, postProcess); - else - inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' : - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess); - if (duration == '') - this._tidyDialog(inst); - var onClose = this._get(inst, 'onClose'); - if (onClose) - onClose.apply((inst.input ? inst.input[0] : null), - [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback - this._datepickerShowing = false; - this._lastInput = null; - if (this._inDialog) { - this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); - if ($.blockUI) { - $.unblockUI(); - $('body').append(this.dpDiv); - } - } - this._inDialog = false; - } - this._curInst = null; - }, - - /* Tidy up after a dialog display. */ - _tidyDialog: function(inst) { - inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); - }, - - /* Close date picker if clicked elsewhere. */ - _checkExternalClick: function(event) { - if (!$.datepicker._curInst) - return; - var $target = $(event.target); - if (($target.parents('#' + $.datepicker._mainDivId).length == 0) && - !$target.hasClass($.datepicker.markerClassName) && - !$target.hasClass($.datepicker._triggerClass) && - $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) - $.datepicker._hideDatepicker(null, ''); - }, - - /* Adjust one of the date sub-fields. */ - _adjustDate: function(id, offset, period) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._isDisabledDatepicker(target[0])) { - return; - } - this._adjustInstDate(inst, offset + - (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning - period); - this._updateDatepicker(inst); - }, - - /* Action for current link. */ - _gotoToday: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._get(inst, 'gotoCurrent') && inst.currentDay) { - inst.selectedDay = inst.currentDay; - inst.drawMonth = inst.selectedMonth = inst.currentMonth; - inst.drawYear = inst.selectedYear = inst.currentYear; - } - else { - var date = new Date(); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - } - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a new month/year. */ - _selectMonthYear: function(id, select, period) { - var target = $(id); - var inst = this._getInst(target[0]); - inst._selectingMonthYear = false; - inst['selected' + (period == 'M' ? 'Month' : 'Year')] = - inst['draw' + (period == 'M' ? 'Month' : 'Year')] = - parseInt(select.options[select.selectedIndex].value,10); - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Restore input focus after not changing month/year. */ - _clickMonthYear: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (inst.input && inst._selectingMonthYear && !$.browser.msie) - inst.input[0].focus(); - inst._selectingMonthYear = !inst._selectingMonthYear; - }, - - /* Action for selecting a day. */ - _selectDay: function(id, month, year, td) { - var target = $(id); - if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { - return; - } - var inst = this._getInst(target[0]); - inst.selectedDay = inst.currentDay = $('a', td).html(); - inst.selectedMonth = inst.currentMonth = month; - inst.selectedYear = inst.currentYear = year; - if (inst.stayOpen) { - inst.endDay = inst.endMonth = inst.endYear = null; - } - this._selectDate(id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - if (inst.stayOpen) { - inst.rangeStart = this._daylightSavingAdjust( - new Date(inst.currentYear, inst.currentMonth, inst.currentDay)); - this._updateDatepicker(inst); - } - }, - - /* Erase the input field and hide the date picker. */ - _clearDate: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - inst.stayOpen = false; - inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null; - this._selectDate(target, ''); - }, - - /* Update the input field with the selected date. */ - _selectDate: function(id, dateStr) { - var target = $(id); - var inst = this._getInst(target[0]); - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - if (inst.input) - inst.input.val(dateStr); - this._updateAlternate(inst); - var onSelect = this._get(inst, 'onSelect'); - if (onSelect) - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - else if (inst.input) - inst.input.trigger('change'); // fire the change event - if (inst.inline) - this._updateDatepicker(inst); - else if (!inst.stayOpen) { - this._hideDatepicker(null, this._get(inst, 'duration')); - this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) != 'object') - inst.input[0].focus(); // restore focus - this._lastInput = null; - } - }, - - /* Update any alternate field to synchronise with the main field. */ - _updateAlternate: function(inst) { - var altField = this._get(inst, 'altField'); - if (altField) { // update alternate field too - var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); - var date = this._getDate(inst); - dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); - $(altField).each(function() { $(this).val(dateStr); }); - } - }, - - /* Set as beforeShowDay function to prevent selection of weekends. - @param date Date - the date to customise - @return [boolean, string] - is this date selectable?, what is its CSS class? */ - noWeekends: function(date) { - var day = date.getDay(); - return [(day > 0 && day < 6), '']; - }, - - /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. - @param date Date - the date to get the week for - @return number - the number of the week within the year that contains this date */ - iso8601Week: function(date) { - var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan - var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7 - firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday - if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary - checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year - return $.datepicker.iso8601Week(checkDate); - } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year - firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7; - if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary - return 1; - } - } - return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date - }, - - /* Parse a string value into a date object. - See formatDate below for the possible formats. - - @param format string - the expected format of the date - @param value string - the date in the above format - @param settings Object - attributes include: - shortYearCutoff number - the cutoff year for determining the century (optional) - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return Date - the extracted date value or null if value is blank */ - parseDate: function (format, value, settings) { - if (format == null || value == null) - throw 'Invalid arguments'; - value = (typeof value == 'object' ? value.toString() : value + ''); - if (value == '') - return null; - var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - var year = -1; - var month = -1; - var day = -1; - var doy = -1; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Extract a number from the string value - var getNumber = function(match) { - lookAhead(match); - var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2))); - var size = origSize; - var num = 0; - while (size > 0 && iValue < value.length && - value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') { - num = num * 10 + parseInt(value.charAt(iValue++),10); - size--; - } - if (size == origSize) - throw 'Missing number at position ' + iValue; - return num; - }; - // Extract a name from the string value and convert to an index - var getName = function(match, shortNames, longNames) { - var names = (lookAhead(match) ? longNames : shortNames); - var size = 0; - for (var j = 0; j < names.length; j++) - size = Math.max(size, names[j].length); - var name = ''; - var iInit = iValue; - while (size > 0 && iValue < value.length) { - name += value.charAt(iValue++); - for (var i = 0; i < names.length; i++) - if (name == names[i]) - return i + 1; - size--; - } - throw 'Unknown name at position ' + iInit; - }; - // Confirm that a literal character matches the string value - var checkLiteral = function() { - if (value.charAt(iValue) != format.charAt(iFormat)) - throw 'Unexpected literal at position ' + iValue; - iValue++; - }; - var iValue = 0; - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - checkLiteral(); - else - switch (format.charAt(iFormat)) { - case 'd': - day = getNumber('d'); - break; - case 'D': - getName('D', dayNamesShort, dayNames); - break; - case 'o': - doy = getNumber('o'); - break; - case 'm': - month = getNumber('m'); - break; - case 'M': - month = getName('M', monthNamesShort, monthNames); - break; - case 'y': - year = getNumber('y'); - break; - case '@': - var date = new Date(getNumber('@')); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "'": - if (lookAhead("'")) - checkLiteral(); - else - literal = true; - break; - default: - checkLiteral(); - } - } - if (year == -1) - year = new Date().getFullYear(); - else if (year < 100) - year += new Date().getFullYear() - new Date().getFullYear() % 100 + - (year <= shortYearCutoff ? 0 : -100); - if (doy > -1) { - month = 1; - day = doy; - do { - var dim = this._getDaysInMonth(year, month - 1); - if (day <= dim) - break; - month++; - day -= dim; - } while (true); - } - var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); - if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) - throw 'Invalid date'; // E.g. 31/02/* - return date; - }, - - /* Standard date formats. */ - ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) - COOKIE: 'D, dd M yy', - ISO_8601: 'yy-mm-dd', - RFC_822: 'D, d M y', - RFC_850: 'DD, dd-M-y', - RFC_1036: 'D, d M y', - RFC_1123: 'D, d M yy', - RFC_2822: 'D, d M yy', - RSS: 'D, d M y', // RFC 822 - TIMESTAMP: '@', - W3C: 'yy-mm-dd', // ISO 8601 - - /* Format a date object into a string value. - The format can be combinations of the following: - d - day of month (no leading zero) - dd - day of month (two digit) - o - day of year (no leading zeros) - oo - day of year (three digit) - D - day name short - DD - day name long - m - month of year (no leading zero) - mm - month of year (two digit) - M - month name short - MM - month name long - y - year (two digit) - yy - year (four digit) - @ - Unix timestamp (ms since 01/01/1970) - '...' - literal text - '' - single quote - - @param format string - the desired format of the date - @param date Date - the date value to format - @param settings Object - attributes include: - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return string - the date in the above format */ - formatDate: function (format, date, settings) { - if (!date) - return ''; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Format a number, with leading zero if necessary - var formatNumber = function(match, value, len) { - var num = '' + value; - if (lookAhead(match)) - while (num.length < len) - num = '0' + num; - return num; - }; - // Format a name, short or long as requested - var formatName = function(match, value, shortNames, longNames) { - return (lookAhead(match) ? longNames[value] : shortNames[value]); - }; - var output = ''; - var literal = false; - if (date) - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - output += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': - output += formatNumber('d', date.getDate(), 2); - break; - case 'D': - output += formatName('D', date.getDay(), dayNamesShort, dayNames); - break; - case 'o': - var doy = date.getDate(); - for (var m = date.getMonth() - 1; m >= 0; m--) - doy += this._getDaysInMonth(date.getFullYear(), m); - output += formatNumber('o', doy, 3); - break; - case 'm': - output += formatNumber('m', date.getMonth() + 1, 2); - break; - case 'M': - output += formatName('M', date.getMonth(), monthNamesShort, monthNames); - break; - case 'y': - output += (lookAhead('y') ? date.getFullYear() : - (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); - break; - case '@': - output += date.getTime(); - break; - case "'": - if (lookAhead("'")) - output += "'"; - else - literal = true; - break; - default: - output += format.charAt(iFormat); - } - } - return output; - }, - - /* Extract all possible characters from the date format. */ - _possibleChars: function (format) { - var chars = ''; - var literal = false; - for (var iFormat = 0; iFormat < format.length; iFormat++) - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - chars += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': case 'm': case 'y': case '@': - chars += '0123456789'; - break; - case 'D': case 'M': - return null; // Accept anything - case "'": - if (lookAhead("'")) - chars += "'"; - else - literal = true; - break; - default: - chars += format.charAt(iFormat); - } - return chars; - }, - - /* Get a setting value, defaulting if necessary. */ - _get: function(inst, name) { - return inst.settings[name] !== undefined ? - inst.settings[name] : this._defaults[name]; - }, - - /* Parse existing date and initialise date picker. */ - _setDateFromField: function(inst) { - var dateFormat = this._get(inst, 'dateFormat'); - var dates = inst.input ? inst.input.val() : null; - inst.endDay = inst.endMonth = inst.endYear = null; - var date = defaultDate = this._getDefaultDate(inst); - var settings = this._getFormatConfig(inst); - try { - date = this.parseDate(dateFormat, dates, settings) || defaultDate; - } catch (event) { - this.log(event); - date = defaultDate; - } - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - inst.currentDay = (dates ? date.getDate() : 0); - inst.currentMonth = (dates ? date.getMonth() : 0); - inst.currentYear = (dates ? date.getFullYear() : 0); - this._adjustInstDate(inst); - }, - - /* Retrieve the default date shown on opening. */ - _getDefaultDate: function(inst) { - var date = this._determineDate(this._get(inst, 'defaultDate'), new Date()); - var minDate = this._getMinMaxDate(inst, 'min', true); - var maxDate = this._getMinMaxDate(inst, 'max'); - date = (minDate && date < minDate ? minDate : date); - date = (maxDate && date > maxDate ? maxDate : date); - return date; - }, - - /* A date may be specified as an exact value or a relative one. */ - _determineDate: function(date, defaultDate) { - var offsetNumeric = function(offset) { - var date = new Date(); - date.setDate(date.getDate() + offset); - return date; - }; - var offsetString = function(offset, getDaysInMonth) { - var date = new Date(); - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; - var matches = pattern.exec(offset); - while (matches) { - switch (matches[2] || 'd') { - case 'd' : case 'D' : - day += parseInt(matches[1],10); break; - case 'w' : case 'W' : - day += parseInt(matches[1],10) * 7; break; - case 'm' : case 'M' : - month += parseInt(matches[1],10); - day = Math.min(day, getDaysInMonth(year, month)); - break; - case 'y': case 'Y' : - year += parseInt(matches[1],10); - day = Math.min(day, getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - return new Date(year, month, day); - }; - date = (date == null ? defaultDate : - (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) : - (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); - date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); - if (date) { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - } - return this._daylightSavingAdjust(date); - }, - - /* Handle switch to/from daylight saving. - Hours may be non-zero on daylight saving cut-over: - > 12 when midnight changeover, but then cannot generate - midnight datetime, so jump to 1AM, otherwise reset. - @param date (Date) the date to check - @return (Date) the corrected date */ - _daylightSavingAdjust: function(date) { - if (!date) return null; - date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); - return date; - }, - - /* Set the date(s) directly. */ - _setDate: function(inst, date, endDate) { - var clear = !(date); - var origMonth = inst.selectedMonth; - var origYear = inst.selectedYear; - date = this._determineDate(date, new Date()); - inst.selectedDay = inst.currentDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); - if (origMonth != inst.selectedMonth || origYear != inst.selectedYear) - this._notifyChange(inst); - this._adjustInstDate(inst); - if (inst.input) { - inst.input.val(clear ? '' : this._formatDate(inst)); - } - }, - - /* Retrieve the date(s) directly. */ - _getDate: function(inst) { - var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : - this._daylightSavingAdjust(new Date( - inst.currentYear, inst.currentMonth, inst.currentDay))); - return startDate; - }, - - /* Generate the HTML for the current state of the date picker. */ - _generateHTML: function(inst) { - var today = new Date(); - today = this._daylightSavingAdjust( - new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time - var isRTL = this._get(inst, 'isRTL'); - var showButtonPanel = this._get(inst, 'showButtonPanel'); - var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); - var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); - var numMonths = this._getNumberOfMonths(inst); - var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); - var stepMonths = this._get(inst, 'stepMonths'); - var stepBigMonths = this._get(inst, 'stepBigMonths'); - var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); - var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : - new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - var minDate = this._getMinMaxDate(inst, 'min', true); - var maxDate = this._getMinMaxDate(inst, 'max'); - var drawMonth = inst.drawMonth - showCurrentAtPos; - var drawYear = inst.drawYear; - if (drawMonth < 0) { - drawMonth += 12; - drawYear--; - } - if (maxDate) { - var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), - maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate())); - maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); - while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { - drawMonth--; - if (drawMonth < 0) { - drawMonth = 11; - drawYear--; - } - } - } - inst.drawMonth = drawMonth; - inst.drawYear = drawYear; - var prevText = this._get(inst, 'prevText'); - prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), - this._getFormatConfig(inst))); - var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' + - ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : - (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>')); - var nextText = this._get(inst, 'nextText'); - nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), - this._getFormatConfig(inst))); - var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' + - ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : - (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>')); - var currentText = this._get(inst, 'currentText'); - var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); - currentText = (!navigationAsDateFormat ? currentText : - this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : ''); - var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') + - (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' + - '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; - var firstDay = parseInt(this._get(inst, 'firstDay'),10); - firstDay = (isNaN(firstDay) ? 0 : firstDay); - var dayNames = this._get(inst, 'dayNames'); - var dayNamesShort = this._get(inst, 'dayNamesShort'); - var dayNamesMin = this._get(inst, 'dayNamesMin'); - var monthNames = this._get(inst, 'monthNames'); - var monthNamesShort = this._get(inst, 'monthNamesShort'); - var beforeShowDay = this._get(inst, 'beforeShowDay'); - var showOtherMonths = this._get(inst, 'showOtherMonths'); - var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; - var endDate = inst.endDay ? this._daylightSavingAdjust( - new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate; - var defaultDate = this._getDefaultDate(inst); - var html = ''; - for (var row = 0; row < numMonths[0]; row++) { - var group = ''; - for (var col = 0; col < numMonths[1]; col++) { - var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); - var cornerClass = ' ui-corner-all'; - var calender = ''; - if (isMultiMonth) { - calender += '<div class="ui-datepicker-group ui-datepicker-group-'; - switch (col) { - case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break; - case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break; - default: calender += 'middle'; cornerClass = ''; break; - } - calender += '">'; - } - calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + - (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + - (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + - this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, - selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers - '</div><table class="ui-datepicker-calendar"><thead>' + - '<tr>'; - var thead = ''; - for (var dow = 0; dow < 7; dow++) { // days of the week - var day = (dow + firstDay) % 7; - thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + - '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>'; - } - calender += thead + '</tr></thead><tbody>'; - var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); - if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) - inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); - var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate - var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); - for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows - calender += '<tr>'; - var tbody = ''; - for (var dow = 0; dow < 7; dow++) { // create date picker days - var daySettings = (beforeShowDay ? - beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); - var otherMonth = (printDate.getMonth() != drawMonth); - var unselectable = otherMonth || !daySettings[0] || - (minDate && printDate < minDate) || (maxDate && printDate > maxDate); - tbody += '<td class="' + - ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends - (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months - ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key - (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ? - // or defaultDate is current printedDate and defaultDate is selectedDate - ' ' + this._dayOverClass : '') + // highlight selected day - (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days - (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates - (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range - ' ' + this._currentClass : '') + // highlight selected day - (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) - ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title - (unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' + - inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions - (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months - (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + - (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') + - (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range - ' ui-state-active' : '') + // highlight selected day - '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month - printDate.setDate(printDate.getDate() + 1); - printDate = this._daylightSavingAdjust(printDate); - } - calender += tbody + '</tr>'; - } - drawMonth++; - if (drawMonth > 11) { - drawMonth = 0; - drawYear++; - } - calender += '</tbody></table>' + (isMultiMonth ? '</div>' + - ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : ''); - group += calender; - } - html += group; - } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? - '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - selectedDate, secondary, monthNames, monthNamesShort) { - minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate); - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '<div class="ui-datepicker-title">'; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> '; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += '<select class="ui-datepicker-month" ' + - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' + - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + - '>'; - for (var month = 0; month < 12; month++) { - if ((!inMinYear || month >= minDate.getMonth()) && - (!inMaxYear || month <= maxDate.getMonth())) - monthHtml += '<option value="' + month + '"' + - (month == drawMonth ? ' selected="selected"' : '') + - '>' + monthNamesShort[month] + '</option>'; - } - monthHtml += '</select>'; - } - if (!showMonthAfterYear) - html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? ' ' : ''); - // year selection - if (secondary || !changeYear) - html += '<span class="ui-datepicker-year">' + drawYear + '</span>'; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var year = 0; - var endYear = 0; - if (years.length != 2) { - year = drawYear - 10; - endYear = drawYear + 10; - } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') { - year = drawYear + parseInt(years[0], 10); - endYear = drawYear + parseInt(years[1], 10); - } else { - year = parseInt(years[0], 10); - endYear = parseInt(years[1], 10); - } - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - html += '<select class="ui-datepicker-year" ' + - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' + - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + - '>'; - for (; year <= endYear; year++) { - html += '<option value="' + year + '"' + - (year == drawYear ? ' selected="selected"' : '') + - '>' + year + '</option>'; - } - html += '</select>'; - } - if (showMonthAfterYear) - html += (secondary || changeMonth || changeYear ? ' ' : '') + monthHtml; - html += '</div>'; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._daylightSavingAdjust(new Date(year, month, day)); - // ensure it is within the bounds set - var minDate = this._getMinMaxDate(inst, 'min', true); - var maxDate = this._getMinMaxDate(inst, 'max'); - date = (minDate && date < minDate ? minDate : date); - date = (maxDate && date > maxDate ? maxDate : date); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */ - _getMinMaxDate: function(inst, minMax, checkRange) { - var date = this._determineDate(this._get(inst, minMax + 'Date'), null); - return (!checkRange || !inst.rangeStart ? date : - (!date || inst.rangeStart > date ? inst.rangeStart : date)); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - new Date(year, month, 32).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date( - curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - // during range selection, use minimum of selected date and range start - var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust( - new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay))); - newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate); - var minDate = newMinDate || this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate)); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Determine whether an object is an array. */ -function isArray(a) { - return (a && (($.browser.safari && typeof a == 'object' && a.length) || - (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); -}; - -/* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.7.2"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window.DP_jQuery = $; - -})(jQuery); diff --git a/static/upbutton.png b/static/upbutton.png Binary files differdeleted file mode 100644 index 8129526..0000000 --- a/static/upbutton.png +++ /dev/null diff --git a/static/upbutton1.png b/static/upbutton1.png Binary files differdeleted file mode 100644 index aa5c934..0000000 --- a/static/upbutton1.png +++ /dev/null diff --git a/static/upload-test.html b/static/upload-test.html deleted file mode 100755 index 1590b66..0000000 --- a/static/upload-test.html +++ /dev/null @@ -1,47 +0,0 @@ -<html> - <head> - <title>DUMP file upload test</title> - <script type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> - <script type="text/javascript" - src="/static/js/jquery.form.js"></script> - - <script> - args = 1; - $(document).ready(function() { - var error = function(resp) { - $('#result').hide().css({'color': 'red'}) - .html(resp.statusText).fadeIn(250); - } - var success = function(imageUrl) { - imageUrl = $.trim(imageUrl); - console.log(imageUrl, imageUrl.length); - if ($.trim(imageUrl) == "NOT_LOGGED_IN") { - error({statusText: "Not logged in!" }); - return; - } - $('#result').hide().css({'color': 'green'}) - .html('<img src="' + imageUrl + '">').fadeIn(250); - } - - $('#test').ajaxForm({ - url: '/upload', - type: 'POST', - dataType: 'text', - success: success, - error: error - }); - }); - </script> - </head> - <body> - <h2>Upload File</h2> - <form id="test" enctype="multipart/form-data"> - <input type="hidden" name="room" value="RoomA"> - <input type="file" name="image"> - <br /> - <input type="submit"> - </form> - <div id="result"></div> - </body> -</html> diff --git a/static/upload.png b/static/upload.png Binary files differdeleted file mode 100644 index 6929ad7..0000000 --- a/static/upload.png +++ /dev/null diff --git a/static/uploadstuff.png b/static/uploadstuff.png Binary files differdeleted file mode 100644 index 8a4c30c..0000000 --- a/static/uploadstuff.png +++ /dev/null diff --git a/static/urlbutton.png b/static/urlbutton.png Binary files differdeleted file mode 100644 index 1fc486b..0000000 --- a/static/urlbutton.png +++ /dev/null diff --git a/static/urserlisthelp.png b/static/urserlisthelp.png Binary files differdeleted file mode 100644 index bb2a559..0000000 --- a/static/urserlisthelp.png +++ /dev/null diff --git a/static/userlisthelp.png b/static/userlisthelp.png Binary files differdeleted file mode 100644 index db0fc24..0000000 --- a/static/userlisthelp.png +++ /dev/null diff --git a/static/valid_html-cougar.gif b/static/valid_html-cougar.gif Binary files differdeleted file mode 100644 index cb14ae4..0000000 --- a/static/valid_html-cougar.gif +++ /dev/null diff --git a/static/valid_html.gif b/static/valid_html.gif Binary files differdeleted file mode 100644 index 105505f..0000000 --- a/static/valid_html.gif +++ /dev/null diff --git a/static/valid_html3.2.gif b/static/valid_html3.2.gif Binary files differdeleted file mode 100644 index 4de03e0..0000000 --- a/static/valid_html3.2.gif +++ /dev/null diff --git a/static/validator-w3-org_vh40.gif b/static/validator-w3-org_vh40.gif Binary files differdeleted file mode 100644 index c5e9402..0000000 --- a/static/validator-w3-org_vh40.gif +++ /dev/null diff --git a/static/vxhtml.gif b/static/vxhtml.gif Binary files differdeleted file mode 100644 index b417962..0000000 --- a/static/vxhtml.gif +++ /dev/null diff --git a/static/webcamhelp.png b/static/webcamhelp.png Binary files differdeleted file mode 100644 index 4c7daf2..0000000 --- a/static/webcamhelp.png +++ /dev/null diff --git a/static/welcome.gif b/static/welcome.gif Binary files differdeleted file mode 100644 index 5f3cfd0..0000000 --- a/static/welcome.gif +++ /dev/null diff --git a/static/welcomebanner.gif b/static/welcomebanner.gif Binary files differdeleted file mode 100644 index 080bb61..0000000 --- a/static/welcomebanner.gif +++ /dev/null diff --git a/static/welcometop.gif b/static/welcometop.gif Binary files differdeleted file mode 100644 index c3f3b54..0000000 --- a/static/welcometop.gif +++ /dev/null diff --git a/static/welcometop.png b/static/welcometop.png Binary files differdeleted file mode 100644 index 105dc9a..0000000 --- a/static/welcometop.png +++ /dev/null diff --git a/static/whited.png b/static/whited.png Binary files differdeleted file mode 100644 index 828833a..0000000 --- a/static/whited.png +++ /dev/null diff --git a/static/whitedover.png b/static/whitedover.png Binary files differdeleted file mode 100644 index 1e7e1cb..0000000 --- a/static/whitedover.png +++ /dev/null diff --git a/static/wowalk.gif b/static/wowalk.gif Binary files differdeleted file mode 100644 index 7370ec3..0000000 --- a/static/wowalk.gif +++ /dev/null diff --git a/static/xd_receiver.htm b/static/xd_receiver.htm deleted file mode 100644 index 3c63739..0000000 --- a/static/xd_receiver.htm +++ /dev/null @@ -1 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>xd</title></head><body><script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script></body></html>
\ No newline at end of file diff --git a/static/yellow.gif b/static/yellow.gif Binary files differdeleted file mode 100644 index 2756016..0000000 --- a/static/yellow.gif +++ /dev/null diff --git a/template/about_us.st b/template/about_us.st index 6cd04dc..7431eac 100644 --- a/template/about_us.st +++ b/template/about_us.st @@ -3,23 +3,19 @@ <link href="/static/css/pages.css" rel="stylesheet" type="text/css" media="screen" /> <link href="/static/css/win.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="/static/js/win.js"></script> - - <script type="text/javascript"> + <script type="text/javascript"> jQuery(function() { jQuery('.scroll-pane').jScrollPane(); }); - - </script> - - <title>dump.fm</title> + <title>dump.fm: about us</title> $head()$ </head> <body style="font-family: Arial, Helvetica, sans-serif; background-color:#ffffee; - background-image:url(/static/chanbg.png); + background-image:url(/static/img/chanbg.png); background-repeat:repeat-x; background-position:1 10; background-attachment:fixed;" onload=" @@ -36,33 +32,33 @@ background-attachment:fixed;" onload=" <div style="overflow:hidden; height:600px; position:absolute;display:none;" id="news"> <div style="padding:0px" id="content" name="content"> <div style="background-color:#fff"><center> -<img src="/static/dumpclouds.png"><br><br> +<img src="/static/img/dumpclouds.png"><br><br> <h5 style="padding:2px;"> -DUMP.FM is a <img src="/static/newanim.gif"> exciting tool for the internets; allowing pictures to be used for realtime communication and collaboration. Users can send image URLs (which display instantly in the chat), upload locally from their hard drive or post a pics right from their webcam. Every image gets stored in your DUMP.FM log, similarly, a log is kept of the entire collaboration. +DUMP.FM is a <img src="/static/img/newanim.gif"> exciting tool for the internets; allowing pictures to be used for realtime communication and collaboration. Users can send image URLs (which display instantly in the chat), upload locally from their hard drive or post a pics right from their webcam. Every image gets stored in your DUMP.FM log, similarly, a log is kept of the entire collaboration. </center><br></div></h5> </div></div> <div style="display:none;"id="link"> - <div id="content" name="content"style="background-image:url(/static/hearts.gif);background-repeat:repeat;"> -<img src="/static/dumpteam.gif"><br><br> + <div id="content" name="content"style="background-image:url(/static/img/hearts.gif);background-repeat:repeat;"> +<img src="/static/img/dumpteam.gif"><br><br> <h1><br> <a href="/u/ryder">Ryder Ripps</a> - screams, rapping<br></h1> - <h2> <img src="/static/dot.gif"> Ryder is also the founder of <a href="http://www.internetarchaeology.org" target="_blank">Internet Archaeology</a></h2> + <h2> <img src="/static/img/dot.gif"> Ryder is also the founder of <a href="http://www.internetarchaeology.org" target="_blank">Internet Archaeology</a></h2> <h1><a href="/u/scottbot">Scott Ostler</a> - clean vocals <br></h1> - <h2> <img src="/static/dot.gif"> Scott also worked on the development of <a href="http://www.simile-widgets.org/exhibit/"target="_blank">MIT Exhibit</a></h2> + <h2> <img src="/static/img/dot.gif"> Scott also worked on the development of <a href="http://www.simile-widgets.org/exhibit/"target="_blank">MIT Exhibit</a></h2> <h1><a href="/u/timb">Tim Baker</a> - synths, guitars, beats, backing vocals <br></h1> - <h2> <img src="/static/dot.gif"> Tim also helped make <a href="http://www.delicious.com" target="_blank">delicious</a></h2> + <h2> <img src="/static/img/dot.gif"> Tim also helped make <a href="http://www.delicious.com" target="_blank">delicious</a></h2> <h1><a href="/u/stefan">Stefan Moore</a> - beats, fog machine, lights <br></h1> - <h2> <img src="/static/dot.gif"> Stefan is also one half of <a href="http://www.that-go.net" target="_blank">That-Go</a></h2> + <h2> <img src="/static/img/dot.gif"> Stefan is also one half of <a href="http://www.that-go.net" target="_blank">That-Go</a></h2> </h1> </div> </div> <div style="display:none;background-color:#fff;"id="contact"> <div id="content" name="content"> - <center><div style="background-color:#fff"><br><br><img src="/static/tvfun.gif"><img src="/static/tvfun.gif"><img src="/static/tvfun.gif"><br><br> + <center><div style="background-color:#fff"><br><br><img src="/static/img/tvfun.gif"><img src="/static/img/tvfun.gif"><img src="/static/img/tvfun.gif"><br><br> <h5><br> @@ -72,7 +68,7 @@ You can shoot us an email at </div> </div> </div> -<div id="hugescreen"><img src="/static/hugescreen.png"></div> +<div id="hugescreen"><img src="/static/img/hugescreen.png"></div> <div id="footer"> $footer()$ diff --git a/template/banner.st b/template/banner.st index 9c6198c..02613c6 100644 --- a/template/banner.st +++ b/template/banner.st @@ -4,7 +4,6 @@ <div id="logoicons"> <div id="logo7"> <div align="center"><a href="/">dump.fm</a></div> - <div id="strapline"><img src="/static/talkwith.png" width="179" height="53" /></div> </div> <div class="white"> @@ -14,16 +13,16 @@ $if(user_nick)$ - <a href="/log" ><img src="/static/text.gif"width="20px" height="20px"> Log</a> - <a href="/u/$user_nick$">$if(user_avatar)$<img src="$user_avatar$" width="19px" height="19px" />$else$<img src="/static/home4.gif"width="22px" height="22px" />$endif$ Profile</a> - <a href="/directory"><img src="/static/directory.gif"width="20px" height="20px" /> Directory</a> - <a href="/browser"><img src="/static/image_draw.gif"/> Image Search</a> + <a href="/log" ><img src="/static/img/log.gif"width="20px" height="20px"> Log</a> + <a href="/u/$user_nick$">$if(user_avatar)$<img src="$user_avatar$" width="19px" height="19px" />$else$<img src="/static/img/profile.gif"width="22px" height="22px" />$endif$ Profile</a> + <a href="/directory"><img src="/static/img/directory.gif"width="20px" height="20px" /> Directory</a> + <a href="/browser"><img src="/static/img/image_draw.gif"/> Image Search</a> $else$ <div id="registerlink"> -<a href="/register"><img src="/static/ako.gif"width="21px" height="21px" /> Register</a> +<a href="/register"><img src="/static/img/ako.gif"width="21px" height="21px" /> Register</a> </div> @@ -43,7 +42,7 @@ </div> $endif$ <div id="logout7" class="white"> - <div align="center">$if(user_nick)$ <a href="/logout"><img src="/static/door2.gif" width="16" height="16" /> Logout</a> $else$ $form_login()$ $endif$ + <div align="center">$if(user_nick)$ <a href="/logout"><img src="/static/img/door.gif" width="16" height="16" /> Logout</a> $else$ $form_login()$ $endif$ </div> </div> diff --git a/template/browser.st b/template/browser.st index 28a514d..8cb6403 100644 --- a/template/browser.st +++ b/template/browser.st @@ -49,9 +49,7 @@ </div> <div id="messagePane"> <div id="messageList"> - <iframe src="/static/search/browser.html" - allowtransparency="true" - scrolling="auto" ></iframe> + <iframe src="/static/search/browser.html" allowtransparency="true" scrolling="auto" ></iframe> </div> </div> diff --git a/template/butt.st b/template/butt.st new file mode 100644 index 0000000..b14df64 --- /dev/null +++ b/template/butt.st @@ -0,0 +1 @@ +Hi diff --git a/template/debug.st b/template/debug.st new file mode 100644 index 0000000..c9bbcdb --- /dev/null +++ b/template/debug.st @@ -0,0 +1,56 @@ +<html> + <head> + <title>dump.fm DEBUG</title> + $head()$ + <style> + #main { + padding: 100px 2em 0px 2em; + } + #flash { + border: 2px solid red; + margin: 0 auto; + padding: 1em; + width: 75% + } + label { + float: left; + width: 100px; + } + </style> + </head> + <body> + $banner()$ + <div id="main"> + + $if(flash)$ + <div id="flash">$flash$</div> + <br><br><br> + $endif$ + + <form action="/debug" method="POST"> + <h1>Registration Email</h1> + <br> + <label>To:</label> + <input name="to" value="$user_email$"> + <br> + <label>Nick:</label> + <input name="nick" value="$user_nick$"> + <br> + <label>Template:</label> + <div> + $mailtemps: { t | + <input type="radio" name="template" value="$t.template$" + $if(t.selected)$checked="checked"$endif$> $t.template$ + }$ + </div> + <br> + <input type="submit" value="Send Email"> + <input type="hidden" name="action" value="regemail"> + <br> + <form/> + </div> + </body> +</html> + + + diff --git a/template/directory.st b/template/directory.st index 9135947..05d13e2 100644 --- a/template/directory.st +++ b/template/directory.st @@ -25,7 +25,7 @@ <center> <h2>✭ ✭ DUMP STARS ✭ ✭</h2> <div id="lolbanner"> - <img src="/static/welcomebanner.gif"> + <img src="/static/img/welcomebanner.gif"> </div> </center> $if(users)$ @@ -39,7 +39,7 @@ </div> $else$ <div id="logavatar"> - <img height="50" width="50" src="/static/noinfo.png" /> + <img height="50" width="50" src="/static/img/noinfo.png" /> </div> $endif$ </a> diff --git a/template/form_login.st b/template/form_login.st index ad61bbb..7d7adf5 100644 --- a/template/form_login.st +++ b/template/form_login.st @@ -24,7 +24,7 @@ </p> <p class="remember"><br> - <img src="/static/signin.gif" id="signin-submit"> + <img src="/static/img/signin.gif" id="signin-submit"> <!-- <input id="signin-submit" value="Sign in" tabindex="6" type="submit"> --> </p> diff --git a/template/head.st b/template/head.st index cb2d0fb..8634534 100644 --- a/template/head.st +++ b/template/head.st @@ -12,7 +12,6 @@ $if(!user_nick)$ $endif$ <link rel="shortcut icon" href="/static/favicon.ico"> <script type="text/javascript"> -jQuery(document).ready(function () { MM_preloadImages('/static/mouseover.gif'); }); </script> <!--[if IE]> <script> diff --git a/template/help.st b/template/help.st index 24285d6..d1a999c 100644 --- a/template/help.st +++ b/template/help.st @@ -3,7 +3,7 @@ <link href="/static/css/pages.css" rel="stylesheet" type="text/css" media="screen"/> <link href="/static/css/win.css" rel="stylesheet" type="text/css" media="screen"/> <script type="text/javascript" src="/static/js/win.js"></script> - <script type="text/javascript" src="/static/jquery.em.js"></script> + <script type="text/javascript"> jQuery(function() @@ -19,11 +19,12 @@ jQuery(function() </head> <body style="font-family: Arial, Helvetica, sans-serif; background-color:#ffffee; - background-image:url(/static/chanbg.png); + background-image:url(/static/img/chanbg.png); background-repeat:repeat-x; background-position:1 10; background-attachment:fixed;" onload=" javascript:CreateDropdownWindow('dump.fm', '360px', true, 'news', 30, 115); + javascript:CreateDropdownWindow('frequently asked questions', '520px', true, 'archive', 440, 60); @@ -36,18 +37,18 @@ background-attachment:fixed;" onload=" <div style="overflow:hidden; height:600px; position:absolute;display:none;" id="news"> <div style="padding:0px;" id="content" name="content"> <div style="background-color:#fff"><center> -<img src="/static/dumpclouds.png"><br><br> +<img src="/static/img/dumpclouds.png"><br><br> <h5> ©2010 All Rights Reserved<br><br> <a href="mailto:info@dump.fm"> info@dump.fm</a> </center><br></div></h5> </div></div> - + <div style="display:none;"id="archive"> <div style="padding:0px" id="content" name="content"> - <iframe src="/static/help.html" style="overflow-x:hidden; padding:5;background-image:url(/static/hearts.gif);background-repeat:repeat;" width="510px" height="500px"></iframe> + <iframe src="/static/html/help.html" style="overflow-x:hidden; padding:5;background-image:url(/static/img/hearts.gif);background-repeat:repeat;" width="510px" height="500px"name="iframe"></iframe> </div> </div> <div style="display:none;"id="link"> @@ -60,7 +61,7 @@ background-attachment:fixed;" onload=" </div> </div> </div> -<div id="hugescreen"><img src="/static/hugescreen.png"></div> +<div id="hugescreen"><img src="/static/img/hugescreen.png"></div> <div id="footer"> diff --git a/template/logged_dump.st b/template/logged_dump.st new file mode 100755 index 0000000..3b8336a --- /dev/null +++ b/template/logged_dump.st @@ -0,0 +1,20 @@ + +<div class="logged-dump" id="message-$dump.message_id$"> + <div>$dump.created_on$ -- by <b><a href="/u/$dump.nick$">$dump.nick$</a></b></div> + + <a href="/u/$dump.nick$"> + + <div id="logavatar"> + + $if(dump.avatar)$<img height="50" width="50" src="$dump.avatar$" /> + + $else$ + + <img height="50" width="50" src="/static/noinfo.png"> + + $endif$ + </div></a> + <div class="content">$dump.content$</div> + <hr /> + $share_buttons()$ +</div> diff --git a/template/preload.st b/template/preload.st index 8963e70..3339e4e 100644 --- a/template/preload.st +++ b/template/preload.st @@ -1,13 +1,13 @@ <!-- todo: just put this lot in javascript? --> <div id="preload"> <img src="/static/img/cursors/osx.hand.gif" class="no-cursor invisible" id="cursor-big" /> - <img src="/static/upload.png" class="invisible" /> - <img src="/static/dblue2.png" class="invisible" /> -<img src="/static/text.gif" class="invisible" /> -<img src="/static/directory.gif" class="invisible" /> -<img src="/static/image_draw.gif" class="invisible" /> -<img src="/static/door2.gif" class="invisible" /> -<img src="/static/cambutton.png" class="invisible" /> -<img src="/static/urlbutton.png" class="invisible" /> -<img src="/static/upbutton.png" class="invisible" /> + <img src="/static/img/upload.png" class="invisible" /> + <img src="/static/img/dblue2.png" class="invisible" /> +<img src="/static/img/log.gif" class="invisible" /> +<img src="/static/img/directory.gif" class="invisible" /> +<img src="/static/img/image_draw.gif" class="invisible" /> +<img src="/static/img/door.gif" class="invisible" /> +<img src="/static/img/cambutton.png" class="invisible" /> +<img src="/static/img/urlbutton.png" class="invisible" /> +<img src="/static/img/upbutton.png" class="invisible" /> </div>
\ No newline at end of file diff --git a/template/privacy.st b/template/privacy.st index 9c0c90e..d904951 100644 --- a/template/privacy.st +++ b/template/privacy.st @@ -4,6 +4,7 @@ <link href="/static/css/win.css" rel="stylesheet" type="text/css" media="screen"/> <script type="text/javascript" src="/static/js/win.js"></script> <script type="text/javascript" src="/static/jquery.em.js"></script> + <script type="text/javascript"> jQuery(function() @@ -19,7 +20,7 @@ jQuery(function() </head> <body style="font-family: Arial, Helvetica, sans-serif; background-color:#ffffee; - background-image:url(/static/chanbg.png); + background-image:url(/static/img/chanbg.png); background-repeat:repeat-x; background-position:1 10; background-attachment:fixed;" onload=" @@ -36,7 +37,7 @@ background-attachment:fixed;" onload=" <div style="overflow:hidden; height:600px; position:absolute;display:none;" id="news"> <div style="padding:0px;" id="content" name="content"> <div style="background-color:#fff"><center> -<img src="/static/dumpclouds.png"><br><br> +<img src="/static/img/dumpclouds.png"><br><br> <h5> ©2010 All Rights Reserved<br><br> <a href="mailto:info@dump.fm"> info@dump.fm</a> @@ -47,7 +48,7 @@ background-attachment:fixed;" onload=" <div style="padding:0px" id="content" name="content"> - <iframe src="/static/privacy.html" style="overflow-x:hidden; padding:5;background-image:url(/static/hearts.gif);background-repeat:repeat;" width="550px" height="500px"></iframe> + <iframe src="/static/html/privacy.html" style="overflow-x:hidden; padding:5;background-image:url(/static/img/hearts.gif);background-repeat:repeat;" width="550px" height="500px"></iframe> </div> </div> <div style="display:none;"id="link"> diff --git a/template/profile.st b/template/profile.st index e4dd467..e89a285 100644 --- a/template/profile.st +++ b/template/profile.st @@ -24,7 +24,7 @@ <div id="cats"> $if(dumps)$ <div id="lolbanner"> - <img src="/static/welcomebanner.gif"> + <img src="/static/img/welcomebanner.gif"> </div> $dumps:{ d | $profile_dump(dump=d)$ }$ @@ -34,14 +34,14 @@ $if(avatar)$ <img id="avatarPic" src="$avatar$" width="150px"/> $else$ - <img id="avatarPic"><img src="/static/noinfo.png"> + <img id="avatarPic"><img src="/static/img/noinfo.png"> $endif$ $if(is_home)$ <div id="avatar-editing" style="display: none"> <div id="avatar" class="editable">$avatar$</div> <input id="upload" value="Upload Icon" type="submit"> - <img id="spinner" src="/static/spinner.gif" style="display: none" /> + <img id="spinner" src="/static/img/spinner.gif" style="display: none" /> </div> $endif$ @@ -49,7 +49,7 @@ $if(contact)$ <div id="contact" class="linkify">$contact$</div> $else$ - <div><img id="contact" src="/static/noinfo.png"></div> + <div><img id="contact" src="/static/img/noinfo.png"></div> $endif$ <br> @@ -57,7 +57,7 @@ $if(bio)$ <div id="bio" class="linkify">$bio$</div> $else$ - <div><img id="bio" src="/static/noinfo.png"></div> + <div><img id="bio" src="/static/img/noinfo.png"></div> $endif$ $if(is_home)$ @@ -93,7 +93,7 @@ <div id="avatar-editing"> <div id="avatar" class="editable">$avatar$</div> <input id="upload" value="Upload Icon" type="submit"> - <img id="spinner" src="/static/spinner.gif" style="display: none" /> + <img id="spinner" src="/static/img/spinner.gif" style="display: none" /> </div> $endif$ diff --git a/template/profile.st.save b/template/profile.st.save new file mode 100644 index 0000000..7a3944f --- /dev/null +++ b/template/profile.st.save @@ -0,0 +1,145 @@ + +<html> + <head> + <title>$nick$'s dump.fm</title> + $head()$ + <link rel="stylesheet" type="text/css" media="screen" + href="/static/profile.css"> + <script src="/static/jquery.editinplace.1.0.1.packed.js" + type="text/javascript"></script> + <script src="/static/js/ajaxupload.js"></script> + <script type="text/javascript" src="/static/jquery.editinplace.1.0.1.packed.js"></script> + <script> + jQuery(document).ready(initProfile); + </script> + + </head> + <body> + $banner()$ + <div id="chatrap"> + <div id="headerbar"></div> + + <div id="log"> + <div id="loghead"> + </div> + <br> + <div id="posts"> + + <div id="cats"> + $if(dumps)$ + <div id="lolbanner"> + <img src="/static/welcomebanner.gif"> + </div> + + $dumps:{ d | $profile_dump(dump=d)$ }$ + <div id="profile"> + + <h2>$nick$</h2> + $if(avatar)$ + <img id="avatarPic" src="$avatar$" width="150px"/> + $else$ + <img id="avatarPic"><img src="/static/noinfo.png"> + $endif$ + + $if(is_home)$ + <div id="avatar-editing" style="display: none"> + <div id="avatar" class="editable">$avatar$</div> + <input id="upload" value="Upload Icon" type="submit"> + <img id="spinner" src="/static/spinner.gif" style="display: none" /> + </div> + $endif$ + + <h3>contact info</h3> + $if(contact)$ + <div id="contact" class="linkify">$contact$</div> + $else$ + <div><img id="contact" src="/static/noinfo.png"></div> + $endif$ + <br> + + <h3>bio</h3> + $if(bio)$ + <div id="bio" class="linkify">$bio$</div> + $else$ + <div><img id="bio" src="/static/noinfo.png"></div> + $endif$ + + $if(is_home)$ + <br> + <div id="edit-toggle"><a href="#">edit profile</a></div> + $endif$ + + <br> + <div id="date"> + <div type="text" id="datepicker"></div></div> + </div> + + $else$ + <h3> </h3> + <h3> </h3> + <h3> </h3> + <h3> </h3> + <h3> </h3> + <h3> </h3> + <div id="newuser"> + <h2>Welcome to dump.fm</h2> + <br><br> + + <h1>Step ❶</h1> + <h3>☟ Find a sweet image for your avatar, paste the URL below ☟</h3> + $if(avatar)$ + <img id="avatarPic" src="$avatar$" width="150px"/> + $else$ + <b id="avatarPic"></b> + $endif$ + + $if(is_home)$ + <div id="avatar-editing"> + <div id="avatar" class="editable">$avatar$</div> + <input id="upload" value="Upload Icon" type="submit"> + <img id="spinner" src="/static/spinner.gif" style="display: none" /> + </div> + $endif$ + + <h1>Step ❷</h1> + <h3>☟ Enter some contact info below ☟</h3> + <div id="contact" class="$if(is_home)$editable$else$linkify$endif$">$contact$</div> + <br> + + <h1>Step ❸</h1> + <h3>☟ Enter some personal info below ☟</h3> + <div id="bio" class="$if(is_home)$editable$else$linkify$endif$">$bio$</div> + <br> + <h1>Step ❹</h1> + + <h3> <a href="/chat">Join the ♣ and start posting pictures!</a></h3> + <h3> </h3></div> + <h3> </h3> + <h3> </h3> + <h3> </h3> + <h3> </h3> + <h3> </h3> + $endif$ + + <p> </p> + <div id="pnav"> + + $if(next)$ + <div id="pnavn"><a href="/u/$nick$/$next$">next ☞</a></div> + $endif$ + + + $if(prev)$ + <div id="pnavo"> <a href="/u/$nick$/$prev$">☜ prev</a></div> + $endif$ + + <br><br> + </div> + + <div id="footer"> + $footer()$ + </div> + </div> + </div></div></div> + </body> +</html> diff --git a/template/profile_dump.st b/template/profile_dump.st index 0020c70..ff5ff8c 100644 --- a/template/profile_dump.st +++ b/template/profile_dump.st @@ -8,7 +8,7 @@ $if(dump.avatar)$ <img height="50" width="50" src="$dump.avatar$" /> $else$ - <img height="50" width="50" src="/static/noinfo.png"> + <img height="50" width="50" src="/static/img/noinfo.png"> $endif$ </div></a> diff --git a/template/terms.st b/template/terms.st index 5297503..286593c 100644 --- a/template/terms.st +++ b/template/terms.st @@ -3,7 +3,6 @@ <link href="/static/css/pages.css" rel="stylesheet" type="text/css" media="screen"/> <link href="/static/css/win.css" rel="stylesheet" type="text/css" media="screen"/> <script type="text/javascript" src="/static/js/win.js"></script> - <script type="text/javascript" src="/static/jquery.em.js"></script> <script type="text/javascript"> jQuery(function() @@ -19,7 +18,7 @@ jQuery(function() </head> <body style="font-family: Arial, Helvetica, sans-serif; background-color:#ffffee; - background-image:url(/static/chanbg.png); + background-image:url(/static/img/chanbg.png); background-repeat:repeat-x; background-position:1 10; background-attachment:fixed;" onload=" @@ -36,7 +35,7 @@ background-attachment:fixed;" onload=" <div style="overflow:hidden; height:600px; position:absolute;display:none;" id="news"> <div style="padding:0px;" id="content" name="content"> <div style="background-color:#fff"><center> -<img src="/static/dumpclouds.png"><br><br> +<img src="/static/img/dumpclouds.png"><br><br> <h5> ©2010 All Rights Reserved<br><br> <a href="mailto:info@dump.fm"> info@dump.fm</a> @@ -47,7 +46,7 @@ background-attachment:fixed;" onload=" <div style="padding:0px" id="content" name="content"> - <iframe src="/static/terms.html" style="overflow-x:hidden; padding:5;background-image:url(/static/hearts.gif);background-repeat:repeat;" width="550px" height="500px"></iframe> + <iframe src="/static/html/terms.html" style="overflow-x:hidden; padding:5;background-image:url(/static/img/hearts.gif);background-repeat:repeat;" width="550px" height="500px"></iframe> </div> </div> <div style="display:none;"id="link"> @@ -60,7 +59,7 @@ background-attachment:fixed;" onload=" </div> </div> </div> -<div id="hugescreen"><img src="/static/hugescreen.png"></div> +<div id="hugescreen"><img src="/static/img/hugescreen.png"></div> <div id="footer"> $footer()$ diff --git a/template/test.st b/template/test.st new file mode 100644 index 0000000..ee6a4c6 --- /dev/null +++ b/template/test.st @@ -0,0 +1,84 @@ + + <head> + <title>dump.fm</title> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <META NAME="keywords" CONTENT="dump.fm, image chat, realtime, internet 3.0, dump, dump fm, image dump, pictures, image links, image board"> +<META NAME="description" CONTENT="Talk with pictures!"> +<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> +<script type="text/javascript" src="/static/js/sha1.js"></script> +<script type="text/javascript" src="/static/js/home.js"></script> + +<script> +$(document).ready(initLoginForm); + +</script> +<link rel="stylesheet" type="text/css" href="static/css/reset.css"> +<link rel="stylesheet" type="text/css" href="static/css/index.css"> + <link rel="shortcut icon" href="static/favicon.ico"> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dump.fm</title></head> + +</head> +<body> + +<div id="main" align="center"> + + <img src="/static/img/flyhorse.gif" id="horse" /> + <img src="/static/img/guaranteed_customer_satisfaction.gif" id="customer" /> + + <div id="registerbox"> + <div id="logo-and-text"> + <a href="/"><img src="/static/img/dumpclearlogo.png"></a> + <p align="center" class="line">Talk with pictures!</p> + <div align="right" class="txt"> + <br> + <div align="center">dump.fm lets you talk with pictures<br> + <a href="/register" style="text-decoration:none;">Click here to Register!</a> <br> + </div> + </div> + </div> + <input type="text" id="nickInput" size="17" /> + <input id="passwordInputLabel" name="passwordInputLabel" size="17" type="text" class="invisible"> + <input type="password" id="passwordInput" size="17" /><br /> + + + <!-- <br /><a id="signin-submit">Sign In</a> --> + <input id="signin-submit" value="Sign In" /> + <div id="remember"><label> + <input checked="checked" type="checkbox" name="rememberme" id="remembermeInput" /> + Remember Me + </label></div> + </div> +</div> +<div id="info" align="right"> + <img src="/static/img/vxhtml.gif"> + <img src="/static/img/aol_suck.gif"> + <img src="/static/img/html_3_2.gif"> + <img src="/static/img/geocities.gif"> + <img src="/static/img/valid_html.gif"> + +</div> +<div id="dumpednow"> + + +</div> +<div id="preload"> + <img src="/static/img/cursors/osx.hand.gif" class="no-cursor invisible" id="cursor-big"> +</div> + + + <div id="preload"> + <img src="/static/img/cursors/osx.hand.gif" class="no-cursor invisible" id="cursor-big"> + </div> + + <script type="text/javascript"> + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + </script> + <script type="text/javascript"> + try { + var pageTracker = _gat._getTracker("UA-12364576-1"); + pageTracker._trackPageview(); + } catch(err) {} + </script> + </body> + diff --git a/webcam/com/adobe/images/BitString.as b/webcam/com/adobe/images/BitString.as index 7e1ff14..5d89c93 100644 --- a/webcam/com/adobe/images/BitString.as +++ b/webcam/com/adobe/images/BitString.as @@ -1,42 +1,42 @@ -/*
- Adobe Systems Incorporated(r) Source Code License Agreement
- Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
-
- Please read this Source Code License Agreement carefully before using
- the source code.
-
- Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
- no-charge, royalty-free, irrevocable copyright license, to reproduce,
- prepare derivative works of, publicly display, publicly perform, and
- distribute this source code and such derivative works in source or
- object code form without any attribution requirements.
-
- The name "Adobe Systems Incorporated" must not be used to endorse or promote products
- derived from the source code without prior written permission.
-
- You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
- against any loss, damage, claims or lawsuits, including attorney's
- fees that arise or result from your use or distribution of the source
- code.
-
- THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
- ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
- NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
- OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-package com.adobe.images
-{
- public class BitString
- {
- public var len:int = 0;
- public var val:int = 0;
- }
+/* + Adobe Systems Incorporated(r) Source Code License Agreement + Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved. + + Please read this Source Code License Agreement carefully before using + the source code. + + Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable copyright license, to reproduce, + prepare derivative works of, publicly display, publicly perform, and + distribute this source code and such derivative works in source or + object code form without any attribution requirements. + + The name "Adobe Systems Incorporated" must not be used to endorse or promote products + derived from the source code without prior written permission. + + You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and + against any loss, damage, claims or lawsuits, including attorney's + fees that arise or result from your use or distribution of the source + code. + + THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT + ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF + NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA + OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +package com.adobe.images +{ + public class BitString + { + public var len:int = 0; + public var val:int = 0; + } }
\ No newline at end of file diff --git a/webcam/com/adobe/images/JPGEncoder.as b/webcam/com/adobe/images/JPGEncoder.as index 4c6ad63..1679976 100644 --- a/webcam/com/adobe/images/JPGEncoder.as +++ b/webcam/com/adobe/images/JPGEncoder.as @@ -1,651 +1,651 @@ -/*
- Adobe Systems Incorporated(r) Source Code License Agreement
- Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
-
- Please read this Source Code License Agreement carefully before using
- the source code.
-
- Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
- no-charge, royalty-free, irrevocable copyright license, to reproduce,
- prepare derivative works of, publicly display, publicly perform, and
- distribute this source code and such derivative works in source or
- object code form without any attribution requirements.
-
- The name "Adobe Systems Incorporated" must not be used to endorse or promote products
- derived from the source code without prior written permission.
-
- You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
- against any loss, damage, claims or lawsuits, including attorney's
- fees that arise or result from your use or distribution of the source
- code.
-
- THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
- ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
- NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
- OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-package com.adobe.images
-{
- import flash.geom.*;
- import flash.display.*;
- import flash.utils.*;
-
- /**
- * Class that converts BitmapData into a valid JPEG
- */
- public class JPGEncoder
- {
-
- // Static table initialization
-
- private var ZigZag:Array = [
- 0, 1, 5, 6,14,15,27,28,
- 2, 4, 7,13,16,26,29,42,
- 3, 8,12,17,25,30,41,43,
- 9,11,18,24,31,40,44,53,
- 10,19,23,32,39,45,52,54,
- 20,22,33,38,46,51,55,60,
- 21,34,37,47,50,56,59,61,
- 35,36,48,49,57,58,62,63
- ];
-
- private var YTable:Array = new Array(64);
- private var UVTable:Array = new Array(64);
- private var fdtbl_Y:Array = new Array(64);
- private var fdtbl_UV:Array = new Array(64);
-
- private function initQuantTables(sf:int):void
- {
- var i:int;
- var t:Number;
- var YQT:Array = [
- 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 56, 68,109,103, 77,
- 24, 35, 55, 64, 81,104,113, 92,
- 49, 64, 78, 87,103,121,120,101,
- 72, 92, 95, 98,112,100,103, 99
- ];
- for (i = 0; i < 64; i++) {
- t = Math.floor((YQT[i]*sf+50)/100);
- if (t < 1) {
- t = 1;
- } else if (t > 255) {
- t = 255;
- }
- YTable[ZigZag[i]] = t;
- }
- var UVQT:Array = [
- 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
- ];
- for (i = 0; i < 64; i++) {
- t = Math.floor((UVQT[i]*sf+50)/100);
- if (t < 1) {
- t = 1;
- } else if (t > 255) {
- t = 255;
- }
- UVTable[ZigZag[i]] = t;
- }
- var aasf:Array = [
- 1.0, 1.387039845, 1.306562965, 1.175875602,
- 1.0, 0.785694958, 0.541196100, 0.275899379
- ];
- i = 0;
- for (var row:int = 0; row < 8; row++)
- {
- for (var col:int = 0; col < 8; col++)
- {
- fdtbl_Y[i] = (1.0 / (YTable [ZigZag[i]] * aasf[row] * aasf[col] * 8.0));
- fdtbl_UV[i] = (1.0 / (UVTable[ZigZag[i]] * aasf[row] * aasf[col] * 8.0));
- i++;
- }
- }
- }
-
- private var YDC_HT:Array;
- private var UVDC_HT:Array;
- private var YAC_HT:Array;
- private var UVAC_HT:Array;
-
- private function computeHuffmanTbl(nrcodes:Array, std_table:Array):Array
- {
- var codevalue:int = 0;
- var pos_in_table:int = 0;
- var HT:Array = new Array();
- for (var k:int=1; k<=16; k++) {
- for (var j:int=1; j<=nrcodes[k]; j++) {
- HT[std_table[pos_in_table]] = new BitString();
- HT[std_table[pos_in_table]].val = codevalue;
- HT[std_table[pos_in_table]].len = k;
- pos_in_table++;
- codevalue++;
- }
- codevalue*=2;
- }
- return HT;
- }
-
- private var std_dc_luminance_nrcodes:Array = [0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];
- private var std_dc_luminance_values:Array = [0,1,2,3,4,5,6,7,8,9,10,11];
- private var std_ac_luminance_nrcodes:Array = [0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d];
- private var std_ac_luminance_values:Array = [
- 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,
- 0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,
- 0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08,
- 0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,
- 0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,
- 0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28,
- 0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,
- 0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
- 0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
- 0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,
- 0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,
- 0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89,
- 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,
- 0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,
- 0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,
- 0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,
- 0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,
- 0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2,
- 0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,
- 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,
- 0xf9,0xfa
- ];
-
- private var std_dc_chrominance_nrcodes:Array = [0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];
- private var std_dc_chrominance_values:Array = [0,1,2,3,4,5,6,7,8,9,10,11];
- private var std_ac_chrominance_nrcodes:Array = [0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77];
- private var std_ac_chrominance_values:Array = [
- 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,
- 0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,
- 0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,
- 0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,
- 0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,
- 0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26,
- 0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,
- 0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,
- 0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,
- 0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,
- 0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,
- 0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87,
- 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,
- 0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,
- 0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,
- 0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,
- 0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,
- 0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,
- 0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,
- 0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,
- 0xf9,0xfa
- ];
-
- private function initHuffmanTbl():void
- {
- YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes,std_dc_luminance_values);
- UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes,std_dc_chrominance_values);
- YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes,std_ac_luminance_values);
- UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes,std_ac_chrominance_values);
- }
-
- private var bitcode:Array = new Array(65535);
- private var category:Array = new Array(65535);
-
- private function initCategoryNumber():void
- {
- var nrlower:int = 1;
- var nrupper:int = 2;
- var nr:int;
- for (var cat:int=1; cat<=15; cat++) {
- //Positive numbers
- for (nr=nrlower; nr<nrupper; nr++) {
- category[32767+nr] = cat;
- bitcode[32767+nr] = new BitString();
- bitcode[32767+nr].len = cat;
- bitcode[32767+nr].val = nr;
- }
- //Negative numbers
- for (nr=-(nrupper-1); nr<=-nrlower; nr++) {
- category[32767+nr] = cat;
- bitcode[32767+nr] = new BitString();
- bitcode[32767+nr].len = cat;
- bitcode[32767+nr].val = nrupper-1+nr;
- }
- nrlower <<= 1;
- nrupper <<= 1;
- }
- }
-
- // IO functions
-
- private var byteout:ByteArray;
- private var bytenew:int = 0;
- private var bytepos:int = 7;
-
- private function writeBits(bs:BitString):void
- {
- var value:int = bs.val;
- var posval:int = bs.len-1;
- while ( posval >= 0 ) {
- if (value & uint(1 << posval) ) {
- bytenew |= uint(1 << bytepos);
- }
- posval--;
- bytepos--;
- if (bytepos < 0) {
- if (bytenew == 0xFF) {
- writeByte(0xFF);
- writeByte(0);
- }
- else {
- writeByte(bytenew);
- }
- bytepos=7;
- bytenew=0;
- }
- }
- }
-
- private function writeByte(value:int):void
- {
- byteout.writeByte(value);
- }
-
- private function writeWord(value:int):void
- {
- writeByte((value>>8)&0xFF);
- writeByte((value )&0xFF);
- }
-
- // DCT & quantization core
-
- private function fDCTQuant(data:Array, fdtbl:Array):Array
- {
- var tmp0:Number, tmp1:Number, tmp2:Number, tmp3:Number, tmp4:Number, tmp5:Number, tmp6:Number, tmp7:Number;
- var tmp10:Number, tmp11:Number, tmp12:Number, tmp13:Number;
- var z1:Number, z2:Number, z3:Number, z4:Number, z5:Number, z11:Number, z13:Number;
- var i:int;
- /* Pass 1: process rows. */
- var dataOff:int=0;
- for (i=0; i<8; i++) {
- tmp0 = data[dataOff+0] + data[dataOff+7];
- tmp7 = data[dataOff+0] - data[dataOff+7];
- tmp1 = data[dataOff+1] + data[dataOff+6];
- tmp6 = data[dataOff+1] - data[dataOff+6];
- tmp2 = data[dataOff+2] + data[dataOff+5];
- tmp5 = data[dataOff+2] - data[dataOff+5];
- tmp3 = data[dataOff+3] + data[dataOff+4];
- tmp4 = data[dataOff+3] - data[dataOff+4];
-
- /* Even part */
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- data[dataOff+0] = tmp10 + tmp11; /* phase 3 */
- data[dataOff+4] = tmp10 - tmp11;
-
- z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */
- data[dataOff+2] = tmp13 + z1; /* phase 5 */
- data[dataOff+6] = tmp13 - z1;
-
- /* Odd part */
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */
- z2 = 0.541196100 * tmp10 + z5; /* c2-c6 */
- z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */
- z3 = tmp11 * 0.707106781; /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- data[dataOff+5] = z13 + z2; /* phase 6 */
- data[dataOff+3] = z13 - z2;
- data[dataOff+1] = z11 + z4;
- data[dataOff+7] = z11 - z4;
-
- dataOff += 8; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns. */
- dataOff = 0;
- for (i=0; i<8; i++) {
- tmp0 = data[dataOff+ 0] + data[dataOff+56];
- tmp7 = data[dataOff+ 0] - data[dataOff+56];
- tmp1 = data[dataOff+ 8] + data[dataOff+48];
- tmp6 = data[dataOff+ 8] - data[dataOff+48];
- tmp2 = data[dataOff+16] + data[dataOff+40];
- tmp5 = data[dataOff+16] - data[dataOff+40];
- tmp3 = data[dataOff+24] + data[dataOff+32];
- tmp4 = data[dataOff+24] - data[dataOff+32];
-
- /* Even part */
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- data[dataOff+ 0] = tmp10 + tmp11; /* phase 3 */
- data[dataOff+32] = tmp10 - tmp11;
-
- z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */
- data[dataOff+16] = tmp13 + z1; /* phase 5 */
- data[dataOff+48] = tmp13 - z1;
-
- /* Odd part */
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */
- z2 = 0.541196100 * tmp10 + z5; /* c2-c6 */
- z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */
- z3 = tmp11 * 0.707106781; /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- data[dataOff+40] = z13 + z2; /* phase 6 */
- data[dataOff+24] = z13 - z2;
- data[dataOff+ 8] = z11 + z4;
- data[dataOff+56] = z11 - z4;
-
- dataOff++; /* advance pointer to next column */
- }
-
- // Quantize/descale the coefficients
- for (i=0; i<64; i++) {
- // Apply the quantization and scaling factor & Round to nearest integer
- data[i] = Math.round((data[i]*fdtbl[i]));
- }
- return data;
- }
-
- // Chunk writing
-
- private function writeAPP0():void
- {
- writeWord(0xFFE0); // marker
- writeWord(16); // length
- writeByte(0x4A); // J
- writeByte(0x46); // F
- writeByte(0x49); // I
- writeByte(0x46); // F
- writeByte(0); // = "JFIF",'\0'
- writeByte(1); // versionhi
- writeByte(1); // versionlo
- writeByte(0); // xyunits
- writeWord(1); // xdensity
- writeWord(1); // ydensity
- writeByte(0); // thumbnwidth
- writeByte(0); // thumbnheight
- }
-
- private function writeSOF0(width:int, height:int):void
- {
- writeWord(0xFFC0); // marker
- writeWord(17); // length, truecolor YUV JPG
- writeByte(8); // precision
- writeWord(height);
- writeWord(width);
- writeByte(3); // nrofcomponents
- writeByte(1); // IdY
- writeByte(0x11); // HVY
- writeByte(0); // QTY
- writeByte(2); // IdU
- writeByte(0x11); // HVU
- writeByte(1); // QTU
- writeByte(3); // IdV
- writeByte(0x11); // HVV
- writeByte(1); // QTV
- }
-
- private function writeDQT():void
- {
- writeWord(0xFFDB); // marker
- writeWord(132); // length
- writeByte(0);
- var i:int;
- for (i=0; i<64; i++) {
- writeByte(YTable[i]);
- }
- writeByte(1);
- for (i=0; i<64; i++) {
- writeByte(UVTable[i]);
- }
- }
-
- private function writeDHT():void
- {
- writeWord(0xFFC4); // marker
- writeWord(0x01A2); // length
- var i:int;
-
- writeByte(0); // HTYDCinfo
- for (i=0; i<16; i++) {
- writeByte(std_dc_luminance_nrcodes[i+1]);
- }
- for (i=0; i<=11; i++) {
- writeByte(std_dc_luminance_values[i]);
- }
-
- writeByte(0x10); // HTYACinfo
- for (i=0; i<16; i++) {
- writeByte(std_ac_luminance_nrcodes[i+1]);
- }
- for (i=0; i<=161; i++) {
- writeByte(std_ac_luminance_values[i]);
- }
-
- writeByte(1); // HTUDCinfo
- for (i=0; i<16; i++) {
- writeByte(std_dc_chrominance_nrcodes[i+1]);
- }
- for (i=0; i<=11; i++) {
- writeByte(std_dc_chrominance_values[i]);
- }
-
- writeByte(0x11); // HTUACinfo
- for (i=0; i<16; i++) {
- writeByte(std_ac_chrominance_nrcodes[i+1]);
- }
- for (i=0; i<=161; i++) {
- writeByte(std_ac_chrominance_values[i]);
- }
- }
-
- private function writeSOS():void
- {
- writeWord(0xFFDA); // marker
- writeWord(12); // length
- writeByte(3); // nrofcomponents
- writeByte(1); // IdY
- writeByte(0); // HTY
- writeByte(2); // IdU
- writeByte(0x11); // HTU
- writeByte(3); // IdV
- writeByte(0x11); // HTV
- writeByte(0); // Ss
- writeByte(0x3f); // Se
- writeByte(0); // Bf
- }
-
- // Core processing
- private var DU:Array = new Array(64);
-
- private function processDU(CDU:Array, fdtbl:Array, DC:Number, HTDC:Array, HTAC:Array):Number
- {
- var EOB:BitString = HTAC[0x00];
- var M16zeroes:BitString = HTAC[0xF0];
- var i:int;
-
- var DU_DCT:Array = fDCTQuant(CDU, fdtbl);
- //ZigZag reorder
- for (i=0;i<64;i++) {
- DU[ZigZag[i]]=DU_DCT[i];
- }
- var Diff:int = DU[0] - DC; DC = DU[0];
- //Encode DC
- if (Diff==0) {
- writeBits(HTDC[0]); // Diff might be 0
- } else {
- writeBits(HTDC[category[32767+Diff]]);
- writeBits(bitcode[32767+Diff]);
- }
- //Encode ACs
- var end0pos:int = 63;
- for (; (end0pos>0)&&(DU[end0pos]==0); end0pos--) {
- };
- //end0pos = first element in reverse order !=0
- if ( end0pos == 0) {
- writeBits(EOB);
- return DC;
- }
- i = 1;
- while ( i <= end0pos ) {
- var startpos:int = i;
- for (; (DU[i]==0) && (i<=end0pos); i++) {
- }
- var nrzeroes:int = i-startpos;
- if ( nrzeroes >= 16 ) {
- for (var nrmarker:int=1; nrmarker <= nrzeroes/16; nrmarker++) {
- writeBits(M16zeroes);
- }
- nrzeroes = int(nrzeroes&0xF);
- }
- writeBits(HTAC[nrzeroes*16+category[32767+DU[i]]]);
- writeBits(bitcode[32767+DU[i]]);
- i++;
- }
- if ( end0pos != 63 ) {
- writeBits(EOB);
- }
- return DC;
- }
-
- private var YDU:Array = new Array(64);
- private var UDU:Array = new Array(64);
- private var VDU:Array = new Array(64);
-
- private function RGB2YUV(img:BitmapData, xpos:int, ypos:int):void
- {
- var pos:int=0;
- for (var y:int=0; y<8; y++) {
- for (var x:int=0; x<8; x++) {
- var P:uint = img.getPixel32(xpos+x,ypos+y);
- var R:Number = Number((P>>16)&0xFF);
- var G:Number = Number((P>> 8)&0xFF);
- var B:Number = Number((P )&0xFF);
- YDU[pos]=((( 0.29900)*R+( 0.58700)*G+( 0.11400)*B))-128;
- UDU[pos]=(((-0.16874)*R+(-0.33126)*G+( 0.50000)*B));
- VDU[pos]=((( 0.50000)*R+(-0.41869)*G+(-0.08131)*B));
- pos++;
- }
- }
- }
-
- /**
- * Constructor for JPEGEncoder class
- *
- * @param quality The quality level between 1 and 100 that detrmines the
- * level of compression used in the generated JPEG
- * @langversion ActionScript 3.0
- * @playerversion Flash 9.0
- * @tiptext
- */
- public function JPGEncoder(quality:Number = 50)
- {
- if (quality <= 0) {
- quality = 1;
- }
- if (quality > 100) {
- quality = 100;
- }
- var sf:int = 0;
- if (quality < 50) {
- sf = int(5000 / quality);
- } else {
- sf = int(200 - quality*2);
- }
- // Create tables
- initHuffmanTbl();
- initCategoryNumber();
- initQuantTables(sf);
- }
-
- /**
- * Created a JPEG image from the specified BitmapData
- *
- * @param image The BitmapData that will be converted into the JPEG format.
- * @return a ByteArray representing the JPEG encoded image data.
- * @langversion ActionScript 3.0
- * @playerversion Flash 9.0
- * @tiptext
- */
- public function encode(image:BitmapData):ByteArray
- {
- // Initialize bit writer
- byteout = new ByteArray();
- bytenew=0;
- bytepos=7;
-
- // Add JPEG headers
- writeWord(0xFFD8); // SOI
- writeAPP0();
- writeDQT();
- writeSOF0(image.width,image.height);
- writeDHT();
- writeSOS();
-
-
- // Encode 8x8 macroblocks
- var DCY:Number=0;
- var DCU:Number=0;
- var DCV:Number=0;
- bytenew=0;
- bytepos=7;
- for (var ypos:int=0; ypos<image.height; ypos+=8) {
- for (var xpos:int=0; xpos<image.width; xpos+=8) {
- RGB2YUV(image, xpos, ypos);
- DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);
- DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
- DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
- }
- }
-
- // Do the bit alignment of the EOI marker
- if ( bytepos >= 0 ) {
- var fillbits:BitString = new BitString();
- fillbits.len = bytepos+1;
- fillbits.val = (1<<(bytepos+1))-1;
- writeBits(fillbits);
- }
-
- writeWord(0xFFD9); //EOI
- return byteout;
- }
- }
-}
+/* + Adobe Systems Incorporated(r) Source Code License Agreement + Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved. + + Please read this Source Code License Agreement carefully before using + the source code. + + Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable copyright license, to reproduce, + prepare derivative works of, publicly display, publicly perform, and + distribute this source code and such derivative works in source or + object code form without any attribution requirements. + + The name "Adobe Systems Incorporated" must not be used to endorse or promote products + derived from the source code without prior written permission. + + You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and + against any loss, damage, claims or lawsuits, including attorney's + fees that arise or result from your use or distribution of the source + code. + + THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT + ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF + NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA + OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +package com.adobe.images +{ + import flash.geom.*; + import flash.display.*; + import flash.utils.*; + + /** + * Class that converts BitmapData into a valid JPEG + */ + public class JPGEncoder + { + + // Static table initialization + + private var ZigZag:Array = [ + 0, 1, 5, 6,14,15,27,28, + 2, 4, 7,13,16,26,29,42, + 3, 8,12,17,25,30,41,43, + 9,11,18,24,31,40,44,53, + 10,19,23,32,39,45,52,54, + 20,22,33,38,46,51,55,60, + 21,34,37,47,50,56,59,61, + 35,36,48,49,57,58,62,63 + ]; + + private var YTable:Array = new Array(64); + private var UVTable:Array = new Array(64); + private var fdtbl_Y:Array = new Array(64); + private var fdtbl_UV:Array = new Array(64); + + private function initQuantTables(sf:int):void + { + var i:int; + var t:Number; + var YQT:Array = [ + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68,109,103, 77, + 24, 35, 55, 64, 81,104,113, 92, + 49, 64, 78, 87,103,121,120,101, + 72, 92, 95, 98,112,100,103, 99 + ]; + for (i = 0; i < 64; i++) { + t = Math.floor((YQT[i]*sf+50)/100); + if (t < 1) { + t = 1; + } else if (t > 255) { + t = 255; + } + YTable[ZigZag[i]] = t; + } + var UVQT:Array = [ + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + ]; + for (i = 0; i < 64; i++) { + t = Math.floor((UVQT[i]*sf+50)/100); + if (t < 1) { + t = 1; + } else if (t > 255) { + t = 255; + } + UVTable[ZigZag[i]] = t; + } + var aasf:Array = [ + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + ]; + i = 0; + for (var row:int = 0; row < 8; row++) + { + for (var col:int = 0; col < 8; col++) + { + fdtbl_Y[i] = (1.0 / (YTable [ZigZag[i]] * aasf[row] * aasf[col] * 8.0)); + fdtbl_UV[i] = (1.0 / (UVTable[ZigZag[i]] * aasf[row] * aasf[col] * 8.0)); + i++; + } + } + } + + private var YDC_HT:Array; + private var UVDC_HT:Array; + private var YAC_HT:Array; + private var UVAC_HT:Array; + + private function computeHuffmanTbl(nrcodes:Array, std_table:Array):Array + { + var codevalue:int = 0; + var pos_in_table:int = 0; + var HT:Array = new Array(); + for (var k:int=1; k<=16; k++) { + for (var j:int=1; j<=nrcodes[k]; j++) { + HT[std_table[pos_in_table]] = new BitString(); + HT[std_table[pos_in_table]].val = codevalue; + HT[std_table[pos_in_table]].len = k; + pos_in_table++; + codevalue++; + } + codevalue*=2; + } + return HT; + } + + private var std_dc_luminance_nrcodes:Array = [0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0]; + private var std_dc_luminance_values:Array = [0,1,2,3,4,5,6,7,8,9,10,11]; + private var std_ac_luminance_nrcodes:Array = [0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d]; + private var std_ac_luminance_values:Array = [ + 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12, + 0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07, + 0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08, + 0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0, + 0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16, + 0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28, + 0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39, + 0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49, + 0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59, + 0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69, + 0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79, + 0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89, + 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98, + 0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7, + 0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6, + 0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5, + 0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4, + 0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2, + 0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea, + 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8, + 0xf9,0xfa + ]; + + private var std_dc_chrominance_nrcodes:Array = [0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0]; + private var std_dc_chrominance_values:Array = [0,1,2,3,4,5,6,7,8,9,10,11]; + private var std_ac_chrominance_nrcodes:Array = [0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77]; + private var std_ac_chrominance_values:Array = [ + 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21, + 0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71, + 0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91, + 0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0, + 0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34, + 0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26, + 0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38, + 0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48, + 0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58, + 0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68, + 0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78, + 0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87, + 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96, + 0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5, + 0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4, + 0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3, + 0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2, + 0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda, + 0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9, + 0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8, + 0xf9,0xfa + ]; + + private function initHuffmanTbl():void + { + YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes,std_dc_luminance_values); + UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes,std_dc_chrominance_values); + YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes,std_ac_luminance_values); + UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes,std_ac_chrominance_values); + } + + private var bitcode:Array = new Array(65535); + private var category:Array = new Array(65535); + + private function initCategoryNumber():void + { + var nrlower:int = 1; + var nrupper:int = 2; + var nr:int; + for (var cat:int=1; cat<=15; cat++) { + //Positive numbers + for (nr=nrlower; nr<nrupper; nr++) { + category[32767+nr] = cat; + bitcode[32767+nr] = new BitString(); + bitcode[32767+nr].len = cat; + bitcode[32767+nr].val = nr; + } + //Negative numbers + for (nr=-(nrupper-1); nr<=-nrlower; nr++) { + category[32767+nr] = cat; + bitcode[32767+nr] = new BitString(); + bitcode[32767+nr].len = cat; + bitcode[32767+nr].val = nrupper-1+nr; + } + nrlower <<= 1; + nrupper <<= 1; + } + } + + // IO functions + + private var byteout:ByteArray; + private var bytenew:int = 0; + private var bytepos:int = 7; + + private function writeBits(bs:BitString):void + { + var value:int = bs.val; + var posval:int = bs.len-1; + while ( posval >= 0 ) { + if (value & uint(1 << posval) ) { + bytenew |= uint(1 << bytepos); + } + posval--; + bytepos--; + if (bytepos < 0) { + if (bytenew == 0xFF) { + writeByte(0xFF); + writeByte(0); + } + else { + writeByte(bytenew); + } + bytepos=7; + bytenew=0; + } + } + } + + private function writeByte(value:int):void + { + byteout.writeByte(value); + } + + private function writeWord(value:int):void + { + writeByte((value>>8)&0xFF); + writeByte((value )&0xFF); + } + + // DCT & quantization core + + private function fDCTQuant(data:Array, fdtbl:Array):Array + { + var tmp0:Number, tmp1:Number, tmp2:Number, tmp3:Number, tmp4:Number, tmp5:Number, tmp6:Number, tmp7:Number; + var tmp10:Number, tmp11:Number, tmp12:Number, tmp13:Number; + var z1:Number, z2:Number, z3:Number, z4:Number, z5:Number, z11:Number, z13:Number; + var i:int; + /* Pass 1: process rows. */ + var dataOff:int=0; + for (i=0; i<8; i++) { + tmp0 = data[dataOff+0] + data[dataOff+7]; + tmp7 = data[dataOff+0] - data[dataOff+7]; + tmp1 = data[dataOff+1] + data[dataOff+6]; + tmp6 = data[dataOff+1] - data[dataOff+6]; + tmp2 = data[dataOff+2] + data[dataOff+5]; + tmp5 = data[dataOff+2] - data[dataOff+5]; + tmp3 = data[dataOff+3] + data[dataOff+4]; + tmp4 = data[dataOff+3] - data[dataOff+4]; + + /* Even part */ + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + data[dataOff+0] = tmp10 + tmp11; /* phase 3 */ + data[dataOff+4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */ + data[dataOff+2] = tmp13 + z1; /* phase 5 */ + data[dataOff+6] = tmp13 - z1; + + /* Odd part */ + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */ + z2 = 0.541196100 * tmp10 + z5; /* c2-c6 */ + z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * 0.707106781; /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + data[dataOff+5] = z13 + z2; /* phase 6 */ + data[dataOff+3] = z13 - z2; + data[dataOff+1] = z11 + z4; + data[dataOff+7] = z11 - z4; + + dataOff += 8; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + dataOff = 0; + for (i=0; i<8; i++) { + tmp0 = data[dataOff+ 0] + data[dataOff+56]; + tmp7 = data[dataOff+ 0] - data[dataOff+56]; + tmp1 = data[dataOff+ 8] + data[dataOff+48]; + tmp6 = data[dataOff+ 8] - data[dataOff+48]; + tmp2 = data[dataOff+16] + data[dataOff+40]; + tmp5 = data[dataOff+16] - data[dataOff+40]; + tmp3 = data[dataOff+24] + data[dataOff+32]; + tmp4 = data[dataOff+24] - data[dataOff+32]; + + /* Even part */ + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + data[dataOff+ 0] = tmp10 + tmp11; /* phase 3 */ + data[dataOff+32] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */ + data[dataOff+16] = tmp13 + z1; /* phase 5 */ + data[dataOff+48] = tmp13 - z1; + + /* Odd part */ + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */ + z2 = 0.541196100 * tmp10 + z5; /* c2-c6 */ + z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * 0.707106781; /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + data[dataOff+40] = z13 + z2; /* phase 6 */ + data[dataOff+24] = z13 - z2; + data[dataOff+ 8] = z11 + z4; + data[dataOff+56] = z11 - z4; + + dataOff++; /* advance pointer to next column */ + } + + // Quantize/descale the coefficients + for (i=0; i<64; i++) { + // Apply the quantization and scaling factor & Round to nearest integer + data[i] = Math.round((data[i]*fdtbl[i])); + } + return data; + } + + // Chunk writing + + private function writeAPP0():void + { + writeWord(0xFFE0); // marker + writeWord(16); // length + writeByte(0x4A); // J + writeByte(0x46); // F + writeByte(0x49); // I + writeByte(0x46); // F + writeByte(0); // = "JFIF",'\0' + writeByte(1); // versionhi + writeByte(1); // versionlo + writeByte(0); // xyunits + writeWord(1); // xdensity + writeWord(1); // ydensity + writeByte(0); // thumbnwidth + writeByte(0); // thumbnheight + } + + private function writeSOF0(width:int, height:int):void + { + writeWord(0xFFC0); // marker + writeWord(17); // length, truecolor YUV JPG + writeByte(8); // precision + writeWord(height); + writeWord(width); + writeByte(3); // nrofcomponents + writeByte(1); // IdY + writeByte(0x11); // HVY + writeByte(0); // QTY + writeByte(2); // IdU + writeByte(0x11); // HVU + writeByte(1); // QTU + writeByte(3); // IdV + writeByte(0x11); // HVV + writeByte(1); // QTV + } + + private function writeDQT():void + { + writeWord(0xFFDB); // marker + writeWord(132); // length + writeByte(0); + var i:int; + for (i=0; i<64; i++) { + writeByte(YTable[i]); + } + writeByte(1); + for (i=0; i<64; i++) { + writeByte(UVTable[i]); + } + } + + private function writeDHT():void + { + writeWord(0xFFC4); // marker + writeWord(0x01A2); // length + var i:int; + + writeByte(0); // HTYDCinfo + for (i=0; i<16; i++) { + writeByte(std_dc_luminance_nrcodes[i+1]); + } + for (i=0; i<=11; i++) { + writeByte(std_dc_luminance_values[i]); + } + + writeByte(0x10); // HTYACinfo + for (i=0; i<16; i++) { + writeByte(std_ac_luminance_nrcodes[i+1]); + } + for (i=0; i<=161; i++) { + writeByte(std_ac_luminance_values[i]); + } + + writeByte(1); // HTUDCinfo + for (i=0; i<16; i++) { + writeByte(std_dc_chrominance_nrcodes[i+1]); + } + for (i=0; i<=11; i++) { + writeByte(std_dc_chrominance_values[i]); + } + + writeByte(0x11); // HTUACinfo + for (i=0; i<16; i++) { + writeByte(std_ac_chrominance_nrcodes[i+1]); + } + for (i=0; i<=161; i++) { + writeByte(std_ac_chrominance_values[i]); + } + } + + private function writeSOS():void + { + writeWord(0xFFDA); // marker + writeWord(12); // length + writeByte(3); // nrofcomponents + writeByte(1); // IdY + writeByte(0); // HTY + writeByte(2); // IdU + writeByte(0x11); // HTU + writeByte(3); // IdV + writeByte(0x11); // HTV + writeByte(0); // Ss + writeByte(0x3f); // Se + writeByte(0); // Bf + } + + // Core processing + private var DU:Array = new Array(64); + + private function processDU(CDU:Array, fdtbl:Array, DC:Number, HTDC:Array, HTAC:Array):Number + { + var EOB:BitString = HTAC[0x00]; + var M16zeroes:BitString = HTAC[0xF0]; + var i:int; + + var DU_DCT:Array = fDCTQuant(CDU, fdtbl); + //ZigZag reorder + for (i=0;i<64;i++) { + DU[ZigZag[i]]=DU_DCT[i]; + } + var Diff:int = DU[0] - DC; DC = DU[0]; + //Encode DC + if (Diff==0) { + writeBits(HTDC[0]); // Diff might be 0 + } else { + writeBits(HTDC[category[32767+Diff]]); + writeBits(bitcode[32767+Diff]); + } + //Encode ACs + var end0pos:int = 63; + for (; (end0pos>0)&&(DU[end0pos]==0); end0pos--) { + }; + //end0pos = first element in reverse order !=0 + if ( end0pos == 0) { + writeBits(EOB); + return DC; + } + i = 1; + while ( i <= end0pos ) { + var startpos:int = i; + for (; (DU[i]==0) && (i<=end0pos); i++) { + } + var nrzeroes:int = i-startpos; + if ( nrzeroes >= 16 ) { + for (var nrmarker:int=1; nrmarker <= nrzeroes/16; nrmarker++) { + writeBits(M16zeroes); + } + nrzeroes = int(nrzeroes&0xF); + } + writeBits(HTAC[nrzeroes*16+category[32767+DU[i]]]); + writeBits(bitcode[32767+DU[i]]); + i++; + } + if ( end0pos != 63 ) { + writeBits(EOB); + } + return DC; + } + + private var YDU:Array = new Array(64); + private var UDU:Array = new Array(64); + private var VDU:Array = new Array(64); + + private function RGB2YUV(img:BitmapData, xpos:int, ypos:int):void + { + var pos:int=0; + for (var y:int=0; y<8; y++) { + for (var x:int=0; x<8; x++) { + var P:uint = img.getPixel32(xpos+x,ypos+y); + var R:Number = Number((P>>16)&0xFF); + var G:Number = Number((P>> 8)&0xFF); + var B:Number = Number((P )&0xFF); + YDU[pos]=((( 0.29900)*R+( 0.58700)*G+( 0.11400)*B))-128; + UDU[pos]=(((-0.16874)*R+(-0.33126)*G+( 0.50000)*B)); + VDU[pos]=((( 0.50000)*R+(-0.41869)*G+(-0.08131)*B)); + pos++; + } + } + } + + /** + * Constructor for JPEGEncoder class + * + * @param quality The quality level between 1 and 100 that detrmines the + * level of compression used in the generated JPEG + * @langversion ActionScript 3.0 + * @playerversion Flash 9.0 + * @tiptext + */ + public function JPGEncoder(quality:Number = 50) + { + if (quality <= 0) { + quality = 1; + } + if (quality > 100) { + quality = 100; + } + var sf:int = 0; + if (quality < 50) { + sf = int(5000 / quality); + } else { + sf = int(200 - quality*2); + } + // Create tables + initHuffmanTbl(); + initCategoryNumber(); + initQuantTables(sf); + } + + /** + * Created a JPEG image from the specified BitmapData + * + * @param image The BitmapData that will be converted into the JPEG format. + * @return a ByteArray representing the JPEG encoded image data. + * @langversion ActionScript 3.0 + * @playerversion Flash 9.0 + * @tiptext + */ + public function encode(image:BitmapData):ByteArray + { + // Initialize bit writer + byteout = new ByteArray(); + bytenew=0; + bytepos=7; + + // Add JPEG headers + writeWord(0xFFD8); // SOI + writeAPP0(); + writeDQT(); + writeSOF0(image.width,image.height); + writeDHT(); + writeSOS(); + + + // Encode 8x8 macroblocks + var DCY:Number=0; + var DCU:Number=0; + var DCV:Number=0; + bytenew=0; + bytepos=7; + for (var ypos:int=0; ypos<image.height; ypos+=8) { + for (var xpos:int=0; xpos<image.width; xpos+=8) { + RGB2YUV(image, xpos, ypos); + DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT); + DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); + DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); + } + } + + // Do the bit alignment of the EOI marker + if ( bytepos >= 0 ) { + var fillbits:BitString = new BitString(); + fillbits.len = bytepos+1; + fillbits.val = (1<<(bytepos+1))-1; + writeBits(fillbits); + } + + writeWord(0xFFD9); //EOI + return byteout; + } + } +} diff --git a/webcam/com/adobe/images/PNGEncoder.as b/webcam/com/adobe/images/PNGEncoder.as index f40e575..bb86444 100644 --- a/webcam/com/adobe/images/PNGEncoder.as +++ b/webcam/com/adobe/images/PNGEncoder.as @@ -1,144 +1,144 @@ -/*
- Adobe Systems Incorporated(r) Source Code License Agreement
- Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
-
- Please read this Source Code License Agreement carefully before using
- the source code.
-
- Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
- no-charge, royalty-free, irrevocable copyright license, to reproduce,
- prepare derivative works of, publicly display, publicly perform, and
- distribute this source code and such derivative works in source or
- object code form without any attribution requirements.
-
- The name "Adobe Systems Incorporated" must not be used to endorse or promote products
- derived from the source code without prior written permission.
-
- You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
- against any loss, damage, claims or lawsuits, including attorney's
- fees that arise or result from your use or distribution of the source
- code.
-
- THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
- ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
- NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
- OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-package com.adobe.images
-{
- import flash.geom.*;
- import flash.display.Bitmap;
- import flash.display.BitmapData;
- import flash.utils.ByteArray;
-
- /**
- * Class that converts BitmapData into a valid PNG
- */
- public class PNGEncoder
- {
- /**
- * Created a PNG image from the specified BitmapData
- *
- * @param image The BitmapData that will be converted into the PNG format.
- * @return a ByteArray representing the PNG encoded image data.
- * @langversion ActionScript 3.0
- * @playerversion Flash 9.0
- * @tiptext
- */
- public static function encode(img:BitmapData):ByteArray {
- // Create output byte array
- var png:ByteArray = new ByteArray();
- // Write PNG signature
- png.writeUnsignedInt(0x89504e47);
- png.writeUnsignedInt(0x0D0A1A0A);
- // Build IHDR chunk
- var IHDR:ByteArray = new ByteArray();
- IHDR.writeInt(img.width);
- IHDR.writeInt(img.height);
- IHDR.writeUnsignedInt(0x08060000); // 32bit RGBA
- IHDR.writeByte(0);
- writeChunk(png,0x49484452,IHDR);
- // Build IDAT chunk
- var IDAT:ByteArray= new ByteArray();
- for(var i:int=0;i < img.height;i++) {
- // no filter
- IDAT.writeByte(0);
- var p:uint;
- var j:int;
- if ( !img.transparent ) {
- for(j=0;j < img.width;j++) {
- p = img.getPixel(j,i);
- IDAT.writeUnsignedInt(
- uint(((p&0xFFFFFF) << 8)|0xFF));
- }
- } else {
- for(j=0;j < img.width;j++) {
- p = img.getPixel32(j,i);
- IDAT.writeUnsignedInt(
- uint(((p&0xFFFFFF) << 8)|
- (p>>>24)));
- }
- }
- }
- IDAT.compress();
- writeChunk(png,0x49444154,IDAT);
- // Build IEND chunk
- writeChunk(png,0x49454E44,null);
- // return PNG
- return png;
- }
-
- private static var crcTable:Array;
- private static var crcTableComputed:Boolean = false;
-
- private static function writeChunk(png:ByteArray,
- type:uint, data:ByteArray):void {
- if (!crcTableComputed) {
- crcTableComputed = true;
- crcTable = [];
- var c:uint;
- for (var n:uint = 0; n < 256; n++) {
- c = n;
- for (var k:uint = 0; k < 8; k++) {
- if (c & 1) {
- c = uint(uint(0xedb88320) ^
- uint(c >>> 1));
- } else {
- c = uint(c >>> 1);
- }
- }
- crcTable[n] = c;
- }
- }
- var len:uint = 0;
- if (data != null) {
- len = data.length;
- }
- png.writeUnsignedInt(len);
- var p:uint = png.position;
- png.writeUnsignedInt(type);
- if ( data != null ) {
- png.writeBytes(data);
- }
- var e:uint = png.position;
- png.position = p;
- c = 0xffffffff;
- for (var i:int = 0; i < (e-p); i++) {
- c = uint(crcTable[
- (c ^ png.readUnsignedByte()) &
- uint(0xff)] ^ uint(c >>> 8));
- }
- c = uint(c^uint(0xffffffff));
- png.position = e;
- png.writeUnsignedInt(c);
- }
- }
+/* + Adobe Systems Incorporated(r) Source Code License Agreement + Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved. + + Please read this Source Code License Agreement carefully before using + the source code. + + Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable copyright license, to reproduce, + prepare derivative works of, publicly display, publicly perform, and + distribute this source code and such derivative works in source or + object code form without any attribution requirements. + + The name "Adobe Systems Incorporated" must not be used to endorse or promote products + derived from the source code without prior written permission. + + You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and + against any loss, damage, claims or lawsuits, including attorney's + fees that arise or result from your use or distribution of the source + code. + + THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT + ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF + NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA + OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +package com.adobe.images +{ + import flash.geom.*; + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.utils.ByteArray; + + /** + * Class that converts BitmapData into a valid PNG + */ + public class PNGEncoder + { + /** + * Created a PNG image from the specified BitmapData + * + * @param image The BitmapData that will be converted into the PNG format. + * @return a ByteArray representing the PNG encoded image data. + * @langversion ActionScript 3.0 + * @playerversion Flash 9.0 + * @tiptext + */ + public static function encode(img:BitmapData):ByteArray { + // Create output byte array + var png:ByteArray = new ByteArray(); + // Write PNG signature + png.writeUnsignedInt(0x89504e47); + png.writeUnsignedInt(0x0D0A1A0A); + // Build IHDR chunk + var IHDR:ByteArray = new ByteArray(); + IHDR.writeInt(img.width); + IHDR.writeInt(img.height); + IHDR.writeUnsignedInt(0x08060000); // 32bit RGBA + IHDR.writeByte(0); + writeChunk(png,0x49484452,IHDR); + // Build IDAT chunk + var IDAT:ByteArray= new ByteArray(); + for(var i:int=0;i < img.height;i++) { + // no filter + IDAT.writeByte(0); + var p:uint; + var j:int; + if ( !img.transparent ) { + for(j=0;j < img.width;j++) { + p = img.getPixel(j,i); + IDAT.writeUnsignedInt( + uint(((p&0xFFFFFF) << 8)|0xFF)); + } + } else { + for(j=0;j < img.width;j++) { + p = img.getPixel32(j,i); + IDAT.writeUnsignedInt( + uint(((p&0xFFFFFF) << 8)| + (p>>>24))); + } + } + } + IDAT.compress(); + writeChunk(png,0x49444154,IDAT); + // Build IEND chunk + writeChunk(png,0x49454E44,null); + // return PNG + return png; + } + + private static var crcTable:Array; + private static var crcTableComputed:Boolean = false; + + private static function writeChunk(png:ByteArray, + type:uint, data:ByteArray):void { + if (!crcTableComputed) { + crcTableComputed = true; + crcTable = []; + var c:uint; + for (var n:uint = 0; n < 256; n++) { + c = n; + for (var k:uint = 0; k < 8; k++) { + if (c & 1) { + c = uint(uint(0xedb88320) ^ + uint(c >>> 1)); + } else { + c = uint(c >>> 1); + } + } + crcTable[n] = c; + } + } + var len:uint = 0; + if (data != null) { + len = data.length; + } + png.writeUnsignedInt(len); + var p:uint = png.position; + png.writeUnsignedInt(type); + if ( data != null ) { + png.writeBytes(data); + } + var e:uint = png.position; + png.position = p; + c = 0xffffffff; + for (var i:int = 0; i < (e-p); i++) { + c = uint(crcTable[ + (c ^ png.readUnsignedByte()) & + uint(0xff)] ^ uint(c >>> 8)); + } + c = uint(c^uint(0xffffffff)); + png.position = e; + png.writeUnsignedInt(c); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/media/NeaveCamera.as b/webcam/com/neave/media/NeaveCamera.as index f401af8..2b68201 100755..100644 --- a/webcam/com/neave/media/NeaveCamera.as +++ b/webcam/com/neave/media/NeaveCamera.as @@ -1,81 +1,81 @@ -/**
- * Neave Camera
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.media
-{
- import flash.events.*;
- import flash.media.*;
- import flash.system.*;
-
- public class NeaveCamera
- {
- /**
- * The requested width of the camera object
- */
- static public var CAMERA_WIDTH:int = 320;
-
- /**
- * The requested height of the camera object
- */
- static public var CAMERA_HEIGHT:int = 240;
-
- static private var cam:Camera;
-
- public function NeaveCamera() { }
-
- /**
- * Sets up and returns the camera object
- *
- * @return A camera object
- */
- static public function getCamera():Camera
- {
- // Return the same camera if it has been successfully requested before
- if (cam != null)
- {
- if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY);
- return cam;
- }
-
- // Get the camera
- cam = Camera.getCamera();
- if (cam != null)
- {
- // Set properties if a camera was found
- cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true);
- cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener);
- return cam;
- }
- else
- {
- // No camera found
- Security.showSettings(SecurityPanel.CAMERA);
- return new Camera();
- }
- }
-
- /**
- * Whether the camera object is available or not
- */
- static public function get muted():Boolean
- {
- return cam == null || cam.muted || cam.name == null || cam.width == 0;
- }
-
- /**
- * Camera status response
- */
- static private function statusListener(e:StatusEvent):void
- {
- if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA);
- }
- }
+/** + * Neave Camera + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + + public class NeaveCamera + { + /** + * The requested width of the camera object + */ + static public var CAMERA_WIDTH:int = 320; + + /** + * The requested height of the camera object + */ + static public var CAMERA_HEIGHT:int = 240; + + static private var cam:Camera; + + public function NeaveCamera() { } + + /** + * Sets up and returns the camera object + * + * @return A camera object + */ + static public function getCamera():Camera + { + // Return the same camera if it has been successfully requested before + if (cam != null) + { + if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY); + return cam; + } + + // Get the camera + cam = Camera.getCamera(); + if (cam != null) + { + // Set properties if a camera was found + cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true); + cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener); + return cam; + } + else + { + // No camera found + Security.showSettings(SecurityPanel.CAMERA); + return new Camera(); + } + } + + /** + * Whether the camera object is available or not + */ + static public function get muted():Boolean + { + return cam == null || cam.muted || cam.name == null || cam.width == 0; + } + + /** + * Camera status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/media/NeaveMicrophone.as b/webcam/com/neave/media/NeaveMicrophone.as index 6a46ee7..4f6e6c1 100755..100644 --- a/webcam/com/neave/media/NeaveMicrophone.as +++ b/webcam/com/neave/media/NeaveMicrophone.as @@ -1,104 +1,104 @@ -/**
- * Neave Microphone
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.media
-{
- import flash.events.*;
- import flash.media.*;
- import flash.system.*;
- import flash.utils.*;
-
- public class NeaveMicrophone
- {
- static private var mic:Microphone;
- static private var gainTimer:Timer;
-
- public function NeaveMicrophone() { }
-
- /**
- * Sets up and returns the microphone object
- *
- * @return A microphone object
- */
- static public function getMicrophone():Microphone
- {
- // Return the same microphone if it has been successfully requested before
- if (mic != null)
- {
- if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY);
- else NeaveMicrophone.startAutoGain();
- return mic;
- }
-
- gainTimer = new Timer(100);
-
- // Get the microphone
- mic = Microphone.getMicrophone();
- if (mic != null)
- {
- // Set properties if a microphone was found
- mic.setLoopBack(true);
- mic.rate = 44;
- mic.gain = 25;
- mic.setSilenceLevel(0);
- mic.setUseEchoSuppression(true);
- mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers
- mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener);
-
- return mic;
- }
- else
- {
- // No microphone found
- Security.showSettings(SecurityPanel.MICROPHONE);
- return new Microphone();
- }
- }
-
- /**
- * Microphone status response
- */
- static private function statusListener(e:StatusEvent):void
- {
- if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain();
- else NeaveMicrophone.stopAutoGain();
- }
-
- /**
- * Set up gain control
- */
- static public function startAutoGain():void
- {
- gainTimer.start();
- if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain);
- }
-
- /**
- * Stop gain control
- */
- static public function stopAutoGain():void
- {
- gainTimer.stop();
- gainTimer.reset();
- gainTimer.removeEventListener(TimerEvent.TIMER, setGain);
- }
-
- /**
- * Dynamically adjust the microphone's gain value
- */
- static private function setGain(e:TimerEvent):void
- {
- if (mic.activityLevel < 15) mic.gain = 30;
- else if (mic.activityLevel > 90) mic.gain = 20;
- else mic.gain = 25;
- }
- }
+/** + * Neave Microphone + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + import flash.utils.*; + + public class NeaveMicrophone + { + static private var mic:Microphone; + static private var gainTimer:Timer; + + public function NeaveMicrophone() { } + + /** + * Sets up and returns the microphone object + * + * @return A microphone object + */ + static public function getMicrophone():Microphone + { + // Return the same microphone if it has been successfully requested before + if (mic != null) + { + if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY); + else NeaveMicrophone.startAutoGain(); + return mic; + } + + gainTimer = new Timer(100); + + // Get the microphone + mic = Microphone.getMicrophone(); + if (mic != null) + { + // Set properties if a microphone was found + mic.setLoopBack(true); + mic.rate = 44; + mic.gain = 25; + mic.setSilenceLevel(0); + mic.setUseEchoSuppression(true); + mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers + mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener); + + return mic; + } + else + { + // No microphone found + Security.showSettings(SecurityPanel.MICROPHONE); + return new Microphone(); + } + } + + /** + * Microphone status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain(); + else NeaveMicrophone.stopAutoGain(); + } + + /** + * Set up gain control + */ + static public function startAutoGain():void + { + gainTimer.start(); + if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Stop gain control + */ + static public function stopAutoGain():void + { + gainTimer.stop(); + gainTimer.reset(); + gainTimer.removeEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Dynamically adjust the microphone's gain value + */ + static private function setGain(e:TimerEvent):void + { + if (mic.activityLevel < 15) mic.gain = 30; + else if (mic.activityLevel > 90) mic.gain = 20; + else mic.gain = 25; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/NeaveWebcam.as b/webcam/com/neave/webcam/NeaveWebcam.as index 5372ad5..a39c426 100755..100644 --- a/webcam/com/neave/webcam/NeaveWebcam.as +++ b/webcam/com/neave/webcam/NeaveWebcam.as @@ -1,198 +1,198 @@ -/**
- * Neave Webcam ...play with webcam effects
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * @author Paul Neave
- * @version 1.0.0
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam
-{
- import flash.display.*;
- import flash.events.*;
- import flash.media.*;
- import flash.ui.*;
- import com.neave.media.*;
- import com.neave.webcam.effects.*;
-
- public class NeaveWebcam extends Sprite
- {
- // Main variables
- private var camera:Camera;
- private var video:Video;
- private var videoBitmap:Bitmap;
- private var videoContainer:Sprite;
- private var uiEnabled:Boolean;
-
- /**
- * Manages the webcam effects
- */
- public var effects:EffectsManager;
-
- /**
- * Creates a new instance of Neave Webcam
- *
- * @param camera The camera object to use to create the webcam effects
- * @param interactive Enable mouse click or arrow keys to change the webcam effect
- */
- public function NeaveWebcam(camera:Camera, interactive:Boolean = true)
- {
- this.camera = camera;
-
- initVideo();
- initEffects();
-
- this.interactive = interactive;
- }
-
- /**
- * Sets up the main video object
- */
- private function initVideo():void
- {
- // Video dimensions must be 320x240 or higher
- var w:int = camera.width < NeaveCamera.CAMERA_WIDTH ? NeaveCamera.CAMERA_WIDTH : camera.width;
- var h:int = camera.height < NeaveCamera.CAMERA_HEIGHT ? NeaveCamera.CAMERA_HEIGHT : camera.height;
-
- // Attach the camera object a video object
- video = new Video(w, h);
- video.attachCamera(camera);
-
- // Create a bitmap object for the video effect, flipping to create a mirror image
- videoBitmap = new Bitmap(new BitmapData(w, h, false, 0xFF000000), PixelSnapping.AUTO, false);
- videoBitmap.scaleX = -1;
- videoBitmap.x = w;
-
- // Create a sprite to hold the bitmap
- videoContainer = new Sprite();
- videoContainer.addChild(videoBitmap);
- videoContainer.scaleX = -1;
- videoContainer.x = w;
- addChild(videoContainer);
- }
-
- /**
- * Sets up the webcam effects for the video object
- */
- private function initEffects():void
- {
- // Set up the effects manager for this video object
- effects = new EffectsManager(video, videoBitmap.bitmapData);
- paused = false;
- }
-
- /**
- * Enable mouse click or arrow keys to change the webcam effect
- */
- public function set interactive(i:Boolean):void
- {
- uiEnabled = i;
-
- if (uiEnabled)
- {
- // Arrow keys select previous or next webcam effect
- addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
-
- // Clicking on the video selects the next webcam effect
- videoContainer.addEventListener(MouseEvent.CLICK, videoClickListener);
- videoContainer.buttonMode = true;
- }
- else
- {
- // Remove interactivity
- removeEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
- videoContainer.removeEventListener(MouseEvent.CLICK, videoClickListener);
- videoContainer.buttonMode = false;
- }
- }
-
- /**
- * Moves to the next webcam effect on mouse click
- */
- private function videoClickListener(e:MouseEvent):void
- {
- if (paused || camera.muted || camera.width == 0) return;
-
- effects.nextEffect();
- }
-
- /**
- * Moves to the next or previous webcam effect when the arrow keys are pressed
- */
- private function keyDownListener(e:KeyboardEvent):void
- {
- if (paused || camera.muted || camera.width == 0) return;
-
- switch (e.keyCode)
- {
- case Keyboard.LEFT:
- effects.previousEffect();
- break;
-
- case Keyboard.RIGHT:
- effects.nextEffect();
- break;
- }
- }
-
- /**
- * The bitmap data containing the current webcam effect
- */
- public function get effectBitmap():BitmapData
- {
- return videoBitmap.bitmapData;
- }
-
- /**
- * Pause or resume the current webcam effect
- */
- public function set paused(p:Boolean):void
- {
- if (p == paused) return;
-
- // Pause or resume updating the current webcam effect every frame
- if (p) removeEventListener(Event.ENTER_FRAME, update);
- else addEventListener(Event.ENTER_FRAME, update);
- }
-
- /**
- * Pause or resume the current webcam effect
- */
- public function get paused():Boolean
- {
- return !hasEventListener(Event.ENTER_FRAME);
- }
-
- /**
- * Removes the webcam and all other referenced objects
- */
- public function destroy():void
- {
- interactive = false;
- paused = true;
- effects.destroy();
- videoContainer.removeChild(videoBitmap);
- videoBitmap.bitmapData.dispose();
- videoBitmap.bitmapData = null;
- videoBitmap = null;
- removeChild(videoContainer);
- videoContainer = null;
- video = null;
- camera = null;
- }
-
- /**
- * Updates the current webcam effect
- */
- private function update(e:Event):void
- {
- effects.update();
- }
- }
+/** + * Neave Webcam ...play with webcam effects + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * @author Paul Neave + * @version 1.0.0 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam +{ + import flash.display.*; + import flash.events.*; + import flash.media.*; + import flash.ui.*; + import com.neave.media.*; + import com.neave.webcam.effects.*; + + public class NeaveWebcam extends Sprite + { + // Main variables + private var camera:Camera; + private var video:Video; + private var videoBitmap:Bitmap; + private var videoContainer:Sprite; + private var uiEnabled:Boolean; + + /** + * Manages the webcam effects + */ + public var effects:EffectsManager; + + /** + * Creates a new instance of Neave Webcam + * + * @param camera The camera object to use to create the webcam effects + * @param interactive Enable mouse click or arrow keys to change the webcam effect + */ + public function NeaveWebcam(camera:Camera, interactive:Boolean = true) + { + this.camera = camera; + + initVideo(); + initEffects(); + + this.interactive = interactive; + } + + /** + * Sets up the main video object + */ + private function initVideo():void + { + // Video dimensions must be 320x240 or higher + var w:int = camera.width < NeaveCamera.CAMERA_WIDTH ? NeaveCamera.CAMERA_WIDTH : camera.width; + var h:int = camera.height < NeaveCamera.CAMERA_HEIGHT ? NeaveCamera.CAMERA_HEIGHT : camera.height; + + // Attach the camera object a video object + video = new Video(w, h); + video.attachCamera(camera); + + // Create a bitmap object for the video effect, flipping to create a mirror image + videoBitmap = new Bitmap(new BitmapData(w, h, false, 0xFF000000), PixelSnapping.AUTO, false); + videoBitmap.scaleX = -1; + videoBitmap.x = w; + + // Create a sprite to hold the bitmap + videoContainer = new Sprite(); + videoContainer.addChild(videoBitmap); + videoContainer.scaleX = -1; + videoContainer.x = w; + addChild(videoContainer); + } + + /** + * Sets up the webcam effects for the video object + */ + private function initEffects():void + { + // Set up the effects manager for this video object + effects = new EffectsManager(video, videoBitmap.bitmapData); + paused = false; + } + + /** + * Enable mouse click or arrow keys to change the webcam effect + */ + public function set interactive(i:Boolean):void + { + uiEnabled = i; + + if (uiEnabled) + { + // Arrow keys select previous or next webcam effect + addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); + + // Clicking on the video selects the next webcam effect + videoContainer.addEventListener(MouseEvent.CLICK, videoClickListener); + videoContainer.buttonMode = true; + } + else + { + // Remove interactivity + removeEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); + videoContainer.removeEventListener(MouseEvent.CLICK, videoClickListener); + videoContainer.buttonMode = false; + } + } + + /** + * Moves to the next webcam effect on mouse click + */ + private function videoClickListener(e:MouseEvent):void + { + if (paused || camera.muted || camera.width == 0) return; + + effects.nextEffect(); + } + + /** + * Moves to the next or previous webcam effect when the arrow keys are pressed + */ + private function keyDownListener(e:KeyboardEvent):void + { + if (paused || camera.muted || camera.width == 0) return; + + switch (e.keyCode) + { + case Keyboard.LEFT: + effects.previousEffect(); + break; + + case Keyboard.RIGHT: + effects.nextEffect(); + break; + } + } + + /** + * The bitmap data containing the current webcam effect + */ + public function get effectBitmap():BitmapData + { + return videoBitmap.bitmapData; + } + + /** + * Pause or resume the current webcam effect + */ + public function set paused(p:Boolean):void + { + if (p == paused) return; + + // Pause or resume updating the current webcam effect every frame + if (p) removeEventListener(Event.ENTER_FRAME, update); + else addEventListener(Event.ENTER_FRAME, update); + } + + /** + * Pause or resume the current webcam effect + */ + public function get paused():Boolean + { + return !hasEventListener(Event.ENTER_FRAME); + } + + /** + * Removes the webcam and all other referenced objects + */ + public function destroy():void + { + interactive = false; + paused = true; + effects.destroy(); + videoContainer.removeChild(videoBitmap); + videoBitmap.bitmapData.dispose(); + videoBitmap.bitmapData = null; + videoBitmap = null; + removeChild(videoContainer); + videoContainer = null; + video = null; + camera = null; + } + + /** + * Updates the current webcam effect + */ + private function update(e:Event):void + { + effects.update(); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/AbstractEffect.as b/webcam/com/neave/webcam/effects/AbstractEffect.as index a0fb241..24e9957 100755..100644 --- a/webcam/com/neave/webcam/effects/AbstractEffect.as +++ b/webcam/com/neave/webcam/effects/AbstractEffect.as @@ -1,81 +1,81 @@ -/**
- * Neave Webcam // Abstract Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- import flash.display.*;
- import flash.geom.*;
-
- public class AbstractEffect
- {
- protected var source:IBitmapDrawable;
- protected var targetBitmap:BitmapData;
- protected var name:String;
- protected var sourceBitmap:BitmapData;
- protected var sourceMatrix:Matrix;
- protected var rect:Rectangle;
- protected var point:Point;
- protected var color:ColorTransform;
-
- /**
- * An abstract effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- this.source = source;
- this.targetBitmap = targetBitmap;
- this.name = name;
-
- createEffect();
- }
-
- /**
- * Sets up the effect
- */
- private function createEffect():void
- {
- sourceBitmap = targetBitmap.clone();
- sourceMatrix = new Matrix();
- rect = targetBitmap.rect;
- point = new Point();
- color = new ColorTransform();
- }
-
- /**
- * The proper name of the effect
- */
- public function get effectName():String
- {
- return name;
- }
-
- /**
- * Draws the effect
- */
- public function draw():void
- {
- sourceBitmap.draw(source, sourceMatrix, color);
- }
-
- /**
- * Removes the effect and all other referenced objects
- */
- public function destroy():void
- {
- sourceBitmap.dispose();
- sourceBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + import flash.display.*; + import flash.geom.*; + + public class AbstractEffect + { + protected var source:IBitmapDrawable; + protected var targetBitmap:BitmapData; + protected var name:String; + protected var sourceBitmap:BitmapData; + protected var sourceMatrix:Matrix; + protected var rect:Rectangle; + protected var point:Point; + protected var color:ColorTransform; + + /** + * An abstract effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + this.source = source; + this.targetBitmap = targetBitmap; + this.name = name; + + createEffect(); + } + + /** + * Sets up the effect + */ + private function createEffect():void + { + sourceBitmap = targetBitmap.clone(); + sourceMatrix = new Matrix(); + rect = targetBitmap.rect; + point = new Point(); + color = new ColorTransform(); + } + + /** + * The proper name of the effect + */ + public function get effectName():String + { + return name; + } + + /** + * Draws the effect + */ + public function draw():void + { + sourceBitmap.draw(source, sourceMatrix, color); + } + + /** + * Removes the effect and all other referenced objects + */ + public function destroy():void + { + sourceBitmap.dispose(); + sourceBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/EffectEvent.as b/webcam/com/neave/webcam/effects/EffectEvent.as index 134b792..9d1dbe3 100755..100644 --- a/webcam/com/neave/webcam/effects/EffectEvent.as +++ b/webcam/com/neave/webcam/effects/EffectEvent.as @@ -1,23 +1,23 @@ -package com.neave.webcam.effects
-{
- import flash.events.*;
-
- public class EffectEvent extends Event
- {
- public static const NEW_EFFECT:String = "newEffect";
-
- private var _effectType:int;
-
- public function EffectEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, effectType:int = 0)
- {
- super(type, bubbles, cancelable);
-
- _effectType = effectType;
- }
-
- public function get effectType():int
- {
- return _effectType;
- }
- }
+package com.neave.webcam.effects +{ + import flash.events.*; + + public class EffectEvent extends Event + { + public static const NEW_EFFECT:String = "newEffect"; + + private var _effectType:int; + + public function EffectEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, effectType:int = 0) + { + super(type, bubbles, cancelable); + + _effectType = effectType; + } + + public function get effectType():int + { + return _effectType; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/EffectType.as b/webcam/com/neave/webcam/effects/EffectType.as index 3c9967d..3c9967d 100755..100644 --- a/webcam/com/neave/webcam/effects/EffectType.as +++ b/webcam/com/neave/webcam/effects/EffectType.as diff --git a/webcam/com/neave/webcam/effects/EffectsManager.as b/webcam/com/neave/webcam/effects/EffectsManager.as index 0c898c8..0c898c8 100755..100644 --- a/webcam/com/neave/webcam/effects/EffectsManager.as +++ b/webcam/com/neave/webcam/effects/EffectsManager.as diff --git a/webcam/com/neave/webcam/effects/NormalEffect.as b/webcam/com/neave/webcam/effects/NormalEffect.as index b97e896..584629a 100755..100644 --- a/webcam/com/neave/webcam/effects/NormalEffect.as +++ b/webcam/com/neave/webcam/effects/NormalEffect.as @@ -1,38 +1,38 @@ -/**
- * Neave Webcam // Normal Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- import flash.display.*;
-
- public class NormalEffect extends AbstractEffect
- {
- /**
- * Creates a normal effect for copying the source object into the target bitmap data without modification
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function NormalEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Normal");
- }
-
- /**
- * Draws the normal effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
- }
+/** + * Neave Webcam // Normal Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + import flash.display.*; + + public class NormalEffect extends AbstractEffect + { + /** + * Creates a normal effect for copying the source object into the target bitmap data without modification + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function NormalEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Normal"); + } + + /** + * Draws the normal effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/GlowEffect.as b/webcam/com/neave/webcam/effects/color/GlowEffect.as index 5c96e71..64cdfa0 100755..100644 --- a/webcam/com/neave/webcam/effects/color/GlowEffect.as +++ b/webcam/com/neave/webcam/effects/color/GlowEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Glow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class GlowEffect extends AbstractEffect
- {
- private var edge:ConvolutionFilter;
- private var blur:BlurFilter;
-
- /**
- * Creates a high constrast glow effect around surface edges
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function GlowEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Glow");
-
- createGlow();
- }
-
- /**
- * Sets up the glow effect
- */
- private function createGlow():void
- {
- // Increase contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Set up a large horizontal edge convoluton filter
- var m:Array =
- [
- -100, -100, -100,
- 100, 100, 100,
- 0, 0, 0
- ];
- edge = new ConvolutionFilter(3, 3, m, 9);
-
- // Blur the edges to create a smooth glow
- blur = new BlurFilter(8, 8, 2);
- }
-
- /**
- * Draws the glow effect
- */
- override public function draw():void
- {
- super.draw();
- sourceBitmap.applyFilter(sourceBitmap, rect, point, blur);
- targetBitmap.applyFilter(sourceBitmap, rect, point, edge);
- }
- }
+/** + * Neave Webcam // Glow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class GlowEffect extends AbstractEffect + { + private var edge:ConvolutionFilter; + private var blur:BlurFilter; + + /** + * Creates a high constrast glow effect around surface edges + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function GlowEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Glow"); + + createGlow(); + } + + /** + * Sets up the glow effect + */ + private function createGlow():void + { + // Increase contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Set up a large horizontal edge convoluton filter + var m:Array = + [ + -100, -100, -100, + 100, 100, 100, + 0, 0, 0 + ]; + edge = new ConvolutionFilter(3, 3, m, 9); + + // Blur the edges to create a smooth glow + blur = new BlurFilter(8, 8, 2); + } + + /** + * Draws the glow effect + */ + override public function draw():void + { + super.draw(); + sourceBitmap.applyFilter(sourceBitmap, rect, point, blur); + targetBitmap.applyFilter(sourceBitmap, rect, point, edge); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/MonochromeEffect.as b/webcam/com/neave/webcam/effects/color/MonochromeEffect.as index ed14de9..9657bb2 100755..100644 --- a/webcam/com/neave/webcam/effects/color/MonochromeEffect.as +++ b/webcam/com/neave/webcam/effects/color/MonochromeEffect.as @@ -1,61 +1,61 @@ -/**
- * Neave Webcam // Monochrome (Black & White) Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class MonochromeEffect extends AbstractEffect
- {
- private var monochrome:ColorMatrixFilter;
-
- /**
- * Creates a high contrast black and white monochrome effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function MonochromeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Black & White");
-
- createMonochrome();
- }
-
- /**
- * Sets up the monochrome effect
- */
- private function createMonochrome():void
- {
- // Add punch with more contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Monochrome colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- monochrome = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the monochrome effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, monochrome);
- }
- }
+/** + * Neave Webcam // Monochrome (Black & White) Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class MonochromeEffect extends AbstractEffect + { + private var monochrome:ColorMatrixFilter; + + /** + * Creates a high contrast black and white monochrome effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function MonochromeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Black & White"); + + createMonochrome(); + } + + /** + * Sets up the monochrome effect + */ + private function createMonochrome():void + { + // Add punch with more contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Monochrome colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + monochrome = new ColorMatrixFilter(m); + } + + /** + * Draws the monochrome effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, monochrome); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/RainbowEffect.as b/webcam/com/neave/webcam/effects/color/RainbowEffect.as index 3b5b70b..13f21ab 100755..100644 --- a/webcam/com/neave/webcam/effects/color/RainbowEffect.as +++ b/webcam/com/neave/webcam/effects/color/RainbowEffect.as @@ -1,90 +1,90 @@ -/**
- * Neave Webcam // Rainbow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class RainbowEffect extends AbstractEffect
- {
- private var red:Array;
- private var green:Array;
- private var blue:Array;
-
- /**
- * Creates a psychedelic colour-cycling effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function RainbowEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Rainbow");
-
- createRainbow();
- }
-
- /**
- * Sets up the rainbow effect
- */
- private function createRainbow():void
- {
- // Add punch with more contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Set up colour arrays
- red = new Array(256);
- green = new Array(256);
- blue = new Array(256);
-
- // Populate colour arrays with a curved gradient
- for (var i:int = 0; i < 256; i++)
- {
- red[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 16;
- green[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 8;
- blue[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF;
- }
- }
-
- /**
- * Draws the rainbow effect
- */
- override public function draw():void
- {
- super.draw();
-
- red.push(red.splice(0, 1));
- green.unshift(green.pop());
- green.unshift(green.pop());
- if (Math.random() < 0.5) green.unshift(green.pop());
- blue.unshift(blue.pop());
- blue.unshift(blue.pop());
- blue.unshift(blue.pop());
- if (Math.random() < 0.5) blue.unshift(blue.pop());
- if (Math.random() < 0.5) blue.unshift(blue.pop());
-
- targetBitmap.paletteMap(sourceBitmap, rect, point, red, green, blue);
- }
-
- /**
- * Removes the rainbow effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- red = null;
- green = null;
- blue = null;
- }
- }
+/** + * Neave Webcam // Rainbow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class RainbowEffect extends AbstractEffect + { + private var red:Array; + private var green:Array; + private var blue:Array; + + /** + * Creates a psychedelic colour-cycling effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function RainbowEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Rainbow"); + + createRainbow(); + } + + /** + * Sets up the rainbow effect + */ + private function createRainbow():void + { + // Add punch with more contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Set up colour arrays + red = new Array(256); + green = new Array(256); + blue = new Array(256); + + // Populate colour arrays with a curved gradient + for (var i:int = 0; i < 256; i++) + { + red[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 16; + green[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 8; + blue[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF; + } + } + + /** + * Draws the rainbow effect + */ + override public function draw():void + { + super.draw(); + + red.push(red.splice(0, 1)); + green.unshift(green.pop()); + green.unshift(green.pop()); + if (Math.random() < 0.5) green.unshift(green.pop()); + blue.unshift(blue.pop()); + blue.unshift(blue.pop()); + blue.unshift(blue.pop()); + if (Math.random() < 0.5) blue.unshift(blue.pop()); + if (Math.random() < 0.5) blue.unshift(blue.pop()); + + targetBitmap.paletteMap(sourceBitmap, rect, point, red, green, blue); + } + + /** + * Removes the rainbow effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + red = null; + green = null; + blue = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/SepiaDirt.as b/webcam/com/neave/webcam/effects/color/SepiaDirt.as index 4b03f65..50eb396 100755..100644 --- a/webcam/com/neave/webcam/effects/color/SepiaDirt.as +++ b/webcam/com/neave/webcam/effects/color/SepiaDirt.as @@ -1,31 +1,31 @@ -/**
- * Neave Webcam // Sepia Dirt
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
-
- final internal class SepiaDirt extends Shape
- {
- /**
- * Creates a black circular shape to be used with the sepia effect
- *
- * @param x The position of the dirt on the x-axis
- * @param y The position of the dirt on the y-axis
- * @param radius The radius of the dirt
- */
- public function SepiaDirt(x:Number = 0, y:Number = 0, radius:Number = 1)
- {
- graphics.beginFill(0x000000);
- graphics.drawCircle(x, y, radius);
- }
- }
+/** + * Neave Webcam // Sepia Dirt + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + + final internal class SepiaDirt extends Shape + { + /** + * Creates a black circular shape to be used with the sepia effect + * + * @param x The position of the dirt on the x-axis + * @param y The position of the dirt on the y-axis + * @param radius The radius of the dirt + */ + public function SepiaDirt(x:Number = 0, y:Number = 0, radius:Number = 1) + { + graphics.beginFill(0x000000); + graphics.drawCircle(x, y, radius); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/SepiaEffect.as b/webcam/com/neave/webcam/effects/color/SepiaEffect.as index f7d2ebe..236168c 100755..100644 --- a/webcam/com/neave/webcam/effects/color/SepiaEffect.as +++ b/webcam/com/neave/webcam/effects/color/SepiaEffect.as @@ -1,90 +1,90 @@ -/**
- * Neave Webcam // Sepia Movie Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class SepiaEffect extends AbstractEffect
- {
- private var frameStep:int;
- private var sepia:ColorMatrixFilter;
- private var count:uint;
- private var linePos:Number;
-
- /**
- * Creates an animated sepia effect like an old projector movie
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frameStep The number of frames to step over to create a jittery movie effect
- */
- public function SepiaEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frameStep:int = 3)
- {
- super(source, targetBitmap, "Sepia Movie");
- this.frameStep = frameStep < 1 ? 1 : frameStep;
-
- createSepia();
- }
-
- /**
- * Sets up the sepia effect
- */
- private function createSepia():void
- {
- // Reset variables
- count = linePos = 0;
-
- // Sepia colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.246, 0.4838, 0.0902, 0, 10]); // Green
- m = m.concat([0.15, 0.295, 0.055, 0, 10]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- sepia = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the sepia effect
- */
- override public function draw():void
- {
- if (count == 0)
- {
- super.draw();
-
- // Tint source bitmap sepia
- sourceBitmap.applyFilter(sourceBitmap, rect, point, sepia);
-
- // Create old movie style black vertical line on one side
- linePos += (Math.random() * rect.width * 0.25 - linePos) * 0.04;
- if (Math.random() < 0.05) linePos = rect.width;
- if (Math.random() < 0.05) linePos = rect.width * 0.2;
- if (Math.random() < 0.5) sourceBitmap.fillRect(new Rectangle(Math.round(linePos), 0, 1, rect.height), 0xFF000000);
-
- // Create random dirt with one big spot every so often
- for (var i:int = 4; i--; ) sourceBitmap.draw(new SepiaDirt(Math.random() * rect.width, Math.random() * rect.height, Math.random() < 0.995 ? Math.random() + 0.5 : Math.random() * 10 + 15));
-
- // Draw source bitmap into target bitmap with a slight flicker
- var mult:uint = Math.random() * 64 + (255 - 64);
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFF000000);
- targetBitmap.merge(sourceBitmap, rect, point, mult, mult, mult, 0);
- targetBitmap.unlock();
- }
- count++;
- count %= frameStep;
- }
- }
+/** + * Neave Webcam // Sepia Movie Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class SepiaEffect extends AbstractEffect + { + private var frameStep:int; + private var sepia:ColorMatrixFilter; + private var count:uint; + private var linePos:Number; + + /** + * Creates an animated sepia effect like an old projector movie + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frameStep The number of frames to step over to create a jittery movie effect + */ + public function SepiaEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frameStep:int = 3) + { + super(source, targetBitmap, "Sepia Movie"); + this.frameStep = frameStep < 1 ? 1 : frameStep; + + createSepia(); + } + + /** + * Sets up the sepia effect + */ + private function createSepia():void + { + // Reset variables + count = linePos = 0; + + // Sepia colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.246, 0.4838, 0.0902, 0, 10]); // Green + m = m.concat([0.15, 0.295, 0.055, 0, 10]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + sepia = new ColorMatrixFilter(m); + } + + /** + * Draws the sepia effect + */ + override public function draw():void + { + if (count == 0) + { + super.draw(); + + // Tint source bitmap sepia + sourceBitmap.applyFilter(sourceBitmap, rect, point, sepia); + + // Create old movie style black vertical line on one side + linePos += (Math.random() * rect.width * 0.25 - linePos) * 0.04; + if (Math.random() < 0.05) linePos = rect.width; + if (Math.random() < 0.05) linePos = rect.width * 0.2; + if (Math.random() < 0.5) sourceBitmap.fillRect(new Rectangle(Math.round(linePos), 0, 1, rect.height), 0xFF000000); + + // Create random dirt with one big spot every so often + for (var i:int = 4; i--; ) sourceBitmap.draw(new SepiaDirt(Math.random() * rect.width, Math.random() * rect.height, Math.random() < 0.995 ? Math.random() + 0.5 : Math.random() * 10 + 15)); + + // Draw source bitmap into target bitmap with a slight flicker + var mult:uint = Math.random() * 64 + (255 - 64); + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFF000000); + targetBitmap.merge(sourceBitmap, rect, point, mult, mult, mult, 0); + targetBitmap.unlock(); + } + count++; + count %= frameStep; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/WarholEffect.as b/webcam/com/neave/webcam/effects/color/WarholEffect.as index 81f8289..f64dea0 100755..100644 --- a/webcam/com/neave/webcam/effects/color/WarholEffect.as +++ b/webcam/com/neave/webcam/effects/color/WarholEffect.as @@ -1,99 +1,99 @@ -/**
- * Neave Webcam // Andy Warhol Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class WarholEffect extends AbstractEffect
- {
- private var smallBitmap:BitmapData;
- private var pos1:Point;
- private var pos2:Point;
- private var pos3:Point;
- private var pos4:Point;
-
- /**
- * Creates an Andy Warhol-style Pop Art effect with four highly constrasted tricolour images
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function WarholEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Andy Warhol");
-
- createWarhol();
- }
-
- /**
- * Sets up the Warhol effect
- */
- private function createWarhol():void
- {
- // Create a bitmap quarter the size of the original
- smallBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000);
- sourceMatrix.scale(0.5, 0.5);
-
- // Positions of each image
- pos1 = new Point(0, 0);
- pos2 = new Point(smallBitmap.width, 0);
- pos3 = new Point(0, smallBitmap.height);
- pos4 = new Point(smallBitmap.width, smallBitmap.height);
- }
-
- /**
- * Draws a tricolour (three colour) image from the passed bitmap into the target bitmap data
- *
- * @param bitmapData The source bitmap data to draw the tricolour from
- * @param pos The position to draw tricolour
- * @param color1 The background colour
- * @param color2 The middle colour
- * @param color3 The highlight colour
- */
- private function drawTricolor(bitmapData:BitmapData, pos:Point, color1:uint, color2:uint, color3:uint):void
- {
- // Limit the pixels in the bitmap data to three colours only
- targetBitmap.threshold(bitmapData, rect, pos, "<=", 0xFFAAAAAA, color2);
- targetBitmap.threshold(bitmapData, rect, pos, ">", 0xFFAAAAAA, color3);
- targetBitmap.threshold(bitmapData, rect, pos, "<", 0xFF555555, color1);
- }
-
- /**
- * Draws the Warhol effect
- */
- override public function draw():void
- {
- smallBitmap.draw(source, sourceMatrix);
-
- targetBitmap.lock();
- drawTricolor(smallBitmap, pos1, 0xFF0080FF, 0xFFFFFF00, 0xFFFF0080);
- drawTricolor(smallBitmap, pos2, 0xFF202020, 0xFFFF0000, 0xFFFFFFFF);
- drawTricolor(smallBitmap, pos3, 0xFFA040A0, 0xFFFF9900, 0xFF80C0FF);
- drawTricolor(smallBitmap, pos4, 0xFF40A000, 0xFFFFFFA0, 0xFFFFA0FF);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the Warhol effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- pos1 = pos2 = pos3 = pos4 = null;
- }
- }
+/** + * Neave Webcam // Andy Warhol Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class WarholEffect extends AbstractEffect + { + private var smallBitmap:BitmapData; + private var pos1:Point; + private var pos2:Point; + private var pos3:Point; + private var pos4:Point; + + /** + * Creates an Andy Warhol-style Pop Art effect with four highly constrasted tricolour images + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function WarholEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Andy Warhol"); + + createWarhol(); + } + + /** + * Sets up the Warhol effect + */ + private function createWarhol():void + { + // Create a bitmap quarter the size of the original + smallBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000); + sourceMatrix.scale(0.5, 0.5); + + // Positions of each image + pos1 = new Point(0, 0); + pos2 = new Point(smallBitmap.width, 0); + pos3 = new Point(0, smallBitmap.height); + pos4 = new Point(smallBitmap.width, smallBitmap.height); + } + + /** + * Draws a tricolour (three colour) image from the passed bitmap into the target bitmap data + * + * @param bitmapData The source bitmap data to draw the tricolour from + * @param pos The position to draw tricolour + * @param color1 The background colour + * @param color2 The middle colour + * @param color3 The highlight colour + */ + private function drawTricolor(bitmapData:BitmapData, pos:Point, color1:uint, color2:uint, color3:uint):void + { + // Limit the pixels in the bitmap data to three colours only + targetBitmap.threshold(bitmapData, rect, pos, "<=", 0xFFAAAAAA, color2); + targetBitmap.threshold(bitmapData, rect, pos, ">", 0xFFAAAAAA, color3); + targetBitmap.threshold(bitmapData, rect, pos, "<", 0xFF555555, color1); + } + + /** + * Draws the Warhol effect + */ + override public function draw():void + { + smallBitmap.draw(source, sourceMatrix); + + targetBitmap.lock(); + drawTricolor(smallBitmap, pos1, 0xFF0080FF, 0xFFFFFF00, 0xFFFF0080); + drawTricolor(smallBitmap, pos2, 0xFF202020, 0xFFFF0000, 0xFFFFFFFF); + drawTricolor(smallBitmap, pos3, 0xFFA040A0, 0xFFFF9900, 0xFF80C0FF); + drawTricolor(smallBitmap, pos4, 0xFF40A000, 0xFFFFFFA0, 0xFFFFA0FF); + targetBitmap.unlock(); + } + + /** + * Removes the Warhol effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + pos1 = pos2 = pos3 = pos4 = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/color/XRayEffect.as b/webcam/com/neave/webcam/effects/color/XRayEffect.as index 06067bd..8f79e92 100755..100644 --- a/webcam/com/neave/webcam/effects/color/XRayEffect.as +++ b/webcam/com/neave/webcam/effects/color/XRayEffect.as @@ -1,62 +1,62 @@ -/**
- * Neave Webcam // X-Ray Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class XRayEffect extends AbstractEffect
- {
- private var cyanWash:ColorMatrixFilter;
-
- /**
- * Creates a mock x-ray effect by inverting the image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function XRayEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "X-Ray");
-
- createXRay();
- }
-
- /**
- * Sets up the x-ray effect
- */
- private function createXRay():void
- {
- // Invert the image
- color = new ColorTransform(-1.5, -1.5, -1.5, 1, 0xFF, 0xFF, 0xFF);
-
- // Monochrome colour matrix with a cyan tint
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 40]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 50]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- cyanWash = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the x-ray effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, cyanWash);
- }
- }
+/** + * Neave Webcam // X-Ray Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class XRayEffect extends AbstractEffect + { + private var cyanWash:ColorMatrixFilter; + + /** + * Creates a mock x-ray effect by inverting the image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function XRayEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "X-Ray"); + + createXRay(); + } + + /** + * Sets up the x-ray effect + */ + private function createXRay():void + { + // Invert the image + color = new ColorTransform(-1.5, -1.5, -1.5, 1, 0xFF, 0xFF, 0xFF); + + // Monochrome colour matrix with a cyan tint + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 40]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 50]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + cyanWash = new ColorMatrixFilter(m); + } + + /** + * Draws the x-ray effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, cyanWash); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/delay/DivideEffect.as b/webcam/com/neave/webcam/effects/delay/DivideEffect.as index 5e9cfee..9565e6d 100755..100644 --- a/webcam/com/neave/webcam/effects/delay/DivideEffect.as +++ b/webcam/com/neave/webcam/effects/delay/DivideEffect.as @@ -1,99 +1,99 @@ -/**
- * Neave Webcam // Delayed Divide Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class DivideEffect extends AbstractEffect
- {
- private var frames:int;
- private var divideBitmaps:Array;
- private var divideRect:Rectangle;
- private var dividePoint:Point;
-
- /**
- * Creates a split screen effect where the lower half of the image is delayed
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frames The number of frames to delay the lower half of the image by
- */
- public function DivideEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30)
- {
- super(source, targetBitmap, "Delayed Divide");
- this.frames = frames < 2 ? 2 : frames;
-
- createDivide();
- }
-
- /**
- * Sets up the divide effect
- */
- private function createDivide():void
- {
- // Define the lower half area and its top left position
- divideRect = new Rectangle(0, rect.height / 2, rect.width, rect.height / 2);
- dividePoint = new Point(0, rect.height / 2);
-
- // Draw the delayed bitmap into the lower half
- var m:Matrix = sourceMatrix.clone();
- m.translate(0, -rect.height / 2);
-
- // Create an array of bitmaps to store the delayed frames
- divideBitmaps = new Array();
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width, rect.height / 2, false, 0xFF000000);
- b.draw(source, m, color, null, rect, true); // Start with the current source image
- divideBitmaps.push(b);
- }
- }
-
- /**
- * Draws the divide effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through all the delayed frames
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = divideBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, divideRect, point); // Draw the current source image into frame 0
- else b.copyPixels(divideBitmaps[i - 1], b.rect, point); // Move the other frames along the array
- }
-
- // Draw the final delayed frame into the lower half with the current source image
- sourceBitmap.copyPixels(divideBitmaps[frames - 1], divideBitmaps[0].rect, dividePoint);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = frames; i--; )
- {
- divideBitmaps[i].dispose();
- divideBitmaps[i] = null;
- }
- divideBitmaps = null;
- }
- }
+/** + * Neave Webcam // Delayed Divide Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class DivideEffect extends AbstractEffect + { + private var frames:int; + private var divideBitmaps:Array; + private var divideRect:Rectangle; + private var dividePoint:Point; + + /** + * Creates a split screen effect where the lower half of the image is delayed + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frames The number of frames to delay the lower half of the image by + */ + public function DivideEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30) + { + super(source, targetBitmap, "Delayed Divide"); + this.frames = frames < 2 ? 2 : frames; + + createDivide(); + } + + /** + * Sets up the divide effect + */ + private function createDivide():void + { + // Define the lower half area and its top left position + divideRect = new Rectangle(0, rect.height / 2, rect.width, rect.height / 2); + dividePoint = new Point(0, rect.height / 2); + + // Draw the delayed bitmap into the lower half + var m:Matrix = sourceMatrix.clone(); + m.translate(0, -rect.height / 2); + + // Create an array of bitmaps to store the delayed frames + divideBitmaps = new Array(); + for (var i:int = frames; i--; ) + { + var b:BitmapData = new BitmapData(rect.width, rect.height / 2, false, 0xFF000000); + b.draw(source, m, color, null, rect, true); // Start with the current source image + divideBitmaps.push(b); + } + } + + /** + * Draws the divide effect + */ + override public function draw():void + { + super.draw(); + + // Loop through all the delayed frames + for (var i:int = frames; i--; ) + { + var b:BitmapData = divideBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, divideRect, point); // Draw the current source image into frame 0 + else b.copyPixels(divideBitmaps[i - 1], b.rect, point); // Move the other frames along the array + } + + // Draw the final delayed frame into the lower half with the current source image + sourceBitmap.copyPixels(divideBitmaps[frames - 1], divideBitmaps[0].rect, dividePoint); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = frames; i--; ) + { + divideBitmaps[i].dispose(); + divideBitmaps[i] = null; + } + divideBitmaps = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/delay/FilmstripEffect.as b/webcam/com/neave/webcam/effects/delay/FilmstripEffect.as index ce324b1..a7f6274 100755..100644 --- a/webcam/com/neave/webcam/effects/delay/FilmstripEffect.as +++ b/webcam/com/neave/webcam/effects/delay/FilmstripEffect.as @@ -1,91 +1,91 @@ -/**
- * Neave Webcam // Filmstrip Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class FilmstripEffect extends AbstractEffect
- {
- private var scale:int;
- private var total:int;
- private var filmstrip:Array;
-
- /**
- * Creates a grid of delayed images, each delayed by one frame after the previous frame
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param scale The number of images to use along the width and height of the grid
- */
- public function FilmstripEffect(source:IBitmapDrawable, targetBitmap:BitmapData, scale:int = 8)
- {
- super(source, targetBitmap, "Filmstrip");
- this.scale = scale < 2 ? 2 : scale;
-
- createFilmstrip();
- }
-
- /**
- * Sets up the filmstrip effect
- */
- private function createFilmstrip():void
- {
- // Resize the source to the set scale
- sourceMatrix.scale(1 / scale, 1 / scale);
-
- // Create an array of bitmaps to store the delayed frames
- total = scale * scale;
- filmstrip = new Array();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width / scale, rect.height / scale, false, 0xFF000000);
- b.draw(source, sourceMatrix, color, null, null, true);
- filmstrip.push(b);
- }
- }
-
- /**
- * Draws the filmstrip effect
- */
- override public function draw():void
- {
- // Loop through all the delayed frames
- targetBitmap.lock();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = filmstrip[i];
- if (i == 0) b.draw(source, sourceMatrix, color); // Draw the source at a smaller size into frame 0
- else b.copyPixels(filmstrip[i - 1], b.rect, point); // Move the other frames along the array
- targetBitmap.copyPixels(b, b.rect, new Point((scale - (i % scale) - 1) * rect.width / scale, int(i / scale) * rect.height / scale)); // Draw this frame in position
- }
- targetBitmap.unlock();
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the filmstrip bitmaps
- for (var i:int = total; i--; )
- {
- filmstrip[i].dispose();
- filmstrip[i] = null;
- }
- filmstrip = null;
- }
- }
+/** + * Neave Webcam // Filmstrip Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class FilmstripEffect extends AbstractEffect + { + private var scale:int; + private var total:int; + private var filmstrip:Array; + + /** + * Creates a grid of delayed images, each delayed by one frame after the previous frame + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param scale The number of images to use along the width and height of the grid + */ + public function FilmstripEffect(source:IBitmapDrawable, targetBitmap:BitmapData, scale:int = 8) + { + super(source, targetBitmap, "Filmstrip"); + this.scale = scale < 2 ? 2 : scale; + + createFilmstrip(); + } + + /** + * Sets up the filmstrip effect + */ + private function createFilmstrip():void + { + // Resize the source to the set scale + sourceMatrix.scale(1 / scale, 1 / scale); + + // Create an array of bitmaps to store the delayed frames + total = scale * scale; + filmstrip = new Array(); + for (var i:int = total; i--; ) + { + var b:BitmapData = new BitmapData(rect.width / scale, rect.height / scale, false, 0xFF000000); + b.draw(source, sourceMatrix, color, null, null, true); + filmstrip.push(b); + } + } + + /** + * Draws the filmstrip effect + */ + override public function draw():void + { + // Loop through all the delayed frames + targetBitmap.lock(); + for (var i:int = total; i--; ) + { + var b:BitmapData = filmstrip[i]; + if (i == 0) b.draw(source, sourceMatrix, color); // Draw the source at a smaller size into frame 0 + else b.copyPixels(filmstrip[i - 1], b.rect, point); // Move the other frames along the array + targetBitmap.copyPixels(b, b.rect, new Point((scale - (i % scale) - 1) * rect.width / scale, int(i / scale) * rect.height / scale)); // Draw this frame in position + } + targetBitmap.unlock(); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the filmstrip bitmaps + for (var i:int = total; i--; ) + { + filmstrip[i].dispose(); + filmstrip[i] = null; + } + filmstrip = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/delay/GhostEffect.as b/webcam/com/neave/webcam/effects/delay/GhostEffect.as index 35c5787..1dd1c5a 100755..100644 --- a/webcam/com/neave/webcam/effects/delay/GhostEffect.as +++ b/webcam/com/neave/webcam/effects/delay/GhostEffect.as @@ -1,89 +1,89 @@ -/**
- * Neave Webcam // Ghost Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class GhostEffect extends AbstractEffect
- {
- private var frames:int;
- private var ghostBitmaps:Array;
-
- /**
- * Creates a ghost effect where the source image is delayed then blended with the current image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frames The number of frames to delay the ghost image by
- */
- public function GhostEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30)
- {
- super(source, targetBitmap, "Ghost");
- this.frames = frames < 2 ? 2 : frames;
-
- createGhost();
- }
-
- /**
- * Sets up the ghost effect
- */
- private function createGhost():void
- {
- // Create an array of bitmaps to store the delayed frames
- ghostBitmaps = new Array();
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = sourceBitmap.clone();
- b.draw(source, null, color, null, null, true); // Start with the current source image
- ghostBitmaps.push(b);
- }
- }
-
- /**
- * Draws the ghost effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through all the delayed frames
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = ghostBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, rect, point); // Draw the current source image into frame 0
- else b.copyPixels(ghostBitmaps[i - 1], rect, point); // Move the other frames along the array
- }
-
- // Blend the final delayed frame with the current source image
- sourceBitmap.merge(ghostBitmaps[frames - 1], rect, point, 128, 128, 128, 0);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
-
- /**
- * Removes the ghost effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = frames; i--; )
- {
- ghostBitmaps[i].dispose();
- ghostBitmaps[i] = null;
- }
- ghostBitmaps = null;
- }
- }
+/** + * Neave Webcam // Ghost Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class GhostEffect extends AbstractEffect + { + private var frames:int; + private var ghostBitmaps:Array; + + /** + * Creates a ghost effect where the source image is delayed then blended with the current image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frames The number of frames to delay the ghost image by + */ + public function GhostEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30) + { + super(source, targetBitmap, "Ghost"); + this.frames = frames < 2 ? 2 : frames; + + createGhost(); + } + + /** + * Sets up the ghost effect + */ + private function createGhost():void + { + // Create an array of bitmaps to store the delayed frames + ghostBitmaps = new Array(); + for (var i:int = frames; i--; ) + { + var b:BitmapData = sourceBitmap.clone(); + b.draw(source, null, color, null, null, true); // Start with the current source image + ghostBitmaps.push(b); + } + } + + /** + * Draws the ghost effect + */ + override public function draw():void + { + super.draw(); + + // Loop through all the delayed frames + for (var i:int = frames; i--; ) + { + var b:BitmapData = ghostBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, rect, point); // Draw the current source image into frame 0 + else b.copyPixels(ghostBitmaps[i - 1], rect, point); // Move the other frames along the array + } + + // Blend the final delayed frame with the current source image + sourceBitmap.merge(ghostBitmaps[frames - 1], rect, point, 128, 128, 128, 0); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + + /** + * Removes the ghost effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = frames; i--; ) + { + ghostBitmaps[i].dispose(); + ghostBitmaps[i] = null; + } + ghostBitmaps = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/delay/SlitScanEffect.as b/webcam/com/neave/webcam/effects/delay/SlitScanEffect.as index 37eb00c..5ac81b2 100755..100644 --- a/webcam/com/neave/webcam/effects/delay/SlitScanEffect.as +++ b/webcam/com/neave/webcam/effects/delay/SlitScanEffect.as @@ -1,178 +1,178 @@ -/**
- * Neave Webcam // Slit Scan Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class SlitScanEffect extends AbstractEffect
- {
- private const MAX_SLITS:int = 60;
-
- private var slitHeight:int;
- private var slitScale:Number;
- private var initScale:Number;
- private var total:int;
- private var slitBitmaps:Array;
- private var slitMatrix:Matrix;
- private var slitRect:Rectangle;
- private var halfBitmap:BitmapData;
- private var topMatrix:Matrix;
- private var bottomPoint:Point;
- private var moveUp:Boolean;
- private var midX:Number;
-
- /**
- * Creates a slit scan effect, similar to the final scene in 2001: A Space Odyssey
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param slitHeight The height of the slit to capture in pixels
- * @param slitScale How much to increase the size of each slit by
- * @param initScale The scale of the first slit
- */
- public function SlitScanEffect(source:IBitmapDrawable, targetBitmap:BitmapData, slitHeight:int = 1, slitScale:Number = 1.125, initScale:Number = 0.25)
- {
- super(source, targetBitmap, "Slit Scan");
- this.slitHeight = slitHeight < 1 ? 1 : slitHeight;
- this.slitScale = slitScale < 0.1 ? 0.1 : slitScale;
- this.initScale = initScale < 0.1 ? 0.1 : initScale;
-
- createSlitScan();
- }
-
- /**
- * Sets up the slit scan effect
- */
- private function createSlitScan():void
- {
- // Slit dimensions
- slitMatrix = new Matrix();
- slitRect = new Rectangle(0, 0, rect.width, slitHeight);
-
- // Create a half-sized bitmap to contain all the slit scans
- halfBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- topMatrix = new Matrix(1, 0, 0, -1, 0, halfBitmap.height);
- bottomPoint = new Point(0, halfBitmap.height);
-
- // Create an array of bitmaps to store the slits
- slitBitmaps = new Array();
- setTotal();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width, slitHeight, false, 0xFF000000);
- b.draw(source, null, color, null, slitRect, true); // Start with the current source image
- slitBitmaps.push(b);
- }
-
- // Other variables
- moveUp = false;
- midX = rect.width / 2 / initScale - rect.width / 2;
- }
-
- /**
- * Calculates the total number of slits needed to cover the half-sized bitmap
- */
- private function setTotal():void
- {
- total = 0;
- var size:Number = slitHeight * initScale;
- var lastSize:Number = size;
-
- // Loop through the slit sizes, increasing in height until the size is bigger than the bitmap height
- while (size < halfBitmap.height && total < MAX_SLITS)
- {
- var nextSize:Number = lastSize * slitScale;
- lastSize = nextSize;
- size += nextSize;
- total++;
- }
- }
-
- /**
- * Moves the slit position up or down the source image
- */
- private function moveSlit():void
- {
- if (moveUp)
- {
- // Moving up or reversing direction
- if (slitRect.top > 1) slitRect.offset(0, -slitHeight);
- else moveUp = false;
- }
- else
- {
- // Moving down or reversing direction
- if (slitRect.top < rect.height - slitHeight - 1) slitRect.offset(0, slitHeight);
- else moveUp = true;
- }
- }
-
- /**
- * Draw the slit scan effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Move the slit up or down
- moveSlit();
-
- // Set slit to initial position and size
- slitMatrix.identity();
- slitMatrix.tx = midX;
- slitMatrix.scale(initScale, initScale);
-
- // Draw each slit
- for (var i:int = total; i--; )
- {
- // Draw or move each slit along the array
- var b:BitmapData = slitBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, slitRect, point); // Draw the current source image into slit 0
- else b.copyPixels(slitBitmaps[i - 1], b.rect, point); // Move the other slits along the array
-
- // Scale each slit up and position in the middle
- slitMatrix.scale(slitScale, slitScale);
- slitMatrix.translate(rect.width / 2 * (1 - slitScale), slitHeight * initScale);
-
- // Draw this new slit into the main half-size bitmap
- halfBitmap.draw(slitBitmaps[total - i - 1], slitMatrix, null, null, null, true);
- }
-
- // Draw the half-size bitmaps into the top and bottom
- targetBitmap.lock();
- targetBitmap.draw(halfBitmap, topMatrix);
- targetBitmap.copyPixels(halfBitmap, halfBitmap.rect, bottomPoint);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the slit scan effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = total; i--; )
- {
- slitBitmaps[i].dispose();
- slitBitmaps[i] = null;
- }
- slitBitmaps = null;
-
- halfBitmap.dispose();
- halfBitmap = null;
- }
- }
+/** + * Neave Webcam // Slit Scan Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class SlitScanEffect extends AbstractEffect + { + private const MAX_SLITS:int = 60; + + private var slitHeight:int; + private var slitScale:Number; + private var initScale:Number; + private var total:int; + private var slitBitmaps:Array; + private var slitMatrix:Matrix; + private var slitRect:Rectangle; + private var halfBitmap:BitmapData; + private var topMatrix:Matrix; + private var bottomPoint:Point; + private var moveUp:Boolean; + private var midX:Number; + + /** + * Creates a slit scan effect, similar to the final scene in 2001: A Space Odyssey + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param slitHeight The height of the slit to capture in pixels + * @param slitScale How much to increase the size of each slit by + * @param initScale The scale of the first slit + */ + public function SlitScanEffect(source:IBitmapDrawable, targetBitmap:BitmapData, slitHeight:int = 1, slitScale:Number = 1.125, initScale:Number = 0.25) + { + super(source, targetBitmap, "Slit Scan"); + this.slitHeight = slitHeight < 1 ? 1 : slitHeight; + this.slitScale = slitScale < 0.1 ? 0.1 : slitScale; + this.initScale = initScale < 0.1 ? 0.1 : initScale; + + createSlitScan(); + } + + /** + * Sets up the slit scan effect + */ + private function createSlitScan():void + { + // Slit dimensions + slitMatrix = new Matrix(); + slitRect = new Rectangle(0, 0, rect.width, slitHeight); + + // Create a half-sized bitmap to contain all the slit scans + halfBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + topMatrix = new Matrix(1, 0, 0, -1, 0, halfBitmap.height); + bottomPoint = new Point(0, halfBitmap.height); + + // Create an array of bitmaps to store the slits + slitBitmaps = new Array(); + setTotal(); + for (var i:int = total; i--; ) + { + var b:BitmapData = new BitmapData(rect.width, slitHeight, false, 0xFF000000); + b.draw(source, null, color, null, slitRect, true); // Start with the current source image + slitBitmaps.push(b); + } + + // Other variables + moveUp = false; + midX = rect.width / 2 / initScale - rect.width / 2; + } + + /** + * Calculates the total number of slits needed to cover the half-sized bitmap + */ + private function setTotal():void + { + total = 0; + var size:Number = slitHeight * initScale; + var lastSize:Number = size; + + // Loop through the slit sizes, increasing in height until the size is bigger than the bitmap height + while (size < halfBitmap.height && total < MAX_SLITS) + { + var nextSize:Number = lastSize * slitScale; + lastSize = nextSize; + size += nextSize; + total++; + } + } + + /** + * Moves the slit position up or down the source image + */ + private function moveSlit():void + { + if (moveUp) + { + // Moving up or reversing direction + if (slitRect.top > 1) slitRect.offset(0, -slitHeight); + else moveUp = false; + } + else + { + // Moving down or reversing direction + if (slitRect.top < rect.height - slitHeight - 1) slitRect.offset(0, slitHeight); + else moveUp = true; + } + } + + /** + * Draw the slit scan effect + */ + override public function draw():void + { + super.draw(); + + // Move the slit up or down + moveSlit(); + + // Set slit to initial position and size + slitMatrix.identity(); + slitMatrix.tx = midX; + slitMatrix.scale(initScale, initScale); + + // Draw each slit + for (var i:int = total; i--; ) + { + // Draw or move each slit along the array + var b:BitmapData = slitBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, slitRect, point); // Draw the current source image into slit 0 + else b.copyPixels(slitBitmaps[i - 1], b.rect, point); // Move the other slits along the array + + // Scale each slit up and position in the middle + slitMatrix.scale(slitScale, slitScale); + slitMatrix.translate(rect.width / 2 * (1 - slitScale), slitHeight * initScale); + + // Draw this new slit into the main half-size bitmap + halfBitmap.draw(slitBitmaps[total - i - 1], slitMatrix, null, null, null, true); + } + + // Draw the half-size bitmaps into the top and bottom + targetBitmap.lock(); + targetBitmap.draw(halfBitmap, topMatrix); + targetBitmap.copyPixels(halfBitmap, halfBitmap.rect, bottomPoint); + targetBitmap.unlock(); + } + + /** + * Removes the slit scan effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = total; i--; ) + { + slitBitmaps[i].dispose(); + slitBitmaps[i] = null; + } + slitBitmaps = null; + + halfBitmap.dispose(); + halfBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/delay/TrailEffect.as b/webcam/com/neave/webcam/effects/delay/TrailEffect.as index 41a9c91..725b0ac 100755..100644 --- a/webcam/com/neave/webcam/effects/delay/TrailEffect.as +++ b/webcam/com/neave/webcam/effects/delay/TrailEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Trail Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import com.neave.webcam.effects.*;
-
- public class TrailEffect extends AbstractEffect
- {
- private var fade:uint;
- private var whiteBitmap:BitmapData;
-
- /**
- * Creates a trail effect by smearing and fading out movement
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param fade The amount to fade out the trail by each frame, the higher the faster
- */
- public function TrailEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fade:uint = 8)
- {
- super(source, targetBitmap, "Trail");
- this.fade = fade > 0xFF ? 0xFF: fade;
-
- createTrail();
- }
-
- /**
- * Sets up the trail effect
- */
- private function createTrail():void
- {
- whiteBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFFFFFF); // White bitmap for fading out the trail
- targetBitmap.draw(source, null, color, null, null, true); // Start with the current source image
- }
-
- /**
- * Draws the trail effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.lock();
- targetBitmap.merge(whiteBitmap, rect, point, fade, fade, fade, 0); // Repeatedly fade out the image
- targetBitmap.draw(sourceBitmap, null, null, BlendMode.DARKEN); // Blend the new source image with the old one
- targetBitmap.unlock();
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- whiteBitmap.dispose();
- whiteBitmap = null;
- }
- }
+/** + * Neave Webcam // Trail Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import com.neave.webcam.effects.*; + + public class TrailEffect extends AbstractEffect + { + private var fade:uint; + private var whiteBitmap:BitmapData; + + /** + * Creates a trail effect by smearing and fading out movement + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param fade The amount to fade out the trail by each frame, the higher the faster + */ + public function TrailEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fade:uint = 8) + { + super(source, targetBitmap, "Trail"); + this.fade = fade > 0xFF ? 0xFF: fade; + + createTrail(); + } + + /** + * Sets up the trail effect + */ + private function createTrail():void + { + whiteBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFFFFFF); // White bitmap for fading out the trail + targetBitmap.draw(source, null, color, null, null, true); // Start with the current source image + } + + /** + * Draws the trail effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.lock(); + targetBitmap.merge(whiteBitmap, rect, point, fade, fade, fade, 0); // Repeatedly fade out the image + targetBitmap.draw(sourceBitmap, null, null, BlendMode.DARKEN); // Blend the new source image with the old one + targetBitmap.unlock(); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + whiteBitmap.dispose(); + whiteBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/AbstractDisplaceEffect.as b/webcam/com/neave/webcam/effects/displace/AbstractDisplaceEffect.as index 89458ac..671d5e7 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/AbstractDisplaceEffect.as +++ b/webcam/com/neave/webcam/effects/displace/AbstractDisplaceEffect.as @@ -1,64 +1,64 @@ -/**
- * Neave Webcam // Abstract Displace Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractDisplaceEffect extends AbstractEffect
- {
- protected var displace:DisplacementMapFilter;
-
- /**
- * An abstract displacement effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractDisplaceEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- super(source, targetBitmap, name);
-
- createAbstractDisplace();
- }
-
- /**
- * Sets up the displacement effect
- */
- private function createAbstractDisplace():void
- {
- // Create a displacement map filter with grey bitmap data, using red to distort horizontally, green to distort vertically
- displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 0, 0, DisplacementMapFilterMode.CLAMP);
- }
-
- /**
- * Draws the displacement effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, displace);
- }
-
- /**
- * Removes the displacement effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- displace.mapBitmap.dispose();
- displace = null;
- }
- }
+/** + * Neave Webcam // Abstract Displace Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import com.neave.webcam.effects.*; + + internal class AbstractDisplaceEffect extends AbstractEffect + { + protected var displace:DisplacementMapFilter; + + /** + * An abstract displacement effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractDisplaceEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + super(source, targetBitmap, name); + + createAbstractDisplace(); + } + + /** + * Sets up the displacement effect + */ + private function createAbstractDisplace():void + { + // Create a displacement map filter with grey bitmap data, using red to distort horizontally, green to distort vertically + displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 0, 0, DisplacementMapFilterMode.CLAMP); + } + + /** + * Draws the displacement effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, displace); + } + + /** + * Removes the displacement effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + displace.mapBitmap.dispose(); + displace = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/BulgeEffect.as b/webcam/com/neave/webcam/effects/displace/BulgeEffect.as index d2c1ac2..919f7a7 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/BulgeEffect.as +++ b/webcam/com/neave/webcam/effects/displace/BulgeEffect.as @@ -1,74 +1,74 @@ -/**
- * Neave Webcam // Bulge Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class BulgeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a bulge effect that pushes the centre of the image outwards
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function BulgeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Bulge");
-
- createBulge();
- }
-
- /**
- * Sets up the bulge effect
- */
- private function createBulge():void
- {
- // The size of the bulge, one quarter the size of the source image
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round((w + h) / 4);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, size, size);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, size, size);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, size, size);
-
- // Draw all the gradients into one displacement map bitmap
- var mapMatrix:Matrix = new Matrix();
- mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2);
- displace.mapBitmap.draw(red, mapMatrix);
- displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover, mapMatrix);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Bulge Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class BulgeEffect extends AbstractDisplaceEffect + { + /** + * Creates a bulge effect that pushes the centre of the image outwards + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function BulgeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Bulge"); + + createBulge(); + } + + /** + * Sets up the bulge effect + */ + private function createBulge():void + { + // The size of the bulge, one quarter the size of the source image + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round((w + h) / 4); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, size, size); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, size, size); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, size, size); + + // Draw all the gradients into one displacement map bitmap + var mapMatrix:Matrix = new Matrix(); + mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2); + displace.mapBitmap.draw(red, mapMatrix); + displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD); + displace.mapBitmap.draw(cover, mapMatrix); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/DentEffect.as b/webcam/com/neave/webcam/effects/displace/DentEffect.as index c701146..2905693 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/DentEffect.as +++ b/webcam/com/neave/webcam/effects/displace/DentEffect.as @@ -1,75 +1,75 @@ -/**
- * Neave Webcam // Dent Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class DentEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a dent effect that pinches the centre of the image inwards
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function DentEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Dent");
-
- createDent();
- }
-
- /**
- * Sets up the dent effect
- */
- private function createDent():void
- {
- // The size of the dent, one quarter the size of the source image
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round((w + h) / 4);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, size, size);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, size, size);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, size, size);
-
- // Draw all the gradients into one displacement map bitmap
- var mapMatrix:Matrix = new Matrix();
- mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2);
- displace.mapBitmap.draw(red, mapMatrix);
- displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover, mapMatrix);
-
- // Double up the grey cover for a greater dent size
- displace.mapBitmap.draw(cover, mapMatrix);
- displace.scaleX = displace.scaleY = size * 2;
- }
- }
+/** + * Neave Webcam // Dent Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class DentEffect extends AbstractDisplaceEffect + { + /** + * Creates a dent effect that pinches the centre of the image inwards + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function DentEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Dent"); + + createDent(); + } + + /** + * Sets up the dent effect + */ + private function createDent():void + { + // The size of the dent, one quarter the size of the source image + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round((w + h) / 4); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, size, size); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, size, size); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, size, size); + + // Draw all the gradients into one displacement map bitmap + var mapMatrix:Matrix = new Matrix(); + mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2); + displace.mapBitmap.draw(red, mapMatrix); + displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD); + displace.mapBitmap.draw(cover, mapMatrix); + + // Double up the grey cover for a greater dent size + displace.mapBitmap.draw(cover, mapMatrix); + displace.scaleX = displace.scaleY = size * 2; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/FishbowlEffect.as b/webcam/com/neave/webcam/effects/displace/FishbowlEffect.as index 08f5d08..50ffe2c 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/FishbowlEffect.as +++ b/webcam/com/neave/webcam/effects/displace/FishbowlEffect.as @@ -1,72 +1,72 @@ -/**
- * Neave Webcam // Fishbowl Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FishbowlEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a fishbowl effect like looking into a fishbowl, the opposite of the fisheye effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FishbowlEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fishbowl");
-
- createFishbowl();
- }
-
- /**
- * Sets up the fishbowl effect
- */
- private function createFishbowl():void
- {
- // The size of the fishbowl effect
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round(Math.sqrt((w / 2) * (w / 2) + (h / 2) * (h / 2)) * 2);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, w, h);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, h);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, h);
-
- // Draw all the gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Fishbowl Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FishbowlEffect extends AbstractDisplaceEffect + { + /** + * Creates a fishbowl effect like looking into a fishbowl, the opposite of the fisheye effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FishbowlEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fishbowl"); + + createFishbowl(); + } + + /** + * Sets up the fishbowl effect + */ + private function createFishbowl():void + { + // The size of the fishbowl effect + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round(Math.sqrt((w / 2) * (w / 2) + (h / 2) * (h / 2)) * 2); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, w, h); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, h); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, h); + + // Draw all the gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + displace.mapBitmap.draw(cover); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/FisheyeEffect.as b/webcam/com/neave/webcam/effects/displace/FisheyeEffect.as index 1d4cf4a..1ec5d66 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/FisheyeEffect.as +++ b/webcam/com/neave/webcam/effects/displace/FisheyeEffect.as @@ -1,72 +1,72 @@ -/**
- * Neave Webcam // Fisheye Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FisheyeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a fisheye (wide-angle) lens effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FisheyeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fisheye");
-
- createFisheye();
- }
-
- /**
- * Sets up the fisheye effect
- */
- private function createFisheye():void
- {
- // The size of the fisheye effect
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = (w + h) / 2;
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m, SpreadMethod.REFLECT);
- cover.graphics.drawRect(0, 0, w, h);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, h);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, h);
-
- // Draw all the gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Fisheye Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FisheyeEffect extends AbstractDisplaceEffect + { + /** + * Creates a fisheye (wide-angle) lens effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FisheyeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fisheye"); + + createFisheye(); + } + + /** + * Sets up the fisheye effect + */ + private function createFisheye():void + { + // The size of the fisheye effect + var w:int = rect.width; + var h:int = rect.height; + var size:int = (w + h) / 2; + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m, SpreadMethod.REFLECT); + cover.graphics.drawRect(0, 0, w, h); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, h); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, h); + + // Draw all the gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + displace.mapBitmap.draw(cover); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/FragmentEffect.as b/webcam/com/neave/webcam/effects/displace/FragmentEffect.as index e058dd9..773a350 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/FragmentEffect.as +++ b/webcam/com/neave/webcam/effects/displace/FragmentEffect.as @@ -1,101 +1,101 @@ -/**
- * Neave Webcam // Fragment Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class FragmentEffect extends AbstractEffect
- {
- private var fragmentsWide:int;
- private var scale:Number;
- private var total:int;
- private var fragmentBitmap:BitmapData;
- private var fragmentMatrix:Matrix;
- private var fragmentRects:Array;
- private var fragmentPoints:Array;
-
- /**
- * Creates a fragmentary effect where the image is divided into a grid of smaller zoomed areas
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param fragmentsWide The number of fragments in width to use
- * @param scale The size of the zoom for each fragment
- */
- public function FragmentEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fragmentsWide:int = 10, scale:Number = 0.5)
- {
- super(source, targetBitmap, "Fragment");
- this.fragmentsWide = fragmentsWide < 1 ? 1 : fragmentsWide;
- this.scale = scale;
- if (scale > 2) this.scale = 2;
- if (scale < 0.5) this.scale = 0.5;
-
- createFragment();
- }
-
- /**
- * Sets up the fragment effect
- */
- private function createFragment():void
- {
- // The fragment dimensions
- var w:Number = rect.width / fragmentsWide;
- var h:Number = rect.height / fragmentsWide;
-
- // Set up the main fragment bitmap data and scaling properties
- fragmentBitmap = new BitmapData(rect.width * scale, rect.height * scale, false, 0xFF000000);
- fragmentMatrix = new Matrix();
- fragmentMatrix.scale(1 / scale, 1 / scale);
- fragmentRects = new Array();
- fragmentPoints = new Array();
-
- // Set up each fragment's area and position
- for (var y:int = 0; y < fragmentsWide; y++)
- {
- for (var x:int = 0; x < fragmentsWide; x++)
- {
- fragmentRects.push(new Rectangle(x * w, y * h, w * scale, h * scale));
- fragmentPoints.push(new Point(x * w * scale, y * h * scale));
- }
- }
- total = fragmentsWide * fragmentsWide;
- }
-
- /**
- * Draws the fragment effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each fragment and draw the zoomed area
- for (var i:int = total; i--; ) fragmentBitmap.copyPixels(sourceBitmap, fragmentRects[i], fragmentPoints[i]);
-
- // Draw the fragment bitmap data into the target bitmap data but scaled to fit
- targetBitmap.draw(fragmentBitmap, fragmentMatrix, null, null, null, true);
- }
-
- /**
- * Removes the fragment effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- fragmentBitmap.dispose();
- fragmentBitmap = null;
- fragmentRects = null;
- fragmentPoints = null;
- }
- }
+/** + * Neave Webcam // Fragment Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class FragmentEffect extends AbstractEffect + { + private var fragmentsWide:int; + private var scale:Number; + private var total:int; + private var fragmentBitmap:BitmapData; + private var fragmentMatrix:Matrix; + private var fragmentRects:Array; + private var fragmentPoints:Array; + + /** + * Creates a fragmentary effect where the image is divided into a grid of smaller zoomed areas + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param fragmentsWide The number of fragments in width to use + * @param scale The size of the zoom for each fragment + */ + public function FragmentEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fragmentsWide:int = 10, scale:Number = 0.5) + { + super(source, targetBitmap, "Fragment"); + this.fragmentsWide = fragmentsWide < 1 ? 1 : fragmentsWide; + this.scale = scale; + if (scale > 2) this.scale = 2; + if (scale < 0.5) this.scale = 0.5; + + createFragment(); + } + + /** + * Sets up the fragment effect + */ + private function createFragment():void + { + // The fragment dimensions + var w:Number = rect.width / fragmentsWide; + var h:Number = rect.height / fragmentsWide; + + // Set up the main fragment bitmap data and scaling properties + fragmentBitmap = new BitmapData(rect.width * scale, rect.height * scale, false, 0xFF000000); + fragmentMatrix = new Matrix(); + fragmentMatrix.scale(1 / scale, 1 / scale); + fragmentRects = new Array(); + fragmentPoints = new Array(); + + // Set up each fragment's area and position + for (var y:int = 0; y < fragmentsWide; y++) + { + for (var x:int = 0; x < fragmentsWide; x++) + { + fragmentRects.push(new Rectangle(x * w, y * h, w * scale, h * scale)); + fragmentPoints.push(new Point(x * w * scale, y * h * scale)); + } + } + total = fragmentsWide * fragmentsWide; + } + + /** + * Draws the fragment effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each fragment and draw the zoomed area + for (var i:int = total; i--; ) fragmentBitmap.copyPixels(sourceBitmap, fragmentRects[i], fragmentPoints[i]); + + // Draw the fragment bitmap data into the target bitmap data but scaled to fit + targetBitmap.draw(fragmentBitmap, fragmentMatrix, null, null, null, true); + } + + /** + * Removes the fragment effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + fragmentBitmap.dispose(); + fragmentBitmap = null; + fragmentRects = null; + fragmentPoints = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/SqueezeEffect.as b/webcam/com/neave/webcam/effects/displace/SqueezeEffect.as index e702dc1..6818da1 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/SqueezeEffect.as +++ b/webcam/com/neave/webcam/effects/displace/SqueezeEffect.as @@ -1,87 +1,87 @@ -/**
- * Neave Webcam // Squeeze Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class SqueezeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a squeezing distortion effect where the middle is squeezed and the edges are stretched
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function SqueezeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Squeeze");
-
- createSqueeze();
- }
-
- /**
- * Sets up the squeeze effect
- */
- private function createSqueeze():void
- {
- // The size of the squeeze effect
- var w:int = rect.width;
- var h:int = rect.height;
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- m.createGradientBox(w, w);
- cover.graphics.beginGradientFill(GradientType.LINEAR, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, w, w);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- m.createGradientBox(h, h, 0, (w - h) / 2, 0);
- red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, w);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.createGradientBox(h, h, Math.PI / 2, (w - h) / 2, 0);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, w);
-
- // Draw red and green gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
-
- // Fade out the edges of the distorion linearly in each direction, up, down, left and right
- m.identity();
- m.scale(0.5, 1);
- displace.mapBitmap.draw(cover, m);
- m.rotate(Math.PI);
- m.translate(w, h);
- displace.mapBitmap.draw(cover, m);
- m.identity();
- m.scale(h / w / 2, 1);
- m.rotate(Math.PI / 2);
- m.translate(w, 0);
- displace.mapBitmap.draw(cover, m);
- m.rotate(Math.PI);
- m.translate(w, h);
- displace.mapBitmap.draw(cover, m);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = w;
- }
- }
+/** + * Neave Webcam // Squeeze Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class SqueezeEffect extends AbstractDisplaceEffect + { + /** + * Creates a squeezing distortion effect where the middle is squeezed and the edges are stretched + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function SqueezeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Squeeze"); + + createSqueeze(); + } + + /** + * Sets up the squeeze effect + */ + private function createSqueeze():void + { + // The size of the squeeze effect + var w:int = rect.width; + var h:int = rect.height; + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + m.createGradientBox(w, w); + cover.graphics.beginGradientFill(GradientType.LINEAR, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, w, w); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + m.createGradientBox(h, h, 0, (w - h) / 2, 0); + red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, w); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.createGradientBox(h, h, Math.PI / 2, (w - h) / 2, 0); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, w); + + // Draw red and green gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + + // Fade out the edges of the distorion linearly in each direction, up, down, left and right + m.identity(); + m.scale(0.5, 1); + displace.mapBitmap.draw(cover, m); + m.rotate(Math.PI); + m.translate(w, h); + displace.mapBitmap.draw(cover, m); + m.identity(); + m.scale(h / w / 2, 1); + m.rotate(Math.PI / 2); + m.translate(w, 0); + displace.mapBitmap.draw(cover, m); + m.rotate(Math.PI); + m.translate(w, h); + displace.mapBitmap.draw(cover, m); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = w; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/displace/WaterEffect.as b/webcam/com/neave/webcam/effects/displace/WaterEffect.as index 4f45d72..6f4abb0 100755..100644 --- a/webcam/com/neave/webcam/effects/displace/WaterEffect.as +++ b/webcam/com/neave/webcam/effects/displace/WaterEffect.as @@ -1,76 +1,76 @@ -/**
- * Neave Webcam // Water Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class WaterEffect extends AbstractDisplaceEffect
- {
- private var seed:int;
- private var offsets:Array;
- private var blue:ColorMatrixFilter;
-
- /**
- * Creates a water effect as if you were looking into a pool of waving water
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function WaterEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Water");
-
- createWater();
- }
-
- /**
- * Sets up the water effect
- */
- private function createWater():void
- {
- // Set up the displacement
- displace.scaleX = rect.width * 0.25;
- displace.scaleY = rect.height * 0.25;
- seed = Math.floor(Math.random() * 256);
- offsets = new Array(new Point(), new Point());
-
- // Blue colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, -10]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 30]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 70]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- blue = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the water effect
- */
- override public function draw():void
- {
- // Wave the water by moving the displacement map's offsets
- offsets[0].x += rect.width * 0.06;
- offsets[1].x += rect.height * 0.06;
-
- // Generate perlin noise as a displacement map to make water waves
- displace.mapBitmap.perlinNoise(rect.width * 0.5, rect.height * 0.5, 1, seed, false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false, offsets);
-
- // Draw the displaced image and tint it blue
- targetBitmap.lock();
- super.draw();
- targetBitmap.applyFilter(targetBitmap, rect, point, blue);
- targetBitmap.unlock();
- }
- }
+/** + * Neave Webcam // Water Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class WaterEffect extends AbstractDisplaceEffect + { + private var seed:int; + private var offsets:Array; + private var blue:ColorMatrixFilter; + + /** + * Creates a water effect as if you were looking into a pool of waving water + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function WaterEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Water"); + + createWater(); + } + + /** + * Sets up the water effect + */ + private function createWater():void + { + // Set up the displacement + displace.scaleX = rect.width * 0.25; + displace.scaleY = rect.height * 0.25; + seed = Math.floor(Math.random() * 256); + offsets = new Array(new Point(), new Point()); + + // Blue colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, -10]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 30]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 70]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + blue = new ColorMatrixFilter(m); + } + + /** + * Draws the water effect + */ + override public function draw():void + { + // Wave the water by moving the displacement map's offsets + offsets[0].x += rect.width * 0.06; + offsets[1].x += rect.height * 0.06; + + // Generate perlin noise as a displacement map to make water waves + displace.mapBitmap.perlinNoise(rect.width * 0.5, rect.height * 0.5, 1, seed, false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false, offsets); + + // Draw the displaced image and tint it blue + targetBitmap.lock(); + super.draw(); + targetBitmap.applyFilter(targetBitmap, rect, point, blue); + targetBitmap.unlock(); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/AbstractMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/AbstractMirrorEffect.as index 57008f7..decb011 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/AbstractMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/AbstractMirrorEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Abstract Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractMirrorEffect extends AbstractEffect
- {
- protected var mirrorBitmap:BitmapData;
- protected var mirrorMatrix:Matrix;
- protected var mirrorPoint:Point;
-
- /**
- * An abstract mirror effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- super(source, targetBitmap, name);
-
- createAbstractMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createAbstractMirror():void
- {
- mirrorMatrix = new Matrix();
- mirrorPoint = new Point();
- }
-
- /**
- * Draws the mirror effect
- */
- override public function draw():void
- {
- super.draw();
- mirrorBitmap.draw(sourceBitmap, mirrorMatrix);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint);
- }
-
- /**
- * Removes the mirror effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- mirrorBitmap.dispose();
- mirrorBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + internal class AbstractMirrorEffect extends AbstractEffect + { + protected var mirrorBitmap:BitmapData; + protected var mirrorMatrix:Matrix; + protected var mirrorPoint:Point; + + /** + * An abstract mirror effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + super(source, targetBitmap, name); + + createAbstractMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createAbstractMirror():void + { + mirrorMatrix = new Matrix(); + mirrorPoint = new Point(); + } + + /** + * Draws the mirror effect + */ + override public function draw():void + { + super.draw(); + mirrorBitmap.draw(sourceBitmap, mirrorMatrix); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint); + } + + /** + * Removes the mirror effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + mirrorBitmap.dispose(); + mirrorBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/BottomMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/BottomMirrorEffect.as index 4bb7b07..5a3be79 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/BottomMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/BottomMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Bottom Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class BottomMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the bottom half of the image is reflected into the top half
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function BottomMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Bottom Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(1, -1);
- mirrorMatrix.translate(0, rect.height);
- mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Bottom Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class BottomMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the bottom half of the image is reflected into the top half + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function BottomMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Bottom Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(1, -1); + mirrorMatrix.translate(0, rect.height); + mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/InverseMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/InverseMirrorEffect.as index 8f0da4c..982f6bc 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/InverseMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/InverseMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Inverse Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class InverseMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the top half of the image is inversed
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function InverseMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Inverse Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(rect.width, 0);
- mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Inverse Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class InverseMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the top half of the image is inversed + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function InverseMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Inverse Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(rect.width, 0); + mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/LeftMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/LeftMirrorEffect.as index 31cc510..912a96c 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/LeftMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/LeftMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Left Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class LeftMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the left side of the image is reflected into the right side (when using a flipped image)
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function LeftMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Left Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(rect.width, 0);
- mirrorBitmap = new BitmapData(Math.round(rect.width / 2), rect.height, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Left Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class LeftMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the left side of the image is reflected into the right side (when using a flipped image) + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function LeftMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Left Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(rect.width, 0); + mirrorBitmap = new BitmapData(Math.round(rect.width / 2), rect.height, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/QuadMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/QuadMirrorEffect.as index d4e84a4..5c1442a 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/QuadMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/QuadMirrorEffect.as @@ -1,97 +1,97 @@ -/**
- * Neave Webcam // Quad Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class QuadMirrorEffect extends AbstractEffect
- {
- private var quadBitmap:BitmapData;
- private var halfBitmap:BitmapData;
- private var quadMatrix:Matrix;
- private var rightMatrix:Matrix;
- private var topMatrix:Matrix;
- private var bottomMatrix:Matrix;
-
- /**
- * Creates a mirror effect where the source image is reflected vertically and horizontally
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function QuadMirrorEffect(source:IBitmapDrawable, targetBitmapData:BitmapData)
- {
- super(source, targetBitmapData, "Quad Mirror");
-
- createQuadMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createQuadMirror():void
- {
- // Mirror dimensions
- var midW:int = Math.round(rect.width / 2);
- var midH:int = Math.round(rect.height / 2);
-
- // Reflected bitmap data
- quadBitmap = new BitmapData(midW, midH, false, 0xFF000000);
- halfBitmap = new BitmapData(rect.width, midH, false, 0xFF000000);
-
- // Half size matrix
- quadMatrix = new Matrix();
- quadMatrix.scale(0.5, 0.5);
-
- // Right side matrix
- rightMatrix = new Matrix();
- rightMatrix.scale(-1, 1);
- rightMatrix.translate(rect.width, 0);
-
- // Top half matrix
- topMatrix = new Matrix();
- topMatrix.scale(1, -1);
- topMatrix.translate(0, midH);
-
- // Bottom half matrix
- bottomMatrix = new Matrix();
- bottomMatrix.translate(0, midH);
- }
-
- /**
- * Draws the quad mirror effect
- */
- override public function draw():void
- {
- super.draw();
- quadBitmap.draw(sourceBitmap, quadMatrix); // Draw quarter image
- halfBitmap.draw(quadBitmap); // Draw quarter into left
- halfBitmap.draw(quadBitmap, rightMatrix); // Draw quarter into right
- targetBitmap.draw(halfBitmap, bottomMatrix); // Draw half into bottom
- targetBitmap.draw(halfBitmap, topMatrix); // Draw half into top
- }
-
- /**
- * Removes the quad mirror effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- quadBitmap.dispose();
- quadBitmap = null;
- halfBitmap.dispose();
- halfBitmap = null;
- }
- }
+/** + * Neave Webcam // Quad Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class QuadMirrorEffect extends AbstractEffect + { + private var quadBitmap:BitmapData; + private var halfBitmap:BitmapData; + private var quadMatrix:Matrix; + private var rightMatrix:Matrix; + private var topMatrix:Matrix; + private var bottomMatrix:Matrix; + + /** + * Creates a mirror effect where the source image is reflected vertically and horizontally + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function QuadMirrorEffect(source:IBitmapDrawable, targetBitmapData:BitmapData) + { + super(source, targetBitmapData, "Quad Mirror"); + + createQuadMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createQuadMirror():void + { + // Mirror dimensions + var midW:int = Math.round(rect.width / 2); + var midH:int = Math.round(rect.height / 2); + + // Reflected bitmap data + quadBitmap = new BitmapData(midW, midH, false, 0xFF000000); + halfBitmap = new BitmapData(rect.width, midH, false, 0xFF000000); + + // Half size matrix + quadMatrix = new Matrix(); + quadMatrix.scale(0.5, 0.5); + + // Right side matrix + rightMatrix = new Matrix(); + rightMatrix.scale(-1, 1); + rightMatrix.translate(rect.width, 0); + + // Top half matrix + topMatrix = new Matrix(); + topMatrix.scale(1, -1); + topMatrix.translate(0, midH); + + // Bottom half matrix + bottomMatrix = new Matrix(); + bottomMatrix.translate(0, midH); + } + + /** + * Draws the quad mirror effect + */ + override public function draw():void + { + super.draw(); + quadBitmap.draw(sourceBitmap, quadMatrix); // Draw quarter image + halfBitmap.draw(quadBitmap); // Draw quarter into left + halfBitmap.draw(quadBitmap, rightMatrix); // Draw quarter into right + targetBitmap.draw(halfBitmap, bottomMatrix); // Draw half into bottom + targetBitmap.draw(halfBitmap, topMatrix); // Draw half into top + } + + /** + * Removes the quad mirror effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + quadBitmap.dispose(); + quadBitmap = null; + halfBitmap.dispose(); + halfBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/RightMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/RightMirrorEffect.as index d469226..2df2a03 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/RightMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/RightMirrorEffect.as @@ -1,44 +1,44 @@ -/**
- * Neave Webcam // Right Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class RightMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the right side of the image is reflected into the left side (when using a flipped image)
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function RightMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Right Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- var midW:int = Math.round(rect.width / 2);
-
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(midW, 0);
- mirrorPoint.x = midW;
- mirrorBitmap = new BitmapData(midW, rect.height, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Right Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class RightMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the right side of the image is reflected into the left side (when using a flipped image) + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function RightMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Right Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + var midW:int = Math.round(rect.width / 2); + + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(midW, 0); + mirrorPoint.x = midW; + mirrorBitmap = new BitmapData(midW, rect.height, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/TopMirrorEffect.as b/webcam/com/neave/webcam/effects/mirror/TopMirrorEffect.as index af69612..a911b09 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/TopMirrorEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/TopMirrorEffect.as @@ -1,44 +1,44 @@ -/**
- * Neave Webcam // Top Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class TopMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the top half of the image is reflected into the bottom half
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function TopMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Top Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- var midH:int = Math.round(rect.height / 2);
-
- mirrorMatrix.scale(1, -1);
- mirrorMatrix.translate(0, midH);
- mirrorPoint.y = midH;
- mirrorBitmap = new BitmapData(rect.width, midH, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Top Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class TopMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the top half of the image is reflected into the bottom half + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function TopMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Top Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + var midH:int = Math.round(rect.height / 2); + + mirrorMatrix.scale(1, -1); + mirrorMatrix.translate(0, midH); + mirrorPoint.y = midH; + mirrorBitmap = new BitmapData(rect.width, midH, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/mirror/UpsideDownEffect.as b/webcam/com/neave/webcam/effects/mirror/UpsideDownEffect.as index 71e08d8..1b2bd9d 100755..100644 --- a/webcam/com/neave/webcam/effects/mirror/UpsideDownEffect.as +++ b/webcam/com/neave/webcam/effects/mirror/UpsideDownEffect.as @@ -1,54 +1,54 @@ -/**
- * Neave Webcam // Upside-Down Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class UpsideDownEffect extends AbstractEffect
- {
- private var flipMatrix:Matrix;
-
- /**
- * Creates a mirror effect where the source image is flipped vertically
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function UpsideDownEffect(source:IBitmapDrawable, targetBitmapData:BitmapData)
- {
- super(source, targetBitmapData, "Upside-Down");
-
- createUpsideDown();
- }
-
- /**
- * Sets up the upside-down effect
- */
- private function createUpsideDown():void
- {
- flipMatrix = new Matrix();
- flipMatrix.scale(1, -1);
- flipMatrix.translate(0, rect.height);
- }
-
- /**
- * Draws the upside-down effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.draw(sourceBitmap, flipMatrix);
- }
- }
+/** + * Neave Webcam // Upside-Down Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class UpsideDownEffect extends AbstractEffect + { + private var flipMatrix:Matrix; + + /** + * Creates a mirror effect where the source image is flipped vertically + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function UpsideDownEffect(source:IBitmapDrawable, targetBitmapData:BitmapData) + { + super(source, targetBitmapData, "Upside-Down"); + + createUpsideDown(); + } + + /** + * Sets up the upside-down effect + */ + private function createUpsideDown():void + { + flipMatrix = new Matrix(); + flipMatrix.scale(1, -1); + flipMatrix.translate(0, rect.height); + } + + /** + * Draws the upside-down effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.draw(sourceBitmap, flipMatrix); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/AbstractMotionEffect.as b/webcam/com/neave/webcam/effects/motion/AbstractMotionEffect.as index 3301a8a..37095ac 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/AbstractMotionEffect.as +++ b/webcam/com/neave/webcam/effects/motion/AbstractMotionEffect.as @@ -1,138 +1,138 @@ -/**
- * Neave Webcam // Abstract Motion Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractMotionEffect extends AbstractEffect
- {
- private var motionScale:int;
- private var motionFrames:int;
- private var contrast:ColorTransform;
- private var frames:Array;
- private var frameBitmap:BitmapData;
- protected var monochrome:ColorMatrixFilter;
- protected var motionBitmap:BitmapData;
- protected var motionRect:Rectangle;
- protected var motionMatrix:Matrix;
-
- /**
- * An abstract motion detection effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- * @param motionScale The scale of the motion bitmap data to use for detection
- * @param motionFrames The number of frames to capture for the motion bitmap data
- */
- public function AbstractMotionEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "", motionScale:int = 1, motionFrames:int = 4)
- {
- super(source, targetBitmap, name);
- this.motionScale = motionScale < 1 ? 1 : motionScale;
- this.motionFrames = motionFrames < 1 ? 1 : motionFrames;
-
- createAbstractMotion();
- }
-
- /**
- * Sets up the motion effect
- */
- private function createAbstractMotion():void
- {
- // Increase contrast
- contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Motion bitmap dimensions
- var w:int = Math.round(rect.width / motionScale);
- var h:int = Math.round(rect.height / motionScale);
-
- // Main motion bitmap data
- motionBitmap = new BitmapData(w, h, false, 0xFF000000);
- motionRect = motionBitmap.rect;
- motionMatrix = new Matrix();
- motionMatrix.scale(1 / motionScale, 1 / motionScale);
-
- // The previous frame to use when comparing with the current image
- frameBitmap = motionBitmap.clone();
- frameBitmap.draw(source, motionMatrix, contrast);
-
- // Create the delayed motion frames
- frames = new Array();
- for (var i:int = motionFrames; i--; ) frames.push(new BitmapData(w, h, false, 0xFF000000));
-
- // Monochrome colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- monochrome = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the motion effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Clear old motion bitmap
- motionBitmap.fillRect(motionRect, 0xFF000000);
-
- // Do motion detection
- for (var i:int = motionFrames; i--; )
- {
- var b:BitmapData = frames[i];
- if (i == 0)
- {
- // Detect motion by taking the difference between this source image to the previous source image
- b.copyPixels(frameBitmap, motionRect, point); // Get the old image
- frameBitmap.draw(sourceBitmap, motionMatrix, contrast); // Draw the new image
- frameBitmap.applyFilter(frameBitmap, motionRect, point, monochrome); // Convert the new image to greyscale
- b.draw(frameBitmap, null, null, BlendMode.DIFFERENCE); // Draw the difference
- }
- else b.copyPixels(frames[i - 1], motionRect, point); // Move the motion frames along the array
-
- // Add all the motion frames into a single bitmap
- motionBitmap.draw(b, null, null, BlendMode.ADD);
- }
-
- // Separate the motion bitmap data into only black and white pixels
- motionBitmap.threshold(motionBitmap, motionRect, point, ">", 0xFF808080, 0xFFFFFFFF);
- motionBitmap.threshold(motionBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000);
- }
-
- /**
- * Removes the motion effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the motion frames
- for (var i:int = motionFrames; i--; )
- {
- frames[i].dispose();
- frames[i] = null;
- }
- frames = null;
-
- frameBitmap.dispose();
- frameBitmap = null;
- motionBitmap.dispose();
- motionBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Motion Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + internal class AbstractMotionEffect extends AbstractEffect + { + private var motionScale:int; + private var motionFrames:int; + private var contrast:ColorTransform; + private var frames:Array; + private var frameBitmap:BitmapData; + protected var monochrome:ColorMatrixFilter; + protected var motionBitmap:BitmapData; + protected var motionRect:Rectangle; + protected var motionMatrix:Matrix; + + /** + * An abstract motion detection effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + * @param motionScale The scale of the motion bitmap data to use for detection + * @param motionFrames The number of frames to capture for the motion bitmap data + */ + public function AbstractMotionEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "", motionScale:int = 1, motionFrames:int = 4) + { + super(source, targetBitmap, name); + this.motionScale = motionScale < 1 ? 1 : motionScale; + this.motionFrames = motionFrames < 1 ? 1 : motionFrames; + + createAbstractMotion(); + } + + /** + * Sets up the motion effect + */ + private function createAbstractMotion():void + { + // Increase contrast + contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Motion bitmap dimensions + var w:int = Math.round(rect.width / motionScale); + var h:int = Math.round(rect.height / motionScale); + + // Main motion bitmap data + motionBitmap = new BitmapData(w, h, false, 0xFF000000); + motionRect = motionBitmap.rect; + motionMatrix = new Matrix(); + motionMatrix.scale(1 / motionScale, 1 / motionScale); + + // The previous frame to use when comparing with the current image + frameBitmap = motionBitmap.clone(); + frameBitmap.draw(source, motionMatrix, contrast); + + // Create the delayed motion frames + frames = new Array(); + for (var i:int = motionFrames; i--; ) frames.push(new BitmapData(w, h, false, 0xFF000000)); + + // Monochrome colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + monochrome = new ColorMatrixFilter(m); + } + + /** + * Draws the motion effect + */ + override public function draw():void + { + super.draw(); + + // Clear old motion bitmap + motionBitmap.fillRect(motionRect, 0xFF000000); + + // Do motion detection + for (var i:int = motionFrames; i--; ) + { + var b:BitmapData = frames[i]; + if (i == 0) + { + // Detect motion by taking the difference between this source image to the previous source image + b.copyPixels(frameBitmap, motionRect, point); // Get the old image + frameBitmap.draw(sourceBitmap, motionMatrix, contrast); // Draw the new image + frameBitmap.applyFilter(frameBitmap, motionRect, point, monochrome); // Convert the new image to greyscale + b.draw(frameBitmap, null, null, BlendMode.DIFFERENCE); // Draw the difference + } + else b.copyPixels(frames[i - 1], motionRect, point); // Move the motion frames along the array + + // Add all the motion frames into a single bitmap + motionBitmap.draw(b, null, null, BlendMode.ADD); + } + + // Separate the motion bitmap data into only black and white pixels + motionBitmap.threshold(motionBitmap, motionRect, point, ">", 0xFF808080, 0xFFFFFFFF); + motionBitmap.threshold(motionBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000); + } + + /** + * Removes the motion effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the motion frames + for (var i:int = motionFrames; i--; ) + { + frames[i].dispose(); + frames[i] = null; + } + frames = null; + + frameBitmap.dispose(); + frameBitmap = null; + motionBitmap.dispose(); + motionBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/FireEffect.as b/webcam/com/neave/webcam/effects/motion/FireEffect.as index 33dcfe2..cc0a760 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/FireEffect.as +++ b/webcam/com/neave/webcam/effects/motion/FireEffect.as @@ -1,129 +1,129 @@ -/**
- * Neave Webcam // Fire Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FireEffect extends AbstractMotionEffect
- {
- private const MOTION_SCALE:int = 2;
-
- private var fireSourceBitmap:BitmapData;
- private var fireBitmap:BitmapData;
- private var darkenBitmap:BitmapData;
- private var edge:ConvolutionFilter;
- private var fireColor:ColorMatrixFilter;
- private var displace:DisplacementMapFilter;
- private var blur:BlurFilter;
- private var targetMatrix:Matrix;
-
- /**
- * Creates a fire effect which animates along edges and as motion is detected
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FireEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fire", MOTION_SCALE, 5);
-
- createFire();
- }
-
- /**
- * Sets up the fire effect
- */
- private function createFire():void
- {
- // Set up fire bitmap data and scaling
- fireSourceBitmap = motionBitmap.clone();
- fireBitmap = motionBitmap.clone();
- targetMatrix = new Matrix();
- targetMatrix.scale(MOTION_SCALE, MOTION_SCALE);
-
- // Edge detection convolution array
- var m:Array =
- [
- 0, 0, 0,
- 16, 16, 16,
- -16, -16, -16
- ];
- edge = new ConvolutionFilter(3, 3, m, 9);
-
- // Fire colour matrix
- m = new Array();
- m = m.concat([0.8, 0.05, 0, 0, 0]); // Red
- m = m.concat([0, 0.65, 0, 0, 0]); // Green
- m = m.concat([0, 0, 0.5, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- fireColor = new ColorMatrixFilter(m);
-
- // Fire displacement map
- displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 7, -35, DisplacementMapFilterMode.CLAMP);
-
- // Fire blurring
- blur = new BlurFilter(8, 8, 1);
-
- // Darken the fire
- darkenBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFF8000);
- }
-
- /**
- * Draws the fire effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Get the source image's edges
- fireSourceBitmap.draw(sourceBitmap, motionMatrix);
- fireBitmap.applyFilter(fireSourceBitmap, motionRect, point, edge);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, monochrome);
-
- // Add motion bitmap to edge bitmap and turn pixels into orange and black only
- fireBitmap.draw(motionBitmap, null, null, BlendMode.ADD);
- fireBitmap.threshold(fireBitmap, motionRect, point, ">", 0xFF808080, 0xFFFF8000);
- fireBitmap.threshold(fireBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000);
-
- // Blur to make motion bitmap look more like fire
- fireBitmap.applyFilter(fireBitmap, motionRect, point, blur);
-
- // Displace the image with perlin noise to animate the fire
- displace.mapBitmap.perlinNoise(14, 10, 1, Math.floor(Math.random() * 256), false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false);
- displace.mapBitmap.draw(darkenBitmap, null, null, BlendMode.DARKEN);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, displace);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, fireColor);
-
- // Draw the fire bitmap on top of the current source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(fireBitmap, targetMatrix, null, BlendMode.ADD);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the fire effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- fireSourceBitmap.dispose();
- fireSourceBitmap = null;
- fireBitmap.dispose();
- fireBitmap = null;
- darkenBitmap.dispose();
- darkenBitmap = null;
- }
- }
+/** + * Neave Webcam // Fire Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FireEffect extends AbstractMotionEffect + { + private const MOTION_SCALE:int = 2; + + private var fireSourceBitmap:BitmapData; + private var fireBitmap:BitmapData; + private var darkenBitmap:BitmapData; + private var edge:ConvolutionFilter; + private var fireColor:ColorMatrixFilter; + private var displace:DisplacementMapFilter; + private var blur:BlurFilter; + private var targetMatrix:Matrix; + + /** + * Creates a fire effect which animates along edges and as motion is detected + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FireEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fire", MOTION_SCALE, 5); + + createFire(); + } + + /** + * Sets up the fire effect + */ + private function createFire():void + { + // Set up fire bitmap data and scaling + fireSourceBitmap = motionBitmap.clone(); + fireBitmap = motionBitmap.clone(); + targetMatrix = new Matrix(); + targetMatrix.scale(MOTION_SCALE, MOTION_SCALE); + + // Edge detection convolution array + var m:Array = + [ + 0, 0, 0, + 16, 16, 16, + -16, -16, -16 + ]; + edge = new ConvolutionFilter(3, 3, m, 9); + + // Fire colour matrix + m = new Array(); + m = m.concat([0.8, 0.05, 0, 0, 0]); // Red + m = m.concat([0, 0.65, 0, 0, 0]); // Green + m = m.concat([0, 0, 0.5, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + fireColor = new ColorMatrixFilter(m); + + // Fire displacement map + displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 7, -35, DisplacementMapFilterMode.CLAMP); + + // Fire blurring + blur = new BlurFilter(8, 8, 1); + + // Darken the fire + darkenBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFF8000); + } + + /** + * Draws the fire effect + */ + override public function draw():void + { + super.draw(); + + // Get the source image's edges + fireSourceBitmap.draw(sourceBitmap, motionMatrix); + fireBitmap.applyFilter(fireSourceBitmap, motionRect, point, edge); + fireBitmap.applyFilter(fireBitmap, motionRect, point, monochrome); + + // Add motion bitmap to edge bitmap and turn pixels into orange and black only + fireBitmap.draw(motionBitmap, null, null, BlendMode.ADD); + fireBitmap.threshold(fireBitmap, motionRect, point, ">", 0xFF808080, 0xFFFF8000); + fireBitmap.threshold(fireBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000); + + // Blur to make motion bitmap look more like fire + fireBitmap.applyFilter(fireBitmap, motionRect, point, blur); + + // Displace the image with perlin noise to animate the fire + displace.mapBitmap.perlinNoise(14, 10, 1, Math.floor(Math.random() * 256), false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false); + displace.mapBitmap.draw(darkenBitmap, null, null, BlendMode.DARKEN); + fireBitmap.applyFilter(fireBitmap, motionRect, point, displace); + fireBitmap.applyFilter(fireBitmap, motionRect, point, fireColor); + + // Draw the fire bitmap on top of the current source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(fireBitmap, targetMatrix, null, BlendMode.ADD); + targetBitmap.unlock(); + } + + /** + * Removes the fire effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + fireSourceBitmap.dispose(); + fireSourceBitmap = null; + fireBitmap.dispose(); + fireBitmap = null; + darkenBitmap.dispose(); + darkenBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/SnowEffect.as b/webcam/com/neave/webcam/effects/motion/SnowEffect.as index 30468d9..b2a945f 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/SnowEffect.as +++ b/webcam/com/neave/webcam/effects/motion/SnowEffect.as @@ -1,154 +1,154 @@ -/**
- * Neave Webcam // Snow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.events.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.utils.*;
- import com.neave.webcam.effects.*;
-
- public class SnowEffect extends AbstractEffect
- {
- private const SNOWFLAKE_DELAY:int = 20;
- private const MELT_SPEED:Number = 0.0025;
-
- private var totalFlakes:int;
- private var snowSourceBitmap:BitmapData;
- private var edgeBitmap:BitmapData;
- private var edge:ConvolutionFilter;
- private var blur:BlurFilter;
- private var snowflakes:Sprite;
- private var snowTimer:Timer;
- private var snowMatrix:Matrix;
- private var contrast:ColorTransform;
-
- /**
- * Creates a snow effect where falling snowflakes settle and build up along edges
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param totalFlakes The total number of snowflakes to use
- */
- public function SnowEffect(source:IBitmapDrawable, targetBitmap:BitmapData, totalFlakes:int = 200)
- {
- super(source, targetBitmap, "Snow");
- this.totalFlakes = totalFlakes < 1 ? 1 : totalFlakes;
-
- createSnow();
- }
-
- /**
- * Sets up the snow effect
- */
- private function createSnow():void
- {
- // Increase contrast to better detect edges
- //contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Create bitmaps to hold edge detection
- snowSourceBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000);
- edgeBitmap = snowSourceBitmap.clone();
- snowMatrix = new Matrix();
- snowMatrix.scale(0.5, 0.5);
-
- // Add a new snowflake to the snowflakes sprite every so often
- snowflakes = new Sprite();
- snowTimer = new Timer(SNOWFLAKE_DELAY);
- snowTimer.addEventListener(TimerEvent.TIMER, makeNewSnowflake);
- snowTimer.start();
-
- // Edge detection convolution array
- var m:Array =
- [
- 0, 50, 0,
- 0, -60, 0,
- 0, 10, 0
- ];
- edge = new ConvolutionFilter(3, 3, m, 5);
- }
-
- /**
- * Creates a new snowflake inside the snowflakes sprite
- */
- private function makeNewSnowflake(e:TimerEvent = null):void
- {
- // Only add another random snowflake if the maximum amount has not been reached
- if (snowflakes.numChildren < totalFlakes) snowflakes.addChild(new Snowflake(Math.random() * rect.width, -4, Math.random() * 2 + 1, Math.random() * 2 - 1));
- }
-
- /**
- * Draws the snow effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each snowflake
- for (var i:int = snowflakes.numChildren; i--; )
- {
- var flake:Snowflake = snowflakes.getChildAt(i) as Snowflake;
-
- // Only move the snowflake if it is not hitting an edge
- if (edgeBitmap.getPixel(Math.round(flake.x / 2), Math.round(flake.y / 2)) == 0x000000)
- {
- // Animate the snowflake
- flake.fall();
- flake.alpha += 0.1;
- if (flake.alpha > 1) flake.alpha = 1;
-
- // Wrap the snowflake to within the bounds of the image
- if (flake.x > rect.width + flake.width) flake.x -= rect.width + flake.width;
- if (flake.x < -flake.width) flake.x += rect.width + flake.width;
-
- // Remove this snowflake if it has fallen off the bottom of the image
- if (flake.y > rect.height + flake.height) snowflakes.removeChildAt(i);
- }
- else
- {
- // Melt this snowflake by fading out it
- if (flake.alpha > 0.1) flake.alpha -= MELT_SPEED;
- else snowflakes.removeChildAt(i);
- }
- }
-
- // Find the edges for the snow to settle on
- snowSourceBitmap.draw(sourceBitmap, snowMatrix, contrast);
- edgeBitmap.applyFilter(snowSourceBitmap, edgeBitmap.rect, point, edge);
- edgeBitmap.threshold(edgeBitmap, edgeBitmap.rect, point, "<", 0xFF808080, 0xFF000000);
-
- // Draw the snow over the current source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(snowflakes);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the snow effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Stop making new snowflakes
- snowTimer.removeEventListener(TimerEvent.TIMER, makeNewSnowflake);
-
- // Remove bitmap data
- snowSourceBitmap.dispose();
- snowSourceBitmap = null;
- edgeBitmap.dispose();
- edgeBitmap = null;
- }
- }
+/** + * Neave Webcam // Snow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.events.*; + import flash.filters.*; + import flash.geom.*; + import flash.utils.*; + import com.neave.webcam.effects.*; + + public class SnowEffect extends AbstractEffect + { + private const SNOWFLAKE_DELAY:int = 20; + private const MELT_SPEED:Number = 0.0025; + + private var totalFlakes:int; + private var snowSourceBitmap:BitmapData; + private var edgeBitmap:BitmapData; + private var edge:ConvolutionFilter; + private var blur:BlurFilter; + private var snowflakes:Sprite; + private var snowTimer:Timer; + private var snowMatrix:Matrix; + private var contrast:ColorTransform; + + /** + * Creates a snow effect where falling snowflakes settle and build up along edges + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param totalFlakes The total number of snowflakes to use + */ + public function SnowEffect(source:IBitmapDrawable, targetBitmap:BitmapData, totalFlakes:int = 200) + { + super(source, targetBitmap, "Snow"); + this.totalFlakes = totalFlakes < 1 ? 1 : totalFlakes; + + createSnow(); + } + + /** + * Sets up the snow effect + */ + private function createSnow():void + { + // Increase contrast to better detect edges + //contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Create bitmaps to hold edge detection + snowSourceBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000); + edgeBitmap = snowSourceBitmap.clone(); + snowMatrix = new Matrix(); + snowMatrix.scale(0.5, 0.5); + + // Add a new snowflake to the snowflakes sprite every so often + snowflakes = new Sprite(); + snowTimer = new Timer(SNOWFLAKE_DELAY); + snowTimer.addEventListener(TimerEvent.TIMER, makeNewSnowflake); + snowTimer.start(); + + // Edge detection convolution array + var m:Array = + [ + 0, 50, 0, + 0, -60, 0, + 0, 10, 0 + ]; + edge = new ConvolutionFilter(3, 3, m, 5); + } + + /** + * Creates a new snowflake inside the snowflakes sprite + */ + private function makeNewSnowflake(e:TimerEvent = null):void + { + // Only add another random snowflake if the maximum amount has not been reached + if (snowflakes.numChildren < totalFlakes) snowflakes.addChild(new Snowflake(Math.random() * rect.width, -4, Math.random() * 2 + 1, Math.random() * 2 - 1)); + } + + /** + * Draws the snow effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each snowflake + for (var i:int = snowflakes.numChildren; i--; ) + { + var flake:Snowflake = snowflakes.getChildAt(i) as Snowflake; + + // Only move the snowflake if it is not hitting an edge + if (edgeBitmap.getPixel(Math.round(flake.x / 2), Math.round(flake.y / 2)) == 0x000000) + { + // Animate the snowflake + flake.fall(); + flake.alpha += 0.1; + if (flake.alpha > 1) flake.alpha = 1; + + // Wrap the snowflake to within the bounds of the image + if (flake.x > rect.width + flake.width) flake.x -= rect.width + flake.width; + if (flake.x < -flake.width) flake.x += rect.width + flake.width; + + // Remove this snowflake if it has fallen off the bottom of the image + if (flake.y > rect.height + flake.height) snowflakes.removeChildAt(i); + } + else + { + // Melt this snowflake by fading out it + if (flake.alpha > 0.1) flake.alpha -= MELT_SPEED; + else snowflakes.removeChildAt(i); + } + } + + // Find the edges for the snow to settle on + snowSourceBitmap.draw(sourceBitmap, snowMatrix, contrast); + edgeBitmap.applyFilter(snowSourceBitmap, edgeBitmap.rect, point, edge); + edgeBitmap.threshold(edgeBitmap, edgeBitmap.rect, point, "<", 0xFF808080, 0xFF000000); + + // Draw the snow over the current source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(snowflakes); + targetBitmap.unlock(); + } + + /** + * Removes the snow effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Stop making new snowflakes + snowTimer.removeEventListener(TimerEvent.TIMER, makeNewSnowflake); + + // Remove bitmap data + snowSourceBitmap.dispose(); + snowSourceBitmap = null; + edgeBitmap.dispose(); + edgeBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/Snowflake.as b/webcam/com/neave/webcam/effects/motion/Snowflake.as index fc943f5..79ee34c 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/Snowflake.as +++ b/webcam/com/neave/webcam/effects/motion/Snowflake.as @@ -1,66 +1,66 @@ -/**
- * Neave Webcam // Snowflake
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.geom.*;
-
- final internal class Snowflake extends Shape
- {
- private const SIDEWAYS_DAMPEN:Number = 0.995;
-
- private var size:Number;
- private var vx:Number;
-
- /**
- * Draws a snowflake shape to be used with the snow effect
- *
- * @param x The position of the snowflake on the x-axis
- * @param y The position of the snowflake on the y-axis
- * @param size The size of the snowflake
- * @param vx The sideways velocity of the snowflake
- */
- public function Snowflake(x:Number = 0, y:Number = 0, size:Number = 1, vx:Number = 0)
- {
- this.x = x;
- this.y = y;
- this.size = size;
- this.vx = vx;
-
- createSnowflake();
- }
-
- /**
- * Sets up the snowflake shape, a white oval gradient
- */
- private function createSnowflake():void
- {
- var m:Matrix = new Matrix();
- m.createGradientBox(size * 2, size * 2);
- m.translate(-size, -size);
- graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0xFFFFFF], [1, 0], [0x66, 0xFF], m);
- graphics.drawCircle(0, 0, size);
- width *= 1.5;
- cacheAsBitmap = true;
- }
-
- /**
- * Animates the snowflake downwards
- */
- internal function fall():void
- {
- vx *= SIDEWAYS_DAMPEN;
- x += vx;
- y += size;
- }
- }
+/** + * Neave Webcam // Snowflake + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.geom.*; + + final internal class Snowflake extends Shape + { + private const SIDEWAYS_DAMPEN:Number = 0.995; + + private var size:Number; + private var vx:Number; + + /** + * Draws a snowflake shape to be used with the snow effect + * + * @param x The position of the snowflake on the x-axis + * @param y The position of the snowflake on the y-axis + * @param size The size of the snowflake + * @param vx The sideways velocity of the snowflake + */ + public function Snowflake(x:Number = 0, y:Number = 0, size:Number = 1, vx:Number = 0) + { + this.x = x; + this.y = y; + this.size = size; + this.vx = vx; + + createSnowflake(); + } + + /** + * Sets up the snowflake shape, a white oval gradient + */ + private function createSnowflake():void + { + var m:Matrix = new Matrix(); + m.createGradientBox(size * 2, size * 2); + m.translate(-size, -size); + graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0xFFFFFF], [1, 0], [0x66, 0xFF], m); + graphics.drawCircle(0, 0, size); + width *= 1.5; + cacheAsBitmap = true; + } + + /** + * Animates the snowflake downwards + */ + internal function fall():void + { + vx *= SIDEWAYS_DAMPEN; + x += vx; + y += size; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/SteamEffect.as b/webcam/com/neave/webcam/effects/motion/SteamEffect.as index 0b55ca2..1666bdc 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/SteamEffect.as +++ b/webcam/com/neave/webcam/effects/motion/SteamEffect.as @@ -1,73 +1,73 @@ -/**
- * Neave Webcam // Steamy Window Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
-
- public class SteamEffect extends AbstractMotionEffect
- {
- private var steamBitmap:BitmapData;
- private var blackBitmap:BitmapData;
- private var wipedBitmap:BitmapData;
-
- /**
- * Creates a steamy window effect where detected motion wipes away areas of the steamed-up image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function SteamEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Steamy Window");
-
- createSteam();
- }
-
- /**
- * Sets up the steam effect
- */
- private function createSteam():void
- {
- steamBitmap = new BitmapData(rect.width, rect.height, false, 0xFF808080);
- blackBitmap = new BitmapData(rect.width, rect.height, false, 0xFF000000);
- wipedBitmap = blackBitmap.clone();
- }
-
- /**
- * Draws the steam effect
- */
- override public function draw():void
- {
- super.draw();
- wipedBitmap.draw(motionBitmap, null, null, BlendMode.ADD); // Build up a wiped area by repeatedly adding the motion bitmap
- wipedBitmap.merge(blackBitmap, rect, point, 2, 2, 2, 0); // Gradually fade away the wiped areas
- steamBitmap.fillRect(rect, 0xFF808080); // Create some steam
- steamBitmap.draw(wipedBitmap, null, null, BlendMode.SUBTRACT); // Remove the wiped areas from the steam
- sourceBitmap.merge(steamBitmap, rect, point, 0x80, 0x80, 0x80, 0); // Merge the steam with the source image
- targetBitmap.copyPixels(sourceBitmap, rect, point); // Draw into the target bitmap
- }
-
- /**
- * Removes the steam effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- steamBitmap.dispose();
- steamBitmap = null;
- blackBitmap.dispose();
- blackBitmap = null;
- wipedBitmap.dispose();
- wipedBitmap = null;
- }
- }
+/** + * Neave Webcam // Steamy Window Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + + public class SteamEffect extends AbstractMotionEffect + { + private var steamBitmap:BitmapData; + private var blackBitmap:BitmapData; + private var wipedBitmap:BitmapData; + + /** + * Creates a steamy window effect where detected motion wipes away areas of the steamed-up image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function SteamEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Steamy Window"); + + createSteam(); + } + + /** + * Sets up the steam effect + */ + private function createSteam():void + { + steamBitmap = new BitmapData(rect.width, rect.height, false, 0xFF808080); + blackBitmap = new BitmapData(rect.width, rect.height, false, 0xFF000000); + wipedBitmap = blackBitmap.clone(); + } + + /** + * Draws the steam effect + */ + override public function draw():void + { + super.draw(); + wipedBitmap.draw(motionBitmap, null, null, BlendMode.ADD); // Build up a wiped area by repeatedly adding the motion bitmap + wipedBitmap.merge(blackBitmap, rect, point, 2, 2, 2, 0); // Gradually fade away the wiped areas + steamBitmap.fillRect(rect, 0xFF808080); // Create some steam + steamBitmap.draw(wipedBitmap, null, null, BlendMode.SUBTRACT); // Remove the wiped areas from the steam + sourceBitmap.merge(steamBitmap, rect, point, 0x80, 0x80, 0x80, 0); // Merge the steam with the source image + targetBitmap.copyPixels(sourceBitmap, rect, point); // Draw into the target bitmap + } + + /** + * Removes the steam effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + steamBitmap.dispose(); + steamBitmap = null; + blackBitmap.dispose(); + blackBitmap = null; + wipedBitmap.dispose(); + wipedBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/SwarmEffect.as b/webcam/com/neave/webcam/effects/motion/SwarmEffect.as index f22a6bd..e86213c 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/SwarmEffect.as +++ b/webcam/com/neave/webcam/effects/motion/SwarmEffect.as @@ -1,106 +1,106 @@ -/**
- * Neave Webcam // Swarm Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.geom.*;
-
- public class SwarmEffect extends AbstractMotionEffect
- {
- private const MOTION_SCALE:int = 4;
-
- private var flies:int;
- private var swarm:Sprite;
-
- /**
- * Creates a swarming flies effect where the flies are attracted to detected motion
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param flies The number of flies to use in the swarm
- */
- public function SwarmEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flies:int = 150)
- {
- super(source, targetBitmap, "Swarm", MOTION_SCALE);
- this.flies = flies < 1 ? 1 : flies;
-
- createSwarm();
- }
-
- /**
- * Sets up the swarm effect
- */
- private function createSwarm():void
- {
- // Draw the flies into the swarm sprite in random positions
- swarm = new Sprite();
- for (var i:int = flies; i--; ) swarm.addChild(new SwarmFly(Math.random() * rect.width, Math.random() * rect.height, (i / flies) * 0.75 + 0.75));
- }
-
- /**
- * Draws the swarm effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each pixel in the motion bitmap data
- var flyX:int = -1;
- var flyY:int = -1;
- for (var y:int = motionBitmap.height; y--; )
- {
- for (var x:int = motionBitmap.width; x--; )
- {
- // If this pixel has motion set this as a point for the flies to move to
- if (motionBitmap.getPixel(x, y) == 0xFFFFFF)
- {
- flyX = x * MOTION_SCALE;
- flyY = y * MOTION_SCALE;
- break;
- }
- }
- }
-
- // Loop through each fly in the swarm
- for (var i:int = flies; i--; )
- {
- // Fly the fly towards the motion point
- var fly:SwarmFly = swarm.getChildAt(i) as SwarmFly;
- fly.flyTo(flyX, flyY);
-
- // Limit the fly to within bounds of the source image
- if (fly.x < 0) fly.x = 0;
- if (fly.y < 0) fly.y = 0;
- if (fly.x > rect.width) fly.x = rect.width;
- if (fly.y > rect.height) fly.y = rect.height;
- }
-
- // Draw the swarm over the source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(swarm);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the swarm effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the flies from the swarm sprite
- for (var i:int = flies; i--; ) swarm.removeChildAt(i);
- swarm = null;
- }
- }
+/** + * Neave Webcam // Swarm Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.geom.*; + + public class SwarmEffect extends AbstractMotionEffect + { + private const MOTION_SCALE:int = 4; + + private var flies:int; + private var swarm:Sprite; + + /** + * Creates a swarming flies effect where the flies are attracted to detected motion + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param flies The number of flies to use in the swarm + */ + public function SwarmEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flies:int = 150) + { + super(source, targetBitmap, "Swarm", MOTION_SCALE); + this.flies = flies < 1 ? 1 : flies; + + createSwarm(); + } + + /** + * Sets up the swarm effect + */ + private function createSwarm():void + { + // Draw the flies into the swarm sprite in random positions + swarm = new Sprite(); + for (var i:int = flies; i--; ) swarm.addChild(new SwarmFly(Math.random() * rect.width, Math.random() * rect.height, (i / flies) * 0.75 + 0.75)); + } + + /** + * Draws the swarm effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each pixel in the motion bitmap data + var flyX:int = -1; + var flyY:int = -1; + for (var y:int = motionBitmap.height; y--; ) + { + for (var x:int = motionBitmap.width; x--; ) + { + // If this pixel has motion set this as a point for the flies to move to + if (motionBitmap.getPixel(x, y) == 0xFFFFFF) + { + flyX = x * MOTION_SCALE; + flyY = y * MOTION_SCALE; + break; + } + } + } + + // Loop through each fly in the swarm + for (var i:int = flies; i--; ) + { + // Fly the fly towards the motion point + var fly:SwarmFly = swarm.getChildAt(i) as SwarmFly; + fly.flyTo(flyX, flyY); + + // Limit the fly to within bounds of the source image + if (fly.x < 0) fly.x = 0; + if (fly.y < 0) fly.y = 0; + if (fly.x > rect.width) fly.x = rect.width; + if (fly.y > rect.height) fly.y = rect.height; + } + + // Draw the swarm over the source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(swarm); + targetBitmap.unlock(); + } + + /** + * Removes the swarm effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the flies from the swarm sprite + for (var i:int = flies; i--; ) swarm.removeChildAt(i); + swarm = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/motion/SwarmFly.as b/webcam/com/neave/webcam/effects/motion/SwarmFly.as index a7cfe62..84d751c 100755..100644 --- a/webcam/com/neave/webcam/effects/motion/SwarmFly.as +++ b/webcam/com/neave/webcam/effects/motion/SwarmFly.as @@ -1,122 +1,122 @@ -/**
- * Neave Webcam // Swarm Fly
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
-
- final internal class SwarmFly extends Shape
- {
- private const MAX_BOREDOM:int = 10;
- private const BOREDOM_TIME:int = 20;
- private const MAX_DIST:int = 8000;
- private const BORED_DIST:int = 30;
-
- private var x0:Number;
- private var y0:Number;
- private var size:Number;
- private var speed:Number;
- private var boredom:int;
- private var wobbleAngle:Number;
- private var wobbleDist:Number;
- private var wobbleStep:Number;
-
- /**
- * Creates a fly graphic to be used with the swarm effect
- *
- * @param x The starting position of the fly on the x-axis
- * @param y The starting position of the fly on the y-axis
- */
- public function SwarmFly(x:Number = 0, y:Number = 0, size:Number = 1)
- {
- this.x = x0 = x;
- this.y = y0 = y;
- this.size = size;
-
- createFly();
- }
-
- /**
- * Sets up the fly and its initial properties
- */
- private function createFly():void
- {
- // This fly's movement speed and initial boredom threshold
- speed = Math.random() * 20 + 10;
- boredom = Math.floor(Math.random() * (MAX_BOREDOM + BOREDOM_TIME));
-
- // This fly's wobbling amount as it flies
- wobbleAngle = Math.random() * Math.PI;
- wobbleDist = Math.random() * 2.5 + 0.5;
- wobbleStep = evenRandom() * 2;
-
- // Draw the fly shape, a black circle with a black glow
- graphics.beginFill(0x000000);
- graphics.drawCircle(0, 0, size);
- filters = [ new GlowFilter(0x000000, 1, 6, 6, 2, 2, false, false) ];
- cacheAsBitmap = true;
- }
-
- /**
- * Generates a random number between -0.5 and 0.5
- */
- private function evenRandom():Number
- {
- return Math.random() - 0.5;
- }
-
- /**
- * Moves the fly towards the specified position
- *
- * @param x The position to move to on the x-axis
- * @param y The position to move to on the y-axis
- */
- internal function flyTo(x:int, y:int):void
- {
- var dx:int = this.x - x;
- var dy:int = this.y - y;
- if (boredom > MAX_BOREDOM || dx * dx + dy * dy > MAX_DIST)
- {
- // Fly around if the fly is too bored or too far away
- this.x += (x0 - this.x) / speed;
- this.y += (y0 - this.y) / speed;
-
- // Flying around reduces boredom
- if (boredom > 0) boredom--;
-
- // Not bored any more, reset boredom threshold
- if (boredom == MAX_BOREDOM) boredom = 0;
- }
- else if (x >=0 || y >= 0)
- {
- // Fly isn't bored yet so moves towards the motion
- this.x += (x - this.x) / speed / 2;
- this.y += (y - this.y) / speed / 2;
-
- // Boredom increases until the fly is totally bored and flies off
- if (boredom < MAX_BOREDOM) boredom++;
- else
- {
- // Bored now, so fly away somewhere for a time
- x0 = x + evenRandom() * BORED_DIST;
- y0 = y + evenRandom() * BORED_DIST;
- boredom = MAX_BOREDOM + Math.ceil(evenRandom() * BOREDOM_TIME);
- }
- }
-
- // Wobble the fly's movement
- wobbleAngle += wobbleStep;
- this.x += Math.sin(wobbleAngle) * wobbleDist;
- this.y += Math.cos(wobbleAngle / 3) * wobbleDist;
- }
- }
+/** + * Neave Webcam // Swarm Fly + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + + final internal class SwarmFly extends Shape + { + private const MAX_BOREDOM:int = 10; + private const BOREDOM_TIME:int = 20; + private const MAX_DIST:int = 8000; + private const BORED_DIST:int = 30; + + private var x0:Number; + private var y0:Number; + private var size:Number; + private var speed:Number; + private var boredom:int; + private var wobbleAngle:Number; + private var wobbleDist:Number; + private var wobbleStep:Number; + + /** + * Creates a fly graphic to be used with the swarm effect + * + * @param x The starting position of the fly on the x-axis + * @param y The starting position of the fly on the y-axis + */ + public function SwarmFly(x:Number = 0, y:Number = 0, size:Number = 1) + { + this.x = x0 = x; + this.y = y0 = y; + this.size = size; + + createFly(); + } + + /** + * Sets up the fly and its initial properties + */ + private function createFly():void + { + // This fly's movement speed and initial boredom threshold + speed = Math.random() * 20 + 10; + boredom = Math.floor(Math.random() * (MAX_BOREDOM + BOREDOM_TIME)); + + // This fly's wobbling amount as it flies + wobbleAngle = Math.random() * Math.PI; + wobbleDist = Math.random() * 2.5 + 0.5; + wobbleStep = evenRandom() * 2; + + // Draw the fly shape, a black circle with a black glow + graphics.beginFill(0x000000); + graphics.drawCircle(0, 0, size); + filters = [ new GlowFilter(0x000000, 1, 6, 6, 2, 2, false, false) ]; + cacheAsBitmap = true; + } + + /** + * Generates a random number between -0.5 and 0.5 + */ + private function evenRandom():Number + { + return Math.random() - 0.5; + } + + /** + * Moves the fly towards the specified position + * + * @param x The position to move to on the x-axis + * @param y The position to move to on the y-axis + */ + internal function flyTo(x:int, y:int):void + { + var dx:int = this.x - x; + var dy:int = this.y - y; + if (boredom > MAX_BOREDOM || dx * dx + dy * dy > MAX_DIST) + { + // Fly around if the fly is too bored or too far away + this.x += (x0 - this.x) / speed; + this.y += (y0 - this.y) / speed; + + // Flying around reduces boredom + if (boredom > 0) boredom--; + + // Not bored any more, reset boredom threshold + if (boredom == MAX_BOREDOM) boredom = 0; + } + else if (x >=0 || y >= 0) + { + // Fly isn't bored yet so moves towards the motion + this.x += (x - this.x) / speed / 2; + this.y += (y - this.y) / speed / 2; + + // Boredom increases until the fly is totally bored and flies off + if (boredom < MAX_BOREDOM) boredom++; + else + { + // Bored now, so fly away somewhere for a time + x0 = x + evenRandom() * BORED_DIST; + y0 = y + evenRandom() * BORED_DIST; + boredom = MAX_BOREDOM + Math.ceil(evenRandom() * BOREDOM_TIME); + } + } + + // Wobble the fly's movement + wobbleAngle += wobbleStep; + this.x += Math.sin(wobbleAngle) * wobbleDist; + this.y += Math.cos(wobbleAngle / 3) * wobbleDist; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/ASCIIEffect.as b/webcam/com/neave/webcam/effects/pixel/ASCIIEffect.as index cd8e8d8..6ca3a67 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/ASCIIEffect.as +++ b/webcam/com/neave/webcam/effects/pixel/ASCIIEffect.as @@ -1,225 +1,225 @@ -/**
- * Neave Webcam // ASCII Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.system.*;
- import flash.text.*;
- import com.neave.webcam.effects.*;
-
- public class ASCIIEffect extends AbstractEffect
- {
- private const FONT_NAME:String = "_typewriter";
- private const FONT_SIZE:int = 10;
- private const FONT_COLOR:int = 0x33FF33;
- private const FONT_SPACING:int = 2;
- private const FONT_WIN_LEADING:int = -8;
- private const FONT_MAC_LEADING:int = -6;
- private const CHARS_WIDE:int = 39;
- private const MIN_ASCII_CHAR:uint = 32;
- private const MAX_ASCII_CHAR:uint = 126;
-
- private var flipChars:Boolean;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var textBitmap:BitmapData;
- private var textfield:TextField;
- private var textMatrix:Matrix;
- private var flipMatrix:Matrix;
- private var charsX:int;
- private var charsY:int;
- private var total:int;
- private var textFormat:TextFormat;
- private var chars:Array;
- private var blur:BlurFilter;
-
- /**
- * Creates a text-based effect where each pixel is drawn as a letter from the ASCII character table
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param flipChars Flips the ASCII characters horizontally, useful if using a mirrored webcam as the source object
- */
- public function ASCIIEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flipChars:Boolean = true)
- {
- super(source, targetBitmap, "ASCII");
- this.flipChars = flipChars;
-
- createASCII();
- }
-
- /**
- * Sets up the ASCII effect
- */
- private function createASCII():void
- {
- // Increase contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Create the main textfield
- var fmt:TextFormat = new TextFormat(FONT_NAME, FONT_SIZE, FONT_COLOR);
- fmt.letterSpacing = FONT_SPACING;
- fmt.leading = Capabilities.version.substr(0, 3) == "MAC" ? FONT_MAC_LEADING : FONT_WIN_LEADING;
- textfield = new TextField();
- textfield.defaultTextFormat = fmt;
- textfield.autoSize = TextFieldAutoSize.LEFT;
-
- // Get the ASCII characters in order of brightness
- chars = getOrderedChars();
- total = chars.length - 1;
-
- // Create a bitmap to hold the textfield
- textBitmap = targetBitmap.clone();
- textMatrix = new Matrix();
- textMatrix.translate(3, 0);
-
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(CHARS_WIDE, Math.round(CHARS_WIDE * rect.height / rect.width), false, 0xFF000000);
- charsX = smallBitmap.width;
- charsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(charsX / rect.width, charsY / rect.height);
-
- // If flip flag is true, reverse the bitmaps horizontally
- flipMatrix = new Matrix();
- flipMatrix.scale(rect.width / 320, rect.height / 240);
- if (flipChars)
- {
- flipMatrix.scale(-1, 1);
- flipMatrix.translate(rect.width, 0);
- smallMatrix.scale(-1, 1);
- smallMatrix.translate(charsX, 0);
- }
-
- // Use a blur filter to add a slight glow behind the characters
- blur = new BlurFilter(4, 4, 1);
- }
-
- /**
- * Generates an array of ASCII characters in order of pixel brightness
- *
- * @return An array of characters ordered by pixel brightness
- */
- private function getOrderedChars():Array
- {
- // Create an array containing character and its brightness
- var order:Array = new Array();
- for (var i:int = MIN_ASCII_CHAR; i < MAX_ASCII_CHAR; i++)
- {
- var c:String = String.fromCharCode(i);
- order.push( { char:c, level:getCharBrightness(c) } );
- }
-
- // Sort the characters in order of descending brightness
- order.sortOn("level", Array.NUMERIC | Array.DESCENDING);
-
- // Return a new array containing only the characters in order
- var list:Array = new Array();
- for (i = order.length; i--; ) list.push(order[i].char);
- return list;
- }
-
- /**
- * Calculates the pixel brightness a character
- *
- * @param char The single ASCII character to test for brightness level
- * @return A number between 0 and 1 indicating the amount of brightness
- */
- private function getCharBrightness(char:String):Number
- {
- // Create a temporary textfield to hold this character
- var tf:TextField = new TextField();
- tf.defaultTextFormat = new TextFormat(FONT_NAME, FONT_SIZE, 0x000000);
- tf.text = char.charAt();
- tf.autoSize = TextFieldAutoSize.LEFT;
-
- // Determine the width and height of this character
- var charWidth:int = Math.ceil(tf.width);
- var charHeight:int = Math.ceil(tf.height);
-
- // Create a temporary bitmap data to draw this character into
- var charBitmap:BitmapData = new BitmapData(charWidth, charHeight, false, 0xFFFFFFFF);
- charBitmap.draw(tf);
-
- // Loop through each pixel in this character's bitmap data
- var level:int = 0;
- for (var y:int = charHeight; y--; )
- {
- for (var x:int = charWidth; x--; )
- {
- // If this pixel is bright enough, add it to the overall brightness level
- if (charBitmap.getPixel(x, y) > 0x808080) level++;
- }
- }
-
- // Return the brightness level as a percentage of the whole character area
- return level / (charWidth * charHeight);
- }
-
- /**
- * Converts a colour value to an averaged monochrome (greyscale) value
- *
- * @param col The colour to convert to monochrome
- * @return The averaged monochrome value
- */
- private function getMonochrome(col:uint):uint
- {
- // Add the red, green and blue components together and return the average
- return 0xFF - (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3;
- }
-
- /**
- * Draws the ASCII effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the ASCII textfield from each pixel
- var str:String = "";
- for (var y:int = 0; y < charsY; y++)
- {
- for (var x:int = 0; x < charsX; x++)
- {
- // Get the monochrome pixel value and convert it to an ASCII character
- str += chars[int(getMonochrome(smallBitmap.getPixel(x, y)) / 0xFF * total)];
- }
- str += "\r\n"; // New line
- }
-
- // Draw the new ASCII textfield into the text bitmap data with a blurred background glow
- textfield.text = str;
- textBitmap.fillRect(rect, 0xFF000000);
- textBitmap.draw(textfield, textMatrix);
- sourceBitmap.applyFilter(textBitmap, rect, point, blur);
- sourceBitmap.draw(textBitmap, null, null, BlendMode.ADD);
- targetBitmap.draw(sourceBitmap, flipMatrix);
- }
-
- /**
- * Removes the ASCII effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- textBitmap.dispose();
- textBitmap = null;
- textfield = null;
- chars = null;
- }
- }
+/** + * Neave Webcam // ASCII Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import flash.system.*; + import flash.text.*; + import com.neave.webcam.effects.*; + + public class ASCIIEffect extends AbstractEffect + { + private const FONT_NAME:String = "_typewriter"; + private const FONT_SIZE:int = 10; + private const FONT_COLOR:int = 0x33FF33; + private const FONT_SPACING:int = 2; + private const FONT_WIN_LEADING:int = -8; + private const FONT_MAC_LEADING:int = -6; + private const CHARS_WIDE:int = 39; + private const MIN_ASCII_CHAR:uint = 32; + private const MAX_ASCII_CHAR:uint = 126; + + private var flipChars:Boolean; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var textBitmap:BitmapData; + private var textfield:TextField; + private var textMatrix:Matrix; + private var flipMatrix:Matrix; + private var charsX:int; + private var charsY:int; + private var total:int; + private var textFormat:TextFormat; + private var chars:Array; + private var blur:BlurFilter; + + /** + * Creates a text-based effect where each pixel is drawn as a letter from the ASCII character table + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param flipChars Flips the ASCII characters horizontally, useful if using a mirrored webcam as the source object + */ + public function ASCIIEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flipChars:Boolean = true) + { + super(source, targetBitmap, "ASCII"); + this.flipChars = flipChars; + + createASCII(); + } + + /** + * Sets up the ASCII effect + */ + private function createASCII():void + { + // Increase contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Create the main textfield + var fmt:TextFormat = new TextFormat(FONT_NAME, FONT_SIZE, FONT_COLOR); + fmt.letterSpacing = FONT_SPACING; + fmt.leading = Capabilities.version.substr(0, 3) == "MAC" ? FONT_MAC_LEADING : FONT_WIN_LEADING; + textfield = new TextField(); + textfield.defaultTextFormat = fmt; + textfield.autoSize = TextFieldAutoSize.LEFT; + + // Get the ASCII characters in order of brightness + chars = getOrderedChars(); + total = chars.length - 1; + + // Create a bitmap to hold the textfield + textBitmap = targetBitmap.clone(); + textMatrix = new Matrix(); + textMatrix.translate(3, 0); + + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(CHARS_WIDE, Math.round(CHARS_WIDE * rect.height / rect.width), false, 0xFF000000); + charsX = smallBitmap.width; + charsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(charsX / rect.width, charsY / rect.height); + + // If flip flag is true, reverse the bitmaps horizontally + flipMatrix = new Matrix(); + flipMatrix.scale(rect.width / 320, rect.height / 240); + if (flipChars) + { + flipMatrix.scale(-1, 1); + flipMatrix.translate(rect.width, 0); + smallMatrix.scale(-1, 1); + smallMatrix.translate(charsX, 0); + } + + // Use a blur filter to add a slight glow behind the characters + blur = new BlurFilter(4, 4, 1); + } + + /** + * Generates an array of ASCII characters in order of pixel brightness + * + * @return An array of characters ordered by pixel brightness + */ + private function getOrderedChars():Array + { + // Create an array containing character and its brightness + var order:Array = new Array(); + for (var i:int = MIN_ASCII_CHAR; i < MAX_ASCII_CHAR; i++) + { + var c:String = String.fromCharCode(i); + order.push( { char:c, level:getCharBrightness(c) } ); + } + + // Sort the characters in order of descending brightness + order.sortOn("level", Array.NUMERIC | Array.DESCENDING); + + // Return a new array containing only the characters in order + var list:Array = new Array(); + for (i = order.length; i--; ) list.push(order[i].char); + return list; + } + + /** + * Calculates the pixel brightness a character + * + * @param char The single ASCII character to test for brightness level + * @return A number between 0 and 1 indicating the amount of brightness + */ + private function getCharBrightness(char:String):Number + { + // Create a temporary textfield to hold this character + var tf:TextField = new TextField(); + tf.defaultTextFormat = new TextFormat(FONT_NAME, FONT_SIZE, 0x000000); + tf.text = char.charAt(); + tf.autoSize = TextFieldAutoSize.LEFT; + + // Determine the width and height of this character + var charWidth:int = Math.ceil(tf.width); + var charHeight:int = Math.ceil(tf.height); + + // Create a temporary bitmap data to draw this character into + var charBitmap:BitmapData = new BitmapData(charWidth, charHeight, false, 0xFFFFFFFF); + charBitmap.draw(tf); + + // Loop through each pixel in this character's bitmap data + var level:int = 0; + for (var y:int = charHeight; y--; ) + { + for (var x:int = charWidth; x--; ) + { + // If this pixel is bright enough, add it to the overall brightness level + if (charBitmap.getPixel(x, y) > 0x808080) level++; + } + } + + // Return the brightness level as a percentage of the whole character area + return level / (charWidth * charHeight); + } + + /** + * Converts a colour value to an averaged monochrome (greyscale) value + * + * @param col The colour to convert to monochrome + * @return The averaged monochrome value + */ + private function getMonochrome(col:uint):uint + { + // Add the red, green and blue components together and return the average + return 0xFF - (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3; + } + + /** + * Draws the ASCII effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the ASCII textfield from each pixel + var str:String = ""; + for (var y:int = 0; y < charsY; y++) + { + for (var x:int = 0; x < charsX; x++) + { + // Get the monochrome pixel value and convert it to an ASCII character + str += chars[int(getMonochrome(smallBitmap.getPixel(x, y)) / 0xFF * total)]; + } + str += "\r\n"; // New line + } + + // Draw the new ASCII textfield into the text bitmap data with a blurred background glow + textfield.text = str; + textBitmap.fillRect(rect, 0xFF000000); + textBitmap.draw(textfield, textMatrix); + sourceBitmap.applyFilter(textBitmap, rect, point, blur); + sourceBitmap.draw(textBitmap, null, null, BlendMode.ADD); + targetBitmap.draw(sourceBitmap, flipMatrix); + } + + /** + * Removes the ASCII effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + textBitmap.dispose(); + textBitmap = null; + textfield = null; + chars = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/HalftoneDot.as b/webcam/com/neave/webcam/effects/pixel/HalftoneDot.as index 4f4fb40..3e97578 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/HalftoneDot.as +++ b/webcam/com/neave/webcam/effects/pixel/HalftoneDot.as @@ -1,33 +1,33 @@ -/**
- * Neave Webcam // Halftone Dot
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
-
- final internal class HalftoneDot extends Shape
- {
- /**
- * Draws a halftone dot shape to be used with the halftone effect
- *
- * @param x The position of the dot on the x-axis
- * @param y The position of the dot on the y-axis
- * @param radius The radius of the dot
- */
- public function HalftoneDot(x:Number = 0, y:Number = 0, radius:Number = 1)
- {
- this.x = x;
- this.y = y;
- graphics.beginFill(0x000000);
- graphics.drawCircle(0, 0, radius);
- }
- }
+/** + * Neave Webcam // Halftone Dot + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + + final internal class HalftoneDot extends Shape + { + /** + * Draws a halftone dot shape to be used with the halftone effect + * + * @param x The position of the dot on the x-axis + * @param y The position of the dot on the y-axis + * @param radius The radius of the dot + */ + public function HalftoneDot(x:Number = 0, y:Number = 0, radius:Number = 1) + { + this.x = x; + this.y = y; + graphics.beginFill(0x000000); + graphics.drawCircle(0, 0, radius); + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/HalftoneEffect.as b/webcam/com/neave/webcam/effects/pixel/HalftoneEffect.as index 0b9cf3c..9ee7656 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/HalftoneEffect.as +++ b/webcam/com/neave/webcam/effects/pixel/HalftoneEffect.as @@ -1,135 +1,135 @@ -/**
- * Neave Webcam // Halftone Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class HalftoneEffect extends AbstractEffect
- {
- private var dotsWide:int;
- private var invert:Boolean;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var halftone:Sprite;
- private var dotsX:int;
- private var dotsY:int;
- private var size:Number;
-
- /**
- * Creates a halftone effect where each pixel is drawn as a variably-sized black dot, as used in the printing process
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param dotsWide The number of dots to use in width
- * @param invert Inverts the halftone effect so bright pixels create large dots
- */
- public function HalftoneEffect(source:IBitmapDrawable, targetBitmap:BitmapData, dotsWide:int = 40, invert:Boolean = false)
- {
- super(source, targetBitmap, "Halftone");
- this.dotsWide = dotsWide < 1 ? 1: dotsWide;
- this.invert = invert;
-
- createHalftone();
- }
-
- /**
- * Sets up the halftone effect
- */
- private function createHalftone():void
- {
- // Increase contrast
- color = new ColorTransform(1.5, 1.5, 1.5, 1, -50, -50, -50);
-
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(dotsWide, Math.round(dotsWide * rect.height / rect.width), false, 0xFF000000);
- dotsX = smallBitmap.width;
- dotsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(dotsX / rect.width, dotsY / rect.height);
- size = rect.width / dotsX;
-
- // Create a sprite containing all the halftone dots needed
- halftone = new Sprite();
- for (var y:int = dotsY; y--; )
- {
- for (var x:int = dotsX; x--; )
- {
- // Position each halftone dot, alternating the y-axis position between on pixel and halfway between pixels
- halftone.addChild(new HalftoneDot((x + 0.25 + (y % 2) * 0.5) * size, (y + 0.5) * size, size));
- }
- }
- }
-
- /**
- * Converts a colour value to an averaged monochrome (greyscale) value
- *
- * @param col The colour to convert to monochrome
- * @param inv Whether to invert the monochrome value
- * @return The averaged monochrome value
- */
- private function getMonochrome(col:uint, inv:Boolean):uint
- {
- // Add the red, green and blue components together and return the average
- var mono:uint = (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3;
- if (inv) return mono;
- else return 0xFF - mono;
- }
-
- /**
- * Draws the halftone effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the halftone dots from each pixel
- var n:int = 0;
- for (var y:int = dotsY; y--; )
- {
- for (var x:int = dotsX; x--; )
- {
- // Average this pixel's colour to a greyscale value
- var w:Number = getMonochrome(smallBitmap.getPixel(x, y), invert) / 0xFF * Math.SQRT2 * size;
-
- // Set this dot's size, alternating the y-axis position between on pixel and halfway between pixels
- var d:HalftoneDot = halftone.getChildAt(n) as HalftoneDot;
- d.width = d.height = (y % 2 == 0 || n == 0) ? w : (w + halftone.getChildAt(n - 1).width) / 2; // Average pixel values if this y-axis position is between pixels
- n++;
- }
- }
-
- // Draw the new halftone dots
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFFFFFFFF);
- targetBitmap.draw(halftone);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the halftone effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the halftone dots
- for (var i:int = dotsX * dotsY; i--; ) halftone.removeChildAt(i);
- halftone = null;
-
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Halftone Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class HalftoneEffect extends AbstractEffect + { + private var dotsWide:int; + private var invert:Boolean; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var halftone:Sprite; + private var dotsX:int; + private var dotsY:int; + private var size:Number; + + /** + * Creates a halftone effect where each pixel is drawn as a variably-sized black dot, as used in the printing process + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param dotsWide The number of dots to use in width + * @param invert Inverts the halftone effect so bright pixels create large dots + */ + public function HalftoneEffect(source:IBitmapDrawable, targetBitmap:BitmapData, dotsWide:int = 40, invert:Boolean = false) + { + super(source, targetBitmap, "Halftone"); + this.dotsWide = dotsWide < 1 ? 1: dotsWide; + this.invert = invert; + + createHalftone(); + } + + /** + * Sets up the halftone effect + */ + private function createHalftone():void + { + // Increase contrast + color = new ColorTransform(1.5, 1.5, 1.5, 1, -50, -50, -50); + + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(dotsWide, Math.round(dotsWide * rect.height / rect.width), false, 0xFF000000); + dotsX = smallBitmap.width; + dotsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(dotsX / rect.width, dotsY / rect.height); + size = rect.width / dotsX; + + // Create a sprite containing all the halftone dots needed + halftone = new Sprite(); + for (var y:int = dotsY; y--; ) + { + for (var x:int = dotsX; x--; ) + { + // Position each halftone dot, alternating the y-axis position between on pixel and halfway between pixels + halftone.addChild(new HalftoneDot((x + 0.25 + (y % 2) * 0.5) * size, (y + 0.5) * size, size)); + } + } + } + + /** + * Converts a colour value to an averaged monochrome (greyscale) value + * + * @param col The colour to convert to monochrome + * @param inv Whether to invert the monochrome value + * @return The averaged monochrome value + */ + private function getMonochrome(col:uint, inv:Boolean):uint + { + // Add the red, green and blue components together and return the average + var mono:uint = (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3; + if (inv) return mono; + else return 0xFF - mono; + } + + /** + * Draws the halftone effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the halftone dots from each pixel + var n:int = 0; + for (var y:int = dotsY; y--; ) + { + for (var x:int = dotsX; x--; ) + { + // Average this pixel's colour to a greyscale value + var w:Number = getMonochrome(smallBitmap.getPixel(x, y), invert) / 0xFF * Math.SQRT2 * size; + + // Set this dot's size, alternating the y-axis position between on pixel and halfway between pixels + var d:HalftoneDot = halftone.getChildAt(n) as HalftoneDot; + d.width = d.height = (y % 2 == 0 || n == 0) ? w : (w + halftone.getChildAt(n - 1).width) / 2; // Average pixel values if this y-axis position is between pixels + n++; + } + } + + // Draw the new halftone dots + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFFFFFFFF); + targetBitmap.draw(halftone); + targetBitmap.unlock(); + } + + /** + * Removes the halftone effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the halftone dots + for (var i:int = dotsX * dotsY; i--; ) halftone.removeChildAt(i); + halftone = null; + + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/PixelateEffect.as b/webcam/com/neave/webcam/effects/pixel/PixelateEffect.as index 8ff94d5..28d0d94 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/PixelateEffect.as +++ b/webcam/com/neave/webcam/effects/pixel/PixelateEffect.as @@ -1,75 +1,75 @@ -/**
- * Neave Webcam // Pixelate Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class PixelateEffect extends AbstractEffect
- {
- private var pixelsWide:int;
- private var smallBitmap:BitmapData;
- private var targetMatrix:Matrix;
-
- /**
- * Creates a low-resolution effect where pixels appear large
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param pixelsWide The number of pixels to use in width
- */
- public function PixelateEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 20)
- {
- super(source, targetBitmap, "Pixelate");
- this.pixelsWide = pixelsWide < 1 ? 1 : pixelsWide;
-
- createPixelate();
- }
-
- /**
- * Sets up the pixelate effect
- */
- private function createPixelate():void
- {
- // Create a low resolution bitmap data
- smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000);
-
- // Set up scaling of bitmaps from large to small to large again
- var sx:Number = smallBitmap.width / rect.width;
- var sy:Number = smallBitmap.height / rect.height;
- sourceMatrix.scale(sx, sy);
- targetMatrix = new Matrix();
- targetMatrix.scale(1 / sx, 1 / sy);
- }
-
- /**
- * Draws the pixelate effect
- */
- override public function draw():void
- {
- // Resize small then resize large
- smallBitmap.draw(source, sourceMatrix);
- targetBitmap.draw(smallBitmap, targetMatrix);
- }
-
- /**
- * Removes the pixelate effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Pixelate Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class PixelateEffect extends AbstractEffect + { + private var pixelsWide:int; + private var smallBitmap:BitmapData; + private var targetMatrix:Matrix; + + /** + * Creates a low-resolution effect where pixels appear large + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param pixelsWide The number of pixels to use in width + */ + public function PixelateEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 20) + { + super(source, targetBitmap, "Pixelate"); + this.pixelsWide = pixelsWide < 1 ? 1 : pixelsWide; + + createPixelate(); + } + + /** + * Sets up the pixelate effect + */ + private function createPixelate():void + { + // Create a low resolution bitmap data + smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000); + + // Set up scaling of bitmaps from large to small to large again + var sx:Number = smallBitmap.width / rect.width; + var sy:Number = smallBitmap.height / rect.height; + sourceMatrix.scale(sx, sy); + targetMatrix = new Matrix(); + targetMatrix.scale(1 / sx, 1 / sy); + } + + /** + * Draws the pixelate effect + */ + override public function draw():void + { + // Resize small then resize large + smallBitmap.draw(source, sourceMatrix); + targetBitmap.draw(smallBitmap, targetMatrix); + } + + /** + * Removes the pixelate effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/RGBEffect.as b/webcam/com/neave/webcam/effects/pixel/RGBEffect.as index 4d2b2ff..f05a090 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/RGBEffect.as +++ b/webcam/com/neave/webcam/effects/pixel/RGBEffect.as @@ -1,126 +1,126 @@ -/**
- * Neave Webcam // Red Green Blue Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class RGBEffect extends AbstractEffect
- {
- private const COLORS:Array = [0xFF0000, 0x00FF00, 0x0000FF];
-
- private var pixelsWide:int;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var pixels:Sprite;
- private var pixelsX:int;
- private var pixelsY:int;
- private var size:Number;
-
- /**
- * Creates a low-resolution effect where each pixel is split into its red, green and blue components
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param pixelsWide The number of pixels to use in width
- */
- public function RGBEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 40)
- {
- super(source, targetBitmap, "RGB");
- this.pixelsWide = pixelsWide < 3 ? 3 : pixelsWide;
-
- createRGB();
- }
-
- /**
- * Sets up the RGB effect
- */
- private function createRGB():void
- {
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000);
- pixelsX = smallBitmap.width;
- pixelsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(pixelsX / rect.width, pixelsY / rect.height);
- size = rect.width / pixelsX;
-
- // Create a sprite containing all the RGB pixels needed
- pixels = new Sprite();
- for (var y:int = pixelsY; y--; )
- {
- for (var x:int = pixelsX; x--; )
- {
- // Position each RGB pixel and set its colour to either red, green or blue
- pixels.addChild(new RGBPixel((x + 0.5) * size, (y + 0.5) * size, COLORS[x % 3], size));
- }
- }
- }
-
- /**
- * Draws the RGB effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the RGB pixels from each pixel
- var n:int = 0;
- for (var y:int = pixelsY; y--; )
- {
- for (var x:int = pixelsX; x--; )
- {
- // Set the brightness of this RGB pixel
- var c:uint = smallBitmap.getPixel(x, y);
- var p:RGBPixel = pixels.getChildAt(n++) as RGBPixel;
- switch (x % 3)
- {
- case 0: // Red
- p.alpha = ((c >> 16) & 0xFF) / 0xFF;
- break;
-
- case 1: // Green
- p.alpha = ((c >> 8) & 0xFF) / 0xFF;
- break;
-
- case 2: // Blue
- p.alpha = (c & 0xFF) / 0xFF;
- break;
- }
- }
- }
-
- // Draw the new RGB pixels
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFF000000);
- targetBitmap.draw(pixels);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the RGB effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the pixels
- for (var i:int = pixelsX * pixelsY; i--; ) pixels.removeChildAt(i);
- pixels = null;
-
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Red Green Blue Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class RGBEffect extends AbstractEffect + { + private const COLORS:Array = [0xFF0000, 0x00FF00, 0x0000FF]; + + private var pixelsWide:int; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var pixels:Sprite; + private var pixelsX:int; + private var pixelsY:int; + private var size:Number; + + /** + * Creates a low-resolution effect where each pixel is split into its red, green and blue components + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param pixelsWide The number of pixels to use in width + */ + public function RGBEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 40) + { + super(source, targetBitmap, "RGB"); + this.pixelsWide = pixelsWide < 3 ? 3 : pixelsWide; + + createRGB(); + } + + /** + * Sets up the RGB effect + */ + private function createRGB():void + { + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000); + pixelsX = smallBitmap.width; + pixelsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(pixelsX / rect.width, pixelsY / rect.height); + size = rect.width / pixelsX; + + // Create a sprite containing all the RGB pixels needed + pixels = new Sprite(); + for (var y:int = pixelsY; y--; ) + { + for (var x:int = pixelsX; x--; ) + { + // Position each RGB pixel and set its colour to either red, green or blue + pixels.addChild(new RGBPixel((x + 0.5) * size, (y + 0.5) * size, COLORS[x % 3], size)); + } + } + } + + /** + * Draws the RGB effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the RGB pixels from each pixel + var n:int = 0; + for (var y:int = pixelsY; y--; ) + { + for (var x:int = pixelsX; x--; ) + { + // Set the brightness of this RGB pixel + var c:uint = smallBitmap.getPixel(x, y); + var p:RGBPixel = pixels.getChildAt(n++) as RGBPixel; + switch (x % 3) + { + case 0: // Red + p.alpha = ((c >> 16) & 0xFF) / 0xFF; + break; + + case 1: // Green + p.alpha = ((c >> 8) & 0xFF) / 0xFF; + break; + + case 2: // Blue + p.alpha = (c & 0xFF) / 0xFF; + break; + } + } + } + + // Draw the new RGB pixels + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFF000000); + targetBitmap.draw(pixels); + targetBitmap.unlock(); + } + + /** + * Removes the RGB effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the pixels + for (var i:int = pixelsX * pixelsY; i--; ) pixels.removeChildAt(i); + pixels = null; + + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/com/neave/webcam/effects/pixel/RGBPixel.as b/webcam/com/neave/webcam/effects/pixel/RGBPixel.as index ababb10..1d92389 100755..100644 --- a/webcam/com/neave/webcam/effects/pixel/RGBPixel.as +++ b/webcam/com/neave/webcam/effects/pixel/RGBPixel.as @@ -1,34 +1,34 @@ -/**
- * Neave Webcam // Red Green Blue Pixel
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
-
- final internal class RGBPixel extends Shape
- {
- /**
- * Draws a simple square graphic to be used with the RGB effect
- *
- * @param x The position of the pixel on the x-axis
- * @param y The position of the pixel on the y-axis
- * @param color The colour of the pixel
- * @param size The size (width and height) of the pixel
- */
- public function RGBPixel(x:int = 0, y:int = 0, color:uint = 0, size:Number = 1)
- {
- this.x = x - size / 2;
- this.y = y - size / 2;
- graphics.beginFill(color);
- graphics.drawRect(0, 0, size, size);
- }
- }
+/** + * Neave Webcam // Red Green Blue Pixel + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + + final internal class RGBPixel extends Shape + { + /** + * Draws a simple square graphic to be used with the RGB effect + * + * @param x The position of the pixel on the x-axis + * @param y The position of the pixel on the y-axis + * @param color The colour of the pixel + * @param size The size (width and height) of the pixel + */ + public function RGBPixel(x:int = 0, y:int = 0, color:uint = 0, size:Number = 1) + { + this.x = x - size / 2; + this.y = y - size / 2; + graphics.beginFill(color); + graphics.drawRect(0, 0, size, size); + } + } }
\ No newline at end of file diff --git a/webcam/media/NeaveCamera.as b/webcam/media/NeaveCamera.as index f401af8..2b68201 100755..100644 --- a/webcam/media/NeaveCamera.as +++ b/webcam/media/NeaveCamera.as @@ -1,81 +1,81 @@ -/**
- * Neave Camera
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.media
-{
- import flash.events.*;
- import flash.media.*;
- import flash.system.*;
-
- public class NeaveCamera
- {
- /**
- * The requested width of the camera object
- */
- static public var CAMERA_WIDTH:int = 320;
-
- /**
- * The requested height of the camera object
- */
- static public var CAMERA_HEIGHT:int = 240;
-
- static private var cam:Camera;
-
- public function NeaveCamera() { }
-
- /**
- * Sets up and returns the camera object
- *
- * @return A camera object
- */
- static public function getCamera():Camera
- {
- // Return the same camera if it has been successfully requested before
- if (cam != null)
- {
- if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY);
- return cam;
- }
-
- // Get the camera
- cam = Camera.getCamera();
- if (cam != null)
- {
- // Set properties if a camera was found
- cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true);
- cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener);
- return cam;
- }
- else
- {
- // No camera found
- Security.showSettings(SecurityPanel.CAMERA);
- return new Camera();
- }
- }
-
- /**
- * Whether the camera object is available or not
- */
- static public function get muted():Boolean
- {
- return cam == null || cam.muted || cam.name == null || cam.width == 0;
- }
-
- /**
- * Camera status response
- */
- static private function statusListener(e:StatusEvent):void
- {
- if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA);
- }
- }
+/** + * Neave Camera + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + + public class NeaveCamera + { + /** + * The requested width of the camera object + */ + static public var CAMERA_WIDTH:int = 320; + + /** + * The requested height of the camera object + */ + static public var CAMERA_HEIGHT:int = 240; + + static private var cam:Camera; + + public function NeaveCamera() { } + + /** + * Sets up and returns the camera object + * + * @return A camera object + */ + static public function getCamera():Camera + { + // Return the same camera if it has been successfully requested before + if (cam != null) + { + if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY); + return cam; + } + + // Get the camera + cam = Camera.getCamera(); + if (cam != null) + { + // Set properties if a camera was found + cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true); + cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener); + return cam; + } + else + { + // No camera found + Security.showSettings(SecurityPanel.CAMERA); + return new Camera(); + } + } + + /** + * Whether the camera object is available or not + */ + static public function get muted():Boolean + { + return cam == null || cam.muted || cam.name == null || cam.width == 0; + } + + /** + * Camera status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA); + } + } }
\ No newline at end of file diff --git a/webcam/media/NeaveMicrophone.as b/webcam/media/NeaveMicrophone.as index 6a46ee7..4f6e6c1 100755..100644 --- a/webcam/media/NeaveMicrophone.as +++ b/webcam/media/NeaveMicrophone.as @@ -1,104 +1,104 @@ -/**
- * Neave Microphone
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.media
-{
- import flash.events.*;
- import flash.media.*;
- import flash.system.*;
- import flash.utils.*;
-
- public class NeaveMicrophone
- {
- static private var mic:Microphone;
- static private var gainTimer:Timer;
-
- public function NeaveMicrophone() { }
-
- /**
- * Sets up and returns the microphone object
- *
- * @return A microphone object
- */
- static public function getMicrophone():Microphone
- {
- // Return the same microphone if it has been successfully requested before
- if (mic != null)
- {
- if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY);
- else NeaveMicrophone.startAutoGain();
- return mic;
- }
-
- gainTimer = new Timer(100);
-
- // Get the microphone
- mic = Microphone.getMicrophone();
- if (mic != null)
- {
- // Set properties if a microphone was found
- mic.setLoopBack(true);
- mic.rate = 44;
- mic.gain = 25;
- mic.setSilenceLevel(0);
- mic.setUseEchoSuppression(true);
- mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers
- mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener);
-
- return mic;
- }
- else
- {
- // No microphone found
- Security.showSettings(SecurityPanel.MICROPHONE);
- return new Microphone();
- }
- }
-
- /**
- * Microphone status response
- */
- static private function statusListener(e:StatusEvent):void
- {
- if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain();
- else NeaveMicrophone.stopAutoGain();
- }
-
- /**
- * Set up gain control
- */
- static public function startAutoGain():void
- {
- gainTimer.start();
- if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain);
- }
-
- /**
- * Stop gain control
- */
- static public function stopAutoGain():void
- {
- gainTimer.stop();
- gainTimer.reset();
- gainTimer.removeEventListener(TimerEvent.TIMER, setGain);
- }
-
- /**
- * Dynamically adjust the microphone's gain value
- */
- static private function setGain(e:TimerEvent):void
- {
- if (mic.activityLevel < 15) mic.gain = 30;
- else if (mic.activityLevel > 90) mic.gain = 20;
- else mic.gain = 25;
- }
- }
+/** + * Neave Microphone + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + import flash.utils.*; + + public class NeaveMicrophone + { + static private var mic:Microphone; + static private var gainTimer:Timer; + + public function NeaveMicrophone() { } + + /** + * Sets up and returns the microphone object + * + * @return A microphone object + */ + static public function getMicrophone():Microphone + { + // Return the same microphone if it has been successfully requested before + if (mic != null) + { + if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY); + else NeaveMicrophone.startAutoGain(); + return mic; + } + + gainTimer = new Timer(100); + + // Get the microphone + mic = Microphone.getMicrophone(); + if (mic != null) + { + // Set properties if a microphone was found + mic.setLoopBack(true); + mic.rate = 44; + mic.gain = 25; + mic.setSilenceLevel(0); + mic.setUseEchoSuppression(true); + mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers + mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener); + + return mic; + } + else + { + // No microphone found + Security.showSettings(SecurityPanel.MICROPHONE); + return new Microphone(); + } + } + + /** + * Microphone status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain(); + else NeaveMicrophone.stopAutoGain(); + } + + /** + * Set up gain control + */ + static public function startAutoGain():void + { + gainTimer.start(); + if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Stop gain control + */ + static public function stopAutoGain():void + { + gainTimer.stop(); + gainTimer.reset(); + gainTimer.removeEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Dynamically adjust the microphone's gain value + */ + static private function setGain(e:TimerEvent):void + { + if (mic.activityLevel < 15) mic.gain = 30; + else if (mic.activityLevel > 90) mic.gain = 20; + else mic.gain = 25; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/NeaveWebcam.as b/webcam/webcam/NeaveWebcam.as index 811446b..c63b7ef 100755..100644 --- a/webcam/webcam/NeaveWebcam.as +++ b/webcam/webcam/NeaveWebcam.as @@ -1,196 +1,196 @@ -/**
- * Neave Webcam ...play with webcam effects
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * @author Paul Neave
- * @version 1.0.0
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam
-{
- import flash.display.*;
- import flash.events.*;
- import flash.media.*;
- import flash.ui.*;
- import com.neave.media.*;
- import com.neave.webcam.effects.*;
-
- public class NeaveWebcam extends Sprite
- {
- // Main variables
- private var camera:Camera;
- private var video:Video;
- private var videoBitmap:Bitmap;
- private var videoContainer:Sprite;
- private var uiEnabled:Boolean;
-
- /**
- * Manages the webcam effects
- */
- public var effects:EffectsManager;
-
- /**
- * Creates a new instance of Neave Webcam
- *
- * @param camera The camera object to use to create the webcam effects
- * @param interactive Enable mouse click or arrow keys to change the webcam effect
- */
- public function NeaveWebcam(camera:Camera, interactive:Boolean = true)
- {
- this.camera = camera;
-
- initVideo();
- initEffects();
-
- this.interactive = interactive;
- }
-
- /**
- * Sets up the main video object
- */
- private function initVideo():void
- {
- // Video dimensions must be 320x240 or higher
- var w:int = camera.width < NeaveCamera.CAMERA_WIDTH ? NeaveCamera.CAMERA_WIDTH : camera.width;
- var h:int = camera.height < NeaveCamera.CAMERA_HEIGHT ? NeaveCamera.CAMERA_HEIGHT : camera.height;
-
- // Attach the camera object a video object
- video = new Video(w, h);
- video.attachCamera(camera);
-
- // Create a bitmap object for the video effect, flipping to create a mirror image
- videoBitmap = new Bitmap(new BitmapData(w, h, false, 0xFF000000), PixelSnapping.AUTO, false);
- videoBitmap.scaleX = -1;
- videoBitmap.x = w;
-
- // Create a sprite to hold the bitmap
- videoContainer = new Sprite();
- videoContainer.addChild(videoBitmap);
- addChild(videoContainer);
- }
-
- /**
- * Sets up the webcam effects for the video object
- */
- private function initEffects():void
- {
- // Set up the effects manager for this video object
- effects = new EffectsManager(video, videoBitmap.bitmapData);
- paused = false;
- }
-
- /**
- * Enable mouse click or arrow keys to change the webcam effect
- */
- public function set interactive(i:Boolean):void
- {
- uiEnabled = i;
-
- if (uiEnabled)
- {
- // Arrow keys select previous or next webcam effect
- addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
-
- // Clicking on the video selects the next webcam effect
- videoContainer.addEventListener(MouseEvent.CLICK, videoClickListener);
- videoContainer.buttonMode = true;
- }
- else
- {
- // Remove interactivity
- removeEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
- videoContainer.removeEventListener(MouseEvent.CLICK, videoClickListener);
- videoContainer.buttonMode = false;
- }
- }
-
- /**
- * Moves to the next webcam effect on mouse click
- */
- private function videoClickListener(e:MouseEvent):void
- {
- if (paused || camera.muted || camera.width == 0) return;
-
- effects.nextEffect();
- }
-
- /**
- * Moves to the next or previous webcam effect when the arrow keys are pressed
- */
- private function keyDownListener(e:KeyboardEvent):void
- {
- if (paused || camera.muted || camera.width == 0) return;
-
- switch (e.keyCode)
- {
- case Keyboard.LEFT:
- effects.previousEffect();
- break;
-
- case Keyboard.RIGHT:
- effects.nextEffect();
- break;
- }
- }
-
- /**
- * The bitmap data containing the current webcam effect
- */
- public function get effectBitmap():BitmapData
- {
- return videoBitmap.bitmapData;
- }
-
- /**
- * Pause or resume the current webcam effect
- */
- public function set paused(p:Boolean):void
- {
- if (p == paused) return;
-
- // Pause or resume updating the current webcam effect every frame
- if (p) removeEventListener(Event.ENTER_FRAME, update);
- else addEventListener(Event.ENTER_FRAME, update);
- }
-
- /**
- * Pause or resume the current webcam effect
- */
- public function get paused():Boolean
- {
- return !hasEventListener(Event.ENTER_FRAME);
- }
-
- /**
- * Removes the webcam and all other referenced objects
- */
- public function destroy():void
- {
- interactive = false;
- paused = true;
- effects.destroy();
- videoContainer.removeChild(videoBitmap);
- videoBitmap.bitmapData.dispose();
- videoBitmap.bitmapData = null;
- videoBitmap = null;
- removeChild(videoContainer);
- videoContainer = null;
- video = null;
- camera = null;
- }
-
- /**
- * Updates the current webcam effect
- */
- private function update(e:Event):void
- {
- effects.update();
- }
- }
+/** + * Neave Webcam ...play with webcam effects + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * @author Paul Neave + * @version 1.0.0 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam +{ + import flash.display.*; + import flash.events.*; + import flash.media.*; + import flash.ui.*; + import com.neave.media.*; + import com.neave.webcam.effects.*; + + public class NeaveWebcam extends Sprite + { + // Main variables + private var camera:Camera; + private var video:Video; + private var videoBitmap:Bitmap; + private var videoContainer:Sprite; + private var uiEnabled:Boolean; + + /** + * Manages the webcam effects + */ + public var effects:EffectsManager; + + /** + * Creates a new instance of Neave Webcam + * + * @param camera The camera object to use to create the webcam effects + * @param interactive Enable mouse click or arrow keys to change the webcam effect + */ + public function NeaveWebcam(camera:Camera, interactive:Boolean = true) + { + this.camera = camera; + + initVideo(); + initEffects(); + + this.interactive = interactive; + } + + /** + * Sets up the main video object + */ + private function initVideo():void + { + // Video dimensions must be 320x240 or higher + var w:int = camera.width < NeaveCamera.CAMERA_WIDTH ? NeaveCamera.CAMERA_WIDTH : camera.width; + var h:int = camera.height < NeaveCamera.CAMERA_HEIGHT ? NeaveCamera.CAMERA_HEIGHT : camera.height; + + // Attach the camera object a video object + video = new Video(w, h); + video.attachCamera(camera); + + // Create a bitmap object for the video effect, flipping to create a mirror image + videoBitmap = new Bitmap(new BitmapData(w, h, false, 0xFF000000), PixelSnapping.AUTO, false); + videoBitmap.scaleX = -1; + videoBitmap.x = w; + + // Create a sprite to hold the bitmap + videoContainer = new Sprite(); + videoContainer.addChild(videoBitmap); + addChild(videoContainer); + } + + /** + * Sets up the webcam effects for the video object + */ + private function initEffects():void + { + // Set up the effects manager for this video object + effects = new EffectsManager(video, videoBitmap.bitmapData); + paused = false; + } + + /** + * Enable mouse click or arrow keys to change the webcam effect + */ + public function set interactive(i:Boolean):void + { + uiEnabled = i; + + if (uiEnabled) + { + // Arrow keys select previous or next webcam effect + addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); + + // Clicking on the video selects the next webcam effect + videoContainer.addEventListener(MouseEvent.CLICK, videoClickListener); + videoContainer.buttonMode = true; + } + else + { + // Remove interactivity + removeEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); + videoContainer.removeEventListener(MouseEvent.CLICK, videoClickListener); + videoContainer.buttonMode = false; + } + } + + /** + * Moves to the next webcam effect on mouse click + */ + private function videoClickListener(e:MouseEvent):void + { + if (paused || camera.muted || camera.width == 0) return; + + effects.nextEffect(); + } + + /** + * Moves to the next or previous webcam effect when the arrow keys are pressed + */ + private function keyDownListener(e:KeyboardEvent):void + { + if (paused || camera.muted || camera.width == 0) return; + + switch (e.keyCode) + { + case Keyboard.LEFT: + effects.previousEffect(); + break; + + case Keyboard.RIGHT: + effects.nextEffect(); + break; + } + } + + /** + * The bitmap data containing the current webcam effect + */ + public function get effectBitmap():BitmapData + { + return videoBitmap.bitmapData; + } + + /** + * Pause or resume the current webcam effect + */ + public function set paused(p:Boolean):void + { + if (p == paused) return; + + // Pause or resume updating the current webcam effect every frame + if (p) removeEventListener(Event.ENTER_FRAME, update); + else addEventListener(Event.ENTER_FRAME, update); + } + + /** + * Pause or resume the current webcam effect + */ + public function get paused():Boolean + { + return !hasEventListener(Event.ENTER_FRAME); + } + + /** + * Removes the webcam and all other referenced objects + */ + public function destroy():void + { + interactive = false; + paused = true; + effects.destroy(); + videoContainer.removeChild(videoBitmap); + videoBitmap.bitmapData.dispose(); + videoBitmap.bitmapData = null; + videoBitmap = null; + removeChild(videoContainer); + videoContainer = null; + video = null; + camera = null; + } + + /** + * Updates the current webcam effect + */ + private function update(e:Event):void + { + effects.update(); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/AbstractEffect.as b/webcam/webcam/effects/AbstractEffect.as index a0fb241..24e9957 100755..100644 --- a/webcam/webcam/effects/AbstractEffect.as +++ b/webcam/webcam/effects/AbstractEffect.as @@ -1,81 +1,81 @@ -/**
- * Neave Webcam // Abstract Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- import flash.display.*;
- import flash.geom.*;
-
- public class AbstractEffect
- {
- protected var source:IBitmapDrawable;
- protected var targetBitmap:BitmapData;
- protected var name:String;
- protected var sourceBitmap:BitmapData;
- protected var sourceMatrix:Matrix;
- protected var rect:Rectangle;
- protected var point:Point;
- protected var color:ColorTransform;
-
- /**
- * An abstract effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- this.source = source;
- this.targetBitmap = targetBitmap;
- this.name = name;
-
- createEffect();
- }
-
- /**
- * Sets up the effect
- */
- private function createEffect():void
- {
- sourceBitmap = targetBitmap.clone();
- sourceMatrix = new Matrix();
- rect = targetBitmap.rect;
- point = new Point();
- color = new ColorTransform();
- }
-
- /**
- * The proper name of the effect
- */
- public function get effectName():String
- {
- return name;
- }
-
- /**
- * Draws the effect
- */
- public function draw():void
- {
- sourceBitmap.draw(source, sourceMatrix, color);
- }
-
- /**
- * Removes the effect and all other referenced objects
- */
- public function destroy():void
- {
- sourceBitmap.dispose();
- sourceBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + import flash.display.*; + import flash.geom.*; + + public class AbstractEffect + { + protected var source:IBitmapDrawable; + protected var targetBitmap:BitmapData; + protected var name:String; + protected var sourceBitmap:BitmapData; + protected var sourceMatrix:Matrix; + protected var rect:Rectangle; + protected var point:Point; + protected var color:ColorTransform; + + /** + * An abstract effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + this.source = source; + this.targetBitmap = targetBitmap; + this.name = name; + + createEffect(); + } + + /** + * Sets up the effect + */ + private function createEffect():void + { + sourceBitmap = targetBitmap.clone(); + sourceMatrix = new Matrix(); + rect = targetBitmap.rect; + point = new Point(); + color = new ColorTransform(); + } + + /** + * The proper name of the effect + */ + public function get effectName():String + { + return name; + } + + /** + * Draws the effect + */ + public function draw():void + { + sourceBitmap.draw(source, sourceMatrix, color); + } + + /** + * Removes the effect and all other referenced objects + */ + public function destroy():void + { + sourceBitmap.dispose(); + sourceBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/EffectEvent.as b/webcam/webcam/effects/EffectEvent.as index 134b792..9d1dbe3 100755..100644 --- a/webcam/webcam/effects/EffectEvent.as +++ b/webcam/webcam/effects/EffectEvent.as @@ -1,23 +1,23 @@ -package com.neave.webcam.effects
-{
- import flash.events.*;
-
- public class EffectEvent extends Event
- {
- public static const NEW_EFFECT:String = "newEffect";
-
- private var _effectType:int;
-
- public function EffectEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, effectType:int = 0)
- {
- super(type, bubbles, cancelable);
-
- _effectType = effectType;
- }
-
- public function get effectType():int
- {
- return _effectType;
- }
- }
+package com.neave.webcam.effects +{ + import flash.events.*; + + public class EffectEvent extends Event + { + public static const NEW_EFFECT:String = "newEffect"; + + private var _effectType:int; + + public function EffectEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, effectType:int = 0) + { + super(type, bubbles, cancelable); + + _effectType = effectType; + } + + public function get effectType():int + { + return _effectType; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/EffectType.as b/webcam/webcam/effects/EffectType.as index af5abea..e471310 100755..100644 --- a/webcam/webcam/effects/EffectType.as +++ b/webcam/webcam/effects/EffectType.as @@ -1,55 +1,55 @@ -/**
- * Neave Webcam // Effects Type
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- final public class EffectType
- {
- static public const NORMAL :int = 0;
- static public const MIRROR_LEFT :int = 1;
- static public const MIRROR_RIGHT :int = 2;
- static public const MIRROR_TOP :int = 3;
- static public const MIRROR_BOTTOM :int = 4;
- static public const MIRROR_INVERSE :int = 5;
- static public const MIRROR_QUAD :int = 6;
- static public const UPSIDE_DOWN :int = 7;
- static public const DIVIDE :int = 8;
- static public const FILMSTRIP :int = 9;
- static public const FRAGMENT :int = 10;
- static public const GHOST :int = 11;
- static public const TRAIL :int = 12;
- static public const BULGE :int = 13;
- static public const FISHEYE :int = 14;
- static public const FISHBOWL :int = 15;
- static public const DENT :int = 16;
- static public const SQUEEZE :int = 17;
- static public const WATER :int = 18;
- static public const FIRE :int = 19;
- static public const SNOW :int = 20;
- static public const STEAM :int = 21;
- static public const SWARM :int = 22;
- static public const PIXELATE :int = 23;
- static public const RGB :int = 24;
- static public const HALFTONE :int = 25;
- static public const MONOCHROME :int = 26;
- static public const SEPIA :int = 27;
- static public const RAINBOW :int = 28;
- static public const ASCII :int = 29;
- static public const X_RAY :int = 30;
- static public const WARHOL :int = 31;
- static public const GLOW :int = 32;
- static public const SLIT_SCAN :int = 33;
-
- static public const TOTAL_EFFECTS :int = 33;
-
- public function EffectType() { }
- }
+/** + * Neave Webcam // Effects Type + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + final public class EffectType + { + static public const NORMAL :int = 0; + static public const MIRROR_LEFT :int = 1; + static public const MIRROR_RIGHT :int = 2; + static public const MIRROR_TOP :int = 3; + static public const MIRROR_BOTTOM :int = 4; + static public const MIRROR_INVERSE :int = 5; + static public const MIRROR_QUAD :int = 6; + static public const UPSIDE_DOWN :int = 7; + static public const DIVIDE :int = 8; + static public const FILMSTRIP :int = 9; + static public const FRAGMENT :int = 10; + static public const GHOST :int = 11; + static public const TRAIL :int = 12; + static public const BULGE :int = 13; + static public const FISHEYE :int = 14; + static public const FISHBOWL :int = 15; + static public const DENT :int = 16; + static public const SQUEEZE :int = 17; + static public const WATER :int = 18; + static public const FIRE :int = 19; + static public const SNOW :int = 20; + static public const STEAM :int = 21; + static public const SWARM :int = 22; + static public const PIXELATE :int = 23; + static public const RGB :int = 24; + static public const HALFTONE :int = 25; + static public const MONOCHROME :int = 26; + static public const SEPIA :int = 27; + static public const RAINBOW :int = 28; + static public const ASCII :int = 29; + static public const X_RAY :int = 30; + static public const WARHOL :int = 31; + static public const GLOW :int = 32; + static public const SLIT_SCAN :int = 33; + + static public const TOTAL_EFFECTS :int = 33; + + public function EffectType() { } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/EffectsManager.as b/webcam/webcam/effects/EffectsManager.as index 57eac59..6e31135 100755..100644 --- a/webcam/webcam/effects/EffectsManager.as +++ b/webcam/webcam/effects/EffectsManager.as @@ -1,156 +1,156 @@ -/**
- * Neave Webcam // Effects Manager
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- import flash.display.*;
- import flash.events.*;
- import com.neave.webcam.effects.color.*;
- import com.neave.webcam.effects.delay.*;
- import com.neave.webcam.effects.displace.*;
- import com.neave.webcam.effects.mirror.*;
- import com.neave.webcam.effects.motion.*;
- import com.neave.webcam.effects.pixel.*;
-
- public class EffectsManager extends EventDispatcher
- {
- private var source:IBitmapDrawable;
- private var targetBitmap:BitmapData;
- private var effect:AbstractEffect;
- private var chosenEffect:int;
-
- /**
- * Manages all of the webcam effects
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function EffectsManager(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- this.source = source;
- this.targetBitmap = targetBitmap;
-
- // Start with the normal effect
- effectType = EffectType.NORMAL;
- }
-
- /**
- * Sets the effect to the next effect in the EffectType class
- */
- public function nextEffect():void
- {
- effectType = chosenEffect + 1;
- }
-
- /**
- * Sets the effect to the previous effect in the EffectType class
- */
- public function previousEffect():void
- {
- effectType = chosenEffect - 1;
- }
-
- /**
- * An integer representing the current effect in the EffectType class
- */
- public function set effectType(type:int):void
- {
- // Remove the previous effect
- if (effect != null) effect.destroy();
-
- // Wrap the chosen effect within the total effects available
- if (type > EffectType.TOTAL_EFFECTS) type = 0;
- if (type < 0) type = EffectType.TOTAL_EFFECTS;
-
- // Set the effect
- switch (type)
- {
- case EffectType.MIRROR_LEFT: effect = new LeftMirrorEffect (source, targetBitmap); break;
- case EffectType.MIRROR_RIGHT: effect = new RightMirrorEffect (source, targetBitmap); break;
- case EffectType.MIRROR_TOP: effect = new TopMirrorEffect (source, targetBitmap); break;
- case EffectType.MIRROR_BOTTOM: effect = new BottomMirrorEffect (source, targetBitmap); break;
- case EffectType.MIRROR_INVERSE: effect = new InverseMirrorEffect (source, targetBitmap); break;
- case EffectType.MIRROR_QUAD: effect = new QuadMirrorEffect (source, targetBitmap); break;
- case EffectType.UPSIDE_DOWN: effect = new UpsideDownEffect (source, targetBitmap); break;
- case EffectType.DIVIDE: effect = new DivideEffect (source, targetBitmap); break;
- case EffectType.FILMSTRIP: effect = new FilmstripEffect (source, targetBitmap); break;
- case EffectType.FRAGMENT: effect = new FragmentEffect (source, targetBitmap); break;
- case EffectType.GHOST: effect = new GhostEffect (source, targetBitmap); break;
- case EffectType.TRAIL: effect = new TrailEffect (source, targetBitmap); break;
- case EffectType.BULGE: effect = new BulgeEffect (source, targetBitmap); break;
- case EffectType.FISHEYE: effect = new FisheyeEffect (source, targetBitmap); break;
- case EffectType.FISHBOWL: effect = new FishbowlEffect (source, targetBitmap); break;
- case EffectType.DENT: effect = new DentEffect (source, targetBitmap); break;
- case EffectType.SQUEEZE: effect = new SqueezeEffect (source, targetBitmap); break;
- case EffectType.WATER: effect = new WaterEffect (source, targetBitmap); break;
- case EffectType.FIRE: effect = new FireEffect (source, targetBitmap); break;
- case EffectType.SNOW: effect = new SnowEffect (source, targetBitmap); break;
- case EffectType.STEAM: effect = new SteamEffect (source, targetBitmap); break;
- case EffectType.SWARM: effect = new SwarmEffect (source, targetBitmap); break;
- case EffectType.PIXELATE: effect = new PixelateEffect (source, targetBitmap); break;
- case EffectType.RGB: effect = new RGBEffect (source, targetBitmap); break;
- case EffectType.HALFTONE: effect = new HalftoneEffect (source, targetBitmap); break;
- case EffectType.MONOCHROME: effect = new MonochromeEffect (source, targetBitmap); break;
- case EffectType.SEPIA: effect = new SepiaEffect (source, targetBitmap); break;
- case EffectType.RAINBOW: effect = new RainbowEffect (source, targetBitmap); break;
- case EffectType.ASCII: effect = new ASCIIEffect (source, targetBitmap); break;
- case EffectType.X_RAY: effect = new XRayEffect (source, targetBitmap); break;
- case EffectType.WARHOL: effect = new WarholEffect (source, targetBitmap); break;
- case EffectType.GLOW: effect = new GlowEffect (source, targetBitmap); break;
- case EffectType.SLIT_SCAN: effect = new SlitScanEffect (source, targetBitmap); break;
- case EffectType.NORMAL:
- default:
- // Use a normal effect if the passed effect type is not valid
- type = EffectType.NORMAL;
- effect = new NormalEffect(source, targetBitmap);
- break;
- }
-
- // Remember the chosen effect
- chosenEffect = type;
-
- // Tell anything listening that a new effect has been chosen
- dispatchEvent(new EffectEvent(EffectEvent.NEW_EFFECT, false, false, chosenEffect));
- }
-
- /**
- * An integer representing the current effect in the EffectType class
- */
- public function get effectType():int
- {
- return chosenEffect;
- }
-
- /**
- * The proper name of the current effect
- */
- public function get effectName():String
- {
- return effect.effectName;
- }
-
- /**
- * Updates the appearance of the current effect
- */
- public function update():void
- {
- effect.draw();
- }
-
- /**
- * Removes the current effect
- */
- public function destroy():void
- {
- effect.destroy();
- }
- }
+/** + * Neave Webcam // Effects Manager + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + import flash.display.*; + import flash.events.*; + import com.neave.webcam.effects.color.*; + import com.neave.webcam.effects.delay.*; + import com.neave.webcam.effects.displace.*; + import com.neave.webcam.effects.mirror.*; + import com.neave.webcam.effects.motion.*; + import com.neave.webcam.effects.pixel.*; + + public class EffectsManager extends EventDispatcher + { + private var source:IBitmapDrawable; + private var targetBitmap:BitmapData; + private var effect:AbstractEffect; + private var chosenEffect:int; + + /** + * Manages all of the webcam effects + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function EffectsManager(source:IBitmapDrawable, targetBitmap:BitmapData) + { + this.source = source; + this.targetBitmap = targetBitmap; + + // Start with the normal effect + effectType = EffectType.NORMAL; + } + + /** + * Sets the effect to the next effect in the EffectType class + */ + public function nextEffect():void + { + effectType = chosenEffect + 1; + } + + /** + * Sets the effect to the previous effect in the EffectType class + */ + public function previousEffect():void + { + effectType = chosenEffect - 1; + } + + /** + * An integer representing the current effect in the EffectType class + */ + public function set effectType(type:int):void + { + // Remove the previous effect + if (effect != null) effect.destroy(); + + // Wrap the chosen effect within the total effects available + if (type > EffectType.TOTAL_EFFECTS) type = 0; + if (type < 0) type = EffectType.TOTAL_EFFECTS; + + // Set the effect + switch (type) + { + case EffectType.MIRROR_LEFT: effect = new LeftMirrorEffect (source, targetBitmap); break; + case EffectType.MIRROR_RIGHT: effect = new RightMirrorEffect (source, targetBitmap); break; + case EffectType.MIRROR_TOP: effect = new TopMirrorEffect (source, targetBitmap); break; + case EffectType.MIRROR_BOTTOM: effect = new BottomMirrorEffect (source, targetBitmap); break; + case EffectType.MIRROR_INVERSE: effect = new InverseMirrorEffect (source, targetBitmap); break; + case EffectType.MIRROR_QUAD: effect = new QuadMirrorEffect (source, targetBitmap); break; + case EffectType.UPSIDE_DOWN: effect = new UpsideDownEffect (source, targetBitmap); break; + case EffectType.DIVIDE: effect = new DivideEffect (source, targetBitmap); break; + case EffectType.FILMSTRIP: effect = new FilmstripEffect (source, targetBitmap); break; + case EffectType.FRAGMENT: effect = new FragmentEffect (source, targetBitmap); break; + case EffectType.GHOST: effect = new GhostEffect (source, targetBitmap); break; + case EffectType.TRAIL: effect = new TrailEffect (source, targetBitmap); break; + case EffectType.BULGE: effect = new BulgeEffect (source, targetBitmap); break; + case EffectType.FISHEYE: effect = new FisheyeEffect (source, targetBitmap); break; + case EffectType.FISHBOWL: effect = new FishbowlEffect (source, targetBitmap); break; + case EffectType.DENT: effect = new DentEffect (source, targetBitmap); break; + case EffectType.SQUEEZE: effect = new SqueezeEffect (source, targetBitmap); break; + case EffectType.WATER: effect = new WaterEffect (source, targetBitmap); break; + case EffectType.FIRE: effect = new FireEffect (source, targetBitmap); break; + case EffectType.SNOW: effect = new SnowEffect (source, targetBitmap); break; + case EffectType.STEAM: effect = new SteamEffect (source, targetBitmap); break; + case EffectType.SWARM: effect = new SwarmEffect (source, targetBitmap); break; + case EffectType.PIXELATE: effect = new PixelateEffect (source, targetBitmap); break; + case EffectType.RGB: effect = new RGBEffect (source, targetBitmap); break; + case EffectType.HALFTONE: effect = new HalftoneEffect (source, targetBitmap); break; + case EffectType.MONOCHROME: effect = new MonochromeEffect (source, targetBitmap); break; + case EffectType.SEPIA: effect = new SepiaEffect (source, targetBitmap); break; + case EffectType.RAINBOW: effect = new RainbowEffect (source, targetBitmap); break; + case EffectType.ASCII: effect = new ASCIIEffect (source, targetBitmap); break; + case EffectType.X_RAY: effect = new XRayEffect (source, targetBitmap); break; + case EffectType.WARHOL: effect = new WarholEffect (source, targetBitmap); break; + case EffectType.GLOW: effect = new GlowEffect (source, targetBitmap); break; + case EffectType.SLIT_SCAN: effect = new SlitScanEffect (source, targetBitmap); break; + case EffectType.NORMAL: + default: + // Use a normal effect if the passed effect type is not valid + type = EffectType.NORMAL; + effect = new NormalEffect(source, targetBitmap); + break; + } + + // Remember the chosen effect + chosenEffect = type; + + // Tell anything listening that a new effect has been chosen + dispatchEvent(new EffectEvent(EffectEvent.NEW_EFFECT, false, false, chosenEffect)); + } + + /** + * An integer representing the current effect in the EffectType class + */ + public function get effectType():int + { + return chosenEffect; + } + + /** + * The proper name of the current effect + */ + public function get effectName():String + { + return effect.effectName; + } + + /** + * Updates the appearance of the current effect + */ + public function update():void + { + effect.draw(); + } + + /** + * Removes the current effect + */ + public function destroy():void + { + effect.destroy(); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/NormalEffect.as b/webcam/webcam/effects/NormalEffect.as index b97e896..584629a 100755..100644 --- a/webcam/webcam/effects/NormalEffect.as +++ b/webcam/webcam/effects/NormalEffect.as @@ -1,38 +1,38 @@ -/**
- * Neave Webcam // Normal Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects
-{
- import flash.display.*;
-
- public class NormalEffect extends AbstractEffect
- {
- /**
- * Creates a normal effect for copying the source object into the target bitmap data without modification
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function NormalEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Normal");
- }
-
- /**
- * Draws the normal effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
- }
+/** + * Neave Webcam // Normal Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects +{ + import flash.display.*; + + public class NormalEffect extends AbstractEffect + { + /** + * Creates a normal effect for copying the source object into the target bitmap data without modification + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function NormalEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Normal"); + } + + /** + * Draws the normal effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/GlowEffect.as b/webcam/webcam/effects/color/GlowEffect.as index 5c96e71..64cdfa0 100755..100644 --- a/webcam/webcam/effects/color/GlowEffect.as +++ b/webcam/webcam/effects/color/GlowEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Glow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class GlowEffect extends AbstractEffect
- {
- private var edge:ConvolutionFilter;
- private var blur:BlurFilter;
-
- /**
- * Creates a high constrast glow effect around surface edges
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function GlowEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Glow");
-
- createGlow();
- }
-
- /**
- * Sets up the glow effect
- */
- private function createGlow():void
- {
- // Increase contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Set up a large horizontal edge convoluton filter
- var m:Array =
- [
- -100, -100, -100,
- 100, 100, 100,
- 0, 0, 0
- ];
- edge = new ConvolutionFilter(3, 3, m, 9);
-
- // Blur the edges to create a smooth glow
- blur = new BlurFilter(8, 8, 2);
- }
-
- /**
- * Draws the glow effect
- */
- override public function draw():void
- {
- super.draw();
- sourceBitmap.applyFilter(sourceBitmap, rect, point, blur);
- targetBitmap.applyFilter(sourceBitmap, rect, point, edge);
- }
- }
+/** + * Neave Webcam // Glow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class GlowEffect extends AbstractEffect + { + private var edge:ConvolutionFilter; + private var blur:BlurFilter; + + /** + * Creates a high constrast glow effect around surface edges + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function GlowEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Glow"); + + createGlow(); + } + + /** + * Sets up the glow effect + */ + private function createGlow():void + { + // Increase contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Set up a large horizontal edge convoluton filter + var m:Array = + [ + -100, -100, -100, + 100, 100, 100, + 0, 0, 0 + ]; + edge = new ConvolutionFilter(3, 3, m, 9); + + // Blur the edges to create a smooth glow + blur = new BlurFilter(8, 8, 2); + } + + /** + * Draws the glow effect + */ + override public function draw():void + { + super.draw(); + sourceBitmap.applyFilter(sourceBitmap, rect, point, blur); + targetBitmap.applyFilter(sourceBitmap, rect, point, edge); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/MonochromeEffect.as b/webcam/webcam/effects/color/MonochromeEffect.as index ed14de9..9657bb2 100755..100644 --- a/webcam/webcam/effects/color/MonochromeEffect.as +++ b/webcam/webcam/effects/color/MonochromeEffect.as @@ -1,61 +1,61 @@ -/**
- * Neave Webcam // Monochrome (Black & White) Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class MonochromeEffect extends AbstractEffect
- {
- private var monochrome:ColorMatrixFilter;
-
- /**
- * Creates a high contrast black and white monochrome effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function MonochromeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Black & White");
-
- createMonochrome();
- }
-
- /**
- * Sets up the monochrome effect
- */
- private function createMonochrome():void
- {
- // Add punch with more contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Monochrome colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- monochrome = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the monochrome effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, monochrome);
- }
- }
+/** + * Neave Webcam // Monochrome (Black & White) Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class MonochromeEffect extends AbstractEffect + { + private var monochrome:ColorMatrixFilter; + + /** + * Creates a high contrast black and white monochrome effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function MonochromeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Black & White"); + + createMonochrome(); + } + + /** + * Sets up the monochrome effect + */ + private function createMonochrome():void + { + // Add punch with more contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Monochrome colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + monochrome = new ColorMatrixFilter(m); + } + + /** + * Draws the monochrome effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, monochrome); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/RainbowEffect.as b/webcam/webcam/effects/color/RainbowEffect.as index 3b5b70b..13f21ab 100755..100644 --- a/webcam/webcam/effects/color/RainbowEffect.as +++ b/webcam/webcam/effects/color/RainbowEffect.as @@ -1,90 +1,90 @@ -/**
- * Neave Webcam // Rainbow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class RainbowEffect extends AbstractEffect
- {
- private var red:Array;
- private var green:Array;
- private var blue:Array;
-
- /**
- * Creates a psychedelic colour-cycling effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function RainbowEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Rainbow");
-
- createRainbow();
- }
-
- /**
- * Sets up the rainbow effect
- */
- private function createRainbow():void
- {
- // Add punch with more contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Set up colour arrays
- red = new Array(256);
- green = new Array(256);
- blue = new Array(256);
-
- // Populate colour arrays with a curved gradient
- for (var i:int = 0; i < 256; i++)
- {
- red[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 16;
- green[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 8;
- blue[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF;
- }
- }
-
- /**
- * Draws the rainbow effect
- */
- override public function draw():void
- {
- super.draw();
-
- red.push(red.splice(0, 1));
- green.unshift(green.pop());
- green.unshift(green.pop());
- if (Math.random() < 0.5) green.unshift(green.pop());
- blue.unshift(blue.pop());
- blue.unshift(blue.pop());
- blue.unshift(blue.pop());
- if (Math.random() < 0.5) blue.unshift(blue.pop());
- if (Math.random() < 0.5) blue.unshift(blue.pop());
-
- targetBitmap.paletteMap(sourceBitmap, rect, point, red, green, blue);
- }
-
- /**
- * Removes the rainbow effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- red = null;
- green = null;
- blue = null;
- }
- }
+/** + * Neave Webcam // Rainbow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class RainbowEffect extends AbstractEffect + { + private var red:Array; + private var green:Array; + private var blue:Array; + + /** + * Creates a psychedelic colour-cycling effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function RainbowEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Rainbow"); + + createRainbow(); + } + + /** + * Sets up the rainbow effect + */ + private function createRainbow():void + { + // Add punch with more contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Set up colour arrays + red = new Array(256); + green = new Array(256); + blue = new Array(256); + + // Populate colour arrays with a curved gradient + for (var i:int = 0; i < 256; i++) + { + red[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 16; + green[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF << 8; + blue[i] = Math.sin(i / 0xFF * Math.PI) * 0xFF; + } + } + + /** + * Draws the rainbow effect + */ + override public function draw():void + { + super.draw(); + + red.push(red.splice(0, 1)); + green.unshift(green.pop()); + green.unshift(green.pop()); + if (Math.random() < 0.5) green.unshift(green.pop()); + blue.unshift(blue.pop()); + blue.unshift(blue.pop()); + blue.unshift(blue.pop()); + if (Math.random() < 0.5) blue.unshift(blue.pop()); + if (Math.random() < 0.5) blue.unshift(blue.pop()); + + targetBitmap.paletteMap(sourceBitmap, rect, point, red, green, blue); + } + + /** + * Removes the rainbow effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + red = null; + green = null; + blue = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/SepiaDirt.as b/webcam/webcam/effects/color/SepiaDirt.as index 4b03f65..50eb396 100755..100644 --- a/webcam/webcam/effects/color/SepiaDirt.as +++ b/webcam/webcam/effects/color/SepiaDirt.as @@ -1,31 +1,31 @@ -/**
- * Neave Webcam // Sepia Dirt
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
-
- final internal class SepiaDirt extends Shape
- {
- /**
- * Creates a black circular shape to be used with the sepia effect
- *
- * @param x The position of the dirt on the x-axis
- * @param y The position of the dirt on the y-axis
- * @param radius The radius of the dirt
- */
- public function SepiaDirt(x:Number = 0, y:Number = 0, radius:Number = 1)
- {
- graphics.beginFill(0x000000);
- graphics.drawCircle(x, y, radius);
- }
- }
+/** + * Neave Webcam // Sepia Dirt + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + + final internal class SepiaDirt extends Shape + { + /** + * Creates a black circular shape to be used with the sepia effect + * + * @param x The position of the dirt on the x-axis + * @param y The position of the dirt on the y-axis + * @param radius The radius of the dirt + */ + public function SepiaDirt(x:Number = 0, y:Number = 0, radius:Number = 1) + { + graphics.beginFill(0x000000); + graphics.drawCircle(x, y, radius); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/SepiaEffect.as b/webcam/webcam/effects/color/SepiaEffect.as index f7d2ebe..236168c 100755..100644 --- a/webcam/webcam/effects/color/SepiaEffect.as +++ b/webcam/webcam/effects/color/SepiaEffect.as @@ -1,90 +1,90 @@ -/**
- * Neave Webcam // Sepia Movie Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class SepiaEffect extends AbstractEffect
- {
- private var frameStep:int;
- private var sepia:ColorMatrixFilter;
- private var count:uint;
- private var linePos:Number;
-
- /**
- * Creates an animated sepia effect like an old projector movie
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frameStep The number of frames to step over to create a jittery movie effect
- */
- public function SepiaEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frameStep:int = 3)
- {
- super(source, targetBitmap, "Sepia Movie");
- this.frameStep = frameStep < 1 ? 1 : frameStep;
-
- createSepia();
- }
-
- /**
- * Sets up the sepia effect
- */
- private function createSepia():void
- {
- // Reset variables
- count = linePos = 0;
-
- // Sepia colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.246, 0.4838, 0.0902, 0, 10]); // Green
- m = m.concat([0.15, 0.295, 0.055, 0, 10]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- sepia = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the sepia effect
- */
- override public function draw():void
- {
- if (count == 0)
- {
- super.draw();
-
- // Tint source bitmap sepia
- sourceBitmap.applyFilter(sourceBitmap, rect, point, sepia);
-
- // Create old movie style black vertical line on one side
- linePos += (Math.random() * rect.width * 0.25 - linePos) * 0.04;
- if (Math.random() < 0.05) linePos = rect.width;
- if (Math.random() < 0.05) linePos = rect.width * 0.2;
- if (Math.random() < 0.5) sourceBitmap.fillRect(new Rectangle(Math.round(linePos), 0, 1, rect.height), 0xFF000000);
-
- // Create random dirt with one big spot every so often
- for (var i:int = 4; i--; ) sourceBitmap.draw(new SepiaDirt(Math.random() * rect.width, Math.random() * rect.height, Math.random() < 0.995 ? Math.random() + 0.5 : Math.random() * 10 + 15));
-
- // Draw source bitmap into target bitmap with a slight flicker
- var mult:uint = Math.random() * 64 + (255 - 64);
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFF000000);
- targetBitmap.merge(sourceBitmap, rect, point, mult, mult, mult, 0);
- targetBitmap.unlock();
- }
- count++;
- count %= frameStep;
- }
- }
+/** + * Neave Webcam // Sepia Movie Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class SepiaEffect extends AbstractEffect + { + private var frameStep:int; + private var sepia:ColorMatrixFilter; + private var count:uint; + private var linePos:Number; + + /** + * Creates an animated sepia effect like an old projector movie + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frameStep The number of frames to step over to create a jittery movie effect + */ + public function SepiaEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frameStep:int = 3) + { + super(source, targetBitmap, "Sepia Movie"); + this.frameStep = frameStep < 1 ? 1 : frameStep; + + createSepia(); + } + + /** + * Sets up the sepia effect + */ + private function createSepia():void + { + // Reset variables + count = linePos = 0; + + // Sepia colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.246, 0.4838, 0.0902, 0, 10]); // Green + m = m.concat([0.15, 0.295, 0.055, 0, 10]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + sepia = new ColorMatrixFilter(m); + } + + /** + * Draws the sepia effect + */ + override public function draw():void + { + if (count == 0) + { + super.draw(); + + // Tint source bitmap sepia + sourceBitmap.applyFilter(sourceBitmap, rect, point, sepia); + + // Create old movie style black vertical line on one side + linePos += (Math.random() * rect.width * 0.25 - linePos) * 0.04; + if (Math.random() < 0.05) linePos = rect.width; + if (Math.random() < 0.05) linePos = rect.width * 0.2; + if (Math.random() < 0.5) sourceBitmap.fillRect(new Rectangle(Math.round(linePos), 0, 1, rect.height), 0xFF000000); + + // Create random dirt with one big spot every so often + for (var i:int = 4; i--; ) sourceBitmap.draw(new SepiaDirt(Math.random() * rect.width, Math.random() * rect.height, Math.random() < 0.995 ? Math.random() + 0.5 : Math.random() * 10 + 15)); + + // Draw source bitmap into target bitmap with a slight flicker + var mult:uint = Math.random() * 64 + (255 - 64); + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFF000000); + targetBitmap.merge(sourceBitmap, rect, point, mult, mult, mult, 0); + targetBitmap.unlock(); + } + count++; + count %= frameStep; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/WarholEffect.as b/webcam/webcam/effects/color/WarholEffect.as index 81f8289..f64dea0 100755..100644 --- a/webcam/webcam/effects/color/WarholEffect.as +++ b/webcam/webcam/effects/color/WarholEffect.as @@ -1,99 +1,99 @@ -/**
- * Neave Webcam // Andy Warhol Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class WarholEffect extends AbstractEffect
- {
- private var smallBitmap:BitmapData;
- private var pos1:Point;
- private var pos2:Point;
- private var pos3:Point;
- private var pos4:Point;
-
- /**
- * Creates an Andy Warhol-style Pop Art effect with four highly constrasted tricolour images
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function WarholEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Andy Warhol");
-
- createWarhol();
- }
-
- /**
- * Sets up the Warhol effect
- */
- private function createWarhol():void
- {
- // Create a bitmap quarter the size of the original
- smallBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000);
- sourceMatrix.scale(0.5, 0.5);
-
- // Positions of each image
- pos1 = new Point(0, 0);
- pos2 = new Point(smallBitmap.width, 0);
- pos3 = new Point(0, smallBitmap.height);
- pos4 = new Point(smallBitmap.width, smallBitmap.height);
- }
-
- /**
- * Draws a tricolour (three colour) image from the passed bitmap into the target bitmap data
- *
- * @param bitmapData The source bitmap data to draw the tricolour from
- * @param pos The position to draw tricolour
- * @param color1 The background colour
- * @param color2 The middle colour
- * @param color3 The highlight colour
- */
- private function drawTricolor(bitmapData:BitmapData, pos:Point, color1:uint, color2:uint, color3:uint):void
- {
- // Limit the pixels in the bitmap data to three colours only
- targetBitmap.threshold(bitmapData, rect, pos, "<=", 0xFFAAAAAA, color2);
- targetBitmap.threshold(bitmapData, rect, pos, ">", 0xFFAAAAAA, color3);
- targetBitmap.threshold(bitmapData, rect, pos, "<", 0xFF555555, color1);
- }
-
- /**
- * Draws the Warhol effect
- */
- override public function draw():void
- {
- smallBitmap.draw(source, sourceMatrix);
-
- targetBitmap.lock();
- drawTricolor(smallBitmap, pos1, 0xFF0080FF, 0xFFFFFF00, 0xFFFF0080);
- drawTricolor(smallBitmap, pos2, 0xFF202020, 0xFFFF0000, 0xFFFFFFFF);
- drawTricolor(smallBitmap, pos3, 0xFFA040A0, 0xFFFF9900, 0xFF80C0FF);
- drawTricolor(smallBitmap, pos4, 0xFF40A000, 0xFFFFFFA0, 0xFFFFA0FF);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the Warhol effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- pos1 = pos2 = pos3 = pos4 = null;
- }
- }
+/** + * Neave Webcam // Andy Warhol Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class WarholEffect extends AbstractEffect + { + private var smallBitmap:BitmapData; + private var pos1:Point; + private var pos2:Point; + private var pos3:Point; + private var pos4:Point; + + /** + * Creates an Andy Warhol-style Pop Art effect with four highly constrasted tricolour images + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function WarholEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Andy Warhol"); + + createWarhol(); + } + + /** + * Sets up the Warhol effect + */ + private function createWarhol():void + { + // Create a bitmap quarter the size of the original + smallBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000); + sourceMatrix.scale(0.5, 0.5); + + // Positions of each image + pos1 = new Point(0, 0); + pos2 = new Point(smallBitmap.width, 0); + pos3 = new Point(0, smallBitmap.height); + pos4 = new Point(smallBitmap.width, smallBitmap.height); + } + + /** + * Draws a tricolour (three colour) image from the passed bitmap into the target bitmap data + * + * @param bitmapData The source bitmap data to draw the tricolour from + * @param pos The position to draw tricolour + * @param color1 The background colour + * @param color2 The middle colour + * @param color3 The highlight colour + */ + private function drawTricolor(bitmapData:BitmapData, pos:Point, color1:uint, color2:uint, color3:uint):void + { + // Limit the pixels in the bitmap data to three colours only + targetBitmap.threshold(bitmapData, rect, pos, "<=", 0xFFAAAAAA, color2); + targetBitmap.threshold(bitmapData, rect, pos, ">", 0xFFAAAAAA, color3); + targetBitmap.threshold(bitmapData, rect, pos, "<", 0xFF555555, color1); + } + + /** + * Draws the Warhol effect + */ + override public function draw():void + { + smallBitmap.draw(source, sourceMatrix); + + targetBitmap.lock(); + drawTricolor(smallBitmap, pos1, 0xFF0080FF, 0xFFFFFF00, 0xFFFF0080); + drawTricolor(smallBitmap, pos2, 0xFF202020, 0xFFFF0000, 0xFFFFFFFF); + drawTricolor(smallBitmap, pos3, 0xFFA040A0, 0xFFFF9900, 0xFF80C0FF); + drawTricolor(smallBitmap, pos4, 0xFF40A000, 0xFFFFFFA0, 0xFFFFA0FF); + targetBitmap.unlock(); + } + + /** + * Removes the Warhol effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + pos1 = pos2 = pos3 = pos4 = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/color/XRayEffect.as b/webcam/webcam/effects/color/XRayEffect.as index 06067bd..8f79e92 100755..100644 --- a/webcam/webcam/effects/color/XRayEffect.as +++ b/webcam/webcam/effects/color/XRayEffect.as @@ -1,62 +1,62 @@ -/**
- * Neave Webcam // X-Ray Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.color
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class XRayEffect extends AbstractEffect
- {
- private var cyanWash:ColorMatrixFilter;
-
- /**
- * Creates a mock x-ray effect by inverting the image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function XRayEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "X-Ray");
-
- createXRay();
- }
-
- /**
- * Sets up the x-ray effect
- */
- private function createXRay():void
- {
- // Invert the image
- color = new ColorTransform(-1.5, -1.5, -1.5, 1, 0xFF, 0xFF, 0xFF);
-
- // Monochrome colour matrix with a cyan tint
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 40]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 50]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- cyanWash = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the x-ray effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, cyanWash);
- }
- }
+/** + * Neave Webcam // X-Ray Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.color +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class XRayEffect extends AbstractEffect + { + private var cyanWash:ColorMatrixFilter; + + /** + * Creates a mock x-ray effect by inverting the image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function XRayEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "X-Ray"); + + createXRay(); + } + + /** + * Sets up the x-ray effect + */ + private function createXRay():void + { + // Invert the image + color = new ColorTransform(-1.5, -1.5, -1.5, 1, 0xFF, 0xFF, 0xFF); + + // Monochrome colour matrix with a cyan tint + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 40]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 50]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + cyanWash = new ColorMatrixFilter(m); + } + + /** + * Draws the x-ray effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, cyanWash); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/delay/DivideEffect.as b/webcam/webcam/effects/delay/DivideEffect.as index 5e9cfee..9565e6d 100755..100644 --- a/webcam/webcam/effects/delay/DivideEffect.as +++ b/webcam/webcam/effects/delay/DivideEffect.as @@ -1,99 +1,99 @@ -/**
- * Neave Webcam // Delayed Divide Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class DivideEffect extends AbstractEffect
- {
- private var frames:int;
- private var divideBitmaps:Array;
- private var divideRect:Rectangle;
- private var dividePoint:Point;
-
- /**
- * Creates a split screen effect where the lower half of the image is delayed
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frames The number of frames to delay the lower half of the image by
- */
- public function DivideEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30)
- {
- super(source, targetBitmap, "Delayed Divide");
- this.frames = frames < 2 ? 2 : frames;
-
- createDivide();
- }
-
- /**
- * Sets up the divide effect
- */
- private function createDivide():void
- {
- // Define the lower half area and its top left position
- divideRect = new Rectangle(0, rect.height / 2, rect.width, rect.height / 2);
- dividePoint = new Point(0, rect.height / 2);
-
- // Draw the delayed bitmap into the lower half
- var m:Matrix = sourceMatrix.clone();
- m.translate(0, -rect.height / 2);
-
- // Create an array of bitmaps to store the delayed frames
- divideBitmaps = new Array();
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width, rect.height / 2, false, 0xFF000000);
- b.draw(source, m, color, null, rect, true); // Start with the current source image
- divideBitmaps.push(b);
- }
- }
-
- /**
- * Draws the divide effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through all the delayed frames
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = divideBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, divideRect, point); // Draw the current source image into frame 0
- else b.copyPixels(divideBitmaps[i - 1], b.rect, point); // Move the other frames along the array
- }
-
- // Draw the final delayed frame into the lower half with the current source image
- sourceBitmap.copyPixels(divideBitmaps[frames - 1], divideBitmaps[0].rect, dividePoint);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = frames; i--; )
- {
- divideBitmaps[i].dispose();
- divideBitmaps[i] = null;
- }
- divideBitmaps = null;
- }
- }
+/** + * Neave Webcam // Delayed Divide Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class DivideEffect extends AbstractEffect + { + private var frames:int; + private var divideBitmaps:Array; + private var divideRect:Rectangle; + private var dividePoint:Point; + + /** + * Creates a split screen effect where the lower half of the image is delayed + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frames The number of frames to delay the lower half of the image by + */ + public function DivideEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30) + { + super(source, targetBitmap, "Delayed Divide"); + this.frames = frames < 2 ? 2 : frames; + + createDivide(); + } + + /** + * Sets up the divide effect + */ + private function createDivide():void + { + // Define the lower half area and its top left position + divideRect = new Rectangle(0, rect.height / 2, rect.width, rect.height / 2); + dividePoint = new Point(0, rect.height / 2); + + // Draw the delayed bitmap into the lower half + var m:Matrix = sourceMatrix.clone(); + m.translate(0, -rect.height / 2); + + // Create an array of bitmaps to store the delayed frames + divideBitmaps = new Array(); + for (var i:int = frames; i--; ) + { + var b:BitmapData = new BitmapData(rect.width, rect.height / 2, false, 0xFF000000); + b.draw(source, m, color, null, rect, true); // Start with the current source image + divideBitmaps.push(b); + } + } + + /** + * Draws the divide effect + */ + override public function draw():void + { + super.draw(); + + // Loop through all the delayed frames + for (var i:int = frames; i--; ) + { + var b:BitmapData = divideBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, divideRect, point); // Draw the current source image into frame 0 + else b.copyPixels(divideBitmaps[i - 1], b.rect, point); // Move the other frames along the array + } + + // Draw the final delayed frame into the lower half with the current source image + sourceBitmap.copyPixels(divideBitmaps[frames - 1], divideBitmaps[0].rect, dividePoint); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = frames; i--; ) + { + divideBitmaps[i].dispose(); + divideBitmaps[i] = null; + } + divideBitmaps = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/delay/FilmstripEffect.as b/webcam/webcam/effects/delay/FilmstripEffect.as index ce324b1..a7f6274 100755..100644 --- a/webcam/webcam/effects/delay/FilmstripEffect.as +++ b/webcam/webcam/effects/delay/FilmstripEffect.as @@ -1,91 +1,91 @@ -/**
- * Neave Webcam // Filmstrip Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class FilmstripEffect extends AbstractEffect
- {
- private var scale:int;
- private var total:int;
- private var filmstrip:Array;
-
- /**
- * Creates a grid of delayed images, each delayed by one frame after the previous frame
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param scale The number of images to use along the width and height of the grid
- */
- public function FilmstripEffect(source:IBitmapDrawable, targetBitmap:BitmapData, scale:int = 8)
- {
- super(source, targetBitmap, "Filmstrip");
- this.scale = scale < 2 ? 2 : scale;
-
- createFilmstrip();
- }
-
- /**
- * Sets up the filmstrip effect
- */
- private function createFilmstrip():void
- {
- // Resize the source to the set scale
- sourceMatrix.scale(1 / scale, 1 / scale);
-
- // Create an array of bitmaps to store the delayed frames
- total = scale * scale;
- filmstrip = new Array();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width / scale, rect.height / scale, false, 0xFF000000);
- b.draw(source, sourceMatrix, color, null, null, true);
- filmstrip.push(b);
- }
- }
-
- /**
- * Draws the filmstrip effect
- */
- override public function draw():void
- {
- // Loop through all the delayed frames
- targetBitmap.lock();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = filmstrip[i];
- if (i == 0) b.draw(source, sourceMatrix, color); // Draw the source at a smaller size into frame 0
- else b.copyPixels(filmstrip[i - 1], b.rect, point); // Move the other frames along the array
- targetBitmap.copyPixels(b, b.rect, new Point((scale - (i % scale) - 1) * rect.width / scale, int(i / scale) * rect.height / scale)); // Draw this frame in position
- }
- targetBitmap.unlock();
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the filmstrip bitmaps
- for (var i:int = total; i--; )
- {
- filmstrip[i].dispose();
- filmstrip[i] = null;
- }
- filmstrip = null;
- }
- }
+/** + * Neave Webcam // Filmstrip Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class FilmstripEffect extends AbstractEffect + { + private var scale:int; + private var total:int; + private var filmstrip:Array; + + /** + * Creates a grid of delayed images, each delayed by one frame after the previous frame + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param scale The number of images to use along the width and height of the grid + */ + public function FilmstripEffect(source:IBitmapDrawable, targetBitmap:BitmapData, scale:int = 8) + { + super(source, targetBitmap, "Filmstrip"); + this.scale = scale < 2 ? 2 : scale; + + createFilmstrip(); + } + + /** + * Sets up the filmstrip effect + */ + private function createFilmstrip():void + { + // Resize the source to the set scale + sourceMatrix.scale(1 / scale, 1 / scale); + + // Create an array of bitmaps to store the delayed frames + total = scale * scale; + filmstrip = new Array(); + for (var i:int = total; i--; ) + { + var b:BitmapData = new BitmapData(rect.width / scale, rect.height / scale, false, 0xFF000000); + b.draw(source, sourceMatrix, color, null, null, true); + filmstrip.push(b); + } + } + + /** + * Draws the filmstrip effect + */ + override public function draw():void + { + // Loop through all the delayed frames + targetBitmap.lock(); + for (var i:int = total; i--; ) + { + var b:BitmapData = filmstrip[i]; + if (i == 0) b.draw(source, sourceMatrix, color); // Draw the source at a smaller size into frame 0 + else b.copyPixels(filmstrip[i - 1], b.rect, point); // Move the other frames along the array + targetBitmap.copyPixels(b, b.rect, new Point((scale - (i % scale) - 1) * rect.width / scale, int(i / scale) * rect.height / scale)); // Draw this frame in position + } + targetBitmap.unlock(); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the filmstrip bitmaps + for (var i:int = total; i--; ) + { + filmstrip[i].dispose(); + filmstrip[i] = null; + } + filmstrip = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/delay/GhostEffect.as b/webcam/webcam/effects/delay/GhostEffect.as index 35c5787..1dd1c5a 100755..100644 --- a/webcam/webcam/effects/delay/GhostEffect.as +++ b/webcam/webcam/effects/delay/GhostEffect.as @@ -1,89 +1,89 @@ -/**
- * Neave Webcam // Ghost Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class GhostEffect extends AbstractEffect
- {
- private var frames:int;
- private var ghostBitmaps:Array;
-
- /**
- * Creates a ghost effect where the source image is delayed then blended with the current image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param frames The number of frames to delay the ghost image by
- */
- public function GhostEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30)
- {
- super(source, targetBitmap, "Ghost");
- this.frames = frames < 2 ? 2 : frames;
-
- createGhost();
- }
-
- /**
- * Sets up the ghost effect
- */
- private function createGhost():void
- {
- // Create an array of bitmaps to store the delayed frames
- ghostBitmaps = new Array();
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = sourceBitmap.clone();
- b.draw(source, null, color, null, null, true); // Start with the current source image
- ghostBitmaps.push(b);
- }
- }
-
- /**
- * Draws the ghost effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through all the delayed frames
- for (var i:int = frames; i--; )
- {
- var b:BitmapData = ghostBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, rect, point); // Draw the current source image into frame 0
- else b.copyPixels(ghostBitmaps[i - 1], rect, point); // Move the other frames along the array
- }
-
- // Blend the final delayed frame with the current source image
- sourceBitmap.merge(ghostBitmaps[frames - 1], rect, point, 128, 128, 128, 0);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- }
-
- /**
- * Removes the ghost effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = frames; i--; )
- {
- ghostBitmaps[i].dispose();
- ghostBitmaps[i] = null;
- }
- ghostBitmaps = null;
- }
- }
+/** + * Neave Webcam // Ghost Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class GhostEffect extends AbstractEffect + { + private var frames:int; + private var ghostBitmaps:Array; + + /** + * Creates a ghost effect where the source image is delayed then blended with the current image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param frames The number of frames to delay the ghost image by + */ + public function GhostEffect(source:IBitmapDrawable, targetBitmap:BitmapData, frames:int = 30) + { + super(source, targetBitmap, "Ghost"); + this.frames = frames < 2 ? 2 : frames; + + createGhost(); + } + + /** + * Sets up the ghost effect + */ + private function createGhost():void + { + // Create an array of bitmaps to store the delayed frames + ghostBitmaps = new Array(); + for (var i:int = frames; i--; ) + { + var b:BitmapData = sourceBitmap.clone(); + b.draw(source, null, color, null, null, true); // Start with the current source image + ghostBitmaps.push(b); + } + } + + /** + * Draws the ghost effect + */ + override public function draw():void + { + super.draw(); + + // Loop through all the delayed frames + for (var i:int = frames; i--; ) + { + var b:BitmapData = ghostBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, rect, point); // Draw the current source image into frame 0 + else b.copyPixels(ghostBitmaps[i - 1], rect, point); // Move the other frames along the array + } + + // Blend the final delayed frame with the current source image + sourceBitmap.merge(ghostBitmaps[frames - 1], rect, point, 128, 128, 128, 0); + targetBitmap.copyPixels(sourceBitmap, rect, point); + } + + /** + * Removes the ghost effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = frames; i--; ) + { + ghostBitmaps[i].dispose(); + ghostBitmaps[i] = null; + } + ghostBitmaps = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/delay/SlitScanEffect.as b/webcam/webcam/effects/delay/SlitScanEffect.as index 37eb00c..5ac81b2 100755..100644 --- a/webcam/webcam/effects/delay/SlitScanEffect.as +++ b/webcam/webcam/effects/delay/SlitScanEffect.as @@ -1,178 +1,178 @@ -/**
- * Neave Webcam // Slit Scan Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class SlitScanEffect extends AbstractEffect
- {
- private const MAX_SLITS:int = 60;
-
- private var slitHeight:int;
- private var slitScale:Number;
- private var initScale:Number;
- private var total:int;
- private var slitBitmaps:Array;
- private var slitMatrix:Matrix;
- private var slitRect:Rectangle;
- private var halfBitmap:BitmapData;
- private var topMatrix:Matrix;
- private var bottomPoint:Point;
- private var moveUp:Boolean;
- private var midX:Number;
-
- /**
- * Creates a slit scan effect, similar to the final scene in 2001: A Space Odyssey
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param slitHeight The height of the slit to capture in pixels
- * @param slitScale How much to increase the size of each slit by
- * @param initScale The scale of the first slit
- */
- public function SlitScanEffect(source:IBitmapDrawable, targetBitmap:BitmapData, slitHeight:int = 1, slitScale:Number = 1.125, initScale:Number = 0.25)
- {
- super(source, targetBitmap, "Slit Scan");
- this.slitHeight = slitHeight < 1 ? 1 : slitHeight;
- this.slitScale = slitScale < 0.1 ? 0.1 : slitScale;
- this.initScale = initScale < 0.1 ? 0.1 : initScale;
-
- createSlitScan();
- }
-
- /**
- * Sets up the slit scan effect
- */
- private function createSlitScan():void
- {
- // Slit dimensions
- slitMatrix = new Matrix();
- slitRect = new Rectangle(0, 0, rect.width, slitHeight);
-
- // Create a half-sized bitmap to contain all the slit scans
- halfBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- topMatrix = new Matrix(1, 0, 0, -1, 0, halfBitmap.height);
- bottomPoint = new Point(0, halfBitmap.height);
-
- // Create an array of bitmaps to store the slits
- slitBitmaps = new Array();
- setTotal();
- for (var i:int = total; i--; )
- {
- var b:BitmapData = new BitmapData(rect.width, slitHeight, false, 0xFF000000);
- b.draw(source, null, color, null, slitRect, true); // Start with the current source image
- slitBitmaps.push(b);
- }
-
- // Other variables
- moveUp = false;
- midX = rect.width / 2 / initScale - rect.width / 2;
- }
-
- /**
- * Calculates the total number of slits needed to cover the half-sized bitmap
- */
- private function setTotal():void
- {
- total = 0;
- var size:Number = slitHeight * initScale;
- var lastSize:Number = size;
-
- // Loop through the slit sizes, increasing in height until the size is bigger than the bitmap height
- while (size < halfBitmap.height && total < MAX_SLITS)
- {
- var nextSize:Number = lastSize * slitScale;
- lastSize = nextSize;
- size += nextSize;
- total++;
- }
- }
-
- /**
- * Moves the slit position up or down the source image
- */
- private function moveSlit():void
- {
- if (moveUp)
- {
- // Moving up or reversing direction
- if (slitRect.top > 1) slitRect.offset(0, -slitHeight);
- else moveUp = false;
- }
- else
- {
- // Moving down or reversing direction
- if (slitRect.top < rect.height - slitHeight - 1) slitRect.offset(0, slitHeight);
- else moveUp = true;
- }
- }
-
- /**
- * Draw the slit scan effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Move the slit up or down
- moveSlit();
-
- // Set slit to initial position and size
- slitMatrix.identity();
- slitMatrix.tx = midX;
- slitMatrix.scale(initScale, initScale);
-
- // Draw each slit
- for (var i:int = total; i--; )
- {
- // Draw or move each slit along the array
- var b:BitmapData = slitBitmaps[i];
- if (i == 0) b.copyPixels(sourceBitmap, slitRect, point); // Draw the current source image into slit 0
- else b.copyPixels(slitBitmaps[i - 1], b.rect, point); // Move the other slits along the array
-
- // Scale each slit up and position in the middle
- slitMatrix.scale(slitScale, slitScale);
- slitMatrix.translate(rect.width / 2 * (1 - slitScale), slitHeight * initScale);
-
- // Draw this new slit into the main half-size bitmap
- halfBitmap.draw(slitBitmaps[total - i - 1], slitMatrix, null, null, null, true);
- }
-
- // Draw the half-size bitmaps into the top and bottom
- targetBitmap.lock();
- targetBitmap.draw(halfBitmap, topMatrix);
- targetBitmap.copyPixels(halfBitmap, halfBitmap.rect, bottomPoint);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the slit scan effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the frame bitmaps
- for (var i:int = total; i--; )
- {
- slitBitmaps[i].dispose();
- slitBitmaps[i] = null;
- }
- slitBitmaps = null;
-
- halfBitmap.dispose();
- halfBitmap = null;
- }
- }
+/** + * Neave Webcam // Slit Scan Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class SlitScanEffect extends AbstractEffect + { + private const MAX_SLITS:int = 60; + + private var slitHeight:int; + private var slitScale:Number; + private var initScale:Number; + private var total:int; + private var slitBitmaps:Array; + private var slitMatrix:Matrix; + private var slitRect:Rectangle; + private var halfBitmap:BitmapData; + private var topMatrix:Matrix; + private var bottomPoint:Point; + private var moveUp:Boolean; + private var midX:Number; + + /** + * Creates a slit scan effect, similar to the final scene in 2001: A Space Odyssey + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param slitHeight The height of the slit to capture in pixels + * @param slitScale How much to increase the size of each slit by + * @param initScale The scale of the first slit + */ + public function SlitScanEffect(source:IBitmapDrawable, targetBitmap:BitmapData, slitHeight:int = 1, slitScale:Number = 1.125, initScale:Number = 0.25) + { + super(source, targetBitmap, "Slit Scan"); + this.slitHeight = slitHeight < 1 ? 1 : slitHeight; + this.slitScale = slitScale < 0.1 ? 0.1 : slitScale; + this.initScale = initScale < 0.1 ? 0.1 : initScale; + + createSlitScan(); + } + + /** + * Sets up the slit scan effect + */ + private function createSlitScan():void + { + // Slit dimensions + slitMatrix = new Matrix(); + slitRect = new Rectangle(0, 0, rect.width, slitHeight); + + // Create a half-sized bitmap to contain all the slit scans + halfBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + topMatrix = new Matrix(1, 0, 0, -1, 0, halfBitmap.height); + bottomPoint = new Point(0, halfBitmap.height); + + // Create an array of bitmaps to store the slits + slitBitmaps = new Array(); + setTotal(); + for (var i:int = total; i--; ) + { + var b:BitmapData = new BitmapData(rect.width, slitHeight, false, 0xFF000000); + b.draw(source, null, color, null, slitRect, true); // Start with the current source image + slitBitmaps.push(b); + } + + // Other variables + moveUp = false; + midX = rect.width / 2 / initScale - rect.width / 2; + } + + /** + * Calculates the total number of slits needed to cover the half-sized bitmap + */ + private function setTotal():void + { + total = 0; + var size:Number = slitHeight * initScale; + var lastSize:Number = size; + + // Loop through the slit sizes, increasing in height until the size is bigger than the bitmap height + while (size < halfBitmap.height && total < MAX_SLITS) + { + var nextSize:Number = lastSize * slitScale; + lastSize = nextSize; + size += nextSize; + total++; + } + } + + /** + * Moves the slit position up or down the source image + */ + private function moveSlit():void + { + if (moveUp) + { + // Moving up or reversing direction + if (slitRect.top > 1) slitRect.offset(0, -slitHeight); + else moveUp = false; + } + else + { + // Moving down or reversing direction + if (slitRect.top < rect.height - slitHeight - 1) slitRect.offset(0, slitHeight); + else moveUp = true; + } + } + + /** + * Draw the slit scan effect + */ + override public function draw():void + { + super.draw(); + + // Move the slit up or down + moveSlit(); + + // Set slit to initial position and size + slitMatrix.identity(); + slitMatrix.tx = midX; + slitMatrix.scale(initScale, initScale); + + // Draw each slit + for (var i:int = total; i--; ) + { + // Draw or move each slit along the array + var b:BitmapData = slitBitmaps[i]; + if (i == 0) b.copyPixels(sourceBitmap, slitRect, point); // Draw the current source image into slit 0 + else b.copyPixels(slitBitmaps[i - 1], b.rect, point); // Move the other slits along the array + + // Scale each slit up and position in the middle + slitMatrix.scale(slitScale, slitScale); + slitMatrix.translate(rect.width / 2 * (1 - slitScale), slitHeight * initScale); + + // Draw this new slit into the main half-size bitmap + halfBitmap.draw(slitBitmaps[total - i - 1], slitMatrix, null, null, null, true); + } + + // Draw the half-size bitmaps into the top and bottom + targetBitmap.lock(); + targetBitmap.draw(halfBitmap, topMatrix); + targetBitmap.copyPixels(halfBitmap, halfBitmap.rect, bottomPoint); + targetBitmap.unlock(); + } + + /** + * Removes the slit scan effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the frame bitmaps + for (var i:int = total; i--; ) + { + slitBitmaps[i].dispose(); + slitBitmaps[i] = null; + } + slitBitmaps = null; + + halfBitmap.dispose(); + halfBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/delay/TrailEffect.as b/webcam/webcam/effects/delay/TrailEffect.as index 41a9c91..725b0ac 100755..100644 --- a/webcam/webcam/effects/delay/TrailEffect.as +++ b/webcam/webcam/effects/delay/TrailEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Trail Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.delay
-{
- import flash.display.*;
- import com.neave.webcam.effects.*;
-
- public class TrailEffect extends AbstractEffect
- {
- private var fade:uint;
- private var whiteBitmap:BitmapData;
-
- /**
- * Creates a trail effect by smearing and fading out movement
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param fade The amount to fade out the trail by each frame, the higher the faster
- */
- public function TrailEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fade:uint = 8)
- {
- super(source, targetBitmap, "Trail");
- this.fade = fade > 0xFF ? 0xFF: fade;
-
- createTrail();
- }
-
- /**
- * Sets up the trail effect
- */
- private function createTrail():void
- {
- whiteBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFFFFFF); // White bitmap for fading out the trail
- targetBitmap.draw(source, null, color, null, null, true); // Start with the current source image
- }
-
- /**
- * Draws the trail effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.lock();
- targetBitmap.merge(whiteBitmap, rect, point, fade, fade, fade, 0); // Repeatedly fade out the image
- targetBitmap.draw(sourceBitmap, null, null, BlendMode.DARKEN); // Blend the new source image with the old one
- targetBitmap.unlock();
- }
-
- /**
- * Removes the divide effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- whiteBitmap.dispose();
- whiteBitmap = null;
- }
- }
+/** + * Neave Webcam // Trail Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.delay +{ + import flash.display.*; + import com.neave.webcam.effects.*; + + public class TrailEffect extends AbstractEffect + { + private var fade:uint; + private var whiteBitmap:BitmapData; + + /** + * Creates a trail effect by smearing and fading out movement + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param fade The amount to fade out the trail by each frame, the higher the faster + */ + public function TrailEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fade:uint = 8) + { + super(source, targetBitmap, "Trail"); + this.fade = fade > 0xFF ? 0xFF: fade; + + createTrail(); + } + + /** + * Sets up the trail effect + */ + private function createTrail():void + { + whiteBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFFFFFF); // White bitmap for fading out the trail + targetBitmap.draw(source, null, color, null, null, true); // Start with the current source image + } + + /** + * Draws the trail effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.lock(); + targetBitmap.merge(whiteBitmap, rect, point, fade, fade, fade, 0); // Repeatedly fade out the image + targetBitmap.draw(sourceBitmap, null, null, BlendMode.DARKEN); // Blend the new source image with the old one + targetBitmap.unlock(); + } + + /** + * Removes the divide effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + whiteBitmap.dispose(); + whiteBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/AbstractDisplaceEffect.as b/webcam/webcam/effects/displace/AbstractDisplaceEffect.as index 89458ac..671d5e7 100755..100644 --- a/webcam/webcam/effects/displace/AbstractDisplaceEffect.as +++ b/webcam/webcam/effects/displace/AbstractDisplaceEffect.as @@ -1,64 +1,64 @@ -/**
- * Neave Webcam // Abstract Displace Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractDisplaceEffect extends AbstractEffect
- {
- protected var displace:DisplacementMapFilter;
-
- /**
- * An abstract displacement effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractDisplaceEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- super(source, targetBitmap, name);
-
- createAbstractDisplace();
- }
-
- /**
- * Sets up the displacement effect
- */
- private function createAbstractDisplace():void
- {
- // Create a displacement map filter with grey bitmap data, using red to distort horizontally, green to distort vertically
- displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 0, 0, DisplacementMapFilterMode.CLAMP);
- }
-
- /**
- * Draws the displacement effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.applyFilter(sourceBitmap, rect, point, displace);
- }
-
- /**
- * Removes the displacement effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- displace.mapBitmap.dispose();
- displace = null;
- }
- }
+/** + * Neave Webcam // Abstract Displace Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import com.neave.webcam.effects.*; + + internal class AbstractDisplaceEffect extends AbstractEffect + { + protected var displace:DisplacementMapFilter; + + /** + * An abstract displacement effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractDisplaceEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + super(source, targetBitmap, name); + + createAbstractDisplace(); + } + + /** + * Sets up the displacement effect + */ + private function createAbstractDisplace():void + { + // Create a displacement map filter with grey bitmap data, using red to distort horizontally, green to distort vertically + displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 0, 0, DisplacementMapFilterMode.CLAMP); + } + + /** + * Draws the displacement effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.applyFilter(sourceBitmap, rect, point, displace); + } + + /** + * Removes the displacement effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + displace.mapBitmap.dispose(); + displace = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/BulgeEffect.as b/webcam/webcam/effects/displace/BulgeEffect.as index d2c1ac2..919f7a7 100755..100644 --- a/webcam/webcam/effects/displace/BulgeEffect.as +++ b/webcam/webcam/effects/displace/BulgeEffect.as @@ -1,74 +1,74 @@ -/**
- * Neave Webcam // Bulge Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class BulgeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a bulge effect that pushes the centre of the image outwards
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function BulgeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Bulge");
-
- createBulge();
- }
-
- /**
- * Sets up the bulge effect
- */
- private function createBulge():void
- {
- // The size of the bulge, one quarter the size of the source image
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round((w + h) / 4);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, size, size);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, size, size);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, size, size);
-
- // Draw all the gradients into one displacement map bitmap
- var mapMatrix:Matrix = new Matrix();
- mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2);
- displace.mapBitmap.draw(red, mapMatrix);
- displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover, mapMatrix);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Bulge Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class BulgeEffect extends AbstractDisplaceEffect + { + /** + * Creates a bulge effect that pushes the centre of the image outwards + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function BulgeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Bulge"); + + createBulge(); + } + + /** + * Sets up the bulge effect + */ + private function createBulge():void + { + // The size of the bulge, one quarter the size of the source image + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round((w + h) / 4); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, size, size); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, size, size); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, size, size); + + // Draw all the gradients into one displacement map bitmap + var mapMatrix:Matrix = new Matrix(); + mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2); + displace.mapBitmap.draw(red, mapMatrix); + displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD); + displace.mapBitmap.draw(cover, mapMatrix); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/DentEffect.as b/webcam/webcam/effects/displace/DentEffect.as index c701146..2905693 100755..100644 --- a/webcam/webcam/effects/displace/DentEffect.as +++ b/webcam/webcam/effects/displace/DentEffect.as @@ -1,75 +1,75 @@ -/**
- * Neave Webcam // Dent Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class DentEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a dent effect that pinches the centre of the image inwards
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function DentEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Dent");
-
- createDent();
- }
-
- /**
- * Sets up the dent effect
- */
- private function createDent():void
- {
- // The size of the dent, one quarter the size of the source image
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round((w + h) / 4);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, size, size);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, size, size);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, size, size);
-
- // Draw all the gradients into one displacement map bitmap
- var mapMatrix:Matrix = new Matrix();
- mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2);
- displace.mapBitmap.draw(red, mapMatrix);
- displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover, mapMatrix);
-
- // Double up the grey cover for a greater dent size
- displace.mapBitmap.draw(cover, mapMatrix);
- displace.scaleX = displace.scaleY = size * 2;
- }
- }
+/** + * Neave Webcam // Dent Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class DentEffect extends AbstractDisplaceEffect + { + /** + * Creates a dent effect that pinches the centre of the image inwards + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function DentEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Dent"); + + createDent(); + } + + /** + * Sets up the dent effect + */ + private function createDent():void + { + // The size of the dent, one quarter the size of the source image + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round((w + h) / 4); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, size, size); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, size, size); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, size, size); + + // Draw all the gradients into one displacement map bitmap + var mapMatrix:Matrix = new Matrix(); + mapMatrix.translate(w / 2 - size / 2, h / 2 - size / 2); + displace.mapBitmap.draw(red, mapMatrix); + displace.mapBitmap.draw(green, mapMatrix, null, BlendMode.ADD); + displace.mapBitmap.draw(cover, mapMatrix); + + // Double up the grey cover for a greater dent size + displace.mapBitmap.draw(cover, mapMatrix); + displace.scaleX = displace.scaleY = size * 2; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/FishbowlEffect.as b/webcam/webcam/effects/displace/FishbowlEffect.as index 08f5d08..50ffe2c 100755..100644 --- a/webcam/webcam/effects/displace/FishbowlEffect.as +++ b/webcam/webcam/effects/displace/FishbowlEffect.as @@ -1,72 +1,72 @@ -/**
- * Neave Webcam // Fishbowl Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FishbowlEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a fishbowl effect like looking into a fishbowl, the opposite of the fisheye effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FishbowlEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fishbowl");
-
- createFishbowl();
- }
-
- /**
- * Sets up the fishbowl effect
- */
- private function createFishbowl():void
- {
- // The size of the fishbowl effect
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = Math.round(Math.sqrt((w / 2) * (w / 2) + (h / 2) * (h / 2)) * 2);
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, w, h);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, h);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, h);
-
- // Draw all the gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Fishbowl Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FishbowlEffect extends AbstractDisplaceEffect + { + /** + * Creates a fishbowl effect like looking into a fishbowl, the opposite of the fisheye effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FishbowlEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fishbowl"); + + createFishbowl(); + } + + /** + * Sets up the fishbowl effect + */ + private function createFishbowl():void + { + // The size of the fishbowl effect + var w:int = rect.width; + var h:int = rect.height; + var size:int = Math.round(Math.sqrt((w / 2) * (w / 2) + (h / 2) * (h / 2)) * 2); + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, w, h); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, h); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, h); + + // Draw all the gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + displace.mapBitmap.draw(cover); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/FisheyeEffect.as b/webcam/webcam/effects/displace/FisheyeEffect.as index 1d4cf4a..1ec5d66 100755..100644 --- a/webcam/webcam/effects/displace/FisheyeEffect.as +++ b/webcam/webcam/effects/displace/FisheyeEffect.as @@ -1,72 +1,72 @@ -/**
- * Neave Webcam // Fisheye Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FisheyeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a fisheye (wide-angle) lens effect
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FisheyeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fisheye");
-
- createFisheye();
- }
-
- /**
- * Sets up the fisheye effect
- */
- private function createFisheye():void
- {
- // The size of the fisheye effect
- var w:int = rect.width;
- var h:int = rect.height;
- var size:int = (w + h) / 2;
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
- m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2);
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m, SpreadMethod.REFLECT);
- cover.graphics.drawRect(0, 0, w, h);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, h);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.rotate(Math.PI / 2);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, h);
-
- // Draw all the gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
- displace.mapBitmap.draw(cover);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = size;
- }
- }
+/** + * Neave Webcam // Fisheye Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FisheyeEffect extends AbstractDisplaceEffect + { + /** + * Creates a fisheye (wide-angle) lens effect + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FisheyeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fisheye"); + + createFisheye(); + } + + /** + * Sets up the fisheye effect + */ + private function createFisheye():void + { + // The size of the fisheye effect + var w:int = rect.width; + var h:int = rect.height; + var size:int = (w + h) / 2; + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + m.createGradientBox(size, size, 0, w / 2 - size / 2, h / 2 - size / 2); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + cover.graphics.beginGradientFill(GradientType.RADIAL, [0x808080, 0x808080], [0, 1], [0x00, 0xFF], m, SpreadMethod.REFLECT); + cover.graphics.drawRect(0, 0, w, h); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + red.graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x000000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, h); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.rotate(Math.PI / 2); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x00FF00, 0x000000], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, h); + + // Draw all the gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + displace.mapBitmap.draw(cover); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = size; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/FragmentEffect.as b/webcam/webcam/effects/displace/FragmentEffect.as index e058dd9..773a350 100755..100644 --- a/webcam/webcam/effects/displace/FragmentEffect.as +++ b/webcam/webcam/effects/displace/FragmentEffect.as @@ -1,101 +1,101 @@ -/**
- * Neave Webcam // Fragment Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class FragmentEffect extends AbstractEffect
- {
- private var fragmentsWide:int;
- private var scale:Number;
- private var total:int;
- private var fragmentBitmap:BitmapData;
- private var fragmentMatrix:Matrix;
- private var fragmentRects:Array;
- private var fragmentPoints:Array;
-
- /**
- * Creates a fragmentary effect where the image is divided into a grid of smaller zoomed areas
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param fragmentsWide The number of fragments in width to use
- * @param scale The size of the zoom for each fragment
- */
- public function FragmentEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fragmentsWide:int = 10, scale:Number = 0.5)
- {
- super(source, targetBitmap, "Fragment");
- this.fragmentsWide = fragmentsWide < 1 ? 1 : fragmentsWide;
- this.scale = scale;
- if (scale > 2) this.scale = 2;
- if (scale < 0.5) this.scale = 0.5;
-
- createFragment();
- }
-
- /**
- * Sets up the fragment effect
- */
- private function createFragment():void
- {
- // The fragment dimensions
- var w:Number = rect.width / fragmentsWide;
- var h:Number = rect.height / fragmentsWide;
-
- // Set up the main fragment bitmap data and scaling properties
- fragmentBitmap = new BitmapData(rect.width * scale, rect.height * scale, false, 0xFF000000);
- fragmentMatrix = new Matrix();
- fragmentMatrix.scale(1 / scale, 1 / scale);
- fragmentRects = new Array();
- fragmentPoints = new Array();
-
- // Set up each fragment's area and position
- for (var y:int = 0; y < fragmentsWide; y++)
- {
- for (var x:int = 0; x < fragmentsWide; x++)
- {
- fragmentRects.push(new Rectangle(x * w, y * h, w * scale, h * scale));
- fragmentPoints.push(new Point(x * w * scale, y * h * scale));
- }
- }
- total = fragmentsWide * fragmentsWide;
- }
-
- /**
- * Draws the fragment effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each fragment and draw the zoomed area
- for (var i:int = total; i--; ) fragmentBitmap.copyPixels(sourceBitmap, fragmentRects[i], fragmentPoints[i]);
-
- // Draw the fragment bitmap data into the target bitmap data but scaled to fit
- targetBitmap.draw(fragmentBitmap, fragmentMatrix, null, null, null, true);
- }
-
- /**
- * Removes the fragment effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- fragmentBitmap.dispose();
- fragmentBitmap = null;
- fragmentRects = null;
- fragmentPoints = null;
- }
- }
+/** + * Neave Webcam // Fragment Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class FragmentEffect extends AbstractEffect + { + private var fragmentsWide:int; + private var scale:Number; + private var total:int; + private var fragmentBitmap:BitmapData; + private var fragmentMatrix:Matrix; + private var fragmentRects:Array; + private var fragmentPoints:Array; + + /** + * Creates a fragmentary effect where the image is divided into a grid of smaller zoomed areas + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param fragmentsWide The number of fragments in width to use + * @param scale The size of the zoom for each fragment + */ + public function FragmentEffect(source:IBitmapDrawable, targetBitmap:BitmapData, fragmentsWide:int = 10, scale:Number = 0.5) + { + super(source, targetBitmap, "Fragment"); + this.fragmentsWide = fragmentsWide < 1 ? 1 : fragmentsWide; + this.scale = scale; + if (scale > 2) this.scale = 2; + if (scale < 0.5) this.scale = 0.5; + + createFragment(); + } + + /** + * Sets up the fragment effect + */ + private function createFragment():void + { + // The fragment dimensions + var w:Number = rect.width / fragmentsWide; + var h:Number = rect.height / fragmentsWide; + + // Set up the main fragment bitmap data and scaling properties + fragmentBitmap = new BitmapData(rect.width * scale, rect.height * scale, false, 0xFF000000); + fragmentMatrix = new Matrix(); + fragmentMatrix.scale(1 / scale, 1 / scale); + fragmentRects = new Array(); + fragmentPoints = new Array(); + + // Set up each fragment's area and position + for (var y:int = 0; y < fragmentsWide; y++) + { + for (var x:int = 0; x < fragmentsWide; x++) + { + fragmentRects.push(new Rectangle(x * w, y * h, w * scale, h * scale)); + fragmentPoints.push(new Point(x * w * scale, y * h * scale)); + } + } + total = fragmentsWide * fragmentsWide; + } + + /** + * Draws the fragment effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each fragment and draw the zoomed area + for (var i:int = total; i--; ) fragmentBitmap.copyPixels(sourceBitmap, fragmentRects[i], fragmentPoints[i]); + + // Draw the fragment bitmap data into the target bitmap data but scaled to fit + targetBitmap.draw(fragmentBitmap, fragmentMatrix, null, null, null, true); + } + + /** + * Removes the fragment effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + fragmentBitmap.dispose(); + fragmentBitmap = null; + fragmentRects = null; + fragmentPoints = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/SqueezeEffect.as b/webcam/webcam/effects/displace/SqueezeEffect.as index e702dc1..6818da1 100755..100644 --- a/webcam/webcam/effects/displace/SqueezeEffect.as +++ b/webcam/webcam/effects/displace/SqueezeEffect.as @@ -1,87 +1,87 @@ -/**
- * Neave Webcam // Squeeze Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class SqueezeEffect extends AbstractDisplaceEffect
- {
- /**
- * Creates a squeezing distortion effect where the middle is squeezed and the edges are stretched
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function SqueezeEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Squeeze");
-
- createSqueeze();
- }
-
- /**
- * Sets up the squeeze effect
- */
- private function createSqueeze():void
- {
- // The size of the squeeze effect
- var w:int = rect.width;
- var h:int = rect.height;
-
- // The displacement gradient matrix
- var m:Matrix = new Matrix();
-
- // Grey radial gradient to smooth the edges of the distortion
- var cover:Shape = new Shape();
- m.createGradientBox(w, w);
- cover.graphics.beginGradientFill(GradientType.LINEAR, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m);
- cover.graphics.drawRect(0, 0, w, w);
-
- // Red gradient to distort pixels horizontally
- var red:Shape = new Shape();
- m.createGradientBox(h, h, 0, (w - h) / 2, 0);
- red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m);
- red.graphics.drawRect(0, 0, w, w);
-
- // Green gradient to distort pixels vertically
- var green:Shape = new Shape();
- m.createGradientBox(h, h, Math.PI / 2, (w - h) / 2, 0);
- green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m);
- green.graphics.drawRect(0, 0, w, w);
-
- // Draw red and green gradients into one displacement map bitmap
- displace.mapBitmap.draw(red);
- displace.mapBitmap.draw(green, null, null, BlendMode.ADD);
-
- // Fade out the edges of the distorion linearly in each direction, up, down, left and right
- m.identity();
- m.scale(0.5, 1);
- displace.mapBitmap.draw(cover, m);
- m.rotate(Math.PI);
- m.translate(w, h);
- displace.mapBitmap.draw(cover, m);
- m.identity();
- m.scale(h / w / 2, 1);
- m.rotate(Math.PI / 2);
- m.translate(w, 0);
- displace.mapBitmap.draw(cover, m);
- m.rotate(Math.PI);
- m.translate(w, h);
- displace.mapBitmap.draw(cover, m);
-
- // Set the size of the displacement
- displace.scaleX = displace.scaleY = w;
- }
- }
+/** + * Neave Webcam // Squeeze Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class SqueezeEffect extends AbstractDisplaceEffect + { + /** + * Creates a squeezing distortion effect where the middle is squeezed and the edges are stretched + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function SqueezeEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Squeeze"); + + createSqueeze(); + } + + /** + * Sets up the squeeze effect + */ + private function createSqueeze():void + { + // The size of the squeeze effect + var w:int = rect.width; + var h:int = rect.height; + + // The displacement gradient matrix + var m:Matrix = new Matrix(); + + // Grey radial gradient to smooth the edges of the distortion + var cover:Shape = new Shape(); + m.createGradientBox(w, w); + cover.graphics.beginGradientFill(GradientType.LINEAR, [0x808080, 0x808080], [1, 0], [0x00, 0xFF], m); + cover.graphics.drawRect(0, 0, w, w); + + // Red gradient to distort pixels horizontally + var red:Shape = new Shape(); + m.createGradientBox(h, h, 0, (w - h) / 2, 0); + red.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0xFF0000], [1, 1], [0x00, 0xFF], m); + red.graphics.drawRect(0, 0, w, w); + + // Green gradient to distort pixels vertically + var green:Shape = new Shape(); + m.createGradientBox(h, h, Math.PI / 2, (w - h) / 2, 0); + green.graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x00FF00], [1, 1], [0x00, 0xFF], m); + green.graphics.drawRect(0, 0, w, w); + + // Draw red and green gradients into one displacement map bitmap + displace.mapBitmap.draw(red); + displace.mapBitmap.draw(green, null, null, BlendMode.ADD); + + // Fade out the edges of the distorion linearly in each direction, up, down, left and right + m.identity(); + m.scale(0.5, 1); + displace.mapBitmap.draw(cover, m); + m.rotate(Math.PI); + m.translate(w, h); + displace.mapBitmap.draw(cover, m); + m.identity(); + m.scale(h / w / 2, 1); + m.rotate(Math.PI / 2); + m.translate(w, 0); + displace.mapBitmap.draw(cover, m); + m.rotate(Math.PI); + m.translate(w, h); + displace.mapBitmap.draw(cover, m); + + // Set the size of the displacement + displace.scaleX = displace.scaleY = w; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/displace/WaterEffect.as b/webcam/webcam/effects/displace/WaterEffect.as index 4f45d72..6f4abb0 100755..100644 --- a/webcam/webcam/effects/displace/WaterEffect.as +++ b/webcam/webcam/effects/displace/WaterEffect.as @@ -1,76 +1,76 @@ -/**
- * Neave Webcam // Water Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.displace
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class WaterEffect extends AbstractDisplaceEffect
- {
- private var seed:int;
- private var offsets:Array;
- private var blue:ColorMatrixFilter;
-
- /**
- * Creates a water effect as if you were looking into a pool of waving water
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function WaterEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Water");
-
- createWater();
- }
-
- /**
- * Sets up the water effect
- */
- private function createWater():void
- {
- // Set up the displacement
- displace.scaleX = rect.width * 0.25;
- displace.scaleY = rect.height * 0.25;
- seed = Math.floor(Math.random() * 256);
- offsets = new Array(new Point(), new Point());
-
- // Blue colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, -10]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 30]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 70]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- blue = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the water effect
- */
- override public function draw():void
- {
- // Wave the water by moving the displacement map's offsets
- offsets[0].x += rect.width * 0.06;
- offsets[1].x += rect.height * 0.06;
-
- // Generate perlin noise as a displacement map to make water waves
- displace.mapBitmap.perlinNoise(rect.width * 0.5, rect.height * 0.5, 1, seed, false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false, offsets);
-
- // Draw the displaced image and tint it blue
- targetBitmap.lock();
- super.draw();
- targetBitmap.applyFilter(targetBitmap, rect, point, blue);
- targetBitmap.unlock();
- }
- }
+/** + * Neave Webcam // Water Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.displace +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class WaterEffect extends AbstractDisplaceEffect + { + private var seed:int; + private var offsets:Array; + private var blue:ColorMatrixFilter; + + /** + * Creates a water effect as if you were looking into a pool of waving water + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function WaterEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Water"); + + createWater(); + } + + /** + * Sets up the water effect + */ + private function createWater():void + { + // Set up the displacement + displace.scaleX = rect.width * 0.25; + displace.scaleY = rect.height * 0.25; + seed = Math.floor(Math.random() * 256); + offsets = new Array(new Point(), new Point()); + + // Blue colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, -10]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 30]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 70]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + blue = new ColorMatrixFilter(m); + } + + /** + * Draws the water effect + */ + override public function draw():void + { + // Wave the water by moving the displacement map's offsets + offsets[0].x += rect.width * 0.06; + offsets[1].x += rect.height * 0.06; + + // Generate perlin noise as a displacement map to make water waves + displace.mapBitmap.perlinNoise(rect.width * 0.5, rect.height * 0.5, 1, seed, false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false, offsets); + + // Draw the displaced image and tint it blue + targetBitmap.lock(); + super.draw(); + targetBitmap.applyFilter(targetBitmap, rect, point, blue); + targetBitmap.unlock(); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/AbstractMirrorEffect.as b/webcam/webcam/effects/mirror/AbstractMirrorEffect.as index 57008f7..decb011 100755..100644 --- a/webcam/webcam/effects/mirror/AbstractMirrorEffect.as +++ b/webcam/webcam/effects/mirror/AbstractMirrorEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Abstract Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractMirrorEffect extends AbstractEffect
- {
- protected var mirrorBitmap:BitmapData;
- protected var mirrorMatrix:Matrix;
- protected var mirrorPoint:Point;
-
- /**
- * An abstract mirror effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- super(source, targetBitmap, name);
-
- createAbstractMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createAbstractMirror():void
- {
- mirrorMatrix = new Matrix();
- mirrorPoint = new Point();
- }
-
- /**
- * Draws the mirror effect
- */
- override public function draw():void
- {
- super.draw();
- mirrorBitmap.draw(sourceBitmap, mirrorMatrix);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint);
- }
-
- /**
- * Removes the mirror effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- mirrorBitmap.dispose();
- mirrorBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + internal class AbstractMirrorEffect extends AbstractEffect + { + protected var mirrorBitmap:BitmapData; + protected var mirrorMatrix:Matrix; + protected var mirrorPoint:Point; + + /** + * An abstract mirror effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + super(source, targetBitmap, name); + + createAbstractMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createAbstractMirror():void + { + mirrorMatrix = new Matrix(); + mirrorPoint = new Point(); + } + + /** + * Draws the mirror effect + */ + override public function draw():void + { + super.draw(); + mirrorBitmap.draw(sourceBitmap, mirrorMatrix); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint); + } + + /** + * Removes the mirror effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + mirrorBitmap.dispose(); + mirrorBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/BottomMirrorEffect.as b/webcam/webcam/effects/mirror/BottomMirrorEffect.as index 4bb7b07..5a3be79 100755..100644 --- a/webcam/webcam/effects/mirror/BottomMirrorEffect.as +++ b/webcam/webcam/effects/mirror/BottomMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Bottom Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class BottomMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the bottom half of the image is reflected into the top half
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function BottomMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Bottom Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(1, -1);
- mirrorMatrix.translate(0, rect.height);
- mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Bottom Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class BottomMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the bottom half of the image is reflected into the top half + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function BottomMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Bottom Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(1, -1); + mirrorMatrix.translate(0, rect.height); + mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/InverseMirrorEffect.as b/webcam/webcam/effects/mirror/InverseMirrorEffect.as index 8f0da4c..982f6bc 100755..100644 --- a/webcam/webcam/effects/mirror/InverseMirrorEffect.as +++ b/webcam/webcam/effects/mirror/InverseMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Inverse Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class InverseMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the top half of the image is inversed
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function InverseMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Inverse Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(rect.width, 0);
- mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Inverse Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class InverseMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the top half of the image is inversed + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function InverseMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Inverse Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(rect.width, 0); + mirrorBitmap = new BitmapData(rect.width, Math.round(rect.height / 2), false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/LeftMirrorEffect.as b/webcam/webcam/effects/mirror/LeftMirrorEffect.as index 31cc510..912a96c 100755..100644 --- a/webcam/webcam/effects/mirror/LeftMirrorEffect.as +++ b/webcam/webcam/effects/mirror/LeftMirrorEffect.as @@ -1,41 +1,41 @@ -/**
- * Neave Webcam // Left Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class LeftMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the left side of the image is reflected into the right side (when using a flipped image)
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function LeftMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Left Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(rect.width, 0);
- mirrorBitmap = new BitmapData(Math.round(rect.width / 2), rect.height, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Left Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class LeftMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the left side of the image is reflected into the right side (when using a flipped image) + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function LeftMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Left Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(rect.width, 0); + mirrorBitmap = new BitmapData(Math.round(rect.width / 2), rect.height, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/QuadMirrorEffect.as b/webcam/webcam/effects/mirror/QuadMirrorEffect.as index d4e84a4..5c1442a 100755..100644 --- a/webcam/webcam/effects/mirror/QuadMirrorEffect.as +++ b/webcam/webcam/effects/mirror/QuadMirrorEffect.as @@ -1,97 +1,97 @@ -/**
- * Neave Webcam // Quad Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class QuadMirrorEffect extends AbstractEffect
- {
- private var quadBitmap:BitmapData;
- private var halfBitmap:BitmapData;
- private var quadMatrix:Matrix;
- private var rightMatrix:Matrix;
- private var topMatrix:Matrix;
- private var bottomMatrix:Matrix;
-
- /**
- * Creates a mirror effect where the source image is reflected vertically and horizontally
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function QuadMirrorEffect(source:IBitmapDrawable, targetBitmapData:BitmapData)
- {
- super(source, targetBitmapData, "Quad Mirror");
-
- createQuadMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createQuadMirror():void
- {
- // Mirror dimensions
- var midW:int = Math.round(rect.width / 2);
- var midH:int = Math.round(rect.height / 2);
-
- // Reflected bitmap data
- quadBitmap = new BitmapData(midW, midH, false, 0xFF000000);
- halfBitmap = new BitmapData(rect.width, midH, false, 0xFF000000);
-
- // Half size matrix
- quadMatrix = new Matrix();
- quadMatrix.scale(0.5, 0.5);
-
- // Right side matrix
- rightMatrix = new Matrix();
- rightMatrix.scale(-1, 1);
- rightMatrix.translate(rect.width, 0);
-
- // Top half matrix
- topMatrix = new Matrix();
- topMatrix.scale(1, -1);
- topMatrix.translate(0, midH);
-
- // Bottom half matrix
- bottomMatrix = new Matrix();
- bottomMatrix.translate(0, midH);
- }
-
- /**
- * Draws the quad mirror effect
- */
- override public function draw():void
- {
- super.draw();
- quadBitmap.draw(sourceBitmap, quadMatrix); // Draw quarter image
- halfBitmap.draw(quadBitmap); // Draw quarter into left
- halfBitmap.draw(quadBitmap, rightMatrix); // Draw quarter into right
- targetBitmap.draw(halfBitmap, bottomMatrix); // Draw half into bottom
- targetBitmap.draw(halfBitmap, topMatrix); // Draw half into top
- }
-
- /**
- * Removes the quad mirror effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- quadBitmap.dispose();
- quadBitmap = null;
- halfBitmap.dispose();
- halfBitmap = null;
- }
- }
+/** + * Neave Webcam // Quad Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class QuadMirrorEffect extends AbstractEffect + { + private var quadBitmap:BitmapData; + private var halfBitmap:BitmapData; + private var quadMatrix:Matrix; + private var rightMatrix:Matrix; + private var topMatrix:Matrix; + private var bottomMatrix:Matrix; + + /** + * Creates a mirror effect where the source image is reflected vertically and horizontally + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function QuadMirrorEffect(source:IBitmapDrawable, targetBitmapData:BitmapData) + { + super(source, targetBitmapData, "Quad Mirror"); + + createQuadMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createQuadMirror():void + { + // Mirror dimensions + var midW:int = Math.round(rect.width / 2); + var midH:int = Math.round(rect.height / 2); + + // Reflected bitmap data + quadBitmap = new BitmapData(midW, midH, false, 0xFF000000); + halfBitmap = new BitmapData(rect.width, midH, false, 0xFF000000); + + // Half size matrix + quadMatrix = new Matrix(); + quadMatrix.scale(0.5, 0.5); + + // Right side matrix + rightMatrix = new Matrix(); + rightMatrix.scale(-1, 1); + rightMatrix.translate(rect.width, 0); + + // Top half matrix + topMatrix = new Matrix(); + topMatrix.scale(1, -1); + topMatrix.translate(0, midH); + + // Bottom half matrix + bottomMatrix = new Matrix(); + bottomMatrix.translate(0, midH); + } + + /** + * Draws the quad mirror effect + */ + override public function draw():void + { + super.draw(); + quadBitmap.draw(sourceBitmap, quadMatrix); // Draw quarter image + halfBitmap.draw(quadBitmap); // Draw quarter into left + halfBitmap.draw(quadBitmap, rightMatrix); // Draw quarter into right + targetBitmap.draw(halfBitmap, bottomMatrix); // Draw half into bottom + targetBitmap.draw(halfBitmap, topMatrix); // Draw half into top + } + + /** + * Removes the quad mirror effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + quadBitmap.dispose(); + quadBitmap = null; + halfBitmap.dispose(); + halfBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/RightMirrorEffect.as b/webcam/webcam/effects/mirror/RightMirrorEffect.as index d469226..2df2a03 100755..100644 --- a/webcam/webcam/effects/mirror/RightMirrorEffect.as +++ b/webcam/webcam/effects/mirror/RightMirrorEffect.as @@ -1,44 +1,44 @@ -/**
- * Neave Webcam // Right Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class RightMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the right side of the image is reflected into the left side (when using a flipped image)
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function RightMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Right Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- var midW:int = Math.round(rect.width / 2);
-
- mirrorMatrix.scale(-1, 1);
- mirrorMatrix.translate(midW, 0);
- mirrorPoint.x = midW;
- mirrorBitmap = new BitmapData(midW, rect.height, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Right Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class RightMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the right side of the image is reflected into the left side (when using a flipped image) + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function RightMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Right Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + var midW:int = Math.round(rect.width / 2); + + mirrorMatrix.scale(-1, 1); + mirrorMatrix.translate(midW, 0); + mirrorPoint.x = midW; + mirrorBitmap = new BitmapData(midW, rect.height, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/TopMirrorEffect.as b/webcam/webcam/effects/mirror/TopMirrorEffect.as index af69612..a911b09 100755..100644 --- a/webcam/webcam/effects/mirror/TopMirrorEffect.as +++ b/webcam/webcam/effects/mirror/TopMirrorEffect.as @@ -1,44 +1,44 @@ -/**
- * Neave Webcam // Top Mirror Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
-
- public class TopMirrorEffect extends AbstractMirrorEffect
- {
- /**
- * Creates a mirror effect where the top half of the image is reflected into the bottom half
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function TopMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Top Mirror");
-
- createMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createMirror():void
- {
- var midH:int = Math.round(rect.height / 2);
-
- mirrorMatrix.scale(1, -1);
- mirrorMatrix.translate(0, midH);
- mirrorPoint.y = midH;
- mirrorBitmap = new BitmapData(rect.width, midH, false, 0xFF000000);
- }
- }
+/** + * Neave Webcam // Top Mirror Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + + public class TopMirrorEffect extends AbstractMirrorEffect + { + /** + * Creates a mirror effect where the top half of the image is reflected into the bottom half + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function TopMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Top Mirror"); + + createMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createMirror():void + { + var midH:int = Math.round(rect.height / 2); + + mirrorMatrix.scale(1, -1); + mirrorMatrix.translate(0, midH); + mirrorPoint.y = midH; + mirrorBitmap = new BitmapData(rect.width, midH, false, 0xFF000000); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/mirror/UpsideDownEffect.as b/webcam/webcam/effects/mirror/UpsideDownEffect.as index 71e08d8..1b2bd9d 100755..100644 --- a/webcam/webcam/effects/mirror/UpsideDownEffect.as +++ b/webcam/webcam/effects/mirror/UpsideDownEffect.as @@ -1,54 +1,54 @@ -/**
- * Neave Webcam // Upside-Down Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.mirror
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class UpsideDownEffect extends AbstractEffect
- {
- private var flipMatrix:Matrix;
-
- /**
- * Creates a mirror effect where the source image is flipped vertically
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function UpsideDownEffect(source:IBitmapDrawable, targetBitmapData:BitmapData)
- {
- super(source, targetBitmapData, "Upside-Down");
-
- createUpsideDown();
- }
-
- /**
- * Sets up the upside-down effect
- */
- private function createUpsideDown():void
- {
- flipMatrix = new Matrix();
- flipMatrix.scale(1, -1);
- flipMatrix.translate(0, rect.height);
- }
-
- /**
- * Draws the upside-down effect
- */
- override public function draw():void
- {
- super.draw();
- targetBitmap.draw(sourceBitmap, flipMatrix);
- }
- }
+/** + * Neave Webcam // Upside-Down Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.mirror +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class UpsideDownEffect extends AbstractEffect + { + private var flipMatrix:Matrix; + + /** + * Creates a mirror effect where the source image is flipped vertically + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function UpsideDownEffect(source:IBitmapDrawable, targetBitmapData:BitmapData) + { + super(source, targetBitmapData, "Upside-Down"); + + createUpsideDown(); + } + + /** + * Sets up the upside-down effect + */ + private function createUpsideDown():void + { + flipMatrix = new Matrix(); + flipMatrix.scale(1, -1); + flipMatrix.translate(0, rect.height); + } + + /** + * Draws the upside-down effect + */ + override public function draw():void + { + super.draw(); + targetBitmap.draw(sourceBitmap, flipMatrix); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/AbstractMotionEffect.as b/webcam/webcam/effects/motion/AbstractMotionEffect.as index 3301a8a..37095ac 100755..100644 --- a/webcam/webcam/effects/motion/AbstractMotionEffect.as +++ b/webcam/webcam/effects/motion/AbstractMotionEffect.as @@ -1,138 +1,138 @@ -/**
- * Neave Webcam // Abstract Motion Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractMotionEffect extends AbstractEffect
- {
- private var motionScale:int;
- private var motionFrames:int;
- private var contrast:ColorTransform;
- private var frames:Array;
- private var frameBitmap:BitmapData;
- protected var monochrome:ColorMatrixFilter;
- protected var motionBitmap:BitmapData;
- protected var motionRect:Rectangle;
- protected var motionMatrix:Matrix;
-
- /**
- * An abstract motion detection effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- * @param motionScale The scale of the motion bitmap data to use for detection
- * @param motionFrames The number of frames to capture for the motion bitmap data
- */
- public function AbstractMotionEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "", motionScale:int = 1, motionFrames:int = 4)
- {
- super(source, targetBitmap, name);
- this.motionScale = motionScale < 1 ? 1 : motionScale;
- this.motionFrames = motionFrames < 1 ? 1 : motionFrames;
-
- createAbstractMotion();
- }
-
- /**
- * Sets up the motion effect
- */
- private function createAbstractMotion():void
- {
- // Increase contrast
- contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Motion bitmap dimensions
- var w:int = Math.round(rect.width / motionScale);
- var h:int = Math.round(rect.height / motionScale);
-
- // Main motion bitmap data
- motionBitmap = new BitmapData(w, h, false, 0xFF000000);
- motionRect = motionBitmap.rect;
- motionMatrix = new Matrix();
- motionMatrix.scale(1 / motionScale, 1 / motionScale);
-
- // The previous frame to use when comparing with the current image
- frameBitmap = motionBitmap.clone();
- frameBitmap.draw(source, motionMatrix, contrast);
-
- // Create the delayed motion frames
- frames = new Array();
- for (var i:int = motionFrames; i--; ) frames.push(new BitmapData(w, h, false, 0xFF000000));
-
- // Monochrome colour matrix
- var m:Array = new Array();
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green
- m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- monochrome = new ColorMatrixFilter(m);
- }
-
- /**
- * Draws the motion effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Clear old motion bitmap
- motionBitmap.fillRect(motionRect, 0xFF000000);
-
- // Do motion detection
- for (var i:int = motionFrames; i--; )
- {
- var b:BitmapData = frames[i];
- if (i == 0)
- {
- // Detect motion by taking the difference between this source image to the previous source image
- b.copyPixels(frameBitmap, motionRect, point); // Get the old image
- frameBitmap.draw(sourceBitmap, motionMatrix, contrast); // Draw the new image
- frameBitmap.applyFilter(frameBitmap, motionRect, point, monochrome); // Convert the new image to greyscale
- b.draw(frameBitmap, null, null, BlendMode.DIFFERENCE); // Draw the difference
- }
- else b.copyPixels(frames[i - 1], motionRect, point); // Move the motion frames along the array
-
- // Add all the motion frames into a single bitmap
- motionBitmap.draw(b, null, null, BlendMode.ADD);
- }
-
- // Separate the motion bitmap data into only black and white pixels
- motionBitmap.threshold(motionBitmap, motionRect, point, ">", 0xFF808080, 0xFFFFFFFF);
- motionBitmap.threshold(motionBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000);
- }
-
- /**
- * Removes the motion effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the motion frames
- for (var i:int = motionFrames; i--; )
- {
- frames[i].dispose();
- frames[i] = null;
- }
- frames = null;
-
- frameBitmap.dispose();
- frameBitmap = null;
- motionBitmap.dispose();
- motionBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract Motion Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + internal class AbstractMotionEffect extends AbstractEffect + { + private var motionScale:int; + private var motionFrames:int; + private var contrast:ColorTransform; + private var frames:Array; + private var frameBitmap:BitmapData; + protected var monochrome:ColorMatrixFilter; + protected var motionBitmap:BitmapData; + protected var motionRect:Rectangle; + protected var motionMatrix:Matrix; + + /** + * An abstract motion detection effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + * @param motionScale The scale of the motion bitmap data to use for detection + * @param motionFrames The number of frames to capture for the motion bitmap data + */ + public function AbstractMotionEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "", motionScale:int = 1, motionFrames:int = 4) + { + super(source, targetBitmap, name); + this.motionScale = motionScale < 1 ? 1 : motionScale; + this.motionFrames = motionFrames < 1 ? 1 : motionFrames; + + createAbstractMotion(); + } + + /** + * Sets up the motion effect + */ + private function createAbstractMotion():void + { + // Increase contrast + contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Motion bitmap dimensions + var w:int = Math.round(rect.width / motionScale); + var h:int = Math.round(rect.height / motionScale); + + // Main motion bitmap data + motionBitmap = new BitmapData(w, h, false, 0xFF000000); + motionRect = motionBitmap.rect; + motionMatrix = new Matrix(); + motionMatrix.scale(1 / motionScale, 1 / motionScale); + + // The previous frame to use when comparing with the current image + frameBitmap = motionBitmap.clone(); + frameBitmap.draw(source, motionMatrix, contrast); + + // Create the delayed motion frames + frames = new Array(); + for (var i:int = motionFrames; i--; ) frames.push(new BitmapData(w, h, false, 0xFF000000)); + + // Monochrome colour matrix + var m:Array = new Array(); + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Red + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Green + m = m.concat([0.3, 0.59, 0.11, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + monochrome = new ColorMatrixFilter(m); + } + + /** + * Draws the motion effect + */ + override public function draw():void + { + super.draw(); + + // Clear old motion bitmap + motionBitmap.fillRect(motionRect, 0xFF000000); + + // Do motion detection + for (var i:int = motionFrames; i--; ) + { + var b:BitmapData = frames[i]; + if (i == 0) + { + // Detect motion by taking the difference between this source image to the previous source image + b.copyPixels(frameBitmap, motionRect, point); // Get the old image + frameBitmap.draw(sourceBitmap, motionMatrix, contrast); // Draw the new image + frameBitmap.applyFilter(frameBitmap, motionRect, point, monochrome); // Convert the new image to greyscale + b.draw(frameBitmap, null, null, BlendMode.DIFFERENCE); // Draw the difference + } + else b.copyPixels(frames[i - 1], motionRect, point); // Move the motion frames along the array + + // Add all the motion frames into a single bitmap + motionBitmap.draw(b, null, null, BlendMode.ADD); + } + + // Separate the motion bitmap data into only black and white pixels + motionBitmap.threshold(motionBitmap, motionRect, point, ">", 0xFF808080, 0xFFFFFFFF); + motionBitmap.threshold(motionBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000); + } + + /** + * Removes the motion effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the motion frames + for (var i:int = motionFrames; i--; ) + { + frames[i].dispose(); + frames[i] = null; + } + frames = null; + + frameBitmap.dispose(); + frameBitmap = null; + motionBitmap.dispose(); + motionBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/FireEffect.as b/webcam/webcam/effects/motion/FireEffect.as index 33dcfe2..cc0a760 100755..100644 --- a/webcam/webcam/effects/motion/FireEffect.as +++ b/webcam/webcam/effects/motion/FireEffect.as @@ -1,129 +1,129 @@ -/**
- * Neave Webcam // Fire Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class FireEffect extends AbstractMotionEffect
- {
- private const MOTION_SCALE:int = 2;
-
- private var fireSourceBitmap:BitmapData;
- private var fireBitmap:BitmapData;
- private var darkenBitmap:BitmapData;
- private var edge:ConvolutionFilter;
- private var fireColor:ColorMatrixFilter;
- private var displace:DisplacementMapFilter;
- private var blur:BlurFilter;
- private var targetMatrix:Matrix;
-
- /**
- * Creates a fire effect which animates along edges and as motion is detected
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function FireEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Fire", MOTION_SCALE, 5);
-
- createFire();
- }
-
- /**
- * Sets up the fire effect
- */
- private function createFire():void
- {
- // Set up fire bitmap data and scaling
- fireSourceBitmap = motionBitmap.clone();
- fireBitmap = motionBitmap.clone();
- targetMatrix = new Matrix();
- targetMatrix.scale(MOTION_SCALE, MOTION_SCALE);
-
- // Edge detection convolution array
- var m:Array =
- [
- 0, 0, 0,
- 16, 16, 16,
- -16, -16, -16
- ];
- edge = new ConvolutionFilter(3, 3, m, 9);
-
- // Fire colour matrix
- m = new Array();
- m = m.concat([0.8, 0.05, 0, 0, 0]); // Red
- m = m.concat([0, 0.65, 0, 0, 0]); // Green
- m = m.concat([0, 0, 0.5, 0, 0]); // Blue
- m = m.concat([0, 0, 0, 1, 0]); // Alpha
- fireColor = new ColorMatrixFilter(m);
-
- // Fire displacement map
- displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 7, -35, DisplacementMapFilterMode.CLAMP);
-
- // Fire blurring
- blur = new BlurFilter(8, 8, 1);
-
- // Darken the fire
- darkenBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFF8000);
- }
-
- /**
- * Draws the fire effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Get the source image's edges
- fireSourceBitmap.draw(sourceBitmap, motionMatrix);
- fireBitmap.applyFilter(fireSourceBitmap, motionRect, point, edge);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, monochrome);
-
- // Add motion bitmap to edge bitmap and turn pixels into orange and black only
- fireBitmap.draw(motionBitmap, null, null, BlendMode.ADD);
- fireBitmap.threshold(fireBitmap, motionRect, point, ">", 0xFF808080, 0xFFFF8000);
- fireBitmap.threshold(fireBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000);
-
- // Blur to make motion bitmap look more like fire
- fireBitmap.applyFilter(fireBitmap, motionRect, point, blur);
-
- // Displace the image with perlin noise to animate the fire
- displace.mapBitmap.perlinNoise(14, 10, 1, Math.floor(Math.random() * 256), false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false);
- displace.mapBitmap.draw(darkenBitmap, null, null, BlendMode.DARKEN);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, displace);
- fireBitmap.applyFilter(fireBitmap, motionRect, point, fireColor);
-
- // Draw the fire bitmap on top of the current source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(fireBitmap, targetMatrix, null, BlendMode.ADD);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the fire effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- fireSourceBitmap.dispose();
- fireSourceBitmap = null;
- fireBitmap.dispose();
- fireBitmap = null;
- darkenBitmap.dispose();
- darkenBitmap = null;
- }
- }
+/** + * Neave Webcam // Fire Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + + public class FireEffect extends AbstractMotionEffect + { + private const MOTION_SCALE:int = 2; + + private var fireSourceBitmap:BitmapData; + private var fireBitmap:BitmapData; + private var darkenBitmap:BitmapData; + private var edge:ConvolutionFilter; + private var fireColor:ColorMatrixFilter; + private var displace:DisplacementMapFilter; + private var blur:BlurFilter; + private var targetMatrix:Matrix; + + /** + * Creates a fire effect which animates along edges and as motion is detected + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function FireEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Fire", MOTION_SCALE, 5); + + createFire(); + } + + /** + * Sets up the fire effect + */ + private function createFire():void + { + // Set up fire bitmap data and scaling + fireSourceBitmap = motionBitmap.clone(); + fireBitmap = motionBitmap.clone(); + targetMatrix = new Matrix(); + targetMatrix.scale(MOTION_SCALE, MOTION_SCALE); + + // Edge detection convolution array + var m:Array = + [ + 0, 0, 0, + 16, 16, 16, + -16, -16, -16 + ]; + edge = new ConvolutionFilter(3, 3, m, 9); + + // Fire colour matrix + m = new Array(); + m = m.concat([0.8, 0.05, 0, 0, 0]); // Red + m = m.concat([0, 0.65, 0, 0, 0]); // Green + m = m.concat([0, 0, 0.5, 0, 0]); // Blue + m = m.concat([0, 0, 0, 1, 0]); // Alpha + fireColor = new ColorMatrixFilter(m); + + // Fire displacement map + displace = new DisplacementMapFilter(new BitmapData(rect.width, rect.height, false, 0xFF808080), point, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 7, -35, DisplacementMapFilterMode.CLAMP); + + // Fire blurring + blur = new BlurFilter(8, 8, 1); + + // Darken the fire + darkenBitmap = new BitmapData(rect.width, rect.height, false, 0xFFFF8000); + } + + /** + * Draws the fire effect + */ + override public function draw():void + { + super.draw(); + + // Get the source image's edges + fireSourceBitmap.draw(sourceBitmap, motionMatrix); + fireBitmap.applyFilter(fireSourceBitmap, motionRect, point, edge); + fireBitmap.applyFilter(fireBitmap, motionRect, point, monochrome); + + // Add motion bitmap to edge bitmap and turn pixels into orange and black only + fireBitmap.draw(motionBitmap, null, null, BlendMode.ADD); + fireBitmap.threshold(fireBitmap, motionRect, point, ">", 0xFF808080, 0xFFFF8000); + fireBitmap.threshold(fireBitmap, motionRect, point, "<=", 0xFF808080, 0xFF000000); + + // Blur to make motion bitmap look more like fire + fireBitmap.applyFilter(fireBitmap, motionRect, point, blur); + + // Displace the image with perlin noise to animate the fire + displace.mapBitmap.perlinNoise(14, 10, 1, Math.floor(Math.random() * 256), false, true, BitmapDataChannel.RED | BitmapDataChannel.GREEN, false); + displace.mapBitmap.draw(darkenBitmap, null, null, BlendMode.DARKEN); + fireBitmap.applyFilter(fireBitmap, motionRect, point, displace); + fireBitmap.applyFilter(fireBitmap, motionRect, point, fireColor); + + // Draw the fire bitmap on top of the current source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(fireBitmap, targetMatrix, null, BlendMode.ADD); + targetBitmap.unlock(); + } + + /** + * Removes the fire effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + fireSourceBitmap.dispose(); + fireSourceBitmap = null; + fireBitmap.dispose(); + fireBitmap = null; + darkenBitmap.dispose(); + darkenBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/SnowEffect.as b/webcam/webcam/effects/motion/SnowEffect.as index 30468d9..b2a945f 100755..100644 --- a/webcam/webcam/effects/motion/SnowEffect.as +++ b/webcam/webcam/effects/motion/SnowEffect.as @@ -1,154 +1,154 @@ -/**
- * Neave Webcam // Snow Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.events.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.utils.*;
- import com.neave.webcam.effects.*;
-
- public class SnowEffect extends AbstractEffect
- {
- private const SNOWFLAKE_DELAY:int = 20;
- private const MELT_SPEED:Number = 0.0025;
-
- private var totalFlakes:int;
- private var snowSourceBitmap:BitmapData;
- private var edgeBitmap:BitmapData;
- private var edge:ConvolutionFilter;
- private var blur:BlurFilter;
- private var snowflakes:Sprite;
- private var snowTimer:Timer;
- private var snowMatrix:Matrix;
- private var contrast:ColorTransform;
-
- /**
- * Creates a snow effect where falling snowflakes settle and build up along edges
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param totalFlakes The total number of snowflakes to use
- */
- public function SnowEffect(source:IBitmapDrawable, targetBitmap:BitmapData, totalFlakes:int = 200)
- {
- super(source, targetBitmap, "Snow");
- this.totalFlakes = totalFlakes < 1 ? 1 : totalFlakes;
-
- createSnow();
- }
-
- /**
- * Sets up the snow effect
- */
- private function createSnow():void
- {
- // Increase contrast to better detect edges
- //contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Create bitmaps to hold edge detection
- snowSourceBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000);
- edgeBitmap = snowSourceBitmap.clone();
- snowMatrix = new Matrix();
- snowMatrix.scale(0.5, 0.5);
-
- // Add a new snowflake to the snowflakes sprite every so often
- snowflakes = new Sprite();
- snowTimer = new Timer(SNOWFLAKE_DELAY);
- snowTimer.addEventListener(TimerEvent.TIMER, makeNewSnowflake);
- snowTimer.start();
-
- // Edge detection convolution array
- var m:Array =
- [
- 0, 50, 0,
- 0, -60, 0,
- 0, 10, 0
- ];
- edge = new ConvolutionFilter(3, 3, m, 5);
- }
-
- /**
- * Creates a new snowflake inside the snowflakes sprite
- */
- private function makeNewSnowflake(e:TimerEvent = null):void
- {
- // Only add another random snowflake if the maximum amount has not been reached
- if (snowflakes.numChildren < totalFlakes) snowflakes.addChild(new Snowflake(Math.random() * rect.width, -4, Math.random() * 2 + 1, Math.random() * 2 - 1));
- }
-
- /**
- * Draws the snow effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each snowflake
- for (var i:int = snowflakes.numChildren; i--; )
- {
- var flake:Snowflake = snowflakes.getChildAt(i) as Snowflake;
-
- // Only move the snowflake if it is not hitting an edge
- if (edgeBitmap.getPixel(Math.round(flake.x / 2), Math.round(flake.y / 2)) == 0x000000)
- {
- // Animate the snowflake
- flake.fall();
- flake.alpha += 0.1;
- if (flake.alpha > 1) flake.alpha = 1;
-
- // Wrap the snowflake to within the bounds of the image
- if (flake.x > rect.width + flake.width) flake.x -= rect.width + flake.width;
- if (flake.x < -flake.width) flake.x += rect.width + flake.width;
-
- // Remove this snowflake if it has fallen off the bottom of the image
- if (flake.y > rect.height + flake.height) snowflakes.removeChildAt(i);
- }
- else
- {
- // Melt this snowflake by fading out it
- if (flake.alpha > 0.1) flake.alpha -= MELT_SPEED;
- else snowflakes.removeChildAt(i);
- }
- }
-
- // Find the edges for the snow to settle on
- snowSourceBitmap.draw(sourceBitmap, snowMatrix, contrast);
- edgeBitmap.applyFilter(snowSourceBitmap, edgeBitmap.rect, point, edge);
- edgeBitmap.threshold(edgeBitmap, edgeBitmap.rect, point, "<", 0xFF808080, 0xFF000000);
-
- // Draw the snow over the current source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(snowflakes);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the snow effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Stop making new snowflakes
- snowTimer.removeEventListener(TimerEvent.TIMER, makeNewSnowflake);
-
- // Remove bitmap data
- snowSourceBitmap.dispose();
- snowSourceBitmap = null;
- edgeBitmap.dispose();
- edgeBitmap = null;
- }
- }
+/** + * Neave Webcam // Snow Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.events.*; + import flash.filters.*; + import flash.geom.*; + import flash.utils.*; + import com.neave.webcam.effects.*; + + public class SnowEffect extends AbstractEffect + { + private const SNOWFLAKE_DELAY:int = 20; + private const MELT_SPEED:Number = 0.0025; + + private var totalFlakes:int; + private var snowSourceBitmap:BitmapData; + private var edgeBitmap:BitmapData; + private var edge:ConvolutionFilter; + private var blur:BlurFilter; + private var snowflakes:Sprite; + private var snowTimer:Timer; + private var snowMatrix:Matrix; + private var contrast:ColorTransform; + + /** + * Creates a snow effect where falling snowflakes settle and build up along edges + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param totalFlakes The total number of snowflakes to use + */ + public function SnowEffect(source:IBitmapDrawable, targetBitmap:BitmapData, totalFlakes:int = 200) + { + super(source, targetBitmap, "Snow"); + this.totalFlakes = totalFlakes < 1 ? 1 : totalFlakes; + + createSnow(); + } + + /** + * Sets up the snow effect + */ + private function createSnow():void + { + // Increase contrast to better detect edges + //contrast = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Create bitmaps to hold edge detection + snowSourceBitmap = new BitmapData(Math.round(rect.width / 2), Math.round(rect.height / 2), false, 0xFF000000); + edgeBitmap = snowSourceBitmap.clone(); + snowMatrix = new Matrix(); + snowMatrix.scale(0.5, 0.5); + + // Add a new snowflake to the snowflakes sprite every so often + snowflakes = new Sprite(); + snowTimer = new Timer(SNOWFLAKE_DELAY); + snowTimer.addEventListener(TimerEvent.TIMER, makeNewSnowflake); + snowTimer.start(); + + // Edge detection convolution array + var m:Array = + [ + 0, 50, 0, + 0, -60, 0, + 0, 10, 0 + ]; + edge = new ConvolutionFilter(3, 3, m, 5); + } + + /** + * Creates a new snowflake inside the snowflakes sprite + */ + private function makeNewSnowflake(e:TimerEvent = null):void + { + // Only add another random snowflake if the maximum amount has not been reached + if (snowflakes.numChildren < totalFlakes) snowflakes.addChild(new Snowflake(Math.random() * rect.width, -4, Math.random() * 2 + 1, Math.random() * 2 - 1)); + } + + /** + * Draws the snow effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each snowflake + for (var i:int = snowflakes.numChildren; i--; ) + { + var flake:Snowflake = snowflakes.getChildAt(i) as Snowflake; + + // Only move the snowflake if it is not hitting an edge + if (edgeBitmap.getPixel(Math.round(flake.x / 2), Math.round(flake.y / 2)) == 0x000000) + { + // Animate the snowflake + flake.fall(); + flake.alpha += 0.1; + if (flake.alpha > 1) flake.alpha = 1; + + // Wrap the snowflake to within the bounds of the image + if (flake.x > rect.width + flake.width) flake.x -= rect.width + flake.width; + if (flake.x < -flake.width) flake.x += rect.width + flake.width; + + // Remove this snowflake if it has fallen off the bottom of the image + if (flake.y > rect.height + flake.height) snowflakes.removeChildAt(i); + } + else + { + // Melt this snowflake by fading out it + if (flake.alpha > 0.1) flake.alpha -= MELT_SPEED; + else snowflakes.removeChildAt(i); + } + } + + // Find the edges for the snow to settle on + snowSourceBitmap.draw(sourceBitmap, snowMatrix, contrast); + edgeBitmap.applyFilter(snowSourceBitmap, edgeBitmap.rect, point, edge); + edgeBitmap.threshold(edgeBitmap, edgeBitmap.rect, point, "<", 0xFF808080, 0xFF000000); + + // Draw the snow over the current source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(snowflakes); + targetBitmap.unlock(); + } + + /** + * Removes the snow effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Stop making new snowflakes + snowTimer.removeEventListener(TimerEvent.TIMER, makeNewSnowflake); + + // Remove bitmap data + snowSourceBitmap.dispose(); + snowSourceBitmap = null; + edgeBitmap.dispose(); + edgeBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/Snowflake.as b/webcam/webcam/effects/motion/Snowflake.as index fc943f5..79ee34c 100755..100644 --- a/webcam/webcam/effects/motion/Snowflake.as +++ b/webcam/webcam/effects/motion/Snowflake.as @@ -1,66 +1,66 @@ -/**
- * Neave Webcam // Snowflake
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.geom.*;
-
- final internal class Snowflake extends Shape
- {
- private const SIDEWAYS_DAMPEN:Number = 0.995;
-
- private var size:Number;
- private var vx:Number;
-
- /**
- * Draws a snowflake shape to be used with the snow effect
- *
- * @param x The position of the snowflake on the x-axis
- * @param y The position of the snowflake on the y-axis
- * @param size The size of the snowflake
- * @param vx The sideways velocity of the snowflake
- */
- public function Snowflake(x:Number = 0, y:Number = 0, size:Number = 1, vx:Number = 0)
- {
- this.x = x;
- this.y = y;
- this.size = size;
- this.vx = vx;
-
- createSnowflake();
- }
-
- /**
- * Sets up the snowflake shape, a white oval gradient
- */
- private function createSnowflake():void
- {
- var m:Matrix = new Matrix();
- m.createGradientBox(size * 2, size * 2);
- m.translate(-size, -size);
- graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0xFFFFFF], [1, 0], [0x66, 0xFF], m);
- graphics.drawCircle(0, 0, size);
- width *= 1.5;
- cacheAsBitmap = true;
- }
-
- /**
- * Animates the snowflake downwards
- */
- internal function fall():void
- {
- vx *= SIDEWAYS_DAMPEN;
- x += vx;
- y += size;
- }
- }
+/** + * Neave Webcam // Snowflake + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.geom.*; + + final internal class Snowflake extends Shape + { + private const SIDEWAYS_DAMPEN:Number = 0.995; + + private var size:Number; + private var vx:Number; + + /** + * Draws a snowflake shape to be used with the snow effect + * + * @param x The position of the snowflake on the x-axis + * @param y The position of the snowflake on the y-axis + * @param size The size of the snowflake + * @param vx The sideways velocity of the snowflake + */ + public function Snowflake(x:Number = 0, y:Number = 0, size:Number = 1, vx:Number = 0) + { + this.x = x; + this.y = y; + this.size = size; + this.vx = vx; + + createSnowflake(); + } + + /** + * Sets up the snowflake shape, a white oval gradient + */ + private function createSnowflake():void + { + var m:Matrix = new Matrix(); + m.createGradientBox(size * 2, size * 2); + m.translate(-size, -size); + graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0xFFFFFF], [1, 0], [0x66, 0xFF], m); + graphics.drawCircle(0, 0, size); + width *= 1.5; + cacheAsBitmap = true; + } + + /** + * Animates the snowflake downwards + */ + internal function fall():void + { + vx *= SIDEWAYS_DAMPEN; + x += vx; + y += size; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/SteamEffect.as b/webcam/webcam/effects/motion/SteamEffect.as index 0b55ca2..1666bdc 100755..100644 --- a/webcam/webcam/effects/motion/SteamEffect.as +++ b/webcam/webcam/effects/motion/SteamEffect.as @@ -1,73 +1,73 @@ -/**
- * Neave Webcam // Steamy Window Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
-
- public class SteamEffect extends AbstractMotionEffect
- {
- private var steamBitmap:BitmapData;
- private var blackBitmap:BitmapData;
- private var wipedBitmap:BitmapData;
-
- /**
- * Creates a steamy window effect where detected motion wipes away areas of the steamed-up image
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- */
- public function SteamEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
- {
- super(source, targetBitmap, "Steamy Window");
-
- createSteam();
- }
-
- /**
- * Sets up the steam effect
- */
- private function createSteam():void
- {
- steamBitmap = new BitmapData(rect.width, rect.height, false, 0xFF808080);
- blackBitmap = new BitmapData(rect.width, rect.height, false, 0xFF000000);
- wipedBitmap = blackBitmap.clone();
- }
-
- /**
- * Draws the steam effect
- */
- override public function draw():void
- {
- super.draw();
- wipedBitmap.draw(motionBitmap, null, null, BlendMode.ADD); // Build up a wiped area by repeatedly adding the motion bitmap
- wipedBitmap.merge(blackBitmap, rect, point, 2, 2, 2, 0); // Gradually fade away the wiped areas
- steamBitmap.fillRect(rect, 0xFF808080); // Create some steam
- steamBitmap.draw(wipedBitmap, null, null, BlendMode.SUBTRACT); // Remove the wiped areas from the steam
- sourceBitmap.merge(steamBitmap, rect, point, 0x80, 0x80, 0x80, 0); // Merge the steam with the source image
- targetBitmap.copyPixels(sourceBitmap, rect, point); // Draw into the target bitmap
- }
-
- /**
- * Removes the steam effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- steamBitmap.dispose();
- steamBitmap = null;
- blackBitmap.dispose();
- blackBitmap = null;
- wipedBitmap.dispose();
- wipedBitmap = null;
- }
- }
+/** + * Neave Webcam // Steamy Window Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + + public class SteamEffect extends AbstractMotionEffect + { + private var steamBitmap:BitmapData; + private var blackBitmap:BitmapData; + private var wipedBitmap:BitmapData; + + /** + * Creates a steamy window effect where detected motion wipes away areas of the steamed-up image + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + */ + public function SteamEffect(source:IBitmapDrawable, targetBitmap:BitmapData) + { + super(source, targetBitmap, "Steamy Window"); + + createSteam(); + } + + /** + * Sets up the steam effect + */ + private function createSteam():void + { + steamBitmap = new BitmapData(rect.width, rect.height, false, 0xFF808080); + blackBitmap = new BitmapData(rect.width, rect.height, false, 0xFF000000); + wipedBitmap = blackBitmap.clone(); + } + + /** + * Draws the steam effect + */ + override public function draw():void + { + super.draw(); + wipedBitmap.draw(motionBitmap, null, null, BlendMode.ADD); // Build up a wiped area by repeatedly adding the motion bitmap + wipedBitmap.merge(blackBitmap, rect, point, 2, 2, 2, 0); // Gradually fade away the wiped areas + steamBitmap.fillRect(rect, 0xFF808080); // Create some steam + steamBitmap.draw(wipedBitmap, null, null, BlendMode.SUBTRACT); // Remove the wiped areas from the steam + sourceBitmap.merge(steamBitmap, rect, point, 0x80, 0x80, 0x80, 0); // Merge the steam with the source image + targetBitmap.copyPixels(sourceBitmap, rect, point); // Draw into the target bitmap + } + + /** + * Removes the steam effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + steamBitmap.dispose(); + steamBitmap = null; + blackBitmap.dispose(); + blackBitmap = null; + wipedBitmap.dispose(); + wipedBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/SwarmEffect.as b/webcam/webcam/effects/motion/SwarmEffect.as index f22a6bd..e86213c 100755..100644 --- a/webcam/webcam/effects/motion/SwarmEffect.as +++ b/webcam/webcam/effects/motion/SwarmEffect.as @@ -1,106 +1,106 @@ -/**
- * Neave Webcam // Swarm Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.geom.*;
-
- public class SwarmEffect extends AbstractMotionEffect
- {
- private const MOTION_SCALE:int = 4;
-
- private var flies:int;
- private var swarm:Sprite;
-
- /**
- * Creates a swarming flies effect where the flies are attracted to detected motion
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param flies The number of flies to use in the swarm
- */
- public function SwarmEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flies:int = 150)
- {
- super(source, targetBitmap, "Swarm", MOTION_SCALE);
- this.flies = flies < 1 ? 1 : flies;
-
- createSwarm();
- }
-
- /**
- * Sets up the swarm effect
- */
- private function createSwarm():void
- {
- // Draw the flies into the swarm sprite in random positions
- swarm = new Sprite();
- for (var i:int = flies; i--; ) swarm.addChild(new SwarmFly(Math.random() * rect.width, Math.random() * rect.height, (i / flies) * 0.75 + 0.75));
- }
-
- /**
- * Draws the swarm effect
- */
- override public function draw():void
- {
- super.draw();
-
- // Loop through each pixel in the motion bitmap data
- var flyX:int = -1;
- var flyY:int = -1;
- for (var y:int = motionBitmap.height; y--; )
- {
- for (var x:int = motionBitmap.width; x--; )
- {
- // If this pixel has motion set this as a point for the flies to move to
- if (motionBitmap.getPixel(x, y) == 0xFFFFFF)
- {
- flyX = x * MOTION_SCALE;
- flyY = y * MOTION_SCALE;
- break;
- }
- }
- }
-
- // Loop through each fly in the swarm
- for (var i:int = flies; i--; )
- {
- // Fly the fly towards the motion point
- var fly:SwarmFly = swarm.getChildAt(i) as SwarmFly;
- fly.flyTo(flyX, flyY);
-
- // Limit the fly to within bounds of the source image
- if (fly.x < 0) fly.x = 0;
- if (fly.y < 0) fly.y = 0;
- if (fly.x > rect.width) fly.x = rect.width;
- if (fly.y > rect.height) fly.y = rect.height;
- }
-
- // Draw the swarm over the source image
- targetBitmap.lock();
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.draw(swarm);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the swarm effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the flies from the swarm sprite
- for (var i:int = flies; i--; ) swarm.removeChildAt(i);
- swarm = null;
- }
- }
+/** + * Neave Webcam // Swarm Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.geom.*; + + public class SwarmEffect extends AbstractMotionEffect + { + private const MOTION_SCALE:int = 4; + + private var flies:int; + private var swarm:Sprite; + + /** + * Creates a swarming flies effect where the flies are attracted to detected motion + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param flies The number of flies to use in the swarm + */ + public function SwarmEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flies:int = 150) + { + super(source, targetBitmap, "Swarm", MOTION_SCALE); + this.flies = flies < 1 ? 1 : flies; + + createSwarm(); + } + + /** + * Sets up the swarm effect + */ + private function createSwarm():void + { + // Draw the flies into the swarm sprite in random positions + swarm = new Sprite(); + for (var i:int = flies; i--; ) swarm.addChild(new SwarmFly(Math.random() * rect.width, Math.random() * rect.height, (i / flies) * 0.75 + 0.75)); + } + + /** + * Draws the swarm effect + */ + override public function draw():void + { + super.draw(); + + // Loop through each pixel in the motion bitmap data + var flyX:int = -1; + var flyY:int = -1; + for (var y:int = motionBitmap.height; y--; ) + { + for (var x:int = motionBitmap.width; x--; ) + { + // If this pixel has motion set this as a point for the flies to move to + if (motionBitmap.getPixel(x, y) == 0xFFFFFF) + { + flyX = x * MOTION_SCALE; + flyY = y * MOTION_SCALE; + break; + } + } + } + + // Loop through each fly in the swarm + for (var i:int = flies; i--; ) + { + // Fly the fly towards the motion point + var fly:SwarmFly = swarm.getChildAt(i) as SwarmFly; + fly.flyTo(flyX, flyY); + + // Limit the fly to within bounds of the source image + if (fly.x < 0) fly.x = 0; + if (fly.y < 0) fly.y = 0; + if (fly.x > rect.width) fly.x = rect.width; + if (fly.y > rect.height) fly.y = rect.height; + } + + // Draw the swarm over the source image + targetBitmap.lock(); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.draw(swarm); + targetBitmap.unlock(); + } + + /** + * Removes the swarm effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the flies from the swarm sprite + for (var i:int = flies; i--; ) swarm.removeChildAt(i); + swarm = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/motion/SwarmFly.as b/webcam/webcam/effects/motion/SwarmFly.as index a7cfe62..84d751c 100755..100644 --- a/webcam/webcam/effects/motion/SwarmFly.as +++ b/webcam/webcam/effects/motion/SwarmFly.as @@ -1,122 +1,122 @@ -/**
- * Neave Webcam // Swarm Fly
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.motion
-{
- import flash.display.*;
- import flash.filters.*;
-
- final internal class SwarmFly extends Shape
- {
- private const MAX_BOREDOM:int = 10;
- private const BOREDOM_TIME:int = 20;
- private const MAX_DIST:int = 8000;
- private const BORED_DIST:int = 30;
-
- private var x0:Number;
- private var y0:Number;
- private var size:Number;
- private var speed:Number;
- private var boredom:int;
- private var wobbleAngle:Number;
- private var wobbleDist:Number;
- private var wobbleStep:Number;
-
- /**
- * Creates a fly graphic to be used with the swarm effect
- *
- * @param x The starting position of the fly on the x-axis
- * @param y The starting position of the fly on the y-axis
- */
- public function SwarmFly(x:Number = 0, y:Number = 0, size:Number = 1)
- {
- this.x = x0 = x;
- this.y = y0 = y;
- this.size = size;
-
- createFly();
- }
-
- /**
- * Sets up the fly and its initial properties
- */
- private function createFly():void
- {
- // This fly's movement speed and initial boredom threshold
- speed = Math.random() * 20 + 10;
- boredom = Math.floor(Math.random() * (MAX_BOREDOM + BOREDOM_TIME));
-
- // This fly's wobbling amount as it flies
- wobbleAngle = Math.random() * Math.PI;
- wobbleDist = Math.random() * 2.5 + 0.5;
- wobbleStep = evenRandom() * 2;
-
- // Draw the fly shape, a black circle with a black glow
- graphics.beginFill(0x000000);
- graphics.drawCircle(0, 0, size);
- filters = [ new GlowFilter(0x000000, 1, 6, 6, 2, 2, false, false) ];
- cacheAsBitmap = true;
- }
-
- /**
- * Generates a random number between -0.5 and 0.5
- */
- private function evenRandom():Number
- {
- return Math.random() - 0.5;
- }
-
- /**
- * Moves the fly towards the specified position
- *
- * @param x The position to move to on the x-axis
- * @param y The position to move to on the y-axis
- */
- internal function flyTo(x:int, y:int):void
- {
- var dx:int = this.x - x;
- var dy:int = this.y - y;
- if (boredom > MAX_BOREDOM || dx * dx + dy * dy > MAX_DIST)
- {
- // Fly around if the fly is too bored or too far away
- this.x += (x0 - this.x) / speed;
- this.y += (y0 - this.y) / speed;
-
- // Flying around reduces boredom
- if (boredom > 0) boredom--;
-
- // Not bored any more, reset boredom threshold
- if (boredom == MAX_BOREDOM) boredom = 0;
- }
- else if (x >=0 || y >= 0)
- {
- // Fly isn't bored yet so moves towards the motion
- this.x += (x - this.x) / speed / 2;
- this.y += (y - this.y) / speed / 2;
-
- // Boredom increases until the fly is totally bored and flies off
- if (boredom < MAX_BOREDOM) boredom++;
- else
- {
- // Bored now, so fly away somewhere for a time
- x0 = x + evenRandom() * BORED_DIST;
- y0 = y + evenRandom() * BORED_DIST;
- boredom = MAX_BOREDOM + Math.ceil(evenRandom() * BOREDOM_TIME);
- }
- }
-
- // Wobble the fly's movement
- wobbleAngle += wobbleStep;
- this.x += Math.sin(wobbleAngle) * wobbleDist;
- this.y += Math.cos(wobbleAngle / 3) * wobbleDist;
- }
- }
+/** + * Neave Webcam // Swarm Fly + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.motion +{ + import flash.display.*; + import flash.filters.*; + + final internal class SwarmFly extends Shape + { + private const MAX_BOREDOM:int = 10; + private const BOREDOM_TIME:int = 20; + private const MAX_DIST:int = 8000; + private const BORED_DIST:int = 30; + + private var x0:Number; + private var y0:Number; + private var size:Number; + private var speed:Number; + private var boredom:int; + private var wobbleAngle:Number; + private var wobbleDist:Number; + private var wobbleStep:Number; + + /** + * Creates a fly graphic to be used with the swarm effect + * + * @param x The starting position of the fly on the x-axis + * @param y The starting position of the fly on the y-axis + */ + public function SwarmFly(x:Number = 0, y:Number = 0, size:Number = 1) + { + this.x = x0 = x; + this.y = y0 = y; + this.size = size; + + createFly(); + } + + /** + * Sets up the fly and its initial properties + */ + private function createFly():void + { + // This fly's movement speed and initial boredom threshold + speed = Math.random() * 20 + 10; + boredom = Math.floor(Math.random() * (MAX_BOREDOM + BOREDOM_TIME)); + + // This fly's wobbling amount as it flies + wobbleAngle = Math.random() * Math.PI; + wobbleDist = Math.random() * 2.5 + 0.5; + wobbleStep = evenRandom() * 2; + + // Draw the fly shape, a black circle with a black glow + graphics.beginFill(0x000000); + graphics.drawCircle(0, 0, size); + filters = [ new GlowFilter(0x000000, 1, 6, 6, 2, 2, false, false) ]; + cacheAsBitmap = true; + } + + /** + * Generates a random number between -0.5 and 0.5 + */ + private function evenRandom():Number + { + return Math.random() - 0.5; + } + + /** + * Moves the fly towards the specified position + * + * @param x The position to move to on the x-axis + * @param y The position to move to on the y-axis + */ + internal function flyTo(x:int, y:int):void + { + var dx:int = this.x - x; + var dy:int = this.y - y; + if (boredom > MAX_BOREDOM || dx * dx + dy * dy > MAX_DIST) + { + // Fly around if the fly is too bored or too far away + this.x += (x0 - this.x) / speed; + this.y += (y0 - this.y) / speed; + + // Flying around reduces boredom + if (boredom > 0) boredom--; + + // Not bored any more, reset boredom threshold + if (boredom == MAX_BOREDOM) boredom = 0; + } + else if (x >=0 || y >= 0) + { + // Fly isn't bored yet so moves towards the motion + this.x += (x - this.x) / speed / 2; + this.y += (y - this.y) / speed / 2; + + // Boredom increases until the fly is totally bored and flies off + if (boredom < MAX_BOREDOM) boredom++; + else + { + // Bored now, so fly away somewhere for a time + x0 = x + evenRandom() * BORED_DIST; + y0 = y + evenRandom() * BORED_DIST; + boredom = MAX_BOREDOM + Math.ceil(evenRandom() * BOREDOM_TIME); + } + } + + // Wobble the fly's movement + wobbleAngle += wobbleStep; + this.x += Math.sin(wobbleAngle) * wobbleDist; + this.y += Math.cos(wobbleAngle / 3) * wobbleDist; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/ASCIIEffect.as b/webcam/webcam/effects/pixel/ASCIIEffect.as index cd8e8d8..6ca3a67 100755..100644 --- a/webcam/webcam/effects/pixel/ASCIIEffect.as +++ b/webcam/webcam/effects/pixel/ASCIIEffect.as @@ -1,225 +1,225 @@ -/**
- * Neave Webcam // ASCII Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.system.*;
- import flash.text.*;
- import com.neave.webcam.effects.*;
-
- public class ASCIIEffect extends AbstractEffect
- {
- private const FONT_NAME:String = "_typewriter";
- private const FONT_SIZE:int = 10;
- private const FONT_COLOR:int = 0x33FF33;
- private const FONT_SPACING:int = 2;
- private const FONT_WIN_LEADING:int = -8;
- private const FONT_MAC_LEADING:int = -6;
- private const CHARS_WIDE:int = 39;
- private const MIN_ASCII_CHAR:uint = 32;
- private const MAX_ASCII_CHAR:uint = 126;
-
- private var flipChars:Boolean;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var textBitmap:BitmapData;
- private var textfield:TextField;
- private var textMatrix:Matrix;
- private var flipMatrix:Matrix;
- private var charsX:int;
- private var charsY:int;
- private var total:int;
- private var textFormat:TextFormat;
- private var chars:Array;
- private var blur:BlurFilter;
-
- /**
- * Creates a text-based effect where each pixel is drawn as a letter from the ASCII character table
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param flipChars Flips the ASCII characters horizontally, useful if using a mirrored webcam as the source object
- */
- public function ASCIIEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flipChars:Boolean = true)
- {
- super(source, targetBitmap, "ASCII");
- this.flipChars = flipChars;
-
- createASCII();
- }
-
- /**
- * Sets up the ASCII effect
- */
- private function createASCII():void
- {
- // Increase contrast
- color = new ColorTransform(2, 2, 2, 1, -100, -100, -100);
-
- // Create the main textfield
- var fmt:TextFormat = new TextFormat(FONT_NAME, FONT_SIZE, FONT_COLOR);
- fmt.letterSpacing = FONT_SPACING;
- fmt.leading = Capabilities.version.substr(0, 3) == "MAC" ? FONT_MAC_LEADING : FONT_WIN_LEADING;
- textfield = new TextField();
- textfield.defaultTextFormat = fmt;
- textfield.autoSize = TextFieldAutoSize.LEFT;
-
- // Get the ASCII characters in order of brightness
- chars = getOrderedChars();
- total = chars.length - 1;
-
- // Create a bitmap to hold the textfield
- textBitmap = targetBitmap.clone();
- textMatrix = new Matrix();
- textMatrix.translate(3, 0);
-
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(CHARS_WIDE, Math.round(CHARS_WIDE * rect.height / rect.width), false, 0xFF000000);
- charsX = smallBitmap.width;
- charsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(charsX / rect.width, charsY / rect.height);
-
- // If flip flag is true, reverse the bitmaps horizontally
- flipMatrix = new Matrix();
- flipMatrix.scale(rect.width / 320, rect.height / 240);
- if (flipChars)
- {
- flipMatrix.scale(-1, 1);
- flipMatrix.translate(rect.width, 0);
- smallMatrix.scale(-1, 1);
- smallMatrix.translate(charsX, 0);
- }
-
- // Use a blur filter to add a slight glow behind the characters
- blur = new BlurFilter(4, 4, 1);
- }
-
- /**
- * Generates an array of ASCII characters in order of pixel brightness
- *
- * @return An array of characters ordered by pixel brightness
- */
- private function getOrderedChars():Array
- {
- // Create an array containing character and its brightness
- var order:Array = new Array();
- for (var i:int = MIN_ASCII_CHAR; i < MAX_ASCII_CHAR; i++)
- {
- var c:String = String.fromCharCode(i);
- order.push( { char:c, level:getCharBrightness(c) } );
- }
-
- // Sort the characters in order of descending brightness
- order.sortOn("level", Array.NUMERIC | Array.DESCENDING);
-
- // Return a new array containing only the characters in order
- var list:Array = new Array();
- for (i = order.length; i--; ) list.push(order[i].char);
- return list;
- }
-
- /**
- * Calculates the pixel brightness a character
- *
- * @param char The single ASCII character to test for brightness level
- * @return A number between 0 and 1 indicating the amount of brightness
- */
- private function getCharBrightness(char:String):Number
- {
- // Create a temporary textfield to hold this character
- var tf:TextField = new TextField();
- tf.defaultTextFormat = new TextFormat(FONT_NAME, FONT_SIZE, 0x000000);
- tf.text = char.charAt();
- tf.autoSize = TextFieldAutoSize.LEFT;
-
- // Determine the width and height of this character
- var charWidth:int = Math.ceil(tf.width);
- var charHeight:int = Math.ceil(tf.height);
-
- // Create a temporary bitmap data to draw this character into
- var charBitmap:BitmapData = new BitmapData(charWidth, charHeight, false, 0xFFFFFFFF);
- charBitmap.draw(tf);
-
- // Loop through each pixel in this character's bitmap data
- var level:int = 0;
- for (var y:int = charHeight; y--; )
- {
- for (var x:int = charWidth; x--; )
- {
- // If this pixel is bright enough, add it to the overall brightness level
- if (charBitmap.getPixel(x, y) > 0x808080) level++;
- }
- }
-
- // Return the brightness level as a percentage of the whole character area
- return level / (charWidth * charHeight);
- }
-
- /**
- * Converts a colour value to an averaged monochrome (greyscale) value
- *
- * @param col The colour to convert to monochrome
- * @return The averaged monochrome value
- */
- private function getMonochrome(col:uint):uint
- {
- // Add the red, green and blue components together and return the average
- return 0xFF - (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3;
- }
-
- /**
- * Draws the ASCII effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the ASCII textfield from each pixel
- var str:String = "";
- for (var y:int = 0; y < charsY; y++)
- {
- for (var x:int = 0; x < charsX; x++)
- {
- // Get the monochrome pixel value and convert it to an ASCII character
- str += chars[int(getMonochrome(smallBitmap.getPixel(x, y)) / 0xFF * total)];
- }
- str += "\r\n"; // New line
- }
-
- // Draw the new ASCII textfield into the text bitmap data with a blurred background glow
- textfield.text = str;
- textBitmap.fillRect(rect, 0xFF000000);
- textBitmap.draw(textfield, textMatrix);
- sourceBitmap.applyFilter(textBitmap, rect, point, blur);
- sourceBitmap.draw(textBitmap, null, null, BlendMode.ADD);
- targetBitmap.draw(sourceBitmap, flipMatrix);
- }
-
- /**
- * Removes the ASCII effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- textBitmap.dispose();
- textBitmap = null;
- textfield = null;
- chars = null;
- }
- }
+/** + * Neave Webcam // ASCII Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.filters.*; + import flash.geom.*; + import flash.system.*; + import flash.text.*; + import com.neave.webcam.effects.*; + + public class ASCIIEffect extends AbstractEffect + { + private const FONT_NAME:String = "_typewriter"; + private const FONT_SIZE:int = 10; + private const FONT_COLOR:int = 0x33FF33; + private const FONT_SPACING:int = 2; + private const FONT_WIN_LEADING:int = -8; + private const FONT_MAC_LEADING:int = -6; + private const CHARS_WIDE:int = 39; + private const MIN_ASCII_CHAR:uint = 32; + private const MAX_ASCII_CHAR:uint = 126; + + private var flipChars:Boolean; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var textBitmap:BitmapData; + private var textfield:TextField; + private var textMatrix:Matrix; + private var flipMatrix:Matrix; + private var charsX:int; + private var charsY:int; + private var total:int; + private var textFormat:TextFormat; + private var chars:Array; + private var blur:BlurFilter; + + /** + * Creates a text-based effect where each pixel is drawn as a letter from the ASCII character table + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param flipChars Flips the ASCII characters horizontally, useful if using a mirrored webcam as the source object + */ + public function ASCIIEffect(source:IBitmapDrawable, targetBitmap:BitmapData, flipChars:Boolean = true) + { + super(source, targetBitmap, "ASCII"); + this.flipChars = flipChars; + + createASCII(); + } + + /** + * Sets up the ASCII effect + */ + private function createASCII():void + { + // Increase contrast + color = new ColorTransform(2, 2, 2, 1, -100, -100, -100); + + // Create the main textfield + var fmt:TextFormat = new TextFormat(FONT_NAME, FONT_SIZE, FONT_COLOR); + fmt.letterSpacing = FONT_SPACING; + fmt.leading = Capabilities.version.substr(0, 3) == "MAC" ? FONT_MAC_LEADING : FONT_WIN_LEADING; + textfield = new TextField(); + textfield.defaultTextFormat = fmt; + textfield.autoSize = TextFieldAutoSize.LEFT; + + // Get the ASCII characters in order of brightness + chars = getOrderedChars(); + total = chars.length - 1; + + // Create a bitmap to hold the textfield + textBitmap = targetBitmap.clone(); + textMatrix = new Matrix(); + textMatrix.translate(3, 0); + + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(CHARS_WIDE, Math.round(CHARS_WIDE * rect.height / rect.width), false, 0xFF000000); + charsX = smallBitmap.width; + charsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(charsX / rect.width, charsY / rect.height); + + // If flip flag is true, reverse the bitmaps horizontally + flipMatrix = new Matrix(); + flipMatrix.scale(rect.width / 320, rect.height / 240); + if (flipChars) + { + flipMatrix.scale(-1, 1); + flipMatrix.translate(rect.width, 0); + smallMatrix.scale(-1, 1); + smallMatrix.translate(charsX, 0); + } + + // Use a blur filter to add a slight glow behind the characters + blur = new BlurFilter(4, 4, 1); + } + + /** + * Generates an array of ASCII characters in order of pixel brightness + * + * @return An array of characters ordered by pixel brightness + */ + private function getOrderedChars():Array + { + // Create an array containing character and its brightness + var order:Array = new Array(); + for (var i:int = MIN_ASCII_CHAR; i < MAX_ASCII_CHAR; i++) + { + var c:String = String.fromCharCode(i); + order.push( { char:c, level:getCharBrightness(c) } ); + } + + // Sort the characters in order of descending brightness + order.sortOn("level", Array.NUMERIC | Array.DESCENDING); + + // Return a new array containing only the characters in order + var list:Array = new Array(); + for (i = order.length; i--; ) list.push(order[i].char); + return list; + } + + /** + * Calculates the pixel brightness a character + * + * @param char The single ASCII character to test for brightness level + * @return A number between 0 and 1 indicating the amount of brightness + */ + private function getCharBrightness(char:String):Number + { + // Create a temporary textfield to hold this character + var tf:TextField = new TextField(); + tf.defaultTextFormat = new TextFormat(FONT_NAME, FONT_SIZE, 0x000000); + tf.text = char.charAt(); + tf.autoSize = TextFieldAutoSize.LEFT; + + // Determine the width and height of this character + var charWidth:int = Math.ceil(tf.width); + var charHeight:int = Math.ceil(tf.height); + + // Create a temporary bitmap data to draw this character into + var charBitmap:BitmapData = new BitmapData(charWidth, charHeight, false, 0xFFFFFFFF); + charBitmap.draw(tf); + + // Loop through each pixel in this character's bitmap data + var level:int = 0; + for (var y:int = charHeight; y--; ) + { + for (var x:int = charWidth; x--; ) + { + // If this pixel is bright enough, add it to the overall brightness level + if (charBitmap.getPixel(x, y) > 0x808080) level++; + } + } + + // Return the brightness level as a percentage of the whole character area + return level / (charWidth * charHeight); + } + + /** + * Converts a colour value to an averaged monochrome (greyscale) value + * + * @param col The colour to convert to monochrome + * @return The averaged monochrome value + */ + private function getMonochrome(col:uint):uint + { + // Add the red, green and blue components together and return the average + return 0xFF - (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3; + } + + /** + * Draws the ASCII effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the ASCII textfield from each pixel + var str:String = ""; + for (var y:int = 0; y < charsY; y++) + { + for (var x:int = 0; x < charsX; x++) + { + // Get the monochrome pixel value and convert it to an ASCII character + str += chars[int(getMonochrome(smallBitmap.getPixel(x, y)) / 0xFF * total)]; + } + str += "\r\n"; // New line + } + + // Draw the new ASCII textfield into the text bitmap data with a blurred background glow + textfield.text = str; + textBitmap.fillRect(rect, 0xFF000000); + textBitmap.draw(textfield, textMatrix); + sourceBitmap.applyFilter(textBitmap, rect, point, blur); + sourceBitmap.draw(textBitmap, null, null, BlendMode.ADD); + targetBitmap.draw(sourceBitmap, flipMatrix); + } + + /** + * Removes the ASCII effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + textBitmap.dispose(); + textBitmap = null; + textfield = null; + chars = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/HalftoneDot.as b/webcam/webcam/effects/pixel/HalftoneDot.as index 4f4fb40..3e97578 100755..100644 --- a/webcam/webcam/effects/pixel/HalftoneDot.as +++ b/webcam/webcam/effects/pixel/HalftoneDot.as @@ -1,33 +1,33 @@ -/**
- * Neave Webcam // Halftone Dot
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
-
- final internal class HalftoneDot extends Shape
- {
- /**
- * Draws a halftone dot shape to be used with the halftone effect
- *
- * @param x The position of the dot on the x-axis
- * @param y The position of the dot on the y-axis
- * @param radius The radius of the dot
- */
- public function HalftoneDot(x:Number = 0, y:Number = 0, radius:Number = 1)
- {
- this.x = x;
- this.y = y;
- graphics.beginFill(0x000000);
- graphics.drawCircle(0, 0, radius);
- }
- }
+/** + * Neave Webcam // Halftone Dot + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + + final internal class HalftoneDot extends Shape + { + /** + * Draws a halftone dot shape to be used with the halftone effect + * + * @param x The position of the dot on the x-axis + * @param y The position of the dot on the y-axis + * @param radius The radius of the dot + */ + public function HalftoneDot(x:Number = 0, y:Number = 0, radius:Number = 1) + { + this.x = x; + this.y = y; + graphics.beginFill(0x000000); + graphics.drawCircle(0, 0, radius); + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/HalftoneEffect.as b/webcam/webcam/effects/pixel/HalftoneEffect.as index 0b9cf3c..9ee7656 100755..100644 --- a/webcam/webcam/effects/pixel/HalftoneEffect.as +++ b/webcam/webcam/effects/pixel/HalftoneEffect.as @@ -1,135 +1,135 @@ -/**
- * Neave Webcam // Halftone Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class HalftoneEffect extends AbstractEffect
- {
- private var dotsWide:int;
- private var invert:Boolean;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var halftone:Sprite;
- private var dotsX:int;
- private var dotsY:int;
- private var size:Number;
-
- /**
- * Creates a halftone effect where each pixel is drawn as a variably-sized black dot, as used in the printing process
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param dotsWide The number of dots to use in width
- * @param invert Inverts the halftone effect so bright pixels create large dots
- */
- public function HalftoneEffect(source:IBitmapDrawable, targetBitmap:BitmapData, dotsWide:int = 40, invert:Boolean = false)
- {
- super(source, targetBitmap, "Halftone");
- this.dotsWide = dotsWide < 1 ? 1: dotsWide;
- this.invert = invert;
-
- createHalftone();
- }
-
- /**
- * Sets up the halftone effect
- */
- private function createHalftone():void
- {
- // Increase contrast
- color = new ColorTransform(1.5, 1.5, 1.5, 1, -50, -50, -50);
-
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(dotsWide, Math.round(dotsWide * rect.height / rect.width), false, 0xFF000000);
- dotsX = smallBitmap.width;
- dotsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(dotsX / rect.width, dotsY / rect.height);
- size = rect.width / dotsX;
-
- // Create a sprite containing all the halftone dots needed
- halftone = new Sprite();
- for (var y:int = dotsY; y--; )
- {
- for (var x:int = dotsX; x--; )
- {
- // Position each halftone dot, alternating the y-axis position between on pixel and halfway between pixels
- halftone.addChild(new HalftoneDot((x + 0.25 + (y % 2) * 0.5) * size, (y + 0.5) * size, size));
- }
- }
- }
-
- /**
- * Converts a colour value to an averaged monochrome (greyscale) value
- *
- * @param col The colour to convert to monochrome
- * @param inv Whether to invert the monochrome value
- * @return The averaged monochrome value
- */
- private function getMonochrome(col:uint, inv:Boolean):uint
- {
- // Add the red, green and blue components together and return the average
- var mono:uint = (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3;
- if (inv) return mono;
- else return 0xFF - mono;
- }
-
- /**
- * Draws the halftone effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the halftone dots from each pixel
- var n:int = 0;
- for (var y:int = dotsY; y--; )
- {
- for (var x:int = dotsX; x--; )
- {
- // Average this pixel's colour to a greyscale value
- var w:Number = getMonochrome(smallBitmap.getPixel(x, y), invert) / 0xFF * Math.SQRT2 * size;
-
- // Set this dot's size, alternating the y-axis position between on pixel and halfway between pixels
- var d:HalftoneDot = halftone.getChildAt(n) as HalftoneDot;
- d.width = d.height = (y % 2 == 0 || n == 0) ? w : (w + halftone.getChildAt(n - 1).width) / 2; // Average pixel values if this y-axis position is between pixels
- n++;
- }
- }
-
- // Draw the new halftone dots
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFFFFFFFF);
- targetBitmap.draw(halftone);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the halftone effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the halftone dots
- for (var i:int = dotsX * dotsY; i--; ) halftone.removeChildAt(i);
- halftone = null;
-
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Halftone Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class HalftoneEffect extends AbstractEffect + { + private var dotsWide:int; + private var invert:Boolean; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var halftone:Sprite; + private var dotsX:int; + private var dotsY:int; + private var size:Number; + + /** + * Creates a halftone effect where each pixel is drawn as a variably-sized black dot, as used in the printing process + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param dotsWide The number of dots to use in width + * @param invert Inverts the halftone effect so bright pixels create large dots + */ + public function HalftoneEffect(source:IBitmapDrawable, targetBitmap:BitmapData, dotsWide:int = 40, invert:Boolean = false) + { + super(source, targetBitmap, "Halftone"); + this.dotsWide = dotsWide < 1 ? 1: dotsWide; + this.invert = invert; + + createHalftone(); + } + + /** + * Sets up the halftone effect + */ + private function createHalftone():void + { + // Increase contrast + color = new ColorTransform(1.5, 1.5, 1.5, 1, -50, -50, -50); + + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(dotsWide, Math.round(dotsWide * rect.height / rect.width), false, 0xFF000000); + dotsX = smallBitmap.width; + dotsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(dotsX / rect.width, dotsY / rect.height); + size = rect.width / dotsX; + + // Create a sprite containing all the halftone dots needed + halftone = new Sprite(); + for (var y:int = dotsY; y--; ) + { + for (var x:int = dotsX; x--; ) + { + // Position each halftone dot, alternating the y-axis position between on pixel and halfway between pixels + halftone.addChild(new HalftoneDot((x + 0.25 + (y % 2) * 0.5) * size, (y + 0.5) * size, size)); + } + } + } + + /** + * Converts a colour value to an averaged monochrome (greyscale) value + * + * @param col The colour to convert to monochrome + * @param inv Whether to invert the monochrome value + * @return The averaged monochrome value + */ + private function getMonochrome(col:uint, inv:Boolean):uint + { + // Add the red, green and blue components together and return the average + var mono:uint = (((col >> 16) & 0xFF) + ((col >> 8) & 0xFF) + (col & 0xFF)) / 3; + if (inv) return mono; + else return 0xFF - mono; + } + + /** + * Draws the halftone effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the halftone dots from each pixel + var n:int = 0; + for (var y:int = dotsY; y--; ) + { + for (var x:int = dotsX; x--; ) + { + // Average this pixel's colour to a greyscale value + var w:Number = getMonochrome(smallBitmap.getPixel(x, y), invert) / 0xFF * Math.SQRT2 * size; + + // Set this dot's size, alternating the y-axis position between on pixel and halfway between pixels + var d:HalftoneDot = halftone.getChildAt(n) as HalftoneDot; + d.width = d.height = (y % 2 == 0 || n == 0) ? w : (w + halftone.getChildAt(n - 1).width) / 2; // Average pixel values if this y-axis position is between pixels + n++; + } + } + + // Draw the new halftone dots + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFFFFFFFF); + targetBitmap.draw(halftone); + targetBitmap.unlock(); + } + + /** + * Removes the halftone effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the halftone dots + for (var i:int = dotsX * dotsY; i--; ) halftone.removeChildAt(i); + halftone = null; + + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/PixelateEffect.as b/webcam/webcam/effects/pixel/PixelateEffect.as index 8ff94d5..28d0d94 100755..100644 --- a/webcam/webcam/effects/pixel/PixelateEffect.as +++ b/webcam/webcam/effects/pixel/PixelateEffect.as @@ -1,75 +1,75 @@ -/**
- * Neave Webcam // Pixelate Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class PixelateEffect extends AbstractEffect
- {
- private var pixelsWide:int;
- private var smallBitmap:BitmapData;
- private var targetMatrix:Matrix;
-
- /**
- * Creates a low-resolution effect where pixels appear large
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param pixelsWide The number of pixels to use in width
- */
- public function PixelateEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 20)
- {
- super(source, targetBitmap, "Pixelate");
- this.pixelsWide = pixelsWide < 1 ? 1 : pixelsWide;
-
- createPixelate();
- }
-
- /**
- * Sets up the pixelate effect
- */
- private function createPixelate():void
- {
- // Create a low resolution bitmap data
- smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000);
-
- // Set up scaling of bitmaps from large to small to large again
- var sx:Number = smallBitmap.width / rect.width;
- var sy:Number = smallBitmap.height / rect.height;
- sourceMatrix.scale(sx, sy);
- targetMatrix = new Matrix();
- targetMatrix.scale(1 / sx, 1 / sy);
- }
-
- /**
- * Draws the pixelate effect
- */
- override public function draw():void
- {
- // Resize small then resize large
- smallBitmap.draw(source, sourceMatrix);
- targetBitmap.draw(smallBitmap, targetMatrix);
- }
-
- /**
- * Removes the pixelate effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Pixelate Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class PixelateEffect extends AbstractEffect + { + private var pixelsWide:int; + private var smallBitmap:BitmapData; + private var targetMatrix:Matrix; + + /** + * Creates a low-resolution effect where pixels appear large + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param pixelsWide The number of pixels to use in width + */ + public function PixelateEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 20) + { + super(source, targetBitmap, "Pixelate"); + this.pixelsWide = pixelsWide < 1 ? 1 : pixelsWide; + + createPixelate(); + } + + /** + * Sets up the pixelate effect + */ + private function createPixelate():void + { + // Create a low resolution bitmap data + smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000); + + // Set up scaling of bitmaps from large to small to large again + var sx:Number = smallBitmap.width / rect.width; + var sy:Number = smallBitmap.height / rect.height; + sourceMatrix.scale(sx, sy); + targetMatrix = new Matrix(); + targetMatrix.scale(1 / sx, 1 / sy); + } + + /** + * Draws the pixelate effect + */ + override public function draw():void + { + // Resize small then resize large + smallBitmap.draw(source, sourceMatrix); + targetBitmap.draw(smallBitmap, targetMatrix); + } + + /** + * Removes the pixelate effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/RGBEffect.as b/webcam/webcam/effects/pixel/RGBEffect.as index 4d2b2ff..f05a090 100755..100644 --- a/webcam/webcam/effects/pixel/RGBEffect.as +++ b/webcam/webcam/effects/pixel/RGBEffect.as @@ -1,126 +1,126 @@ -/**
- * Neave Webcam // Red Green Blue Effect
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- public class RGBEffect extends AbstractEffect
- {
- private const COLORS:Array = [0xFF0000, 0x00FF00, 0x0000FF];
-
- private var pixelsWide:int;
- private var smallBitmap:BitmapData;
- private var smallMatrix:Matrix;
- private var pixels:Sprite;
- private var pixelsX:int;
- private var pixelsY:int;
- private var size:Number;
-
- /**
- * Creates a low-resolution effect where each pixel is split into its red, green and blue components
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param pixelsWide The number of pixels to use in width
- */
- public function RGBEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 40)
- {
- super(source, targetBitmap, "RGB");
- this.pixelsWide = pixelsWide < 3 ? 3 : pixelsWide;
-
- createRGB();
- }
-
- /**
- * Sets up the RGB effect
- */
- private function createRGB():void
- {
- // Create a smaller, lower resolution bitmap to sample pixels from
- smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000);
- pixelsX = smallBitmap.width;
- pixelsY = smallBitmap.height;
- smallMatrix = new Matrix();
- smallMatrix.scale(pixelsX / rect.width, pixelsY / rect.height);
- size = rect.width / pixelsX;
-
- // Create a sprite containing all the RGB pixels needed
- pixels = new Sprite();
- for (var y:int = pixelsY; y--; )
- {
- for (var x:int = pixelsX; x--; )
- {
- // Position each RGB pixel and set its colour to either red, green or blue
- pixels.addChild(new RGBPixel((x + 0.5) * size, (y + 0.5) * size, COLORS[x % 3], size));
- }
- }
- }
-
- /**
- * Draws the RGB effect
- */
- override public function draw():void
- {
- // Generate a lower resolution bitmap data to sample pixels from
- smallBitmap.draw(source, smallMatrix, color);
-
- // Create the RGB pixels from each pixel
- var n:int = 0;
- for (var y:int = pixelsY; y--; )
- {
- for (var x:int = pixelsX; x--; )
- {
- // Set the brightness of this RGB pixel
- var c:uint = smallBitmap.getPixel(x, y);
- var p:RGBPixel = pixels.getChildAt(n++) as RGBPixel;
- switch (x % 3)
- {
- case 0: // Red
- p.alpha = ((c >> 16) & 0xFF) / 0xFF;
- break;
-
- case 1: // Green
- p.alpha = ((c >> 8) & 0xFF) / 0xFF;
- break;
-
- case 2: // Blue
- p.alpha = (c & 0xFF) / 0xFF;
- break;
- }
- }
- }
-
- // Draw the new RGB pixels
- targetBitmap.lock();
- targetBitmap.fillRect(rect, 0xFF000000);
- targetBitmap.draw(pixels);
- targetBitmap.unlock();
- }
-
- /**
- * Removes the RGB effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
-
- // Remove all the pixels
- for (var i:int = pixelsX * pixelsY; i--; ) pixels.removeChildAt(i);
- pixels = null;
-
- smallBitmap.dispose();
- smallBitmap = null;
- }
- }
+/** + * Neave Webcam // Red Green Blue Effect + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + public class RGBEffect extends AbstractEffect + { + private const COLORS:Array = [0xFF0000, 0x00FF00, 0x0000FF]; + + private var pixelsWide:int; + private var smallBitmap:BitmapData; + private var smallMatrix:Matrix; + private var pixels:Sprite; + private var pixelsX:int; + private var pixelsY:int; + private var size:Number; + + /** + * Creates a low-resolution effect where each pixel is split into its red, green and blue components + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param pixelsWide The number of pixels to use in width + */ + public function RGBEffect(source:IBitmapDrawable, targetBitmap:BitmapData, pixelsWide:int = 40) + { + super(source, targetBitmap, "RGB"); + this.pixelsWide = pixelsWide < 3 ? 3 : pixelsWide; + + createRGB(); + } + + /** + * Sets up the RGB effect + */ + private function createRGB():void + { + // Create a smaller, lower resolution bitmap to sample pixels from + smallBitmap = new BitmapData(pixelsWide, Math.round(pixelsWide * rect.height / rect.width), false, 0xFF000000); + pixelsX = smallBitmap.width; + pixelsY = smallBitmap.height; + smallMatrix = new Matrix(); + smallMatrix.scale(pixelsX / rect.width, pixelsY / rect.height); + size = rect.width / pixelsX; + + // Create a sprite containing all the RGB pixels needed + pixels = new Sprite(); + for (var y:int = pixelsY; y--; ) + { + for (var x:int = pixelsX; x--; ) + { + // Position each RGB pixel and set its colour to either red, green or blue + pixels.addChild(new RGBPixel((x + 0.5) * size, (y + 0.5) * size, COLORS[x % 3], size)); + } + } + } + + /** + * Draws the RGB effect + */ + override public function draw():void + { + // Generate a lower resolution bitmap data to sample pixels from + smallBitmap.draw(source, smallMatrix, color); + + // Create the RGB pixels from each pixel + var n:int = 0; + for (var y:int = pixelsY; y--; ) + { + for (var x:int = pixelsX; x--; ) + { + // Set the brightness of this RGB pixel + var c:uint = smallBitmap.getPixel(x, y); + var p:RGBPixel = pixels.getChildAt(n++) as RGBPixel; + switch (x % 3) + { + case 0: // Red + p.alpha = ((c >> 16) & 0xFF) / 0xFF; + break; + + case 1: // Green + p.alpha = ((c >> 8) & 0xFF) / 0xFF; + break; + + case 2: // Blue + p.alpha = (c & 0xFF) / 0xFF; + break; + } + } + } + + // Draw the new RGB pixels + targetBitmap.lock(); + targetBitmap.fillRect(rect, 0xFF000000); + targetBitmap.draw(pixels); + targetBitmap.unlock(); + } + + /** + * Removes the RGB effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + + // Remove all the pixels + for (var i:int = pixelsX * pixelsY; i--; ) pixels.removeChildAt(i); + pixels = null; + + smallBitmap.dispose(); + smallBitmap = null; + } + } }
\ No newline at end of file diff --git a/webcam/webcam/effects/pixel/RGBPixel.as b/webcam/webcam/effects/pixel/RGBPixel.as index ababb10..1d92389 100755..100644 --- a/webcam/webcam/effects/pixel/RGBPixel.as +++ b/webcam/webcam/effects/pixel/RGBPixel.as @@ -1,34 +1,34 @@ -/**
- * Neave Webcam // Red Green Blue Pixel
- *
- * Copyright (C) 2008 Paul Neave
- * http://www.neave.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
- */
-
-package com.neave.webcam.effects.pixel
-{
- import flash.display.*;
-
- final internal class RGBPixel extends Shape
- {
- /**
- * Draws a simple square graphic to be used with the RGB effect
- *
- * @param x The position of the pixel on the x-axis
- * @param y The position of the pixel on the y-axis
- * @param color The colour of the pixel
- * @param size The size (width and height) of the pixel
- */
- public function RGBPixel(x:int = 0, y:int = 0, color:uint = 0, size:Number = 1)
- {
- this.x = x - size / 2;
- this.y = y - size / 2;
- graphics.beginFill(color);
- graphics.drawRect(0, 0, size, size);
- }
- }
+/** + * Neave Webcam // Red Green Blue Pixel + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.webcam.effects.pixel +{ + import flash.display.*; + + final internal class RGBPixel extends Shape + { + /** + * Draws a simple square graphic to be used with the RGB effect + * + * @param x The position of the pixel on the x-axis + * @param y The position of the pixel on the y-axis + * @param color The colour of the pixel + * @param size The size (width and height) of the pixel + */ + public function RGBPixel(x:int = 0, y:int = 0, color:uint = 0, size:Number = 1) + { + this.x = x - size / 2; + this.y = y - size / 2; + graphics.beginFill(color); + graphics.drawRect(0, 0, size, size); + } + } }
\ No newline at end of file |
