From 57f7d899ec69bba67971c48f0d0d5654ece51593 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Mon, 16 Dec 2013 18:36:09 -0700 Subject: [PATCH] Some last FappeTyme/WerkTyme tweaks --- builds/appchan-x.user.js | 7 ++----- builds/crx/script.js | 7 ++----- src/Images/FappeTyme.coffee | 8 +++----- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 74afcc26d..29ea0a8ce 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -9795,7 +9795,7 @@ continue; } lc = type.toLowerCase(); - el = $.el('a', { + FappeTyme[lc] = el = $.el('a', { href: 'javascript:;', id: "" + lc + "Tyme", title: "" + type + " Tyme", @@ -9809,9 +9809,7 @@ name: "" + lc })); Header.addShortcut(el, true); - if (Conf[lc]) { - FappeTyme.cb.set(lc); - } + FappeTyme.cb.set(lc); } return Post.callbacks.push({ name: 'Fappe Tyme', @@ -9826,7 +9824,6 @@ }, cb: { set: function(type) { - FappeTyme[type].checked = Conf[type]; return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme"); }, toggle: function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index b163fccda..2f88e1b8d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9781,7 +9781,7 @@ continue; } lc = type.toLowerCase(); - el = $.el('a', { + FappeTyme[lc] = el = $.el('a', { href: 'javascript:;', id: "" + lc + "Tyme", title: "" + type + " Tyme", @@ -9795,9 +9795,7 @@ name: "" + lc })); Header.addShortcut(el, true); - if (Conf[lc]) { - FappeTyme.cb.set(lc); - } + FappeTyme.cb.set(lc); } return Post.callbacks.push({ name: 'Fappe Tyme', @@ -9812,7 +9810,6 @@ }, cb: { set: function(type) { - FappeTyme[type].checked = Conf[type]; return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme"); }, toggle: function() { diff --git a/src/Images/FappeTyme.coffee b/src/Images/FappeTyme.coffee index d351d4606..e91652f59 100755 --- a/src/Images/FappeTyme.coffee +++ b/src/Images/FappeTyme.coffee @@ -4,7 +4,7 @@ FappeTyme = for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"] lc = type.toLowerCase() - el = $.el 'a', + FappeTyme[lc] = el = $.el 'a', href: 'javascript:;' id: "#{lc}Tyme" title: "#{type} Tyme" @@ -16,7 +16,7 @@ FappeTyme = $.on el, 'click', FappeTyme.cb.toggle.bind {name: "#{lc}"} Header.addShortcut el, true - FappeTyme.cb.set lc if Conf[lc] + FappeTyme.cb.set lc Post.callbacks.push name: 'Fappe Tyme' @@ -27,9 +27,7 @@ FappeTyme = $.addClass @nodes.root, "noFile" cb: - set: (type) -> - FappeTyme[type].checked = Conf[type] - $["#{if Conf[type] then 'add' else 'rm'}Class"] doc, "#{type}Tyme" + set: (type) -> $["#{if Conf[type] then 'add' else 'rm'}Class"] doc, "#{type}Tyme" toggle: -> Conf[@name] = !Conf[@name]