From 5fe814cb4e9818d86dada180d34d68279dd23010 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 3 Sep 2018 21:43:00 -0400 Subject: js/luigi-template.js: fix license, add json filter --- js/luigi-template.js | 57 +++++++++++++++++++++++----------------------------- 1 file 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 () - * * Home Page: - * * Mercurial Repository: + * * Home Page: * * Overview * -------- @@ -28,42 +27,32 @@ * * License * ------- - * Copyright (c) 2014 Paul Duncan + * 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() { '<': '<', '&': '&' }; - + 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 = { -- cgit v1.2.3