One more thing from master branch
This commit is contained in:
parent
c45807c9b9
commit
282a2338d8
@ -12640,13 +12640,32 @@
|
|||||||
}
|
}
|
||||||
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
||||||
},
|
},
|
||||||
|
setMode: function(a) {
|
||||||
|
var indexMode, indexSort, result, _ref;
|
||||||
|
_ref = a.dataset, indexMode = _ref.indexMode, indexSort = _ref.indexSort;
|
||||||
|
result = false;
|
||||||
|
if (indexMode && Conf['Index Mode'] !== indexMode) {
|
||||||
|
$.set('Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode);
|
||||||
|
Index.cb.mode();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
if (indexSort && Conf['Index Sort'] !== indexSort) {
|
||||||
|
$.set('Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort);
|
||||||
|
Index.cb.sort();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
navigate: function(e) {
|
navigate: function(e) {
|
||||||
var boardID, indexMode, indexSort, load, pageNum, path, threadID, view, _, _ref, _ref1;
|
var boardID, load, pageNum, path, threadID, view, _, _ref;
|
||||||
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org') {
|
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
if (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)) {
|
if (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)) {
|
||||||
|
if ((e != null ? e.button : void 0) !== 2) {
|
||||||
|
Navigate.setMode(this);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12655,7 +12674,11 @@
|
|||||||
ThreadUpdater.update();
|
ThreadUpdater.update();
|
||||||
} else {
|
} else {
|
||||||
if (!Index.searchTest()) {
|
if (!Index.searchTest()) {
|
||||||
Index.update();
|
if (Navigate.setMode(this)) {
|
||||||
|
Index.buildIndex();
|
||||||
|
} else {
|
||||||
|
Index.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
@ -12692,15 +12715,7 @@
|
|||||||
history.pushState(null, '', path);
|
history.pushState(null, '', path);
|
||||||
}
|
}
|
||||||
Navigate.path = this.pathname;
|
Navigate.path = this.pathname;
|
||||||
_ref1 = this.dataset, indexMode = _ref1.indexMode, indexSort = _ref1.indexSort;
|
Navigate.setMode(this);
|
||||||
if (indexMode && Conf['Index Mode'] !== indexMode) {
|
|
||||||
$.set('Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode);
|
|
||||||
Index.cb.mode();
|
|
||||||
}
|
|
||||||
if (indexSort && Conf['Index Sort'] !== indexSort) {
|
|
||||||
$.set('Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort);
|
|
||||||
Index.cb.sort();
|
|
||||||
}
|
|
||||||
if (!(view === 'index' && 'index' === g.VIEW && boardID === g.BOARD.ID)) {
|
if (!(view === 'index' && 'index' === g.VIEW && boardID === g.BOARD.ID)) {
|
||||||
Navigate.disconnect();
|
Navigate.disconnect();
|
||||||
Navigate.updateContext(view);
|
Navigate.updateContext(view);
|
||||||
|
|||||||
@ -12659,13 +12659,32 @@
|
|||||||
}
|
}
|
||||||
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
||||||
},
|
},
|
||||||
|
setMode: function(a) {
|
||||||
|
var indexMode, indexSort, result, _ref;
|
||||||
|
_ref = a.dataset, indexMode = _ref.indexMode, indexSort = _ref.indexSort;
|
||||||
|
result = false;
|
||||||
|
if (indexMode && Conf['Index Mode'] !== indexMode) {
|
||||||
|
$.set('Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode);
|
||||||
|
Index.cb.mode();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
if (indexSort && Conf['Index Sort'] !== indexSort) {
|
||||||
|
$.set('Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort);
|
||||||
|
Index.cb.sort();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
navigate: function(e) {
|
navigate: function(e) {
|
||||||
var boardID, indexMode, indexSort, load, pageNum, path, threadID, view, _, _ref, _ref1;
|
var boardID, load, pageNum, path, threadID, view, _, _ref;
|
||||||
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org') {
|
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
if (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)) {
|
if (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)) {
|
||||||
|
if ((e != null ? e.button : void 0) !== 2) {
|
||||||
|
Navigate.setMode(this);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12674,7 +12693,11 @@
|
|||||||
ThreadUpdater.update();
|
ThreadUpdater.update();
|
||||||
} else {
|
} else {
|
||||||
if (!Index.searchTest()) {
|
if (!Index.searchTest()) {
|
||||||
Index.update();
|
if (Navigate.setMode(this)) {
|
||||||
|
Index.buildIndex();
|
||||||
|
} else {
|
||||||
|
Index.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
@ -12711,15 +12734,7 @@
|
|||||||
history.pushState(null, '', path);
|
history.pushState(null, '', path);
|
||||||
}
|
}
|
||||||
Navigate.path = this.pathname;
|
Navigate.path = this.pathname;
|
||||||
_ref1 = this.dataset, indexMode = _ref1.indexMode, indexSort = _ref1.indexSort;
|
Navigate.setMode(this);
|
||||||
if (indexMode && Conf['Index Mode'] !== indexMode) {
|
|
||||||
$.set('Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode);
|
|
||||||
Index.cb.mode();
|
|
||||||
}
|
|
||||||
if (indexSort && Conf['Index Sort'] !== indexSort) {
|
|
||||||
$.set('Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort);
|
|
||||||
Index.cb.sort();
|
|
||||||
}
|
|
||||||
if (!(view === 'index' && 'index' === g.VIEW && boardID === g.BOARD.ID)) {
|
if (!(view === 'index' && 'index' === g.VIEW && boardID === g.BOARD.ID)) {
|
||||||
Navigate.disconnect();
|
Navigate.disconnect();
|
||||||
Navigate.updateContext(view);
|
Navigate.updateContext(view);
|
||||||
|
|||||||
@ -179,17 +179,37 @@ Navigate =
|
|||||||
$.rm subtitle if subtitle = $ '.boardSubtitle'
|
$.rm subtitle if subtitle = $ '.boardSubtitle'
|
||||||
$('.boardTitle').textContent = d.title = "/#{board}/ - #{title}"
|
$('.boardTitle').textContent = d.title = "/#{board}/ - #{title}"
|
||||||
|
|
||||||
|
setMode: (a) ->
|
||||||
|
{indexMode, indexSort} = a.dataset
|
||||||
|
result = false
|
||||||
|
if indexMode and Conf['Index Mode'] isnt indexMode
|
||||||
|
$.set 'Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode
|
||||||
|
Index.cb.mode()
|
||||||
|
result = true
|
||||||
|
|
||||||
|
if indexSort and Conf['Index Sort'] isnt indexSort
|
||||||
|
$.set 'Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort
|
||||||
|
Index.cb.sort()
|
||||||
|
result = true
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
navigate: (e) ->
|
navigate: (e) ->
|
||||||
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org'
|
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org'
|
||||||
if e
|
if e
|
||||||
return if e.shiftKey or e.ctrlKey or (e.type is 'click' and e.button isnt 0) # Not simply a left click
|
if e.shiftKey or e.ctrlKey or (e.type is 'click' and e.button isnt 0) # Not simply a left click
|
||||||
|
Navigate.setMode @ unless e?.button is 2 # Right Click
|
||||||
|
return
|
||||||
|
|
||||||
if @pathname is Navigate.path
|
if @pathname is Navigate.path
|
||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
ThreadUpdater.update()
|
ThreadUpdater.update()
|
||||||
else
|
else
|
||||||
unless Index.searchTest()
|
unless Index.searchTest()
|
||||||
Index.update()
|
if Navigate.setMode @
|
||||||
|
Index.buildIndex()
|
||||||
|
else
|
||||||
|
Index.update()
|
||||||
e?.preventDefault()
|
e?.preventDefault()
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -219,14 +239,7 @@ Navigate =
|
|||||||
history.pushState null, '', path unless @id is 'popState'
|
history.pushState null, '', path unless @id is 'popState'
|
||||||
Navigate.path = @pathname
|
Navigate.path = @pathname
|
||||||
|
|
||||||
{indexMode, indexSort} = @dataset
|
Navigate.setMode @
|
||||||
if indexMode and Conf['Index Mode'] isnt indexMode
|
|
||||||
$.set 'Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode
|
|
||||||
Index.cb.mode()
|
|
||||||
|
|
||||||
if indexSort and Conf['Index Sort'] isnt indexSort
|
|
||||||
$.set 'Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort
|
|
||||||
Index.cb.sort()
|
|
||||||
|
|
||||||
unless view is 'index' and 'index' is g.VIEW and boardID is g.BOARD.ID
|
unless view is 'index' and 'index' is g.VIEW and boardID is g.BOARD.ID
|
||||||
Navigate.disconnect()
|
Navigate.disconnect()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user