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
*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.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

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

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "4chan X",
"version": "1.3.0",
"version": "1.3.1",
"manifest_version": 2,
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"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",
"version": "1.3.0",
"version": "1.3.1",
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",

View File

@ -14,6 +14,7 @@ Index =
el: $.el 'span', textContent: 'Index mode'
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="infinite"> Infinite scrolling' }
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="all pages"> All threads' }
]
for label in modeEntry.subEntries
@ -109,7 +110,7 @@ Index =
$.after $.id('delform'), Index.pagelist
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
return Index.endNotice() if pageNum >= Index.pagesNum
nodesPerPage = Index.threadsNumPerPage * 2
@ -163,7 +164,7 @@ Index =
getCurrentPage: ->
+window.location.pathname.split('/')[2]
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
else
Index.pageNav pageNum
@ -173,7 +174,7 @@ Index =
Index.pageLoad pageNum
pageLoad: (pageNum) ->
Index.currentPage = pageNum
return if Conf['Index Mode'] isnt 'paged'
return if Conf['Index Mode'] is 'all pages'
Index.buildIndex()
Index.setPage()
Index.scrollToIndex()
@ -186,7 +187,7 @@ Index =
getMaxPageNum: ->
Math.max 0, Index.getPagesNum() - 1
togglePagelist: ->
Index.pagelist.hidden = Conf['Index Mode'] isnt 'paged'
Index.pagelist.hidden = Conf['Index Mode'] is 'all pages'
buildPagelist: ->
pagesRoot = $ '.pages', Index.pagelist
maxPageNum = Index.getMaxPageNum()
@ -406,7 +407,7 @@ Index =
return
buildIndex: ->
if Conf['Index Mode'] is 'paged'
if Conf['Index Mode'] isnt 'all pages'
pageNum = Index.getCurrentPage()
nodesPerPage = Index.threadsNumPerPage * 2
nodes = Index.sortedNodes[nodesPerPage * pageNum ... nodesPerPage * (pageNum + 1)]
@ -444,7 +445,7 @@ Index =
<% } %>
Index.sort()
# 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()
if Index.currentPage is pageNum
Index.buildIndex()

View File

@ -18,10 +18,10 @@
:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {
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);
}
:root.burichan #custom-board-list .current:hover {
:root.burichan.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2);
}

View File

@ -18,10 +18,10 @@
:root.futaba #header-bar a, :root.futaba #notifications a {
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);
}
:root.futaba #custom-board-list .current:hover {
:root.futaba.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2);
}

View File

@ -18,10 +18,10 @@
:root.photon #header-bar a, :root.photon #notifications a {
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);
}
:root.photon #custom-board-list .current:hover {
:root.photon.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,51,0,0.2);
}

View File

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

View File

@ -15,10 +15,10 @@
:root.tomorrow #header-bar a, :root.tomorrow #notifications a {
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);
}
:root.tomorrow #custom-board-list .current:hover {
:root.tomorrow.fixed #custom-board-list .current:hover {
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 {
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);
}
: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);
}

View File

@ -18,10 +18,10 @@
:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {
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);
}
:root.yotsuba #custom-board-list .current:hover {
:root.yotsuba.fixed #custom-board-list .current:hover {
border-bottom-color: rgba(255,0,0,0.2);
}

View File

@ -93,10 +93,10 @@ Keybinds =
when Conf['Open front page']
$.open "/#{g.BOARD}/"
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()
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()
when Conf['Search form']
Index.searchInput.focus()