Rebuild only needed files when an imported file changes.
29
Makefile
@ -44,8 +44,6 @@ parts := \
|
|||||||
)) \
|
)) \
|
||||||
main
|
main
|
||||||
|
|
||||||
lang = $(if $(filter globals css,$1),js,coffee)
|
|
||||||
|
|
||||||
# remove extension when sorting so X.coffee comes before X.Y.coffee
|
# remove extension when sorting so X.coffee comes before X.Y.coffee
|
||||||
sources_part = \
|
sources_part = \
|
||||||
$(subst !c,.coffee,$(subst !j,.js,$(sort $(subst .coffee,!c,$(subst .js,!j, \
|
$(subst !c,.coffee,$(subst !j,.js,$(sort $(subst .coffee,!c,$(subst .js,!j, \
|
||||||
@ -55,21 +53,30 @@ sources := $(foreach p,$(parts),$(call sources_part,$(p)))
|
|||||||
|
|
||||||
part_of = $(patsubst src/%/,%,$(dir $1))
|
part_of = $(patsubst src/%/,%,$(dir $1))
|
||||||
|
|
||||||
imports = \
|
uses_tests_enabled := \
|
||||||
$(filter-out %.coffee %.js,$(wildcard src/$1/*.* src/$1/*/*.* src/$1/*/*/*.*)) \
|
src/classes/Post.coffee \
|
||||||
.tests_enabled \
|
src/General/Build.Test.coffee \
|
||||||
$(imports_$1)
|
src/Linkification/Linkify.coffee \
|
||||||
|
src/Miscellaneous/Keybinds.coffee \
|
||||||
|
src/Monitoring/Unread.coffee \
|
||||||
|
src/main/Main.coffee
|
||||||
|
|
||||||
imports_globals := \
|
imports_src/globals/globals.js := \
|
||||||
version.json
|
version.json
|
||||||
imports_config := \
|
imports_src/config/Config.coffee := \
|
||||||
src/Archive/archives.json
|
src/Archive/archives.json
|
||||||
imports_css := \
|
imports_src/css/CSS.js := \
|
||||||
tools/style.js \
|
tools/style.js \
|
||||||
node_modules/font-awesome/package.json
|
node_modules/font-awesome/package.json
|
||||||
imports_Monitoring := \
|
imports_src/Monitoring/Favicon.coffee := \
|
||||||
src/meta/icon128.png
|
src/meta/icon128.png
|
||||||
|
|
||||||
|
imports = \
|
||||||
|
$(filter-out %.coffee %.js,$(wildcard $(dir $1)*.*)) \
|
||||||
|
$(wildcard $(basename $1)/*.*) \
|
||||||
|
$(if $(filter $(uses_tests_enabled),$1),.tests_enabled) \
|
||||||
|
$(imports_$1)
|
||||||
|
|
||||||
dests_platform = $(addprefix tmp/,$(subst /,-,$(subst src/,,$(subst platform,platform_$2,$(subst .coffee,.js,$1)))))
|
dests_platform = $(addprefix tmp/,$(subst /,-,$(subst src/,,$(subst platform,platform_$2,$(subst .coffee,.js,$1)))))
|
||||||
|
|
||||||
dests_of = $(sort $(call dests_platform,$1,crx) $(call dests_platform,$1,userscript))
|
dests_of = $(sort $(call dests_platform,$1,crx) $(call dests_platform,$1,userscript))
|
||||||
@ -131,7 +138,7 @@ tmp/declaration.js : .events/declare
|
|||||||
$(if $(wildcard $@),,node tools/declare.js && echo -> $^)
|
$(if $(wildcard $@),,node tools/declare.js && echo -> $^)
|
||||||
|
|
||||||
define force_compile
|
define force_compile
|
||||||
$$(call dests_of,$1) : $1 $$(call imports,$$(call part_of,$1)) $$(template_deps) $$(coffee_deps) tools/chain.js
|
$$(call dests_of,$1) : $1 $$(call imports,$1) $$(template_deps) $$(coffee_deps) tools/chain.js
|
||||||
$(RM) $$(call QUOTE,$$@)
|
$(RM) $$(call QUOTE,$$@)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ Redirect =
|
|||||||
|
|
||||||
archives:
|
archives:
|
||||||
`<%=
|
`<%=
|
||||||
JSON.stringify(readJSON('src/Archive/archives.json'), null, 2)
|
JSON.stringify(readJSON('archives.json'), null, 2)
|
||||||
.replace(/\n {2,}(?!{)/g, ' ')
|
.replace(/\n {2,}(?!{)/g, ' ')
|
||||||
.replace(/\n/g, '\n ')
|
.replace(/\n/g, '\n ')
|
||||||
.replace(/`/g, '\\`')
|
.replace(/`/g, '\\`')
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<% if (readJSON('.tests_enabled')) { %>
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
Build.Test =
|
Build.Test =
|
||||||
init: ->
|
init: ->
|
||||||
return if !Conf['Menu'] or g.VIEW not in ['index', 'thread']
|
return if !Conf['Menu'] or g.VIEW not in ['index', 'thread']
|
||||||
|
|||||||
@ -115,7 +115,7 @@ Build =
|
|||||||
else
|
else
|
||||||
"/#{boardID}/thread/#{threadID}#q#{postID}"
|
"/#{boardID}/thread/#{threadID}#q#{postID}"
|
||||||
|
|
||||||
postInfo = <%= importHTML('General/Build/PostInfo') %>
|
postInfo = <%= readHTML('PostInfo.html') %>
|
||||||
|
|
||||||
### File Info ###
|
### File Info ###
|
||||||
|
|
||||||
@ -125,13 +125,13 @@ Build =
|
|||||||
shortFilename = Build.shortFilename file.name
|
shortFilename = Build.shortFilename file.name
|
||||||
fileThumb = if file.isSpoiler then Build.spoilerThumb(boardID) else file.thumbURL.replace(protocol, '')
|
fileThumb = if file.isSpoiler then Build.spoilerThumb(boardID) else file.thumbURL.replace(protocol, '')
|
||||||
|
|
||||||
fileBlock = <%= importHTML('General/Build/File') %>
|
fileBlock = <%= readHTML('File.html') %>
|
||||||
|
|
||||||
### Whole Post ###
|
### Whole Post ###
|
||||||
|
|
||||||
postClass = if o.isReply then 'reply' else 'op'
|
postClass = if o.isReply then 'reply' else 'op'
|
||||||
|
|
||||||
wholePost = <%= importHTML('General/Build/Post') %>
|
wholePost = <%= readHTML('Post.html') %>
|
||||||
|
|
||||||
container = $.el 'div',
|
container = $.el 'div',
|
||||||
className: "postContainer #{postClass}Container"
|
className: "postContainer #{postClass}Container"
|
||||||
@ -221,7 +221,7 @@ Build =
|
|||||||
root = $.el 'div',
|
root = $.el 'div',
|
||||||
className: 'catalog-thread'
|
className: 'catalog-thread'
|
||||||
|
|
||||||
$.extend root, <%= importHTML('General/Build/CatalogThread') %>
|
$.extend root, <%= readHTML('CatalogThread.html') %>
|
||||||
|
|
||||||
root.dataset.fullID = thread.fullID
|
root.dataset.fullID = thread.fullID
|
||||||
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
||||||
|
|||||||
@ -63,7 +63,7 @@ Index =
|
|||||||
|
|
||||||
# Navigation links at top of index
|
# Navigation links at top of index
|
||||||
@navLinks = $.el 'div', className: 'navLinks json-index'
|
@navLinks = $.el 'div', className: 'navLinks json-index'
|
||||||
$.extend @navLinks, <%= importHTML('General/Index/NavLinks') %>
|
$.extend @navLinks, <%= readHTML('NavLinks.html') %>
|
||||||
$('.cataloglink a', @navLinks).href = CatalogLinks.catalog()
|
$('.cataloglink a', @navLinks).href = CatalogLinks.catalog()
|
||||||
$('.archlistlink', @navLinks).hidden = true if g.BOARD.ID in ['b', 'trash']
|
$('.archlistlink', @navLinks).hidden = true if g.BOARD.ID in ['b', 'trash']
|
||||||
$.on $('#index-last-refresh a', @navLinks), 'click', @cb.refreshFront
|
$.on $('#index-last-refresh a', @navLinks), 'click', @cb.refreshFront
|
||||||
@ -96,7 +96,7 @@ Index =
|
|||||||
|
|
||||||
# Page list
|
# Page list
|
||||||
@pagelist = $.el 'div', className: 'pagelist json-index'
|
@pagelist = $.el 'div', className: 'pagelist json-index'
|
||||||
$.extend @pagelist, <%= importHTML('General/Index/PageList') %>
|
$.extend @pagelist, <%= readHTML('PageList.html') %>
|
||||||
$('.cataloglink a', @pagelist).href = CatalogLinks.catalog()
|
$('.cataloglink a', @pagelist).href = CatalogLinks.catalog()
|
||||||
$.on @pagelist, 'click', @cb.pageNav
|
$.on @pagelist, 'click', @cb.pageNav
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ Settings =
|
|||||||
Settings.dialog = dialog = $.el 'div',
|
Settings.dialog = dialog = $.el 'div',
|
||||||
id: 'fourchanx-settings'
|
id: 'fourchanx-settings'
|
||||||
className: 'dialog'
|
className: 'dialog'
|
||||||
$.extend dialog, <%= importHTML('General/Settings/Settings') %>
|
$.extend dialog, <%= readHTML('Settings.html') %>
|
||||||
|
|
||||||
Settings.overlay = overlay = $.el 'div',
|
Settings.overlay = overlay = $.el 'div',
|
||||||
id: 'overlay'
|
id: 'overlay'
|
||||||
@ -377,7 +377,7 @@ Settings =
|
|||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
|
||||||
filter: (section) ->
|
filter: (section) ->
|
||||||
$.extend section, <%= importHTML('General/Settings/Filter-select') %>
|
$.extend section, <%= readHTML('Filter-select.html') %>
|
||||||
select = $ 'select', section
|
select = $ 'select', section
|
||||||
$.on select, 'change', Settings.selectFilter
|
$.on select, 'change', Settings.selectFilter
|
||||||
Settings.selectFilter.call select
|
Settings.selectFilter.call select
|
||||||
@ -395,11 +395,11 @@ Settings =
|
|||||||
$.on ta, 'change', $.cb.value
|
$.on ta, 'change', $.cb.value
|
||||||
$.add div, ta
|
$.add div, ta
|
||||||
return
|
return
|
||||||
$.extend div, <%= importHTML('General/Settings/Filter-guide') %>
|
$.extend div, <%= readHTML('Filter-guide.html') %>
|
||||||
$('.warning', div).hidden = Conf['Filter']
|
$('.warning', div).hidden = Conf['Filter']
|
||||||
|
|
||||||
sauce: (section) ->
|
sauce: (section) ->
|
||||||
$.extend section, <%= importHTML('General/Settings/Sauce') %>
|
$.extend section, <%= readHTML('Sauce.html') %>
|
||||||
$('.warning', section).hidden = Conf['Sauce']
|
$('.warning', section).hidden = Conf['Sauce']
|
||||||
ta = $ 'textarea', section
|
ta = $ 'textarea', section
|
||||||
$.get 'sauces', Conf['sauces'], (item) ->
|
$.get 'sauces', Conf['sauces'], (item) ->
|
||||||
@ -407,7 +407,7 @@ Settings =
|
|||||||
$.on ta, 'change', $.cb.value
|
$.on ta, 'change', $.cb.value
|
||||||
|
|
||||||
advanced: (section) ->
|
advanced: (section) ->
|
||||||
$.extend section, <%= importHTML('General/Settings/Advanced') %>
|
$.extend section, <%= readHTML('Advanced.html') %>
|
||||||
warning.hidden = Conf[warning.dataset.feature] for warning in $$ '.warning', section
|
warning.hidden = Conf[warning.dataset.feature] for warning in $$ '.warning', section
|
||||||
|
|
||||||
items = {}
|
items = {}
|
||||||
@ -584,7 +584,7 @@ Settings =
|
|||||||
CustomCSS.update()
|
CustomCSS.update()
|
||||||
|
|
||||||
keybinds: (section) ->
|
keybinds: (section) ->
|
||||||
$.extend section, <%= importHTML('General/Settings/Keybinds') %>
|
$.extend section, <%= readHTML('Keybinds.html') %>
|
||||||
$('.warning', section).hidden = Conf['Keybinds']
|
$('.warning', section).hidden = Conf['Keybinds']
|
||||||
|
|
||||||
tbody = $ 'tbody', section
|
tbody = $ 'tbody', section
|
||||||
|
|||||||
@ -44,7 +44,7 @@ Gallery =
|
|||||||
|
|
||||||
nodes.el = dialog = $.el 'div',
|
nodes.el = dialog = $.el 'div',
|
||||||
id: 'a-gallery'
|
id: 'a-gallery'
|
||||||
$.extend dialog, <%= importHTML('Images/Gallery') %>
|
$.extend dialog, <%= readHTML('Gallery.html') %>
|
||||||
|
|
||||||
nodes[key] = $ value, dialog for key, value of {
|
nodes[key] = $ value, dialog for key, value of {
|
||||||
buttons: '.gal-buttons'
|
buttons: '.gal-buttons'
|
||||||
|
|||||||
@ -19,7 +19,7 @@ Sauce =
|
|||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
sandbox: (url) ->
|
sandbox: (url) ->
|
||||||
E.url <%= importHTML('Images/Sandbox') %>
|
E.url <%= readHTML('Sandbox.html') %>
|
||||||
|
|
||||||
rmOrigin: (e) ->
|
rmOrigin: (e) ->
|
||||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Embedding =
|
|||||||
|
|
||||||
if Conf['Floating Embeds']
|
if Conf['Floating Embeds']
|
||||||
@dialog = UI.dialog 'embedding', 'top: 50px; right: 0px;',
|
@dialog = UI.dialog 'embedding', 'top: 50px; right: 0px;',
|
||||||
<%= importHTML('Linkification/Embed') %>
|
<%= readHTML('Embed.html') %>
|
||||||
@media = $ '#media-embed', @dialog
|
@media = $ '#media-embed', @dialog
|
||||||
$.one d, '4chanXInitFinished', @ready
|
$.one d, '4chanXInitFinished', @ready
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ Linkify =
|
|||||||
|
|
||||||
if Linkify.regString.test word
|
if Linkify.regString.test word
|
||||||
links.push Linkify.makeRange node, endNode, index, length
|
links.push Linkify.makeRange node, endNode, index, length
|
||||||
<%= assert('.tests_enabled', 'word is links[links.length-1].toString()') %>
|
<% if (readJSON('/.tests_enabled')) { %><%= assert('word is links[links.length-1].toString()') %><% } %>
|
||||||
|
|
||||||
break unless test.lastIndex and node is endNode
|
break unless test.lastIndex and node is endNode
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Banner =
|
Banner =
|
||||||
banners: `<%= JSON.stringify(readJSON('src/Miscellaneous/banners.json')) %>`
|
banners: `<%= JSON.stringify(readJSON('banners.json')) %>`
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
if Conf['Custom Board Titles']
|
if Conf['Custom Board Titles']
|
||||||
|
|||||||
@ -192,7 +192,7 @@ Keybinds =
|
|||||||
when Conf['Next Post Quoting You']
|
when Conf['Next Post Quoting You']
|
||||||
return unless threadRoot and QuoteYou.db
|
return unless threadRoot and QuoteYou.db
|
||||||
QuoteYou.cb.seek 'following'
|
QuoteYou.cb.seek 'following'
|
||||||
<% if (readJSON('.tests_enabled')) { %>
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
when 't'
|
when 't'
|
||||||
return unless threadRoot
|
return unless threadRoot
|
||||||
Build.Test.testAll()
|
Build.Test.testAll()
|
||||||
|
|||||||
@ -12,52 +12,52 @@ Favicon =
|
|||||||
switch: ->
|
switch: ->
|
||||||
items = {
|
items = {
|
||||||
ferongr: [
|
ferongr: [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadDead.png") %>'
|
'<%= readBase64('ferongr.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadDeadY.png") %>'
|
'<%= readBase64('ferongr.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadSFW.png") %>'
|
'<%= readBase64('ferongr.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadSFWY.png") %>'
|
'<%= readBase64('ferongr.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadNSFW.png") %>'
|
'<%= readBase64('ferongr.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/ferongr/unreadNSFWY.png") %>'
|
'<%= readBase64('ferongr.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
'xat-': [
|
'xat-': [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadDead.png") %>'
|
'<%= readBase64('xat-.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadDeadY.png") %>'
|
'<%= readBase64('xat-.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadSFW.png") %>'
|
'<%= readBase64('xat-.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadSFWY.png") %>'
|
'<%= readBase64('xat-.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadNSFW.png") %>'
|
'<%= readBase64('xat-.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/xat-/unreadNSFWY.png") %>'
|
'<%= readBase64('xat-.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
Mayhem: [
|
Mayhem: [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadDead.png") %>'
|
'<%= readBase64('Mayhem.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadDeadY.png") %>'
|
'<%= readBase64('Mayhem.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadSFW.png") %>'
|
'<%= readBase64('Mayhem.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadSFWY.png") %>'
|
'<%= readBase64('Mayhem.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadNSFW.png") %>'
|
'<%= readBase64('Mayhem.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Mayhem/unreadNSFWY.png") %>'
|
'<%= readBase64('Mayhem.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
'4chanJS': [
|
'4chanJS': [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadDead.png") %>'
|
'<%= readBase64('4chanJS.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadDeadY.png") %>'
|
'<%= readBase64('4chanJS.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadSFW.png") %>'
|
'<%= readBase64('4chanJS.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadSFWY.png") %>'
|
'<%= readBase64('4chanJS.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadNSFW.png") %>'
|
'<%= readBase64('4chanJS.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/4chanJS/unreadNSFWY.png") %>'
|
'<%= readBase64('4chanJS.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
Original: [
|
Original: [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadDead.png") %>'
|
'<%= readBase64('Original.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadDeadY.png") %>'
|
'<%= readBase64('Original.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadSFW.png") %>'
|
'<%= readBase64('Original.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadSFWY.png") %>'
|
'<%= readBase64('Original.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadNSFW.png") %>'
|
'<%= readBase64('Original.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Original/unreadNSFWY.png") %>'
|
'<%= readBase64('Original.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
'Metro': [
|
'Metro': [
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadDead.png") %>'
|
'<%= readBase64('Metro.unreadDead.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadDeadY.png") %>'
|
'<%= readBase64('Metro.unreadDeadY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadSFW.png") %>'
|
'<%= readBase64('Metro.unreadSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadSFWY.png") %>'
|
'<%= readBase64('Metro.unreadSFWY.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadNSFW.png") %>'
|
'<%= readBase64('Metro.unreadNSFW.png') %>'
|
||||||
'<%= readBase64("src/Monitoring/Favicon/Metro/unreadNSFWY.png") %>'
|
'<%= readBase64('Metro.unreadNSFWY.png') %>'
|
||||||
]
|
]
|
||||||
}[Conf['favicon']]
|
}[Conf['favicon']]
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ Favicon =
|
|||||||
@unread = @unreadNSFW
|
@unread = @unreadNSFW
|
||||||
@unreadY = @unreadNSFWY
|
@unreadY = @unreadNSFWY
|
||||||
|
|
||||||
dead: 'data:image/gif;base64,<%= readBase64("src/Monitoring/Favicon/dead.gif") %>'
|
dead: 'data:image/gif;base64,<%= readBase64('dead.gif') %>'
|
||||||
logo: 'data:image/png;base64,<%= readBase64("src/meta/icon128.png") %>'
|
logo: 'data:image/png;base64,<%= readBase64('/src/meta/icon128.png') %>'
|
||||||
|
|
||||||
return Favicon
|
return Favicon
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
|
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
|
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
|
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
|
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
@ -87,7 +87,7 @@ ThreadUpdater =
|
|||||||
http://freesound.org/people/pierrecartoons1979/sounds/90112/
|
http://freesound.org/people/pierrecartoons1979/sounds/90112/
|
||||||
cc-by-nc-3.0
|
cc-by-nc-3.0
|
||||||
###
|
###
|
||||||
beep: 'data:audio/wav;base64,<%= readBase64("src/Monitoring/beep.wav") %>'
|
beep: 'data:audio/wav;base64,<%= readBase64('beep.wav') %>'
|
||||||
|
|
||||||
playBeep: ->
|
playBeep: ->
|
||||||
{audio} = ThreadUpdater
|
{audio} = ThreadUpdater
|
||||||
|
|||||||
@ -10,7 +10,7 @@ ThreadWatcher =
|
|||||||
className: 'disabled fa fa-eye'
|
className: 'disabled fa fa-eye'
|
||||||
|
|
||||||
@db = new DataBoard 'watchedThreads', @refresh, true
|
@db = new DataBoard 'watchedThreads', @refresh, true
|
||||||
@dialog = UI.dialog 'thread-watcher', 'top: 50px; left: 0px;', <%= importHTML('Monitoring/ThreadWatcher') %>
|
@dialog = UI.dialog 'thread-watcher', 'top: 50px; left: 0px;', <%= readHTML('ThreadWatcher.html') %>
|
||||||
|
|
||||||
@status = $ '#watcher-status', @dialog
|
@status = $ '#watcher-status', @dialog
|
||||||
@list = @dialog.lastElementChild
|
@list = @dialog.lastElementChild
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Unread =
|
|||||||
name: 'Unread'
|
name: 'Unread'
|
||||||
cb: @addPost
|
cb: @addPost
|
||||||
|
|
||||||
<% if (readJSON('.tests_enabled')) { %>
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
testLink = $.el 'a',
|
testLink = $.el 'a',
|
||||||
textContent: 'Test Post Order'
|
textContent: 'Test Post Order'
|
||||||
$.on testLink, 'click', ->
|
$.on testLink, 'click', ->
|
||||||
|
|||||||
@ -433,7 +433,7 @@ QR =
|
|||||||
dialog: ->
|
dialog: ->
|
||||||
QR.nodes = nodes =
|
QR.nodes = nodes =
|
||||||
el: dialog = UI.dialog 'qr', 'top: 50px; right: 0px;',
|
el: dialog = UI.dialog 'qr', 'top: 50px; right: 0px;',
|
||||||
<%= importHTML('Posting/QuickReply') %>
|
<%= readHTML('QuickReply.html') %>
|
||||||
|
|
||||||
setNode = (name, query) ->
|
setNode = (name, query) ->
|
||||||
nodes[name] = $ query, dialog
|
nodes[name] = $ query, dialog
|
||||||
|
|||||||
@ -2,7 +2,7 @@ class Post
|
|||||||
toString: -> @ID
|
toString: -> @ID
|
||||||
|
|
||||||
constructor: (root, @thread, @board) ->
|
constructor: (root, @thread, @board) ->
|
||||||
<% if (readJSON('.tests_enabled')) { %>
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
root2 = root.cloneNode true
|
root2 = root.cloneNode true
|
||||||
for el in $$ '.mobile', root2
|
for el in $$ '.mobile', root2
|
||||||
$.rm el
|
$.rm el
|
||||||
|
|||||||
@ -728,10 +728,10 @@ Config =
|
|||||||
# "View Same" in archives:
|
# "View Same" in archives:
|
||||||
#https://archive.4plebs.org/_/search/image/%sMD5/;text:View same on 4plebs
|
#https://archive.4plebs.org/_/search/image/%sMD5/;text:View same on 4plebs
|
||||||
#https://archive.4plebs.org/%board/search/image/%sMD5/;text:View same on 4plebs /%board/;boards:<%=
|
#https://archive.4plebs.org/%board/search/image/%sMD5/;text:View same on 4plebs /%board/;boards:<%=
|
||||||
readJSON('src/Archive/archives.json').filter(function(x) {return x.uid === 3})[0].files.join(',')
|
readJSON('/src/Archive/archives.json').filter(function(x) {return x.uid === 3})[0].files.join(',')
|
||||||
%>
|
%>
|
||||||
#https://rbt.asia/%board/image/%sMD5;text:View same on RBT /%board/;boards:<%=
|
#https://rbt.asia/%board/image/%sMD5;text:View same on RBT /%board/;boards:<%=
|
||||||
readJSON('src/Archive/archives.json').filter(function(x) {return x.uid === 8})[0].files.join(',')
|
readJSON('/src/Archive/archives.json').filter(function(x) {return x.uid === 8})[0].files.join(',')
|
||||||
%>
|
%>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ Config =
|
|||||||
|
|
||||||
favicon: 'ferongr'
|
favicon: 'ferongr'
|
||||||
|
|
||||||
usercss: `<%= multiline(read('src/config/user.css')) %>`
|
usercss: `<%= multiline(read('user.css')) %>`
|
||||||
|
|
||||||
hotkeys:
|
hotkeys:
|
||||||
# QR & Options
|
# QR & Options
|
||||||
|
|||||||
@ -4,9 +4,9 @@ boards:
|
|||||||
<%= multiline(require['style']()()) %>,
|
<%= multiline(require['style']()()) %>,
|
||||||
|
|
||||||
report:
|
report:
|
||||||
<%= multiline(read('src/css/report.css')) %>,
|
<%= multiline(read('report.css')) %>,
|
||||||
|
|
||||||
www:
|
www:
|
||||||
<%= multiline(read('src/css/www.css')) %>
|
<%= multiline(read('www.css')) %>
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 667 B |
|
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 863 B |
|
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 729 B |
|
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 740 B |
|
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 839 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
|
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
|
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 928 B After Width: | Height: | Size: 928 B |
|
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
@ -6,7 +6,7 @@ d = document;
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '<%= readJSON('version.json').version %>',
|
VERSION: '<%= readJSON('/version.json').version %>',
|
||||||
NAMESPACE: '<%= meta.name %>.',
|
NAMESPACE: '<%= meta.name %>.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -465,7 +465,7 @@ Main =
|
|||||||
['Banner', Banner]
|
['Banner', Banner]
|
||||||
['Flash Features', Flash]
|
['Flash Features', Flash]
|
||||||
['Reply Pruning', ReplyPruning]
|
['Reply Pruning', ReplyPruning]
|
||||||
<% if (readJSON('.tests_enabled')) { %>
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
['Build Test', Build.Test]
|
['Build Test', Build.Test]
|
||||||
<% } %>
|
<% } %>
|
||||||
]
|
]
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
"chrome": true<%=
|
"chrome": true<%=
|
||||||
meta.grants.map(x => `,\n "${x}": true`).join('')
|
meta.grants.map(x => `,\n "${x}": true`).join('')
|
||||||
%><%=
|
%><%=
|
||||||
read('tmp/declaration.js').match(/^var (.*);/)[1].split(', ').map(x => `,\n "${x}": true`).join('')
|
read('/tmp/declaration.js').match(/^var (.*);/)[1].split(', ').map(x => `,\n "${x}": true`).join('')
|
||||||
%><%=
|
%><%=
|
||||||
read('tmp/globals-globals.js').match(/^var (.*);/)[1].split(', ').map(x => `,\n "${x}": true`).join('')
|
read('/tmp/globals-globals.js').match(/^var (.*);/)[1].split(', ').map(x => `,\n "${x}": true`).join('')
|
||||||
%>
|
%>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "<%= meta.name %>",
|
"name": "<%= meta.name %>",
|
||||||
"version": "<%= readJSON('version.json').version %>",
|
"version": "<%= readJSON('/version.json').version %>",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "<%= description %>",
|
"description": "<%= description %>",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name <%= meta.name %><%= (channel === '-beta') ? ' beta' : '' %>
|
// @name <%= meta.name %><%= (channel === '-beta') ? ' beta' : '' %>
|
||||||
// @version <%= readJSON('version.json').version %>
|
// @version <%= readJSON('/version.json').version %>
|
||||||
// @minGMVer <%= meta.min.greasemonkey %>
|
// @minGMVer <%= meta.min.greasemonkey %>
|
||||||
// @minFFVer <%= meta.min.firefox %>
|
// @minFFVer <%= meta.min.firefox %>
|
||||||
// @namespace <%= name %>
|
// @namespace <%= name %>
|
||||||
@ -42,5 +42,5 @@
|
|||||||
// @run-at document-start
|
// @run-at document-start
|
||||||
// @updateURL <%= (channel !== '-noupdate') ? `${meta.downloads}${name}${channel}.meta.js` : 'https://noupdate.invalid/' %>
|
// @updateURL <%= (channel !== '-noupdate') ? `${meta.downloads}${name}${channel}.meta.js` : 'https://noupdate.invalid/' %>
|
||||||
// @downloadURL <%= (channel !== '-noupdate') ? `${meta.downloads}${name}${channel}.user.js` : 'https://noupdate.invalid/' %>
|
// @downloadURL <%= (channel !== '-noupdate') ? `${meta.downloads}${name}${channel}.user.js` : 'https://noupdate.invalid/' %>
|
||||||
// @icon data:image/png;base64,<%= readBase64('src/meta/icon48.png') %>
|
// @icon data:image/png;base64,<%= readBase64('/src/meta/icon48.png') %>
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='<%= meta.appid %>'>
|
<app appid='<%= meta.appid %>'>
|
||||||
<updatecheck codebase='<%= meta.downloads %><%= name %><%= channel %>.crx' version='<%= readJSON('version.json').version %>' />
|
<updatecheck codebase='<%= meta.downloads %><%= name %><%= channel %>.crx' version='<%= readJSON('/version.json').version %>' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -15,5 +15,5 @@ for ext in ['jpg', 'png', 'gif']:
|
|||||||
print(banner, status)
|
print(banner, status)
|
||||||
if status == 200:
|
if status == 200:
|
||||||
banners.append(banner)
|
banners.append(banner)
|
||||||
with open('src/Miscellaneous/banners.json', 'w') as f:
|
with open('src/Miscellaneous/Banner/banners.json', 'w') as f:
|
||||||
f.write(json.dumps(banners))
|
f.write(json.dumps(banners))
|
||||||
|
|||||||
@ -6,9 +6,10 @@ for (var name of process.argv.slice(2)) {
|
|||||||
try {
|
try {
|
||||||
var parts = name.match(/^tmp\/([^_]*)(?:_(.*))?-(.*)\.js$/);
|
var parts = name.match(/^tmp\/([^_]*)(?:_(.*))?-(.*)\.js$/);
|
||||||
var basename = fs.readdirSync(`src/${parts[1]}`).filter(x => (x === `${parts[3]}.coffee` || x === `${parts[3]}.js`))[0];
|
var basename = fs.readdirSync(`src/${parts[1]}`).filter(x => (x === `${parts[3]}.coffee` || x === `${parts[3]}.js`))[0];
|
||||||
var script = fs.readFileSync(`src/${parts[1]}/${basename}`, 'utf8');
|
var sourceName = `src/${parts[1]}/${basename}`;
|
||||||
|
var script = fs.readFileSync(sourceName, 'utf8');
|
||||||
script = script.replace(/\r\n/g, '\n');
|
script = script.replace(/\r\n/g, '\n');
|
||||||
script = template(script, {type: parts[2]});
|
script = template(script, {type: parts[2]}, sourceName);
|
||||||
if (/\.coffee$/.test(basename)) {
|
if (/\.coffee$/.test(basename)) {
|
||||||
script = coffee.compile(script);
|
script = coffee.compile(script);
|
||||||
if (/^[$A-Z][$\w]*$/.test(parts[3])) {
|
if (/^[$A-Z][$\w]*$/.test(parts[3])) {
|
||||||
|
|||||||
@ -32,9 +32,11 @@ read('node_modules/font-awesome/css/font-awesome.css')
|
|||||||
).join('') +
|
).join('') +
|
||||||
|
|
||||||
'/* Link Title Favicons */\n' +
|
'/* Link Title Favicons */\n' +
|
||||||
fs.readdirSync('src/css/linkIcons').map(file =>
|
fs.readdirSync('src/css').filter(file =>
|
||||||
`.linkify.${file.split('.')[0]} {
|
/^linkify\.[^.]+\.png$/.test(file)
|
||||||
background: transparent url('data:image/png;base64,${readBase64(`src/css/linkIcons/${file}`)}') center left no-repeat!important;
|
).map(file =>
|
||||||
|
`.linkify.${file.split('.')[1]} {
|
||||||
|
background: transparent url('data:image/png;base64,${readBase64(`src/css/${file}`)}') center left no-repeat!important;
|
||||||
padding-left: 18px;
|
padding-left: 18px;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
var _template = require('lodash.template');
|
var _template = require('lodash.template');
|
||||||
var esprima = require('esprima');
|
var esprima = require('esprima');
|
||||||
|
|
||||||
// disable ES6 delimiters
|
// disable ES6 delimiters
|
||||||
var _templateSettings = {interpolate: /<%=([\s\S]+?)%>/g};
|
var _templateSettings = {interpolate: /<%=([\s\S]+?)%>/g};
|
||||||
|
|
||||||
|
// Functions used in templates.
|
||||||
var tools = {};
|
var tools = {};
|
||||||
|
|
||||||
tools.require = {};
|
tools.require = {};
|
||||||
@ -16,18 +18,18 @@ var read = tools.read = filename => fs.readFileSync(filename, 'utf8').re
|
|||||||
var readJSON = tools.readJSON = filename => JSON.parse(read(filename));
|
var readJSON = tools.readJSON = filename => JSON.parse(read(filename));
|
||||||
tools.readBase64 = filename => fs.readFileSync(filename).toString('base64');
|
tools.readBase64 = filename => fs.readFileSync(filename).toString('base64');
|
||||||
|
|
||||||
// Convert JSON object to Coffeescript expression (via embedded JS).
|
tools.readHTML = function(filename) {
|
||||||
var constExpression = data => '`' + JSON.stringify(data).replace(/`/g, '\\`') + '`';
|
var text = read(filename).replace(/^ +/gm, '').replace(/\r?\n/g, '');
|
||||||
|
text = _template(text, _templateSettings)(pkg); // package.json data only; no recursive imports
|
||||||
|
return tools.html(text);
|
||||||
|
};
|
||||||
|
|
||||||
tools.multiline = function(text) {
|
tools.multiline = function(text) {
|
||||||
return text.replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`');
|
return text.replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`');
|
||||||
};
|
};
|
||||||
|
|
||||||
tools.importHTML = function(filename) {
|
// Convert JSON object to Coffeescript expression (via embedded JS).
|
||||||
var text = read(`src/${filename}.html`).replace(/^ +/gm, '').replace(/\r?\n/g, '');
|
var constExpression = data => '`' + JSON.stringify(data).replace(/`/g, '\\`') + '`';
|
||||||
text = _template(text, _templateSettings)(pkg); // variables only; no recursive imports
|
|
||||||
return tools.html(text);
|
|
||||||
};
|
|
||||||
|
|
||||||
function TextStream(text) {
|
function TextStream(text) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
@ -173,20 +175,44 @@ tools.html = function(template) {
|
|||||||
return `(innerHTML: ${output})`;
|
return `(innerHTML: ${output})`;
|
||||||
};
|
};
|
||||||
|
|
||||||
tools.assert = function(flagFile, statement) {
|
tools.assert = function(statement) {
|
||||||
if (!readJSON(flagFile)) return '';
|
|
||||||
return `throw new Error 'Assertion failed: ' + ${constExpression(statement)} unless ${statement}`;
|
return `throw new Error 'Assertion failed: ' + ${constExpression(statement)} unless ${statement}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function resolvePath(filename, templateName) {
|
||||||
|
if (filename[0] === '/') {
|
||||||
|
return path.join(process.cwd(), filename);
|
||||||
|
}
|
||||||
|
var dir = path.dirname(templateName);
|
||||||
|
var subdir = path.basename(templateName).replace(/\.[^.]+$/, '');
|
||||||
|
if (fs.readdirSync(dir).indexOf(subdir) >= 0) {
|
||||||
|
return path.join(dir, subdir, filename);
|
||||||
|
} else {
|
||||||
|
return path.join(dir, filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function wrapTool(tool, templateName) {
|
||||||
|
return function(filename) {
|
||||||
|
return tool(resolvePath(filename, templateName));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Import variables from package.json.
|
// Import variables from package.json.
|
||||||
var pkg = readJSON('package.json');
|
var pkg = readJSON('package.json');
|
||||||
|
|
||||||
function interpolate(text, data) {
|
function interpolate(text, data, filename) {
|
||||||
var context = {}, key;
|
var context = {}, key;
|
||||||
for (key in tools) context[key] = tools[key];
|
for (key in tools) {
|
||||||
for (key in pkg) context[key] = pkg[key];
|
context[key] = /^read/.test(key) ? wrapTool(tools[key], filename) : tools[key];
|
||||||
|
}
|
||||||
|
for (key in pkg) {
|
||||||
|
context[key] = pkg[key];
|
||||||
|
}
|
||||||
if (data) {
|
if (data) {
|
||||||
for (key in data) context[key] = data[key];
|
for (key in data) {
|
||||||
|
context[key] = data[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _template(text, _templateSettings)(context);
|
return _template(text, _templateSettings)(context);
|
||||||
}
|
}
|
||||||
@ -203,7 +229,7 @@ if (require.main === module) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var text = read(process.argv[2]);
|
var text = read(process.argv[2]);
|
||||||
text = interpolate(text, data);
|
text = interpolate(text, data, process.argv[2]);
|
||||||
fs.writeFileSync(process.argv[3], text);
|
fs.writeFileSync(process.argv[3], text);
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|||||||