diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 86a097f929..776502d11f 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -1,11 +1,11 @@ Redirect = archives: - `<%= + ```<%= JSON.stringify(readJSON('archives.json'), null, 2) .replace(/\n {2,}(?!{)/g, ' ') .replace(/\n/g, '\n ') .replace(/`/g, '\\`') - %>` + %>``` init: -> @selectArchives() diff --git a/src/Monitoring/Favicon.coffee b/src/Monitoring/Favicon.coffee index f3569bbce2..744fa4f470 100644 --- a/src/Monitoring/Favicon.coffee +++ b/src/Monitoring/Favicon.coffee @@ -12,52 +12,52 @@ Favicon = switch: -> items = { ferongr: [ - '<%= readBase64('ferongr.unreadDead.png') %>' - '<%= readBase64('ferongr.unreadDeadY.png') %>' - '<%= readBase64('ferongr.unreadSFW.png') %>' - '<%= readBase64('ferongr.unreadSFWY.png') %>' - '<%= readBase64('ferongr.unreadNSFW.png') %>' - '<%= readBase64('ferongr.unreadNSFWY.png') %>' + '<%= readBase64("ferongr.unreadDead.png") %>' + '<%= readBase64("ferongr.unreadDeadY.png") %>' + '<%= readBase64("ferongr.unreadSFW.png") %>' + '<%= readBase64("ferongr.unreadSFWY.png") %>' + '<%= readBase64("ferongr.unreadNSFW.png") %>' + '<%= readBase64("ferongr.unreadNSFWY.png") %>' ] 'xat-': [ - '<%= readBase64('xat-.unreadDead.png') %>' - '<%= readBase64('xat-.unreadDeadY.png') %>' - '<%= readBase64('xat-.unreadSFW.png') %>' - '<%= readBase64('xat-.unreadSFWY.png') %>' - '<%= readBase64('xat-.unreadNSFW.png') %>' - '<%= readBase64('xat-.unreadNSFWY.png') %>' + '<%= readBase64("xat-.unreadDead.png") %>' + '<%= readBase64("xat-.unreadDeadY.png") %>' + '<%= readBase64("xat-.unreadSFW.png") %>' + '<%= readBase64("xat-.unreadSFWY.png") %>' + '<%= readBase64("xat-.unreadNSFW.png") %>' + '<%= readBase64("xat-.unreadNSFWY.png") %>' ] Mayhem: [ - '<%= readBase64('Mayhem.unreadDead.png') %>' - '<%= readBase64('Mayhem.unreadDeadY.png') %>' - '<%= readBase64('Mayhem.unreadSFW.png') %>' - '<%= readBase64('Mayhem.unreadSFWY.png') %>' - '<%= readBase64('Mayhem.unreadNSFW.png') %>' - '<%= readBase64('Mayhem.unreadNSFWY.png') %>' + '<%= readBase64("Mayhem.unreadDead.png") %>' + '<%= readBase64("Mayhem.unreadDeadY.png") %>' + '<%= readBase64("Mayhem.unreadSFW.png") %>' + '<%= readBase64("Mayhem.unreadSFWY.png") %>' + '<%= readBase64("Mayhem.unreadNSFW.png") %>' + '<%= readBase64("Mayhem.unreadNSFWY.png") %>' ] '4chanJS': [ - '<%= readBase64('4chanJS.unreadDead.png') %>' - '<%= readBase64('4chanJS.unreadDeadY.png') %>' - '<%= readBase64('4chanJS.unreadSFW.png') %>' - '<%= readBase64('4chanJS.unreadSFWY.png') %>' - '<%= readBase64('4chanJS.unreadNSFW.png') %>' - '<%= readBase64('4chanJS.unreadNSFWY.png') %>' + '<%= readBase64("4chanJS.unreadDead.png") %>' + '<%= readBase64("4chanJS.unreadDeadY.png") %>' + '<%= readBase64("4chanJS.unreadSFW.png") %>' + '<%= readBase64("4chanJS.unreadSFWY.png") %>' + '<%= readBase64("4chanJS.unreadNSFW.png") %>' + '<%= readBase64("4chanJS.unreadNSFWY.png") %>' ] Original: [ - '<%= readBase64('Original.unreadDead.png') %>' - '<%= readBase64('Original.unreadDeadY.png') %>' - '<%= readBase64('Original.unreadSFW.png') %>' - '<%= readBase64('Original.unreadSFWY.png') %>' - '<%= readBase64('Original.unreadNSFW.png') %>' - '<%= readBase64('Original.unreadNSFWY.png') %>' + '<%= readBase64("Original.unreadDead.png") %>' + '<%= readBase64("Original.unreadDeadY.png") %>' + '<%= readBase64("Original.unreadSFW.png") %>' + '<%= readBase64("Original.unreadSFWY.png") %>' + '<%= readBase64("Original.unreadNSFW.png") %>' + '<%= readBase64("Original.unreadNSFWY.png") %>' ] 'Metro': [ - '<%= readBase64('Metro.unreadDead.png') %>' - '<%= readBase64('Metro.unreadDeadY.png') %>' - '<%= readBase64('Metro.unreadSFW.png') %>' - '<%= readBase64('Metro.unreadSFWY.png') %>' - '<%= readBase64('Metro.unreadNSFW.png') %>' - '<%= readBase64('Metro.unreadNSFWY.png') %>' + '<%= readBase64("Metro.unreadDead.png") %>' + '<%= readBase64("Metro.unreadDeadY.png") %>' + '<%= readBase64("Metro.unreadSFW.png") %>' + '<%= readBase64("Metro.unreadSFWY.png") %>' + '<%= readBase64("Metro.unreadNSFW.png") %>' + '<%= readBase64("Metro.unreadNSFWY.png") %>' ] }[Conf['favicon']] @@ -80,5 +80,5 @@ Favicon = SFW: '//s.4cdn.org/image/favicon-ws.ico' NSFW: '//s.4cdn.org/image/favicon.ico' - dead: 'data:image/gif;base64,<%= readBase64('dead.gif') %>' - logo: 'data:image/png;base64,<%= readBase64('/src/meta/icon128.png') %>' + dead: 'data:image/gif;base64,<%= readBase64("dead.gif") %>' + logo: 'data:image/png;base64,<%= readBase64("/src/meta/icon128.png") %>' diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 5e9d89d2e0..69f03d7662 100644 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -91,7 +91,7 @@ ThreadUpdater = http://freesound.org/people/pierrecartoons1979/sounds/90112/ cc-by-nc-3.0 ### - beep: 'data:audio/wav;base64,<%= readBase64('beep.wav') %>' + beep: 'data:audio/wav;base64,<%= readBase64("beep.wav") %>' playBeep: -> {audio} = ThreadUpdater diff --git a/src/config/Config.coffee b/src/config/Config.coffee index cc0331269f..28a788b5c7 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -1182,4 +1182,4 @@ Config = hiddenPSAList: [{}] - knownBanners: '<%= readJSON('banners.json').join(',') %>' + knownBanners: '<%= readJSON("banners.json").join(",") %>' diff --git a/src/platform/$.coffee b/src/platform/$.coffee index 3eb1e7bdfd..682fc21ad4 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -367,8 +367,8 @@ do -> $.modifiedClick = (e) -> e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0 -$.open = <% if (type === 'userscript') { %> +$.open = if GM?.openInTab? GM.openInTab else if GM_openInTab? @@ -376,6 +376,7 @@ $.open = else (url) -> window.open url, '_blank' <% } else { %> +$.open = (url) -> window.open url, '_blank' <% } %>