Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor tweaks. Updated to versions in parallel commit of JsViews (pre …

…beta 13)
  • Loading branch information...
commit 6d31cf7eb8a10d63bd4f43872cd8f5ef7557ef44 1 parent 203f39b
@BorisMoore authored
View
8 jsrender.js
@@ -6,9 +6,9 @@
* Copyright 2012, Boris Moore
* Released under the MIT License.
*/
-// informal pre beta commit counter: 11
+// informal pre beta commit counter: 13
-this.jsviews || this.jQuery && jQuery.views || (function(window, undefined) {
+this.jsviews || this.jQuery && jQuery.views || (function(global, undefined) {
//========================== Top-level vars ==========================
@@ -17,7 +17,7 @@ this.jsviews || this.jQuery && jQuery.views || (function(window, undefined) {
$, rTag, rTmplString, extend,
sub = {},
FALSE = false, TRUE = true,
- jQuery = window.jQuery,
+ jQuery = global.jQuery,
rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
// nil object helper view viewProperty pathTokens leafToken string
@@ -781,7 +781,7 @@ this.jsviews || this.jQuery && jQuery.views || (function(window, undefined) {
////////////////////////////////////////////////////////////////////////////////////////////////
// jQuery is not loaded.
- $ = window.jsviews = jsv;
+ $ = global.jsviews = jsv;
$.extend = function(target, source) {
var name;
target = target || {};
View
2  test/perf-compare.html
@@ -18,7 +18,7 @@
<em>Rendered content:</em><br /><br />
<table><tbody id="output"></tbody></table>
-<br /><em>Times in milliseconds:</em>
+<br /><em>Times in microseconds:</em>
<table><tbody id="results"></tbody></table>
<script type="text/javascript">
View
3  test/unit/jsrender-tests-no-jquery.js
@@ -166,7 +166,7 @@ test("values", function() {
});
test("expressions", function() {
- expect(7);
+ expect(8);
equal( compileTmpl( "{{:a++}}" ), "error:Syntax error", "a++" );
equal( compileTmpl( "{{:(a,b)}}" ), "error:Syntax error", "(a,b)" );
equal( jsviews.templates( "{{: a+2}}" ).render({ a: 2, b: false }), "4", "a+2");
@@ -174,6 +174,7 @@ test("expressions", function() {
equal( jsviews.templates( "{{:(a||-1) + (b||-1) }}" ).render({ a: 2, b: 0 }), "1", "a||-1");
equal( jsviews.templates( "{{:3*b()*!a*4/3}}" ).render({ a: false, b: function () { return 3; }}), "12", "3*b()*!a*4/3");
equal( jsviews.templates( "{{:a%b}}" ).render({ a: 30, b: 16}), "14", "a%b");
+ equal( jsviews.templates( "A_{{if v1 && v2 && v3 && v4}}no{{else !v1 && v2 || v3 && v4}}yes{{/if}}_B" ).render({v1:true,v2:false,v3:2,v4:"foo"}), "A_yes_B", "x && y || z");
});
module( "{{for}}" );
Please sign in to comment.
Something went wrong with that request. Please try again.