From d71e0951c999e9ac88e798f240bed3af2f78c405 Mon Sep 17 00:00:00 2001 From: Noble pleb Date: Fri, 29 Nov 2013 21:00:19 +0200 Subject: [PATCH 1/6] Update archives.json archiving /pol/ now too --- json/archives.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json/archives.json b/json/archives.json index 3cf455d73..435f105b9 100644 --- a/json/archives.json +++ b/json/archives.json @@ -32,8 +32,8 @@ "http": true, "https": true, "software": "foolfuuka", - "boards": ["hr", "s4s", "tg", "tv", "x"], - "files": ["hr", "s4s", "tg", "tv", "x"] + "boards": ["hr", "pol", "s4s", "tg", "tv", "x"], + "files": ["hr", "pol", "s4s", "tg", "tv", "x"] }, { "uid": 4, "name": "Nyafuu", From 089090d3c5e0a29830a0fbb59470de9ae51035ee Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 2 Dec 2013 04:03:38 -0800 Subject: [PATCH 2/6] linkification: only 1 level of balanced parens --- src/Linkification/Linkify.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 845d9b9a5..8c0cfa351 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -30,10 +30,10 @@ Linkify = ( # One or more: [^\s()<>]+ # Run of non-space, non-()<> | # or - \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels + \([^\s()<>]+\) # balanced parens, up to 1 level )+ ( # End with: - \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels + \([^\s()<>]+\) # balanced parens, up to 1 level | # or [^\s`!()\[\]{};:'".,<>?«»“”‘’] # not a space or one of these punct chars ) From 1e621a7fe47cb25106d62d9baef90cf740020a4c Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 5 Dec 2013 17:44:01 +0100 Subject: [PATCH 3/6] Fix #1363. --- src/General/Header.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 2c72877bc..7399ca4c1 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -225,12 +225,12 @@ Header = setCatalogLinks: (useCatalog) -> Header.catalogToggler.checked = useCatalog as = $$ [ - '#board-list a[href*="boards.4chan.org"]' - '#boardNavDesktop a[href*="boards.4chan.org"]' - '#boardNavDesktopFoot a[href*="boards.4chan.org"]' + '#board-list a' + '#boardNavDesktop a' + '#boardNavDesktopFoot a' ].join ', ' path = if useCatalog then 'catalog' else '' - for a in as when not a.dataset.only + for a in as when a.hostname is 'boards.4chan.org' and not a.dataset.only a.pathname = "/#{a.pathname.split('/')[1]}/#{path}" return toggleCatalogLinks: -> From 3efffe8a6edf3e469d9c6e9f9e1dedc03252f596 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 5 Dec 2013 17:44:01 +0100 Subject: [PATCH 4/6] Fix 4chan X for markup change. --- CHANGELOG.md | 2 ++ css/style.css | 3 +++ src/General/Build.coffee | 8 ++++---- src/General/Clone.coffee | 3 +-- src/General/Post.coffee | 15 ++++++++------- src/Images/Sauce.coffee | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c505b232b..97e101ba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fix 4chan X breaking in threads following a 4chan markup change. + ### 3.14.1 - *2013-11-25* - Minor cooldown fix: diff --git a/css/style.css b/css/style.css index 278565f97..d0bdfff8d 100644 --- a/css/style.css +++ b/css/style.css @@ -55,6 +55,9 @@ a[href="javascript:;"] { .post { overflow: visible !important; } +.fileText { + margin: 0 20px; +} [hidden] { display: none !important; } diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 28b66a699..292d9362b 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -167,15 +167,15 @@ Build = filename = a.innerHTML.replace /'/g, ''' fileDims = if ext is 'pdf' then 'PDF' else "#{file.width}x#{file.height}" - fileInfo = "File: #{file.timestamp}" + + fileInfo = "
File: #{file.timestamp}" + "-(#{fileSize}, #{fileDims}#{ if file.isSpoiler '' else - ", #{shortFilename}" - }" + ")" + ", #{shortFilename}" + }" + ")
" - fileHTML = "
#{fileInfo}
#{imgSrc}
" + fileHTML = "
#{fileInfo}#{imgSrc}
" else fileHTML = '' diff --git a/src/General/Clone.coffee b/src/General/Clone.coffee index abb51c327..50d1da316 100644 --- a/src/General/Clone.coffee +++ b/src/General/Clone.coffee @@ -52,8 +52,7 @@ class Clone extends Post for key, val of origin.file @file[key] = val file = $ '.file', post - @file.info = file.firstElementChild - @file.text = @file.info.firstElementChild + @file.text = file.firstElementChild @file.thumb = $ 'img[data-md5]', file @file.fullImage = $ '.full-image', file diff --git a/src/General/Post.coffee b/src/General/Post.coffee index f7bc31918..2da5ed5e3 100644 --- a/src/General/Post.coffee +++ b/src/General/Post.coffee @@ -109,15 +109,13 @@ class Post return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl # Supports JPG/PNG/GIF/PDF. # Flash files are not supported. - alt = thumb.alt anchor = thumb.parentNode - fileInfo = fileEl.firstElementChild + fileText = fileEl.firstElementChild @file = - info: fileInfo - text: fileInfo.firstElementChild + text: fileText thumb: thumb URL: anchor.href - size: alt.match(/[\d.]+\s\w+/)[0] + size: thumb.alt.match(/[\d.]+\s\w+/)[0] MD5: thumb.dataset.md5 isSpoiler: $.hasClass anchor, 'imgspoiler' size = +@file.size.match(/[\d.]+/)[0] @@ -128,7 +126,10 @@ class Post thumb.src else "#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" - @file.name = $('span[title]', fileInfo).title + @file.name = if nameNode = $ 'span', fileText + nameNode.title or nameNode.textContent + else + fileText.title <% if (type === 'crx') { %> # replace %22 with quotes, see: # crbug.com/81193 @@ -138,7 +139,7 @@ class Post @file.name = @file.name.replace /%22/g, '"' <% } %> if @file.isImage = /(jpg|png|gif)$/i.test @file.name - @file.dimensions = @file.text.textContent.match(/\d+x\d+/)[0] + @file.dimensions = fileText.textContent.match(/\d+x\d+/)[0] kill: (file, now) -> now or= new Date() diff --git a/src/Images/Sauce.coffee b/src/Images/Sauce.coffee index 10ffeff95..b7ce89779 100644 --- a/src/Images/Sauce.coffee +++ b/src/Images/Sauce.coffee @@ -40,4 +40,4 @@ Sauce = for link in Sauce.links # \u00A0 is nbsp nodes.push $.tn('\u00A0'), link @, Sauce.link.cloneNode true - $.add @file.info, nodes + $.add @file.text, nodes From cff5f21e390c3ff090e9c22aee1efaae33a6c403 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 7 Dec 2013 00:04:23 +0100 Subject: [PATCH 5/6] Release 4chan X v3.14.2. --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e101ba9..fe1ec0421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### 3.14.2 - *2013-12-07* + - Fix 4chan X breaking in threads following a 4chan markup change. ### 3.14.1 - *2013-11-25* diff --git a/package.json b/package.json index ba2bcc342..97875ede3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "3.14.1", + "version": "3.14.2", "description": "Cross-browser extension for productive lurking on 4chan.", "meta": { "name": "4chan X", From d46660e63313d0e60d5719db718dd1f5236b4f61 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 7 Dec 2013 00:22:25 +0100 Subject: [PATCH 6/6] Only set the file info margin for replies, not OPs. --- css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index d0bdfff8d..4d4347ff1 100644 --- a/css/style.css +++ b/css/style.css @@ -55,7 +55,7 @@ a[href="javascript:;"] { .post { overflow: visible !important; } -.fileText { +.reply > .file > .fileText { margin: 0 20px; } [hidden] {