Copy more from Zixaphir and Mayhem, proper(?) fix for Chrome
This commit is contained in:
parent
c9486b00ad
commit
a7b2565e5b
@ -1980,7 +1980,8 @@
|
|||||||
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
|
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
|
||||||
$.addClass(doc, args[0]);
|
$.addClass(doc, args[0]);
|
||||||
$.rmClass(doc, args[1]);
|
$.rmClass(doc, args[1]);
|
||||||
return Header.bar.parentNode.className = args[2];
|
Header.bar.parentNode.className = args[2];
|
||||||
|
return $[args[3]](Header.bar, Header.noticesRoot);
|
||||||
},
|
},
|
||||||
toggleBarPosition: function() {
|
toggleBarPosition: function() {
|
||||||
$.cb.checked.call(this);
|
$.cb.checked.call(this);
|
||||||
@ -5486,15 +5487,10 @@
|
|||||||
return QR.status();
|
return QR.status();
|
||||||
},
|
},
|
||||||
focusin: function() {
|
focusin: function() {
|
||||||
return $.addClass(QR.nodes.el, 'has-focus');
|
return $.addClass(QR.nodes.el, 'focus');
|
||||||
},
|
},
|
||||||
focusout: function() {
|
focusout: function() {
|
||||||
return $.queueTask(function() {
|
return $.rmClass(QR.nodes.el, 'focus');
|
||||||
if ($.x('ancestor::div[@id="qr"]', d.activeElement)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return $.rmClass(QR.nodes.el, 'has-focus');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
d.activeElement.blur();
|
d.activeElement.blur();
|
||||||
@ -5823,8 +5819,6 @@
|
|||||||
$.on(elm, 'blur', QR.focusout);
|
$.on(elm, 'blur', QR.focusout);
|
||||||
$.on(elm, 'focus', QR.focusin);
|
$.on(elm, 'focus', QR.focusin);
|
||||||
}
|
}
|
||||||
$.on(dialog, 'focusin', QR.focusin);
|
|
||||||
$.on(dialog, 'focusout', QR.focusout);
|
|
||||||
$.on(nodes.autohide, 'change', QR.toggleHide);
|
$.on(nodes.autohide, 'change', QR.toggleHide);
|
||||||
$.on(nodes.close, 'click', QR.close);
|
$.on(nodes.close, 'click', QR.close);
|
||||||
$.on(nodes.dumpButton, 'click', function() {
|
$.on(nodes.dumpButton, 'click', function() {
|
||||||
@ -6139,12 +6133,6 @@
|
|||||||
input: input
|
input: input
|
||||||
};
|
};
|
||||||
$.on(input, 'focus', this.setup);
|
$.on(input, 'focus', this.setup);
|
||||||
$.on(input, 'focus', function() {
|
|
||||||
return $.addClass(QR.nodes.el, 'focus');
|
|
||||||
});
|
|
||||||
$.on(input, 'blur', function() {
|
|
||||||
return $.rmClass(QR.nodes.el, 'focus');
|
|
||||||
});
|
|
||||||
$.on(input, 'blur', QR.focusout);
|
$.on(input, 'blur', QR.focusout);
|
||||||
$.on(input, 'focus', QR.focusin);
|
$.on(input, 'focus', QR.focusin);
|
||||||
$.addClass(QR.nodes.el, 'has-captcha');
|
$.addClass(QR.nodes.el, 'has-captcha');
|
||||||
|
|||||||
BIN
builds/crx 1/icon128.png
Normal file
BIN
builds/crx 1/icon128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 196 B |
BIN
builds/crx 1/icon16.png
Normal file
BIN
builds/crx 1/icon16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 157 B |
BIN
builds/crx 1/icon48.png
Normal file
BIN
builds/crx 1/icon48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 204 B |
22
builds/crx 1/manifest.json
Normal file
22
builds/crx 1/manifest.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "4chan X",
|
||||||
|
"version": "1.3.4",
|
||||||
|
"manifest_version": 2,
|
||||||
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
|
"icons": {
|
||||||
|
"16": "icon16.png",
|
||||||
|
"48": "icon48.png",
|
||||||
|
"128": "icon128.png"
|
||||||
|
},
|
||||||
|
"content_scripts": [{
|
||||||
|
"js": ["script.js"],
|
||||||
|
"matches": ["*://boards.4chan.org/*","*://sys.4chan.org/*","*://a.4cdn.org/*","*://i.4cdn.org/*"],
|
||||||
|
"all_frames": true,
|
||||||
|
"run_at": "document_start"
|
||||||
|
}],
|
||||||
|
"homepage_url": "http://seaweedchan.github.io/4chan-x/",
|
||||||
|
"minimum_chrome_version": "31",
|
||||||
|
"permissions": [
|
||||||
|
"storage"
|
||||||
|
]
|
||||||
|
}
|
||||||
12724
builds/crx 1/script.js
Normal file
12724
builds/crx 1/script.js
Normal file
File diff suppressed because one or more lines are too long
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
@ -1990,7 +1990,8 @@
|
|||||||
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
|
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
|
||||||
$.addClass(doc, args[0]);
|
$.addClass(doc, args[0]);
|
||||||
$.rmClass(doc, args[1]);
|
$.rmClass(doc, args[1]);
|
||||||
return Header.bar.parentNode.className = args[2];
|
Header.bar.parentNode.className = args[2];
|
||||||
|
return $[args[3]](Header.bar, Header.noticesRoot);
|
||||||
},
|
},
|
||||||
toggleBarPosition: function() {
|
toggleBarPosition: function() {
|
||||||
$.cb.checked.call(this);
|
$.cb.checked.call(this);
|
||||||
@ -5490,10 +5491,10 @@
|
|||||||
return QR.status();
|
return QR.status();
|
||||||
},
|
},
|
||||||
focusin: function() {
|
focusin: function() {
|
||||||
return $.addClass(QR.nodes.el, 'has-focus');
|
return $.addClass(QR.nodes.el, 'focus');
|
||||||
},
|
},
|
||||||
focusout: function() {
|
focusout: function() {
|
||||||
return $.rmClass(QR.nodes.el, 'has-focus');
|
return $.rmClass(QR.nodes.el, 'focus');
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
d.activeElement.blur();
|
d.activeElement.blur();
|
||||||
@ -5760,7 +5761,7 @@
|
|||||||
return list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
|
return list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
|
||||||
},
|
},
|
||||||
dialog: function() {
|
dialog: function() {
|
||||||
var check, dialog, event, flagSelector, i, items, key, mimeTypes, name, node, nodes, save, value, _ref;
|
var check, dialog, elm, event, flagSelector, i, items, key, mimeTypes, name, node, nodes, save, value, _ref;
|
||||||
QR.nodes = nodes = {
|
QR.nodes = nodes = {
|
||||||
el: dialog = UI.dialog('qr', 'top:0;right:0;', "<div class=move><label><input type=checkbox id=autohide title=Auto-hide>Quick Reply</label><a href=javascript:; class=close title=Close>×</a><select data-name=thread title='Create a new thread / Reply'><option value=new>New thread</option></select></div><form><div class=persona><input name=name data-name=name list=\"list-name\" placeholder=Name class=field size=1 tabindex=10><input name=email data-name=email list=\"list-email\" placeholder=E-mail class=field size=1 tabindex=20><input name=sub data-name=sub list=\"list-sub\" placeholder=Subject class=field size=1 tabindex=30> </div><div class=textarea><textarea data-name=com placeholder=Comment class=field tabindex=40></textarea><span id=char-count></span></div><div id=dump-list-container><div id=dump-list></div><a id=add-post href=javascript:; title=\"Add a post\" tabindex=50>+</a></div><div id=file-n-submit><span id=qr-filename-container class=field tabindex=60><span id=qr-no-file>No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><span id=qr-extras-container><a id=qr-filerm href=javascript:; title='Remove file'>×</a><a id=dump-button title='Dump list'>+</a></span></span><label id=qr-spoiler-label><input type=checkbox id=qr-file-spoiler title='Spoiler image' tabindex=70></label><input type=submit tabindex=80></div><input type=file multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> ")
|
el: dialog = UI.dialog('qr', 'top:0;right:0;', "<div class=move><label><input type=checkbox id=autohide title=Auto-hide>Quick Reply</label><a href=javascript:; class=close title=Close>×</a><select data-name=thread title='Create a new thread / Reply'><option value=new>New thread</option></select></div><form><div class=persona><input name=name data-name=name list=\"list-name\" placeholder=Name class=field size=1 tabindex=10><input name=email data-name=email list=\"list-email\" placeholder=E-mail class=field size=1 tabindex=20><input name=sub data-name=sub list=\"list-sub\" placeholder=Subject class=field size=1 tabindex=30> </div><div class=textarea><textarea data-name=com placeholder=Comment class=field tabindex=40></textarea><span id=char-count></span></div><div id=dump-list-container><div id=dump-list></div><a id=add-post href=javascript:; title=\"Add a post\" tabindex=50>+</a></div><div id=file-n-submit><span id=qr-filename-container class=field tabindex=60><span id=qr-no-file>No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><span id=qr-extras-container><a id=qr-filerm href=javascript:; title='Remove file'>×</a><a id=dump-button title='Dump list'>+</a></span></span><label id=qr-spoiler-label><input type=checkbox id=qr-file-spoiler title='Spoiler image' tabindex=70></label><input type=submit tabindex=80></div><input type=file multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> ")
|
||||||
};
|
};
|
||||||
@ -5825,8 +5826,12 @@
|
|||||||
$.add(nodes.form, nodes.flag);
|
$.add(nodes.form, nodes.flag);
|
||||||
}
|
}
|
||||||
$.on(nodes.filename.parentNode, 'click keydown', QR.openFileInput);
|
$.on(nodes.filename.parentNode, 'click keydown', QR.openFileInput);
|
||||||
$.on(dialog, 'focusin', QR.focusin);
|
items = $$('*', QR.nodes.el);
|
||||||
$.on(dialog, 'focusout', QR.focusout);
|
i = 0;
|
||||||
|
while (elm = items[i++]) {
|
||||||
|
$.on(elm, 'blur', QR.focusout);
|
||||||
|
$.on(elm, 'focus', QR.focusin);
|
||||||
|
}
|
||||||
$.on(nodes.autohide, 'change', QR.toggleHide);
|
$.on(nodes.autohide, 'change', QR.toggleHide);
|
||||||
$.on(nodes.close, 'click', QR.close);
|
$.on(nodes.close, 'click', QR.close);
|
||||||
$.on(nodes.dumpButton, 'click', function() {
|
$.on(nodes.dumpButton, 'click', function() {
|
||||||
@ -6130,12 +6135,8 @@
|
|||||||
input: input
|
input: input
|
||||||
};
|
};
|
||||||
$.on(input, 'focus', this.setup);
|
$.on(input, 'focus', this.setup);
|
||||||
$.on(input, 'focus', function() {
|
$.on(input, 'blur', QR.focusout);
|
||||||
return $.addClass(QR.nodes.el, 'focus');
|
$.on(input, 'focus', QR.focusin);
|
||||||
});
|
|
||||||
$.on(input, 'blur', function() {
|
|
||||||
return $.rmClass(QR.nodes.el, 'focus');
|
|
||||||
});
|
|
||||||
$.addClass(QR.nodes.el, 'has-captcha');
|
$.addClass(QR.nodes.el, 'has-captcha');
|
||||||
$.after(QR.nodes.com.parentNode, [imgContainer, input]);
|
$.after(QR.nodes.com.parentNode, [imgContainer, input]);
|
||||||
this.setupObserver = new MutationObserver(this.afterSetup);
|
this.setupObserver = new MutationObserver(this.afterSetup);
|
||||||
|
|||||||
@ -330,7 +330,7 @@ Header =
|
|||||||
$.addClass doc, args[0]
|
$.addClass doc, args[0]
|
||||||
$.rmClass doc, args[1]
|
$.rmClass doc, args[1]
|
||||||
Header.bar.parentNode.className = args[2]
|
Header.bar.parentNode.className = args[2]
|
||||||
#$[args[3]] Header.bar, Header.notify ##Fix chrome?
|
$[args[3]] Header.bar, Header.noticesRoot
|
||||||
|
|
||||||
toggleBarPosition: ->
|
toggleBarPosition: ->
|
||||||
$.cb.checked.call @
|
$.cb.checked.call @
|
||||||
|
|||||||
@ -21,14 +21,9 @@ QR.captcha =
|
|||||||
input: input
|
input: input
|
||||||
|
|
||||||
$.on input, 'focus', @setup
|
$.on input, 'focus', @setup
|
||||||
$.on input, 'focus', -> $.addClass QR.nodes.el, 'focus'
|
|
||||||
$.on input, 'blur', -> $.rmClass QR.nodes.el, 'focus'
|
|
||||||
|
|
||||||
<% if (type === 'userscript') { %>
|
|
||||||
# XXX Firefox lacks focusin/focusout support.
|
|
||||||
$.on input, 'blur', QR.focusout
|
$.on input, 'blur', QR.focusout
|
||||||
$.on input, 'focus', QR.focusin
|
$.on input, 'focus', QR.focusin
|
||||||
<% } %>
|
|
||||||
|
|
||||||
$.addClass QR.nodes.el, 'has-captcha'
|
$.addClass QR.nodes.el, 'has-captcha'
|
||||||
$.after QR.nodes.com.parentNode, [imgContainer, input]
|
$.after QR.nodes.com.parentNode, [imgContainer, input]
|
||||||
|
|||||||
@ -114,15 +114,9 @@ QR =
|
|||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.status()
|
QR.status()
|
||||||
focusin: ->
|
focusin: ->
|
||||||
$.addClass QR.nodes.el, 'has-focus'
|
$.addClass QR.nodes.el, 'focus'
|
||||||
focusout: ->
|
focusout: ->
|
||||||
<% if (type === 'crx') { %>
|
$.rmClass QR.nodes.el, 'focus'
|
||||||
$.rmClass QR.nodes.el, 'has-focus'
|
|
||||||
<% } else { %>
|
|
||||||
$.queueTask ->
|
|
||||||
return if $.x 'ancestor::div[@id="qr"]', d.activeElement
|
|
||||||
$.rmClass QR.nodes.el, 'has-focus'
|
|
||||||
<% } %>
|
|
||||||
hide: ->
|
hide: ->
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
$.addClass QR.nodes.el, 'autohide'
|
$.addClass QR.nodes.el, 'autohide'
|
||||||
@ -409,16 +403,11 @@ QR =
|
|||||||
|
|
||||||
$.on nodes.filename.parentNode, 'click keydown', QR.openFileInput
|
$.on nodes.filename.parentNode, 'click keydown', QR.openFileInput
|
||||||
|
|
||||||
<% if (type === 'userscript') { %>
|
|
||||||
# XXX Firefox lacks focusin/focusout support.
|
|
||||||
items = $$ '*', QR.nodes.el
|
items = $$ '*', QR.nodes.el
|
||||||
i = 0
|
i = 0
|
||||||
while elm = items[i++]
|
while elm = items[i++]
|
||||||
$.on elm, 'blur', QR.focusout
|
$.on elm, 'blur', QR.focusout
|
||||||
$.on elm, 'focus', QR.focusin
|
$.on elm, 'focus', QR.focusin
|
||||||
<% } %>
|
|
||||||
$.on dialog, 'focusin', QR.focusin
|
|
||||||
$.on dialog, 'focusout', QR.focusout
|
|
||||||
|
|
||||||
$.on nodes.autohide, 'change', QR.toggleHide
|
$.on nodes.autohide, 'change', QR.toggleHide
|
||||||
$.on nodes.close, 'click', QR.close
|
$.on nodes.close, 'click', QR.close
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user