Skip to content

Commit

Permalink
More changes to expedite compiling Coffeescript before interpolating …
Browse files Browse the repository at this point in the history
…templates. #829
  • Loading branch information
ccd0 committed Jul 26, 2019
1 parent 5631d28 commit e58eefc
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
4 changes: 2 additions & 2 deletions src/Archive/Redirect.coffee
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
76 changes: 38 additions & 38 deletions src/Monitoring/Favicon.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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']]

Expand All @@ -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") %>'
2 changes: 1 addition & 1 deletion src/Monitoring/ThreadUpdater.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/config/Config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1182,4 +1182,4 @@ Config =

hiddenPSAList: [{}]

knownBanners: '<%= readJSON('banners.json').join(',') %>'
knownBanners: '<%= readJSON("banners.json").join(",") %>'
3 changes: 2 additions & 1 deletion src/platform/$.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,16 @@ 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?
GM_openInTab
else
(url) -> window.open url, '_blank'
<% } else { %>
$.open =
(url) -> window.open url, '_blank'
<% } %>

Expand Down

0 comments on commit e58eefc

Please sign in to comment.