mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
Add license info to compiled handlebars templates
This commit is contained in:
parent
fdd7ff70b1
commit
9a86a61c99
@ -28,6 +28,8 @@
|
||||
<!-- Compile Handlebars templates for dialogs styles -->
|
||||
<target name="styles_handlebars">
|
||||
<echo>Compile Handlebars templates for dialogs styles</echo>
|
||||
|
||||
<!-- Compile templates -->
|
||||
<apply executable="handlebars">
|
||||
<arg value="-m"/>
|
||||
<arg value="-f"/>
|
||||
@ -35,8 +37,26 @@
|
||||
<dirset dir=".">
|
||||
<include name="${dialogs_styles_path}/*/handlebars_templates" />
|
||||
</dirset>
|
||||
<mapper type="glob" from="*/handlebars_templates" to="*/js/compiled/templates.js" />
|
||||
<mapper type="glob" from="*/handlebars_templates" to="*/js/compiled/templates_tmp.js" />
|
||||
</apply>
|
||||
|
||||
<!-- Appent license info -->
|
||||
<move todir="${dialogs_styles_path}" overwrite="true">
|
||||
<fileset dir="${dialogs_styles_path}"/>
|
||||
<mapper type="glob" from="*/js/compiled/templates_tmp.js" to="*/js/compiled/templates.js"/>
|
||||
|
||||
<filterchain>
|
||||
<!-- Remove comments -->
|
||||
<stripjavacomments />
|
||||
<!-- Add header -->
|
||||
<concatfilter prepend="compiled_templates_header.txt" />
|
||||
<!-- Skip empty lines -->
|
||||
<linecontainsregexp negate="true">
|
||||
<regexp pattern="^\s+$$" />
|
||||
</linecontainsregexp>
|
||||
</filterchain>
|
||||
</move>
|
||||
|
||||
<echo>Done</echo>
|
||||
</target>
|
||||
|
||||
@ -137,30 +157,17 @@
|
||||
<target name="app_js" depends="core_handlebars">
|
||||
<echo>Build "${app_name}" JavaScript application</echo>
|
||||
|
||||
<!-- Initialization code goes first. Preserve header comment but strip
|
||||
empty lines -->
|
||||
<!-- Remove old application file -->
|
||||
<delete file="${js_path}/compiled/${app_name}_app.js" />
|
||||
|
||||
<!-- Append application files to the result file -->
|
||||
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf">
|
||||
<!-- Append templates -->
|
||||
<filelist dir="${js_path}/templates/compiled" files="${app_name}_app.tpl.js" />
|
||||
<!-- For some reasons handlebars do not add trailing semicolon.
|
||||
Add it manually -->
|
||||
<string>;</string>
|
||||
|
||||
<!-- Append application static initialization code -->
|
||||
<filelist dir="${js_path}/compiled/${app_name}" files="init.js" />
|
||||
|
||||
<!-- Apply filters -->
|
||||
<filterchain>
|
||||
<!-- Skip empty lines -->
|
||||
<linecontainsregexp negate="true">
|
||||
<regexp pattern="^\s+$$" />
|
||||
</linecontainsregexp>
|
||||
</filterchain>
|
||||
</concat>
|
||||
|
||||
<!-- Append application files to the result file -->
|
||||
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf" append="true">
|
||||
|
||||
<!-- Include files from ${js_path}/compiled/${app_name}/ -->
|
||||
<fileset dir="${js_path}/compiled/${app_name}">
|
||||
<include name="*.js" />
|
||||
@ -290,7 +297,7 @@
|
||||
<dirset dir=".">
|
||||
<include name="${js_path}/templates/source/*" />
|
||||
</dirset>
|
||||
<mapper type="regexp" from="^(.*)/source/(.*)$$" to="\1/compiled/\2_app.tpl.js" />
|
||||
<mapper type="regexp" from="^(.*)/source/(.*)$$" to="\1/compiled/\2_app_tmp.tpl.js" />
|
||||
</apply>
|
||||
|
||||
<!-- Build misc files -->
|
||||
@ -301,9 +308,32 @@
|
||||
<fileset dir=".">
|
||||
<include name="${js_path}/templates/source/*.handlebars" />
|
||||
</fileset>
|
||||
<mapper type="regexp" from="^(.*)/source/(.*)\.handlebars$$" to="\1/compiled/\2.tpl.js" />
|
||||
<mapper type="regexp" from="^(.*)/source/(.*)\.handlebars$$" to="\1/compiled/\2_tmp.tpl.js" />
|
||||
</apply>
|
||||
|
||||
<!-- Add licanse info -->
|
||||
<move todir="${js_path}/templates/compiled" overwrite="true">
|
||||
<fileset dir="${js_path}/templates/compiled">
|
||||
<include name="*_tmp.tpl.js" />
|
||||
</fileset>
|
||||
<mapper type="glob" from="*_tmp.tpl.js" to="*.tpl.js"/>
|
||||
|
||||
<filterchain>
|
||||
<!-- Remove comments -->
|
||||
<stripjavacomments />
|
||||
<!-- For some reasons handlebars do not add trailing semicolon.
|
||||
Assume that where is only one line in file and add semicolon
|
||||
manually -->
|
||||
<suffixlines suffix=";" />
|
||||
<!-- Add header -->
|
||||
<concatfilter prepend="compiled_templates_header.txt" />
|
||||
<!-- Skip empty lines -->
|
||||
<linecontainsregexp negate="true">
|
||||
<regexp pattern="^\s+$$" />
|
||||
</linecontainsregexp>
|
||||
</filterchain>
|
||||
</move>
|
||||
|
||||
<echo>Done</echo>
|
||||
</target>
|
||||
|
||||
|
6
src/messenger/compiled_templates_header.txt
Normal file
6
src/messenger/compiled_templates_header.txt
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
@ -1,4 +1,4 @@
|
||||
;/*
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
|
@ -1,3 +1,9 @@
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})();/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
|
@ -1,4 +1,4 @@
|
||||
;/*
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1,7 @@
|
||||
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})()
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user