implement #773
This commit is contained in:
parent
7476c51f0f
commit
a5463ac53e
@ -4324,6 +4324,9 @@
|
|||||||
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1],
|
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1],
|
||||||
className: 'external'
|
className: 'external'
|
||||||
});
|
});
|
||||||
|
if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[1] === g.BOARD.ID) {
|
||||||
|
a.className += ' current';
|
||||||
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
|
board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
|
||||||
@ -5005,7 +5008,7 @@
|
|||||||
if (!(hash = window.location.hash)) {
|
if (!(hash = window.location.hash)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(match = hash.match(/s=([\w]+)/))) {
|
if (!(match = hash.match(/s=([\w\s\n]+)/))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.searchInput.value = match[1];
|
this.searchInput.value = match[1];
|
||||||
|
|||||||
@ -4378,6 +4378,9 @@
|
|||||||
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1],
|
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1],
|
||||||
className: 'external'
|
className: 'external'
|
||||||
});
|
});
|
||||||
|
if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[1] === g.BOARD.ID) {
|
||||||
|
a.className += ' current';
|
||||||
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
|
board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
|
||||||
@ -5059,7 +5062,7 @@
|
|||||||
if (!(hash = window.location.hash)) {
|
if (!(hash = window.location.hash)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(match = hash.match(/s=([\w]+)/))) {
|
if (!(match = hash.match(/s=([\w\s\n]+)/))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.searchInput.value = match[1];
|
this.searchInput.value = match[1];
|
||||||
|
|||||||
@ -162,6 +162,8 @@ Header =
|
|||||||
href: (t.match(/\,"(.+)"/) || [null, '+'])[1]
|
href: (t.match(/\,"(.+)"/) || [null, '+'])[1]
|
||||||
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1]
|
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1]
|
||||||
className: 'external'
|
className: 'external'
|
||||||
|
if a.hostname is 'boards.4chan.org' and a.pathname.split('/')[1] is g.BOARD.ID
|
||||||
|
a.className += ' current'
|
||||||
return a
|
return a
|
||||||
|
|
||||||
board = if /^current/.test t
|
board = if /^current/.test t
|
||||||
|
|||||||
@ -288,7 +288,7 @@ Index =
|
|||||||
|
|
||||||
searchTest: (init) ->
|
searchTest: (init) ->
|
||||||
return false unless hash = window.location.hash
|
return false unless hash = window.location.hash
|
||||||
return false unless match = hash.match /s=([\w]+)/
|
return false unless match = hash.match /s=([\w\s\n]+)/
|
||||||
@searchInput.value = match[1]
|
@searchInput.value = match[1]
|
||||||
if init
|
if init
|
||||||
$.on d, '4chanXInitFinished', Index.onSearchInput
|
$.on d, '4chanXInitFinished', Index.onSearchInput
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Navigate =
|
|||||||
|
|
||||||
<% if (type === 'crx') { %>
|
<% if (type === 'crx') { %>
|
||||||
# blink/webkit throw a popstate on page load. Not what we want.
|
# blink/webkit throw a popstate on page load. Not what we want.
|
||||||
popstateHack = ->
|
popstateHack = ->
|
||||||
$.off window, 'popstate', popstateHack
|
$.off window, 'popstate', popstateHack
|
||||||
$.on window, 'popstate', Navigate.popstate
|
$.on window, 'popstate', Navigate.popstate
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ Navigate =
|
|||||||
$.set 'Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort
|
$.set 'Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort
|
||||||
Index.cb.sort()
|
Index.cb.sort()
|
||||||
result = true
|
result = true
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
navigate: (e) ->
|
navigate: (e) ->
|
||||||
@ -237,7 +237,7 @@ Navigate =
|
|||||||
if @id is 'popState'
|
if @id is 'popState'
|
||||||
Navigate.path = window.location
|
Navigate.path = window.location
|
||||||
else
|
else
|
||||||
Navigate.pushState path
|
Navigate.pushState path
|
||||||
|
|
||||||
Navigate.setMode @
|
Navigate.setMode @
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user