summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-09-03 21:43:00 -0400
committerPaul Duncan <pabs@pablotron.org>2018-09-03 21:43:00 -0400
commit5fe814cb4e9818d86dada180d34d68279dd23010 (patch)
treea9ff5429a005e085b26a2e578058fd6cb22b34be
parentf91e3a5dcf8bd5ad0b1d7e8c9a61c3f92d796fb6 (diff)
downloadluigi-template-5fe814cb4e9818d86dada180d34d68279dd23010.tar.bz2
luigi-template-5fe814cb4e9818d86dada180d34d68279dd23010.zip
js/luigi-template.js: fix license, add json filter
-rw-r--r--js/luigi-template.js57
1 files changed, 25 insertions, 32 deletions
diff --git a/js/luigi-template.js b/js/luigi-template.js
index 516fc3f..91b9303 100644
--- a/js/luigi-template.js
+++ b/js/luigi-template.js
@@ -5,8 +5,7 @@
* Links
* -----
* * Contact: Paul Duncan (<pabs@pablotron.org>)
- * * Home Page: <http://pablotron.org/luigi-template/>
- * * Mercurial Repository: <http://hg.pablotron.org/luigi-template/>
+ * * Home Page: <https://github.com/pablotron/luigi-template>
*
* Overview
* --------
@@ -28,42 +27,32 @@
*
* License
* -------
- * Copyright (c) 2014 Paul Duncan <pabs@pablotron.org>
+ * Copyright 2014-2018 Paul Duncan ([pabs@pablotron.org][me])
*
- * All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * The names of contributors may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
LuigiTemplate = (function() {
"use strict";
- var VERSION = '0.4.1';
+ var VERSION = '0.4.2';
// Array.each polyfill
var each = (function() {
@@ -173,7 +162,7 @@ LuigiTemplate = (function() {
'<': '&lt;',
'&': '&amp;'
};
-
+
return function(v) {
if (v === undefined || v === null)
return '';
@@ -182,7 +171,11 @@ LuigiTemplate = (function() {
return LUT[s];
});
};
- })()
+ })(),
+
+ json: function(v) {
+ return JSON.stringify(v);
+ },
};
var RES = {