From 41f4142aefdf53935a83efd389eb4dae488f5f02 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sun, 5 May 2013 18:04:57 +0200 Subject: [PATCH 01/16] Update node engine version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 36c92bc37..d8972ecfd 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,6 @@ "license": "MIT", "readmeFilename": "README.md", "engines": { - "node": ">=0.8" + "node": ">=0.10" } } From f1b6647475d7269cb3446c6b76fef128c24e1536 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sun, 5 May 2013 18:20:27 +0200 Subject: [PATCH 02/16] Fix #1082. --- CHANGELOG.md | 2 ++ src/Quotelinks/QuotePreview.coffee | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89237475b..477d2c7e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fix quote previews getting 'stuck' in Opera. + ### 3.3.1 - *2013-05-04* - Fix whitespaces not being preserved in code tags in /g/. diff --git a/src/Quotelinks/QuotePreview.coffee b/src/Quotelinks/QuotePreview.coffee index e1b9f47ed..399bf5ce6 100644 --- a/src/Quotelinks/QuotePreview.coffee +++ b/src/Quotelinks/QuotePreview.coffee @@ -28,6 +28,21 @@ QuotePreview = cb: QuotePreview.mouseout asapTest: -> qp.firstElementChild + <% if (type === 'userjs') { %> + # XXX Opera workaround for "no mouseout fired" bug. + # Remove it once Opera uses Blink. + root = @ + workaround = (e) -> + if @ is root + e.stopPropagation() + return + $.event 'mouseout', null, root + $.off d, 'mousemove', workaround + $.off root, 'mousemove', workaround + $.on d, 'mousemove', workaround + $.on root, 'mousemove', workaround + <% } %> + return unless origin = g.posts["#{boardID}.#{postID}"] if Conf['Quote Highlighting'] From 538e117746a235a5f83af1ffb056ca27d9aac6bd Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 6 May 2013 06:57:29 +0200 Subject: [PATCH 03/16] Add archive selection. --- CHANGELOG.md | 3 + Gruntfile.js | 1 + css/style.css | 12 ++ html/General/Settings-section-Archives.html | 12 ++ json/archives.json | 100 +++++++++++++ json/archives1.json | 101 +++++++++++++ src/Archive/Redirect.coffee | 158 +++++++++----------- src/General/Get.coffee | 6 +- src/General/Main.coffee | 11 +- src/General/Settings.coffee | 64 ++++++++ src/Images/ImageExpand.coffee | 5 +- src/Images/ImageHover.coffee | 5 +- src/Menu/ArchiveLink.coffee | 8 +- src/Quotelinks/Quotify.coffee | 4 +- 14 files changed, 384 insertions(+), 106 deletions(-) create mode 100644 html/General/Settings-section-Archives.html create mode 100644 json/archives.json create mode 100644 json/archives1.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 477d2c7e4..4a032da5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +- **New feature**: `Archive selection` + - Select which archive you want for specific boards and redirection type. + - Access it in the `Archives` tab of the Settings window. - Fix quote previews getting 'stuck' in Opera. ### 3.3.1 - *2013-05-04* diff --git a/Gruntfile.js b/Gruntfile.js index d2ce937a1..38dc200ba 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -122,6 +122,7 @@ module.exports = function(grunt) { 'src/**/*', 'html/**/*', 'css/**/*', + 'json/**/*', 'img/**/*' ], tasks: 'build' diff --git a/css/style.css b/css/style.css index 0aa8ffa2d..520faec69 100644 --- a/css/style.css +++ b/css/style.css @@ -358,6 +358,18 @@ a[href="javascript:;"] { .section-rice textarea { height: 150px; } +.section-archives table { + width: 100%; +} +.section-archives th:not(:first-child) { + width: 30%; +} +.section-archives td { + text-align: center; +} +.section-archives select { + width: 90%; +} #fourchanx-settings fieldset { border: 1px solid; border-radius: 3px; diff --git a/html/General/Settings-section-Archives.html b/html/General/Settings-section-Archives.html new file mode 100644 index 000000000..086b33d92 --- /dev/null +++ b/html/General/Settings-section-Archives.html @@ -0,0 +1,12 @@ +
404 Redirect is disabled.
+

Disabled selections indicate that only one archive is available for that board and redirection type.

