diff --git a/CHANGELOG.md b/CHANGELOG.md index 01a4f888c..8402df0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,19 @@ -Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0). +### v1.14.21 + +**v1.14.21.0** *(2021-01-15)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.0/builds/4chan-X-noupdate.crx)] +- Based on v1.14.20.6. +- (ihavenoface) Fix bug causing unwanted menu in inlined/previewed quotes. +- (thth) Add Sauce links to Gallery. +- (jakem72360) Add keybind to download images in Gallery. +- (4chenz) Add new sorting mode to index / catalog: Posts per minute + ### v1.14.20 -**v1.14.20.6** *(2021-01-15)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.6/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.6/builds/4chan-X-noupdate.crx)] +**v1.14.20.6** *(2021-01-15)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.6/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.2 +0.6/builds/4chan-X-noupdate.crx)] - Userscript only: Add Youtube to Tampermonkey XHR domain whitelist to stop annoying permission popups. **v1.14.20.5** *(2021-01-14)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.5/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.5/builds/4chan-X-noupdate.crx)] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 4dc303344..82efbcce9 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index 6d3e5372b..d8fff17b5 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.14.20.6 +// @version 1.14.21.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index b34d03489..9a8644ff3 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.14.20.6 +// @version 1.14.21.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -219,7 +219,7 @@ docSet = function() { }; g = { - VERSION: '1.14.20.6', + VERSION: '1.14.21.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -538,6 +538,7 @@ Config = (function() { 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], + 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], 'Front page': ['1', 'Jump to front page.'], @@ -3709,53 +3710,58 @@ a:only-of-type > .remove {\n\ bottom: 2px;\n\ vertical-align: baseline;\n\ }\n\ -.gal-buttons,\n\ -.gal-name,\n\ -.gal-count {\n\ +.gal-labels {\n\ position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-count,\n\ -.gal-hide-thumbnails .gal-name {\n\ - right: 44px;\n\ -}\n\ -.gal-name {\n\ bottom: 6px;\n\ + display: -webkit-flex;\n\ + display: flex;\n\ + -webkit-flex-direction: column;\n\ + flex-direction: column;\n\ + -webkit-align-items: flex-end;\n\ + align-items: flex-end;\n\ +}\n\ +:root:not(.show-sauce) .gal-sauce {\n\ + display: none;\n\ +}\n\ +.gal-name,\n\ +.gal-count,\n\ +.gal-sauce {\n\ background: rgba(0,0,0,0.6) !important;\n\ border-radius: 3px;\n\ padding: 1px 5px 2px 5px;\n\ + margin-top: 3px;\n\ + color: #ffffff !important;\n\ text-decoration: none !important;\n\ - color: white !important;\n\ +}\n\ +.gal-sauce a {\n\ + color: #ffffff !important;\n\ }\n\ .gal-name:hover,\n\ -.gal-buttons a:hover {\n\ +.gal-buttons a:hover,\n\ +.gal-sauce a:hover {\n\ color: rgb(95, 95, 101) !important;\n\ }\n\ :root.gal-pdf .gal-buttons a:hover {\n\ color: rgb(204, 204, 204) !important;\n\ }\n\ -.gal-count {\n\ - bottom: 27px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - color: #ffffff !important;\n\ +.gal-buttons,\n\ +.gal-labels {\n\ + position: fixed;\n\ + right: 195px;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-name {\n\ +.gal-hide-thumbnails .gal-buttons,\n\ +.gal-hide-thumbnails .gal-labels {\n\ + right: 44px;\n\ +}\n\ +:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ bottom: 23px !important;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-count {\n\ - bottom: 44px !important;\n\ -}\n\ :root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-name,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-count {\n\ +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ right: 178px !important;\n\ }\n\ :root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-name,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-count {\n\ +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ right: 28px !important;\n\ }\n\ :root.gallery-open.fixed #header-bar:not(.autohide),\n\ @@ -11421,7 +11427,7 @@ Index = (function() { this.navLinks = $.el('div', { className: 'navLinks json-index' }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); + $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); if (!BoardConfig.isArchived(g.BOARD.ID)) { $('.archlistlink', this.navLinks).hidden = true; @@ -11831,7 +11837,8 @@ Index = (function() { 'last-long-reply': 'lastlong', 'creation-date': 'birth', 'reply-count': 'replycount', - 'file-count': 'filecount' + 'file-count': 'filecount', + 'posts-per-minute': 'activity' } }, processHash: function() { @@ -12391,11 +12398,12 @@ Index = (function() { $.add(thread.OP.nodes.post, nodes.replies); }, sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs; + var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; if (!liveThreadData) { return; } + tmp_time = new Date().getTime() / 1000; sortType = Index.currentSort.replace(/-rev$/, ''); Index.sortedThreadIDs = (function() { var k, len1; @@ -12459,6 +12467,12 @@ Index = (function() { }).map(function(post) { return post.no; }); + case 'activity': + return slice.call(liveThreadData).sort(function(a, b) { + return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); + }).map(function(post) { + return post.no; + }); default: return liveThreadIDs; } @@ -14580,13 +14594,14 @@ Gallery = (function() { nodes.el = dialog = $.el('div', { id: 'a-gallery' }); - $.extend(dialog, {innerHTML: "
× /
"}); + $.extend(dialog, {innerHTML: "
×
/
"}); ref = { buttons: '.gal-buttons', frame: '.gal-image', name: '.gal-name', count: '.count', total: '.total', + sauce: '.gal-sauce', thumbs: '.gal-thumbnails', next: '.gal-image a', current: '.gal-image img' @@ -14701,7 +14716,7 @@ Gallery = (function() { return file; }, open: function(thumb) { - var el, file, newID, nodes, oldID, post, ref; + var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; nodes = Gallery.nodes; oldID = +nodes.current.dataset.id; newID = +thumb.dataset.id; @@ -14738,6 +14753,18 @@ Gallery = (function() { nodes.name.href = thumb.href; nodes.frame.scrollTop = 0; nodes.next.focus(); + $.rmAll(nodes.sauce); + if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { + sauces = []; + ref1 = Sauce.links; + for (i = 0, len = ref1.length; i < len; i++) { + link = ref1[i]; + if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { + sauces.push($.tn(' '), node); + } + } + $.add(nodes.sauce, sauces); + } if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { Gallery.setupTimer(); } else { @@ -14834,6 +14861,8 @@ Gallery = (function() { return Gallery.cb.rotateLeft; case Conf['Rotate image clockwise']: return Gallery.cb.rotateRight; + case Conf['Download Gallery Image']: + return Gallery.cb.download; } })(); if (!cb) { @@ -14887,6 +14916,11 @@ Gallery = (function() { toggleSlideshow: function() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); }, + download: function() { + var name; + name = $('.gal-name'); + return name.click(); + }, pause: function() { var current; Gallery.cb.stop(); @@ -16164,6 +16198,7 @@ Sauce = (function() { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { return; } + $.addClass(doc, 'show-sauce'); links = []; ref1 = Conf['sauces'].split('\n'); for (j = 0, len = ref1.length; j < len; j++) { @@ -17873,7 +17908,7 @@ Menu = (function() { if (this.isClone) { button = $('.menu-button', this.nodes.info); $.rmClass(button, 'active'); - $.rm($('.dialog', button)); + $.rm($('.dialog', this.nodes.info)); Menu.makeButton(this, button); return; } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 44504edd9..2f5b8520f 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index 462e5711a..b68bf7c0d 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.20.6 +// @version 1.14.21.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -219,7 +219,7 @@ docSet = function() { }; g = { - VERSION: '1.14.20.6', + VERSION: '1.14.21.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -538,6 +538,7 @@ Config = (function() { 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], + 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], 'Front page': ['1', 'Jump to front page.'], @@ -3709,53 +3710,58 @@ a:only-of-type > .remove {\n\ bottom: 2px;\n\ vertical-align: baseline;\n\ }\n\ -.gal-buttons,\n\ -.gal-name,\n\ -.gal-count {\n\ +.gal-labels {\n\ position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-count,\n\ -.gal-hide-thumbnails .gal-name {\n\ - right: 44px;\n\ -}\n\ -.gal-name {\n\ bottom: 6px;\n\ + display: -webkit-flex;\n\ + display: flex;\n\ + -webkit-flex-direction: column;\n\ + flex-direction: column;\n\ + -webkit-align-items: flex-end;\n\ + align-items: flex-end;\n\ +}\n\ +:root:not(.show-sauce) .gal-sauce {\n\ + display: none;\n\ +}\n\ +.gal-name,\n\ +.gal-count,\n\ +.gal-sauce {\n\ background: rgba(0,0,0,0.6) !important;\n\ border-radius: 3px;\n\ padding: 1px 5px 2px 5px;\n\ + margin-top: 3px;\n\ + color: #ffffff !important;\n\ text-decoration: none !important;\n\ - color: white !important;\n\ +}\n\ +.gal-sauce a {\n\ + color: #ffffff !important;\n\ }\n\ .gal-name:hover,\n\ -.gal-buttons a:hover {\n\ +.gal-buttons a:hover,\n\ +.gal-sauce a:hover {\n\ color: rgb(95, 95, 101) !important;\n\ }\n\ :root.gal-pdf .gal-buttons a:hover {\n\ color: rgb(204, 204, 204) !important;\n\ }\n\ -.gal-count {\n\ - bottom: 27px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - color: #ffffff !important;\n\ +.gal-buttons,\n\ +.gal-labels {\n\ + position: fixed;\n\ + right: 195px;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-name {\n\ +.gal-hide-thumbnails .gal-buttons,\n\ +.gal-hide-thumbnails .gal-labels {\n\ + right: 44px;\n\ +}\n\ +:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ bottom: 23px !important;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-count {\n\ - bottom: 44px !important;\n\ -}\n\ :root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-name,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-count {\n\ +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ right: 178px !important;\n\ }\n\ :root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-name,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-count {\n\ +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ right: 28px !important;\n\ }\n\ :root.gallery-open.fixed #header-bar:not(.autohide),\n\ @@ -11421,7 +11427,7 @@ Index = (function() { this.navLinks = $.el('div', { className: 'navLinks json-index' }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); + $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); if (!BoardConfig.isArchived(g.BOARD.ID)) { $('.archlistlink', this.navLinks).hidden = true; @@ -11831,7 +11837,8 @@ Index = (function() { 'last-long-reply': 'lastlong', 'creation-date': 'birth', 'reply-count': 'replycount', - 'file-count': 'filecount' + 'file-count': 'filecount', + 'posts-per-minute': 'activity' } }, processHash: function() { @@ -12391,11 +12398,12 @@ Index = (function() { $.add(thread.OP.nodes.post, nodes.replies); }, sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs; + var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; if (!liveThreadData) { return; } + tmp_time = new Date().getTime() / 1000; sortType = Index.currentSort.replace(/-rev$/, ''); Index.sortedThreadIDs = (function() { var k, len1; @@ -12459,6 +12467,12 @@ Index = (function() { }).map(function(post) { return post.no; }); + case 'activity': + return slice.call(liveThreadData).sort(function(a, b) { + return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); + }).map(function(post) { + return post.no; + }); default: return liveThreadIDs; } @@ -14580,13 +14594,14 @@ Gallery = (function() { nodes.el = dialog = $.el('div', { id: 'a-gallery' }); - $.extend(dialog, {innerHTML: "
× /
"}); + $.extend(dialog, {innerHTML: "
×
/
"}); ref = { buttons: '.gal-buttons', frame: '.gal-image', name: '.gal-name', count: '.count', total: '.total', + sauce: '.gal-sauce', thumbs: '.gal-thumbnails', next: '.gal-image a', current: '.gal-image img' @@ -14701,7 +14716,7 @@ Gallery = (function() { return file; }, open: function(thumb) { - var el, file, newID, nodes, oldID, post, ref; + var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; nodes = Gallery.nodes; oldID = +nodes.current.dataset.id; newID = +thumb.dataset.id; @@ -14738,6 +14753,18 @@ Gallery = (function() { nodes.name.href = thumb.href; nodes.frame.scrollTop = 0; nodes.next.focus(); + $.rmAll(nodes.sauce); + if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { + sauces = []; + ref1 = Sauce.links; + for (i = 0, len = ref1.length; i < len; i++) { + link = ref1[i]; + if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { + sauces.push($.tn(' '), node); + } + } + $.add(nodes.sauce, sauces); + } if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { Gallery.setupTimer(); } else { @@ -14834,6 +14861,8 @@ Gallery = (function() { return Gallery.cb.rotateLeft; case Conf['Rotate image clockwise']: return Gallery.cb.rotateRight; + case Conf['Download Gallery Image']: + return Gallery.cb.download; } })(); if (!cb) { @@ -14887,6 +14916,11 @@ Gallery = (function() { toggleSlideshow: function() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); }, + download: function() { + var name; + name = $('.gal-name'); + return name.click(); + }, pause: function() { var current; Gallery.cb.stop(); @@ -16164,6 +16198,7 @@ Sauce = (function() { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { return; } + $.addClass(doc, 'show-sauce'); links = []; ref1 = Conf['sauces'].split('\n'); for (j = 0, len = ref1.length; j < len; j++) { @@ -17873,7 +17908,7 @@ Menu = (function() { if (this.isClone) { button = $('.menu-button', this.nodes.info); $.rmClass(button, 'active'); - $.rm($('.dialog', button)); + $.rm($('.dialog', this.nodes.info)); Menu.makeButton(this, button); return; } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index fba1df52b..5bfe7bf51 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index ab51ec028..8cf89f5d0 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.20.6 +// @version 1.14.21.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a3e4859a3..fbe9909e4 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.20.6 +// @version 1.14.21.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -219,7 +219,7 @@ docSet = function() { }; g = { - VERSION: '1.14.20.6', + VERSION: '1.14.21.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -538,6 +538,7 @@ Config = (function() { 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], + 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], 'Front page': ['1', 'Jump to front page.'], @@ -3709,53 +3710,58 @@ a:only-of-type > .remove {\n\ bottom: 2px;\n\ vertical-align: baseline;\n\ }\n\ -.gal-buttons,\n\ -.gal-name,\n\ -.gal-count {\n\ +.gal-labels {\n\ position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-count,\n\ -.gal-hide-thumbnails .gal-name {\n\ - right: 44px;\n\ -}\n\ -.gal-name {\n\ bottom: 6px;\n\ + display: -webkit-flex;\n\ + display: flex;\n\ + -webkit-flex-direction: column;\n\ + flex-direction: column;\n\ + -webkit-align-items: flex-end;\n\ + align-items: flex-end;\n\ +}\n\ +:root:not(.show-sauce) .gal-sauce {\n\ + display: none;\n\ +}\n\ +.gal-name,\n\ +.gal-count,\n\ +.gal-sauce {\n\ background: rgba(0,0,0,0.6) !important;\n\ border-radius: 3px;\n\ padding: 1px 5px 2px 5px;\n\ + margin-top: 3px;\n\ + color: #ffffff !important;\n\ text-decoration: none !important;\n\ - color: white !important;\n\ +}\n\ +.gal-sauce a {\n\ + color: #ffffff !important;\n\ }\n\ .gal-name:hover,\n\ -.gal-buttons a:hover {\n\ +.gal-buttons a:hover,\n\ +.gal-sauce a:hover {\n\ color: rgb(95, 95, 101) !important;\n\ }\n\ :root.gal-pdf .gal-buttons a:hover {\n\ color: rgb(204, 204, 204) !important;\n\ }\n\ -.gal-count {\n\ - bottom: 27px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - color: #ffffff !important;\n\ +.gal-buttons,\n\ +.gal-labels {\n\ + position: fixed;\n\ + right: 195px;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-name {\n\ +.gal-hide-thumbnails .gal-buttons,\n\ +.gal-hide-thumbnails .gal-labels {\n\ + right: 44px;\n\ +}\n\ +:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ bottom: 23px !important;\n\ }\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-count {\n\ - bottom: 44px !important;\n\ -}\n\ :root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-name,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-count {\n\ +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ right: 178px !important;\n\ }\n\ :root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-name,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-count {\n\ +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ right: 28px !important;\n\ }\n\ :root.gallery-open.fixed #header-bar:not(.autohide),\n\ @@ -11421,7 +11427,7 @@ Index = (function() { this.navLinks = $.el('div', { className: 'navLinks json-index' }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); + $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); if (!BoardConfig.isArchived(g.BOARD.ID)) { $('.archlistlink', this.navLinks).hidden = true; @@ -11831,7 +11837,8 @@ Index = (function() { 'last-long-reply': 'lastlong', 'creation-date': 'birth', 'reply-count': 'replycount', - 'file-count': 'filecount' + 'file-count': 'filecount', + 'posts-per-minute': 'activity' } }, processHash: function() { @@ -12391,11 +12398,12 @@ Index = (function() { $.add(thread.OP.nodes.post, nodes.replies); }, sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs; + var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; if (!liveThreadData) { return; } + tmp_time = new Date().getTime() / 1000; sortType = Index.currentSort.replace(/-rev$/, ''); Index.sortedThreadIDs = (function() { var k, len1; @@ -12459,6 +12467,12 @@ Index = (function() { }).map(function(post) { return post.no; }); + case 'activity': + return slice.call(liveThreadData).sort(function(a, b) { + return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); + }).map(function(post) { + return post.no; + }); default: return liveThreadIDs; } @@ -14580,13 +14594,14 @@ Gallery = (function() { nodes.el = dialog = $.el('div', { id: 'a-gallery' }); - $.extend(dialog, {innerHTML: "
× /
"}); + $.extend(dialog, {innerHTML: "
×
/
"}); ref = { buttons: '.gal-buttons', frame: '.gal-image', name: '.gal-name', count: '.count', total: '.total', + sauce: '.gal-sauce', thumbs: '.gal-thumbnails', next: '.gal-image a', current: '.gal-image img' @@ -14701,7 +14716,7 @@ Gallery = (function() { return file; }, open: function(thumb) { - var el, file, newID, nodes, oldID, post, ref; + var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; nodes = Gallery.nodes; oldID = +nodes.current.dataset.id; newID = +thumb.dataset.id; @@ -14738,6 +14753,18 @@ Gallery = (function() { nodes.name.href = thumb.href; nodes.frame.scrollTop = 0; nodes.next.focus(); + $.rmAll(nodes.sauce); + if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { + sauces = []; + ref1 = Sauce.links; + for (i = 0, len = ref1.length; i < len; i++) { + link = ref1[i]; + if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { + sauces.push($.tn(' '), node); + } + } + $.add(nodes.sauce, sauces); + } if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { Gallery.setupTimer(); } else { @@ -14834,6 +14861,8 @@ Gallery = (function() { return Gallery.cb.rotateLeft; case Conf['Rotate image clockwise']: return Gallery.cb.rotateRight; + case Conf['Download Gallery Image']: + return Gallery.cb.download; } })(); if (!cb) { @@ -14887,6 +14916,11 @@ Gallery = (function() { toggleSlideshow: function() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); }, + download: function() { + var name; + name = $('.gal-name'); + return name.click(); + }, pause: function() { var current; Gallery.cb.stop(); @@ -16164,6 +16198,7 @@ Sauce = (function() { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { return; } + $.addClass(doc, 'show-sauce'); links = []; ref1 = Conf['sauces'].split('\n'); for (j = 0, len = ref1.length; j < len; j++) { @@ -17873,7 +17908,7 @@ Menu = (function() { if (this.isClone) { button = $('.menu-button', this.nodes.info); $.rmClass(button, 'active'); - $.rm($('.dialog', button)); + $.rm($('.dialog', this.nodes.info)); Menu.makeButton(this, button); return; } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 58fd44131..57100d14f 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.json b/builds/updates-beta.json index 8e5b8ce9d..0216f7f0b 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.20.6", + "version": "1.14.21.0", "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" } ] diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 89fdfb4bb..b3b64d548 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.json b/builds/updates.json index a72d32638..5a527432d 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.20.6", + "version": "1.14.21.0", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index aefc50b63..82f4fe128 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index 12f93c53b..95c08d255 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.20.6", - "date": "2021-01-15T06:56:17.947Z" + "version": "1.14.21.0", + "date": "2021-01-15T07:16:21.680Z" } \ No newline at end of file