Merge commit 'e1b0d62ceb258f016377517182497d3572fae095'
This commit is contained in:
commit
2a13c80190
@ -164,5 +164,3 @@ Redirect =
|
||||
location.replace url
|
||||
else if alternative
|
||||
location.replace alternative
|
||||
|
||||
return Redirect
|
||||
|
||||
@ -24,5 +24,3 @@ Anonymize =
|
||||
name.textContent = 'Anonymous' for name in $$ '.name'
|
||||
$.rm trip for trip in $$ '.postertrip'
|
||||
return
|
||||
|
||||
return Anonymize
|
||||
|
||||
@ -249,5 +249,3 @@ Filter =
|
||||
tl = ta.textLength
|
||||
ta.setSelectionRange tl, tl
|
||||
ta.focus()
|
||||
|
||||
return Filter
|
||||
|
||||
@ -215,5 +215,3 @@ PostHiding =
|
||||
for quotelink in Get.allQuotelinksLinkingTo post
|
||||
$.rmClass quotelink, 'filtered'
|
||||
return
|
||||
|
||||
return PostHiding
|
||||
|
||||
@ -32,5 +32,3 @@ Recursive =
|
||||
g.posts.forEach (post) ->
|
||||
if fullID in post.quotes
|
||||
recursive post, args...
|
||||
|
||||
return Recursive
|
||||
|
||||
@ -189,5 +189,3 @@ ThreadHiding =
|
||||
threadRoot = thread.OP.nodes.root.parentNode
|
||||
threadRoot.hidden = thread.isHidden = false
|
||||
Index.updateHideLabel() if Conf['JSON Index']
|
||||
|
||||
return ThreadHiding
|
||||
|
||||
@ -257,5 +257,3 @@ Build =
|
||||
$.addClass $('.file-count', root), 'warning'
|
||||
|
||||
root
|
||||
|
||||
return Build
|
||||
|
||||
@ -68,5 +68,3 @@ Get =
|
||||
for script in $$ 'script:not([src])', d.head
|
||||
return script.textContent if /\bcooldowns *=/.test script.textContent
|
||||
''
|
||||
|
||||
return Get
|
||||
|
||||
@ -544,5 +544,3 @@ Header =
|
||||
$.set 'Desktop Notifications', false
|
||||
notice.close()
|
||||
notice = new Notice 'info', el
|
||||
|
||||
return Header
|
||||
|
||||
@ -773,5 +773,3 @@ Index =
|
||||
for keyword in keywords
|
||||
return false if -1 is text.indexOf keyword
|
||||
return true
|
||||
|
||||
return Index
|
||||
|
||||
@ -13,5 +13,3 @@ Polyfill =
|
||||
ui8a[i] = data.charCodeAt i
|
||||
cb new Blob [ui8a], {type}
|
||||
$.globalEval "HTMLCanvasElement.prototype.toBlob = (#{HTMLCanvasElement::toBlob});"
|
||||
|
||||
return Polyfill
|
||||
|
||||
@ -672,5 +672,3 @@ Settings =
|
||||
return unless (key = Keybinds.keyCode e)?
|
||||
@value = key
|
||||
$.cb.value.call @
|
||||
|
||||
return Settings
|
||||
|
||||
@ -382,7 +382,7 @@ checkbox = (name, text, checked) ->
|
||||
$.add label, [input, $.tn " #{text}"]
|
||||
label
|
||||
|
||||
return {
|
||||
UI = {
|
||||
dialog: dialog
|
||||
Menu: Menu
|
||||
hover: hoverstart
|
||||
|
||||
@ -59,5 +59,3 @@ FappeTyme =
|
||||
toggle: (type) ->
|
||||
@set type, !@enabled[type]
|
||||
$.cb.checked.call @nodes[type] if type is 'werk'
|
||||
|
||||
return FappeTyme
|
||||
|
||||
@ -367,5 +367,3 @@ Gallery =
|
||||
subEntries.push el: delayLabel
|
||||
|
||||
subEntries
|
||||
|
||||
return Gallery
|
||||
|
||||
@ -94,5 +94,3 @@ ImageCommon =
|
||||
$.rm a
|
||||
else
|
||||
new Notice 'warning', "Could not download #{href}", 20
|
||||
|
||||
return ImageCommon
|
||||
|
||||
@ -302,5 +302,3 @@ ImageExpand =
|
||||
$.event 'change', null, input
|
||||
$.on input, 'change', $.cb.checked
|
||||
el: label
|
||||
|
||||
return ImageExpand
|
||||
|
||||
@ -74,5 +74,3 @@ ImageHover =
|
||||
@src = URL + if @src is URL then '?' + Date.now() else ''
|
||||
else
|
||||
$.rm @
|
||||
|
||||
return ImageHover
|
||||
|
||||
@ -89,5 +89,3 @@ ImageLoader =
|
||||
{thumb} = post.file
|
||||
if Header.isNodeVisible(thumb) or post.nodes.root is qpClone then thumb.play() else thumb.pause()
|
||||
return
|
||||
|
||||
return ImageLoader
|
||||
|
||||
@ -60,5 +60,3 @@ Metadata =
|
||||
else unless element in [0x8538067, 0x549A966] # Segment, Info
|
||||
i += size
|
||||
null
|
||||
|
||||
return Metadata
|
||||
|
||||
@ -17,5 +17,3 @@ RevealSpoilers =
|
||||
thumb.src = @file.thumbURL
|
||||
else
|
||||
thumb.dataset.src = @file.thumbURL
|
||||
|
||||
return RevealSpoilers
|
||||
|
||||
@ -85,5 +85,3 @@ Sauce =
|
||||
name: (post) -> post.file.name
|
||||
'%': -> '%'
|
||||
semi: -> ';'
|
||||
|
||||
return Sauce
|
||||
|
||||
@ -78,5 +78,3 @@ Volume =
|
||||
volume /= 1.1 if e.deltaY > 0
|
||||
el.volume = $.minmax volume - 0.1, 0, 1
|
||||
e.preventDefault()
|
||||
|
||||
return Volume
|
||||
|
||||
@ -402,5 +402,3 @@ Embedding =
|
||||
return item.snippet.title
|
||||
'Not Found'
|
||||
]
|
||||
|
||||
return Embedding
|
||||
|
||||
@ -155,5 +155,3 @@ Linkify =
|
||||
range.insertNode a
|
||||
|
||||
a
|
||||
|
||||
return Linkify
|
||||
|
||||
@ -55,5 +55,3 @@ ArchiveLink =
|
||||
el: el
|
||||
open: open
|
||||
}
|
||||
|
||||
return ArchiveLink
|
||||
|
||||
@ -132,5 +132,3 @@ DeleteLink =
|
||||
for fileOnly in [false, true] when DeleteLink.auto[+fileOnly][post.fullID]
|
||||
DeleteLink.delete post, fileOnly
|
||||
return
|
||||
|
||||
return DeleteLink
|
||||
|
||||
@ -17,5 +17,3 @@ DownloadLink =
|
||||
a.href = file.url
|
||||
a.download = file.name
|
||||
true
|
||||
|
||||
return DownloadLink
|
||||
|
||||
@ -34,5 +34,3 @@ Menu =
|
||||
$.on button, 'click', (e) ->
|
||||
Menu.menu.toggle e, @, post
|
||||
button
|
||||
|
||||
return Menu
|
||||
|
||||
@ -28,5 +28,3 @@ ReportLink =
|
||||
id = Date.now()
|
||||
set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,#{dims}"
|
||||
window.open url, id, set
|
||||
|
||||
return ReportLink
|
||||
|
||||
@ -31,5 +31,3 @@ AntiAutoplay =
|
||||
object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '')
|
||||
$.addClass object, 'autoplay-removed'
|
||||
return
|
||||
|
||||
return AntiAutoplay
|
||||
|
||||
@ -90,5 +90,3 @@ Banner =
|
||||
child.textContent = data.title
|
||||
else
|
||||
Banner.db.delete {boardID: g.BOARD.ID, threadID: className}
|
||||
|
||||
return Banner
|
||||
|
||||
@ -86,5 +86,3 @@ CatalogLinks =
|
||||
if g.BOARD.ID is board and g.VIEW is 'index' then '#index' else "/#{board}/#index"
|
||||
else
|
||||
"/#{board}/"
|
||||
|
||||
return CatalogLinks
|
||||
|
||||
@ -15,5 +15,3 @@ CustomCSS =
|
||||
unless @style
|
||||
return @addStyle()
|
||||
@style.textContent = Conf['usercss']
|
||||
|
||||
return CustomCSS
|
||||
|
||||
@ -71,5 +71,3 @@ ExpandComment =
|
||||
for callback in ExpandComment.callbacks
|
||||
callback.call post
|
||||
return
|
||||
|
||||
return ExpandComment
|
||||
|
||||
@ -103,5 +103,3 @@ ExpandThread =
|
||||
|
||||
postsCount = postsRoot.length
|
||||
a.textContent = Build.summaryText '-', postsCount, filesCount
|
||||
|
||||
return ExpandThread
|
||||
|
||||
@ -56,5 +56,3 @@ FileInfo =
|
||||
r: -> <%= html('${this.file.dimensions || "PDF"}') %>
|
||||
g: -> <%= html('?{this.file.tag}{, ${this.file.tag}}{}') %>
|
||||
'%': -> <%= html('%') %>
|
||||
|
||||
return FileInfo
|
||||
|
||||
@ -10,5 +10,3 @@ Flash =
|
||||
if g.VIEW is 'thread'
|
||||
$.global -> window.Main.tid = location.pathname.split(/\/+/)[3]
|
||||
$.global -> window.SWFEmbed.init()
|
||||
|
||||
return Flash
|
||||
|
||||
@ -73,5 +73,3 @@ Fourchan =
|
||||
$.event 'mathjax', null, @nodes.comment
|
||||
$.on d, 'PostsInserted', cb
|
||||
cb()
|
||||
|
||||
return Fourchan
|
||||
|
||||
@ -47,5 +47,3 @@ IDColor =
|
||||
while i < 8
|
||||
msg = (msg << 5) - msg + uid.charCodeAt i++
|
||||
msg
|
||||
|
||||
return IDColor
|
||||
|
||||
@ -21,5 +21,3 @@ IDHighlight =
|
||||
uniqueID = post.info.uniqueID or post.info.capcode
|
||||
IDHighlight.uniqueID = if IDHighlight.uniqueID is uniqueID then null else uniqueID
|
||||
g.posts.forEach IDHighlight.set
|
||||
|
||||
return IDHighlight
|
||||
|
||||
@ -18,5 +18,3 @@ IDPostCount =
|
||||
IDPostCount.thread.posts.forEach (post) ->
|
||||
n++ if post.info.uniqueID is uniqueID
|
||||
@title = "#{n} post#{if n is 1 then '' else 's'} by this ID"
|
||||
|
||||
return IDPostCount
|
||||
|
||||
@ -328,5 +328,3 @@ Keybinds =
|
||||
|
||||
focus: (post) ->
|
||||
$.addClass post, 'highlight'
|
||||
|
||||
return Keybinds
|
||||
|
||||
@ -77,5 +77,3 @@ Nav =
|
||||
d.body.style.marginBottom = null
|
||||
delete Nav.haveExtra
|
||||
$.off d, 'scroll', Nav.removeExtra
|
||||
|
||||
return Nav
|
||||
|
||||
@ -12,5 +12,3 @@ NormalizeURL =
|
||||
pathname = pathname.join '/'
|
||||
if location.pathname isnt pathname
|
||||
history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}"
|
||||
|
||||
return NormalizeURL
|
||||
|
||||
@ -54,5 +54,3 @@ PSAHiding =
|
||||
$.after $.id('globalToggle'), psa
|
||||
PSAHiding.hr?.hidden = PSAHiding.hidden
|
||||
return
|
||||
|
||||
return PSAHiding
|
||||
|
||||
@ -119,5 +119,3 @@ RelativeDates =
|
||||
return if data in RelativeDates.stale # We can call RelativeDates.update() multiple times.
|
||||
return if data instanceof Post and !g.posts[data.fullID] # collected post.
|
||||
RelativeDates.stale.push data
|
||||
|
||||
return RelativeDates
|
||||
|
||||
@ -26,5 +26,3 @@ RemoveSpoilers =
|
||||
$.replace spoiler, span
|
||||
$.add span, [spoiler.childNodes...]
|
||||
return
|
||||
|
||||
return RemoveSpoilers
|
||||
|
||||
@ -23,5 +23,3 @@ Report =
|
||||
return unless (el = $ selector, doc) and getComputedStyle(el).visibility isnt 'hidden'
|
||||
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8
|
||||
window.resizeBy 0, dy if dy > 0
|
||||
|
||||
return Report
|
||||
|
||||
@ -18,5 +18,3 @@ ThreadLinks =
|
||||
|
||||
process: (link) ->
|
||||
link.target = '_blank'
|
||||
|
||||
return ThreadLinks
|
||||
|
||||
@ -62,5 +62,3 @@ Time =
|
||||
y: -> @getFullYear().toString()[2..]
|
||||
Y: -> @getFullYear()
|
||||
'%': -> '%'
|
||||
|
||||
return Time
|
||||
|
||||
@ -80,5 +80,3 @@ Favicon =
|
||||
|
||||
dead: 'data:image/gif;base64,<%= readBase64('dead.gif') %>'
|
||||
logo: 'data:image/png;base64,<%= readBase64('/src/meta/icon128.png') %>'
|
||||
|
||||
return Favicon
|
||||
|
||||
@ -40,5 +40,3 @@ MarkNewIPs =
|
||||
markOld: (post) ->
|
||||
post.nodes.nameBlock.title = 'Not the first post from this IP.'
|
||||
$.addClass post.nodes.root, 'old-ip'
|
||||
|
||||
return MarkNewIPs
|
||||
|
||||
@ -127,5 +127,3 @@ ReplyPruning =
|
||||
# Maintain position in thread when posts are added/removed above
|
||||
if hidden1 isnt hidden2 and (boardTop = Header.getTopOf $('.board')) < 0
|
||||
window.scrollBy 0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY
|
||||
|
||||
return ReplyPruning
|
||||
|
||||
@ -102,5 +102,3 @@ ThreadStats =
|
||||
if g.BOARD.ID isnt 'f' and ThreadStats.lastPost > ThreadStats.lastPageUpdate and ThreadStats.pageCountEl?.textContent isnt '1'
|
||||
clearTimeout ThreadStats.timeout
|
||||
ThreadStats.timeout = setTimeout ThreadStats.fetchPage, 5 * $.SECOND
|
||||
|
||||
return ThreadStats
|
||||
|
||||
@ -360,5 +360,3 @@ ThreadUpdater =
|
||||
postCount: OP.replies + 1
|
||||
fileCount: OP.images + !!OP.fsize
|
||||
ipCount: OP.unique_ips
|
||||
|
||||
return ThreadUpdater
|
||||
|
||||
@ -482,5 +482,3 @@ ThreadWatcher =
|
||||
$.on input, 'change', ThreadWatcher.refresh if name in ['Current Board', 'Show Unread Count']
|
||||
$.on input, 'change', ThreadWatcher.fetchAuto if name in ['Show Unread Count', 'Auto Update Thread Watcher']
|
||||
entry
|
||||
|
||||
return ThreadWatcher
|
||||
|
||||
@ -249,5 +249,3 @@ Unread =
|
||||
Favicon[if isDead then 'dead' else 'default']
|
||||
# `favicon.href = href` doesn't work on Firefox.
|
||||
$.add d.head, Favicon.el
|
||||
|
||||
return Unread
|
||||
|
||||
@ -14,5 +14,3 @@ PassLink =
|
||||
Date.now()
|
||||
'width=500,height=280,toolbar=0'
|
||||
$.before styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]
|
||||
|
||||
return PassLink
|
||||
|
||||
@ -16,5 +16,3 @@ PostSuccessful =
|
||||
threadID: threadID
|
||||
postID: postID
|
||||
val: true
|
||||
|
||||
return PostSuccessful
|
||||
|
||||
@ -816,5 +816,3 @@ QR =
|
||||
QR.cooldown.auto = false
|
||||
QR.notifications.push new Notice 'info', 'QR upload aborted.', 5
|
||||
QR.status()
|
||||
|
||||
return QR
|
||||
|
||||
@ -58,5 +58,3 @@ QuoteBacklink =
|
||||
getContainer: (id) ->
|
||||
@containers[id] or=
|
||||
$.el 'span', className: 'container'
|
||||
|
||||
return QuoteBacklink
|
||||
|
||||
@ -23,5 +23,3 @@ QuoteCT =
|
||||
if boardID is board.ID and threadID isnt thread.ID
|
||||
$.add quotelink, $.tn QuoteCT.text
|
||||
return
|
||||
|
||||
return QuoteCT
|
||||
|
||||
@ -110,5 +110,3 @@ QuoteInline =
|
||||
QuoteInline.rm inlined, boardID, threadID, postID, context
|
||||
$.rmClass inlined, 'inlined'
|
||||
return
|
||||
|
||||
return QuoteInline
|
||||
|
||||
@ -34,5 +34,3 @@ QuoteOP =
|
||||
if "#{boardID}.#{postID}" is fullID
|
||||
$.add quotelink, $.tn QuoteOP.text
|
||||
return
|
||||
|
||||
return QuoteOP
|
||||
|
||||
@ -53,5 +53,3 @@ QuotePreview =
|
||||
for post in [post].concat post.clones
|
||||
$.rmClass post.nodes.post, 'qphl'
|
||||
return
|
||||
|
||||
return QuotePreview
|
||||
|
||||
@ -14,5 +14,3 @@ QuoteStrikeThrough =
|
||||
if g.posts["#{boardID}.#{postID}"]?.isHidden
|
||||
$.addClass quotelink, 'filtered'
|
||||
return
|
||||
|
||||
return QuoteStrikeThrough
|
||||
|
||||
@ -146,5 +146,3 @@ QuoteThreading =
|
||||
Unread.setLine true
|
||||
Unread.read()
|
||||
Unread.update()
|
||||
|
||||
return QuoteThreading
|
||||
|
||||
@ -72,5 +72,3 @@ QuoteYou =
|
||||
Header.scrollTo post
|
||||
$.addClass post, 'highlight'
|
||||
return true
|
||||
|
||||
return QuoteYou
|
||||
|
||||
@ -99,5 +99,3 @@ Quotify =
|
||||
$.before deadlink, green
|
||||
$.add green, deadlink
|
||||
$.replace deadlink, [deadlink.childNodes...]
|
||||
|
||||
return Quotify
|
||||
|
||||
@ -6,5 +6,3 @@ class Board
|
||||
@posts = new SimpleDict()
|
||||
|
||||
g.boards[@] = @
|
||||
|
||||
return Board
|
||||
|
||||
@ -22,5 +22,3 @@ class Callbacks
|
||||
html: node.nodes?.root?.outerHTML
|
||||
|
||||
Main.handleErrors errors if errors
|
||||
|
||||
return Callbacks
|
||||
|
||||
@ -13,5 +13,3 @@ class CatalogThread
|
||||
pageCount: $ '.page-count', root
|
||||
comment: $ '.comment', root
|
||||
@thread.catalogView = @
|
||||
|
||||
return CatalogThread
|
||||
|
||||
@ -20,5 +20,3 @@ class Connection
|
||||
for type, value of data
|
||||
@cb[type]? value
|
||||
return
|
||||
|
||||
return Connection
|
||||
|
||||
@ -105,5 +105,3 @@ class DataBoard
|
||||
onSync: (data) =>
|
||||
@data = data or boards: {}
|
||||
@sync?()
|
||||
|
||||
return DataBoard
|
||||
|
||||
@ -220,5 +220,3 @@ class Fetcher
|
||||
'[/green]': <%= html('</span>') %>
|
||||
'[blue]': <%= html('<span class="mu-b">') %>
|
||||
'[/blue]': <%= html('</span>') %>
|
||||
|
||||
return Fetcher
|
||||
|
||||
@ -30,5 +30,3 @@ class Notice
|
||||
$.off d, 'visibilitychange', @add
|
||||
$.rm @el
|
||||
@onclose?()
|
||||
|
||||
return Notice
|
||||
|
||||
@ -249,5 +249,3 @@ class Post
|
||||
for clone in @clones[index..]
|
||||
clone.nodes.root.dataset.clone = index++
|
||||
return
|
||||
|
||||
return Post
|
||||
|
||||
@ -87,5 +87,3 @@ class RandomAccessList
|
||||
next.prev = prev
|
||||
else
|
||||
@last = prev
|
||||
|
||||
return RandomAccessList
|
||||
|
||||
@ -14,5 +14,3 @@ class ShimSet
|
||||
@size--
|
||||
|
||||
window.Set = ShimSet unless 'Set' of window
|
||||
|
||||
return ShimSet
|
||||
|
||||
@ -16,5 +16,3 @@ class SimpleDict
|
||||
forEach: (fn) ->
|
||||
fn @[key] for key in [@keys...]
|
||||
return
|
||||
|
||||
return SimpleDict
|
||||
|
||||
@ -76,5 +76,3 @@ class Thread
|
||||
@posts.forEach (post) -> post.collect()
|
||||
g.threads.rm @fullID
|
||||
@board.threads.rm @
|
||||
|
||||
return Thread
|
||||
|
||||
@ -1027,5 +1027,3 @@ Config =
|
||||
'Max Replies': 1000
|
||||
|
||||
'Autohiding Scrollbar': false
|
||||
|
||||
return Config
|
||||
|
||||
@ -507,5 +507,3 @@ Main =
|
||||
['Build Test', Build.Test]
|
||||
<% } %>
|
||||
]
|
||||
|
||||
return Main
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
return (selector, root=d.body) ->
|
||||
$$ = (selector, root=d.body) ->
|
||||
[root.querySelectorAll(selector)...]
|
||||
|
||||
@ -585,5 +585,3 @@ $.clear = (cb) ->
|
||||
$.delete $.listValues().map (key) -> key.replace g.NAMESPACE, ''
|
||||
cb?()
|
||||
<% } %>
|
||||
|
||||
return $
|
||||
|
||||
@ -120,5 +120,3 @@ CrossOrigin =
|
||||
delete callbacks[url]
|
||||
responses[url] = response
|
||||
<% } %>
|
||||
|
||||
return CrossOrigin
|
||||
|
||||
@ -10,8 +10,12 @@ for (var name of process.argv.slice(2)) {
|
||||
script = script.replace(/\r\n/g, '\n');
|
||||
script = template(script, {type: parts[2]}, sourceName);
|
||||
if (parts[4] === 'coffee') {
|
||||
var definesVar = /^[$A-Z][$\w]*$/.test(parts[3]);
|
||||
if (definesVar) {
|
||||
script = `${script}\nreturn ${parts[3]};\n`;
|
||||
}
|
||||
script = coffee.compile(script);
|
||||
if (/^[$A-Z][$\w]*$/.test(parts[3])) {
|
||||
if (definesVar) {
|
||||
script = `${parts[3]} = ${script}`;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user