Merge commit 'e1b0d62ceb258f016377517182497d3572fae095'

This commit is contained in:
ccd0 2016-07-09 15:35:52 -07:00
commit 2a13c80190
88 changed files with 7 additions and 173 deletions

View File

@ -164,5 +164,3 @@ Redirect =
location.replace url
else if alternative
location.replace alternative
return Redirect

View File

@ -24,5 +24,3 @@ Anonymize =
name.textContent = 'Anonymous' for name in $$ '.name'
$.rm trip for trip in $$ '.postertrip'
return
return Anonymize

View File

@ -249,5 +249,3 @@ Filter =
tl = ta.textLength
ta.setSelectionRange tl, tl
ta.focus()
return Filter

View File

@ -215,5 +215,3 @@ PostHiding =
for quotelink in Get.allQuotelinksLinkingTo post
$.rmClass quotelink, 'filtered'
return
return PostHiding

View File

@ -32,5 +32,3 @@ Recursive =
g.posts.forEach (post) ->
if fullID in post.quotes
recursive post, args...
return Recursive

View File

@ -189,5 +189,3 @@ ThreadHiding =
threadRoot = thread.OP.nodes.root.parentNode
threadRoot.hidden = thread.isHidden = false
Index.updateHideLabel() if Conf['JSON Index']
return ThreadHiding

View File

@ -257,5 +257,3 @@ Build =
$.addClass $('.file-count', root), 'warning'
root
return Build

View File

@ -68,5 +68,3 @@ Get =
for script in $$ 'script:not([src])', d.head
return script.textContent if /\bcooldowns *=/.test script.textContent
''
return Get

View File

@ -544,5 +544,3 @@ Header =
$.set 'Desktop Notifications', false
notice.close()
notice = new Notice 'info', el
return Header

View File

@ -773,5 +773,3 @@ Index =
for keyword in keywords
return false if -1 is text.indexOf keyword
return true
return Index

View File

@ -13,5 +13,3 @@ Polyfill =
ui8a[i] = data.charCodeAt i
cb new Blob [ui8a], {type}
$.globalEval "HTMLCanvasElement.prototype.toBlob = (#{HTMLCanvasElement::toBlob});"
return Polyfill

View File

@ -672,5 +672,3 @@ Settings =
return unless (key = Keybinds.keyCode e)?
@value = key
$.cb.value.call @
return Settings

View File

@ -382,7 +382,7 @@ checkbox = (name, text, checked) ->
$.add label, [input, $.tn " #{text}"]
label
return {
UI = {
dialog: dialog
Menu: Menu
hover: hoverstart

View File

@ -59,5 +59,3 @@ FappeTyme =
toggle: (type) ->
@set type, !@enabled[type]
$.cb.checked.call @nodes[type] if type is 'werk'
return FappeTyme

View File

@ -367,5 +367,3 @@ Gallery =
subEntries.push el: delayLabel
subEntries
return Gallery

View File

@ -94,5 +94,3 @@ ImageCommon =
$.rm a
else
new Notice 'warning', "Could not download #{href}", 20
return ImageCommon

View File

@ -302,5 +302,3 @@ ImageExpand =
$.event 'change', null, input
$.on input, 'change', $.cb.checked
el: label
return ImageExpand

View File

@ -74,5 +74,3 @@ ImageHover =
@src = URL + if @src is URL then '?' + Date.now() else ''
else
$.rm @
return ImageHover

View File

@ -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

View File

@ -60,5 +60,3 @@ Metadata =
else unless element in [0x8538067, 0x549A966] # Segment, Info
i += size
null
return Metadata

View File

@ -17,5 +17,3 @@ RevealSpoilers =
thumb.src = @file.thumbURL
else
thumb.dataset.src = @file.thumbURL
return RevealSpoilers

View File

@ -85,5 +85,3 @@ Sauce =
name: (post) -> post.file.name
'%': -> '%'
semi: -> ';'
return Sauce

View File

@ -78,5 +78,3 @@ Volume =
volume /= 1.1 if e.deltaY > 0
el.volume = $.minmax volume - 0.1, 0, 1
e.preventDefault()
return Volume

View File

@ -402,5 +402,3 @@ Embedding =
return item.snippet.title
'Not Found'
]
return Embedding

View File

@ -155,5 +155,3 @@ Linkify =
range.insertNode a
a
return Linkify

View File

@ -55,5 +55,3 @@ ArchiveLink =
el: el
open: open
}
return ArchiveLink

