fix x-browser code
This commit is contained in:
parent
5551cdbcc3
commit
82ae41298c
@ -23,10 +23,10 @@ AEOS =
|
||||
init: ->
|
||||
#x-browser
|
||||
if typeof GM_deleteValue == 'undefined'
|
||||
this.GM_setValue = (name, value) ->
|
||||
window.GM_setValue = (name, value) ->
|
||||
value = (typeof value)[0] + value
|
||||
localStorage.setItem name, value
|
||||
this.GM_getValue = (name, defaultValue) ->
|
||||
window.GM_getValue = (name, defaultValue) ->
|
||||
if not value = localStorage.getItem name
|
||||
return defaultValue
|
||||
type = value[0]
|
||||
@ -38,11 +38,11 @@ AEOS =
|
||||
return Number value
|
||||
else
|
||||
return value
|
||||
this.GM_addStyle = (css) ->
|
||||
window.GM_addStyle = (css) ->
|
||||
style = document.createElement 'style'
|
||||
style.type = 'text/css'
|
||||
style.textContent = css
|
||||
$('head', document).appendChild(style)
|
||||
document.getElementsByTagName('head')[0].appendChild style
|
||||
|
||||
#dialog styling
|
||||
GM_addStyle '
|
||||
@ -122,6 +122,7 @@ AEOS =
|
||||
GM_setValue "#{id}Left", div.style.left
|
||||
GM_setValue "#{id}Top", div.style.top
|
||||
|
||||
AEOS.init()
|
||||
d = document
|
||||
#utility funks
|
||||
$ = (selector, root) ->
|
||||
|
||||
@ -19,11 +19,11 @@
|
||||
AEOS = {
|
||||
init: function() {
|
||||
if (typeof GM_deleteValue === 'undefined') {
|
||||
this.GM_setValue = function(name, value) {
|
||||
window.GM_setValue = function(name, value) {
|
||||
value = (typeof value)[0] + value;
|
||||
return localStorage.setItem(name, value);
|
||||
};
|
||||
this.GM_getValue = function(name, defaultValue) {
|
||||
window.GM_getValue = function(name, defaultValue) {
|
||||
var type, value;
|
||||
if (!(value = localStorage.getItem(name))) {
|
||||
return defaultValue;
|
||||
@ -39,12 +39,12 @@
|
||||
return value;
|
||||
}
|
||||
};
|
||||
this.GM_addStyle = function(css) {
|
||||
window.GM_addStyle = function(css) {
|
||||
var style;
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.textContent = css;
|
||||
return $('head', document).appendChild(style);
|
||||
return document.getElementsByTagName('head')[0].appendChild(style);
|
||||
};
|
||||
}
|
||||
return GM_addStyle('\
|
||||
@ -137,6 +137,7 @@
|
||||
return GM_setValue("" + (id) + "Top", div.style.top);
|
||||
}
|
||||
};
|
||||
AEOS.init();
|
||||
d = document;
|
||||
$ = function(selector, root) {
|
||||
root || (root = d.body);
|
||||
|
||||
2
readme
2
readme
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan x
|
||||
// @namespace aeosynth
|
||||
// @description Adds various features; replaces the extension / fychan.
|
||||
// @description Adds various features.
|
||||
// @version 1.4.3
|
||||
// @copyright 2009, 2010 James Campos
|
||||
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user