Fix to websocket js

This commit is contained in:
Raphael 2010-11-16 14:35:46 -08:00
parent 8c647aa169
commit d1a56e9ef2

View file

@ -13,11 +13,11 @@
//Attach onmessage to websocket
ws.onmessage = function(evt) {
var obj = jQuery.parseJSON(evt.data);
if(obj['notice']){
processNotification(obj['notice']);
}else if (obj['class'] == 'people'){
debug("got a " + obj['class']);
processPerson(obj['html']);
}else{
debug("got a " + obj['class'] + " for aspects " + obj['aspect_ids']);
@ -45,7 +45,11 @@
});
function processPerson(html){
$('.people#stream').prepend(html).slideDown('slow', function(){})
$('.people#stream').prepend(html).slideDown('slow', function(){});
var rr = $('#request_result');
rr.prepend(html).hide();
$("#request_result [name='into']").val(rr.attr('aspect_id'));
rr.slideDown('fast', function(){});
}
function processNotification(html){
@ -103,7 +107,8 @@
function processPhotoInAlbum(photoHash){
if (location.href.indexOf(photoHash['album_id']) == -1){
return ;
}›
}
html = "<div class=\'image_thumb\' id=\'"+photoHash['id']+"\' style=\'padding-right:3px;\'> \
<a href=\"/photos/"+ photoHash['id'] +"\"> \
<img alt=\"New thumbnail\" src=\""+ photoHash['thumb_url'] +"\" /> \