Merge pull request #256 from seaweedchan/v3
Archive change + settings changes
This commit is contained in:
commit
20ebebb34e
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
@ -3,7 +3,7 @@ Config =
|
||||
'Miscellaneous':
|
||||
'Catalog Links': [
|
||||
true
|
||||
'Turn Navigation links into links to each board\'s catalog.'
|
||||
'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'
|
||||
]
|
||||
'External Catalog': [
|
||||
false
|
||||
@ -93,11 +93,11 @@ Config =
|
||||
true
|
||||
'Hide replies of hidden posts, recursively.'
|
||||
]
|
||||
'Thread Hiding': [
|
||||
'Thread Hiding Buttons': [
|
||||
true
|
||||
'Add buttons to hide entire threads.'
|
||||
]
|
||||
'Reply Hiding': [
|
||||
'Reply Hiding Buttons': [
|
||||
true
|
||||
'Add buttons to hide single replies.'
|
||||
]
|
||||
@ -185,7 +185,7 @@ Config =
|
||||
false
|
||||
'Hide the unread posts count when it reaches 0.'
|
||||
]
|
||||
'Unread Tab Icon': [
|
||||
'Unread Favicon': [
|
||||
true
|
||||
'Show a different favicon when there are unread posts.'
|
||||
]
|
||||
@ -388,7 +388,7 @@ http://iqdb.org/?url=%TURL
|
||||
|
||||
'Custom CSS': false
|
||||
|
||||
'Boards Navigation': 'sticky top'
|
||||
'Boards Navigation': 'Sticky top'
|
||||
|
||||
'Header auto-hide': false
|
||||
|
||||
@ -402,7 +402,7 @@ http://iqdb.org/?url=%TURL
|
||||
|
||||
backlink: '>>%id'
|
||||
|
||||
fileInfo: '%l (%p%s, %r)'
|
||||
fileInfo: '%L (%p%s, %r)'
|
||||
|
||||
favicon: 'ferongr'
|
||||
|
||||
@ -415,11 +415,11 @@ http://iqdb.org/?url=%TURL
|
||||
'Toggle the full board list.'
|
||||
]
|
||||
'Open empty QR': [
|
||||
'q'
|
||||
'l'
|
||||
'Open QR without post number inserted.'
|
||||
]
|
||||
'Open QR': [
|
||||
'Shift+q'
|
||||
'Shift+l'
|
||||
'Open QR with post number inserted.'
|
||||
]
|
||||
'Open settings': [
|
||||
|
||||
@ -145,22 +145,22 @@ a[href="javascript:;"] {
|
||||
-webkit-transform: translateY(100%);
|
||||
transform: translateY(100%);
|
||||
}
|
||||
#toggle-header-bar {
|
||||
#scroll-marker {
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
}
|
||||
#boardNavDesktop #toggle-header-bar {
|
||||
#header-bar #scroll-marker {
|
||||
display: none;
|
||||
}
|
||||
.fixed #boardNavDesktop #toggle-header-bar {
|
||||
.fixed #header-bar #scroll-marker {
|
||||
display: block;
|
||||
}
|
||||
.fixed.top boardNavDesktop #toggle-header-bar {
|
||||
.fixed.top #header-bar #scroll-marker {
|
||||
top: 100%;
|
||||
}
|
||||
.fixed.bottom #boardNavDesktop #toggle-header-bar {
|
||||
.fixed.bottom #header-bar #scroll-marker {
|
||||
bottom: 100%;
|
||||
}
|
||||
#header-bar a:not(.entry) {
|
||||
@ -857,3 +857,15 @@ a:only-of-type > .remove {
|
||||
.focused .submenu {
|
||||
display: block;
|
||||
}
|
||||
.imp-exp-result {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
width: 200px;
|
||||
}
|
||||
.export, .import {
|
||||
cursor: pointer;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
PostHiding =
|
||||
init: ->
|
||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link']
|
||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding Buttons'] and !Conf['Reply Hiding Link']
|
||||
|
||||
@db = new DataBoard 'hiddenPosts'
|
||||
Post::callbacks.push
|
||||
@ -15,7 +15,7 @@ PostHiding =
|
||||
else
|
||||
Recursive.apply PostHiding.hide, @, data.makeStub, true
|
||||
Recursive.add PostHiding.hide, @, data.makeStub, true
|
||||
return unless Conf['Reply Hiding']
|
||||
return unless Conf['Reply Hiding Buttons']
|
||||
$.replace $('.sideArrows', @nodes.root), PostHiding.makeButton @, 'hide'
|
||||
|
||||
menu:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
QuoteStrikeThrough =
|
||||
init: ->
|
||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link'] and !Conf['Filter']
|
||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding Buttons'] and !Conf['Reply Hiding Link'] and !Conf['Filter']
|
||||
|
||||
Post::callbacks.push
|
||||
name: 'Strike-through Quotes'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
ThreadHiding =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'index' or !Conf['Thread Hiding'] and !Conf['Thread Hiding Link']
|
||||
return if g.VIEW isnt 'index' or !Conf['Thread Hiding Buttons'] and !Conf['Thread Hiding Link']
|
||||
|
||||
@db = new DataBoard 'hiddenThreads'
|
||||
@syncCatalog()
|
||||
@ -11,7 +11,7 @@ ThreadHiding =
|
||||
node: ->
|
||||
if data = ThreadHiding.db.get {boardID: @board.ID, threadID: @ID}
|
||||
ThreadHiding.hide @, data.makeStub
|
||||
return unless Conf['Thread Hiding']
|
||||
return unless Conf['Thread Hiding Buttons']
|
||||
$.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide'
|
||||
|
||||
syncCatalog: ->
|
||||
|
||||
@ -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"
|
||||
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
|
||||
|
||||
@ -17,7 +17,7 @@ Header =
|
||||
|
||||
{createSubEntry} = Header
|
||||
subEntries = []
|
||||
for setting in ['sticky top', 'sticky bottom', 'top']
|
||||
for setting in ['Sticky top', 'Sticky bottom', 'Top']
|
||||
subEntries.push createSubEntry setting
|
||||
|
||||
subEntries.push {el: headerToggler}
|
||||
@ -64,7 +64,7 @@ Header =
|
||||
id: 'hoverUI'
|
||||
|
||||
toggle: $.el 'div',
|
||||
id: 'toggle-header-bar'
|
||||
id: 'scroll-marker'
|
||||
|
||||
createSubEntry: (setting) ->
|
||||
label = $.el 'label',
|
||||
@ -180,15 +180,15 @@ Header =
|
||||
$.rmClass doc, 'bottom'
|
||||
$.rmClass Header.nav, 'dialog'
|
||||
switch setting
|
||||
when 'sticky top'
|
||||
when 'Sticky top'
|
||||
$.addClass doc, 'top'
|
||||
$.addClass doc, 'fixed'
|
||||
$.addClass Header.nav, 'dialog'
|
||||
when 'sticky bottom'
|
||||
when 'Sticky bottom'
|
||||
$.addClass doc, 'fixed'
|
||||
$.addClass doc, 'bottom'
|
||||
$.addClass Header.nav, 'dialog'
|
||||
when 'top'
|
||||
when 'Top'
|
||||
$.addClass doc, 'top'
|
||||
|
||||
setBarVisibility: (hide) ->
|
||||
@ -236,7 +236,7 @@ Header =
|
||||
|
||||
scrollToPost: (post) ->
|
||||
{top} = post.getBoundingClientRect()
|
||||
if Conf['Boards Navigation'] is 'sticky top'
|
||||
if Conf['Boards Navigation'] is 'Sticky top'
|
||||
headRect = Header.bar.getBoundingClientRect()
|
||||
top += - headRect.top - headRect.height
|
||||
(if $.engine is 'webkit' then d.body else doc).scrollTop += top
|
||||
|
||||
@ -79,14 +79,14 @@ Redirect =
|
||||
base: '//fuuka.warosu.org'
|
||||
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg']
|
||||
type: 'fuuka'
|
||||
'RebeccaBlackTech':
|
||||
base: '//rbt.asia'
|
||||
boards: ['an', 'cgl', 'g', 'mu', 'w']
|
||||
type: 'fuuka_mail'
|
||||
'InstallGentoo':
|
||||
base: '//archive.installgentoo.net'
|
||||
boards: ['diy', 'g', 'sci']
|
||||
type: 'fuuka'
|
||||
'RebeccaBlackTech':
|
||||
base: '//rbt.asia'
|
||||
boards: ['an', 'cgl', 'g', 'mu', 'w']
|
||||
type: 'fuuka_mail'
|
||||
'Heinessen':
|
||||
base: 'http://archive.heinessen.com'
|
||||
boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x']
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Unread =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'thread' or !Conf['Unread Count'] and !Conf['Unread Tab Icon']
|
||||
return if g.VIEW isnt 'thread' or !Conf['Unread Count'] and !Conf['Unread Favicon']
|
||||
|
||||
@db = new DataBoard 'lastReadPosts', @sync
|
||||
@hr = $.el 'hr',
|
||||
@ -153,7 +153,7 @@ Unread =
|
||||
, $.SECOND
|
||||
<% } %>
|
||||
|
||||
return unless Conf['Unread Tab Icon']
|
||||
return unless Conf['Unread Favicon']
|
||||
|
||||
Favicon.el.href =
|
||||
if g.DEAD
|
||||
|
||||
@ -16,7 +16,7 @@ QuoteThreading =
|
||||
$.event 'AddMenuEntry',
|
||||
type: 'header'
|
||||
el: @controls
|
||||
order: 115
|
||||
order: 98
|
||||
|
||||
$.on d, '4chanXInitFinished', @setup
|
||||
|
||||
|
||||
@ -75,8 +75,8 @@ Main =
|
||||
'Linkify': Linkify
|
||||
'Resurrect Quotes': Quotify
|
||||
'Filter': Filter
|
||||
'Thread Hiding': ThreadHiding
|
||||
'Reply Hiding': PostHiding
|
||||
'Thread Hiding Buttons': ThreadHiding
|
||||
'Reply Hiding Buttons': PostHiding
|
||||
'Recursive': Recursive
|
||||
'Strike-through Quotes': QuoteStrikeThrough
|
||||
'Quick Reply': QR
|
||||
|
||||
@ -49,7 +49,11 @@ Settings =
|
||||
html = """
|
||||
<nav>
|
||||
<div class=sections-list></div>
|
||||
<p class='imp-exp-result warning'></p>
|
||||
<div class=credits>
|
||||
<a class=export>Export</a> |
|
||||
<a class=import>Import</a> |
|
||||
<input type=file style='display: none;'>
|
||||
<a href='<%= meta.page %>' target=_blank><%= meta.name %></a> |
|
||||
<a href='<%= meta.repo %>blob/<%= meta.mainBranch %>/CHANGELOG.md' target=_blank>#{g.VERSION}</a> |
|
||||
<a href='<%= meta.repo %>blob/<%= meta.mainBranch %>/CONTRIBUTING.md#reporting-bugs-and-suggestions' target=_blank>Issues</a> |
|
||||
@ -68,6 +72,10 @@ Settings =
|
||||
className: 'dialog'
|
||||
innerHTML: html
|
||||
|
||||
$.on $('.export', Settings.dialog), 'click', Settings.export
|
||||
$.on $('.import', Settings.dialog), 'click', Settings.import
|
||||
$.on $('input', Settings.dialog), 'change', Settings.onImport
|
||||
|
||||
links = []
|
||||
for section in Settings.sections
|
||||
link = $.el 'a',
|
||||
@ -114,18 +122,6 @@ Settings =
|
||||
section.scrollTop = 0
|
||||
|
||||
main: (section) ->
|
||||
section.innerHTML = """
|
||||
<div class=imp-exp>
|
||||
<button class=export>Export Settings</button>
|
||||
<button class=import>Import Settings</button>
|
||||
<input type=file style='visibility:hidden'>
|
||||
</div>
|
||||
<p class=imp-exp-result></p>
|
||||
"""
|
||||
$.on $('.export', section), 'click', Settings.export
|
||||
$.on $('.import', section), 'click', Settings.import
|
||||
$.on $('input', section), 'change', Settings.onImport
|
||||
|
||||
items = {}
|
||||
inputs = {}
|
||||
for key, obj of Config.main
|
||||
@ -201,7 +197,7 @@ Settings =
|
||||
@nextElementSibling.click()
|
||||
onImport: ->
|
||||
return unless file = @files[0]
|
||||
output = @parentNode.nextElementSibling
|
||||
output = $('.imp-exp-result')
|
||||
unless confirm 'Your current settings will be entirely overwritten, are you sure?'
|
||||
output.textContent = 'Import aborted.'
|
||||
return
|
||||
@ -227,7 +223,7 @@ Settings =
|
||||
'Show Stubs': 'Stubs'
|
||||
'Image Auto-Gif': 'Auto-GIF'
|
||||
'Expand From Current': ''
|
||||
'Unread Favicon': 'Unread Tab Icon'
|
||||
'Unread Tab Icon': 'Unread Favicon'
|
||||
'Post in Title': 'Thread Excerpt'
|
||||
'Auto Hide QR': ''
|
||||
'Open Reply in New Tab': ''
|
||||
@ -236,6 +232,8 @@ Settings =
|
||||
'Quote Preview': 'Quote Previewing'
|
||||
'Indicate OP quote': 'Mark OP Quotes'
|
||||
'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes'
|
||||
'Reply Hiding': 'Reply Hiding Buttons'
|
||||
'Thread Hiding': 'Thread Hiding Buttons'
|
||||
# filter
|
||||
'uniqueid': 'uniqueID'
|
||||
'mod': 'capcode'
|
||||
@ -434,7 +432,7 @@ Settings =
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Unread Tab Icon <span class=warning #{if Conf['Unread Tab Icon'] then 'hidden' else ''}>is disabled.</span></legend>
|
||||
<legend>Unread Favicon <span class=warning #{if Conf['Unread Favicon'] then 'hidden' else ''}>is disabled.</span></legend>
|
||||
<select name=favicon>
|
||||
<option value=ferongr>ferongr</option>
|
||||
<option value=xat->xat-</option>
|
||||
@ -510,7 +508,7 @@ Settings =
|
||||
@nextElementSibling.innerHTML = funk FileInfo, data
|
||||
favicon: ->
|
||||
Favicon.switch()
|
||||
Unread.update() if g.VIEW is 'thread' and Conf['Unread Tab Icon']
|
||||
Unread.update() if g.VIEW is 'thread' and Conf['Unread Favicon']
|
||||
@nextElementSibling.innerHTML = """
|
||||
<img src=#{Favicon.default}>
|
||||
<img src=#{Favicon.unreadSFW}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user