Banner.cb.toggle()
Because sometimes you get that one banner you don't want.
This commit is contained in:
parent
dbc8e21297
commit
1451c8691b
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* appchan x - Version 2.2.2 - 2013-08-08
|
* appchan x - Version 2.2.2 - 2013-08-09
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* appchan x - Version 2.2.2 - 2013-08-08
|
* appchan x - Version 2.2.2 - 2013-08-09
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
@ -10629,6 +10629,7 @@
|
|||||||
child = children[i];
|
child = children[i];
|
||||||
if (child.tagName.toLowerCase() === "img") {
|
if (child.tagName.toLowerCase() === "img") {
|
||||||
child.id = "Banner";
|
child.id = "Banner";
|
||||||
|
$.on(child, 'click', Banner.cb.toggle);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (Conf['Custom Board Titles']) {
|
if (Conf['Custom Board Titles']) {
|
||||||
@ -10639,7 +10640,19 @@
|
|||||||
$.add(title, nodes.reverse());
|
$.add(title, nodes.reverse());
|
||||||
$.after(banner, title);
|
$.after(banner, title);
|
||||||
},
|
},
|
||||||
|
types: {
|
||||||
|
jpg: 227,
|
||||||
|
png: 270,
|
||||||
|
gif: 253
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
|
toggle: function() {
|
||||||
|
var num, type;
|
||||||
|
|
||||||
|
type = ['jpg', 'png', 'gif'][Math.floor(3 * Math.random())];
|
||||||
|
num = Math.floor(Banner.types[type] * Math.random());
|
||||||
|
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
|
||||||
|
},
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
return this.contentEditable = true;
|
return this.contentEditable = true;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
/*
|
/*
|
||||||
* appchan x - Version 2.2.2 - 2013-08-08
|
* appchan x - Version 2.2.2 - 2013-08-09
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
@ -10617,6 +10617,7 @@
|
|||||||
child = children[i];
|
child = children[i];
|
||||||
if (child.tagName.toLowerCase() === "img") {
|
if (child.tagName.toLowerCase() === "img") {
|
||||||
child.id = "Banner";
|
child.id = "Banner";
|
||||||
|
$.on(child, 'click', Banner.cb.toggle);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (Conf['Custom Board Titles']) {
|
if (Conf['Custom Board Titles']) {
|
||||||
@ -10627,7 +10628,19 @@
|
|||||||
$.add(title, nodes.reverse());
|
$.add(title, nodes.reverse());
|
||||||
$.after(banner, title);
|
$.after(banner, title);
|
||||||
},
|
},
|
||||||
|
types: {
|
||||||
|
jpg: 227,
|
||||||
|
png: 270,
|
||||||
|
gif: 253
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
|
toggle: function() {
|
||||||
|
var num, type;
|
||||||
|
|
||||||
|
type = ['jpg', 'png', 'gif'][Math.floor(3 * Math.random())];
|
||||||
|
num = Math.floor(Banner.types[type] * Math.random());
|
||||||
|
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
|
||||||
|
},
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
return this.contentEditable = true;
|
return this.contentEditable = true;
|
||||||
|
|||||||
@ -14,6 +14,7 @@ Banner =
|
|||||||
child = children[i]
|
child = children[i]
|
||||||
if child.tagName.toLowerCase() is "img"
|
if child.tagName.toLowerCase() is "img"
|
||||||
child.id = "Banner"
|
child.id = "Banner"
|
||||||
|
$.on child, 'click', Banner.cb.toggle
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if Conf['Custom Board Titles']
|
if Conf['Custom Board Titles']
|
||||||
@ -25,7 +26,17 @@ Banner =
|
|||||||
$.after banner, title
|
$.after banner, title
|
||||||
return
|
return
|
||||||
|
|
||||||
|
types:
|
||||||
|
jpg: 227
|
||||||
|
png: 270
|
||||||
|
gif: 253
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
|
toggle: ->
|
||||||
|
type = ['jpg', 'png', 'gif'][Math.floor 3 * Math.random()]
|
||||||
|
num = Math.floor Banner.types[type] * Math.random()
|
||||||
|
@src = "//static.4chan.org/image/title/#{num}.#{type}"
|
||||||
|
|
||||||
click: (e) ->
|
click: (e) ->
|
||||||
if e.shiftKey
|
if e.shiftKey
|
||||||
@contentEditable = true
|
@contentEditable = true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user