Conflicts:
	LICENSE
	builds/4chan-X.user.js
	builds/crx/script.js
	src/Archive/Redirect.coffee
	src/General/Index.coffee
This commit is contained in:
Zixaphir 2014-01-12 14:52:47 -07:00
commit 1b368e4edc
17 changed files with 70 additions and 48 deletions

View File

@ -1,3 +1,14 @@
### v1.3.1
*2014-01-12*
**seaweeedchan**:
- Turn infinite scrolling into new index mode
- Fix style issues with non-fixed header
**Zixaphir**:
- Add old infinite scrolling functionality
- Fix Redirect errors
## v1.3.0 ## v1.3.0
*2014-01-10* *2014-01-10*

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.3.0 - 2014-01-12 * 4chan X - Version 1.3.1 - 2014-01-12
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.3.0 // @version 1.3.1
// @minGMVer 1.13 // @minGMVer 1.13
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "4chan X", "name": "4chan X",
"version": "1.3.0", "version": "1.3.1",
"manifest_version": 2, "manifest_version": 2,
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"icons": { "icons": {

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
postMessage({version:'1.3.0'},'*') postMessage({version:'1.3.1'},'*')

View File

@ -1,6 +1,6 @@
{ {
"name": "4chan-X", "name": "4chan-X",
"version": "1.3.0", "version": "1.3.1",
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": { "meta": {
"name": "4chan X", "name": "4chan X",

View File

@ -14,6 +14,7 @@ Index =
el: $.el 'span', textContent: 'Index mode' el: $.el 'span', textContent: 'Index mode'
subEntries: [ subEntries: [
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="paged"> Paged' } { el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="paged"> Paged' }
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="infinite"> Infinite scrolling' }
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="all pages"> All threads' } { el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="all pages"> All threads' }
] ]
for label in modeEntry.subEntries for label in modeEntry.subEntries
@ -109,7 +110,7 @@ Index =
$.after $.id('delform'), Index.pagelist $.after $.id('delform'), Index.pagelist
scroll: $.debounce 100, -> scroll: $.debounce 100, ->
return if Index.req or Conf['Index Mode'] isnt 'paged' or (doc.scrollTop <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread' return if Index.req or Conf['Index Mode'] isnt 'infinite' or ((d.body.scrollTop or doc.scrollTop) <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread'
pageNum = Index.getCurrentPage() + 1 pageNum = Index.getCurrentPage() + 1
return Index.endNotice() if pageNum >= Index.pagesNum return Index.endNotice() if pageNum >= Index.pagesNum
nodesPerPage = Index.threadsNumPerPage * 2 nodesPerPage = Index.threadsNumPerPage * 2
@ -163,7 +164,7 @@ Index =
getCurrentPage: -> getCurrentPage: ->
+window.location.pathname.split('/')[2] +window.location.pathname.split('/')[2]
userPageNav: (pageNum) -> userPageNav: (pageNum) ->
if Conf['Refreshed Navigation'] and Conf['Index Mode'] is 'paged' if Conf['Refreshed Navigation'] and Conf['Index Mode'] isnt 'all pages'
Index.update pageNum Index.update pageNum
else else
Index.pageNav pageNum Index.pageNav pageNum
@ -173,7 +174,7 @@ Index =
Index.pageLoad pageNum Index.pageLoad pageNum
pageLoad: (pageNum) -> pageLoad: (pageNum) ->
Index.currentPage = pageNum Index.currentPage = pageNum
return if Conf['Index Mode'] isnt 'paged' return if Conf['Index Mode'] is 'all pages'
Index.buildIndex() Index.buildIndex()
Index.setPage() Index.setPage()
Index.scrollToIndex() Index.scrollToIndex()
@ -186,7 +187,7 @@ Index =
getMaxPageNum: -> getMaxPageNum: ->
Math.max 0, Index.getPagesNum() - 1 Math.max 0, Index.getPagesNum() - 1
togglePagelist: -> togglePagelist: ->
Index.pagelist.hidden = Conf['Index Mode'] isnt 'paged' Index.pagelist.hidden = Conf['Index Mode'] is 'all pages'
buildPagelist: -> buildPagelist: ->
pagesRoot = $ '.pages', Index.pagelist pagesRoot = $ '.pages', Index.pagelist
maxPageNum = Index.getMaxPageNum() maxPageNum = Index.getMaxPageNum()
@ -406,7 +407,7 @@ Index =
return return
buildIndex: -> buildIndex: ->
if Conf['Index Mode'] is 'paged' if Conf['Index Mode'] isnt 'all pages'
pageNum = Index.getCurrentPage() pageNum = Index.getCurrentPage()
nodesPerPage = Index.threadsNumPerPage * 2 nodesPerPage = Index.threadsNumPerPage * 2
nodes = Index.sortedNodes[nodesPerPage * pageNum ... nodesPerPage * (pageNum + 1)] nodes = Index.sortedNodes[nodesPerPage * pageNum ... nodesPerPage * (pageNum + 1)]
@ -444,7 +445,7 @@ Index =
<% } %> <% } %>
Index.sort() Index.sort()
# Go to the last available page if we were past the limit. # Go to the last available page if we were past the limit.
pageNum = Math.min pageNum, Index.getMaxPageNum() if Conf['Index Mode'] is 'paged' pageNum = Math.min pageNum, Index.getMaxPageNum() if Conf['Index Mode'] isnt 'all pages'
Index.buildPagelist() Index.buildPagelist()
if Index.currentPage is pageNum if Index.currentPage is pageNum
Index.buildIndex() Index.buildIndex()

View File

@ -18,10 +18,10 @@
:root.burichan #header-bar a, :root.burichan #header-bar #notifications a { :root.burichan #header-bar a, :root.burichan #header-bar #notifications a {
color: #34345C; color: #34345C;
} }
:root.burichan #custom-board-list .current { :root.burichan.fixed #custom-board-list .current {
border-bottom: 1px solid rgba(30, 30, 255, 0.2); border-bottom: 1px solid rgba(30, 30, 255, 0.2);
} }
:root.burichan #custom-board-list .current:hover { :root.burichan.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2); border-bottom-color: rgba(255,0,0,0.2);
} }

