Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Allow compilation of templates to Javascript functions, wrapped for J…
…ST or AMD. Closes gh-14.
- Loading branch information
Showing
15 changed files
with
409 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define(['jade'], function(jade) { if(jade && jade['runtime'] !== undefined) { jade = jade.runtime; } | ||
|
||
return function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<div id="test" class="test"><span id="data">data</span>'); | ||
if ( test) | ||
{ | ||
buf.push('<div>testing</div>'); | ||
} | ||
buf.push('</div>'); | ||
} | ||
return buf.join(""); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define(['jade'], function(jade) { if(jade && jade['runtime'] !== undefined) { jade = jade.runtime; } | ||
|
||
return function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<div id="test" class="test"><span id="data">data</span>'); | ||
if ( test) | ||
{ | ||
buf.push('<div>testing 2</div>'); | ||
} | ||
buf.push('</div>'); | ||
} | ||
return buf.join(""); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define(['jade'], function(jade) { if(jade && jade['runtime'] !== undefined) { jade = jade.runtime; } | ||
|
||
return function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<html><head><title>TEST</title></head><body></body></html>'); | ||
var a = 'hello jade test' | ||
buf.push('<p>'); | ||
var __val__ = a | ||
buf.push(escape(null == __val__ ? "" : __val__)); | ||
buf.push('</p>'); | ||
} | ||
return buf.join(""); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
define(['jade'], function(jade) { if(jade && jade['runtime'] !== undefined) { jade = jade.runtime; } | ||
|
||
return function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<div>'); | ||
var __val__ = year | ||
buf.push(escape(null == __val__ ? "" : __val__)); | ||
buf.push('</div>'); | ||
} | ||
return buf.join(""); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
this["JST"] = this["JST"] || {}; | ||
|
||
this["JST"]["jade"] = function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<div id="test" class="test"><span id="data">data</span>'); | ||
if ( test) | ||
{ | ||
buf.push('<div>testing</div>'); | ||
} | ||
buf.push('</div>'); | ||
} | ||
return buf.join(""); | ||
}; |
Oops, something went wrong.