View File

@ -132,5 +132,3 @@ DeleteLink =
for fileOnly in [false, true] when DeleteLink.auto[+fileOnly][post.fullID]
DeleteLink.delete post, fileOnly
return
return DeleteLink

View File

@ -17,5 +17,3 @@ DownloadLink =
a.href = file.url
a.download = file.name
true
return DownloadLink

View File

@ -34,5 +34,3 @@ Menu =
$.on button, 'click', (e) ->
Menu.menu.toggle e, @, post
button
return Menu

View File

@ -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

View File

@ -31,5 +31,3 @@ AntiAutoplay =
object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '')
$.addClass object, 'autoplay-removed'
return
return AntiAutoplay

View File

@ -90,5 +90,3 @@ Banner =
child.textContent = data.title
else
Banner.db.delete {boardID: g.BOARD.ID, threadID: className}
return Banner

View File

@ -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

View File

@ -15,5 +15,3 @@ CustomCSS =
unless @style
return @addStyle()
@style.textContent = Conf['usercss']
return CustomCSS

View File

@ -71,5 +71,3 @@ ExpandComment =
for callback in ExpandComment.callbacks
callback.call post
return
return ExpandComment

View File

@ -103,5 +103,3 @@ ExpandThread =
postsCount = postsRoot.length
a.textContent = Build.summaryText '-', postsCount, filesCount
return ExpandThread

View File

@ -56,5 +56,3 @@ FileInfo =
r: -> <%= html('${this.file.dimensions || "PDF"}') %>
g: -> <%= html('?{this.file.tag}{, ${this.file.tag}}{}') %>
'%': -> <%= html('%') %>
return FileInfo

View File

@ -10,5 +10,3 @@ Flash =
if g.VIEW is 'thread'
$.global -> window.Main.tid = location.pathname.split(/\/+/)[3]
$.global -> window.SWFEmbed.init()
return Flash

View File

@ -73,5 +73,3 @@ Fourchan =
$.event 'mathjax', null, @nodes.comment
$.on d, 'PostsInserted', cb
cb()
return Fourchan

View File

@ -47,5 +47,3 @@ IDColor =
while i < 8
msg = (msg << 5) - msg + uid.charCodeAt i++
msg
return IDColor

View File

@ -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

View File

@ -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

View File

@ -328,5 +328,3 @@ Keybinds =
focus: (post) ->
$.addClass post, 'highlight'
return Keybinds

View File

@ -77,5 +77,3 @@ Nav =
d.body.style.marginBottom = null
delete Nav.haveExtra
$.off d, 'scroll', Nav.removeExtra
return Nav

View File

@ -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

View File

@ -54,5 +54,3 @@ PSAHiding =
$.after $.id('globalToggle'), psa
PSAHiding.hr?.hidden = PSAHiding.hidden
return
return PSAHiding

View File

@ -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

View File

@ -26,5 +26,3 @@ RemoveSpoilers =
$.replace spoiler, span
$.add span, [spoiler.childNodes...]
return
return RemoveSpoilers

View File

@ -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

View File

@ -18,5 +18,3 @@ ThreadLinks =
process: (link) ->
link.target = '_blank'
return ThreadLinks

View File

@ -62,5 +62,3 @@ Time =
y: -> @getFullYear().toString()[2..]
Y: -> @getFullYear()
'%': -> '%'
return Time

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -360,5 +360,3 @@ ThreadUpdater =
postCount: OP.replies + 1
fileCount: OP.images + !!OP.fsize
ipCount: OP.unique_ips
return ThreadUpdater

View File

@ -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

View File

@ -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

View File

@ -14,5 +14,3 @@ PassLink =
Date.now()
'width=500,height=280,toolbar=0'
$.before styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]
return PassLink

View File

@ -16,5 +16,3 @@ PostSuccessful =
threadID: threadID
postID: postID
val: true
return PostSuccessful

View File

@ -816,5 +816,3 @@ QR =
QR.cooldown.auto = false
QR.notifications.push new Notice 'info', 'QR upload aborted.', 5
QR.status()
return QR

View File

