Small simplification

This commit is contained in:
Zixaphir 2013-07-03 02:01:41 -07:00
parent 0935d1c297
commit 5ab152ee34
5 changed files with 19 additions and 46 deletions

View File

@ -1,5 +1,5 @@
/*
* appchan x - Version 2.1.3 - 2013-06-21
* appchan x - Version 2.1.3 - 2013-07-03
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE

View File

@ -18,7 +18,7 @@
// ==/UserScript==
/*
* appchan x - Version 2.1.3 - 2013-06-21
* appchan x - Version 2.1.3 - 2013-07-03
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -11378,19 +11378,11 @@
cat = _ref[title];
for (name in cat) {
setting = cat[name];
if (setting[2]) {
if (setting[2] === 'text') {
continue;
}
hyphenated = ("" + name + " " + Conf[name]).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
} else {
if (!Conf[name]) {
continue;
}
hyphenated = ("" + name).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
if (!Conf[name] || setting[2] === 'text') {
continue;
}
hyphenated = ("" + name + (setting[2] ? " " + Conf[name] : "")).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
}
}
MascotTools.init();

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
* appchan x - Version 2.1.3 - 2013-06-21
* appchan x - Version 2.1.3 - 2013-07-03
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -11367,19 +11367,11 @@
cat = _ref[title];
for (name in cat) {
setting = cat[name];
if (setting[2]) {
if (setting[2] === 'text') {
continue;
}
hyphenated = ("" + name + " " + Conf[name]).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
} else {
if (!Conf[name]) {
continue;
}
hyphenated = ("" + name).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
if (!Conf[name] || setting[2] === 'text') {
continue;
}
hyphenated = ("" + name + (setting[2] ? " " + Conf[name] : "")).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
$.addClass(doc, hyphenated);
}
}
MascotTools.init();

View File

@ -1,9 +1,3 @@
<% if (type === 'userjs') { %>
# Opera doesn't support the @match metadata key,
# return 4chan X here if we're not on 4chan.
return unless /^[a-z]+\.4chan\.org$/.test location.hostname
<% } %>
editTheme = {} # Currently editted theme.
editMascot = {} # Which mascot we're editting.
userNavigation = {} # ...

View File

@ -20,14 +20,9 @@ Style =
for title, cat of Config.style
for name, setting of cat
if setting[2]
continue if setting[2] is 'text'
hyphenated = "#{name} #{Conf[name]}".toLowerCase().replace(/^4/, 'four').replace /\s+/g, '-'
$.addClass doc, hyphenated
else
continue unless Conf[name]
hyphenated = "#{name}".toLowerCase().replace(/^4/, 'four').replace /\s+/g, '-'
$.addClass doc, hyphenated
continue if !Conf[name] or setting[2] is 'text'
hyphenated = "#{name}#{if setting[2] then " #{Conf[name]}" else ""}".toLowerCase().replace(/^4/, 'four').replace /\s+/g, '-'
$.addClass doc, hyphenated
MascotTools.init()