This commit is contained in:
Zixaphir 2014-01-28 01:51:24 -07:00
parent 7930db0c81
commit 5a5658bc60
5 changed files with 22 additions and 20 deletions

View File

@ -4507,9 +4507,6 @@
$.on(this.searchInput, 'input', this.onSearchInput); $.on(this.searchInput, 'input', this.onSearchInput);
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
$.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate);
$.on($('#cataloglink a', this.navLinks), 'click', function() {
return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog";
});
if (g.VIEW === 'index') { if (g.VIEW === 'index') {
this.update(); this.update();
} }
@ -8768,9 +8765,9 @@
flagsInput: function() { flagsInput: function() {
var flag, nodes; var flag, nodes;
nodes = QR.nodes; nodes = QR.nodes;
if (nodes.flagSelector) { if (nodes.flag) {
$.rm(nodes.flagSelector); $.rm(nodes.flag);
delete nodes.flagSelector; delete nodes.flag;
} }
if (g.BOARD.ID === 'pol') { if (g.BOARD.ID === 'pol') {
flag = QR.flags(); flag = QR.flags();
@ -15668,7 +15665,8 @@
return; return;
} }
$.ready(function() { $.ready(function() {
return $.on(window, 'popstate', Navigate.popstate); $.on(window, 'popstate', Navigate.popstate);
return $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog";
}); });
this.title = function() {}; this.title = function() {};
Thread.callbacks.push({ Thread.callbacks.push({
@ -15874,6 +15872,7 @@
updateTitle: function(_arg) { updateTitle: function(_arg) {
var board, subtitle, title; var board, subtitle, title;
board = _arg.board, title = _arg.title; board = _arg.board, title = _arg.title;
$.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog";
if (subtitle = $('.boardSubtitle')) { if (subtitle = $('.boardSubtitle')) {
$.rm(subtitle); $.rm(subtitle);
} }

View File

@ -4549,9 +4549,6 @@
$.on(this.searchInput, 'input', this.onSearchInput); $.on(this.searchInput, 'input', this.onSearchInput);
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
$.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate);
$.on($('#cataloglink a', this.navLinks), 'click', function() {
return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog";
});
if (g.VIEW === 'index') { if (g.VIEW === 'index') {
this.update(); this.update();
} }
@ -8791,9 +8788,9 @@
flagsInput: function() { flagsInput: function() {
var flag, nodes; var flag, nodes;
nodes = QR.nodes; nodes = QR.nodes;
if (nodes.flagSelector) { if (nodes.flag) {
$.rm(nodes.flagSelector); $.rm(nodes.flag);
delete nodes.flagSelector; delete nodes.flag;
} }
if (g.BOARD.ID === 'pol') { if (g.BOARD.ID === 'pol') {
flag = QR.flags(); flag = QR.flags();
@ -15673,7 +15670,8 @@
return; return;
} }
$.ready(function() { $.ready(function() {
return $.on(window, 'popstate', Navigate.popstate); $.on(window, 'popstate', Navigate.popstate);
return $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog";
}); });
this.title = function() {}; this.title = function() {};
Thread.callbacks.push({ Thread.callbacks.push({
@ -15879,6 +15877,7 @@
updateTitle: function(_arg) { updateTitle: function(_arg) {
var board, subtitle, title; var board, subtitle, title;
board = _arg.board, title = _arg.title; board = _arg.board, title = _arg.title;
$.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog";
if (subtitle = $('.boardSubtitle')) { if (subtitle = $('.boardSubtitle')) {
$.rm(subtitle); $.rm(subtitle);
} }

View File

@ -86,7 +86,6 @@ Index =
$.on @searchInput, 'input', @onSearchInput $.on @searchInput, 'input', @onSearchInput
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch $.on $('#index-search-clear', @navLinks), 'click', @clearSearch
$.on $('#returnlink a', @navLinks), 'click', Navigate.navigate $.on $('#returnlink a', @navLinks), 'click', Navigate.navigate
$.on $('#cataloglink a', @navLinks), 'click', -> window.location = "//boards.4chan.org/#{g.BOARD}/catalog"
@update() if g.VIEW is 'index' @update() if g.VIEW is 'index'
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), -> $.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->

View File

@ -3,8 +3,12 @@ Navigate =
init: -> init: ->
return if g.VIEW is 'catalog' or g.BOARD.ID is 'f' or !Conf['JSON Navigation'] return if g.VIEW is 'catalog' or g.BOARD.ID is 'f' or !Conf['JSON Navigation']
# blink/webkit throw a popstate on page load. Not what we want. $.ready ->
$.ready -> $.on window, 'popstate', Navigate.popstate # blink/webkit throw a popstate on page load. Not what we want.
$.on window, 'popstate', Navigate.popstate
# Prevent having to update the catalog links whenever we open threads.
$.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/#{g.BOARD}/catalog"
@title = -> return @title = -> return
@ -161,6 +165,7 @@ Navigate =
Style.setTheme theme Style.setTheme theme
updateTitle: ({board, title}) -> updateTitle: ({board, title}) ->
$.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/#{g.BOARD}/catalog"
$.rm subtitle if subtitle = $ '.boardSubtitle' $.rm subtitle if subtitle = $ '.boardSubtitle'
$('.boardTitle').textContent = d.title = "/#{board}/ - #{title}" $('.boardTitle').textContent = d.title = "/#{board}/ - #{title}"

View File

@ -524,9 +524,9 @@ QR =
flagsInput: -> flagsInput: ->
{nodes} = QR {nodes} = QR
if nodes.flagSelector if nodes.flag
$.rm nodes.flagSelector $.rm nodes.flag
delete nodes.flagSelector delete nodes.flag
if g.BOARD.ID is 'pol' if g.BOARD.ID is 'pol'
flag = QR.flags() flag = QR.flags()