This commit is contained in:
Zixaphir 2013-05-13 15:15:59 -07:00
commit 78e2d19b55
10 changed files with 242 additions and 361 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,109 +0,0 @@
[{
"uid": 0,
"name": "Foolz",
"domain": "archive.foolz.us",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["a", "co", "gd", "jp", "m", "q", "sp", "tg", "tv", "vp", "vr", "wsg"],
"files": ["a", "gd", "jp", "m", "q", "tg", "vp", "vr", "wsg"]
}, {
"uid": 1,
"name": "NSFW Foolz",
"domain": "nsfw.foolz.us",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["u"],
"files": ["u"]
}, {
"uid": 2,
"name": "The Dark Cave",
"domain": "archive.thedarkcave.org",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["c", "int", "out", "po"],
"files": ["c", "po"]
}, {
"uid": 3,
"name": "4plebs",
"domain": "archive.4plebs.org",
"http": true,
"https": false,
"software": "foolfuuka",
"boards": ["hr", "tg", "tv", "x"],
"files": ["hr", "tg", "tv", "x"]
}, {
"uid": 4,
"name": "Nyafuu",
"domain": "archive.nyafuu.org",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["c", "w", "wg"],
"files": ["c", "w", "wg"]
}, {
"uid": 5,
"name": "Love is Over",
"domain": "loveisover.me",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["d", "h", "v"],
"files": ["d", "h", "v"]
}, {
"uid": 6,
"name": "nth-chan",
"domain": "nth.pensivenonsen.se",
"http": true,
"https": false,
"software": "foolfuuka",
"boards": ["vg"],
"files": ["vg"]
}, {
"uid": 11,
"name": "Foolz a Shit",
"domain": "archive.foolzashit.com",
"http": true,
"https": true,
"software": "foolfuuka",
"boards": ["adv", "asp", "cm", "e", "i", "lgbt", "n", "o", "p", "s", "s4s", "t", "trv", "y"],
"files": ["adv", "asp", "cm", "e", "i", "lgbt", "n", "o", "p", "s", "s4s", "t", "trv", "y"]
}, {
"uid": 7,
"name": "Install Gentoo",
"domain": "archive.installgentoo.net",
"http": true,
"https": true,
"software": "fuuka",
"boards": ["diy", "g", "sci"],
"files": []
}, {
"uid": 8,
"name": "Rebecca Black Tech",
"domain": "rbt.asia",
"http": true,
"https": true,
"software": "fuuka",
"boards": ["cgl", "g", "mu", "w"],
"files": ["cgl", "g", "mu", "w"]
}, {
"uid": 9,
"name": "Heinessen",
"domain": "archive.heinessen.com",
"http": true,
"https": false,
"software": "fuuka",
"boards": ["an", "fit", "k", "mlp", "r9k", "toy", "x"],
"files": ["an", "k", "toy", "x"]
}, {
"uid": 10,
"name": "warosu",
"domain": "fuuka.warosu.org",
"http": true,
"https": true,
"software": "fuuka",
"boards": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "s4s", "tg", "vr"],
"files": ["3", "cgl", "ck", "fa", "ic", "jp", "lit", "q", "s4s", "vr"]
}]

View File

@ -112,7 +112,7 @@ Header =
boardList = $.el 'span',
id: 'board-list'
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><a href=javascript:; class='hide-board-list-button fourchanx-link'>&nbsp;&nbsp;-&nbsp;&nbsp;</a> #{fourchannav.innerHTML}</span>"
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-container fourchanx-link'><a href=javascript:; class='hide-board-list-button'>&nbsp;-&nbsp;</a></span> #{fourchannav.innerHTML}</span>"
fullBoardList = $ '#full-board-list', boardList
btn = $ '.hide-board-list-button', fullBoardList
$.on btn, 'click', Header.toggleBoardList

View File

