diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2dfa4ea56..25351beb5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,7 +45,6 @@
* The QR will now warn you when you are running low on cached captchas while auto-posting.
**seaweedchan**:
-<<<<<<< HEAD
- Gallery Bugfix: hide thumbnails
**Zixaphir**:
@@ -76,12 +75,6 @@
*2013-08-21*
**Zixaphir**:
-=======
- - Visual overhaul for gallery mode
-
-**Zixaphir**:
- - Fix an issue with the file dialog randomly opening multiple times (with seaweedchan)
->>>>>>> v3

- **New Feature**: `Gallery`.
* Disabled by default.
diff --git a/LICENSE b/LICENSE
index 6868e0c5a..ef1b94605 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
/*
-* appchan x - Version 2.4.1 - 2013-10-14
+* appchan x - Version 2.4.1 - 2013-10-16
*
* 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 12e2b6a53..6c7c4a478 100644
--- a/builds/appchan-x.user.js
+++ b/builds/appchan-x.user.js
@@ -20,7 +20,7 @@
// ==/UserScript==
/*
-* appchan x - Version 2.4.1 - 2013-10-14
+* appchan x - Version 2.4.1 - 2013-10-16
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@@ -7097,11 +7097,56 @@
},
MediaCrush: {
regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i,
- style: 'border: 0; width: 640px; height: 480px; resize: both;',
+ style: 'border: 0;',
el: function(a) {
- return $.el('iframe', {
- src: "https://mediacru.sh/" + a.dataset.uid
+ var el;
+
+ el = $.el('div');
+ $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
+ var embed, file, files, status, type, _i, _j, _len, _len1, _ref;
+
+ status = this.status;
+ if (![200, 304].contains(status)) {
+ return div.innerHTML = "ERROR " + status;
+ }
+ files = JSON.parse(this.response).files;
+ _ref = ['video/mp4', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'image/svg', 'audio/mpeg'];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ type = _ref[_i];
+ for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
+ file = files[_j];
+ if (file.type === type) {
+ embed = file;
+ break;
+ }
+ }
+ if (embed) {
+ break;
+ }
+ }
+ if (!embed) {
+ return div.innerHTML = "ERROR: Not a valid filetype";
+ }
+ return el.innerHTML = (function() {
+ switch (embed.type) {
+ case 'video/mp4':
+ case 'video/ogv':
+ return "";
+ case 'image/png':
+ case 'image/gif':
+ case 'image/jpeg':
+ return "
";
+ case 'image/svg':
+ case 'image/svg+xml':
+ return "";
+ case 'audio/mpeg':
+ return "";
+ default:
+ return "ERROR: No valid filetype.";
+ }
+ })();
});
+ return el;
}
},
pastebin: {
@@ -13237,57 +13282,6 @@
}
};
- IDColor = {
- init: function() {
- if (g.VIEW === 'catalog' || !Conf['Color User IDs']) {
- return;
- }
- this.ids = {};
- return Post.callbacks.push({
- name: 'Color User IDs',
- cb: this.node
- });
- },
- node: function() {
- var rgb, span, style, uid;
-
- if (this.isClone || !(uid = this.info.uniqueID)) {
- return;
- }
- span = $('.hand', this.nodes.uniqueID);
- if (!(span && span.nodeName === 'SPAN')) {
- return;
- }
- rgb = IDColor.compute(uid);
- style = span.style;
- style.color = rgb[3];
- style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
- $.addClass(span, 'painted');
- return span.title = 'Highlight posts by this ID';
- },
- compute: function(uid) {
- var hash, rgb;
-
- if (IDColor.ids[uid]) {
- return IDColor.ids[uid];
- }
- hash = IDColor.hash(uid);
- rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb[3] = (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff';
- return this.ids[uid] = rgb;
- },
- hash: function(uid) {
- var i, msg;
-
- msg = 0;
- i = 0;
- while (i < 8) {
- msg = (msg << 5) - msg + uid.charCodeAt(i++);
- }
- return msg;
- }
- };
-
CustomCSS = {
init: function() {
if (!Conf['Custom CSS']) {
@@ -13761,32 +13755,35 @@
if (this.isClone || !(uid = this.info.uniqueID)) {
return;
}
+ span = $('.hand', this.nodes.uniqueID);
+ if (!(span && span.nodeName === 'SPAN')) {
+ return;
+ }
rgb = IDColor.compute(uid);
- span = this.nodes.uniqueID;
style = span.style;
style.color = rgb[3];
style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
$.addClass(span, 'painted');
- span.textContent = uid;
return span.title = 'Highlight posts by this ID';
},
- compute: function(uniqueID) {
+ compute: function(uid) {
var hash, rgb;
- if (uniqueID in IDColor.ids) {
- return IDColor.ids[uniqueID];
+ if (IDColor.ids[uid]) {
+ return IDColor.ids[uid];
}
- hash = this.hash(uniqueID);
+ hash = IDColor.hash(uid);
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 170 ? 'black' : 'white');
- return this.ids[uniqueID] = rgb;
+ rgb[3] = (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff';
+ return this.ids[uid] = rgb;
},
- hash: function(uniqueID) {
- var i, msg, _i, _ref;
+ hash: function(uid) {
+ var i, msg;
msg = 0;
- for (i = _i = 0, _ref = uniqueID.length; _i < _ref; i = _i += 1) {
- msg = (msg << 5) - msg + uniqueID.charCodeAt(i);
+ i = 0;
+ while (i < 8) {
+ msg = (msg << 5) - msg + uid.charCodeAt(i++);
}
return msg;
}
diff --git a/builds/crx/script.js b/builds/crx/script.js
index 87551b167..7b862ed52 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
-* appchan x - Version 2.4.1 - 2013-10-14
+* appchan x - Version 2.4.1 - 2013-10-16
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@@ -7107,11 +7107,56 @@
},
MediaCrush: {
regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i,
- style: 'border: 0; width: 640px; height: 480px; resize: both;',
+ style: 'border: 0;',
el: function(a) {
- return $.el('iframe', {
- src: "https://mediacru.sh/" + a.dataset.uid
+ var el;
+
+ el = $.el('div');
+ $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
+ var embed, file, files, status, type, _i, _j, _len, _len1, _ref;
+
+ status = this.status;
+ if (![200, 304].contains(status)) {
+ return div.innerHTML = "ERROR " + status;
+ }
+ files = JSON.parse(this.response).files;
+ _ref = ['video/mp4', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'image/svg', 'audio/mpeg'];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ type = _ref[_i];
+ for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
+ file = files[_j];
+ if (file.type === type) {
+ embed = file;
+ break;
+ }
+ }
+ if (embed) {
+ break;
+ }
+ }
+ if (!embed) {
+ return div.innerHTML = "ERROR: Not a valid filetype";
+ }
+ return el.innerHTML = (function() {
+ switch (embed.type) {
+ case 'video/mp4':
+ case 'video/ogv':
+ return "";
+ case 'image/png':
+ case 'image/gif':
+ case 'image/jpeg':
+ return "
";
+ case 'image/svg':
+ case 'image/svg+xml':
+ return "";
+ case 'audio/mpeg':
+ return "";
+ default:
+ return "ERROR: No valid filetype.";
+ }
+ })();
});
+ return el;
}
},
pastebin: {
@@ -13233,57 +13278,6 @@
}
};
- IDColor = {
- init: function() {
- if (g.VIEW === 'catalog' || !Conf['Color User IDs']) {
- return;
- }
- this.ids = {};
- return Post.callbacks.push({
- name: 'Color User IDs',
- cb: this.node
- });
- },
- node: function() {
- var rgb, span, style, uid;
-
- if (this.isClone || !(uid = this.info.uniqueID)) {
- return;
- }
- span = $('.hand', this.nodes.uniqueID);
- if (!(span && span.nodeName === 'SPAN')) {
- return;
- }
- rgb = IDColor.compute(uid);
- style = span.style;
- style.color = rgb[3];
- style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
- $.addClass(span, 'painted');
- return span.title = 'Highlight posts by this ID';
- },
- compute: function(uid) {
- var hash, rgb;
-
- if (IDColor.ids[uid]) {
- return IDColor.ids[uid];
- }
- hash = IDColor.hash(uid);
- rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb[3] = (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff';
- return this.ids[uid] = rgb;
- },
- hash: function(uid) {
- var i, msg;
-
- msg = 0;
- i = 0;
- while (i < 8) {
- msg = (msg << 5) - msg + uid.charCodeAt(i++);
- }
- return msg;
- }
- };
-
CustomCSS = {
init: function() {
if (!Conf['Custom CSS']) {
@@ -13757,32 +13751,35 @@
if (this.isClone || !(uid = this.info.uniqueID)) {
return;
}
+ span = $('.hand', this.nodes.uniqueID);
+ if (!(span && span.nodeName === 'SPAN')) {
+ return;
+ }
rgb = IDColor.compute(uid);
- span = this.nodes.uniqueID;
style = span.style;
style.color = rgb[3];
style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
$.addClass(span, 'painted');
- span.textContent = uid;
return span.title = 'Highlight posts by this ID';
},
- compute: function(uniqueID) {
+ compute: function(uid) {
var hash, rgb;
- if (uniqueID in IDColor.ids) {
- return IDColor.ids[uniqueID];
+ if (IDColor.ids[uid]) {
+ return IDColor.ids[uid];
}
- hash = this.hash(uniqueID);
+ hash = IDColor.hash(uid);
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 170 ? 'black' : 'white');
- return this.ids[uniqueID] = rgb;
+ rgb[3] = (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff';
+ return this.ids[uid] = rgb;
},
- hash: function(uniqueID) {
- var i, msg, _i, _ref;
+ hash: function(uid) {
+ var i, msg;
msg = 0;
- for (i = _i = 0, _ref = uniqueID.length; _i < _ref; i = _i += 1) {
- msg = (msg << 5) - msg + uniqueID.charCodeAt(i);
+ i = 0;
+ while (i < 8) {
+ msg = (msg << 5) - msg + uid.charCodeAt(i++);
}
return msg;
}
diff --git a/json/archives.json b/json/archives.json
index 6a3291d10..4faec708b 100644
--- a/json/archives.json
+++ b/json/archives.json
@@ -5,8 +5,8 @@
"http": true,
"https": true,
"software": "foolfuuka",
- "boards": ["a", "co", "gd", "jp", "m", "q", "sp", "tg", "tv", "v", "vg", "vp", "vr", "wsg"],
- "files": ["a", "gd", "jp", "m", "q", "tg", "vg", "vp", "vr", "wsg"]
+ "boards": ["a", "co", "gd", "jp", "m", "sp", "tg", "tv", "v", "vg", "vp", "vr", "wsg"],
+ "files": ["a", "gd", "jp", "m", "tg", "vg", "vp", "vr", "wsg"]
}, {
"uid": 1,
"name": "NSFW Foolz",
@@ -50,8 +50,8 @@
"http": true,
"https": true,
"software": "foolfuuka",
- "boards": ["b", "con", "e", "h", "hc", "p", "s", "soc", "sp", "u"],
- "files": ["b", "con", "e", "h", "hc", "p", "s", "soc", "sp", "u"]
+ "boards": ["adv", "b", "cm", "d", "e", "h", "hc", "lgbt", "pol", "r", "s", "s4s", "soc", "trv", "u", "y"],
+ "files": ["b", "cm", "d", "e", "h", "hc", "pol", "r", "s", "s4s", "soc", "u", "y"]
}, {
"uid": 7,
"name": "Install Gentoo",
@@ -68,8 +68,8 @@
"http": true,
"https": true,
"software": "fuuka",
- "boards": ["cgl", "con", "g", "mu", "w"],
- "files": ["cgl", "con", "g", "mu", "w"]
+ "boards": ["cgl", "g", "mu", "w"],
+ "files": ["cgl", "g", "mu", "w"]
}, {
"uid": 9,
"name": "Heinessen",
@@ -86,8 +86,8 @@
"http": true,
"https": true,
"software": "fuuka",
- "boards": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "tg", "vr"],
- "files": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "tg", "vr"]
+ "boards": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "tg", "vr"],
+ "files": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "tg", "vr"]
}, {
"uid": 13,
"name": "Foolz Beta",
@@ -96,6 +96,6 @@
"https": true,
"withCredentials": true,
"software": "foolfuuka",
- "boards": ["a", "co", "d", "gd", "h", "jp", "m", "mlp", "q", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
- "files": ["a", "d", "gd", "h", "jp", "m", "q", "tg", "u", "vg", "vp", "vr", "wsg"]
+ "boards": ["a", "co", "d", "gd", "h", "jp", "m", "mlp", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
+ "files": ["a", "d", "gd", "h", "jp", "m", "tg", "u", "vg", "vp", "vr", "wsg"]
}]
diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee
index 9a7673e62..e724ff1b8 100755
--- a/src/Linkification/Linkify.coffee
+++ b/src/Linkification/Linkify.coffee
@@ -293,33 +293,35 @@ Linkify =
MediaCrush:
regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i
- style: 'border: 0; width: 640px; height: 480px; resize: both;'
+ style: 'border: 0;'
el: (a) ->
- $.el 'iframe',
- src: "https://mediacru.sh/#{a.dataset.uid}"
-# MediaCrush CORS When?
-#
-# el = $.el 'div'
-# $.cache "https://mediacru.sh/#{a.dataset.uid}.json", ->
-# {status} = @
-# return unless [200, 304].contains status
-# {files} = JSON.parse req.response
-# file = file for file of files when files.hasOwnProperty file
-# el.innerHTML = switch file.type
-# when 'video/mp4', 'video/ogv'
-# """
-#"""
-# when 'image/png', 'image/gif', 'image/jpeg'
-# "
"
-# when 'image/svg', 'image/svg+xml'
-# ""
-# when 'audio/mpeg'
-# ""
-# el
-
+ el = $.el 'div'
+ $.cache "https://mediacru.sh/#{a.dataset.uid}.json", ->
+ {status} = @
+ return div.innerHTML = "ERROR #{status}" unless [200, 304].contains status
+ {files} = JSON.parse @response
+ for type in ['video/mp4', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'image/svg', 'audio/mpeg']
+ for file in files
+ if file.type is type
+ embed = file
+ break
+ break if embed
+ return div.innerHTML = "ERROR: Not a valid filetype" unless embed
+ el.innerHTML = switch embed.type
+ when 'video/mp4', 'video/ogv' then """
+"""
+ when 'image/png', 'image/gif', 'image/jpeg'
+ "
"
+ when 'image/svg', 'image/svg+xml'
+ ""
+ when 'audio/mpeg'
+ ""
+ else
+ "ERROR: No valid filetype."
+ el
pastebin:
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/
diff --git a/src/Miscellaneous/ColorUserIDs.coffee b/src/Miscellaneous/ColorUserIDs.coffee
deleted file mode 100755
index acb1b9b6c..000000000
--- a/src/Miscellaneous/ColorUserIDs.coffee
+++ /dev/null
@@ -1,41 +0,0 @@
-IDColor =
- init: ->
- return if g.VIEW is 'catalog' or not Conf['Color User IDs']
- @ids = {}
-
- Post.callbacks.push
- name: 'Color User IDs'
- cb: @node
-
- node: ->
- return if @isClone or not uid = @info.uniqueID
- span = $ '.hand', @nodes.uniqueID
- return unless span and span.nodeName is 'SPAN'
- rgb = IDColor.compute uid
- {style} = span
- style.color = rgb[3]
- style.backgroundColor = "rgb(#{rgb[0]},#{rgb[1]},#{rgb[2]})"
- $.addClass span, 'painted'
- span.title = 'Highlight posts by this ID'
-
- compute: (uid) ->
- return IDColor.ids[uid] if IDColor.ids[uid]
-
- hash = IDColor.hash uid
- rgb = [
- (hash >> 24) & 0xFF
- (hash >> 16) & 0xFF
- (hash >> 8) & 0xFF
- ]
- rgb[3] = if (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125
- '#000'
- else
- '#fff'
- @ids[uid] = rgb
-
- hash: (uid) ->
- msg = 0
- i = 0
- while i < 8
- msg = (msg << 5) - msg + uid.charCodeAt i++
- msg
\ No newline at end of file
diff --git a/src/Miscellaneous/IDColor.coffee b/src/Miscellaneous/IDColor.coffee
old mode 100644
new mode 100755
index 1fbdd5718..acb1b9b6c
--- a/src/Miscellaneous/IDColor.coffee
+++ b/src/Miscellaneous/IDColor.coffee
@@ -1,6 +1,6 @@
IDColor =
init: ->
- return if g.VIEW is 'catalog' or !Conf['Color User IDs']
+ return if g.VIEW is 'catalog' or not Conf['Color User IDs']
@ids = {}
Post.callbacks.push
@@ -8,33 +8,34 @@ IDColor =
cb: @node
node: ->
- return if @isClone or !(uid = @info.uniqueID)
+ return if @isClone or not uid = @info.uniqueID
+ span = $ '.hand', @nodes.uniqueID
+ return unless span and span.nodeName is 'SPAN'
rgb = IDColor.compute uid
- span = @nodes.uniqueID
{style} = span
style.color = rgb[3]
style.backgroundColor = "rgb(#{rgb[0]},#{rgb[1]},#{rgb[2]})"
$.addClass span, 'painted'
- span.textContent = uid
span.title = 'Highlight posts by this ID'
- compute: (uniqueID) ->
- if uniqueID of IDColor.ids
- return IDColor.ids[uniqueID]
- hash = @hash uniqueID
+ compute: (uid) ->
+ return IDColor.ids[uid] if IDColor.ids[uid]
+
+ hash = IDColor.hash uid
rgb = [
(hash >> 24) & 0xFF
(hash >> 16) & 0xFF
(hash >> 8) & 0xFF
]
- rgb.push if (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 170
- 'black'
+ rgb[3] = if (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125
+ '#000'
else
- 'white'
- @ids[uniqueID] = rgb
+ '#fff'
+ @ids[uid] = rgb
- hash: (uniqueID) ->
+ hash: (uid) ->
msg = 0
- for i in [0...uniqueID.length] by 1
- msg = (msg << 5) - msg + uniqueID.charCodeAt i
- msg
+ i = 0
+ while i < 8
+ msg = (msg << 5) - msg + uid.charCodeAt i++
+ msg
\ No newline at end of file
diff --git a/src/Miscellaneous/Time.coffee b/src/Miscellaneous/Time.coffee
index 40d581179..c76f18cf2 100755
--- a/src/Miscellaneous/Time.coffee
+++ b/src/Miscellaneous/Time.coffee
@@ -58,4 +58,3 @@ Time =
S: -> Time.zeroPad @getSeconds()
y: -> @getFullYear().toString()[2..]
Y: -> @getFullYear()
-