GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Print out falsy values except undefined and null. Closes #35 · 701/JavaScript-Templates@eb72edb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bower.json
  • css
    • demo.css
  • index.html
  • js
    • compile.js
    • demo.js
    • runtime.js
    • tmpl.js
    • tmpl.min.js
  • package.json
  • test
    • index.html
    • test.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bower.json‎

Copy file name to clipboardExpand all lines: bower.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-tmpl",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"title": "JavaScript Templates",
55
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
66
"keywords": [
Collapse file

‎css/demo.css‎

Copy file name to clipboardExpand all lines: css/demo.css
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates Demo CSS 2.2.1
2+
* JavaScript Templates Demo CSS 2.4.0
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2013, Sebastian Tschan
Collapse file

‎index.html‎

Copy file name to clipboardExpand all lines: index.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* JavaScript Templates Demo 2.2.1
4+
* JavaScript Templates Demo 2.4.0
55
* https://github.com/blueimp/JavaScript-Templates
66
*
77
* Copyright 2011, Sebastian Tschan
@@ -76,7 +76,7 @@ <h4>Features</h4>
7676
</script>
7777
<script src="js/tmpl.js"></script>
7878
<!-- jQuery is not required by JavaScript Templates, but included for the demo -->
79-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
79+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
8080
<script src="js/demo.js"></script>
8181
</body>
8282
</html>
Collapse file

‎js/compile.js‎

Copy file name to clipboardExpand all lines: js/compile.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/*
3-
* JavaScript Templates Compiler 2.2.0
3+
* JavaScript Templates Compiler 2.4.0
44
* https://github.com/blueimp/JavaScript-Templates
55
*
66
* Copyright 2011, Sebastian Tschan
Collapse file

‎js/demo.js‎

Copy file name to clipboardExpand all lines: js/demo.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates Demo JS 2.2.1
2+
* JavaScript Templates Demo JS 2.4.0
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2013, Sebastian Tschan
Collapse file

‎js/runtime.js‎

Copy file name to clipboardExpand all lines: js/runtime.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates Runtime 2.2.0
2+
* JavaScript Templates Runtime 2.4.0
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -29,7 +29,7 @@
2929
"'" : "&#39;"
3030
};
3131
tmpl.encode = function (s) {
32-
return String(s).replace(
32+
return (s == null ? "" : "" + s).replace(
3333
tmpl.encReg,
3434
function (c) {
3535
return tmpl.encMap[c] || "";
Collapse file

‎js/tmpl.js‎

Copy file name to clipboardExpand all lines: js/tmpl.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates 2.3.0
2+
* JavaScript Templates 2.4.0
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -48,7 +48,7 @@
4848
if (p2 === "=") {
4949
return "'+_e(" + p3 + ")+'";
5050
}
51-
return "'+" + p3 + "+'";
51+
return "'+(" + p3 + "==null?'':" + p3 + ")+'";
5252
}
5353
if (p4) { // evaluation start tag: {%
5454
return "';";
@@ -66,15 +66,15 @@
6666
"'" : "&#39;"
6767
};
6868
tmpl.encode = function (s) {
69-
return String(s).replace(
69+
return (s == null ? "" : "" + s).replace(
7070
tmpl.encReg,
7171
function (c) {
7272
return tmpl.encMap[c] || "";
7373
}
7474
);
7575
};
7676
tmpl.arg = "o";
77-
tmpl.helper = ",print=function(s,e){_s+=e&&(s||'')||_e(s);}" +
77+
tmpl.helper = ",print=function(s,e){_s+=e?(s==null?'':s):_e(s);}" +
7878
",include=function(s,d){_s+=tmpl(s,d);}";
7979
if (typeof define === "function" && define.amd) {
8080
define(function () {
Collapse file

‎js/tmpl.min.js‎

Copy file name to clipboardExpand all lines: js/tmpl.min.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-tmpl",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"title": "JavaScript Templates",
55
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
66
"keywords": [
@@ -31,9 +31,9 @@
3131
}
3232
],
3333
"devDependencies": {
34-
"mocha": "1.11.0",
34+
"mocha": "1.12.1",
3535
"expect.js": "0.2.0",
36-
"uglify-js": "2.3.6"
36+
"uglify-js": "2.4.0"
3737
},
3838
"scripts": {
3939
"test": "mocha --reporter spec"
Collapse file

‎test/index.html‎

Copy file name to clipboardExpand all lines: test/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* JavaScript Templates Test 2.2.0
4+
* JavaScript Templates Test 2.4.0
55
* https://github.com/blueimp/JavaScript-Templates
66
*
77
* Copyright 2011, Sebastian Tschan

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.