View File

@ -18,10 +18,10 @@
:root.futaba #header-bar a, :root.futaba #notifications a { :root.futaba #header-bar a, :root.futaba #notifications a {
color: #800000; color: #800000;
} }
:root.futaba #custom-board-list a.current { :root.futaba.fixed #custom-board-list a.current {
border-bottom: 1px solid rgba(178,0,0,0.2); border-bottom: 1px solid rgba(178,0,0,0.2);
} }
:root.futaba #custom-board-list .current:hover { :root.futaba.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2); border-bottom-color: rgba(255,0,0,0.2);
} }

View File

@ -18,10 +18,10 @@
:root.photon #header-bar a, :root.photon #notifications a { :root.photon #header-bar a, :root.photon #notifications a {
color: #FF6600; color: #FF6600;
} }
:root.photon #custom-board-list a.current { :root.photon.fixed #custom-board-list a.current {
border-bottom: 1px solid rgba(0,74,153,0.2); border-bottom: 1px solid rgba(0,74,153,0.2);
} }
:root.photon #custom-board-list .current:hover { :root.photon.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,51,0,0.2); border-bottom-color: rgba(255,51,0,0.2);
} }

View File

@ -164,6 +164,8 @@ div.center:not(.ad-cnt) {
#header-bar { #header-bar {
border-width: 0; border-width: 0;
transition: all .1s .05s ease-in-out; transition: all .1s .05s ease-in-out;
}
:root.fixed #header-bar {
box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20); box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);
} }
#custom-board-list .current { #custom-board-list .current {

View File

@ -15,10 +15,10 @@
:root.tomorrow #header-bar a, :root.tomorrow #notifications a { :root.tomorrow #header-bar a, :root.tomorrow #notifications a {
color: #81A2BE; color: #81A2BE;
} }
:root.tomorrow #custom-board-list a.current { :root.tomorrow.fixed #custom-board-list a.current {
border-bottom: 1px solid rgba(83,124,160,0.4); border-bottom: 1px solid rgba(83,124,160,0.4);
} }
:root.tomorrow #custom-board-list .current:hover { :root.tomorrow.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(95,137,172,0.4); border-bottom-color: rgba(95,137,172,0.4);
} }

View File

@ -18,10 +18,10 @@
:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a { :root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {
color: #34345C; color: #34345C;
} }
:root.yotsuba-b #custom-board-list .current { :root.yotsuba-b.fixed #custom-board-list .current {
border-bottom: 1px solid rgba(30, 30, 255, 0.2); border-bottom: 1px solid rgba(30, 30, 255, 0.2);
} }
:root.yotsuba-b #custom-board-list .current:hover { :root.yotsuba-b.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2); border-bottom-color: rgba(255,0,0,0.2);
} }

View File

@ -18,10 +18,10 @@
:root.yotsuba #board-list a, :root.yotsuba #shortcuts a { :root.yotsuba #board-list a, :root.yotsuba #shortcuts a {
color: #800000; color: #800000;
} }
:root.yotsuba #custom-board-list a.current { :root.yotsuba.fixed #custom-board-list a.current {
border-bottom: 1px solid rgba(178,0,0,0.2); border-bottom: 1px solid rgba(178,0,0,0.2);
} }
:root.yotsuba #custom-board-list .current:hover { :root.yotsuba.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2); border-bottom-color: rgba(255,0,0,0.2);
} }

View File

@ -93,10 +93,10 @@ Keybinds =
when Conf['Open front page'] when Conf['Open front page']
$.open "/#{g.BOARD}/" $.open "/#{g.BOARD}/"
when Conf['Next page'] when Conf['Next page']
return unless g.VIEW is 'index' and Conf['Index Mode'] is 'paged' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'all pages'
$('.next button', Index.pagelist).click() $('.next button', Index.pagelist).click()
when Conf['Previous page'] when Conf['Previous page']
return unless g.VIEW is 'index' and Conf['Index Mode'] is 'paged' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'all pages'
$('.prev button', Index.pagelist).click() $('.prev button', Index.pagelist).click()
when Conf['Search form'] when Conf['Search form']
Index.searchInput.focus() Index.searchInput.focus()