start loading hidden posts
This commit is contained in:
parent
f25c5815b9
commit
1f08f803dd
45
4chan_x.js
45
4chan_x.js
@ -1671,7 +1671,7 @@
|
|||||||
g.callbacks.push(quotePreview.node);
|
g.callbacks.push(quotePreview.node);
|
||||||
preview = $.el('div', {
|
preview = $.el('div', {
|
||||||
id: 'qp',
|
id: 'qp',
|
||||||
className: 'reply'
|
className: 'replyhl'
|
||||||
});
|
});
|
||||||
$.hide(preview);
|
$.hide(preview);
|
||||||
return $.append(d.body, preview);
|
return $.append(d.body, preview);
|
||||||
@ -1689,15 +1689,41 @@
|
|||||||
return _results;
|
return _results;
|
||||||
},
|
},
|
||||||
mouseover: function(e) {
|
mouseover: function(e) {
|
||||||
var el, id;
|
var el, id, qp;
|
||||||
id = this.textContent.replace(">>", '');
|
id = this.textContent.replace(">>", '');
|
||||||
el = $('#qp');
|
qp = $('#qp');
|
||||||
el.innerHTML = d.getElementById(id).innerHTML;
|
if (el = d.getElementById(id)) {
|
||||||
$.show(el);
|
qp.innerHTML = el.innerHTML;
|
||||||
return ui.el = el;
|
} else {
|
||||||
|
qp.innerHTML = 'Loading...';
|
||||||
|
quotePreview.get(this, id);
|
||||||
|
}
|
||||||
|
$.show(qp);
|
||||||
|
return ui.el = qp;
|
||||||
},
|
},
|
||||||
mouseout: function(e) {
|
mouseout: function(e) {
|
||||||
return $.hide(ui.el);
|
return $.hide(ui.el);
|
||||||
|
},
|
||||||
|
get: function(link, id) {
|
||||||
|
return $.get(link.href, (function() {
|
||||||
|
return quotePreview.get2(link, id, this);
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
get2: function(link, id, xhr) {
|
||||||
|
var body, reply, _i, _len, _ref, _results;
|
||||||
|
body = $.el('body', {
|
||||||
|
innerHTML: xhr.responseText
|
||||||
|
});
|
||||||
|
_ref = $$('td.reply', body);
|
||||||
|
_results = [];
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
reply = _ref[_i];
|
||||||
|
if (reply.id === id) {
|
||||||
|
ui.el.innerHTML = reply.innerHTML;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
quickReport = {
|
quickReport = {
|
||||||
@ -2390,6 +2416,13 @@
|
|||||||
#watcher > div:last-child {\
|
#watcher > div:last-child {\
|
||||||
padding-bottom: 5px;\
|
padding-bottom: 5px;\
|
||||||
}\
|
}\
|
||||||
|
\
|
||||||
|
#qp {\
|
||||||
|
border: 1px solid;\
|
||||||
|
}\
|
||||||
|
#qp input {\
|
||||||
|
display: none;\
|
||||||
|
}\
|
||||||
'
|
'
|
||||||
};
|
};
|
||||||
main.init();
|
main.init();
|
||||||
|
|||||||
@ -1337,8 +1337,8 @@ quotePreview =
|
|||||||
init: ->
|
init: ->
|
||||||
g.callbacks.push quotePreview.node
|
g.callbacks.push quotePreview.node
|
||||||
preview = $.el 'div',
|
preview = $.el 'div',
|
||||||
id: 'qp',
|
id: 'qp'
|
||||||
className: 'reply'
|
className: 'replyhl'
|
||||||
$.hide preview
|
$.hide preview
|
||||||
$.append d.body, preview
|
$.append d.body, preview
|
||||||
node: (root) ->
|
node: (root) ->
|
||||||
@ -1348,12 +1348,26 @@ quotePreview =
|
|||||||
$.bind quote, 'mouseout', quotePreview.mouseout
|
$.bind quote, 'mouseout', quotePreview.mouseout
|
||||||
mouseover: (e) ->
|
mouseover: (e) ->
|
||||||
id = @textContent.replace ">>", ''
|
id = @textContent.replace ">>", ''
|
||||||
el = $ '#qp'
|
qp = $ '#qp'
|
||||||
el.innerHTML = d.getElementById(id).innerHTML
|
if el = d.getElementById id
|
||||||
$.show el
|
qp.innerHTML = el.innerHTML
|
||||||
ui.el = el
|
else
|
||||||
|
qp.innerHTML = 'Loading...'
|
||||||
|
quotePreview.get this, id
|
||||||
|
$.show qp
|
||||||
|
ui.el = qp
|
||||||
mouseout: (e) ->
|
mouseout: (e) ->
|
||||||
$.hide ui.el
|
$.hide ui.el
|
||||||
|
get: (link, id) ->
|
||||||
|
$.get link.href, (-> quotePreview.get2 link, id, this)
|
||||||
|
get2: (link, id, xhr) ->
|
||||||
|
body = $.el 'body',
|
||||||
|
innerHTML: xhr.responseText
|
||||||
|
|
||||||
|
for reply in $$ 'td.reply', body
|
||||||
|
if reply.id == id
|
||||||
|
ui.el.innerHTML = reply.innerHTML
|
||||||
|
break
|
||||||
|
|
||||||
quickReport =
|
quickReport =
|
||||||
init: ->
|
init: ->
|
||||||
@ -1906,6 +1920,13 @@ main =
|
|||||||
#watcher > div:last-child {
|
#watcher > div:last-child {
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#qp {
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
#qp input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
'
|
'
|
||||||
|
|
||||||
main.init()
|
main.init()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user