@ -27,7 +27,6 @@ Settings =
Settings.addSection 'Filter', Settings.filter
Settings.addSection 'Sauce', Settings.sauce
Settings.addSection 'Advanced', Settings.advanced
Settings.addSection 'Archives', Settings.archives
Settings.addSection 'Keybinds', Settings.keybinds
$.on d, 'AddSettingsSection', Settings.addSection
@ -343,6 +342,39 @@ Settings =
$.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 = {}
for name, archive of Redirect.archives
for boardID in archive.boards
if boardID is g.BOARD.ID
data = boards[boardID] or= {
thread: []
post: []
file: []
}
data.thread.push name
if archive.software is 'foolfuuka'
data.post.push name
if archive.files.contains boardID
data.file.push name
rows = []
for boardID in Object.keys(boards).sort() # Alphabetical order
row = $.el 'tr'
rows.push row
data = boards[boardID]
Settings.addArchiveCell row, boardID, data, 'thread'
Settings.addArchiveCell row, boardID, data, 'post'
Settings.addArchiveCell row, boardID, data, 'file'
$.add $('tbody', section), rows
$.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) ->
for boardID, data of selectedArchives
for type, name of data
if option = $ "select[data-boardid='#{boardID}'][data-type='#{type}'] > option[value='#{name}']", section
option.selected = true
return
boardnav: ->
Header.generateBoardList @value
time: ->
@ -385,51 +417,14 @@ Settings =
usercss: ->
CustomCSS.update()
archives: (section) ->
section.innerHTML = """
<%= grunt.file.read('src/General/html/Settings/Archives.html').replace(/>\s+</g, '><').trim() %>
"""
boards = {}
for name, archive of Redirect.archives
for boardID in archive.boards
data = boards[boardID] or= {
thread: []
post: []
file: []
}
data.thread.push name
if archive.software is 'foolfuuka'
data.post.push name
if archive.files.contains boardID
data.file.push name
rows = []
for boardID in Object.keys(boards).sort() # Alphabetical order
row = $.el 'tr'
rows.push row
$.add row, $.el 'th',
textContent: "/#{boardID}/"
className: if boardID is g.BOARD.ID then 'warning' else ''
data = boards[boardID]
Settings.addArchiveCell row, boardID, data, 'thread'
Settings.addArchiveCell row, boardID, data, 'post'
Settings.addArchiveCell row, boardID, data, 'file'
$.add $('tbody', section), rows
$.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) ->
for boardID, data of selectedArchives
for type, name of data
if option = $ "select[data-boardid='#{boardID}'][data-type='#{type}'] > option[value='#{name}']", section
option.selected = true
return
addArchiveCell: (row, boardID, data, type) ->
options = []
for archive in data[type]
options.push $.el 'option',
textContent: archive
value: archive
td = $.el 'td'
td = $.el 'td',
className: 'archive-cell'
{length} = options
if length
td.innerHTML = '<select></select>'
@ -441,7 +436,7 @@ Settings =
$.on select, 'change', Settings.saveSelectedArchive
$.add select, options
else
td.textContent = 'N/A'
td.textContent = '--'
$.add row, td
saveSelectedArchive: ->
$.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) =>

View File

@ -125,12 +125,16 @@ a {
border-width: 0;
transition: all .1s .05s ease-in-out;
}
:root.centered-links #shortcuts {
width: 300px;
text-align: right;
}
:root.centered-links #header-bar {
text-align: center;
}
:root.centered-links #custom-board-list {
position: relative;
left: 80px;
left: 150px;
}
.fixed.top #header-bar {
border-bottom-width: 1px;
@ -374,6 +378,13 @@ a {
.section-advanced textarea {
height: 150px;
}
.section-advanced #archive-table {
margin-left: 0px;
text-align: left;
}
.section-advanced .archive-cell {
min-width: 160px;
}
.section-advanced .note {
font-size: 0.8em;
font-style: italic;
@ -436,7 +447,7 @@ a.hide-announcement {
.new {
color: limegreen;
}
#update-status.warning, #update-status.new {
#update-status.new {
margin-right: 5px;
}
#update-timer {

View File

@ -1,3 +1,17 @@
<fieldset>
<legend>Archiver</legend>
<div class="warning" #{if Conf['404 Redirect'] then 'hidden' else ''}><code>404 Redirect</code> is disabled.</div>
<table id='archive-table'>
<thead>
<th>Thread redirection</th>
<th>Post fetching</th>
<th>File redirection</th>
</thead>
<tbody></tbody>
</table>
<span class=note>Disabled selections indicate that only one archive is available for that board and redirection type.</span>
</fieldset>
<fieldset>
<legend>Custom Board Navigation</span></legend>
<div><textarea name=boardnav class=field spellcheck=false></textarea></div>

View File

@ -1,12 +0,0 @@
<div class="warning" #{if Conf['404 Redirect'] then 'hidden' else ''}><code>404 Redirect</code> is disabled.</div>
<p>Disabled selections indicate that only one archive is available for that board and redirection type.</p>
<table>
<caption>Archived boards</caption>
<thead>
<th>Board</th>
<th>Thread redirection</th>
<th>Post fetching</th>
<th>File redirection</th>
</thead>
<tbody></tbody>
</table>

View File

@ -4,7 +4,7 @@ CatalogLinks =
el = $.el 'label',
id: 'toggleCatalog'
href: 'javascript:;'
innerHTML: "<input type=checkbox #{if Conf['Header catalog links'] then 'checked' else ''}>Catalog Links"
innerHTML: "<input type=checkbox #{if Conf['Header catalog links'] then 'checked' else ''}> Catalog Links"
title: "Turn catalog links #{if Conf['Header catalog links'] then 'off' else 'on'}."
input = $ 'input', el