From 8b2eab632bbe7aa5fe7f338b9c90461221a0166a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 29 Apr 2013 03:10:44 +0200 Subject: [PATCH 1/3] Some custom board nav fixes. --- src/General/Header.coffee | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index cc714549e..a2a665607 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -125,22 +125,22 @@ Header = for a in as if a.textContent is board a = a.cloneNode true - if /-title/.test t - a.textContent = a.title - else if /-replace/.test t - if $.hasClass a, 'current' - a.textContent = a.title + + a.textContent = if /-title/.test(t) or /-replace/.test(t) and $.hasClass a, 'current' + a.title else if /-full/.test t - a.textContent = "/#{board}/ - #{a.title}" - else if /-(index|catalog|text)/.test t - if m = t.match /-(index|catalog)/ - a.setAttribute 'data-only', m[1] - a.href = "//boards.4chan.org/#{board}/" - a.href += 'catalog' if m[1] is 'catalog' - if m = t.match /-text:"(.+)"/ - a.textContent = m[1] - else if board is '@' - $.addClass a, 'navSmall' + "/#{board}/ - #{a.title}" + else if m = t.match /-text:"(.+)"/ + m[1] + else + a.textContent + + if m = t.match /-(index|catalog)/ + a.setAttribute 'data-only', m[1] + a.href = "//boards.4chan.org/#{board}/" + a.href += 'catalog' if m[1] is 'catalog' + + $.addClass a, 'navSmall' if board is '@' return a $.tn t $.add list, nodes From 6d306d55d800176d98b90202f6108104880320be Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 29 Apr 2013 03:33:23 +0200 Subject: [PATCH 2/3] Better error logging. --- lib/$.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/$.coffee b/lib/$.coffee index 89451e20b..53a6a7dce 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -282,7 +282,7 @@ $.set = do -> items = {} localItems = {} catch err - c.error err + c.error err.stack (key, val) -> if typeof key is 'string' From f07ccc69911714705e0693e644bcf0b5f86d6ab2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 29 Apr 2013 12:57:53 +0200 Subject: [PATCH 3/3] Update archive redirection for nyafuu. --- src/Archive/Redirect.coffee | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 3697b2825..6d09aa6f6 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -10,14 +10,14 @@ Redirect = "//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 'ck', 'fa', 'lit', 's4s' "//fuuka.warosu.org/#{boardID}/full_image/#{filename}" - when 'cgl', 'g', 'mu', 'w' + when 'cgl', 'g', 'mu' "//rbt.asia/#{boardID}/full_image/#{filename}" when 'an', 'k', 'toy', 'x' "http://archive.heinessen.com/#{boardID}/full_image/#{filename}" - when 'c' - "//archive.nyafuu.org/#{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. @@ -26,10 +26,12 @@ Redirect = "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 'c', 'int', 'out', 'po' + 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}" # for fuuka-based archives: # https://github.com/eksopl/fuuka/issues/27 to: (data) -> @@ -43,16 +45,16 @@ Redirect = 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 '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', 'w' + 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 - when 'c' - Redirect.path '//archive.nyafuu.org', 'fuuka', data else if data.threadID then "//boards.4chan.org/#{boardID}/" else '' path: (base, archiver, data) ->