diff --git a/LICENSE b/LICENSE
index 01d652b3d..d3e5735a6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
/*
-* appchan x - Version 2.8.7 - 2014-01-19
+* appchan x - Version 2.8.7 - 2014-01-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js
index a047ba033..6dc71b936 100644
--- a/builds/appchan-x.user.js
+++ b/builds/appchan-x.user.js
@@ -22,7 +22,7 @@
// ==/UserScript==
/*
-* appchan x - Version 2.8.7 - 2014-01-19
+* appchan x - Version 2.8.7 - 2014-01-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@@ -5515,32 +5515,19 @@
return Get.insert(post, root, context);
},
parseMarkup: function(text) {
- switch (text) {
- case '\n':
- return '
';
- case '[b]':
- return '';
- case '[/b]':
- return '';
- case '[spoiler]':
- return '';
- case '[/spoiler]':
- return '';
- case '[code]':
- return '
';
- case '[/code]':
- return '
';
- case '[moot]':
- return '';
- case '[/moot]':
- return '
';
- case '[banned]':
- return '';
- case '[/banned]':
- return '';
- default:
- return text.replace(':lit', '');
- }
+ return {
+ '\n': '
',
+ '[b]': '',
+ '[/b]': '',
+ '[spoiler]': '',
+ '[/spoiler]': '',
+ '[code]': '',
+ '[/code]': '
',
+ '[moot]': '',
+ '[/moot]': '
',
+ '[banned]': '',
+ '[/banned]': ''
+ }[text] || text.replace(':lit', '');
}
};
@@ -10169,9 +10156,9 @@
return ImageExpand.toggle(Get.postFromNode(this));
},
toggleAll: function() {
- var func;
+ var func, toggle;
$.event('CloseMenu');
- func = function(post) {
+ toggle = function(post) {
var file;
file = post.file;
if (!(file && file.isImage && doc.contains(post.nodes.root))) {
@@ -10193,11 +10180,11 @@
}
return g.posts.forEach(function(post) {
var _i, _len, _ref;
- func(post);
+ toggle(post);
_ref = post.clones;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
post = _ref[_i];
- func(post);
+ toggle(post);
}
});
},
diff --git a/builds/crx/script.js b/builds/crx/script.js
index f26f939c8..21fd01f39 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
-* appchan x - Version 2.8.7 - 2014-01-19
+* appchan x - Version 2.8.7 - 2014-01-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@@ -5525,32 +5525,19 @@
return Get.insert(post, root, context);
},
parseMarkup: function(text) {
- switch (text) {
- case '\n':
- return '
';
- case '[b]':
- return '';
- case '[/b]':
- return '';
- case '[spoiler]':
- return '';
- case '[/spoiler]':
- return '';
- case '[code]':
- return '';
- case '[/code]':
- return '
';
- case '[moot]':
- return '';
- case '[/moot]':
- return '
';
- case '[banned]':
- return '';
- case '[/banned]':
- return '';
- default:
- return text.replace(':lit', '');
- }
+ return {
+ '\n': '
',
+ '[b]': '',
+ '[/b]': '',
+ '[spoiler]': '',
+ '[/spoiler]': '',
+ '[code]': '',
+ '[/code]': '
',
+ '[moot]': '',
+ '[/moot]': '
',
+ '[banned]': '',
+ '[/banned]': ''
+ }[text] || text.replace(':lit', '');
}
};
@@ -10152,9 +10139,9 @@
return ImageExpand.toggle(Get.postFromNode(this));
},
toggleAll: function() {
- var func;
+ var func, toggle;
$.event('CloseMenu');
- func = function(post) {
+ toggle = function(post) {
var file;
file = post.file;
if (!(file && file.isImage && doc.contains(post.nodes.root))) {
@@ -10176,11 +10163,11 @@
}
return g.posts.forEach(function(post) {
var _i, _len, _ref;
- func(post);
+ toggle(post);
_ref = post.clones;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
post = _ref[_i];
- func(post);
+ toggle(post);
}
});
},
diff --git a/src/General/Get.coffee b/src/General/Get.coffee
index 0f41b7f9e..d3676ae15 100755
--- a/src/General/Get.coffee
+++ b/src/General/Get.coffee
@@ -215,28 +215,16 @@ Get =
Main.callbackNodes Post, [post]
Get.insert post, root, context
parseMarkup: (text) ->
- switch text
- when '\n'
- '
'
- when '[b]'
- ''
- when '[/b]'
- ''
- when '[spoiler]'
- ''
- when '[/spoiler]'
- ''
- when '[code]'
- ''
- when '[/code]'
- '
'
- when '[moot]'
- ''
- when '[/moot]'
- '
'
- when '[banned]'
- ''
- when '[/banned]'
- ''
- else
- text.replace ':lit', ''
+ {
+ '\n': '
'
+ '[b]': ''
+ '[/b]': ''
+ '[spoiler]': ''
+ '[/spoiler]': ''
+ '[code]': ''
+ '[/code]': '
'
+ '[moot]': ''
+ '[/moot]': '
'
+ '[banned]': ''
+ '[/banned]': ''
+ }[text] or text.replace ':lit', ''
\ No newline at end of file
diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee
index ce2ebd18c..ed2cd2fa7 100644
--- a/src/Images/ImageExpand.coffee
+++ b/src/Images/ImageExpand.coffee
@@ -33,9 +33,10 @@ ImageExpand =
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
e.preventDefault()
ImageExpand.toggle Get.postFromNode @
+
toggleAll: ->
$.event 'CloseMenu'
- func = (post) ->
+ toggle = (post) ->
{file} = post
return unless file and file.isImage and doc.contains post.nodes.root
if ImageExpand.on and
@@ -43,6 +44,7 @@ ImageExpand =
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
return
$.queueTask func, post
+
if ImageExpand.on = $.hasClass ImageExpand.EAI, 'expand-all-shortcut'
ImageExpand.EAI.className = 'contract-all-shortcut a-icon'
ImageExpand.EAI.title = 'Contract All Images'
@@ -51,10 +53,12 @@ ImageExpand =
ImageExpand.EAI.className = 'expand-all-shortcut a-icon'
ImageExpand.EAI.title = 'Expand All Images'
func = ImageExpand.contract
+
g.posts.forEach (post) ->
- func post
- func post for post in post.clones
+ toggle post
+ toggle post for post in post.clones
return
+
setFitness: ->
(if @checked then $.addClass else $.rmClass) doc, @name.toLowerCase().replace /\s+/g, '-'