diff options
| author | sostler <sbostler@gmail.com> | 2010-02-27 18:28:23 -0500 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-02-27 18:28:23 -0500 |
| commit | 99fa8c4569988c27203dc821809f408491fc76e0 (patch) | |
| tree | 0377c3335cf9aff9bdfa95c8d46986fcc39241a5 | |
| parent | 28df6c268853e12e04975f217222a61e118050bf (diff) | |
| parent | fa8c89b543bb6e23cc7cac5983cb61818a4e3139 (diff) | |
Merge branch 'master' of ssh://sostler@192.168.0.194/~/dumpfm
| -rwxr-xr-x | src/site.clj | 82 | ||||
| -rwxr-xr-x | src/utils.clj | 24 | ||||
| -rw-r--r-- | static/browsertool.gif | bin | 6231 -> 14805 bytes | |||
| -rwxr-xr-x | static/header.css | 22 | ||||
| -rwxr-xr-x | static/index.html | 2 | ||||
| -rwxr-xr-x | static/js/pichat.js | 103 | ||||
| -rw-r--r-- | static/log.css | 354 | ||||
| -rwxr-xr-x | static/pichat.css | 1 | ||||
| -rwxr-xr-x | static/profile.css | 61 | ||||
| -rw-r--r-- | static/register.html | 37 | ||||
| -rw-r--r-- | static/right.gif | bin | 0 -> 74 bytes | |||
| -rw-r--r-- | static/webcam/webcam.js | 2 | ||||
| -rw-r--r-- | template/about_us.st | 7 | ||||
| -rwxr-xr-x | template/banner.st | 6 | ||||
| -rwxr-xr-x | template/chat.st | 2 | ||||
| -rw-r--r-- | template/goodies.st | 8 | ||||
| -rwxr-xr-x | template/head.st | 4 | ||||
| -rw-r--r-- | template/help.st | 7 | ||||
| -rwxr-xr-x | template/log.st | 7 | ||||
| -rwxr-xr-x | template/logged_dump.st | 4 | ||||
| -rw-r--r-- | template/privacy.st | 7 | ||||
| -rwxr-xr-x | template/profile.st | 179 | ||||
| -rw-r--r-- | template/terms.st | 7 |
23 files changed, 733 insertions, 193 deletions
diff --git a/src/site.clj b/src/site.clj index 2ea60a6..f039703 100755 --- a/src/site.clj +++ b/src/site.clj @@ -148,19 +148,14 @@ (map process-user (sort-by #(% :nick) (vals @(room :users))))) -(defn updates [room since] +(defn updates [room since] {"users" (prepare-user-list room) "messages" (map process-message-for-json - (new-messages room since))}) + (new-messages room since)) + "topic" @(room :topic)}) (def *dumps-per-page* 20) -(defn maybe-parse-int [s f] - (if s (Integer/parseInt s) f)) - -(defn maybe-parse-long [s f] - (if s (Long/parseLong s) f)) - (defn count-messages-by-room [room-id image-only] (let [query (str "SELECT COUNT(*) " "FROM messages m, users u " @@ -206,17 +201,23 @@ :name (room-db :name) :description (room-db :description) :users (ref {}) - :messages (ref (fetch-messages-by-room (room-db :room_id) false))}) + :messages (ref (fetch-messages-by-room (room-db :room_id) false)) + :topic (ref nil) + }) ;; Templates -(defn fetch-template [template-name session] - (let [st (.getInstanceOf template-group template-name)] - (if (and st (session :nick)) +;; TODO: avoid exception +(defn fetch-template [template session] + (let [st (.getInstanceOf template-group template)] + (if (session :nick) (do (.setAttribute st "user_nick" (session :nick)) (.setAttribute st "isadmin" (session :is_admin)))) st)) +(defn serve-template [template session] + (.toString (fetch-template template session))) + ;; Login code (defn session-map-from-db @@ -301,7 +302,7 @@ invalid-nick-reason (is-invalid-nick? nick)] (cond invalid-nick-reason (resp-error invalid-nick-reason) (fetch-nick nick) (resp-error "NICK_TAKEN") - :else (with-connection db + :else (with-connection *db* (insert-values :users [:nick :hash :email] [nick hash email]) @@ -320,15 +321,16 @@ dump-offset (* offset *dumps-per-page*) dumps (fetch-messages-by-nick profile-nick true dump-offset) dump-count (count-messages-by-nick profile-nick true) - st (fetch-template "profile" session)] + st (fetch-template "profile" session) + dumps (to-array (map process-message-for-output dumps))] (do (.setAttribute st "is_home" is-home) (doseq [a [:nick :avatar :contact :bio]] (let [v (user-info a)] (.setAttribute st (name a) (if (non-empty-string? v) (escape-html v))))) - (.setAttribute st "dumps" - (to-array (map process-message-for-output dumps))) + (if (> (count dumps) 0) + (.setAttribute st "dumps" dumps)) (if (< (+ dump-offset *dumps-per-page*) dump-count) (.setAttribute st "next" (inc offset))) (if (not= offset 0) @@ -338,13 +340,13 @@ (defn update-user-db [user-id attr val] - (with-connection db + (with-connection *db* (update-values "users" ["user_id = ?" user-id] {attr val}))) -(defn download-avatar [session url] - (let [url false] - (update-user-db (session :user_id) "avatar" url) - (resp-success url))) +(defn update-avatar [session url] + (update-user-db (session :user_id) "avatar" url) + [(session-assoc :avatar url) + (resp-success url)]) (defn update-profile [session params] (let [user-id (session :user_id) @@ -354,10 +356,36 @@ (cond (not user-id) (resp-error "MUST_LOGIN") (not (and user-id attr val)) (resp-error "BAD_REQUEST") (not (contains? attr-set attr)) (resp-error "BAD_REQUEST") - (= attr "avatar") (download-avatar session val) + (= attr "avatar") (update-avatar session val) :else (do (update-user-db user-id attr val) (resp-success "OK"))))) +;; Topics + +(defn valid-topic? [topic] + topic) + +(defn valid-deadline? [deadline] + deadline) + +(defn set-topic! [room topic deadline maker] + (ref-set (room :topic) + {:topic topic + :deadline deadline + :maker maker})) + +(defn validate-set-topic [session params] + (let [room (@rooms (params :room)) + topic (params :topic) + deadline (params :deadline)] + (cond (not (session :is_admin)) (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") + :else (do + (dosync (set-topic! room topic deadline (session :nick))) + (resp-success "OK"))))) + ;; Chat (defn validate-room-access [room-key session] @@ -430,7 +458,7 @@ (let [is-image (is-image? content) qry (str "INSERT INTO messages (user_id, room_id, content, is_image) " "VALUES (?, ?, ?, ?) RETURNING message_id")] - (with-connection db + (with-connection *db* ((first (do-select [qry user-id room-id content is-image])) :message_id)))) @@ -596,7 +624,7 @@ (defroutes pichat (GET "/" (no-cache (landing session))) (GET "/favicon.ico" (serve-static "static" "favicon.ico")) - (GET "/u/:nick" (profile session (params :nick) "0")) + (GET "/u/:nick" (profile session (params :nick) "0")) (GET "/u/:nick/" (profile session (params :nick) "0")) (GET "/u/:nick/:offset" (profile session (params :nick) @@ -621,6 +649,12 @@ (POST "/msg" (validated-msg session params)) (POST "/submit-registration" (register session params)) (POST "/update-profile" (update-profile session params)) + (POST "/set-topic" (validate-set-topic session params)) + (GET "/about_us" (serve-template "about_us" session)) + (GET "/goodies" (serve-template "goodies" session)) + (GET "/help" (serve-template "help" session)) + (GET "/privacy" (serve-template "privacy" session)) + (GET "/terms" (serve-template "terms" session)) (ANY "*" (unknown-page params))) (defroutes multipart diff --git a/src/utils.clj b/src/utils.clj index 3ffd54b..33a247f 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -7,11 +7,11 @@ (let [db-host "localhost" db-port 5432 db-name "dumpfm"] - (def db {:classname "org.postgresql.Driver" - :subprotocol "postgresql" - :subname (str "//" db-host ":" db-port "/" db-name) - :user "postgres" - :password "root"})) + (def *db* {:classname "org.postgresql.Driver" + :subprotocol "postgresql" + :subname (str "//" db-host ":" db-port "/" db-name) + :user "postgres" + :password "root"})) ;; JSON responses @@ -30,12 +30,12 @@ ;; Database (defn do-select [query] - (with-connection db + (with-connection *db* (with-query-results rs query (doall rs)))) (defn do-count [query] - ((first (with-connection db + ((first (with-connection *db* (with-query-results rs query (doall rs)))) :count)) @@ -72,4 +72,12 @@ (defn validated-stats [session params] (if (session :is_admin) (stats session params) - (resp-error "BAD_REQUEST")))
\ No newline at end of file + (resp-error "BAD_REQUEST"))) + +;; Parsing + +(defn maybe-parse-int [s f] + (if s (Integer/parseInt s) f)) + +(defn maybe-parse-long [s f] + (if s (Long/parseLong s) f))
\ No newline at end of file diff --git a/static/browsertool.gif b/static/browsertool.gif Binary files differindex 9777d27..05a3379 100644 --- a/static/browsertool.gif +++ b/static/browsertool.gif diff --git a/static/header.css b/static/header.css index 5ad2fbc..5b4e549 100755 --- a/static/header.css +++ b/static/header.css @@ -28,11 +28,13 @@ margin-right:80%; color: #fff; } + #header7{ background-image:url(/static/dblue2.png); background-attachment:inherit; margin: 0px auto -1px auto; top: 0px; +height:38; position:fixed; background-repeat:repeat-x; width:100%; @@ -147,7 +149,7 @@ width:auto; #landscape{ position:absolute; width:auto; - +display:none; margin-left:55%; top:-38; opacity:0.8; @@ -159,6 +161,7 @@ width:auto; left:190; margin-left:29%; top:-19; +display:none; z-index:3; } @@ -188,7 +191,24 @@ z-index:3; #topnav a.signin, #topnav a.signin:hover { *background-position:0 3px!important; } +#register{ + top:-5px; + position:absolute; + font-size: 16px; +height:22; +word-spacing:2; +width:365; +color:#fff; +text-indent:14; +line-height:1.9; +font-weight:bold; + left: -140; + margin-left: 1.2%; + margin-right: 8%; + letter-spacing:.2px; + z-index: 999; +} #banner-menu { position: relative; height: 26px; } diff --git a/static/index.html b/static/index.html index a7e896a..ccdf7ee 100755 --- a/static/index.html +++ b/static/index.html @@ -183,7 +183,7 @@ label { <div align="right" class="txt"> <br> <div align="center">Right now dump.fm is invite only...<br> - If you have registration code, <a href="/register" style="text-decoration:none;">click here!</a> <br> + If you have a registration code, <a href="/register" style="text-decoration:none;">click here!</a> <br> </div> </div> </div> diff --git a/static/js/pichat.js b/static/js/pichat.js index 92d24a1..8917e7c 100755 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -1,8 +1,11 @@ var cache = {} -var pendingMessages = {} +var PendingMessages = {} var MaxImagePosts = 40 +// Utils + + function escapeHtml(txt) { if (!txt) { return ""; } else { return $("<span>").text(txt).html(); } @@ -30,6 +33,8 @@ function linkReplace(url){ } } +// Message Handling + var ImageMsgCount = 0 function removeOldMessages(){ // don't count posts that are all text @@ -61,7 +66,6 @@ function buildMessageDiv(msg, isLoading) { } function buildUserDiv(user) { - console.warn(user); if (user.avatar) { return '<div class="username">' + '<a href="/u/' + escapeHtml(user.nick) + '" target="_blank">' @@ -74,6 +78,8 @@ function buildUserDiv(user) { } } +// Growl + function buildGrowlDataAndPopDatShit(msg) { var nick = escapeHtml(msg.nick); nick = '<a href="/u/' + nick + ' " style="color:pink">' + nick + '</a>:' @@ -96,11 +102,13 @@ function handleMsgError(resp) { } } +// Messages + function submitMessage() { var content = $.trim($('#msgInput').val()); $('#msgInput').val(''); if (content == '') { return; } - pendingMessages[content] = true; + PendingMessages[content] = true; var msg = { 'nick': Nick, 'content': content }; var div = addNewMessage(msg, true); @@ -166,7 +174,6 @@ function updateUI(msgs, users) { } if (users !== null) { var flattened = flattenUserJson(users); - console.log(flattened); if (!('userlist' in cache) || flattened != cache.userlist) { $("#userList").html($.map(users, buildUserDiv).join('')); } @@ -175,14 +182,34 @@ function updateUI(msgs, users) { } function isDuplicateMessage(m) { - if (m.nick == Nick && m.content in pendingMessages) { - delete pendingMessages[m.content]; + if (m.nick == Nick && m.content in PendingMessages) { + delete PendingMessages[m.content]; return true; } else { return false; } } +var CurrentTopic = null; + +function isSameTopic(curTopic, newTopic) { + if (!!curTopic != !!newTopic) { return false; } + else if (!curTopic) { return false; } // => !newTopic also + else { + return curTopic.topic == newTopic.topic && + curTopic.deadline == newTopic.deadline && + curTopic.maker == newTopic.maker; + } +} + +function updateTopic(newTopic) { + if (isSameTopic(CurrentTopic, newTopic)) { return; } + alert('new topic'); + CurrentTopic = newTopic; + $('#topic').text(topic.topic); + +} + function refresh() { var onSuccess = function(json) { try { @@ -194,6 +221,9 @@ function refresh() { if (typeof UnseenMsgCounter !== 'undefined' && !HasFocus) { UnseenMsgCounter += messages.length; } + if (json.topic) { + updateTopic(json.topic); + } } catch(e) { if (IsAdmin && window.console) { console.error(e); @@ -240,22 +270,16 @@ function initChat() { setTimeout(refresh, 1000); } -function initProfile() { - jQuery(".linkify").each(function() { - var text = jQuery(this).text(); - jQuery(this).html(linkify(text)); - }); - - - $('.logged-dump .content').each(function() { - var t = $(this); - t.html(buildMsgContent(t.text())); - }); +function makePlainText() { + var j = $(this); + j.text(j.text()); +} +function activateProfileEditable() { var onSubmit = function(attr, newVal, oldVal) { newVal = $.trim(newVal); if (newVal == oldVal) { return oldVal }; - + $.ajax({ type: "POST", timeout: 5000, @@ -273,22 +297,45 @@ function initProfile() { return escapeHtml(newVal); }; - var avatarOpts = { 'default_text': 'Enter here!', + var avatarOpts = { 'default_text': 'Paste URL here!', 'callback': onSubmit, 'field_type': 'text', 'callbackShowErrors': false }; - $('#avatar.editable').editInPlace(avatarOpts); + if ($('#avatar.editable').length > 0) { + $('#avatar.editable').editInPlace(avatarOpts); + setupUploadAvatar('upload'); + } var textareaOpts = { 'default_text': 'Enter here!', 'callback': onSubmit, 'field_type': 'textarea', 'callbackShowErrors': false }; - $('#contact.editable, #bio.editable').editInPlace(textareaOpts); + $('#contact.editable, #bio.editable') + .editInPlace(textareaOpts) + .each(makePlainText); +} - if ($('#upload').length > 0) { - setupUploadAvatar('upload'); - } +function enableProfileEdit() { + $('#contact, #bio, #avatar').addClass('editable'); + $('#avatar-editing').show(); + var resetPage = function() { location.reload() }; + $('#edit-toggle a').text('--> Done editing <--').click(resetPage); + activateProfileEditable(); +} +function initProfile() { + $(".linkify").each(function() { + var text = jQuery(this).text(); + jQuery(this).html(linkify(text)); + }); + + $('#edit-toggle').click(enableProfileEdit); + activateProfileEditable(); + + $('.logged-dump .content').each(function() { + var t = $(this); + t.html(buildMsgContent(t.text())); + }); }; function initLog() { @@ -303,8 +350,8 @@ function favoriteImage() {}; function setupUpload(elementId, roomKey) { var onSubmit = function(file, ext) { - if (!(ext && /^(jpg|png|jpeg|gif)$/i.test(ext))) { - alert('Error: invalid file extension ' + ext); + if (!(ext && /^(jpg|png|jpeg|gif|bmp)$/i.test(ext))) { + alert('SORRY, NOT AN IMAGE DUDE... '); return false; } }; @@ -331,9 +378,9 @@ function setupUploadAvatar(elementId) { var onComplete = function(file, resp) { $('#spinner').hide(); if (resp == 'INVALID_REQUEST') { - location.href = location.href; + location.reload(); } else if (resp == 'NOT_LOGGED_IN') { - location.href = location.href; + location.reload(); } else if (resp == 'INVALID_IMAGE') { alert("Sorry, dump.fm can't deal with your image. Pick another :("); return; diff --git a/static/log.css b/static/log.css new file mode 100644 index 0000000..7dc2483 --- /dev/null +++ b/static/log.css @@ -0,0 +1,354 @@ + #profile { + float: right; + padding: 20px; +width:180; + position:absolute; + top:29px; +left:545; + margin-top:34px; +background-color:#fff; + + + text-overflow: ellipsis-word; + background-position:top; + z-index:999; + min-height:600px; + + + line-height:1.5; + } +#profile h3{ +margin-top:12; +line-height:2; +color:#fff; +text-shadow: blue -2px -2px 0, red 2px 2px 0, green -6px 4px 0; +} +#profile h2{ +text-indent:-10; +margin-top:-7; +margin-bottom:15; +} +#logavatar{ +margin-left:-90; +height:25; +background-image:url(/static/right.giff); +width:70; + background-repeat:no-repeat; + background-position:50 2; +margin-top:-22; + +} +#logavatar img{ + + +} +#lolbanner{ +position:absolute; +top:5; +margin-left:22; +} +#chatrap{ + width:610; + + margin-left:auto; + margin-right: auto ; + +#cats{ +background-image:url(/static/dumpcats2.png); +} + + +} +#pnav{position:absolute; +padding-left:270; +margin-top:0; +background-position:top; +font-weight:bold; +margin-left:0; +text-align:left; + + + +} +#pnavo{ +margin-top:-18; +padding:2; +width:105; +letter-spacing:-2; +text-indent:6; + background-image:url(/static/grad2.png); +height:32; +text-transform:capitalize; + background-image:url(/static/upload.png); + + +} +#pnavn{ +position:absolute; +top:-1; +left:395; +letter-spacing:-2; +text-indent:5; +width:96; +height:32; +padding:2; +border:1px; + background-image:url(/static/upload.png); + + +} +#pnav a { + font-size: 30px; + color:#fff; +text-transform:lowercase; +text-shadow: blue -2px -2px 0, red 2px 2px 0, green -6px 4px 0; +} +pnav a:link { + text-decoration: none; +color:fff; +} +a:visited { + text-decoration: none; + color: #000; +} +#pnav a:hover { + text-decoration: none; + color: #fff; +text-shadow: blue 2px 2px 0, red -20px -2px 0, green 6px 4px 0; + + +} +a:active { + text-decoration: none; + color: #000; +} +#footer +{ + text-align:center; + position:relative; + width:100%; + bottom:-50px; +line-height:3.8; + font-size:12px; +word-spacing:12px; +margin-left:6; +height:28px; + color: #000; + +} +#footer a { + font-size: 11px; + color: #000; + +} +#footer a:link { + text-decoration: none; + font-size: 10px; +color:000; +} +#footer a:hover { + text-decoration:none; + font-size: 11px; + color: #f0e; +} + +#log +{ + position:absolute; + + top:57px; + padding-top: 25px; + + + +} +#posts { + + + +} +.logged-dump img{ + max-width:500px; + width: expression(this.width > 500 ? 500: true); + max-height:400px; + height: expression(this.width > 500 ? 500: true); + border:0px; + z-index:4; + + + +} +.logged-dump{ + + max-width:500px; +text-overflow: ellipsis-word; + padding: 18px; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-transform: uppercase; + line-height:15px; + background-color:#fff; +border:1px solid #eee; + 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; +margin-top:20; + z-index:4; + + line-height:20px; + text-align: left; + + +} + .editable { + color: #0AA; + } + .editing { + color: #F0F; + } + div#avatar { + overflow: hidden; + text-overflow: ellipsis; + + padding-bottom:20px; + } + #contact { + + + + text-overflow: ellipsis-word; + } + #bio { + + text-overflow: ellipsis-word; + } + + input.inplace_field { + width: 100%; + } + + textarea.inplace_field { + width: 100%; + height: 50px; + } + + h2 { + + letter-spacing:-1px; +color:#087cff; + height:40px; + font-size:24px; + font-family:Arial, Helvetica, sans-serif; + font-weight:bold; + text-transform:capitalize; + + + text-shadow: 1px 3px 3px #c8cbce; +} + + + img#avatarPic { + max-height:250px; + 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; + } + + + #newuser + { + 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; + 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; +padding:20; +line-height:1.5; +height:auto; +margin-top:-100px; + width:600; + + background-image:url(/static/dumpcats2.png); +margin-left:40} + + #newuser a{font-size:28; +line-height:3; + text-shadow: 1px 1px 1px #000; +letter-spacing:-1; +color:#f0e; + + +} + +#newuser h1{font-size:20; +letter-spacing:-2; +color:#fff; +text-indent:250; text-shadow: 1px 1px 1px #000; +display:none; +text-transform:uppercase; + +} +#newuser h3{font-size:18; +letter-spacing:-1; +color:#000; + text-shadow: 1px 1px 1px #ccc; +text-transform:uppercase; + +} +#newuser h2{font-size:35; +margin-top:-10; +color:#000; + text-shadow: 0px 2px px #f0e; +text-transform:lowercase; +letter-spacing:5; +text-align:center; + +} +#date{ +font-size:60%; +} +#headerbar{ +top:80; + background-image:url(/static/welcomebar.gif); +} +.invisible { display: none !important; } +body,td,th { + font-family: Arial, Helvetica, sans-serif; + background-color:#ffffee; + background-image:url(/static/chanbg.png); + background-repeat:repeat-x; + background-position:1 10; +background-attachment:fixed; + margin: 0; + + + +}@charset "UTF-8"; diff --git a/static/pichat.css b/static/pichat.css index f01a150..6c693de 100755 --- a/static/pichat.css +++ b/static/pichat.css @@ -309,6 +309,7 @@ border-bottom:2px solid #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; } diff --git a/static/profile.css b/static/profile.css index 8ee09d3..143aa79 100755 --- a/static/profile.css +++ b/static/profile.css @@ -1,14 +1,18 @@ #profile { float: right; padding: 20px; -width:180; +width:auto; position:absolute; top:29px; left:545; +max-width:230; margin-top:34px; background-color:#fff; - + overflow: hidden; + text-overflow: ellipsis; + + height:auto; text-overflow: ellipsis-word; background-position:top; z-index:999; @@ -17,6 +21,11 @@ background-color:#fff; line-height:1.5; } +#lolbanner{ +position:absolute; +top:5; +margin-left:22; +} #profile h3{ margin-top:12; line-height:2; @@ -28,16 +37,33 @@ text-indent:-10; margin-top:-7; margin-bottom:15; } +#logavatar{ +margin-left:-49; +height:22; + +margin-top:-22; +} +#logavatar img{ + max-width:20px; + width: expression(this.width > 20 ? 20: true); + max-height:20px; + height: expression(this.width > 20 ? 20: true); + max-width:20px; +margin-top:0; + box-shadow: 0 0 10px #d8dbde, 0px 0px 5px #d8dbde; + -webkit-box-shadow: 0 0 10px #d8dbde, 0px 0px 5px #d8dbde; + -moz-box-shadow: 0 0 10px #d8dbde, 2px 2px 5px #d8dbde; +} #chatrap{ - width:720; + width:610; margin-left:auto; margin-right: auto ; + #cats{ background-image:url(/static/dumpcats2.png); } - } @@ -52,6 +78,27 @@ text-align:left; } +#upload{ +display:inline-block; + width:181px; + height:33px; + font-size:20px; + background-image:url(/static/btngrad1.png); + font-weight:bold; + word-spacing:7; + margin-top:25px; +margin-bottom:5; +margin-left:-2; + 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; +} #pnavo{ margin-top:-18; padding:2; @@ -161,8 +208,8 @@ color:000; } .logged-dump{ - - +width:500; + max-width:500px; text-overflow: ellipsis-word; padding: 18px; font-family: Arial, Helvetica, sans-serif; @@ -274,7 +321,7 @@ color:#087cff; -moz-box-shadow: 0 0 10px #d8dbde, 0px 0px 10px #d8dbde; padding:20; line-height:1.5; -height:380; +height:auto; margin-top:-100px; width:600; diff --git a/static/register.html b/static/register.html index ce222e1..c60a319 100644 --- a/static/register.html +++ b/static/register.html @@ -15,11 +15,6 @@ <style type="text/css"> - - - - - <!-- .white a:link { text-decoration: none; @@ -48,7 +43,7 @@ width:460px; margin: 0px auto -1px auto; height:400px; -padding-top:15; +padding-top:5; z-index:2; opacity:0.9; border-top-left-radius:10px; @@ -72,6 +67,9 @@ padding-top:15; -webkit-box-shadow: 5px 5px 100px #c8cbce; -moz-box-shadow: 5px 5px 100px #c8cbce; } +#main img{margin-left:80; + +} #logout7{ top:5px; position:relative; @@ -132,7 +130,7 @@ text-decoration:none; font-size:15px; } -.feild { +.field { height:40px; width:300px; border:3px #000; @@ -197,12 +195,6 @@ top:15px; --> - - - - - - </style> <body> @@ -226,27 +218,26 @@ top:15px; <div align="right"> <h1> </h1> <h1><span>username</span> - <input type="text" class="feild"id="nickInput" /> + <input type="text" class="field"id="nickInput" /> <br /> <span>password</span> - <input type="password"class="feild" id="passwordInput" /> + <input type="password"class="field" id="passwordInput" /> </h1> <h1><span>email</span> - <input type="text" class="feild"id="emailInput" /> + <input type="text" class="field"id="emailInput" /> </h1> <h1><span> regcode</span> - <input type="text" class="feild" id="codeInput" /> + <input type="text" class="field" id="codeInput" /> </h1> - - <h1> <br /> - + + <h1><br /> + </h1> - <div align="center"> - - <input type="submit" class="submit" id="submit" value="Register!" /> + <div align="center"> + <input type="submit" class="submit" id="submit" value="Register!" /> </div> </div> </div> diff --git a/static/right.gif b/static/right.gif Binary files differnew file mode 100644 index 0000000..1196f1b --- /dev/null +++ b/static/right.gif diff --git a/static/webcam/webcam.js b/static/webcam/webcam.js index 3e3b4fd..42af499 100644 --- a/static/webcam/webcam.js +++ b/static/webcam/webcam.js @@ -27,7 +27,7 @@ window.webcam = { }, // callback hook functions init: function(){ - webcam.set_api_url( '/upload' ); + webcam.set_api_url( '/upload/message' ); webcam.set_swf_url('/static/webcam/webcam.swf') webcam.set_quality( 90 ); webcam.set_shutter_sound(false); diff --git a/template/about_us.st b/template/about_us.st new file mode 100644 index 0000000..b8ee9f9 --- /dev/null +++ b/template/about_us.st @@ -0,0 +1,7 @@ +<html> + <head> + <title>About Us</title> + $head()$ + </head> + <body></body> +</html> diff --git a/template/banner.st b/template/banner.st index c67bafa..dd7a7b3 100755 --- a/template/banner.st +++ b/template/banner.st @@ -18,7 +18,7 @@ <li><a href="/browser"><img src="/static/image_draw.gif" /> Image Search</a></li> </ul> $else$ - <a href="/register"><img src="/static/answer_good.gif" />Register</a> + <div id="register"> <a href="/register"><img src="/static/answer_good.gif" />Register</a></div> <div id="landscape"> <img src="/static/const_landscape.gif" /> </div> <div id="welcomeinternet"> <img src="/static/welcome.gif" /> </div> $endif$ @@ -28,7 +28,9 @@ </div> </div> - + + <div id="topic"></div> + $if(isadmin)$ <div id="vippp"> <a href="/VIP/chat"> ★ VIP ★ </a> diff --git a/template/chat.st b/template/chat.st index 2c0f15f..9122c93 100755 --- a/template/chat.st +++ b/template/chat.st @@ -49,7 +49,7 @@ </div> <div id="userList"> $users: { u | - <div class="username"><a href="/u/$u.nick$"> + <div class="username"><a href="/u/$u.nick$" target="_blank"> $if(u.avatar)$<img src="$u.avatar$" width="50" height="50">$endif$ $u.nick$</a><br> </div> diff --git a/template/goodies.st b/template/goodies.st new file mode 100644 index 0000000..a7c0824 --- /dev/null +++ b/template/goodies.st @@ -0,0 +1,8 @@ +<html> + <head> + <title>Goodies</title> + $head()$ + </head> + <body></body> +</html> +
\ No newline at end of file diff --git a/template/head.st b/template/head.st index 46ce6a5..e83e687 100755 --- a/template/head.st +++ b/template/head.st @@ -1,7 +1,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> -<!-- <script type="text/javascript" src="/static/jquery-1.3.2.min.js"></script> --> +<script type="text/javascript" src="/static/jquery-1.3.2.min.js"></script> +<!-- <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> diff --git a/template/help.st b/template/help.st new file mode 100644 index 0000000..0d41e21 --- /dev/null +++ b/template/help.st @@ -0,0 +1,7 @@ +<html> + <head> + <title>Help</title> + $head()$ + </head> + <body></body> +</html> diff --git a/template/log.st b/template/log.st index 97eaa78..65f149e 100755 --- a/template/log.st +++ b/template/log.st @@ -1,8 +1,8 @@ <html> <head> - <title>$roomname$ Log</title> + <title>dump.fm log</title> $head()$ - <link rel="stylesheet" type="text/css" href="/static/profile.css"> + <link rel="stylesheet" type="text/css" href="/static/log.css"> <style> </style> @@ -20,6 +20,9 @@ <br> <div id="posts"> + <div id="lolbanner"> + <img src="/static/welcomebanner.gif"> + </div> $if(dumps)$ $dumps: { d | $logged_dump(dump=d)$ }$ $else$ diff --git a/template/logged_dump.st b/template/logged_dump.st index 01700b5..86465e3 100755 --- a/template/logged_dump.st +++ b/template/logged_dump.st @@ -31,8 +31,8 @@ img{ } </style> <div class="logged-dump"> - <a href="/u/$dump.nick$"><img height="50" width="50" src="$dump.avatar$" /></a> - <div>$dump.created_on$ -- by <a href="/u/$dump.nick$">$dump.nick$</a></div> + <div>$dump.created_on$ -- by <b><a href="/u/$dump.nick$">$dump.nick$</a></b></div> + <a href="/u/$dump.nick$"><div id="logavatar"><img height="50" width="50" src="$dump.avatar$" /></div></a> <div class="content">$dump.content$</div> <hr /> </div> diff --git a/template/privacy.st b/template/privacy.st new file mode 100644 index 0000000..513eca3 --- /dev/null +++ b/template/privacy.st @@ -0,0 +1,7 @@ +<html> + <head> + <title>Privacy</title> + $head()$ + </head> + <body></body> +</html>
\ No newline at end of file diff --git a/template/profile.st b/template/profile.st index b5d3f38..46e8cb4 100755 --- a/template/profile.st +++ b/template/profile.st @@ -11,12 +11,9 @@ <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(function(){ - initProfile(); - }); - </script> + jQuery(document).ready(initProfile); + </script> </head> <body> @@ -28,114 +25,114 @@ <div id="loghead"> </div> <br> - <div id="posts"> <div id="cats"> + <div id="posts"> + <div id="cats"> $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" type="submit"> + <img id="spinner" src="/static/spinner.gif" style="display: none" /> + </div> + $endif$ - <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" class="editable">$avatar$</div> - <input id="upload" value="Upload" type="submit"> - <img id="spinner" src="/static/spinner.gif" style="display: none" /> - $endif$ - - - $if(is_home)$ - <h3>contact info</h3> - <div id="contact" class="editable">$contact$</div> - $elseif(contact)$ - <h3>contact info</h3> - <div id="contact" class="linkify">$contact$</div> - $else$ - <br><br> - <div><img src="/static/noinfo.png"></div> - $endif$ - - - <br> + <h3>contact info</h3> + $if(contact)$ + <div id="contact" class="linkify">$contact$</div> + $else$ + <br><br> + <div><img src="/static/noinfo.png"></div> + $endif$ + <br> + + <h3>bio</h3> + $if(bio)$ + <div id="bio" class="linkify">$bio$</div> + $else$ + <div><img src="/static/noinfo.png"></div> + $endif$ - $if(is_home)$ - <h3>bio</h3> - <div id="bio" class="editable">$bio$</div> - $elseif(bio)$ - <h3>bio</h3> - <div id="bio" class="linkify">$bio$</div> - $else$ - <div><img src="/static/noinfo.png"></div> - $endif$ + $if(is_home)$ + <br> + <div id="edit-toggle"><a href="#">--> Edit your information <--</a></div> + $endif$ + <br> + <div id="date"> + <div type="text" id="datepicker"></div></div> + </div> - <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" class="editable">$avatar$</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> + <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$ - + $if(next)$ + <div id="pnavn"><a href="/u/$nick$/$next$">next ☞</a></div> + $endif$ - <br><br> + + $if(prev)$ + <div id="pnavo"> <a href="/u/$nick$/$prev$">☜ prev</a></div> + $endif$ + + <br><br> </div> <div id="footer"> diff --git a/template/terms.st b/template/terms.st new file mode 100644 index 0000000..29a41cc --- /dev/null +++ b/template/terms.st @@ -0,0 +1,7 @@ +<html> + <head> + <title>Terms and Conditions</title> + $head()$ + </head> + <body></body> +</html> |
