diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 292826a6d..20631c875 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.3.0 - 2014-01-11 +* 4chan X - Version 1.3.0 - 2014-01-12 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -10039,7 +10039,7 @@ if (!((archive = archives[id]))) { continue; } - boards = type === 'file' ? archive.file : archive.boards; + boards = type === 'file' ? archive.files : archive.boards; if (__indexOf.call(boards, boardID) < 0) { continue; } @@ -12652,7 +12652,7 @@ return $.on(ta, 'change', $.cb.value); }, advanced: function(section) { - var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; + var archBoards, boardID, boardOptions, boardSelect, boards, data, event, files, input, inputs, item, items, name, o, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4; section.innerHTML = "
"; items = {}; inputs = {}; @@ -12689,32 +12689,31 @@ $.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval); $.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss); $.on($.id('apply-css'), 'click', Settings.usercss); - boards = {}; + archBoards = {}; _ref1 = Redirect.archives; - for (name in _ref1) { - archive = _ref1[name]; - _ref2 = archive.boards; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - boardID = _ref2[_j]; - data = boards[boardID] || (boards[boardID] = { + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + _ref2 = _ref1[_j], name = _ref2.name, boards = _ref2.boards, files = _ref2.files, data = _ref2.data; + for (_k = 0, _len2 = boards.length; _k < _len2; _k++) { + boardID = boards[_k]; + o = archBoards[boardID] || (archBoards[boardID] = { thread: [], post: [], file: [] }); - data.thread.push(name); - if (archive.software === 'foolfuuka') { - data.post.push(name); + o.thread.push(name); + if (data.software === 'foolfuuka') { + o.post.push(name); } - if (__indexOf.call(archive.files, boardID) >= 0) { - data.file.push(name); + if (__indexOf.call(files, boardID) >= 0) { + o.file.push(name); } } } rows = []; boardOptions = []; - _ref3 = Object.keys(boards).sort(); - for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { - boardID = _ref3[_k]; + _ref3 = Object.keys(archBoards).sort(); + for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { + boardID = _ref3[_l]; row = $.el('tr', { className: "board-" + boardID }); @@ -12724,11 +12723,11 @@ value: "board-" + boardID, selected: boardID === g.BOARD.ID })); - data = boards[boardID]; + o = archBoards[boardID]; _ref4 = ['thread', 'post', 'file']; - for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) { - item = _ref4[_l]; - $.add(row, Settings.addArchiveCell(boardID, data, item)); + for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { + item = _ref4[_m]; + $.add(row, Settings.addArchiveCell(boardID, o, item)); } rows.push(row); } diff --git a/builds/crx/script.js b/builds/crx/script.js index cd066205c..cfef73297 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.3.0 - 2014-01-11 +* 4chan X - Version 1.3.0 - 2014-01-12 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -10028,7 +10028,7 @@ if (!((archive = archives[id]))) { continue; } - boards = type === 'file' ? archive.file : archive.boards; + boards = type === 'file' ? archive.files : archive.boards; if (__indexOf.call(boards, boardID) < 0) { continue; } @@ -12639,7 +12639,7 @@ return $.on(ta, 'change', $.cb.value); }, advanced: function(section) { - var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; + var archBoards, boardID, boardOptions, boardSelect, boards, data, event, files, input, inputs, item, items, name, o, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4; section.innerHTML = ""; items = {}; inputs = {}; @@ -12676,32 +12676,31 @@ $.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval); $.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss); $.on($.id('apply-css'), 'click', Settings.usercss); - boards = {}; + archBoards = {}; _ref1 = Redirect.archives; - for (name in _ref1) { - archive = _ref1[name]; - _ref2 = archive.boards; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - boardID = _ref2[_j]; - data = boards[boardID] || (boards[boardID] = { + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + _ref2 = _ref1[_j], name = _ref2.name, boards = _ref2.boards, files = _ref2.files, data = _ref2.data; + for (_k = 0, _len2 = boards.length; _k < _len2; _k++) { + boardID = boards[_k]; + o = archBoards[boardID] || (archBoards[boardID] = { thread: [], post: [], file: [] }); - data.thread.push(name); - if (archive.software === 'foolfuuka') { - data.post.push(name); + o.thread.push(name); + if (data.software === 'foolfuuka') { + o.post.push(name); } - if (__indexOf.call(archive.files, boardID) >= 0) { - data.file.push(name); + if (__indexOf.call(files, boardID) >= 0) { + o.file.push(name); } } } rows = []; boardOptions = []; - _ref3 = Object.keys(boards).sort(); - for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { - boardID = _ref3[_k]; + _ref3 = Object.keys(archBoards).sort(); + for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { + boardID = _ref3[_l]; row = $.el('tr', { className: "board-" + boardID }); @@ -12711,11 +12710,11 @@ value: "board-" + boardID, selected: boardID === g.BOARD.ID })); - data = boards[boardID]; + o = archBoards[boardID]; _ref4 = ['thread', 'post', 'file']; - for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) { - item = _ref4[_l]; - $.add(row, Settings.addArchiveCell(boardID, data, item)); + for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { + item = _ref4[_m]; + $.add(row, Settings.addArchiveCell(boardID, o, item)); } rows.push(row); } diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 06ac8f37f..a69dbb292 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -17,7 +17,7 @@ Redirect = for boardID, record of Conf['selectedArchives'] for type, id of record when (archive = archives[id]) - boards = if type is 'file' then archive.file else archive.boards + boards = if type is 'file' then archive.files else archive.boards continue unless boardID in boards o[type][boardID] = archive.data diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index a7f944a24..984fd23e0 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -333,20 +333,20 @@ Settings = $.on $('input[name="Custom CSS"]', section), 'change', Settings.togglecss $.on $.id('apply-css'), 'click', Settings.usercss - boards = {} - for name, archive of Redirect.archives - for boardID in archive.boards - data = boards[boardID] or= + archBoards = {} + for {name, boards, files, data} in Redirect.archives + for boardID in boards + o = archBoards[boardID] or= thread: [] post: [] file: [] - data.thread.push name - data.post.push name if archive.software is 'foolfuuka' - data.file.push name if boardID in archive.files + o.thread.push name + o.post.push name if data.software is 'foolfuuka' + o.file.push name if boardID in files rows = [] boardOptions = [] - for boardID in Object.keys(boards).sort() # Alphabetical order + for boardID in Object.keys(archBoards).sort() # Alphabetical order row = $.el 'tr', className: "board-#{boardID}" row.hidden = boardID isnt g.BOARD.ID @@ -356,8 +356,8 @@ Settings = value: "board-#{boardID}" selected: boardID is g.BOARD.ID - data = boards[boardID] - $.add row, Settings.addArchiveCell boardID, data, item for item in ['thread', 'post', 'file'] + o = archBoards[boardID] + $.add row, Settings.addArchiveCell boardID, o, item for item in ['thread', 'post', 'file'] rows.push row $.add $('tbody', section), rows