From 8490850939252707e4cd2e11078cb6ce680f54c2 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 20 Jun 2013 19:31:34 -0700 Subject: [PATCH] Add an option to click current mascot to switch between mascots. --- builds/appchan-x.user.js | 5 ++++- builds/crx/script.js | 5 ++++- src/General/Config.coffee | 4 ++++ src/Theming/Mascots.coffee | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 920da5c81..d8ab7545c 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -287,6 +287,7 @@ }, Mascots: { 'Mascots': [true, 'Add a pretty picture of your waifu to Appchan.'], + 'Click to Toggle': [true, 'Click your current mascot to switch between your enabled mascots.'], 'Mascot Location': ['sidebar', 'Change where your mascot is located.', ['sidebar', 'opposite']], 'Mascot Position': ['default', 'Change where your mascot is placed in relation to the post form.', ['above post form', 'default', 'bottom', 'middle']], 'Mascots Overlap Posts': [true, 'Mascots overlap threads and posts.'], @@ -10927,7 +10928,9 @@ id: "mascot", innerHTML: "" }); - $.on(this.el, 'mousedown', MascotTools.click); + if (Conf['Click to Toggle']) { + $.on(this.el, 'mousedown', MascotTools.click); + } $.asap((function() { return d.body; }), function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index 4870c9925..efbb483e8 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -268,6 +268,7 @@ }, Mascots: { 'Mascots': [true, 'Add a pretty picture of your waifu to Appchan.'], + 'Click to Toggle': [true, 'Click your current mascot to switch between your enabled mascots.'], 'Mascot Location': ['sidebar', 'Change where your mascot is located.', ['sidebar', 'opposite']], 'Mascot Position': ['default', 'Change where your mascot is placed in relation to the post form.', ['above post form', 'default', 'bottom', 'middle']], 'Mascots Overlap Posts': [true, 'Mascots overlap threads and posts.'], @@ -10915,7 +10916,9 @@ id: "mascot", innerHTML: "" }); - $.on(this.el, 'mousedown', MascotTools.click); + if (Conf['Click to Toggle']) { + $.on(this.el, 'mousedown', MascotTools.click); + } $.asap((function() { return d.body; }), function() { diff --git a/src/General/Config.coffee b/src/General/Config.coffee index aef2fdf3b..1b2b90f63 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -609,6 +609,10 @@ Config = true 'Add a pretty picture of your waifu to Appchan.' ] + 'Click to Toggle': [ + true + 'Click your current mascot to switch between your enabled mascots.' + ] 'Mascot Location': [ 'sidebar' 'Change where your mascot is located.' diff --git a/src/Theming/Mascots.coffee b/src/Theming/Mascots.coffee index 0a6acfc67..b97f1eb62 100644 --- a/src/Theming/Mascots.coffee +++ b/src/Theming/Mascots.coffee @@ -11,7 +11,8 @@ MascotTools = id: "mascot" innerHTML: "" - $.on @el, 'mousedown', MascotTools.click + if Conf['Click to Toggle'] + $.on @el, 'mousedown', MascotTools.click $.asap (-> d.body), => $.add d.body, @el