Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/scenarios/01_default-values-scenario.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/scenarios/02_separators-scenario.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/scenarios/03_iterating-through-fields-scenario.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/scenarios/04_assigning-variables-scenario.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/scenarios/05_arrays-plus-headers-and-footers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/01_inserting-data.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />
</head>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/03_converters-and-encoding.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/04_if-else-tag.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/05_for-tag.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/06_template-composition.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/07_paths.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/08_custom-tags.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/09_helper-functions.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/10_comparison-tests.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/11_accessing-parent-data.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/12_passing-in-context.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-4.0.0.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

Expand Down
4 changes: 2 additions & 2 deletions jsrender-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ function tmplObject(markup, options) {
if (htmlTag && htmlTag !== wrapMap.div) {
// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').
// Currently not trimmed for <li> tag. (Not worth adding perf cost)
tmpl.markup = $.trim(tmpl.markup);
tmpl.markup = tmpl.markup.trim();
}

return tmpl;
Expand Down Expand Up @@ -2198,7 +2198,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) {
// to return the new object, and trigger re-binding of the subsequent path)
expr = pathStart[fnDp-1];
if (full.length - 1 > ind - (expr || 0)) { // We need to compile a subexpression
expr = $.trim(full.slice(expr, ind + all.length));
expr = (full.slice(expr, ind + all.length)).trim();
binds = bindto || bndStack[fnDp-1].bd;
// Insert exprOb object, to be used during binding to return the computed object
theOb = binds[binds.length-1];
Expand Down
4 changes: 2 additions & 2 deletions jsrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ function tmplObject(markup, options) {
if (htmlTag && htmlTag !== wrapMap.div) {
// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').
// Currently not trimmed for <li> tag. (Not worth adding perf cost)
tmpl.markup = $.trim(tmpl.markup);
tmpl.markup = tmpl.markup.trim();
}

return tmpl;
Expand Down Expand Up @@ -2250,7 +2250,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) {
// to return the new object, and trigger re-binding of the subsequent path)
expr = pathStart[fnDp-1];
if (full.length - 1 > ind - (expr || 0)) { // We need to compile a subexpression
expr = $.trim(full.slice(expr, ind + all.length));
expr = full.slice(expr, ind + all.length).trim();
binds = bindto || bndStack[fnDp-1].bd;
// Insert exprOb object, to be used during binding to return the computed object
theOb = binds[binds.length-1];
Expand Down
3 changes: 1 addition & 2 deletions jsrender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/perf-compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Benchmark JsRender</title>
<link href="resources/perf-compare.css" rel="stylesheet" type="text/css" />
<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="../jsrender.js" type="text/javascript"></script>
<script src="resources/jquery.tmpl.js" type="text/javascript"></script>

Expand Down
2 changes: 1 addition & 1 deletion test/test.min.map.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="../jsrender.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests-amd-scriptloader.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link href="//code.jquery.com/qunit/qunit-1.21.0.css" rel="stylesheet" type="text/css" />

<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="//code.jquery.com/qunit/qunit-1.21.0.js"></script>

<script src="requirejs/require.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests-browserify.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<link href="//code.jquery.com/qunit/qunit-1.21.0.css" rel="stylesheet" type="text/css" />
<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="//code.jquery.com/qunit/qunit-1.21.0.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests-jsrender-no-jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script src="../jsrender.js"></script>

<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="//code.jquery.com/qunit/qunit-1.21.0.js"></script>

<script src="unit-tests/tests-jsrender-no-jquery.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests-jsrender-with-jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link href="//code.jquery.com/qunit/qunit-1.21.0.css" rel="stylesheet" type="text/css" />

<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="//code.jquery.com/qunit/qunit-1.21.0.js"></script>

<script src="../jsrender.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requirejs.config({
"baseUrl": "//www.jsviews.com/download", // Or point to correct local path on your system: "baseUrl": "/download",
// "baseUrl": "../../download", // Or point to correct local path on your system: "baseUrl": "/download",
"paths": {
"jquery": "//code.jquery.com/jquery-3.7.1",
"jquery": "//code.jquery.com/jquery-4.0.0",
"jsrender": "./jsrender",
"jquery.observable": "./jquery.observable",
"jquery.views": "./jquery.views",
Expand Down
4 changes: 2 additions & 2 deletions test/unit-tests/tests-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QUnit.test("jsrender.compile", function(assert) {
QUnit.test("jsrender.tags.clientTemplate", function(assert) {
jsrender.views.settings.delimiters("<%", "%>");
var tmpl = jsrender.compile(
'<script src="//code.jquery.com/jquery-3.7.1.js"></script>\n'
'<script src="//code.jquery.com/jquery-4.0.0.js"></script>\n'
+ '<script src="//www.jsviews.com/download/jsrender.js"></script>\n'
+ '<%clientTemplate "./test/templates/outer.html"/%>\n'
+ '<%clientTemplate "./test/templates/inner.html"/%>\n'
Expand All @@ -52,7 +52,7 @@ QUnit.test("jsrender.tags.clientTemplate", function(assert) {
+ '<script>var tmpl = $.templates("#clientonly"); $("#result").html(tmpl({name: "Jeff"}));</script>');
var html = tmpl({name: "Jo"});
assert.equal(html,
'<script src="//code.jquery.com/jquery-3.7.1.js"></script>\n'
'<script src="//code.jquery.com/jquery-4.0.0.js"></script>\n'
+ '<script src="//www.jsviews.com/download/jsrender.js"></script>\n'
+ '<script id="./test/templates/outer.html" type="text/x-jsrender">Name: {{:name}} (outer.html) {{include tmpl="./test/templates/inner.html"/}}</script>\n'
+ '<script id="./test/templates/inner.html" type="text/x-jsrender">Name: {{:name}} (inner.html)</script>\n'
Expand Down
2 changes: 1 addition & 1 deletion typescript/jsrender/test/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
body { font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif; font-size: 15px;}
code { font-size: 12px; }
</style>
<script src="//code.jquery.com/jquery-3.7.1.js"></script>
<script src="//code.jquery.com/jquery-4.0.0.js"></script>
<script src="../../../jsrender.js"></script>
</head>
<body>
Expand Down