diff --git a/CHANGELOG.md b/CHANGELOG.md index a03a2ce5c..65d35f3bb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v1.7.20 +*2014-04-27* + **ccd0** - Fix features broken/disabled in catalog: settings link, thread watcher, start thread button, and keybinds. diff --git a/LICENSE b/LICENSE index 03d29fd02..a9e541f18 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.7.19 - 2014-04-25 +* 4chan X - Version 1.7.20 - 2014-04-27 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index ab9d37b86..17b2c087f 100755 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.7.19 +// @version 1.7.20 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index bb26ac0b4..6f06225d3 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.7.19 +// @version 1.7.20 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.7.19 - 2014-04-25 +* 4chan X - Version 1.7.20 - 2014-04-27 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -106,7 +106,7 @@ 'use strict'; (function() { - var $, $$, Anonymize, ArchiveLink, AutoGIF, Banner, Board, Build, Callbacks, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Index, InfiniScroll, Keybinds, Linkify, Main, Menu, Nav, Navigate, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, TrashQueue, UI, Unread, Video, c, d, doc, g, + var $, $$, Anonymize, ArchiveLink, AutoGIF, Banner, Board, Build, Callbacks, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, Menu, Nav, Navigate, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, TrashQueue, UI, Unread, Video, c, d, doc, g, __slice = [].slice, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __hasProp = {}.hasOwnProperty, @@ -372,7 +372,7 @@ doc = d.documentElement; g = { - VERSION: '1.7.19', + VERSION: '1.7.20', NAMESPACE: '4chan X.', boards: {} }; @@ -1905,10 +1905,12 @@ a.className = 'current'; } cs = $.el('a', { - id: 'settingsWindowLink', href: 'javascript:;', textContent: 'Catalog Settings' }); + $.on(cs, 'click', function() { + return $.id('settingsWindowLink').click(); + }); if (g.VIEW === 'catalog') { _this.addShortcut(cs); } @@ -5712,7 +5714,7 @@ return $.rmClass($('.qr-shortcut'), 'disabled'); } }); - $.before($.id('postForm'), link); + $.before($.id('togglePostForm') || $.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; cb = _arg.detail; @@ -11488,183 +11490,10 @@ } }; - InfiniScroll = { - init: function() { - if (!(Conf['Infinite Scrolling'] && g.VIEW === 'index' && g.BOARD !== 'f')) { - return; - } - this.threads = g.threads; - return $.on(d, '4chanXInitFinished', this.ready); - }, - ready: function() { - $.off(d, '4chanXInitFinished', InfiniScroll.ready); - $.on(d, 'scroll', InfiniScroll.scroll); - return InfiniScroll.scroll(); - }, - scroll: $.debounce(100, function() { - var url; - if (InfiniScroll.isFetching || ((d.body.scrollTop || doc.scrollTop) <= doc.scrollHeight - (300 + window.innerHeight))) { - return; - } - if (InfiniScroll.isDead) { - return InfiniScroll.notice(); - } - if (InfiniScroll.cache && InfiniScroll.cache.time > Date.now() - $.MINUTE) { - return InfiniScroll.parse(InfiniScroll.cache); - } - new Notice('info', "Fetching next page.", 2); - InfiniScroll.isFetching = true; - url = "//a.4cdn.org/" + g.BOARD + "/catalog.json"; - return $.ajax(url, { - onloadend: InfiniScroll.cb.load - }, { - whenModified: true - }); - }), - parse: function(response) { - var botPostForm, el, nodes, omitted_images, omitted_posts, op, post, postlink, posts, replylink, thread, threadID, threadNodes, threads, _i, _j, _len, _len1, _ref; - threads = InfiniScroll.parsePages(response); - threadNodes = []; - nodes = []; - if (!threads.length) { - InfiniScroll.notice(); - return InfiniScroll.isDead = true; - } - for (_i = 0, _len = threads.length; _i < _len; _i++) { - thread = threads[_i]; - posts = []; - omitted_posts = thread.omitted_posts, omitted_images = thread.omitted_images; - threadID = thread.no; - el = $.el('div', { - className: 'thread', - id: "t" + threadID - }); - op = Build.postFromObject(thread, g.BOARD); - posts.push(op); - replylink = $.el('a', { - href: "thread/" + threadID, - className: 'replylink', - textContent: 'Reply' - }); - postlink = $.el('div', { - className: "postLink mobile", - innerHTML: "View Thread" - }); - if (omitted_posts) { - posts.push($.el('span', { - className: 'summary desktop', - innerHTML: "" + omitted_posts + " posts " + (omitted_images ? "and " + omitted_images + " image replies" : void 0) + " omitted. Click here to view." - })); - $.prepend(postlink, $.el('span', { - className: 'info', - innerHTML: "" + omitted_posts + " posts omitted" + (omitted_images ? "
(" + omitted_images + " have images)" : "") - })); - } - $.add($('.postInfo', op), [$.tn('\u00A0\u00A0\u00A0['), replylink, $.tn(']\u00A0')]); - $.add(op, postlink); - if (thread.last_replies) { - _ref = thread.last_replies; - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - post = _ref[_j]; - posts.push(Build.postFromObject(post, g.BOARD)); - } - } - $.add(el, posts); - threadNodes.push(el); - nodes.push(el); - nodes.push($.el('hr')); - } - InfiniScroll.features(threadNodes); - if (botPostForm = $('.board > .mobile.center')) { - return $.before(botPostForm, nodes); - } - }, - parsePages: function(response) { - var newThreads, number, page, pages, thread, threads, _i, _len; - pages = JSON.parse(response); - newThreads = []; - for (number in pages) { - page = pages[number]; - if (!(pages.hasOwnProperty(number))) { - continue; - } - threads = page.threads; - for (_i = 0, _len = threads.length; _i < _len; _i++) { - thread = threads[_i]; - if (g.threads["" + g.BOARD + "." + thread.no]) { - continue; - } - newThreads.push(thread); - if (newThreads.length === 15) { - return newThreads; - } - } - } - return newThreads; - }, - features: function(threadNodes) { - var err, errors, post, posts, thread, threadRoot, threads, _i, _j, _len, _len1, _ref; - posts = []; - threads = []; - for (_i = 0, _len = threadNodes.length; _i < _len; _i++) { - threadRoot = threadNodes[_i]; - thread = new Thread(+threadRoot.id.slice(1), g.BOARD); - threads.push(thread); - _ref = $$('.thread > .postContainer', threadRoot); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - post = _ref[_j]; - try { - posts.push(new Post(post, thread, g.BOARD)); - } catch (_error) { - err = _error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.", - error: err - }); - } - } - } - if (errors) { - Main.handleErrors(errors); - } - Main.callbackNodes(Thread, threads); - return Main.callbackNodes(Post, posts); - }, - notice: (function() { - var notify, reset; - notify = false; - reset = function() { - return notify = false; - }; - return function() { - if (notify) { - return; - } - notify = true; - new Notice('info', "Last page reached.", 2); - return setTimeout(reset, 3 * $.SECOND); - }; - })(), - cb: { - load: function() { - InfiniScroll.isFetching = false; - if (this.status !== 200) { - return; - } - InfiniScroll.cache = new String(this.response); - InfiniScroll.cache.time = Date.now(); - return InfiniScroll.parse(this.response); - } - } - }; - Keybinds = { init: function() { var hotkey, init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { + if (!Conf['Keybinds']) { return; } for (hotkey in Conf.hotkeys) { @@ -11696,9 +11525,11 @@ return; } } - threadRoot = Nav.getThread(); - if (op = $('.op', threadRoot)) { - thread = Get.postFromNode(op).thread; + if (g.VIEW !== 'catalog') { + threadRoot = Nav.getThread(); + if (op = $('.op', threadRoot)) { + thread = Get.postFromNode(op).thread; + } } switch (key) { case Conf['Toggle board list']: @@ -11710,10 +11541,13 @@ Header.toggleBarVisibility(); break; case Conf['Open empty QR']: - Keybinds.qr(threadRoot); + Keybinds.qr(); break; case Conf['Open QR']: - Keybinds.qr(threadRoot, true); + if (g.VIEW === 'catalog') { + return; + } + Keybinds.qr(threadRoot); break; case Conf['Open settings']: Settings.open(); @@ -11780,23 +11614,41 @@ } break; case Conf['Watch']: + if (g.VIEW === 'catalog') { + return; + } ThreadWatcher.toggle(thread); break; case Conf['Expand image']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.img(threadRoot); break; case Conf['Expand images']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: + if (g.VIEW === 'catalog') { + return; + } Gallery.cb.toggle(); break; case Conf['fappeTyme']: + if (g.VIEW === 'catalog') { + return; + } FappeTyme.cb.toggle.call({ name: 'fappe' }); break; case Conf['werkTyme']: + if (g.VIEW === 'catalog') { + return; + } FappeTyme.cb.toggle.call({ name: 'werk' }); @@ -11840,6 +11692,9 @@ } break; case Conf['Search form']: + if (g.VIEW !== 'index') { + return; + } searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box'); Header.scrollToIfNeeded(searchInput); searchInput.focus(); @@ -11864,32 +11719,59 @@ Nav.scroll(-1); break; case Conf['Expand thread']: + if (g.VIEW !== 'index') { + return; + } ExpandThread.toggle(thread); break; case Conf['Open thread']: + if (g.VIEW !== 'index') { + return; + } Keybinds.open(thread); break; case Conf['Open thread tab']: + if (g.VIEW !== 'index') { + return; + } Keybinds.open(thread, true); break; case Conf['Next reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(+1, threadRoot); break; case Conf['Previous reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(-1, threadRoot); break; case Conf['Deselect reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(0, threadRoot); break; case Conf['Hide']: + if (g.VIEW === 'catalog') { + return; + } if (ThreadHiding.db) { ThreadHiding.toggle(thread); } break; case Conf['Previous Post Quoting You']: + if (g.VIEW === 'catalog') { + return; + } QuoteYou.cb.seek('preceding'); break; case Conf['Next Post Quoting You']: + if (g.VIEW === 'catalog') { + return; + } QuoteYou.cb.seek('following'); break; default: @@ -11940,12 +11822,12 @@ } return key; }, - qr: function(thread, quote) { + qr: function(thread) { if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { return; } QR.open(); - if (quote) { + if (thread != null) { QR.quote.call($('input', $('.post.highlight', thread) || thread)); } QR.nodes.com.focus(); @@ -13589,6 +13471,8 @@ Main.callbackNodesDB(Post, posts, function() { return $.event('4chanXInitFinished'); }); + } else { + $.event('4chanXInitFinished'); } return $.get('previousversion', null, function(_arg) { var changelog, el, previousversion; diff --git a/builds/crx.crx b/builds/crx.crx index 6f68a143e..d054fc294 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index b3bfc130b..47d4f0691 100755 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.7.19", + "version": "1.7.20", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index cbecca856..864c22c42 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.7.19 - 2014-04-25 +* 4chan X - Version 1.7.20 - 2014-04-27 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -82,7 +82,7 @@ 'use strict'; (function() { - var $, $$, Anonymize, ArchiveLink, AutoGIF, Banner, Board, Build, Callbacks, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Index, InfiniScroll, Keybinds, Linkify, Main, Menu, Nav, Navigate, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, TrashQueue, UI, Unread, Video, c, d, doc, g, + var $, $$, Anonymize, ArchiveLink, AutoGIF, Banner, Board, Build, Callbacks, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, Menu, Nav, Navigate, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, TrashQueue, UI, Unread, Video, c, d, doc, g, __slice = [].slice, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __hasProp = {}.hasOwnProperty, @@ -348,7 +348,7 @@ doc = d.documentElement; g = { - VERSION: '1.7.19', + VERSION: '1.7.20', NAMESPACE: '4chan X.', boards: {} }; @@ -1946,10 +1946,12 @@ a.className = 'current'; } cs = $.el('a', { - id: 'settingsWindowLink', href: 'javascript:;', textContent: 'Catalog Settings' }); + $.on(cs, 'click', function() { + return $.id('settingsWindowLink').click(); + }); if (g.VIEW === 'catalog') { _this.addShortcut(cs); } @@ -5746,7 +5748,7 @@ return $.rmClass($('.qr-shortcut'), 'disabled'); } }); - $.before($.id('postForm'), link); + $.before($.id('togglePostForm') || $.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; cb = _arg.detail; @@ -11491,183 +11493,10 @@ } }; - InfiniScroll = { - init: function() { - if (!(Conf['Infinite Scrolling'] && g.VIEW === 'index' && g.BOARD !== 'f')) { - return; - } - this.threads = g.threads; - return $.on(d, '4chanXInitFinished', this.ready); - }, - ready: function() { - $.off(d, '4chanXInitFinished', InfiniScroll.ready); - $.on(d, 'scroll', InfiniScroll.scroll); - return InfiniScroll.scroll(); - }, - scroll: $.debounce(100, function() { - var url; - if (InfiniScroll.isFetching || ((d.body.scrollTop || doc.scrollTop) <= doc.scrollHeight - (300 + window.innerHeight))) { - return; - } - if (InfiniScroll.isDead) { - return InfiniScroll.notice(); - } - if (InfiniScroll.cache && InfiniScroll.cache.time > Date.now() - $.MINUTE) { - return InfiniScroll.parse(InfiniScroll.cache); - } - new Notice('info', "Fetching next page.", 2); - InfiniScroll.isFetching = true; - url = "//a.4cdn.org/" + g.BOARD + "/catalog.json"; - return $.ajax(url, { - onloadend: InfiniScroll.cb.load - }, { - whenModified: true - }); - }), - parse: function(response) { - var botPostForm, el, nodes, omitted_images, omitted_posts, op, post, postlink, posts, replylink, thread, threadID, threadNodes, threads, _i, _j, _len, _len1, _ref; - threads = InfiniScroll.parsePages(response); - threadNodes = []; - nodes = []; - if (!threads.length) { - InfiniScroll.notice(); - return InfiniScroll.isDead = true; - } - for (_i = 0, _len = threads.length; _i < _len; _i++) { - thread = threads[_i]; - posts = []; - omitted_posts = thread.omitted_posts, omitted_images = thread.omitted_images; - threadID = thread.no; - el = $.el('div', { - className: 'thread', - id: "t" + threadID - }); - op = Build.postFromObject(thread, g.BOARD); - posts.push(op); - replylink = $.el('a', { - href: "thread/" + threadID, - className: 'replylink', - textContent: 'Reply' - }); - postlink = $.el('div', { - className: "postLink mobile", - innerHTML: "View Thread" - }); - if (omitted_posts) { - posts.push($.el('span', { - className: 'summary desktop', - innerHTML: "" + omitted_posts + " posts " + (omitted_images ? "and " + omitted_images + " image replies" : void 0) + " omitted. Click here to view." - })); - $.prepend(postlink, $.el('span', { - className: 'info', - innerHTML: "" + omitted_posts + " posts omitted" + (omitted_images ? "
(" + omitted_images + " have images)" : "") - })); - } - $.add($('.postInfo', op), [$.tn('\u00A0\u00A0\u00A0['), replylink, $.tn(']\u00A0')]); - $.add(op, postlink); - if (thread.last_replies) { - _ref = thread.last_replies; - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - post = _ref[_j]; - posts.push(Build.postFromObject(post, g.BOARD)); - } - } - $.add(el, posts); - threadNodes.push(el); - nodes.push(el); - nodes.push($.el('hr')); - } - InfiniScroll.features(threadNodes); - if (botPostForm = $('.board > .mobile.center')) { - return $.before(botPostForm, nodes); - } - }, - parsePages: function(response) { - var newThreads, number, page, pages, thread, threads, _i, _len; - pages = JSON.parse(response); - newThreads = []; - for (number in pages) { - page = pages[number]; - if (!(pages.hasOwnProperty(number))) { - continue; - } - threads = page.threads; - for (_i = 0, _len = threads.length; _i < _len; _i++) { - thread = threads[_i]; - if (g.threads["" + g.BOARD + "." + thread.no]) { - continue; - } - newThreads.push(thread); - if (newThreads.length === 15) { - return newThreads; - } - } - } - return newThreads; - }, - features: function(threadNodes) { - var err, errors, post, posts, thread, threadRoot, threads, _i, _j, _len, _len1, _ref; - posts = []; - threads = []; - for (_i = 0, _len = threadNodes.length; _i < _len; _i++) { - threadRoot = threadNodes[_i]; - thread = new Thread(+threadRoot.id.slice(1), g.BOARD); - threads.push(thread); - _ref = $$('.thread > .postContainer', threadRoot); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - post = _ref[_j]; - try { - posts.push(new Post(post, thread, g.BOARD)); - } catch (_error) { - err = _error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.", - error: err - }); - } - } - } - if (errors) { - Main.handleErrors(errors); - } - Main.callbackNodes(Thread, threads); - return Main.callbackNodes(Post, posts); - }, - notice: (function() { - var notify, reset; - notify = false; - reset = function() { - return notify = false; - }; - return function() { - if (notify) { - return; - } - notify = true; - new Notice('info', "Last page reached.", 2); - return setTimeout(reset, 3 * $.SECOND); - }; - })(), - cb: { - load: function() { - InfiniScroll.isFetching = false; - if (this.status !== 200) { - return; - } - InfiniScroll.cache = new String(this.response); - InfiniScroll.cache.time = Date.now(); - return InfiniScroll.parse(this.response); - } - } - }; - Keybinds = { init: function() { var hotkey, init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { + if (!Conf['Keybinds']) { return; } for (hotkey in Conf.hotkeys) { @@ -11699,9 +11528,11 @@ return; } } - threadRoot = Nav.getThread(); - if (op = $('.op', threadRoot)) { - thread = Get.postFromNode(op).thread; + if (g.VIEW !== 'catalog') { + threadRoot = Nav.getThread(); + if (op = $('.op', threadRoot)) { + thread = Get.postFromNode(op).thread; + } } switch (key) { case Conf['Toggle board list']: @@ -11713,10 +11544,13 @@ Header.toggleBarVisibility(); break; case Conf['Open empty QR']: - Keybinds.qr(threadRoot); + Keybinds.qr(); break; case Conf['Open QR']: - Keybinds.qr(threadRoot, true); + if (g.VIEW === 'catalog') { + return; + } + Keybinds.qr(threadRoot); break; case Conf['Open settings']: Settings.open(); @@ -11783,23 +11617,41 @@ } break; case Conf['Watch']: + if (g.VIEW === 'catalog') { + return; + } ThreadWatcher.toggle(thread); break; case Conf['Expand image']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.img(threadRoot); break; case Conf['Expand images']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: + if (g.VIEW === 'catalog') { + return; + } Gallery.cb.toggle(); break; case Conf['fappeTyme']: + if (g.VIEW === 'catalog') { + return; + } FappeTyme.cb.toggle.call({ name: 'fappe' }); break; case Conf['werkTyme']: + if (g.VIEW === 'catalog') { + return; + } FappeTyme.cb.toggle.call({ name: 'werk' }); @@ -11843,6 +11695,9 @@ } break; case Conf['Search form']: + if (g.VIEW !== 'index') { + return; + } searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box'); Header.scrollToIfNeeded(searchInput); searchInput.focus(); @@ -11867,32 +11722,59 @@ Nav.scroll(-1); break; case Conf['Expand thread']: + if (g.VIEW !== 'index') { + return; + } ExpandThread.toggle(thread); break; case Conf['Open thread']: + if (g.VIEW !== 'index') { + return; + } Keybinds.open(thread); break; case Conf['Open thread tab']: + if (g.VIEW !== 'index') { + return; + } Keybinds.open(thread, true); break; case Conf['Next reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(+1, threadRoot); break; case Conf['Previous reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(-1, threadRoot); break; case Conf['Deselect reply']: + if (g.VIEW === 'catalog') { + return; + } Keybinds.hl(0, threadRoot); break; case Conf['Hide']: + if (g.VIEW === 'catalog') { + return; + } if (ThreadHiding.db) { ThreadHiding.toggle(thread); } break; case Conf['Previous Post Quoting You']: + if (g.VIEW === 'catalog') { + return; + } QuoteYou.cb.seek('preceding'); break; case Conf['Next Post Quoting You']: + if (g.VIEW === 'catalog') { + return; + } QuoteYou.cb.seek('following'); break; default: @@ -11943,12 +11825,12 @@ } return key; }, - qr: function(thread, quote) { + qr: function(thread) { if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { return; } QR.open(); - if (quote) { + if (thread != null) { QR.quote.call($('input', $('.post.highlight', thread) || thread)); } QR.nodes.com.focus(); @@ -13574,6 +13456,8 @@ Main.callbackNodesDB(Post, posts, function() { return $.event('4chanXInitFinished'); }); + } else { + $.event('4chanXInitFinished'); } return $.get('previousversion', null, function(_arg) { var changelog, el, previousversion; diff --git a/builds/updates.xml b/builds/updates.xml index c6e624432..92259a6c1 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 3c32ef22f..76be60200 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "1.7.19", + "version": "1.7.20", "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X",