@ -58,5 +58,3 @@ QuoteBacklink =
getContainer: (id) ->
@containers[id] or=
$.el 'span', className: 'container'
return QuoteBacklink

View File

@ -23,5 +23,3 @@ QuoteCT =
if boardID is board.ID and threadID isnt thread.ID
$.add quotelink, $.tn QuoteCT.text
return
return QuoteCT

View File

@ -110,5 +110,3 @@ QuoteInline =
QuoteInline.rm inlined, boardID, threadID, postID, context
$.rmClass inlined, 'inlined'
return
return QuoteInline

View File

@ -34,5 +34,3 @@ QuoteOP =
if "#{boardID}.#{postID}" is fullID
$.add quotelink, $.tn QuoteOP.text
return
return QuoteOP

View File

@ -53,5 +53,3 @@ QuotePreview =
for post in [post].concat post.clones
$.rmClass post.nodes.post, 'qphl'
return
return QuotePreview

View File

@ -14,5 +14,3 @@ QuoteStrikeThrough =
if g.posts["#{boardID}.#{postID}"]?.isHidden
$.addClass quotelink, 'filtered'
return
return QuoteStrikeThrough

View File

@ -146,5 +146,3 @@ QuoteThreading =
Unread.setLine true
Unread.read()
Unread.update()
return QuoteThreading

View File

@ -72,5 +72,3 @@ QuoteYou =
Header.scrollTo post
$.addClass post, 'highlight'
return true
return QuoteYou

View File

@ -99,5 +99,3 @@ Quotify =
$.before deadlink, green
$.add green, deadlink
$.replace deadlink, [deadlink.childNodes...]
return Quotify

View File

@ -6,5 +6,3 @@ class Board
@posts = new SimpleDict()
g.boards[@] = @
return Board

View File

@ -22,5 +22,3 @@ class Callbacks
html: node.nodes?.root?.outerHTML
Main.handleErrors errors if errors
return Callbacks

View File

@ -13,5 +13,3 @@ class CatalogThread
pageCount: $ '.page-count', root
comment: $ '.comment', root
@thread.catalogView = @
return CatalogThread

View File

@ -20,5 +20,3 @@ class Connection
for type, value of data
@cb[type]? value
return
return Connection

View File

@ -105,5 +105,3 @@ class DataBoard
onSync: (data) =>
@data = data or boards: {}
@sync?()
return DataBoard

View File

@ -220,5 +220,3 @@ class Fetcher
'[/green]': <%= html('</span>') %>
'[blue]': <%= html('<span class="mu-b">') %>
'[/blue]': <%= html('</span>') %>
return Fetcher

View File

@ -30,5 +30,3 @@ class Notice
$.off d, 'visibilitychange', @add
$.rm @el
@onclose?()
return Notice

View File

@ -249,5 +249,3 @@ class Post
for clone in @clones[index..]
clone.nodes.root.dataset.clone = index++
return
return Post

View File

@ -87,5 +87,3 @@ class RandomAccessList
next.prev = prev
else
@last = prev
return RandomAccessList

View File

@ -14,5 +14,3 @@ class ShimSet
@size--
window.Set = ShimSet unless 'Set' of window
return ShimSet

View File

@ -16,5 +16,3 @@ class SimpleDict
forEach: (fn) ->
fn @[key] for key in [@keys...]
return
return SimpleDict

View File

@ -76,5 +76,3 @@ class Thread
@posts.forEach (post) -> post.collect()
g.threads.rm @fullID
@board.threads.rm @
return Thread

View File

@ -1027,5 +1027,3 @@ Config =
'Max Replies': 1000
'Autohiding Scrollbar': false
return Config

View File

@ -507,5 +507,3 @@ Main =
['Build Test', Build.Test]
<% } %>
]
return Main

View File

@ -1,2 +1,2 @@
return (selector, root=d.body) ->
$$ = (selector, root=d.body) ->
[root.querySelectorAll(selector)...]

View File

@ -585,5 +585,3 @@ $.clear = (cb) ->
$.delete $.listValues().map (key) -> key.replace g.NAMESPACE, ''
cb?()
<% } %>
return $

View File

@ -120,5 +120,3 @@ CrossOrigin =
delete callbacks[url]
responses[url] = response
<% } %>
return CrossOrigin

View File

@ -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}`;
}
}