diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-06-20 22:48:50 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-06-20 22:48:50 -0400 |
| commit | bed8d70d0f1321d0a4463b768b7b2d12a18eb3da (patch) | |
| tree | 76dd5db015c7624923792d3f255932b980fbef06 | |
| parent | 1aeada8bd0a408cb58fc3ec0c2ed56d1b1901135 (diff) | |
sostler prod commit
| -rw-r--r-- | static/js/pichat.js | 28 | ||||
| -rw-r--r-- | template/profile.st | 7 | ||||
| -rw-r--r-- | template/userlog.st | 34 |
3 files changed, 27 insertions, 42 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index 2ea4b3b..a169090 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -95,12 +95,14 @@ function linkReplace(url) { linkUrl = url; else linkUrl = 'http://' + url; - + + // Ugly hack. Don't open new links in chat, only in logs. + var shouldOpen = $('#chatrap').length == 0; var uri = parseUri(url) switch(getUriType(uri)) { case 'image': LastMsgContainsImage = true; - return "<a href='" + linkUrl + "' class='img-wrapper' onclick='return false'><img src='" + linkUrl + "'></a>"; break; + return "<a target='_blank' href='" + linkUrl + "' class='img-wrapper' onclick='return " + shouldOpen + "'><img src='" + linkUrl + "'></a>"; break; case 'youtube': Youtube.startAnimation(); return "<a target='_blank' class='youtube' href='" + linkUrl + "'>" + @@ -662,7 +664,6 @@ function setupUpload(elementId, roomKey) { }; var onComplete = function(file, response) { var r = $.trim(response); - g = r; if (r.match(/FILE_TOO_BIG/)) { var maxSize = r.split(" ")[1] / 1024; alert("Sorry. Your file is just too fucking big. " @@ -692,7 +693,7 @@ function setupUpload(elementId, roomKey) { autoSubmit: true, name: 'image', data: { room: roomKey }, - onSubmit: onSubmit, + onSubmit: onSubmit, onComplete: onComplete }); } @@ -704,17 +705,22 @@ function setupUploadAvatar(elementId) { }; var onComplete = function(file, resp) { $('#spinner').hide(); - if (resp == 'INVALID_REQUEST') { + var r = $.trim(resp); + if (r == 'INVALID_REQUEST') { location.reload(); - } else if (resp == 'NOT_LOGGED_IN') { + } else if (r == 'NOT_LOGGED_IN') { location.reload(); - } else if (resp == 'INVALID_IMAGE') { + } else if (r == 'INVALID_IMAGE') { alert("Sorry, dump.fm can't deal with your image. Pick another :("); return; - } - var s = '<img id="avatarPic" src="' + resp + '" width="150" />'; - $('#avatarPic').replaceWith(s).show(); - $('#avatar').text(resp); + } else if (r.match(/FILE_TOO_BIG/)) { + var maxSize = r.split(" ")[1] / 1024; + alert("Sorry. Your file is just too fucking big. " + + maxSize + "KB or less please."); + return; + } + var s = '<img id="dashavatarPic" src="' + r + '" width="150" />'; + $('#dashavatarPic').replaceWith(s).show(); }; new AjaxUpload(elementId, { action: '/upload/avatar', diff --git a/template/profile.st b/template/profile.st index 7bad5cd..5278e77 100644 --- a/template/profile.st +++ b/template/profile.st @@ -51,18 +51,15 @@ <br> <h3>contact info</h3> $if(contact)$ <div id="contact" class="linkify">$contact$</div> - $else$ -<img src="/static/img/noinfo.png"> - + <img id="contact" src="/static/img/noinfo.png"> $endif$ <br> <h3>bio</h3> $if(bio)$ <div id="bio" class="linkify">$bio$</div> $else$ - -<img src="/static/img/noinfo.png"> + <img id="bio" src="/static/img/noinfo.png"> $endif$ </div> diff --git a/template/userlog.st b/template/userlog.st index 547772e..850e55b 100644 --- a/template/userlog.st +++ b/template/userlog.st @@ -18,15 +18,15 @@ </div> <div id="messagePanep"> - <div id="userListp"><br> $if(is_home)$<br>$endif$ - <h2> + <div id="userListp"><br> + <h2> $if(avatar)$ <img id="avatarPic" src="$avatar$"/> $else$<br><br> <img id="avatarPic" src="/static/img/noinfo.png"> $endif$ - $nick$ </h2><br> + <a href="http://dump.fm/$nick$"> $nick$ </a></h2><br> $if(score_ent)$ <h8> fav score: $score$ @@ -38,15 +38,9 @@ </div> $endif$ - <div>dumps posted: $dump_cnt$</div> - <div>dumps $nick$ faved: $dumps_user_faved_cnt$</div> - - $if(is_home)$ - <div id="avatar-editing" style="display: none"> - <input id="uploadp" value="Upload Icon" type="submit"> - <img id="spinner" src="/static/img/spinner.gif" style="display: none" /> - </div> - $endif$ + <div><a href="http://dump.fm/$nick$/log">dumps posted: $dump_cnt$</a></div> + <div><a href="http://dump.fm/$nick$/favorites">dumps $nick$ faved: $dumps_user_faved_cnt$</a></div> + <br> <h3>contact info</h3> $if(contact)$ @@ -62,23 +56,11 @@ <div><img id="bio" src="/static/img/noinfo.png"><br><br></div> $endif$ - - - - $if(is_home)$ - <br> - <div id="edit-toggle"><a href="#">edit profile</a></div><br><br> - $endif$ + - <br> - - <a href="http://dump.fm/$nick$/favorites"><h7>$nick$'s <br>Favorite Pix</h7></a> - - <div id="date"> - <div type="text" id="datepicker"></div></div> </div> - <div id="favbox" style="display: hidden"></div> + <div id="messageList"> $if(dumps)$ <span class="content"> |
