diff options
| author | sostler <sbostler@gmail.com> | 2010-01-07 23:54:07 -0500 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-01-07 23:54:07 -0500 |
| commit | 4e837788114e07330be2dfb869efd70e525b2bc4 (patch) | |
| tree | c4a644a6e0981c302d3f997d61bf5619eedf728c /static | |
| parent | ca746303a8fc20f304bb3ccbeb74f8ae4631a37e (diff) | |
| parent | cce37b4db8a981ef00db0ebb75f7c98f1c336543 (diff) | |
Added multiple-window posting, removed posting delay
Diffstat (limited to 'static')
| -rw-r--r-- | static/header.css | 4 | ||||
| -rw-r--r-- | static/moverc.png | bin | 0 -> 170 bytes | |||
| -rw-r--r-- | static/pichat.css | 53 | ||||
| -rwxr-xr-x | static/pichat.js | 31 | ||||
| -rw-r--r-- | static/profile.css | 15 |
5 files changed, 56 insertions, 47 deletions
diff --git a/static/header.css b/static/header.css index d981931..c32510c 100644 --- a/static/header.css +++ b/static/header.css @@ -64,11 +64,11 @@ filter: progid:DXImageTransform.Microsoft.dropShadow(color=#036aca, offX=3, offY } #logo7{ top:20px; - margin-left: 1%; + margin-left: 15px; margin-right: 10%; z-index:1000; float:left; - margin-top: 3px; + margin-top: 4px; } #rapper7{ top: 0px; diff --git a/static/moverc.png b/static/moverc.png Binary files differnew file mode 100644 index 0000000..709f78d --- /dev/null +++ b/static/moverc.png diff --git a/static/pichat.css b/static/pichat.css index 9c337e1..40720b7 100644 --- a/static/pichat.css +++ b/static/pichat.css @@ -3,7 +3,7 @@ body { background-color:#e3e3e3; - + margin:0; } @@ -56,24 +56,20 @@ color:000; #messagePane { border: 2px solid #c8cbce; - padding: 5px; -top:58px; + +top:56px; bottom:65px; position:fixed; - width: 98%; + width: 99%; background-color:#FFF; - left:7px; - right:10px; +left:0.3%; - float: left; - min-width:500px; z-index:5; } #messageList { height: 100%; width: 100%; - position:inherit overflow-y: auto; overflow-x: hidden; } @@ -94,8 +90,8 @@ bottom:65px; position:relative; min-width:500px; z-index:100; -left:0px; -bottom:5px; +left:1px; +bottom:10px; width: 100%; } @@ -104,7 +100,7 @@ bottom:5px; z-index:100; background-color:#FFF; margin-top: 15px; - left:0px; + left:-3px; position:relative; border:2px solid #c8cbce; height:36px; @@ -188,7 +184,7 @@ top:15px; -webkit-border-bottom-right-radius:5px; -moz-border-radius-bottomleft:5px; -moz-border-radius-bottomright:5px; - max-height:250px; + max-height:450px; box-shadow: 3px 4px 4px #c8cbce; -webkit-box-shadow: 3px 4px 4px #c8cbce; -moz-box-shadow: 3px 3px 4px #c8cbce; @@ -198,7 +194,7 @@ filter: progid:DXImageTransform.Microsoft.dropShadow(color=#c8cbce, offX=3, offY text-align: left; } .username{height:30px; -margin-top:2px; +margin-top:6px; line-height:20px; text-indent:6px; z-index:18; @@ -216,7 +212,9 @@ text-decoration:none; display:block; width:100%; height:100%; -color:#000; +background-image:url(/static/moverc.png); +background-repeat:repeat-x; +color:#fff; text-decoration:none; background-color:#f3f3f3; border-top-right-radius:5px; @@ -232,22 +230,23 @@ background-color:#f3f3f3; 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: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-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 { diff --git a/static/pichat.js b/static/pichat.js index 51489a4..3267b49 100755 --- a/static/pichat.js +++ b/static/pichat.js @@ -57,15 +57,12 @@ function handleMsgError(resp) { } function submitMessage() { - var content = $('#msgInput').val(); + var content = $.trim($('#msgInput').val()); if (content == '') { return; } - - $('#msgInput, #msgSubmit').attr('disabled', 'disabled'); - var onSuccess = function(json) { - $('#msgInput, #msgSubmit').removeAttr('disabled'); - $('#msgInput').val(''); - }; - + PostedMessages.push(content); + $('#msgInput').val(''); + + var onSuccess = function(json) {}; var onError = function(resp, textStatus, errorThrown) { $('#msgInput, #msgSubmit').removeAttr('disabled'); handleMsgError(resp); @@ -120,12 +117,24 @@ function updateUI(msgs, users) { } } +// A duplicate message is a message that was likely to have +// originated from this browser. +function isDuplicateMessage(m) { + if (m.nick != Nick || $.inArray(m.content, PostedMessages) == -1) { + return false; + } + var now = new Date().getTime(); + console.log(now, m.created_on); + return m.created_on - now < 5000; +} + function refresh() { var onSuccess = function(json) { + Timestamp = json.timestamp; var messages = $.grep( json.messages, - function(m) { return m.nick != Nick }); - updateUI(messages, json.users); + function(m) { return !isDuplicateMessage(m) }); + updateUI(messages, json.users); setTimeout(refresh, 1000); }; var onError = function(resp, textStatus, errorThrown) { @@ -136,7 +145,7 @@ function refresh() { type: 'GET', timeout: 5000, url: '/refresh', - data: { 'room': Room }, + data: { 'room': Room, 'since': Timestamp }, cache: false, dataType: 'json', success: onSuccess, diff --git a/static/profile.css b/static/profile.css index 4b9e2b4..a8989db 100644 --- a/static/profile.css +++ b/static/profile.css @@ -25,16 +25,16 @@ -webkit-border-bottom-right-radius:5px; -moz-border-radius-bottomleft:5px; -moz-border-radius-bottomright:5px; - box-shadow: -3px 4px 10px #c8cbce; --webkit-box-shadow: -3px 4px 10px #c8cbce; --moz-box-shadow: -10px -3px 10px #c8cbce; + box-shadow: 10px 3px 10px #c8cbce; +-webkit-box-shadow:10px 3px 10px #c8cbce; +-moz-box-shadow:10px 3px 10px #c8cbce; line-height:1.6; } #chatrap{ width:600 ; - margin-left: auto ; + margin-left: 18%; margin-right: auto ; @@ -67,13 +67,13 @@ letter-spacing:2px; -webkit-border-bottom-right-radius:5px; -moz-border-radius-bottomleft:5px; -moz-border-radius-bottomright:5px; - box-shadow: 3px 4px 10px #c8cbce; --webkit-box-shadow: 3px 4px 10px #c8cbce; + box-shadow: 15px 15px 10px #c8cbce; +-webkit-box-shadow: 15px 15px 10px #c8cbce; -moz-box-shadow: 15px 15px 10px #c8cbce; } #pnav a { font-size: 12px; - color: #000; + color:#444; } pnav a:link { text-decoration: none; @@ -209,6 +209,7 @@ color:#087cff; } #loghead { font-size:1px; + } body { |
