diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 86db2a84f..b6e11514f 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -186,9 +186,8 @@ Main = $.get 'previousversion', null, ({previousversion}) -> return if previousversion is g.VERSION if previousversion - changelog = '<%= meta.repo %>blob/<%= meta.mainBranch %>/CHANGELOG.md' el = $.el 'span', - innerHTML: "<%= meta.name %> has been updated to version #{g.VERSION}." + innerHTML: '<%= meta.name %> has been updated to version <%= version %>.' new Notice 'info', el, 15 else Settings.open() @@ -243,7 +242,7 @@ Main = return div = $.el 'div', - innerHTML: "#{errors.length} errors occurred. [show]" + innerHTML: "#{+errors.length} errors occurred. [show]" $.on div.lastElementChild, 'click', -> [@textContent, logs.hidden] = if @textContent is 'show' ['hide', false] diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index c50bdad80..f228b9031 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -28,15 +28,13 @@ Settings = return if Settings.dialog $.event 'CloseMenu' - html = <%= importHTML('Settings/Settings') %> - Settings.overlay = overlay = $.el 'div', id: 'overlay' Settings.dialog = dialog = $.el 'div', id: 'fourchanx-settings' className: 'dialog' - innerHTML: html + innerHTML: <%= importHTML('Settings/Settings') %> $.on $('.export', Settings.dialog), 'click', Settings.export $.on $('.import', Settings.dialog), 'click', Settings.import @@ -92,7 +90,8 @@ Settings = inputs = {} for key, obj of Config.main fs = $.el 'fieldset', - innerHTML: "#{key}" + innerHTML: '' + fs.firstElementChild.textContent = key for key, arr of obj description = arr[1] div = $.el 'div' @@ -113,7 +112,7 @@ Settings = return div = $.el 'div', - innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply." + innerHTML: ': Clear manually-hidden threads and posts on all boards. Reload the page to apply.' button = $ 'button', div $.get {hiddenThreads: {}, hiddenPosts: {}}, ({hiddenThreads, hiddenPosts}) -> hiddenNum = 0 @@ -422,16 +421,13 @@ Settings = favicon: -> Favicon.switch() Unread.update() if g.VIEW is 'thread' and Conf['Unread Favicon'] - @nextElementSibling.innerHTML = """ - - - - - """ + img = @nextElementSibling.children + img[0].src = Favicon.default + img[1].src = Favicon.unreadSFW + img[2].src = Favicon.unreadNSFW + img[3].src = Favicon.unreadDead sageEmoji: -> - @nextElementSibling.innerHTML = """ - - """ + @nextElementSibling.firstElementChild.src = "data:image/png;base64,#{Emoji.sage[@value]}" togglecss: -> if $('textarea[name=usercss]', $.x 'ancestor::fieldset[1]', @).disabled = !@checked CustomCSS.rmStyle() @@ -450,7 +446,8 @@ Settings = inputs = {} for key, arr of Config.hotkeys tr = $.el 'tr', - innerHTML: "#{arr[1]}" + innerHTML: '' + tr.firstElementChild.textContent = arr[1] input = $ 'input', tr input.name = key input.spellcheck = false diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html index eb5e51720..32dc380ef 100755 --- a/src/General/html/Settings/Advanced.html +++ b/src/General/html/Settings/Advanced.html @@ -91,7 +91,12 @@ - + + + + + +
@@ -101,7 +106,9 @@ - + + +
Position: #{name}" - title: desc + label = UI.checkbox name, " #{name}" + label.title = desc input = label.firstElementChild if name in ['Fit width', 'Fit height'] $.on input, 'change', ImageExpand.cb.setFitness - input.checked = Conf[name] $.event 'change', null, input $.on input, 'change', $.cb.checked el: label diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 6323c39fa..b4c7b97ca 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -749,18 +749,11 @@ QR = resDoc = req.response if ban = $ '.banType', resDoc # banned/warning - board = $('.board', resDoc).innerHTML - err = $.el 'span', innerHTML: + err = $.el 'span', if ban.textContent.toLowerCase() is 'banned' - """ - You are banned on #{board}! ;_;
- Click here to see the reason. - """ + innerHTML: "You are banned on #{$('.board', resDoc).innerHTML}! ;_;
Click here to see the reason." else - """ - You were issued a warning on #{board} as #{$('.nameBlock', resDoc).innerHTML}.
- Reason: #{$('.reason', resDoc).innerHTML} - """ + innerHTML: "You were issued a warning on #{$('.board', resDoc).innerHTML} as #{$('.nameBlock', resDoc).innerHTML}.
Reason: #{$('.reason', resDoc).innerHTML}" else if err = resDoc.getElementById 'errmsg' # error! $('a', err)?.target = '_blank' # duplicate image link else if resDoc.title isnt 'Post successful!'