error out at start if no #navtopr

attempt to add options to #navtopr at start, erroring out on failure.
do this so we don't add the thread watcher and waste time in general.
This commit is contained in:
James Campos 2010-06-12 18:41:40 -07:00
parent 9610c0f6f0
commit b4a6c8b35e
2 changed files with 19 additions and 17 deletions

View File

@ -654,6 +654,15 @@ replyNav: ->
window.location: "#$op"
#error out if there's no #navtopr.
text: $('#navtopr a').nextSibling
a: tag('a')
a.textContent: 'X'
a.className: 'pointer'
a.addEventListener('click', options, true)
inBefore(text, document.createTextNode(' / '))
inBefore(text, a)
if getValue('Reply Hiding')
callbacks.push((root) ->
tds: $$('td.doubledash', root)
@ -820,14 +829,6 @@ if not REPLY
for a in as
a.addEventListener('click', expandComment, true)
a: tag('a')
a.textContent: 'X'
a.className: 'pointer'
a.addEventListener('click', options, true)
text: $('#navtopr a').nextSibling
inBefore(text, document.createTextNode(' / '))
inBefore(text, a)
for callback in callbacks
callback()
document.body.addEventListener('DOMNodeInserted', nodeInserted, true)

View File

@ -742,8 +742,16 @@ cursor: pointer; \
return window.location;
}
};
//error out if there's no #navtopr.
text = $('#navtopr a').nextSibling;
a = tag('a');
a.textContent = 'X';
a.className = 'pointer';
a.addEventListener('click', options, true);
inBefore(text, document.createTextNode(' / '));
inBefore(text, a);
getValue('Reply Hiding') ? callbacks.push(function(root) {
var _c, _d, _e, _f, _g, _h, _i, _j, a, next, obj, td, tds;
var _c, _d, _e, _f, _g, _h, _i, _j, next, obj, td, tds;
tds = $$('td.doubledash', root);
_c = []; _e = tds;
for (_d = 0, _f = _e.length; _d < _f; _d++) {
@ -784,7 +792,7 @@ cursor: pointer; \
});
}
getValue('Quick Report') ? callbacks.push(function(root) {
var _c, _d, _e, _f, a, arr, el;
var _c, _d, _e, _f, arr, el;
arr = $$('span[id^=no]', root);
_c = []; _e = arr;
for (_d = 0, _f = _e.length; _d < _f; _d++) {
@ -944,13 +952,6 @@ cursor: pointer; \
}
}
}
a = tag('a');
a.textContent = 'X';
a.className = 'pointer';
a.addEventListener('click', options, true);
text = $('#navtopr a').nextSibling;
inBefore(text, document.createTextNode(' / '));
inBefore(text, a);
_s = callbacks;
for (_r = 0, _t = _s.length; _r < _t; _r++) {
callback = _s[_r];