${x}') %>`
+ $.extend div, `<%= readHTML('Filter-guide.html') %>`
$('.warning', div).hidden = Conf['Filter']
sauce: (section) ->
- $.extend section, <%= readHTML('Sauce.html') %>
+ $.extend section, `<%= readHTML('Sauce.html') %>`
$('.warning', section).hidden = Conf['Sauce']
ta = $ 'textarea', section
$.get 'sauces', Conf['sauces'], (item) ->
@@ -548,7 +548,7 @@ Settings =
$.on ta, 'change', $.cb.value
advanced: (section) ->
- $.extend section, <%= readHTML('Advanced.html') %>
+ $.extend section, `<%= readHTML('Advanced.html') %>`
warning.hidden = Conf[warning.dataset.feature] for warning in $$ '.warning', section
inputs = {}
@@ -702,7 +702,7 @@ Settings =
textContent: archive[1]
}
- $.extend td, <%= html('') %>
+ $.extend td, `<%= html('') %>`
select = td.firstElementChild
if not (select.disabled = length is 1)
# XXX GM can't into datasets
@@ -790,7 +790,7 @@ Settings =
$.cb.checked.call @
keybinds: (section) ->
- $.extend section, <%= readHTML('Keybinds.html') %>
+ $.extend section, `<%= readHTML('Keybinds.html') %>`
$('.warning', section).hidden = Conf['Keybinds']
tbody = $ 'tbody', section
@@ -798,7 +798,7 @@ Settings =
inputs = {}
for key, arr of Config.hotkeys
tr = $.el 'tr',
- <%= html('${arr[1]} | | ') %>
+ `<%= html('${arr[1]} | | ') %>`
input = $ 'input', tr
input.name = key
input.spellcheck = false
diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee
index 99b254cef6..12e79c64a5 100644
--- a/src/Images/Gallery.coffee
+++ b/src/Images/Gallery.coffee
@@ -43,7 +43,7 @@ Gallery =
nodes.el = dialog = $.el 'div',
id: 'a-gallery'
- $.extend dialog, <%= readHTML('Gallery.html') %>
+ $.extend dialog, `<%= readHTML('Gallery.html') %>`
nodes[key] = $ value, dialog for key, value of {
buttons: '.gal-buttons'
@@ -388,7 +388,7 @@ Gallery =
createSubEntries: ->
subEntries = (Gallery.menu.createSubEntry item for item in ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'])
- delayLabel = $.el 'label', <%= html('Slide Delay: ') %>
+ delayLabel = $.el 'label', `<%= html('Slide Delay: ') %>`
delayInput = delayLabel.firstElementChild
delayInput.value = Gallery.delay
$.on delayInput, 'change', Gallery.cb.setDelay
diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee
index 87ff8a71cc..d73846b29b 100644
--- a/src/Images/ImageExpand.coffee
+++ b/src/Images/ImageExpand.coffee
@@ -12,7 +12,7 @@ ImageExpand =
Header.addShortcut 'expand-all', @EAI, 520
$.on d, 'scroll visibilitychange', @cb.playVideos
@videoControls = $.el 'span', className: 'video-controls'
- $.extend @videoControls, <%= html(' contract') %>
+ $.extend @videoControls, `<%= html(' contract') %>`
Callbacks.Post.push
name: 'Image Expansion'
diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee
index 264098851f..61f94de926 100644
--- a/src/Images/ImageLoader.coffee
+++ b/src/Images/ImageLoader.coffee
@@ -17,7 +17,7 @@ ImageLoader =
return unless Conf['Image Prefetching'] and g.VIEW in ['index', 'thread']
prefetch = $.el 'label',
- <%= html(' Prefetch Images') %>
+ `<%= html(' Prefetch Images') %>`
@el = prefetch.firstElementChild
$.on @el, 'change', @toggle
diff --git a/src/Images/Metadata.coffee b/src/Images/Metadata.coffee
index d1e39feb89..3303fc4d53 100644
--- a/src/Images/Metadata.coffee
+++ b/src/Images/Metadata.coffee
@@ -15,7 +15,7 @@ Metadata =
className: 'webm-title'
el.dataset.index = i
$.extend el,
- <%= html('') %>
+ `<%= html('') %>`
$.add file.text, [$.tn(' '), el]
$.one el.lastElementChild, 'mouseover focus', Metadata.load if el.children.length is 1
return
diff --git a/src/Images/Volume.coffee b/src/Images/Volume.coffee
index 6ab91a8eba..b14af11d05 100644
--- a/src/Images/Volume.coffee
+++ b/src/Images/Volume.coffee
@@ -29,7 +29,7 @@ Volume =
volumeEntry = $.el 'label',
title: 'Default volume for videos.'
$.extend volumeEntry,
- <%= html(' Volume') %>
+ `<%= html(' Volume') %>`
@inputs =
unmute: unmuteEntry.firstElementChild
diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee
index 659334dcdf..b6fc25c193 100644
--- a/src/Linkification/Embedding.coffee
+++ b/src/Linkification/Embedding.coffee
@@ -6,7 +6,7 @@ Embedding =
if Conf['Embedding'] and g.VIEW isnt 'archive'
@dialog = UI.dialog 'embedding',
- <%= readHTML('Embed.html') %>
+ `<%= readHTML('Embed.html') %>`
@media = $ '#media-embed', @dialog
$.one d, '4chanXInitFinished', @ready
$.on d, 'IndexRefreshInternal', ->
@@ -62,7 +62,7 @@ Embedding =
className: 'embedder'
href: 'javascript:;'
,
- <%= html('(unembed)') %>
+ `<%= html('(unembed)') %>`
embed.dataset[name] = value for name, value of {key, uid, options, href}
@@ -216,7 +216,7 @@ Embedding =
regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp)(?::\w+)?(?:[?#]|$)/i
style: ''
el: (a) ->
- $.el 'div', <%= html('') %>
+ $.el 'div', `<%= html('') %>`
,
key: 'video'
regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i
diff --git a/src/Menu/DeleteLink.coffee b/src/Menu/DeleteLink.coffee
index c16a52fa61..81aa4927eb 100644
--- a/src/Menu/DeleteLink.coffee
+++ b/src/Menu/DeleteLink.coffee
@@ -93,7 +93,7 @@ DeleteLink =
link.textContent = DeleteLink.linkText fileOnly
if resDoc.title is '4chan - Banned' # Ban/warn check
- el = $.el 'span', <%= html('You can't delete posts because you are banned.') %>
+ el = $.el 'span', `<%= html('You can't delete posts because you are banned.') %>`
new Notice 'warning', el, 20
else if msg = resDoc.getElementById 'errmsg' # error!
new Notice 'warning', msg.textContent, 20
diff --git a/src/Menu/Menu.coffee b/src/Menu/Menu.coffee
index 2bfca41404..b503fd90da 100644
--- a/src/Menu/Menu.coffee
+++ b/src/Menu/Menu.coffee
@@ -6,7 +6,7 @@ Menu =
className: 'menu-button'
href: 'javascript:;'
- $.extend @button, <%= html('') %>
+ $.extend @button, `<%= html('') %>`
@menu = new UI.Menu 'post'
Callbacks.Post.push
diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee
index d62c6411bc..b16baf2821 100644
--- a/src/Miscellaneous/FileInfo.coffee
+++ b/src/Miscellaneous/FileInfo.coffee
@@ -29,9 +29,9 @@ FileInfo =
output.push if c of FileInfo.formatters
FileInfo.formatters[c].call post
else
- <%= html('${s}') %>
+ `<%= html('${s}') %>`
''
- $.extend outputNode, <%= html('@{output}') %>
+ $.extend outputNode, `<%= html('@{output}') %>`
for a in $$ '.download-button', outputNode
$.on a, 'click', ImageCommon.download
for a in $$ '.quick-filter-md5', outputNode
@@ -39,25 +39,25 @@ FileInfo =
return
formatters:
- t: -> <%= html('${this.file.url.match(/[^\/]*$/)[0]}') %>
- T: -> <%= html('&{FileInfo.formatters.t.call(this)}') %>
- l: -> <%= html('&{FileInfo.formatters.n.call(this)}') %>
- L: -> <%= html('&{FileInfo.formatters.N.call(this)}') %>
+ t: -> `<%= html('${this.file.url.match(/[^\/]*$/)[0]}') %>`
+ T: -> `<%= html('&{FileInfo.formatters.t.call(this)}') %>`
+ l: -> `<%= html('&{FileInfo.formatters.n.call(this)}') %>`
+ L: -> `<%= html('&{FileInfo.formatters.N.call(this)}') %>`
n: ->
fullname = @file.name
shortname = g.SITE.Build.shortFilename @file.name, @isReply
if fullname is shortname
- <%= html('${fullname}') %>
+ `<%= html('${fullname}') %>`
else
- <%= html('${shortname}${fullname}') %>
- N: -> <%= html('${this.file.name}') %>
- d: -> <%= html('') %>
- f: -> <%= html('') %>
- p: -> <%= html('?{this.file.isSpoiler}{Spoiler, }') %>
- s: -> <%= html('${this.file.size}') %>
- B: -> <%= html('${Math.round(this.file.sizeInBytes)} Bytes') %>
- K: -> <%= html('${Math.round(this.file.sizeInBytes/1024)} KB') %>
- M: -> <%= html('${Math.round(this.file.sizeInBytes/1048576*100)/100} MB') %>
- r: -> <%= html('${this.file.dimensions || "PDF"}') %>
- g: -> <%= html('?{this.file.tag}{, ${this.file.tag}}{}') %>
- '%': -> <%= html('%') %>
+ `<%= html('${shortname}${fullname}') %>`
+ N: -> `<%= html('${this.file.name}') %>`
+ d: -> `<%= html('') %>`
+ f: -> `<%= html('') %>`
+ p: -> `<%= html('?{this.file.isSpoiler}{Spoiler, }') %>`
+ s: -> `<%= html('${this.file.size}') %>`
+ B: -> `<%= html('${Math.round(this.file.sizeInBytes)} Bytes') %>`
+ K: -> `<%= html('${Math.round(this.file.sizeInBytes/1024)} KB') %>`
+ M: -> `<%= html('${Math.round(this.file.sizeInBytes/1048576*100)/100} MB') %>`
+ r: -> `<%= html('${this.file.dimensions || "PDF"}') %>`
+ g: -> `<%= html('?{this.file.tag}{, ${this.file.tag}}{}') %>`
+ '%': -> `<%= html('%') %>`
diff --git a/src/Miscellaneous/ModContact.coffee b/src/Miscellaneous/ModContact.coffee
index 8accd6d64e..9b299e764b 100644
--- a/src/Miscellaneous/ModContact.coffee
+++ b/src/Miscellaneous/ModContact.coffee
@@ -16,19 +16,19 @@ ModContact =
$.add @nodes.post, moveNote
template: (capcode) ->
- <%= html(
+ `<%= html(
'feedback&{ModContact.specific[capcode]()}'
- ) %>
+ ) %>`
specific:
- Mod: -> <%= html(' IRC') %>
+ Mod: -> `<%= html(' IRC') %>`
Manager: -> ModContact.specific.Mod()
- Developer: -> <%= html(' github') %>
- Admin: -> <%= html(' twitter') %>
+ Developer: -> `<%= html(' github') %>`
+ Admin: -> `<%= html(' twitter') %>`
moveNote:
- qa: <%= html(
+ qa: `<%= html(
'Moving a thread to /qa/ does not imply mods will read it. If you wish to contact mods, use ' +
'feedback (https://www.4chan.org/feedback) or ' +
'IRC (https://www.4chan-x.net/4chan-irc.html).'
- ) %>
+ ) %>`
diff --git a/src/Miscellaneous/PostJumper.coffee b/src/Miscellaneous/PostJumper.coffee
index 59bf631d7d..df61b4be98 100644
--- a/src/Miscellaneous/PostJumper.coffee
+++ b/src/Miscellaneous/PostJumper.coffee
@@ -56,7 +56,7 @@ PostJumper =
classNext = 'next'
span = $.el 'span',
className: 'postJumper'
- $.extend span, <%= html('${charPrev}${charNext}') %>
+ $.extend span, `<%= html('${charPrev}${charNext}') %>`
span
scroll: (fromJumper, toJumper) ->
diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee
index 5ce9d17469..c0ca047d27 100644
--- a/src/Miscellaneous/Report.coffee
+++ b/src/Miscellaneous/Report.coffee
@@ -35,7 +35,7 @@ Report =
id: 'archive-report'
hidden: true
,
- <%= readHTML('ArchiveReport.html') %>
+ `<%= readHTML('ArchiveReport.html') %>`
enabled = $ '#archive-report-enabled', fieldset
reason = $ '#archive-report-reason', fieldset
submit = $ '#archive-report-submit', fieldset
diff --git a/src/Monitoring/ReplyPruning.coffee b/src/Monitoring/ReplyPruning.coffee
index b9a6b1d2e6..11c4f70021 100644
--- a/src/Monitoring/ReplyPruning.coffee
+++ b/src/Monitoring/ReplyPruning.coffee
@@ -16,7 +16,7 @@ ReplyPruning =
el = $.el 'span',
title: 'Maximum number of replies to show.'
,
- <%= html(' ') %>
+ `<%= html(' ') %>`
$.prepend el, label
@inputs =
diff --git a/src/Monitoring/ThreadStats.coffee b/src/Monitoring/ThreadStats.coffee
index 120d1a215f..a76a7d6e62 100644
--- a/src/Monitoring/ThreadStats.coffee
+++ b/src/Monitoring/ThreadStats.coffee
@@ -9,11 +9,11 @@ ThreadStats =
if Conf['Page Count in Stats']
@[if g.SITE.isPrunedByAge?(g.BOARD) then 'showPurgePos' else 'showPage'] = true
- statsHTML = <%= html(
+ statsHTML = `<%= html(
'? / ?' +
'?{Conf["IP Count in Stats"] && g.SITE.hasIPCount}{ / ?}' +
'?{Conf["Page Count in Stats"]}{ / ?}'
- ) %>
+ ) %>`
statsTitle = 'Posts / Files'
statsTitle += ' / IPs' if Conf['IP Count in Stats'] and g.SITE.hasIPCount
statsTitle += (if @showPurgePos then ' / Purge Position' else ' / Page') if Conf['Page Count in Stats']
@@ -27,7 +27,7 @@ ThreadStats =
else
@dialog = sc = UI.dialog 'thread-stats',
- <%= html('&{statsHTML}
') %>
+ `<%= html('&{statsHTML}
') %>`
$.addClass doc, 'float'
$.ready ->
$.add d.body, sc
diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee
index de4a9f4602..5e9d89d2e0 100644
--- a/src/Monitoring/ThreadUpdater.coffee
+++ b/src/Monitoring/ThreadUpdater.coffee
@@ -12,11 +12,11 @@ ThreadUpdater =
if Conf['Updater and Stats in Header']
@dialog = sc = $.el 'span',
id: 'updater'
- $.extend sc, <%= html('') %>
+ $.extend sc, `<%= html('') %>`
Header.addShortcut 'updater', sc, 100
else
@dialog = sc = UI.dialog 'updater',
- <%= html('') %>
+ `<%= html('') %>`
$.addClass doc, 'float'
$.ready ->
$.add d.body, sc
@@ -31,7 +31,7 @@ ThreadUpdater =
updateLink = $.el 'span',
className: 'brackets-wrap updatelink'
- $.extend updateLink, <%= html('Update') %>
+ $.extend updateLink, `<%= html('Update') %>`
Main.ready ->
($.add navLinksBot, [$.tn(' '), updateLink] if (navLinksBot = $ '.navLinksBot'))
$.on updateLink.firstElementChild, 'click', @update
@@ -50,7 +50,7 @@ ThreadUpdater =
subEntries.push el: el
@settings = $.el 'span',
- <%= html('Interval') %>
+ `<%= html('Interval') %>`
$.on @settings, 'click', @intervalShortcut
diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee
index 8c4d6aec19..428f6d62ec 100644
--- a/src/Monitoring/ThreadWatcher.coffee
+++ b/src/Monitoring/ThreadWatcher.coffee
@@ -11,7 +11,7 @@ ThreadWatcher =
@db = new DataBoard 'watchedThreads', @refresh, true
@dbLM = new DataBoard 'watcherLastModified', null, true
- @dialog = UI.dialog 'thread-watcher', <%= readHTML('ThreadWatcher.html') %>
+ @dialog = UI.dialog 'thread-watcher', `<%= readHTML('ThreadWatcher.html') %>`
@status = $ '#watcher-status', @dialog
@list = @dialog.lastElementChild
@refreshButton = $ '.refresh', @dialog
@@ -50,7 +50,7 @@ ThreadWatcher =
el: $.el 'a',
href: 'javascript:;'
className: 'has-shortcut-text'
- , <%= html('Alt+click') %>
+ , `<%= html('Alt+click') %>`
order: 6
open: ({thread}) ->
return false if Conf['Index Mode'] isnt 'catalog'
diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee
index a0f2e0c988..1908ed790b 100644
--- a/src/Posting/Captcha.v2.coffee
+++ b/src/Posting/Captcha.v2.coffee
@@ -12,9 +12,9 @@ Captcha.v2 =
$.on d, 'CaptchaCount', @count.bind(@)
root = $.el 'div', className: 'captcha-root'
- $.extend root, <%= html(
+ $.extend root, `<%= html(
''
- ) %>
+ ) %>`
counter = $ '.captcha-counter > a', root
@nodes = {root, counter}
@count()
diff --git a/src/Posting/PassLink.coffee b/src/Posting/PassLink.coffee
index c5f10b3fd2..3111a6d56c 100644
--- a/src/Posting/PassLink.coffee
+++ b/src/Posting/PassLink.coffee
@@ -8,7 +8,7 @@ PassLink =
passLink = $.el 'span',
className: 'brackets-wrap pass-link-container'
- $.extend passLink, <%= html('4chan Pass') %>
+ $.extend passLink, `<%= html('4chan Pass') %>`
$.on passLink.firstElementChild, 'click', ->
window.open "//sys.#{location.hostname.split('.')[1]}.org/auth",
Date.now()
diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee
index bc7a655db2..ce9639a937 100644
--- a/src/Posting/QR.coffee
+++ b/src/Posting/QR.coffee
@@ -72,7 +72,7 @@ QR =
if (origToggle = $.id 'togglePostFormLink')
link = $.el 'h1',
className: "qr-link-container"
- $.extend link, <%= html('?{g.VIEW === "thread"}{Reply to Thread}{Start a Thread}') %>
+ $.extend link, `<%= html('?{g.VIEW === "thread"}{Reply to Thread}{Start a Thread}') %>`
QR.link = link.firstElementChild
$.on link.firstChild, 'click', ->
@@ -85,7 +85,7 @@ QR =
if g.VIEW is 'thread'
linkBot = $.el 'div',
className: "brackets-wrap qr-link-container-bottom"
- $.extend linkBot, <%= html('Reply to Thread') %>
+ $.extend linkBot, `<%= html('Reply to Thread') %>`
$.on linkBot.firstElementChild, 'click', ->
QR.open()
@@ -243,10 +243,10 @@ QR =
connectionError: ->
$.el 'span',
- <%= html(
+ `<%= html(
'Connection error while posting. ' +
'[More info]'
- ) %>
+ ) %>`
notifications: []
@@ -363,7 +363,7 @@ QR =
openError: ->
div = $.el 'div'
- $.extend div, <%= html('Could not open file. [More info]') %>
+ $.extend div, `<%= html('Could not open file. [More info]') %>`
QR.error div
setFile: (e) ->
@@ -490,7 +490,7 @@ QR =
dialog: ->
QR.nodes = nodes =
el: dialog = UI.dialog 'qr',
- <%= readHTML('QuickReply.html') %>
+ `<%= readHTML('QuickReply.html') %>`
setNode = (name, query) ->
nodes[name] = $ query, dialog
diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee
index b18f3fdc19..27009285d4 100644
--- a/src/Posting/QR.post.coffee
+++ b/src/Posting/QR.post.coffee
@@ -4,7 +4,7 @@ QR.post = class
className: 'qr-preview'
draggable: true
href: 'javascript:;'
- $.extend el, <%= html('') %>
+ $.extend el, `<%= html('') %>`
@nodes =
el: el
@@ -177,7 +177,7 @@ QR.post = class
error: (className, message, link) ->
div = $.el 'div', {className}
- $.extend div, <%= html('${message}?{link}{ [More info]}
[delete post] [delete all]') %>
+ $.extend div, `<%= html('${message}?{link}{ [More info]}
[delete post] [delete all]') %>`
(@errors or= []).push div
[rm, rmAll] = $$ 'a', div
$.on div, 'click', =>
diff --git a/src/Quotelinks/QuoteThreading.coffee b/src/Quotelinks/QuoteThreading.coffee
index 91fbfc2581..fc4da4720e 100644
--- a/src/Quotelinks/QuoteThreading.coffee
+++ b/src/Quotelinks/QuoteThreading.coffee
@@ -7,12 +7,12 @@ QuoteThreading =
return unless Conf['Quote Threading'] and g.VIEW is 'thread'
@controls = $.el 'label',
- <%= html(' Threading') %>
+ `<%= html(' Threading') %>`
@threadNewLink = $.el 'span',
className: 'brackets-wrap threadnewlink'
hidden: true
- $.extend @threadNewLink, <%= html('Thread New Posts') %>
+ $.extend @threadNewLink, `<%= html('Thread New Posts') %>`
@input = $('input', @controls)
@input.checked = Conf['Thread Quotes']
diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee
index d49c5457bc..e0d9836b8c 100644
--- a/src/Quotelinks/QuoteYou.coffee
+++ b/src/Quotelinks/QuoteYou.coffee
@@ -59,7 +59,7 @@ QuoteYou =
label = $.el 'label',
className: 'toggle-you'
,
- <%= html(' You') %>
+ `<%= html(' You') %>`
input = $ 'input', label
$.on input, 'change', QuoteYou.menu.toggle
Menu.menu?.addEntry
diff --git a/src/classes/Fetcher.coffee b/src/classes/Fetcher.coffee
index a267734f64..ba9b7bc4c8 100644
--- a/src/classes/Fetcher.coffee
+++ b/src/classes/Fetcher.coffee
@@ -149,10 +149,10 @@ class Fetcher
greentext = text[0] is '>'
text = text.replace /(\[\/?[a-z]+):lit(\])/g, '$1$2'
text = for text2, j in text.split /(>>(?:>\/[a-z\d]+\/)?\d+)/g
- <%= html('?{j % 2}{${text2}}{${text2}}') %>
- text = <%= html('?{greentext}{@{text}}{@{text}}') %>
+ `<%= html('?{j % 2}{${text2}}{${text2}}') %>`
+ text = `<%= html('?{greentext}{@{text}}{@{text}}') %>`
text
- comment = <%= html('@{comment}') %>
+ comment = `<%= html('@{comment}') %>`
@threadID = +data.thread_num
o =
@@ -219,24 +219,24 @@ class Fetcher
@insert post
archiveTags:
- '\n': <%= html('
') %>
- '[b]': <%= html('') %>
- '[/b]': <%= html('') %>
- '[spoiler]': <%= html('') %>
- '[/spoiler]': <%= html('') %>
- '[code]': <%= html('') %>
- '[/code]': <%= html('
') %>
- '[moot]': <%= html('') %>
- '[/moot]': <%= html('
') %>
- '[banned]': <%= html('') %>
- '[/banned]': <%= html('') %>
- '[fortune]': (text) -> <%= html('') %>
- '[/fortune]': <%= html('') %>
- '[i]': <%= html('') %>
- '[/i]': <%= html('') %>
- '[red]': <%= html('') %>
- '[/red]': <%= html('') %>
- '[green]': <%= html('') %>
- '[/green]': <%= html('') %>
- '[blue]': <%= html('') %>
- '[/blue]': <%= html('') %>
+ '\n': `<%= html('
') %>`
+ '[b]': `<%= html('') %>`
+ '[/b]': `<%= html('') %>`
+ '[spoiler]': `<%= html('') %>`
+ '[/spoiler]': `<%= html('') %>`
+ '[code]': `<%= html('') %>`
+ '[/code]': `<%= html('
') %>`
+ '[moot]': `<%= html('') %>`
+ '[/moot]': `<%= html('
') %>`
+ '[banned]': `<%= html('') %>`
+ '[/banned]': `<%= html('') %>`
+ '[fortune]': (text) -> `<%= html('') %>`
+ '[/fortune]': `<%= html('') %>`
+ '[i]': `<%= html('') %>`
+ '[/i]': `<%= html('') %>`
+ '[red]': `<%= html('') %>`
+ '[/red]': `<%= html('') %>`
+ '[green]': `<%= html('') %>`
+ '[/green]': `<%= html('') %>`
+ '[blue]': `<%= html('') %>`
+ '[/blue]': `<%= html('') %>`
diff --git a/src/classes/Notice.coffee b/src/classes/Notice.coffee
index 6478c1e944..bbebab5f6c 100644
--- a/src/classes/Notice.coffee
+++ b/src/classes/Notice.coffee
@@ -1,7 +1,7 @@
class Notice
constructor: (type, content, @timeout, @onclose) ->
@el = $.el 'div',
- <%= html('') %>
+ `<%= html('') %>`
@el.style.opacity = 0
@setType type
$.on @el.firstElementChild, 'click', @close
diff --git a/src/main/Main.coffee b/src/main/Main.coffee
index 9b600b9209..57f9dac410 100644
--- a/src/main/Main.coffee
+++ b/src/main/Main.coffee
@@ -121,7 +121,7 @@ Main =
$.set changes, ->
if items['Show Updated Notifications'] ? true
el = $.el 'span',
- <%= html(meta.name + ' has been updated to version ${g.VERSION}.') %>
+ `<%= html(meta.name + ' has been updated to version ${g.VERSION}.') %>`
new Notice 'info', el, 15
parseURL: (site=g.SITE, url=location) ->
@@ -316,7 +316,7 @@ Main =
if g.SITE.isIncomplete?()
msg = $.el 'div',
- <%= html('The page didn't load completely.
Some features may not work unless you reload.') %>
+ `<%= html('The page didn't load completely.
Some features may not work unless you reload.') %>`
$.on $('a', msg), 'click', -> location.reload()
new Notice 'warning', msg
@@ -510,7 +510,7 @@ Main =
$.addClass doc, 'tainted'
if Conf['Disable Native Extension'] and !Main.isFirstRun
msg = $.el 'div',
- <%= html('Failed to disable the native extension. You may need to block it.') %>
+ `<%= html('Failed to disable the native extension. You may need to block it.') %>`
new Notice 'error', msg
unless errors instanceof Array
@@ -522,7 +522,7 @@ Main =
return
div = $.el 'div',
- <%= html('${errors.length} errors occurred.&{Main.reportLink(errors)} [show]') %>
+ `<%= html('${errors.length} errors occurred.&{Main.reportLink(errors)} [show]') %>`
$.on div.lastElementChild, 'click', ->
[@textContent, logs.hidden] = if @textContent is 'show' then (
['hide', false]
@@ -540,7 +540,7 @@ Main =
parseError: (data, reportLink) ->
c.error data.message, data.error.stack
message = $.el 'div',
- <%= html('${data.message}?{reportLink}{&{reportLink}}') %>
+ `<%= html('${data.message}?{reportLink}{&{reportLink}}') %>`
error = $.el 'div',
textContent: "#{data.error.name or 'Error'}: #{data.error.message or 'see console for details'}"
lines = data.error.stack?.match(/\d+(?=:\d+\)?$)/mg)?.join().replace(/^/, ' at ') or ''
@@ -568,7 +568,7 @@ Main =
addDetails '\n`' + data.html + '`' if data.html
details = details.replace /file:\/{3}.+\//g, '' # Remove local file paths
url = '<%= meta.newIssue %>'.replace('%title', encodeURIComponent title).replace('%details', encodeURIComponent details)
- <%= html(' [report]') %>
+ `<%= html(' [report]') %>`
isThisPageLegit: ->
# not 404 error page or similar.
diff --git a/src/platform/$.coffee b/src/platform/$.coffee
index d2da191a6e..3eb1e7bdfd 100644
--- a/src/platform/$.coffee
+++ b/src/platform/$.coffee
@@ -527,7 +527,7 @@ $.crxWorking = ->
return true
unless $.crxWarningShown
msg = $.el 'div',
- <%= html('4chan X seems to have been updated. You will need to reload the page.') %>
+ `<%= html('4chan X seems to have been updated. You will need to reload the page.') %>`
$.on $('a', msg), 'click', -> location.reload()
new Notice 'warning', msg
$.crxWarningShown = true
diff --git a/src/site/SW.yotsuba.Build.coffee b/src/site/SW.yotsuba.Build.coffee
index 2371d29305..5be64cc229 100644
--- a/src/site/SW.yotsuba.Build.coffee
+++ b/src/site/SW.yotsuba.Build.coffee
@@ -144,7 +144,7 @@ Build =
else
"#{url}#q#{ID}"
- postInfo = <%= readHTML('PostInfo.html') %>
+ postInfo = `<%= readHTML('PostInfo.html') %>`
### File Info ###
@@ -154,13 +154,13 @@ Build =
shortFilename = Build.shortFilename file.name
fileThumb = if file.isSpoiler then Build.spoilerThumb(boardID) else file.thumbURL.replace(protocol, '')
- fileBlock = <%= readHTML('File.html') %>
+ fileBlock = `<%= readHTML('File.html') %>`
### Whole Post ###
postClass = if o.isReply then 'reply' else 'op'
- wholePost = <%= readHTML('Post.html') %>
+ wholePost = `<%= readHTML('Post.html') %>`
container = $.el 'div',
className: "postContainer #{postClass}Container"
@@ -237,7 +237,7 @@ Build =
postCount = data.replies + 1
fileCount = data.images + !!data.ext
- container = $.el 'div', <%= readHTML('CatalogThread.html') %>
+ container = $.el 'div', `<%= readHTML('CatalogThread.html') %>`
$.before thread.OP.nodes.info, [container.childNodes...]
for br in $$('br', thread.OP.nodes.comment) when br.previousSibling and br.previousSibling.nodeName is 'BR'
@@ -265,6 +265,6 @@ Build =
link = Build.postURL thread.board.ID, thread.ID, data.no
$.el 'div', {className: 'catalog-reply'},
- <%= readHTML('CatalogReply.html') %>
+ `<%= readHTML('CatalogReply.html') %>`
SW.yotsuba.Build = Build
diff --git a/tools/template.js b/tools/template.js
index b75cab4ccf..6f671a18c8 100644
--- a/tools/template.js
+++ b/tools/template.js
@@ -168,7 +168,7 @@ tools.html = function(template) {
if (stream.text) {
throw new Error(`Unexpected characters in template (${stream.text}): ${template}`);
}
- return `\`{innerHTML: ${output}}\``;
+ return `{innerHTML: ${output}}`;
};
function includesDir(templateName) {