+ + + + + + + + + +
Archived boards
BoardThread redirectionPost fetchingFile redirection
diff --git a/json/archives.json b/json/archives.json new file mode 100644 index 000000000..405c30029 --- /dev/null +++ b/json/archives.json @@ -0,0 +1,100 @@ +[{ + "uid": 0, + "name": "Foolz", + "domain": "archive.foolz.us", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["a", "co", "gd", "jp", "m", "q", "sp", "tg", "tv", "vp", "vr", "wsg"], + "files": ["a", "gd", "jp", "m", "q", "tg", "vp", "vr", "wsg"] +}, { + "uid": 1, + "name": "NSFW Foolz", + "domain": "nsfw.foolz.us", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["u"], + "files": ["u"] +}, { + "uid": 2, + "name": "The Dark Cave", + "domain": "archive.thedarkcave.org", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["c", "int", "out", "po"], + "files": ["c", "po"] +}, { + "uid": 3, + "name": "4plebs", + "domain": "archive.4plebs.org", + "http": true, + "https": false, + "software": "foolfuuka", + "boards": ["hr", "tg", "tv", "x"], + "files": ["hr", "tg", "tv", "x"] +}, { + "uid": 4, + "name": "Nyafuu", + "domain": "archive.nyafuu.org", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["c", "w", "wg"], + "files": ["c", "w", "wg"] +}, { + "uid": 5, + "name": "Love is Over", + "domain": "loveisover.me", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["d", "h", "v"], + "files": ["d", "h", "v"] +}, { + "uid": 6, + "name": "nth-chan", + "domain": "nth.pensivenonsen.se", + "http": true, + "https": false, + "software": "foolfuuka", + "boards": [], + "files": [] +}, { + "uid": 7, + "name": "Install Gentoo", + "domain": "archive.installgentoo.net", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["diy", "g", "sci"], + "files": [] +}, { + "uid": 8, + "name": "Rebecca Black Tech", + "domain": "rbt.asia", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["cgl", "g", "mu", "w"], + "files": ["cgl", "g", "mu", "w"] +}, { + "uid": 9, + "name": "Heinessen", + "domain": "archive.heinessen.com", + "http": true, + "https": false, + "software": "fuuka", + "boards": ["an", "fit", "k", "mlp", "r9k", "toy", "x"], + "files": ["an", "k", "toy", "x"] +}, { + "uid": 10, + "name": "warosu", + "domain": "fuuka.warosu.org", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "s4s", "tg", "vr"], + "files": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "s4s", "vr"] +}] diff --git a/json/archives1.json b/json/archives1.json new file mode 100644 index 000000000..ed724e4f6 --- /dev/null +++ b/json/archives1.json @@ -0,0 +1,101 @@ +{ + "Foolz": { + "uid": 0, + "domain": "archive.foolz.us", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["a", "co", "gd", "jp", "m", "q", "sp", "tg", "tv", "vp", "vr", "wsg"], + "files": ["a", "gd", "jp", "m", "q", "tg", "vp", "vr", "wsg"] + }, + "NSFW Foolz": { + "uid": 1, + "domain": "nsfw.foolz.us", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["u"], + "files": ["u"] + }, + "The Dark Cave": { + "uid": 2, + "domain": "archive.thedarkcave.org", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["c", "int", "out", "po"], + "files": ["c", "po"] + }, + "4plebs": { + "uid": 3, + "domain": "archive.4plebs.org", + "http": true, + "https": false, + "software": "foolfuuka", + "boards": ["hr", "tg", "tv", "x"], + "files": ["hr", "tg", "tv", "x"] + }, + "Nyafuu": { + "uid": 4, + "domain": "archive.nyafuu.org", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["c", "w", "wg"], + "files": ["c", "w", "wg"] + }, + "Love is Over": { + "uid": 5, + "domain": "loveisover.me", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["d", "h", "v"], + "files": ["d", "h", "v"] + }, + "nth-chan": { + "uid": 6, + "domain": "nth.pensivenonsen.se", + "http": true, + "https": false, + "software": "foolfuuka", + "boards": ["vg"], + "files": ["vg"] + }, + "Install Gentoo": { + "uid": 7, + "domain": "archive.installgentoo.net", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["diy", "g", "sci"], + "files": [] + }, + "Rebecca Black Tech": { + "uid": 8, + "domain": "rbt.asia", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["cgl", "g", "mu", "w"], + "files": ["cgl", "g", "mu", "w"] + }, + "Heinessen": { + "uid": 9, + "domain": "archive.heinessen.com", + "http": true, + "https": false, + "software": "fuuka", + "boards": ["an", "fit", "k", "mlp", "r9k", "toy", "x"], + "files": ["an", "k", "toy", "x"] + }, + "warosu": { + "uid": 10, + "domain": "fuuka.warosu.org", + "http": true, + "https": true, + "software": "fuuka", + "boards": ["cgl", "ck", "fa", "jp", "lit", "q", "s4s", "tg", "vr"], + "files": ["cgl", "ck", "fa", "jp", "lit", "q", "s4s", "tg", "vr"] + } +} diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index da18202c7..284cda71f 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -1,102 +1,78 @@ Redirect = - image: (boardID, filename) -> - # Do not use g.BOARD, the image url can originate from a cross-quote. - switch boardID - when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vp', 'vr', 'wsg' - "//archive.foolz.us/#{boardID}/full_image/#{filename}" - when 'u' - "//nsfw.foolz.us/#{boardID}/full_image/#{filename}" - when 'po' - "//archive.thedarkcave.org/#{boardID}/full_image/#{filename}" - when 'hr', 'tv' - "http://archive.4plebs.org/#{boardID}/full_image/#{filename}" - when 'c', 'w', 'wg' - "//archive.nyafuu.org/#{boardID}/full_image/#{filename}" - when 'd', 'h', 'v' - "//loveisover.me/#{boardID}/full_image/#{filename}" - when 'vg' - "http://nth.pensivenonsen.se/#{boardID}/full_image/#{filename}" - when 'ck', 'fa', 'lit', 's4s' - "//fuuka.warosu.org/#{boardID}/full_image/#{filename}" - when 'cgl', 'g', 'mu' - "//rbt.asia/#{boardID}/full_image/#{filename}" - when 'an', 'k', 'toy', 'x' - "http://archive.heinessen.com/#{boardID}/full_image/#{filename}" - post: (boardID, postID) -> - # XXX foolz had HSTS set for 120 days, which broke XHR+CORS+Redirection when on HTTP. - # Remove necessary HTTPS procotol in September 2013. - switch boardID - when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg' - "https://archive.foolz.us/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'u' - "https://nsfw.foolz.us/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'int', 'out', 'po' - "//archive.thedarkcave.org/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'hr', 'x' - "http://archive.4plebs.org/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'c', 'w', 'wg' - "//archive.nyafuu.org/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'd', 'h', 'v' - "//loveisover.me/_/api/chan/post/?board=#{boardID}&num=#{postID}" - when 'vg' - "http://nth.pensivenonsen.se/_/api/chan/post/?board=#{boardID}&num=#{postID}" - # for fuuka-based archives: - # https://github.com/eksopl/fuuka/issues/27 - to: (data) -> - {boardID} = data - switch boardID - when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg' - Redirect.path '//archive.foolz.us', 'foolfuuka', data - when 'u' - Redirect.path '//nsfw.foolz.us', 'foolfuuka', data - when 'int', 'out', 'po' - Redirect.path '//archive.thedarkcave.org', 'foolfuuka', data - when 'hr' - Redirect.path 'http://archive.4plebs.org', 'foolfuuka', data - when 'c', 'w', 'wg' - Redirect.path '//archive.nyafuu.org', 'foolfuuka', data - when 'd', 'h', 'v' - Redirect.path '//loveisover.me', 'foolfuuka', data - when 'vg' - Redirect.path 'http://nth.pensivenonsen.se', 'foolfuuka', data - when 'ck', 'fa', 'lit', 's4s' - Redirect.path '//fuuka.warosu.org', 'fuuka', data - when 'diy', 'g', 'sci' - Redirect.path '//archive.installgentoo.net', 'fuuka', data - when 'cgl', 'mu' - Redirect.path '//rbt.asia', 'fuuka', data - when 'an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x' - Redirect.path 'http://archive.heinessen.com', 'fuuka', data - else - if data.threadID then "//boards.4chan.org/#{boardID}/" else '' - path: (base, archiver, data) -> - if data.isSearch - {boardID, type, value} = data - type = if type is 'name' - 'username' - else if type is 'MD5' - 'image' - else - type - value = encodeURIComponent value - return if archiver is 'foolfuuka' - "#{base}/#{boardID}/search/#{type}/#{value}" - else if type is 'image' - "#{base}/#{boardID}/?task=search2&search_media_hash=#{value}" - else - "#{base}/#{boardID}/?task=search2&search_#{type}=#{value}" + archives: `<%= JSON.stringify(grunt.file.readJSON('json/archives.json')) %>` + thread: {} + post: {} + file: {} - {boardID, threadID, postID} = data - # keep the number only if the location.hash was sent f.e. + init: -> + for boardID, data of Conf['selectedArchives'] + for type, uid of data + for archive in Redirect.archives + continue if archive.uid isnt uid or type is 'post' and archive.software isnt 'foolfuuka' + arr = if type is 'file' + archive.files + else + archive.boards + Redirect[type][boardID] = archive if boardID in arr + for archive in Redirect.archives + for boardID in archive.boards + unless boardID of Redirect.thread + Redirect.thread[boardID] = archive + unless boardID of Redirect.post or archive.software isnt 'foolfuuka' + Redirect.post[boardID] = archive + unless boardID of Redirect.file or boardID not in archive.files + Redirect.file[boardID] = archive + return + + to: (dest, data) -> + archive = (if dest is 'search' then Redirect.thread else Redirect[dest])[data.boardID] + return '' unless archive + Redirect[dest] archive, data + + protocol: (archive) -> + protocol = location.protocol + unless archive[protocol[0...-1]] + protocol = if protocol is 'https:' then 'http:' else 'https:' + "#{protocol}//" + + thread: (archive, {boardID, threadID, postID}) -> + # Keep the post number only if the location.hash was sent f.e. path = if threadID "#{boardID}/thread/#{threadID}" else "#{boardID}/post/#{postID}" - if archiver is 'foolfuuka' + if archive.software is 'foolfuuka' path += '/' if threadID and postID - path += if archiver is 'foolfuuka' + path += if archive.software is 'foolfuuka' "##{postID}" else "#p#{postID}" - "#{base}/#{path}" + "#{Redirect.protocol archive}#{archive.domain}/#{path}" + + post: (archive, {boardID, postID}) -> + # For fuuka-based archives: + # https://github.com/eksopl/fuuka/issues/27 + protocol = Redirect.protocol archive + # XXX foolz had HSTS set for 120 days, which broke XHR+CORS+Redirection when on HTTP. + # Remove necessary HTTPS procotol in September 2013. + if archive.name in ['Foolz', 'NSFW Foolz'] + protocol = 'https://' + "#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}" + + file: (archive, {boardID, filename}) -> + "#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}" + + search: (archive, {boardID, type, value}) -> + type = if type is 'name' + 'username' + else if type is 'MD5' + 'image' + else + type + value = encodeURIComponent value + path = if archive.software is 'foolfuuka' + "#{boardID}/search/#{type}/#{value}" + else + "#{boardID}/?task=search2&search_#{if type is 'image' then 'media_hash' else type}=#{value}" + "#{Redirect.protocol archive}#{archive.domain}/#{path}" diff --git a/src/General/Get.coffee b/src/General/Get.coffee index adcc770ce..235d2781e 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -71,7 +71,7 @@ Get = if threadID $.cache "//api.4chan.org/#{boardID}/res/#{threadID}.json", -> Get.fetchedPost @, boardID, threadID, postID, root, context - else if url = Redirect.post boardID, postID + else if url = Redirect.to 'post', {boardID, postID} $.cache url, -> Get.archivedPost @, boardID, postID, root, context insert: (post, root, context) -> @@ -97,7 +97,7 @@ Get = {status} = req if status not in [200, 304] # The thread can die by the time we check a quote. - if url = Redirect.post boardID, postID + if url = Redirect.to 'post', {boardID, postID} $.cache url, -> Get.archivedPost @, boardID, postID, root, context else @@ -115,7 +115,7 @@ Get = break if post.no is postID # we found it! if post.no > postID # The post can be deleted by the time we check a quote. - if url = Redirect.post boardID, postID + if url = Redirect.to 'post', {boardID, postID} $.cache url, -> Get.archivedPost @, boardID, postID, root, context else diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 18d9b5fba..35b4363bc 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -14,6 +14,7 @@ Main = flatten null, Config for db in DataBoards Conf[db] = boards: {} + Conf['selectedArchives'] = {} $.get Conf, Main.initFeatures $.on d, '4chanMainInit', Main.initStyle @@ -43,8 +44,11 @@ Main = when 'images.4chan.org' $.ready -> if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found' - url = Redirect.image pathname[1], pathname[3] - location.href = url if url + Redirect.init() + URL = Redirect.to 'file', + boardID: pathname[1] + filename: pathname[3] + location.href = URL if URL return initFeature = (name, module) -> @@ -65,6 +69,7 @@ Main = initFeature 'Announcement Hiding', PSAHiding initFeature 'Fourchan thingies', Fourchan initFeature 'Custom CSS', CustomCSS + initFeature 'Redirect', Redirect initFeature 'Resurrect Quotes', Quotify initFeature 'Filter', Filter initFeature 'Thread Hiding', ThreadHiding @@ -148,7 +153,7 @@ Main = initReady: -> if d.title is '4chan - 404 Not Found' if Conf['404 Redirect'] and g.VIEW is 'thread' - href = Redirect.to + href = Redirect.to 'thread', boardID: g.BOARD.ID threadID: g.THREADID postID: +location.hash.match /\d+/ # post number or 0 diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 42739d968..87edb431a 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -41,6 +41,7 @@ Settings = Settings.addSection 'QR', Settings.qr Settings.addSection 'Sauce', Settings.sauce Settings.addSection 'Rice', Settings.rice + Settings.addSection 'Archives', Settings.archives Settings.addSection 'Keybinds', Settings.keybinds $.on d, 'AddSettingsSection', Settings.addSection $.on d, 'OpenSettings', (e) -> Settings.open e.detail @@ -386,6 +387,69 @@ Settings = usercss: -> CustomCSS.update() + archives: (section) -> + section.innerHTML = """ + <%= grunt.file.read('html/General/Settings-section-Archives.html').replace(/>\s+<').trim() %> + """ + + boards = {} + for archive in Redirect.archives + for boardID in archive.boards + data = boards[boardID] or= { + thread: [] + post: [] + file: [] + } + data.thread.push archive + if archive.software is 'foolfuuka' + data.post.push archive + if boardID in archive.files + data.file.push archive + + rows = [] + for boardID in Object.keys(boards).sort() # Alphabetical order + row = $.el 'tr' + rows.push row + $.add row, $.el 'th', + textContent: "/#{boardID}/" + className: if boardID is g.BOARD.ID then 'warning' else '' + + data = boards[boardID] + Settings.addArchiveCell row, boardID, data, 'thread' + Settings.addArchiveCell row, boardID, data, 'post' + Settings.addArchiveCell row, boardID, data, 'file' + $.add $('tbody', section), rows + $.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) -> + for boardID, data of selectedArchives + for type, uid of data + if option = $ "select[data-boardid='#{boardID}'][data-type='#{type}'] > option[value='#{uid}']", section + option.selected = true + return + addArchiveCell: (row, boardID, data, type) -> + options = [] + for archive in data[type] + options.push $.el 'option', + textContent: archive.name + value: archive.uid + td = $.el 'td' + {length} = options + if length + td.innerHTML = '' + select = td.firstElementChild + unless select.disabled = length is 1 + # XXX GM can't into datasets + select.setAttribute 'data-boardid', boardID + select.setAttribute 'data-type', type + $.on select, 'change', Settings.saveSelectedArchive + $.add select, options + else + td.textContent = 'N/A' + $.add row, td + saveSelectedArchive: -> + $.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) => + (selectedArchives[@dataset.boardid] or= {})[@dataset.type] = +@value + $.set 'selectedArchives', selectedArchives + keybinds: (section) -> section.innerHTML = """ <%= grunt.file.read('html/General/Settings-section-Keybinds.html').replace(/>\s+<').trim() %> diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 7735ed990..38284688f 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -136,7 +136,10 @@ ImageExpand = src = @src.split '/' if src[2] is 'images.4chan.org' - if URL = Redirect.image src[3], src[5] + URL = Redirect.to 'file', + boardID: src[3] + filename: src[5].replace /\?.+$/, '' + if URL setTimeout ImageExpand.expand, 10000, post, URL return if g.DEAD or post.isDead or post.file.isDead diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index f6f2945ab..cff961806 100644 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -28,7 +28,10 @@ ImageHover = src = @src.split '/' if src[2] is 'images.4chan.org' - if URL = Redirect.image src[3], src[5].replace /\?.+$/, '' + URL = Redirect.to 'file', + boardID: src[3] + filename: src[5].replace /\?.+$/, '' + if URL @src = URL return if g.DEAD or post.isDead or post.file.isDead diff --git a/src/Menu/ArchiveLink.coffee b/src/Menu/ArchiveLink.coffee index a3a6fd184..f691d6f95 100644 --- a/src/Menu/ArchiveLink.coffee +++ b/src/Menu/ArchiveLink.coffee @@ -10,8 +10,7 @@ ArchiveLink = el: div order: 90 open: ({ID, thread, board}) -> - redirect = Redirect.to {postID: ID, threadID: thread.ID, boardID: board.ID} - redirect isnt "//boards.4chan.org/#{board}/" + !!Redirect.to 'thread', {postID: ID, threadID: thread.ID, boardID: board.ID} subEntries: [] for type in [ @@ -35,18 +34,17 @@ ArchiveLink = open = if type is 'post' ({ID, thread, board}) -> - el.href = Redirect.to {postID: ID, threadID: thread.ID, boardID: board.ID} + el.href = Redirect.to 'thread', {postID: ID, threadID: thread.ID, boardID: board.ID} true else (post) -> value = Filter[type] post # We want to parse the exact same stuff as the filter does already. return false unless value - el.href = Redirect.to + el.href = Redirect.to 'search', boardID: post.board.ID type: type value: value - isSearch: true true return { diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 8319439f5..0acd189f9 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -47,14 +47,14 @@ Quotify = a.setAttribute 'data-boardid', boardID a.setAttribute 'data-threadid', post.thread.ID a.setAttribute 'data-postid', postID - else if redirect = Redirect.to {boardID, threadID: 0, postID} + else if redirect = Redirect.to 'thread', {boardID, threadID: 0, postID} # Replace the .deadlink span if we can redirect. a = $.el 'a', href: redirect className: 'deadlink' target: '_blank' textContent: "#{quote}\u00A0(Dead)" - if Redirect.post boardID, postID + if Redirect.to 'post', {boardID, postID} # Make it function as a normal quote if we can fetch the post. $.addClass a, 'quotelink' a.setAttribute 'data-boardid', boardID From a542242aafafd652e7ac2d59959babb9a06ba857 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 6 May 2013 16:15:17 +0200 Subject: [PATCH 04/16] Accidentally staged a wrong file. --- json/archives1.json | 101 -------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 json/archives1.json diff --git a/json/archives1.json b/json/archives1.json deleted file mode 100644 index ed724e4f6..000000000 --- a/json/archives1.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "Foolz": { - "uid": 0, - "domain": "archive.foolz.us", - "http": true, - "https": true, - "software": "foolfuuka", - "boards": ["a", "co", "gd", "jp", "m", "q", "sp", "tg", "tv", "vp", "vr", "wsg"], - "files": ["a", "gd", "jp", "m", "q", "tg", "vp", "vr", "wsg"] - }, - "NSFW Foolz": { - "uid": 1, - "domain": "nsfw.foolz.us", - "http": true, - "https": true, - "software": "foolfuuka", - "boards": ["u"], - "files": ["u"] - }, - "The Dark Cave": { - "uid": 2, - "domain": "archive.thedarkcave.org", - "http": true, - "https": true, - "software": "foolfuuka", - "boards": ["c", "int", "out", "po"], - "files": ["c", "po"] - }, - "4plebs": { - "uid": 3, - "domain": "archive.4plebs.org", - "http": true, - "https": false, - "software": "foolfuuka", - "boards": ["hr", "tg", "tv", "x"], - "files": ["hr", "tg", "tv", "x"] - }, - "Nyafuu": { - "uid": 4, - "domain": "archive.nyafuu.org", - "http": true, - "https": true, - "software": "foolfuuka", - "boards": ["c", "w", "wg"], - "files": ["c", "w", "wg"] - }, - "Love is Over": { - "uid": 5, - "domain": "loveisover.me", - "http": true, - "https": true, - "software": "foolfuuka", - "boards": ["d", "h", "v"], - "files": ["d", "h", "v"] - }, - "nth-chan": { - "uid": 6, - "domain": "nth.pensivenonsen.se", - "http": true, - "https": false, - "software": "foolfuuka", - "boards": ["vg"], - "files": ["vg"] - }, - "Install Gentoo": { - "uid": 7, - "domain": "archive.installgentoo.net", - "http": true, - "https": true, - "software": "fuuka", - "boards": ["diy", "g", "sci"], - "files": [] - }, - "Rebecca Black Tech": { - "uid": 8, - "domain": "rbt.asia", - "http": true, - "https": true, - "software": "fuuka", - "boards": ["cgl", "g", "mu", "w"], - "files": ["cgl", "g", "mu", "w"] - }, - "Heinessen": { - "uid": 9, - "domain": "archive.heinessen.com", - "http": true, - "https": false, - "software": "fuuka", - "boards": ["an", "fit", "k", "mlp", "r9k", "toy", "x"], - "files": ["an", "k", "toy", "x"] - }, - "warosu": { - "uid": 10, - "domain": "fuuka.warosu.org", - "http": true, - "https": true, - "software": "fuuka", - "boards": ["cgl", "ck", "fa", "jp", "lit", "q", "s4s", "tg", "vr"], - "files": ["cgl", "ck", "fa", "jp", "lit", "q", "s4s", "tg", "vr"] - } -} From 7c274450ac7a3ebc91b498d890255b163036d3b4 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 6 May 2013 18:38:15 +0200 Subject: [PATCH 05/16] More Unread scrolling fixes. --- src/Monitoring/Unread.coffee | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 1ff2c20f2..79a4f072b 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -30,6 +30,7 @@ Unread = for ID, post of Unread.thread.posts posts.push post if post.isReply Unread.addPosts posts + return unless Conf['Scroll to Last Read Post'] Unread.scroll() scroll: -> @@ -43,11 +44,15 @@ Unread = break if prevID is post.ID prevID = post.ID break unless post.isHidden - root.scrollIntoView false - return - # Scroll to the last read post. - posts = Object.keys Unread.thread.posts - Header.scrollToPost Unread.thread.posts[posts[posts.length - 1]].nodes.root + onload = -> root.scrollIntoView false + else + # Scroll to the last read post. + posts = Object.keys Unread.thread.posts + post = Unread.thread.posts[posts[posts.length - 1]] + onload = -> Header.scrollToPost post.nodes.root + # Prevent the browser to scroll back to + # the previous scroll location on page load. + $.on window, 'load', onload sync: -> lastReadPost = Unread.db.get From 39c3d35a72751ba6d279ff03a154899beade9dfc Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 6 May 2013 21:53:57 +0200 Subject: [PATCH 06/16] Update archived boards list every 4 days. --- CHANGELOG.md | 2 ++ src/Archive/Redirect.coffee | 23 +++++++++++++++++++++-- src/General/Main.coffee | 1 + src/General/Settings.coffee | 9 +++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a032da5c..d1ad99845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ - **New feature**: `Archive selection` - Select which archive you want for specific boards and redirection type. - Access it in the `Archives` tab of the Settings window. +- The list of archived boards will now update automatically, separately from 4chan X updates. + - If you're an archiver and want [data](https://github.com/MayhemYDG/4chan-x/blob/v3/json/archives.json) about your archive to be updated, added or removed: send a PR or open an issue. - Fix quote previews getting 'stuck' in Opera. ### 3.3.1 - *2013-05-04* diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 284cda71f..de882bd74 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -5,16 +5,18 @@ Redirect = file: {} init: -> + Redirect.update() + for boardID, data of Conf['selectedArchives'] for type, uid of data - for archive in Redirect.archives + for archive in Conf['archives'] continue if archive.uid isnt uid or type is 'post' and archive.software isnt 'foolfuuka' arr = if type is 'file' archive.files else archive.boards Redirect[type][boardID] = archive if boardID in arr - for archive in Redirect.archives + for archive in Conf['archives'] for boardID in archive.boards unless boardID of Redirect.thread Redirect.thread[boardID] = archive @@ -24,6 +26,23 @@ Redirect = Redirect.file[boardID] = archive return + update: -> + items = + lastarchivecheck: 0 + lastupdate: 0 + $.get items, (items) -> + now = Date.now() + # Update the list of archives every 4 days. + # The list is also update when 4chan X gets updated. + if items.lastupdate > now - 4 * $.DAY or items.lastarchivecheck > now - 4 * $.DAY + return + $.ajax '<%= meta.page %>json/archives.json', onload: -> + return unless @status is 200 + Conf['archives'] = JSON.parse @response + $.set + lastarchivecheck: now + archives: Conf['archives'] + to: (dest, data) -> archive = (if dest is 'search' then Redirect.thread else Redirect[dest])[data.boardID] return '' unless archive diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 35b4363bc..d91d27326 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -15,6 +15,7 @@ Main = for db in DataBoards Conf[db] = boards: {} Conf['selectedArchives'] = {} + Conf['archives'] = Redirect.archives $.get Conf, Main.initFeatures $.on d, '4chanMainInit', Main.initStyle diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 87edb431a..93f9f14e7 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -32,8 +32,13 @@ Settings = new Notification 'info', el, 30 else $.on d, '4chanXInitFinished', Settings.open + # The archive list will always be updated with 4chan X updates. + Conf['archives'] = Redirect.archives + now = Date.now() $.set - lastupdate: Date.now() + archives: Conf['archives'] + lastarchivecheck: now + lastupdate: now previousversion: g.VERSION Settings.addSection 'Main', Settings.main @@ -393,7 +398,7 @@ Settings = """ boards = {} - for archive in Redirect.archives + for archive in Conf['archives'] for boardID in archive.boards data = boards[boardID] or= { thread: [] From 06cb261613c8cd99bb8da3b9fd47fb476180bc41 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 6 May 2013 23:58:53 +0200 Subject: [PATCH 07/16] Release 4chan X v3.4.0. --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ad99845..9fa94b692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 3.4.0 - *2013-05-06* + - **New feature**: `Archive selection` - Select which archive you want for specific boards and redirection type. - Access it in the `Archives` tab of the Settings window. diff --git a/package.json b/package.json index d8972ecfd..98546d004 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "3.3.1", + "version": "3.4.0", "description": "Cross-browser extension for productive lurking on 4chan.", "meta": { "name": "4chan X", From 56ea8a52e07b0099ba73256018cb4a9615dd7049 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 8 May 2013 16:04:19 +0200 Subject: [PATCH 08/16] No need to check lastupdate when updating the archives list. --- src/Archive/Redirect.coffee | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index de882bd74..18f6c090c 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -27,15 +27,11 @@ Redirect = return update: -> - items = - lastarchivecheck: 0 - lastupdate: 0 - $.get items, (items) -> + $.get lastarchivecheck, 0, ({lastarchivecheck}) -> now = Date.now() # Update the list of archives every 4 days. # The list is also update when 4chan X gets updated. - if items.lastupdate > now - 4 * $.DAY or items.lastarchivecheck > now - 4 * $.DAY - return + return if lastarchivecheck > now - 4 * $.DAY $.ajax '<%= meta.page %>json/archives.json', onload: -> return unless @status is 200 Conf['archives'] = JSON.parse @response From 2211f0160b6a2c718503fdb3f460f7a16bf57ee7 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 8 May 2013 16:40:39 +0200 Subject: [PATCH 09/16] Key needs to be a string. --- src/Archive/Redirect.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 18f6c090c..b02253e5c 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -27,7 +27,7 @@ Redirect = return update: -> - $.get lastarchivecheck, 0, ({lastarchivecheck}) -> + $.get 'lastarchivecheck', 0, ({lastarchivecheck}) -> now = Date.now() # Update the list of archives every 4 days. # The list is also update when 4chan X gets updated. From 17b4a6a2f93a1e57390b3e45cad658c205587d28 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 8 May 2013 21:34:10 +0200 Subject: [PATCH 10/16] Replace join('\n') with triple quotes. --- src/General/Config.coffee | 122 ++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 65 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index f53f67de8..19df555be 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -78,67 +78,59 @@ Config = 'Expand spoilers': [false, 'Expand all images along with spoilers.'] 'Expand from here': [true, 'Expand all images only from current position to thread end.'] filter: - name: [ - '# Filter any namefags:' - '#/^(?!Anonymous$)/' - ].join '\n' - uniqueID: [ - '# Filter a specific ID:' - '#/Txhvk1Tl/' - ].join '\n' - tripcode: [ - '# Filter any tripfag' - '#/^!/' - ].join '\n' - capcode: [ - '# Set a custom class for mods:' - '#/Mod$/;highlight:mod;op:yes' - '# Set a custom class for moot:' - '#/Admin$/;highlight:moot;op:yes' - ].join '\n' - email: [ - '# Filter any e-mails that are not `sage` on /a/ and /jp/:' - '#/^(?!sage$)/;boards:a,jp' - ].join '\n' - subject: [ - '# Filter Generals on /v/:' - '#/general/i;boards:v;op:only' - ].join '\n' - comment: [ - '# Filter Stallman copypasta on /g/:' - '#/what you\'re refer+ing to as linux/i;boards:g' - ].join '\n' - flag: [ - '' - ].join '\n' - filename: [ - '' - ].join '\n' - dimensions: [ - '# Highlight potential wallpapers:' - '#/1920x1080/;op:yes;highlight;top:no;boards:w,wg' - ].join '\n' - filesize: [ - '' - ].join '\n' - MD5: [ - '' - ].join '\n' - sauces: [ - 'https://www.google.com/searchbyimage?image_url=%TURL' - 'http://iqdb.org/?url=%TURL' - '#//tineye.com/search?url=%TURL' - '#http://saucenao.com/search.php?url=%TURL' - '#http://3d.iqdb.org/?url=%TURL' - '#http://regex.info/exif.cgi?imgurl=%URL' - '# uploaders:' - '#http://imgur.com/upload?url=%URL;text:Upload to imgur' - '#http://ompldr.org/upload?url1=%URL;text:Upload to ompldr' - '# "View Same" in archives:' - '#//archive.foolz.us/_/search/image/%MD5/;text:View same on foolz' - '#//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/' - '#//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/' - ].join '\n' + name: """ + # Filter any namefags: + #/^(?!Anonymous$)/ + """ + uniqueID: """ + # Filter a specific ID: + #/Txhvk1Tl/ + """ + tripcode: """ + # Filter any tripfag + #/^!/ + """ + capcode: """ + # Set a custom class for mods: + #/Mod$/;highlight:mod;op:yes + # Set a custom class for moot: + #/Admin$/;highlight:moot;op:yes + """ + email: """ + # Filter any e-mails that are not `sage` on /a/ and /jp/: + #/^(?!sage$)/;boards:a,jp + """ + subject: """ + # Filter Generals on /v/: + #/general/i;boards:v;op:only + """ + comment: """ + # Filter Stallman copypasta on /g/: + #/what you're refer+ing to as linux/i;boards:g + """ + flag: "" + filename: "" + dimensions: """ + # Highlight potential wallpapers: + #/1920x1080/;op:yes;highlight;top:no;boards:w,wg + """ + filesize: "" + MD5: "" + sauces: """ + https://www.google.com/searchbyimage?image_url=%TURL + http://iqdb.org/?url=%TURL + #//tineye.com/search?url=%TURL + #http://saucenao.com/search.php?url=%TURL + #http://3d.iqdb.org/?url=%TURL + #http://regex.info/exif.cgi?imgurl=%URL + # uploaders: + #http://imgur.com/upload?url=%URL;text:Upload to imgur + #http://ompldr.org/upload?url1=%URL;text:Upload to ompldr + # "View Same" in archives: + #//archive.foolz.us/_/search/image/%MD5/;text:View same on foolz + #//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/ + #//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/ + """ 'Custom CSS': false Header: 'Header auto-hide': false @@ -148,10 +140,10 @@ Config = 'Bottom Board List': false 'Custom Board Navigation': true QR: - 'QR.personas': [ - '#email:"sage";boards:jp;always' - 'email:"sage"' - ].join '\n' + 'QR.personas': """ + #email:"sage";boards:jp;always + email:"sage" + """ boardnav: '[current-title / toggle-all]' time: '%m/%d/%y(%a)%H:%M:%S' backlink: '>>%id' From fd5abbc35596f57ed8e511bc34b09fb67a72e230 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 8 May 2013 23:09:40 +0200 Subject: [PATCH 11/16] Make Main.initStyle start sooner on the catalog. --- src/General/Header.coffee | 2 +- src/General/Main.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index a2a665607..c2fa2dccb 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -74,7 +74,7 @@ Header = return unless Main.isThisPageLegit() # Wait for #boardNavMobile instead of #boardNavDesktop, # it might be incomplete otherwise. - $.asap (-> $.id('boardNavMobile') or d.readyState is 'complete'), Header.setBoardList + $.asap (-> $.id('boardNavMobile') or d.readyState in ['interactive', 'complete']), Header.setBoardList $.prepend d.body, headerEl $.ready -> diff --git a/src/General/Main.coffee b/src/General/Main.coffee index d91d27326..a9ac91c01 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -18,7 +18,8 @@ Main = Conf['archives'] = Redirect.archives $.get Conf, Main.initFeatures - $.on d, '4chanMainInit', Main.initStyle + $.asap (-> d.head and $('link[rel="shortcut icon"]', d.head) or d.readyState in ['interactive', 'complete']), + Main.initStyle initFeatures: (items) -> Conf = items @@ -118,7 +119,6 @@ Main = $.ready Main.initReady initStyle: -> - $.off d, '4chanMainInit', Main.initStyle return unless Main.isThisPageLegit() # disable the mobile layout $('link[href*=mobile]', d.head)?.disabled = true From 24a78353f68de6a0d20704654764c7a96ad8a2f9 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 9 May 2013 20:32:50 +0200 Subject: [PATCH 12/16] Update post builder. Let's say this does fix #954. --- src/General/Build.coffee | 47 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index be2fa89ad..691668805 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -35,7 +35,10 @@ Build = o.file = name: data.filename + data.ext timestamp: "#{data.tim}#{data.ext}" - url: "//images.4chan.org/#{boardID}/src/#{data.tim}#{data.ext}" + url: if boardID is 'f' + "//images.4channel.org/#{boardID}/src/#{data.filename}#{data.ext}" + else + "//images.4chan.org/#{boardID}/src/#{data.tim}#{data.ext}" height: data.h width: data.w MD5: data.md5 @@ -56,7 +59,7 @@ Build = } = o isOP = postID is threadID - staticPath = '//static.4chan.org' + staticPath = '//static.4chan.org/image/' if email emailStart = '' @@ -79,21 +82,21 @@ Build = capcodeClass = " capcodeAdmin" capcodeStart = " ## Admin" - capcode = " " when 'mod' capcodeClass = " capcodeMod" capcodeStart = " ## Mod" - capcode = " " when 'developer' capcodeClass = " capcodeDeveloper" capcodeStart = " ## Developer" - capcode = " " else @@ -103,21 +106,20 @@ Build = flag = if flagCode - " #{flagCode}" else '' if file?.isDeleted - fileHTML = - if isOP - "
" + - "File deleted." + - "
" - else - "
" + - "File deleted." + - "
" + fileHtml = if isOP + "
" + + "File deleted." + + "
" + else + "
" + + "File deleted." + + "
" else if file ext = file.name[-3..] if !file.twidth and !file.theight and ext is 'gif' # wtf ? @@ -130,16 +132,19 @@ Build = if file.isSpoiler fileSize = "Spoiler Image, #{fileSize}" unless isArchived - fileThumb = '//static.4chan.org/image/spoiler' + fileThumb = "#{staticPath}spoiler" if spoilerRange = Build.spoilerRange[boardID] # Randomize the spoiler image. fileThumb += "-#{boardID}" + Math.floor 1 + spoilerRange * Math.random() fileThumb += '.png' file.twidth = file.theight = 100 - if boardID.ID isnt 'f' - imgSrc = "
" + - "#{fileSize}" + imgSrc = if boardID is 'f' + '' + else + "" + + "#{fileSize}" + + "" # Ha ha, filenames! # html -> text, translate WebKit's %22s into "s @@ -175,12 +180,12 @@ Build = sticky = if isSticky - ' Sticky' + " Sticky" else '' closed = if isClosed - ' Closed' + " Closed" else '' From f235791873256a8f45b3a9fd370e6e35f7d3a98e Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 9 May 2013 20:46:14 +0200 Subject: [PATCH 13/16] Add the 'blink' class to the doc on Chrome. 'webkit' will be removed in the future. --- src/General/Main.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index a9ac91c01..d54a6aff2 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -122,7 +122,14 @@ Main = return unless Main.isThisPageLegit() # disable the mobile layout $('link[href*=mobile]', d.head)?.disabled = true - $.addClass doc, '<% if (type === 'crx') { %>webkit<% } else if (type === 'userjs') { %>presto<% } else { %>gecko<% } %>' + <% if (type === 'crx') { %> + $.addClass doc, 'webkit' + $.addClass doc, 'blink' + <% } else if (type === 'userjs') { %> + $.addClass doc, 'presto' + <% } else { %> + $.addClass doc, 'gecko' + <% } %> $.addClass doc, 'fourchan-x' $.addStyle Main.css From 6493be7643fdea2577b27c0999a84be1f677c183 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 9 May 2013 21:19:03 +0200 Subject: [PATCH 14/16] Add the "Foolz a Shit" archive. --- json/archives.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/json/archives.json b/json/archives.json index 405c30029..25c8a1a08 100644 --- a/json/archives.json +++ b/json/archives.json @@ -61,6 +61,15 @@ "software": "foolfuuka", "boards": [], "files": [] +}, { + "uid": 11, + "name": "Foolz a Shit", + "domain": "archive.foolzashit.com", + "http": true, + "https": true, + "software": "foolfuuka", + "boards": ["p"], + "files": ["p"] }, { "uid": 7, "name": "Install Gentoo", From df39a5b638654b7e033bcafc5094f8de9a9789fd Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 9 May 2013 23:53:04 +0200 Subject: [PATCH 15/16] Update deps. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98546d004..7a696844a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt-contrib-compress": "~0.5.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-watch": "~0.4.0", + "grunt-contrib-watch": "~0.4.1", "grunt-shell": "~0.2.2" }, "repository": { From d0fc792de0de7a8c09a3713366ac5a0c25159983 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 10 May 2013 02:55:24 +0200 Subject: [PATCH 16/16] Add all of Foolz a Shit's archived boards. --- json/archives.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json/archives.json b/json/archives.json index 25c8a1a08..a1f32bebc 100644 --- a/json/archives.json +++ b/json/archives.json @@ -68,8 +68,8 @@ "http": true, "https": true, "software": "foolfuuka", - "boards": ["p"], - "files": ["p"] + "boards": ["adv", "asp", "cm", "e", "i", "n", "o", "p", "s", "t", "trv", "y"], + "files": ["adv", "asp", "cm", "e", "i", "n", "o", "p", "s", "t", "trv", "y"] }, { "uid": 7, "name": "Install Gentoo",