rm AEOS object ;_;

This commit is contained in:
James Campos 2011-01-15 17:20:34 -08:00
parent c7e57a9cd1
commit b20fadb6af
2 changed files with 79 additions and 86 deletions

View File

@ -31,46 +31,43 @@ config =
'Thread Watcher': [true, 'Bookmark threads'] 'Thread Watcher': [true, 'Bookmark threads']
'Unread Count': [true, 'Show unread post count in tab title'] 'Unread Count': [true, 'Show unread post count in tab title']
#framework #x-browser
AEOS = if typeof GM_deleteValue is 'undefined'
init: -> window.GM_setValue = (name, value) ->
#x-browser value = (typeof value)[0] + value
if typeof GM_deleteValue is 'undefined' localStorage.setItem name, value
window.GM_setValue = (name, value) -> window.GM_getValue = (name, defaultValue) ->
value = (typeof value)[0] + value unless value = localStorage.getItem name
localStorage.setItem name, value return defaultValue
window.GM_getValue = (name, defaultValue) -> type = value[0]
unless value = localStorage.getItem name value = value[1..]
return defaultValue switch type
type = value[0] when 'b'
value = value[1..] value == 'true'
switch type when 'n'
when 'b' Number value
value == 'true' else
when 'n' value
Number value window.GM_addStyle = (css) ->
else style = document.createElement 'style'
value style.type = 'text/css'
window.GM_addStyle = (css) -> style.textContent = css
style = document.createElement 'style' document.getElementsByTagName('head')[0].appendChild style
style.type = 'text/css' window.GM_openInTab = (url) ->
style.textContent = css window.open url, "_blank"
document.getElementsByTagName('head')[0].appendChild style
window.GM_openInTab = (url) ->
window.open url, "_blank"
#dialog styling #dialog styling
GM_addStyle ' GM_addStyle '
div.dialog { div.dialog {
border: 1px solid; border: 1px solid;
} }
div.dialog > div.move { div.dialog > div.move {
cursor: move; cursor: move;
} }
label, a { label, a {
cursor: pointer; cursor: pointer;
} }
' '
class Dialog class Dialog
constructor: (id, position, html) -> constructor: (id, position, html) ->

View File

@ -1,5 +1,5 @@
(function() { (function() {
var $, $$, AEOS, DAY, Dialog, a, addTo, arr, as, autoWatch, autohide, b, board, callback, changeCheckbox, changeText, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, formSubmit, g, getConfig, getThread, getTime, hide, hideReply, hideThread, href, html, i, id, iframe, iframeLoad, imageClick, imageExpandClick, imageFull, imageThumb, imageToggle, img, inAfter, inBefore, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, m, n, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, options, parseResponse, pathname, qrListener, qrText, quickReply, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, thread, threadF, threads, tn, tzOffset, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _, _base, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _m, _ref, _ref2, _ref3, _ref4, _ref5; var $, $$, DAY, Dialog, a, addTo, arr, as, autoWatch, autohide, b, board, callback, changeCheckbox, changeText, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, formSubmit, g, getConfig, getThread, getTime, hide, hideReply, hideThread, href, html, i, id, iframe, iframeLoad, imageClick, imageExpandClick, imageFull, imageThumb, imageToggle, img, inAfter, inBefore, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, m, n, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, options, parseResponse, pathname, qrListener, qrText, quickReply, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, thread, threadF, threads, tn, tzOffset, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _, _base, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _m, _ref, _ref2, _ref3, _ref4, _ref5;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __slice = Array.prototype.slice; var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __slice = Array.prototype.slice;
config = { config = {
'404 Redirect': [true, 'Redirect dead threads'], '404 Redirect': [true, 'Redirect dead threads'],
@ -26,53 +26,49 @@
'Thread Watcher': [true, 'Bookmark threads'], 'Thread Watcher': [true, 'Bookmark threads'],
'Unread Count': [true, 'Show unread post count in tab title'] 'Unread Count': [true, 'Show unread post count in tab title']
}; };
AEOS = { if (typeof GM_deleteValue === 'undefined') {
init: function() { window.GM_setValue = function(name, value) {
if (typeof GM_deleteValue === 'undefined') { value = (typeof value)[0] + value;
window.GM_setValue = function(name, value) { return localStorage.setItem(name, value);
value = (typeof value)[0] + value; };
return localStorage.setItem(name, value); window.GM_getValue = function(name, defaultValue) {
}; var type, value;
window.GM_getValue = function(name, defaultValue) { if (!(value = localStorage.getItem(name))) {
var type, value; return defaultValue;
if (!(value = localStorage.getItem(name))) {
return defaultValue;
}
type = value[0];
value = value.slice(1);
switch (type) {
case 'b':
return value === 'true';
case 'n':
return Number(value);
default:
return value;
}
};
window.GM_addStyle = function(css) {
var style;
style = document.createElement('style');
style.type = 'text/css';
style.textContent = css;
return document.getElementsByTagName('head')[0].appendChild(style);
};
window.GM_openInTab = function(url) {
return window.open(url, "_blank");
};
} }
return GM_addStyle('\ type = value[0];
div.dialog {\ value = value.slice(1);
border: 1px solid;\ switch (type) {
}\ case 'b':
div.dialog > div.move {\ return value === 'true';
cursor: move;\ case 'n':
}\ return Number(value);
label, a {\ default:
cursor: pointer;\ return value;
}\ }
'); };
} window.GM_addStyle = function(css) {
}; var style;
style = document.createElement('style');
style.type = 'text/css';
style.textContent = css;
return document.getElementsByTagName('head')[0].appendChild(style);
};
window.GM_openInTab = function(url) {
return window.open(url, "_blank");
};
}
GM_addStyle('\
div.dialog {\
border: 1px solid;\
}\
div.dialog > div.move {\
cursor: move;\
}\
label, a {\
cursor: pointer;\
}\
');
Dialog = (function() { Dialog = (function() {
function Dialog(id, position, html) { function Dialog(id, position, html) {
this.moveEnd = __bind(this.moveEnd, this);; this.moveEnd = __bind(this.moveEnd, this);;