Merge branch 'mayhem' into v3 (Bugtesting time... yey... ;__;)
Conflicts: css/burichan.css css/futaba.css css/photon.css css/tomorrow.css css/yotsuba-b.css css/yotsuba.css html/General/Settings-section-Main.html html/General/Settings.html src/Filtering/PostHiding.coffee src/General/Build.coffee src/General/Get.coffee src/General/Header.coffee src/General/Index.coffee src/General/Settings.coffee src/Miscellaneous/AnnouncementHiding.coffee src/Monitoring/ThreadUpdater.coffee
This commit is contained in:
commit
db5cccc70f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1069
css/style.css
1069
css/style.css
File diff suppressed because it is too large
Load Diff
4
html/General/Settings-section-Main.html
Normal file
4
html/General/Settings-section-Main.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<button class="export">Export Settings</button>
|
||||||
|
<button class="import">Import Settings</button>
|
||||||
|
<button class="reset">Reset Settings</button>
|
||||||
|
<input type="file" hidden>
|
||||||
15
html/General/Settings.html
Normal file
15
html/General/Settings.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<div id="fourchanx-settings" class="dialog">
|
||||||
|
<nav>
|
||||||
|
<div class="sections-list"></div>
|
||||||
|
<div class="credits">
|
||||||
|
<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>
|
||||||
|
|
|
||||||
|
<a href="javascript:;" class="close fa fa-times" title="Close"></a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<section></section>
|
||||||
|
</div>
|
||||||
@ -5,8 +5,8 @@
|
|||||||
"http": true,
|
"http": true,
|
||||||
"https": true,
|
"https": true,
|
||||||
"software": "foolfuuka",
|
"software": "foolfuuka",
|
||||||
"boards": ["a", "biz", "co", "gd", "jp", "m", "sp", "tg", "tv", "v", "vg", "vp", "vr", "wsg"],
|
"boards": ["a", "biz", "co", "diy", "gd", "jp", "m", "sci", "sp", "tg", "tv", "v", "vg", "vp", "vr", "wsg"],
|
||||||
"files": ["a", "biz", "gd", "jp", "m", "tg", "vg", "vp", "vr", "wsg"]
|
"files": ["a", "biz", "gd", "diy", "jp", "m", "sci", "tg", "vg", "vp", "vr", "wsg"]
|
||||||
}, {
|
}, {
|
||||||
"uid": 1,
|
"uid": 1,
|
||||||
"name": "NSFW Foolz",
|
"name": "NSFW Foolz",
|
||||||
@ -52,15 +52,6 @@
|
|||||||
"software": "foolfuuka",
|
"software": "foolfuuka",
|
||||||
"boards": ["d", "i"],
|
"boards": ["d", "i"],
|
||||||
"files": ["d", "i"]
|
"files": ["d", "i"]
|
||||||
}, {
|
|
||||||
"uid": 7,
|
|
||||||
"name": "Install Gentoo",
|
|
||||||
"domain": "archive.installgentoo.net",
|
|
||||||
"http": false,
|
|
||||||
"https": true,
|
|
||||||
"software": "fuuka",
|
|
||||||
"boards": ["diy", "g", "sci"],
|
|
||||||
"files": []
|
|
||||||
}, {
|
}, {
|
||||||
"uid": 8,
|
"uid": 8,
|
||||||
"name": "Rebecca Black Tech",
|
"name": "Rebecca Black Tech",
|
||||||
@ -86,8 +77,8 @@
|
|||||||
"http": false,
|
"http": false,
|
||||||
"https": true,
|
"https": true,
|
||||||
"software": "fuuka",
|
"software": "fuuka",
|
||||||
"boards": ["3", "biz", "cgl", "ck", "fa", "ic", "jp", "lit", "tg", "vr"],
|
"boards": ["3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr"],
|
||||||
"files": ["3", "biz", "cgl", "ck", "fa", "ic", "jp", "lit", "tg", "vr"]
|
"files": ["3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "tg", "vr"]
|
||||||
}, {
|
}, {
|
||||||
"uid": 15,
|
"uid": 15,
|
||||||
"name": "fgts",
|
"name": "fgts",
|
||||||
@ -123,6 +114,6 @@
|
|||||||
"https": true,
|
"https": true,
|
||||||
"withCredentials": true,
|
"withCredentials": true,
|
||||||
"software": "foolfuuka",
|
"software": "foolfuuka",
|
||||||
"boards": ["a", "biz", "co", "d", "gd", "jp", "m", "mlp", "s4s", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
|
"boards": ["a", "biz", "co", "d", "diy", "gd", "jp", "m", "mlp", "s4s", "sci", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
|
||||||
"files": ["a", "biz", "d", "gd", "jp", "m", "s4s", "tg", "u", "vg", "vp", "vr", "wsg"]
|
"files": ["a", "biz", "d", "diy", "gd", "jp", "m", "s4s", "sci", "tg", "u", "vg", "vp", "vr", "wsg"]
|
||||||
}]
|
}]
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
"grunt-contrib-copy": "~0.5.0",
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
"grunt-shell": "~0.6.4",
|
"grunt-shell": "~0.6.4",
|
||||||
"load-grunt-tasks": "~0.3.0"
|
"load-grunt-tasks": "~0.4.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@ -2,12 +2,10 @@ PostHiding =
|
|||||||
init: ->
|
init: ->
|
||||||
@db = new DataBoard 'hiddenPosts'
|
@db = new DataBoard 'hiddenPosts'
|
||||||
@hideButton = $.el 'a',
|
@hideButton = $.el 'a',
|
||||||
className: 'hide-post-button'
|
className: 'hide-post-button fa fa-minus-square-o'
|
||||||
innerHTML: '<i class="fa fa-minus-square-o"></i>'
|
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
@showButton = $.el 'a',
|
@showButton = $.el 'a',
|
||||||
className: 'show-post-button'
|
className: 'show-post-button fa fa-plus-square-o'
|
||||||
innerHTML: '<i class="fa fa-plus-square-o"></i>'
|
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
@ -61,13 +59,14 @@ PostHiding =
|
|||||||
PostHiding.saveHiddenState post
|
PostHiding.saveHiddenState post
|
||||||
return if post.isReply
|
return if post.isReply
|
||||||
|
|
||||||
if Conf['JSON Navigation']
|
Index.updateHideLabel()
|
||||||
Index.updateHideLabel()
|
if Conf['Index Mode'] is 'all pages' or !Conf['JSON Navigation'] # ssllooooww
|
||||||
Index.sort()
|
root = post.nodes.root.parentNode
|
||||||
Index.buildIndex()
|
$.rm root.nextElementSibling
|
||||||
else
|
$.rm root
|
||||||
# XXX Tempfix until I feel like writing out real functionality for thread hiding without JSON functions
|
return
|
||||||
$.rm post.nodes.root.parentElement
|
Index.sort()
|
||||||
|
Index.buildIndex()
|
||||||
|
|
||||||
saveHiddenState: (post, val) ->
|
saveHiddenState: (post, val) ->
|
||||||
data =
|
data =
|
||||||
|
|||||||
@ -121,11 +121,11 @@ Build =
|
|||||||
|
|
||||||
if file?.isDeleted
|
if file?.isDeleted
|
||||||
fileHTML = if isOP
|
fileHTML = if isOP
|
||||||
"<div class=file id=f#{postID}><span class=fileThumb>" +
|
"<div class=file><span class=fileThumb>" +
|
||||||
"<img src='#{staticPath}filedeleted#{gifIcon}' class=fileDeleted>" +
|
"<img src='#{staticPath}filedeleted#{gifIcon}' class=fileDeleted>" +
|
||||||
"</span></div>"
|
"</span></div>"
|
||||||
else
|
else
|
||||||
"<div class=file id=f#{postID}><span class=fileThumb>" +
|
"<div class=file><span class=fileThumb>" +
|
||||||
"<img src='#{staticPath}filedeleted-res#{gifIcon}' class=fileDeletedRes>" +
|
"<img src='#{staticPath}filedeleted-res#{gifIcon}' class=fileDeletedRes>" +
|
||||||
"</span></div>"
|
"</span></div>"
|
||||||
else if file
|
else if file
|
||||||
@ -159,7 +159,7 @@ Build =
|
|||||||
filename = a.innerHTML.replace /'/g, '''
|
filename = a.innerHTML.replace /'/g, '''
|
||||||
|
|
||||||
fileDims = if file.name[-3..] is 'pdf' then 'PDF' else "#{file.width}x#{file.height}"
|
fileDims = if file.name[-3..] is 'pdf' then 'PDF' else "#{file.width}x#{file.height}"
|
||||||
fileInfo = "<div class=fileText id=fT#{postID}#{if file.isSpoiler then " title='#{filename}'" else ''}>File: <a href='#{file.url}' target=_blank>#{file.timestamp}</a>" +
|
fileInfo = "<div class=fileText#{if file.isSpoiler then " title='#{filename}'" else ''}>File: <a href='#{file.url}' target=_blank>#{file.timestamp}</a>" +
|
||||||
"-(#{fileSize}, #{fileDims}#{
|
"-(#{fileSize}, #{fileDims}#{
|
||||||
if file.isSpoiler
|
if file.isSpoiler
|
||||||
''
|
''
|
||||||
@ -167,7 +167,7 @@ Build =
|
|||||||
", <span#{if filename isnt shortFilename then " title='#{filename}'" else ''}>#{shortFilename}</span>"
|
", <span#{if filename isnt shortFilename then " title='#{filename}'" else ''}>#{shortFilename}</span>"
|
||||||
}" + ")</div>"
|
}" + ")</div>"
|
||||||
|
|
||||||
fileHTML = "<div class=file id=f#{postID}>#{fileInfo}#{imgSrc}</div>"
|
fileHTML = "<div class=file>#{fileInfo}#{imgSrc}</div>"
|
||||||
else
|
else
|
||||||
fileHTML = ''
|
fileHTML = ''
|
||||||
|
|
||||||
|
|||||||
@ -14,14 +14,10 @@ Get =
|
|||||||
threadFromNode: (node) ->
|
threadFromNode: (node) ->
|
||||||
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
|
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
|
||||||
postFromRoot: (root) ->
|
postFromRoot: (root) ->
|
||||||
link = $ 'a[title="Highlight this post"]', root
|
post = g.posts[root.dataset.fullID]
|
||||||
boardID = link.pathname.split('/')[1]
|
if index = root.dataset.clone then post.clones[index] else post
|
||||||
postID = link.hash[2..]
|
postFromNode: (node) ->
|
||||||
index = root.dataset.clone
|
Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', node
|
||||||
post = g.posts["#{boardID}.#{postID}"]
|
|
||||||
if index then post.clones[index] else post
|
|
||||||
postFromNode: (root) ->
|
|
||||||
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root
|
|
||||||
contextFromNode: (node) ->
|
contextFromNode: (node) ->
|
||||||
Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', node
|
Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', node
|
||||||
postDataFromLink: (link) ->
|
postDataFromLink: (link) ->
|
||||||
|
|||||||
@ -393,8 +393,7 @@ Header =
|
|||||||
hashScroll: ->
|
hashScroll: ->
|
||||||
hash = @location.hash[1..]
|
hash = @location.hash[1..]
|
||||||
return unless /^p\d+$/.test(hash) and post = $.id hash
|
return unless /^p\d+$/.test(hash) and post = $.id hash
|
||||||
return if (Get.postFromRoot post).isHidden
|
return if (Get.postFromNode post).isHidden
|
||||||
|
|
||||||
Header.scrollTo post
|
Header.scrollTo post
|
||||||
|
|
||||||
scrollTo: (root, down, needed) ->
|
scrollTo: (root, down, needed) ->
|
||||||
|
|||||||
@ -138,7 +138,6 @@ Index =
|
|||||||
|
|
||||||
$.rm navLink for navLink in $$ '.navLinks'
|
$.rm navLink for navLink in $$ '.navLinks'
|
||||||
$.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks
|
$.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks
|
||||||
$.rmClass doc, 'index-loading'
|
|
||||||
|
|
||||||
@cb.toggleCatalogMode()
|
@cb.toggleCatalogMode()
|
||||||
|
|
||||||
@ -147,6 +146,7 @@ Index =
|
|||||||
$.replace pagelist, Index.pagelist
|
$.replace pagelist, Index.pagelist
|
||||||
else
|
else
|
||||||
$.after $.id('delform'), Index.pagelist
|
$.after $.id('delform'), Index.pagelist
|
||||||
|
$.rmClass doc, 'index-loading'
|
||||||
|
|
||||||
scroll: $.debounce 100, ->
|
scroll: $.debounce 100, ->
|
||||||
return if Index.req or Conf['Index Mode'] isnt 'infinite' or (doc.scrollTop <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread'
|
return if Index.req or Conf['Index Mode'] isnt 'infinite' or (doc.scrollTop <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread'
|
||||||
@ -566,12 +566,10 @@ Index =
|
|||||||
thread.collect() unless thread.ID in Index.liveThreadIDs
|
thread.collect() unless thread.ID in Index.liveThreadIDs
|
||||||
|
|
||||||
buildThreads: ->
|
buildThreads: ->
|
||||||
Index.nodes = []
|
threads = []
|
||||||
threads = []
|
posts = []
|
||||||
posts = []
|
|
||||||
for threadData, i in Index.liveThreadData
|
for threadData, i in Index.liveThreadData
|
||||||
threadRoot = Build.thread g.BOARD, threadData
|
threadRoot = Build.thread g.BOARD, threadData
|
||||||
Index.nodes.push threadRoot
|
|
||||||
if thread = g.BOARD.threads[threadData.no]
|
if thread = g.BOARD.threads[threadData.no]
|
||||||
thread.setPage i // Index.threadsNumPerPage
|
thread.setPage i // Index.threadsNumPerPage
|
||||||
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
|
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
|
||||||
@ -665,7 +663,7 @@ Index =
|
|||||||
when 'filecount'
|
when 'filecount'
|
||||||
sortedThreadIDs = [Index.liveThreadData...].sort((a, b) -> b.images - a.images).map (data) -> data.no
|
sortedThreadIDs = [Index.liveThreadData...].sort((a, b) -> b.images - a.images).map (data) -> data.no
|
||||||
Index.sortedThreads = sortedThreadIDs
|
Index.sortedThreads = sortedThreadIDs
|
||||||
.map (threadID) -> Get.threadFromRoot Index.nodes[Index.liveThreadIDs.indexOf threadID]
|
.map (threadID) -> g.BOARD.threads[threadID]
|
||||||
.filter (thread) -> thread.isHidden is Index.showHiddenThreads
|
.filter (thread) -> thread.isHidden is Index.showHiddenThreads
|
||||||
if Index.isSearching
|
if Index.isSearching
|
||||||
Index.sortedThreads = Index.querySearch(Index.searchInput.value) or Index.sortedThreads
|
Index.sortedThreads = Index.querySearch(Index.searchInput.value) or Index.sortedThreads
|
||||||
|
|||||||
@ -126,34 +126,30 @@ Settings =
|
|||||||
$.get Conf, (Conf) ->
|
$.get Conf, (Conf) ->
|
||||||
# XXX don't export archives.
|
# XXX don't export archives.
|
||||||
delete Conf['archives']
|
delete Conf['archives']
|
||||||
Settings.downloadExport {version: g.VERSION, date: Date.now(), Conf}
|
Settings.downloadExport 'Settings', {version: g.VERSION, date: Date.now(), Conf}
|
||||||
downloadExport: (data) ->
|
downloadExport: (title, data) ->
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
download: "<%= meta.name %> v#{g.VERSION}-#{data.date}.json"
|
download: "<%= meta.name %> v#{g.VERSION} #{title}.#{data.date}.json"
|
||||||
href: "data:application/json;base64,#{btoa unescape encodeURIComponent JSON.stringify data, null, 2}"
|
href: "data:application/json;base64,#{btoa unescape encodeURIComponent JSON.stringify data, null, 2}"
|
||||||
<% if (type === 'userscript') { %>
|
<% if (type === 'userscript') { %>$.add d.body, a<% } %>
|
||||||
p = $ '.imp-exp-result', Settings.dialog
|
|
||||||
$.rmAll p
|
|
||||||
$.add p, a
|
|
||||||
<% } %>
|
|
||||||
a.click()
|
a.click()
|
||||||
|
<% if (type === 'userscript') { %>$.rm a<% } %>
|
||||||
import: ->
|
import: ->
|
||||||
$('input', @parentNode).click()
|
$('input[type=file]', @parentNode).click()
|
||||||
onImport: ->
|
onImport: ->
|
||||||
return unless file = @files[0]
|
return unless file = @files[0]
|
||||||
output = $('.imp-exp-result')
|
return unless confirm 'Your current settings will be entirely overwritten, are you sure?'
|
||||||
unless confirm 'Your current settings will be entirely overwritten, are you sure?'
|
|
||||||
output.textContent = 'Import aborted.'
|
|
||||||
return
|
|
||||||
reader = new FileReader()
|
reader = new FileReader()
|
||||||
reader.onload = (e) ->
|
reader.onload = (e) ->
|
||||||
try
|
try
|
||||||
Settings.loadSettings JSON.parse e.target.result
|
Settings.loadSettings JSON.parse e.target.result
|
||||||
if confirm 'Import successful. Reload now?'
|
|
||||||
window.location.reload()
|
|
||||||
catch err
|
catch err
|
||||||
output.textContent = 'Import failed due to an error.'
|
alert 'Import failed due to an error.'
|
||||||
c.error err.stack
|
c.error err.stack
|
||||||
|
return
|
||||||
|
if confirm 'Import successful. Reload now?'
|
||||||
|
window.location.reload()
|
||||||
reader.readAsText file
|
reader.readAsText file
|
||||||
loadSettings: (data) ->
|
loadSettings: (data) ->
|
||||||
version = data.version.split '.'
|
version = data.version.split '.'
|
||||||
@ -231,7 +227,7 @@ Settings =
|
|||||||
if data.Conf['WatchedThreads']
|
if data.Conf['WatchedThreads']
|
||||||
data.Conf['watchedThreads'] = boards: ThreadWatcher.convert data.Conf['WatchedThreads']
|
data.Conf['watchedThreads'] = boards: ThreadWatcher.convert data.Conf['WatchedThreads']
|
||||||
delete data.Conf['WatchedThreads']
|
delete data.Conf['WatchedThreads']
|
||||||
$.set data.Conf
|
$.clear -> $.set data.Conf
|
||||||
reset: ->
|
reset: ->
|
||||||
if confirm 'Your current settings will be entirely wiped, are you sure?'
|
if confirm 'Your current settings will be entirely wiped, are you sure?'
|
||||||
$.clear -> window.location.reload() if confirm 'Reset successful. Reload now?'
|
$.clear -> window.location.reload() if confirm 'Reset successful. Reload now?'
|
||||||
|
|||||||
@ -40,6 +40,12 @@
|
|||||||
background-color: rgba(255, 255, 255, .14);
|
background-color: rgba(255, 255, 255, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.burichan .hide-post-button,
|
||||||
|
:root.burichan .show-post-button {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.burichan #dump-list::-webkit-scrollbar-thumb {
|
.burichan #dump-list::-webkit-scrollbar-thumb {
|
||||||
background-color: #D6DAF0;
|
background-color: #D6DAF0;
|
||||||
|
|||||||
@ -39,6 +39,11 @@
|
|||||||
background-color: rgba(255, 255, 255, .14);
|
background-color: rgba(255, 255, 255, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.futaba .hide-post-button,
|
||||||
|
:root.futaba .show-post-button {
|
||||||
|
color: #800000;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.futaba #dump-list::-webkit-scrollbar-thumb {
|
.futaba #dump-list::-webkit-scrollbar-thumb {
|
||||||
|
|||||||
@ -39,6 +39,12 @@
|
|||||||
background-color: rgba(255, 255, 255, .14);
|
background-color: rgba(255, 255, 255, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.photon .hide-post-button,
|
||||||
|
:root.photon .show-post-button {
|
||||||
|
color: #333 !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.photon #dump-list::-webkit-scrollbar-thumb {
|
.photon #dump-list::-webkit-scrollbar-thumb {
|
||||||
background-color: #DDD;
|
background-color: #DDD;
|
||||||
|
|||||||
@ -380,7 +380,7 @@ div.center:not(.ad-cnt) {
|
|||||||
}
|
}
|
||||||
#fourchanx-settings > nav a.close {
|
#fourchanx-settings > nav a.close {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 0 2px;
|
padding: 2px 2px .5em;
|
||||||
}
|
}
|
||||||
.section-container {
|
.section-container {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@ -627,6 +627,10 @@ span.hide-announcement {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
}
|
}
|
||||||
|
a.hide-announcement {
|
||||||
|
float: left;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Unread */
|
/* Unread */
|
||||||
#unread-line {
|
#unread-line {
|
||||||
|
|||||||
@ -39,6 +39,12 @@
|
|||||||
background-color: rgba(0, 0, 0, .14);
|
background-color: rgba(0, 0, 0, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.tomorrow .hide-post-button,
|
||||||
|
:root.tomorrow .show-post-button {
|
||||||
|
color: #C5C8C6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.tomorrow #dump-list::-webkit-scrollbar-thumb {
|
.tomorrow #dump-list::-webkit-scrollbar-thumb {
|
||||||
background-color: #282A2E;
|
background-color: #282A2E;
|
||||||
|
|||||||
@ -39,6 +39,12 @@
|
|||||||
background-color: rgba(255, 255, 255, .14);
|
background-color: rgba(255, 255, 255, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.yotsuba .hide-post-button,
|
||||||
|
:root.yotsuba .show-post-button {
|
||||||
|
color: #E0BFB7;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.yotsuba-b #dump-list::-webkit-scrollbar-thumb {
|
.yotsuba-b #dump-list::-webkit-scrollbar-thumb {
|
||||||
background-color: #D6DAF0;
|
background-color: #D6DAF0;
|
||||||
|
|||||||
@ -39,6 +39,12 @@
|
|||||||
background-color: rgba(255, 255, 255, .14);
|
background-color: rgba(255, 255, 255, .14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post Hiding */
|
||||||
|
:root.yotsuba-b .hide-post-button,
|
||||||
|
:root.yotsuba-b .show-post-button {
|
||||||
|
color: #B7C5D9;
|
||||||
|
}
|
||||||
|
|
||||||
/* QR */
|
/* QR */
|
||||||
.yotsuba #dump-list::-webkit-scrollbar-thumb {
|
.yotsuba #dump-list::-webkit-scrollbar-thumb {
|
||||||
background-color: #F0E0D6;
|
background-color: #F0E0D6;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
"""#{if isOP then '' else "<div class=sideArrows id=sa#{postID}>>></div>"}
|
"""#{if isOP then '' else "<div class=sideArrows>>></div>"}
|
||||||
<div id=p#{postID} class='post #{if isOP then 'op' else 'reply'}#{
|
<div id=p#{postID} class='post #{if isOP then 'op' else 'reply'}#{
|
||||||
if capcodeIcon is 'admin_highlight' then
|
if capcodeIcon is 'admin_highlight' then
|
||||||
' highlightPost'
|
' highlightPost'
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#{if isOP then fileHTML else ''}
|
#{if isOP then fileHTML else ''}
|
||||||
|
|
||||||
<div class='postInfo' id=pi#{postID}>
|
<div class='postInfo'>
|
||||||
<input type=checkbox name=#{postID} value=delete>
|
<input type=checkbox name=#{postID} value=delete>
|
||||||
#{' '}<span class=subject>#{subject or ''}</span>#{' '}
|
#{' '}<span class=subject>#{subject or ''}</span>#{' '}
|
||||||
<span class='nameBlock#{capcodeClass}'>
|
<span class='nameBlock#{capcodeClass}'>
|
||||||
@ -31,6 +31,6 @@
|
|||||||
|
|
||||||
#{if isOP then '' else fileHTML}
|
#{if isOP then '' else fileHTML}
|
||||||
|
|
||||||
<blockquote class=postMessage id=m#{postID}>#{comment or ''}</blockquote>#{' '}
|
<blockquote class=postMessage>#{comment or ''}</blockquote>#{' '}
|
||||||
|
|
||||||
</div>"""
|
</div>"""
|
||||||
|
|||||||
@ -303,10 +303,17 @@ do ->
|
|||||||
$.delete = (keys) ->
|
$.delete = (keys) ->
|
||||||
if typeof keys is 'string'
|
if typeof keys is 'string'
|
||||||
keys = [keys]
|
keys = [keys]
|
||||||
|
local = []
|
||||||
|
sync = []
|
||||||
for key in keys
|
for key in keys
|
||||||
delete items.local[key]
|
if key in $.localKeys
|
||||||
delete items.sync[key]
|
local.push key
|
||||||
chrome.storage.sync.remove keys
|
delete items.local[key]
|
||||||
|
else
|
||||||
|
sync.push key
|
||||||
|
delete items.sync[key]
|
||||||
|
chrome.storage.local.remove local
|
||||||
|
chrome.storage.sync.remove sync
|
||||||
|
|
||||||
$.get = (key, val, cb) ->
|
$.get = (key, val, cb) ->
|
||||||
if typeof cb is 'function'
|
if typeof cb is 'function'
|
||||||
|
|||||||
@ -6,9 +6,10 @@ class Post
|
|||||||
@ID = +root.id[2..]
|
@ID = +root.id[2..]
|
||||||
@fullID = "#{@board}.#{@ID}"
|
@fullID = "#{@board}.#{@ID}"
|
||||||
|
|
||||||
@cleanup root if that.isOriginalMarkup
|
|
||||||
post = $ '.post', root
|
post = $ '.post', root
|
||||||
info = $ '.postInfo', post
|
info = $ '.postInfo', post
|
||||||
|
@cleanup root, post if that.isOriginalMarkup
|
||||||
|
root.dataset.fullID = @fullID
|
||||||
@nodes =
|
@nodes =
|
||||||
root: root
|
root: root
|
||||||
post: post
|
post: post
|
||||||
@ -149,9 +150,11 @@ class Post
|
|||||||
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
||||||
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
||||||
|
|
||||||
cleanup: (root) ->
|
cleanup: (root, post) ->
|
||||||
for node in $$ '.mobile', root
|
for node in $$ '.mobile', root
|
||||||
$.rm node
|
$.rm node
|
||||||
|
for node in $$ '[id]', post
|
||||||
|
node.removeAttribute 'id'
|
||||||
for node in $$ '.desktop', root
|
for node in $$ '.desktop', root
|
||||||
$.rmClass node, 'desktop'
|
$.rmClass node, 'desktop'
|
||||||
return
|
return
|
||||||
|
|||||||
@ -35,13 +35,4 @@ Menu =
|
|||||||
button
|
button
|
||||||
|
|
||||||
toggle: (e) ->
|
toggle: (e) ->
|
||||||
try
|
Menu.menu.toggle e, @, Get.postFromNode @
|
||||||
# Posts, inlined posts, hidden replies.
|
|
||||||
post = Get.postFromNode @
|
|
||||||
catch
|
|
||||||
post = if fullID = @parentNode.parentNode.dataset.fullID
|
|
||||||
g.threads[fullID].OP
|
|
||||||
else
|
|
||||||
# Hidden threads.
|
|
||||||
Get.threadFromNode(@).OP
|
|
||||||
Menu.menu.toggle e, @, post
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ RelativeDates =
|
|||||||
when 'thread'
|
when 'thread'
|
||||||
return unless Conf['Relative Post Dates']
|
return unless Conf['Relative Post Dates']
|
||||||
@flush()
|
@flush()
|
||||||
$.on d, 'visibilitychange ThreadUpdate', @flush if g.VIEW is 'thread'
|
$.on d, 'visibilitychange ThreadUpdate', @flush
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -93,10 +93,9 @@ ThreadUpdater =
|
|||||||
Thread.callbacks.disconnect 'Thread Updater'
|
Thread.callbacks.disconnect 'Thread Updater'
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
ThreadUpdater.thread = @
|
ThreadUpdater.thread = @
|
||||||
ThreadUpdater.root = @OP.nodes.root.parentNode
|
ThreadUpdater.root = @OP.nodes.root.parentNode
|
||||||
ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]
|
ThreadUpdater.lastPost = +Object.keys(@posts).sort()[-1..][0]
|
||||||
ThreadUpdater.outdateCount = 0
|
|
||||||
|
|
||||||
ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval']
|
ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval']
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ ThreadWatcher =
|
|||||||
ThreadWatcher.refresh()
|
ThreadWatcher.refresh()
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
toggle: ->
|
toggle: ->
|
||||||
ThreadWatcher.toggle Get.postFromNode(@).thread
|
ThreadWatcher.toggle Get.threadFromNode @
|
||||||
rm: ->
|
rm: ->
|
||||||
[boardID, threadID] = @parentNode.dataset.fullID.split '.'
|
[boardID, threadID] = @parentNode.dataset.fullID.split '.'
|
||||||
ThreadWatcher.rm boardID, +threadID
|
ThreadWatcher.rm boardID, +threadID
|
||||||
|
|||||||
@ -39,7 +39,7 @@ QuoteInline =
|
|||||||
if $.hasClass @, 'inlined'
|
if $.hasClass @, 'inlined'
|
||||||
QuoteInline.rm @, boardID, threadID, postID, context
|
QuoteInline.rm @, boardID, threadID, postID, context
|
||||||
else
|
else
|
||||||
return if $.x "ancestor::div[@id='p#{postID}']", @
|
return if $.x "ancestor::div[@id='pc#{postID}']", @
|
||||||
QuoteInline.add @, boardID, threadID, postID, context
|
QuoteInline.add @, boardID, threadID, postID, context
|
||||||
@classList.toggle 'inlined'
|
@classList.toggle 'inlined'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user