Fix to websocket js
This commit is contained in:
parent
8c647aa169
commit
d1a56e9ef2
1 changed files with 8 additions and 3 deletions
|
|
@ -13,11 +13,11 @@
|
||||||
//Attach onmessage to websocket
|
//Attach onmessage to websocket
|
||||||
ws.onmessage = function(evt) {
|
ws.onmessage = function(evt) {
|
||||||
var obj = jQuery.parseJSON(evt.data);
|
var obj = jQuery.parseJSON(evt.data);
|
||||||
|
|
||||||
if(obj['notice']){
|
if(obj['notice']){
|
||||||
processNotification(obj['notice']);
|
processNotification(obj['notice']);
|
||||||
|
|
||||||
}else if (obj['class'] == 'people'){
|
}else if (obj['class'] == 'people'){
|
||||||
|
debug("got a " + obj['class']);
|
||||||
processPerson(obj['html']);
|
processPerson(obj['html']);
|
||||||
}else{
|
}else{
|
||||||
debug("got a " + obj['class'] + " for aspects " + obj['aspect_ids']);
|
debug("got a " + obj['class'] + " for aspects " + obj['aspect_ids']);
|
||||||
|
|
@ -45,7 +45,11 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
function processPerson(html){
|
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){
|
function processNotification(html){
|
||||||
|
|
@ -103,7 +107,8 @@
|
||||||
function processPhotoInAlbum(photoHash){
|
function processPhotoInAlbum(photoHash){
|
||||||
if (location.href.indexOf(photoHash['album_id']) == -1){
|
if (location.href.indexOf(photoHash['album_id']) == -1){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
html = "<div class=\'image_thumb\' id=\'"+photoHash['id']+"\' style=\'padding-right:3px;\'> \
|
html = "<div class=\'image_thumb\' id=\'"+photoHash['id']+"\' style=\'padding-right:3px;\'> \
|
||||||
<a href=\"/photos/"+ photoHash['id'] +"\"> \
|
<a href=\"/photos/"+ photoHash['id'] +"\"> \
|
||||||
<img alt=\"New thumbnail\" src=\""+ photoHash['thumb_url'] +"\" /> \
|
<img alt=\"New thumbnail\" src=\""+ photoHash['thumb_url'] +"\" /> \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue