From 084e9ffbe8a7ce561abaea0c341792f441bcdf56 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 Jan 2015 21:42:08 -0800 Subject: [PATCH 1/6] Fix gallery crash on files deleted before thread was opened. --- builds/appchan-x.user.js | 38 +++++++++++++++++++------------------- builds/crx/script.js | 38 +++++++++++++++++++------------------- src/Images/Gallery.coffee | 4 ++-- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index dd16075d0..df59aa436 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -5055,13 +5055,13 @@ hidden: true }); $.extend(this.pagelist, { - innerHTML: "
\r\r<\r\r
\r
\r
\r\r>\r\r
" + innerHTML: "
<
>
" }); this.navLinks = $.el('div', { className: 'navLinks' }); $.extend(this.navLinks, { - innerHTML: "\r\r\uf05c\r \r\r\r\r\r\r\r\r" + innerHTML: "\uf05c " }); this.timeEl = $('time#index-last-refresh', this.navLinks); this.searchInput = $('#index-search', this.navLinks); @@ -9861,7 +9861,7 @@ var dialog, event, i, items, match_max, match_min, name, node, nodes, rules, save, setNode; QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', { - innerHTML: "
\r\r
\r\r
\r\uf00d\r
\r
\r
\r\r\r \r
\r
\r\r\r
\r
\r
\r+\r
\r
\r\rNo selected file\r\r\r\rSpoiler\r\uf0c1\rPost from URL\r+\rDump\r\uf00d\rRemove File\r\r\r\r
\r\r
\r\r\r\r" + innerHTML: "
\uf00d
No selected fileSpoiler\uf0c1Post from URL+Dump\uf00dRemove File
" }) }; setNode = function(name, query) { @@ -11110,7 +11110,7 @@ id: 'a-gallery' }); $.extend(dialog, { - innerHTML: "
\r\r\uf04b\r\uf04d\r\uf107\r\uf00d\r\r\r\r / \r\r
\r
\r\r
\r
\r
\r
" + innerHTML: "
\uf04b\uf04d\uf107\uf00d /
" }); _ref = { buttons: '.gal-buttons', @@ -11154,7 +11154,7 @@ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { file = _ref2[_j]; post = Get.postFromNode(file); - if (post.file.isDead) { + if (!post.file || post.file.isDead) { continue; } Gallery.generateThumb(post); @@ -12425,7 +12425,7 @@ } if (Conf['Floating Embeds']) { this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', { - innerHTML: "
\r
\r\uf061\r\uf00d\r
\r
\r" + innerHTML: "
\uf061\uf00d
" }); this.media = $('#media-embed', this.dialog); $.one(d, '4chanXInitFinished', this.ready); @@ -14307,7 +14307,7 @@ } this.db = new DataBoard('watchedThreads', this.refresh, true); this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', { - innerHTML: "
\r\rThread Watcher \r\uf021\r\r\r\uf107\r
\r
" + innerHTML: "
Thread Watcher \uf021\uf107
" }); this.status = $('#watcher-status', this.dialog); this.list = this.dialog.lastElementChild; @@ -18992,7 +18992,7 @@ "class": 'dialog' }); $.extend(dialog, { - innerHTML: "\r
\r
\r" + innerHTML: "
" }); Settings.overlay = overlay = $.el('div', { id: 'overlay' @@ -19211,7 +19211,7 @@ filter: function(section) { var select; $.extend(section, { - innerHTML: "\r
" + innerHTML: "
" }); select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -19235,14 +19235,14 @@ return; } $.extend(div, { - innerHTML: "
Filter is disabled.
\r

\rUse regular expressions, one per line.
\rLines starting with a # will be ignored.
\rFor example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\rMD5 filtering uses exact string matching, not regular expressions.\r

\r\r" + innerHTML: "
Filter is disabled.

Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
MD5 filtering uses exact string matching, not regular expressions.

" }); return $('.warning', div).hidden = Conf['Filter']; }, sauce: function(section) { var ta; $.extend(section, { - innerHTML: "
Sauce is disabled.
\r
Lines starting with a # will be ignored.
\r
You can specify a display text by appending ;text:[text] to the URL.
\r\r\r" + innerHTML: "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
" }); ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -19253,7 +19253,7 @@ advanced: function(section) { var archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; $.extend(section, { - innerHTML: "
\rArchiver\r
404 Redirect is disabled.
\r
\r\r\r\r\r\r\r\r
Thread redirectionPost fetchingFile redirection
\rDisabled selections indicate that only one archive is available for that board and redirection type.\r
\r
\rCustom Board Navigation\r
\rNew lines will be converted into spaces.

\r
In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
\r
Board link: g
\r
Archive link: g-archive
\r
Internal archive link: g-expired
\r
Title link: g-title
\r
Board link (Replace with title when on that board): g-replace
\r
Full text link: g-full
\r
Custom text link: g-text:\"Install Gentoo\"
\r
Index-only link: g-index
\r
Catalog-only link: g-catalog
\r
External link: external-text:\"Google\",\"http://www.google.com\"
\r
Index mode: g-mode:\"type\" where type is paged, all threads or catalog
\r
Index sort: g-sort:\"type\" where type is bump order, last reply, creation date, reply count or file countCombinations are possible: g-index-text:\"Technology Index\"
\r
Full board list toggle: toggle-all
\r
\r
\r[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\rwill give you
\r[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\rif you are on /g/.\r
\r
\r
\rTime Formatting is disabled.\r
:
\r
Supported format specifiers:
\r
Day: %a, %A, %d, %e
\r
Month: %m, %b, %B
\r
Year: %y, %Y
\r
Hour: %k, %H, %l, %I, %p, %P
\r
Minute: %M
\r
Second: %S
\r
\r
\rQuote Backlinks formatting is disabled.\r
:
\r
\r
\rFile Info Formatting is disabled.\r
:
\r
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
\r
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
\r
Spoiler indicator: %p
\r
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\r
Resolution: %r (Displays 'PDF' for PDF files)
\r
\r
\rQuick Reply Personas\r\r

\rOne item per line.
\rItems will be added in the relevant input's auto-completion list.
\rPassword items will always be used, since there is no password input.
\rLines starting with a # will be ignored.\r

\r\r
\r
\rUnread Favicon is disabled.\r\r\r\r\r\r\r\r
\r
\rThread Updater is disabled.\r
\rInterval: seconds\r
\r
\r
\r\r\r\r\r\r
\r" + innerHTML: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Index mode: g-mode:\"type\" where type is paged, all threads or catalog
Index sort: g-sort:\"type\" where type is bump order, last reply, creation date, reply count or file countCombinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
" }); _ref = $$('.warning', section); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -19478,7 +19478,7 @@ keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; $.extend(section, { - innerHTML: "
Keybinds are disabled.
\r
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\r
Press Backspace to disable a keybind.
\r\r\r
ActionsKeybinds
" + innerHTML: "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
" }); $('.warning', section).hidden = Conf['Keybinds']; tbody = $('tbody', section); @@ -19626,7 +19626,7 @@ id: name }); $.extend(div, { - innerHTML: "
\r
\r
\r\r" + name + "\r\r\r" + theme['Author'] + "\r\r\r(SAGE)\r\r\r" + theme['Author Tripcode'] + "\r\r\r\rNo.27583594\r\r\r>>edit\r\r\r>>export\r\r\r>>delete\r\r
\r
\r\r>>27582902\r\r
\rPost content is right here.\r
\r

\rSelected\r

\r
" + innerHTML: "
" + name + "" + theme['Author'] + "(SAGE)" + theme['Author Tripcode'] + "No.27583594>>edit>>export>>delete
>>27582902
Post content is right here.

Selected

" }); div.style.backgroundColor = theme['Background Color']; _ref = $$('a[data-color]', div); @@ -19646,7 +19646,7 @@ id: 'addthemes' }); $.extend(div, { - innerHTML: "New Theme\r/\rImport Theme\r\r/\rUndelete Theme" + innerHTML: "New Theme/Import Theme/Undelete Theme" }); $.on($("#newtheme", div), 'click', function() { ThemeTools.init("untitled"); @@ -19677,7 +19677,7 @@ className: theme }); $.extend(div, { - innerHTML: "
\r
\r\r" + name + "\r\r\r" + theme['Author'] + "\r\r\r(SAGE)\r\r\r" + theme['Author Tripcode'] + "\r\r\r\rNo.27583594\r\r
\r
\r\r>>27582902\r\r
\rI forgive you for using VLC to open me. ;__;\r
\r
" + innerHTML: "
" + name + "" + theme['Author'] + "(SAGE)" + theme['Author Tripcode'] + "No.27583594
>>27582902
I forgive you for using VLC to open me. ;__;
" }); $.on(div, 'click', cb.restore); $.add(suboptions, div); @@ -19783,7 +19783,7 @@ className: __indexOf.call(Conf[g.MASCOTSTRING], name) >= 0 ? 'mascot enabled' : 'mascot' }); $.extend(mascotEl, { - innerHTML: "
" + (name.replace(/_/g, ' ')) + "
\r
" + innerHTML: "
" + (name.replace(/_/g, ' ')) + "
" }); $.on(mascotEl, 'click', cb.select); $.on(mascotEl, 'mouseover', addoptions); @@ -19793,7 +19793,7 @@ id: "mascots_batch" }); $.extend(batchmascots, { - innerHTML: "Clear All\r/\rSelect All\r/\rAdd Mascot\r/\rImport Mascot\r/\rUndelete Mascots\r/\rGet More Mascots!" + innerHTML: "Clear All/Select All/Add Mascot/Import Mascot/Undelete Mascots/Get More Mascots!" }); $.on($('#clear', batchmascots), 'click', function() { var enabledMascots, _k, _len2; @@ -19850,7 +19850,7 @@ id: name }); $.extend(mascotEl, { - innerHTML: "
" + (name.replace(/_/g, ' ')) + "
\r
" + innerHTML: "
" + (name.replace(/_/g, ' ')) + "
" }); $.on(mascotEl, 'click', cb.restore); $.add(container, mascotEl); diff --git a/builds/crx/script.js b/builds/crx/script.js index cce9b3ada..0322d6c7e 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -5080,13 +5080,13 @@ hidden: true }); $.extend(this.pagelist, { - innerHTML: "
\r\r<\r\r
\r
\r
\r\r>\r\r
" + innerHTML: "
<
>
" }); this.navLinks = $.el('div', { className: 'navLinks' }); $.extend(this.navLinks, { - innerHTML: "\r\r\uf05c\r \r\r\r\r\r\r\r\r" + innerHTML: "\uf05c " }); this.timeEl = $('time#index-last-refresh', this.navLinks); this.searchInput = $('#index-search', this.navLinks); @@ -9911,7 +9911,7 @@ var dialog, event, i, items, match_max, match_min, name, node, nodes, rules, save, setNode; QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', { - innerHTML: "
\r\r
\r\r
\r\uf00d\r
\r
\r
\r\r\r \r
\r
\r\r\r
\r
\r
\r+\r
\r
\r\rNo selected file\r\r\r\rSpoiler\r\uf0c1\rPost from URL\r+\rDump\r\uf00d\rRemove File\r\r\r\r
\r\r
\r\r\r\r" + innerHTML: "
\uf00d
No selected fileSpoiler\uf0c1Post from URL+Dump\uf00dRemove File
" }) }; setNode = function(name, query) { @@ -11146,7 +11146,7 @@ id: 'a-gallery' }); $.extend(dialog, { - innerHTML: "
\r\r\uf04b\r\uf04d\r\uf107\r\uf00d\r\r\r\r / \r\r
\r
\r\r
\r
\r
\r
" + innerHTML: "
\uf04b\uf04d\uf107\uf00d /
" }); _ref = { buttons: '.gal-buttons', @@ -11190,7 +11190,7 @@ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { file = _ref2[_j]; post = Get.postFromNode(file); - if (post.file.isDead) { + if (!post.file || post.file.isDead) { continue; } Gallery.generateThumb(post); @@ -12448,7 +12448,7 @@ } if (Conf['Floating Embeds']) { this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', { - innerHTML: "
\r
\r\uf061\r\uf00d\r
\r
\r" + innerHTML: "
\uf061\uf00d
" }); this.media = $('#media-embed', this.dialog); $.one(d, '4chanXInitFinished', this.ready); @@ -14330,7 +14330,7 @@ } this.db = new DataBoard('watchedThreads', this.refresh, true); this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', { - innerHTML: "
\r\rThread Watcher \r\uf021\r\r\r\uf107\r
\r
" + innerHTML: "
Thread Watcher \uf021\uf107
" }); this.status = $('#watcher-status', this.dialog); this.list = this.dialog.lastElementChild; @@ -19025,7 +19025,7 @@ "class": 'dialog' }); $.extend(dialog, { - innerHTML: "\r
\r
\r" + innerHTML: "
" }); Settings.overlay = overlay = $.el('div', { id: 'overlay' @@ -19242,7 +19242,7 @@ filter: function(section) { var select; $.extend(section, { - innerHTML: "\r
" + innerHTML: "
" }); select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -19266,14 +19266,14 @@ return; } $.extend(div, { - innerHTML: "
Filter is disabled.
\r

\rUse regular expressions, one per line.
\rLines starting with a # will be ignored.
\rFor example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\rMD5 filtering uses exact string matching, not regular expressions.\r

\r\r" + innerHTML: "
Filter is disabled.

Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
MD5 filtering uses exact string matching, not regular expressions.

" }); return $('.warning', div).hidden = Conf['Filter']; }, sauce: function(section) { var ta; $.extend(section, { - innerHTML: "
Sauce is disabled.
\r
Lines starting with a # will be ignored.
\r
You can specify a display text by appending ;text:[text] to the URL.
\r\r\r" + innerHTML: "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
" }); ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -19284,7 +19284,7 @@ advanced: function(section) { var archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; $.extend(section, { - innerHTML: "
\rArchiver\r
404 Redirect is disabled.
\r
\r\r\r\r\r\r\r\r
Thread redirectionPost fetchingFile redirection
\rDisabled selections indicate that only one archive is available for that board and redirection type.\r
\r
\rCustom Board Navigation\r
\rNew lines will be converted into spaces.

\r
In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
\r
Board link: g
\r
Archive link: g-archive
\r
Internal archive link: g-expired
\r
Title link: g-title
\r
Board link (Replace with title when on that board): g-replace
\r
Full text link: g-full
\r
Custom text link: g-text:\"Install Gentoo\"
\r
Index-only link: g-index
\r
Catalog-only link: g-catalog
\r
External link: external-text:\"Google\",\"http://www.google.com\"
\r
Index mode: g-mode:\"type\" where type is paged, all threads or catalog
\r
Index sort: g-sort:\"type\" where type is bump order, last reply, creation date, reply count or file countCombinations are possible: g-index-text:\"Technology Index\"
\r
Full board list toggle: toggle-all
\r
\r
\r[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\rwill give you
\r[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\rif you are on /g/.\r
\r
\r
\rTime Formatting is disabled.\r
:
\r
Supported format specifiers:
\r
Day: %a, %A, %d, %e
\r
Month: %m, %b, %B
\r
Year: %y, %Y
\r
Hour: %k, %H, %l, %I, %p, %P
\r
Minute: %M
\r
Second: %S
\r
\r
\rQuote Backlinks formatting is disabled.\r
:
\r
\r
\rFile Info Formatting is disabled.\r
:
\r
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
\r
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
\r
Spoiler indicator: %p
\r
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\r
Resolution: %r (Displays 'PDF' for PDF files)
\r
\r
\rQuick Reply Personas\r\r

\rOne item per line.
\rItems will be added in the relevant input's auto-completion list.
\rPassword items will always be used, since there is no password input.
\rLines starting with a # will be ignored.\r

\r\r
\r
\rUnread Favicon is disabled.\r\r\r\r\r\r\r\r
\r
\rThread Updater is disabled.\r
\rInterval: seconds\r
\r
\r
\r\r\r\r\r\r
\r" + innerHTML: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Index mode: g-mode:\"type\" where type is paged, all threads or catalog
Index sort: g-sort:\"type\" where type is bump order, last reply, creation date, reply count or file countCombinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
" }); _ref = $$('.warning', section); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -19509,7 +19509,7 @@ keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; $.extend(section, { - innerHTML: "
Keybinds are disabled.
\r
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\r
Press Backspace to disable a keybind.
\r\r\r
ActionsKeybinds
" + innerHTML: "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
" }); $('.warning', section).hidden = Conf['Keybinds']; tbody = $('tbody', section); @@ -19657,7 +19657,7 @@ id: name }); $.extend(div, { - innerHTML: "
\r
\r
\r\r" + name + "\r\r\r" + theme['Author'] + "\r\r\r(SAGE)\r\r\r" + theme['Author Tripcode'] + "\r\r\r\rNo.27583594\r\r\r>>edit\r\r\r>>export\r\r\r>>delete\r\r
\r
\r\r>>27582902\r\r
\rPost content is right here.\r
\r

\rSelected\r

\r
" + innerHTML: "
" + name + "" + theme['Author'] + "(SAGE)" + theme['Author Tripcode'] + "No.27583594>>edit>>export>>delete
>>27582902
Post content is right here.

Selected

" }); div.style.backgroundColor = theme['Background Color']; _ref = $$('a[data-color]', div); @@ -19677,7 +19677,7 @@ id: 'addthemes' }); $.extend(div, { - innerHTML: "New Theme\r/\rImport Theme\r\r/\rUndelete Theme" + innerHTML: "New Theme/Import Theme/Undelete Theme" }); $.on($("#newtheme", div), 'click', function() { ThemeTools.init("untitled"); @@ -19708,7 +19708,7 @@ className: theme }); $.extend(div, { - innerHTML: "
\r
\r\r" + name + "\r\r\r" + theme['Author'] + "\r\r\r(SAGE)\r\r\r" + theme['Author Tripcode'] + "\r\r\r\rNo.27583594\r\r
\r
\r\r>>27582902\r\r
\rI forgive you for using VLC to open me. ;__;\r
\r
" + innerHTML: "
" + name + "" + theme['Author'] + "(SAGE)" + theme['Author Tripcode'] + "No.27583594
>>27582902
I forgive you for using VLC to open me. ;__;
" }); $.on(div, 'click', cb.restore); $.add(suboptions, div); @@ -19814,7 +19814,7 @@ className: __indexOf.call(Conf[g.MASCOTSTRING], name) >= 0 ? 'mascot enabled' : 'mascot' }); $.extend(mascotEl, { - innerHTML: "
" + (name.replace(/_/g, ' ')) + "
\r
" + innerHTML: "
" + (name.replace(/_/g, ' ')) + "
" }); $.on(mascotEl, 'click', cb.select); $.on(mascotEl, 'mouseover', addoptions); @@ -19824,7 +19824,7 @@ id: "mascots_batch" }); $.extend(batchmascots, { - innerHTML: "Clear All\r/\rSelect All\r/\rAdd Mascot\r/\rImport Mascot\r/\rUndelete Mascots\r/\rGet More Mascots!" + innerHTML: "Clear All/Select All/Add Mascot/Import Mascot/Undelete Mascots/Get More Mascots!" }); $.on($('#clear', batchmascots), 'click', function() { var enabledMascots, _k, _len2; @@ -19881,7 +19881,7 @@ id: name }); $.extend(mascotEl, { - innerHTML: "
" + (name.replace(/_/g, ' ')) + "
\r
" + innerHTML: "
" + (name.replace(/_/g, ' ')) + "
" }); $.on(mascotEl, 'click', cb.restore); $.add(container, mascotEl); diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 10a1759fd..b93bf7bb3 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -81,7 +81,7 @@ Gallery = for file in $$ '.post .file' post = Get.postFromNode file - continue if post.file.isDead + continue if !post.file or post.file.isDead Gallery.generateThumb post # If no image to open is given, pick image we have scrolled to. if !image and Gallery.fullIDs[post.fullID] @@ -333,4 +333,4 @@ Gallery = $.on delayInput, 'change', $.cb.value subEntries.push el: delayLabel - subEntries \ No newline at end of file + subEntries From 6ae8ef05363fa3fc3d06deaf919de1a70044537a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 Jan 2015 22:37:07 -0800 Subject: [PATCH 2/6] Fix merge error. --- builds/appchan-x.user.js | 2 +- builds/crx/script.js | 2 +- src/Images/Gallery.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index df59aa436..3225870b7 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -11318,7 +11318,7 @@ case 'Right': return Gallery.cb.next; case 'Enter': - return Gallery.cb.advance; + return Gallery.cb.enterKey; case 'Left': case '': return Gallery.cb.prev; diff --git a/builds/crx/script.js b/builds/crx/script.js index 0322d6c7e..43c6415bd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11354,7 +11354,7 @@ case 'Right': return Gallery.cb.next; case 'Enter': - return Gallery.cb.advance; + return Gallery.cb.enterKey; case 'Left': case '': return Gallery.cb.prev; diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index b93bf7bb3..1411978d4 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -219,7 +219,7 @@ Gallery = when 'Right' Gallery.cb.next when 'Enter' - Gallery.cb.advance + Gallery.cb.enterKey when 'Left', '' Gallery.cb.prev when Conf['Pause'] From fe188e12b325484f1812d9ca53d30b6012d9ddee Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 Jan 2015 23:02:13 -0800 Subject: [PATCH 3/6] Don't set loop attribute of non-video. --- builds/appchan-x.user.js | 4 +++- builds/crx/script.js | 4 +++- src/Images/Gallery.coffee | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 3225870b7..143080e15 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -11392,7 +11392,9 @@ } Gallery.cleanupTimer(); current = Gallery.nodes.current; - current.loop = current.nodeName === 'VIDEO'; + if (current.nodeName === 'VIDEO') { + current.loop = true; + } $.rmClass(Gallery.nodes.buttons, 'gal-playing'); return Gallery.slideshow = false; }, diff --git a/builds/crx/script.js b/builds/crx/script.js index 43c6415bd..45e7bbe8c 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11428,7 +11428,9 @@ } Gallery.cleanupTimer(); current = Gallery.nodes.current; - current.loop = current.nodeName === 'VIDEO'; + if (current.nodeName === 'VIDEO') { + current.loop = true; + } $.rmClass(Gallery.nodes.buttons, 'gal-playing'); return Gallery.slideshow = false; }, diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 1411978d4..c6605eb92 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -269,7 +269,7 @@ Gallery = return unless Gallery.slideshow Gallery.cleanupTimer() {current} = Gallery.nodes - current.loop = current.nodeName is 'VIDEO' + current.loop = true if current.nodeName is 'VIDEO' $.rmClass Gallery.nodes.buttons, 'gal-playing' Gallery.slideshow = false From 34888c1dcb0950e334b8b3ef733990877f60b5e5 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 Jan 2015 23:48:59 -0800 Subject: [PATCH 4/6] Fix missing Gallery.cb.toggleSlideshow. --- builds/appchan-x.user.js | 3 +++ builds/crx/script.js | 3 +++ src/Images/Gallery.coffee | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 143080e15..3fa553715 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -11372,6 +11372,9 @@ return Gallery.cb.close(); } }, + toggleSlideshow: function() { + return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); + }, pause: function() { var current; Gallery.cb.stop(); diff --git a/builds/crx/script.js b/builds/crx/script.js index 45e7bbe8c..555c6e55f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11408,6 +11408,9 @@ return Gallery.cb.close(); } }, + toggleSlideshow: function() { + return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); + }, pause: function() { var current; Gallery.cb.stop(); diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index c6605eb92..058568dc5 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -254,7 +254,8 @@ Gallery = click: -> Gallery.cb[if Gallery.nodes.current.controls then 'stop' else 'enterKey']() toggle: -> (if Gallery.nodes then Gallery.cb.close else Gallery.build)() blank: (e) -> Gallery.cb.close() if e.target is @ - + toggleSlideshow: -> Gallery.cb[if Gallery.slideshow then 'stop' else 'start']() + pause: -> Gallery.cb.stop() {current} = Gallery.nodes From dccf88cf134edb1e259bac99e58e0cb25df87377 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 Jan 2015 23:54:43 -0800 Subject: [PATCH 5/6] Fix slide delay being missing from gallery submenu in header. --- builds/appchan-x.user.js | 9 ++------- builds/crx/script.js | 9 ++------- src/Images/Gallery.coffee | 7 +------ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 3fa553715..40ac34288 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -11435,7 +11435,7 @@ }, menu: { init: function() { - var createSubEntry, el, name, subEntries, _ref; + var el, _ref; if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) { return; } @@ -11443,15 +11443,10 @@ textContent: 'Gallery', className: 'gallery-link' }); - createSubEntry = Gallery.menu.createSubEntry; - subEntries = []; - for (name in Config.gallery) { - subEntries.push(createSubEntry(name)); - } return Header.menu.addEntry({ el: el, order: 105, - subEntries: subEntries + subEntries: Gallery.menu.createSubEntries() }); }, createSubEntry: function(name) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 555c6e55f..b137fbe35 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11471,7 +11471,7 @@ }, menu: { init: function() { - var createSubEntry, el, name, subEntries, _ref; + var el, _ref; if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) { return; } @@ -11479,15 +11479,10 @@ textContent: 'Gallery', className: 'gallery-link' }); - createSubEntry = Gallery.menu.createSubEntry; - subEntries = []; - for (name in Config.gallery) { - subEntries.push(createSubEntry(name)); - } return Header.menu.addEntry({ el: el, order: 105, - subEntries: subEntries + subEntries: Gallery.menu.createSubEntries() }); }, createSubEntry: function(name) { diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 058568dc5..d2712514e 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -303,15 +303,10 @@ Gallery = textContent: 'Gallery' className: 'gallery-link' - {createSubEntry} = Gallery.menu - subEntries = [] - for name of Config.gallery - subEntries.push createSubEntry name - Header.menu.addEntry el: el order: 105 - subEntries: subEntries + subEntries: Gallery.menu.createSubEntries() createSubEntry: (name) -> label = $.el 'label', From 95bd98d5c9e1e9d47d2e2bcb4adbe2454f59a291 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 Jan 2015 02:03:02 -0800 Subject: [PATCH 6/6] Fix jsmath listener. --- LICENSE | 2 +- builds/appchan-x.user.js | 4 ++-- builds/crx/script.js | 4 ++-- src/Miscellaneous/Fourchan.coffee | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index bc4c4bec9..4c6a096e7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.10.4 - 2015-01-23 +* appchan x - Version 2.10.4 - 2015-01-24 * * 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 40ac34288..4bbc4c9d3 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -28,7 +28,7 @@ // ==/UserScript== /* -* appchan x - Version 2.10.4 - 2015-01-23 +* appchan x - Version 2.10.4 - 2015-01-24 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -16140,7 +16140,7 @@ }); } if (id === 'sci') { - $.globalEval('window.addEventListener(\'jsmath\', function(e) {\n if (!jsMath) return;\n // process one post\n jsMath.ProcessBeforeShowing(e.target);\n } else if (jsMath.Autoload && jsMath.Autoload.checked) {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push(\'ProcessBeforeShowing\', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);'); + $.globalEval('window.addEventListener(\'jsmath\', function(e) {\n if (!jsMath) return;\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.target);\n } else if (jsMath.Autoload && jsMath.Autoload.checked) {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push(\'ProcessBeforeShowing\', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);'); Post.callbacks.push({ name: 'Parse /sci/ math', cb: this.math diff --git a/builds/crx/script.js b/builds/crx/script.js index b137fbe35..4fa438f67 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.10.4 - 2015-01-23 +* appchan x - Version 2.10.4 - 2015-01-24 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -16162,7 +16162,7 @@ }); } if (id === 'sci') { - $.globalEval('window.addEventListener(\'jsmath\', function(e) {\n if (!jsMath) return;\n // process one post\n jsMath.ProcessBeforeShowing(e.target);\n } else if (jsMath.Autoload && jsMath.Autoload.checked) {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push(\'ProcessBeforeShowing\', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);'); + $.globalEval('window.addEventListener(\'jsmath\', function(e) {\n if (!jsMath) return;\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.target);\n } else if (jsMath.Autoload && jsMath.Autoload.checked) {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push(\'ProcessBeforeShowing\', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);'); Post.callbacks.push({ name: 'Parse /sci/ math', cb: this.math diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 294790f53..c76863385 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -19,6 +19,7 @@ Fourchan = $.globalEval ''' window.addEventListener('jsmath', function(e) { if (!jsMath) return; + if (jsMath.loaded) { // process one post jsMath.ProcessBeforeShowing(e.target); } else if (jsMath.Autoload && jsMath.Autoload.checked) {