diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt deleted file mode 100644 index dc72c3a..0000000 --- a/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2011 Mark Dalgleish - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..d834bc6 --- /dev/null +++ b/README @@ -0,0 +1,63 @@ +jQuery tmpload Plugin Demo + +Asynchronous Template Loading and Caching for jQuery Templates. + +It also has the ability to load local DOM templates and wrap them in a template manager object. + +The Underscore templating system was use in the examples above. +Load local template, compile it with Underscore template manager and insert into the DIVs above + +(view page source and scroll to the end of the page to see the template) + + var tplObject = $.tmpload({id: 'local-template', tplWrapper: _.template}); + $('#div-name1').html(tplObject({name: 'Dumitru'})); + $('#div-name2').html(tplObject({name: 'Lucas'})); + $('#div-name3').html(tplObject({name: 'Steve'})); + + +Result +I'm a local template and I load fast! + +My name is Dumitru. +I'm a local template and I load fast! + +My name is Lucas. +I'm a local template and I load fast! + +My name is Steve. +Load a remote template, compile it with Underscore and insert it into the DIVs above + + $.tmpload({ + url: 'templates/test-template.html', + tplWrapper: _.template, + onLoad: function (tplObject) { + $('#div-name4').html(tplObject({name: 'Sven'})); + $('#div-name5').html(tplObject({name: 'Radu'})); + $('#div-name6').html(tplObject({name: 'Razvan'})); + } + }); + + +Result +I'm a remote template and I load slower than a local one! + +My name is Sven. +I'm a remote template and I load slower than a local one! + +My name is Radu. +I'm a remote template and I load slower than a local one! + +My name is Razvan. +Options + +id (null): + Specify an id of a local template - a template that is a part of the DOM. (view page source for example) +url (null): + Specify the remote URL from where you want to load a template if you don't want to use a local one. +cache (true): + Cache the templates in the memory for later use. +onLoad (null): + Use this callback to use the template when loading aremote one. +tplWrapper (null): + An instance of a template manager object if any. (i.e _.template for Underscore templating system) + diff --git a/README.md b/README.md deleted file mode 100644 index c53133d..0000000 --- a/README.md +++ /dev/null @@ -1,23 +0,0 @@ -[tmpload](http://markdalgleish.com/projects/tmpload) - Asynchronous Template Loading and Caching for jQuery Templates -===================================================================================================================== - -Requirements ------------- - -1. [jQuery 1.5 or later](http://jquery.com/) -2. [jQuery Templates Plugin](http://github.com/jquery/jquery-tmpl) - -Usage ------ - -Beginner's guide available at the [official tmpload page](http://markdalgleish.com/projects/tmpload). - -Questions? ----------- - -Contact me on GitHub. - -Suggestions? ------------- - -See above. \ No newline at end of file diff --git a/Untitled.js b/Untitled.js new file mode 100644 index 0000000..633affa --- /dev/null +++ b/Untitled.js @@ -0,0 +1,29 @@ +// Underscore.js 1.2.0 +// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the MIT license. +// Portions of Underscore are inspired or borrowed from Prototype, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore +(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null)return a===c;var e=typeof a;if(e!=typeof c)return false;if(!a!=!c)return false;if(b.isNaN(a))return b.isNaN(c);var f=b.isString(a),g=b.isString(c);if(f||g)return f&&g&&String(a)==String(c);f=b.isNumber(a);g=b.isNumber(c);if(f||g)return f&&g&&+a==+c;f=b.isBoolean(a);g=b.isBoolean(c);if(f||g)return f&&g&&+a==+c;f=b.isDate(a);g=b.isDate(c);if(f||g)return f&&g&&a.getTime()==c.getTime();f=b.isRegExp(a);g=b.isRegExp(c);if(f||g)return f&& +g&&a.source==c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase;if(e!="object")return false;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(b.isFunction(a.isEqual))return a.isEqual(c);for(e=d.length;e--;)if(d[e]==a)return true;d.push(a);e=0;f=true;if(a.length===+a.length||c.length===+c.length){if(e=a.length,f=e==c.length)for(;e--;)if(!(f=e in a==e in c&&q(a[e],c[e],d)))break}else{for(var h in a)if(l.call(a,h)&&(e++,!(f=l.call(c,h)&&q(a[h],c[h],d))))break;if(f){for(h in c)if(l.call(c, +h)&&!e--)break;f=!e}}d.pop();return f}var r=this,F=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,G=k.unshift,u=o.toString,l=o.hasOwnProperty,v=k.forEach,w=k.map,x=k.reduce,y=k.reduceRight,z=k.filter,A=k.every,B=k.some,p=k.indexOf,C=k.lastIndexOf,o=Array.isArray,H=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):r._=b;b.VERSION="1.2.0";var j=b.each=b.forEach=function(a,c,b){if(a!=null)if(v&&a.forEach=== +v)a.forEach(c,b);else if(a.length===+a.length)for(var e=0,f=a.length;e=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,b){var d={};j(a,function(a,f){var g=b(a,f);(d[g]||(d[g]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})}; +b.difference=function(a,c){return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this, +arguments)}};b.keys=H||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)l.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]= +b[d])});return a};b.clone=function(a){return b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(l.call(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return u.call(a)==="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return!(!a||!l.call(a,"callee"))}; +b.isFunction=function(a){return!(!a||!a.constructor||!a.call||!a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||u.call(a)=="[object Boolean]"};b.isDate=function(a){return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)};b.isRegExp=function(a){return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===false))};b.isNull= +function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.noConflict=function(){r._=F;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),function(c){I(c,b[c]=a[c])})};var J=0;b.uniqueId=function(a){var b= +J++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||null,function(a, +b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",d=new Function("obj",d);return c?d(c):d};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var t=function(a,c){return c?b(a).chain():a},I=function(a,c){m.prototype[a]=function(){var a=i.call(arguments);G.call(a,this._wrapped);return t(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","), +function(a){var b=k[a];m.prototype[a]=function(){b.apply(this._wrapped,arguments);return t(this._wrapped,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return t(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}})(); \ No newline at end of file diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..f1e886e --- /dev/null +++ b/demo.html @@ -0,0 +1,119 @@ + + + + + jQuery tmpload Plugin Demo - Asynchronous Template Loading and Caching for jQuery Templates + + + + + + + + + + +

jQuery tmpload Plugin Demo

+ +

Asynchronous template loading and caching for jQuery templates.

+

It also has the ability to load local DOM templates and wrap them in a template manager object.

+

The Underscore templating system was use in the examples above.

+ +

Load local template, compile it with Underscore template manager and insert into the DIVs above

+ +

(view page source and scroll to the end of the page to see the template)

+ +
+        var tplObject = $.tmpload({id: 'local-template', tplWrapper: _.template});
+        $('#div-name1').html(tplObject({name: 'Dumitru'}));
+        $('#div-name2').html(tplObject({name: 'Lucas'}));
+        $('#div-name3').html(tplObject({name: 'Steve'}));
+    
+ +

Result

+ +
+
+
+ +

Load a remote template, compile it with Underscore and insert it into the DIVs above

+ +
+        $.tmpload({
+            url: 'templates/test-template.html',
+            tplWrapper: _.template,
+            onLoad: function (tplObject) {
+                $('#div-name4').html(tplObject({name: 'Sven'}));
+                $('#div-name5').html(tplObject({name: 'Radu'}));
+                $('#div-name6').html(tplObject({name: 'Razvan'}));
+            }
+        });
+    
+ +

Result

+ +
+
+
+ + +

Options

+ +
+
id (null):
+
+ Specify an id of a local template - a template that is a part of the DOM. (view page source for example) +
+
url (null):
+
+ Specify the remote URL from where you want to load a template if you don't want to use a local one. +
+
cache (true):
+
+ Cache the templates in the memory for later use. +
+
onLoad (null):
+
+ Use this callback to use the template when loading aremote one. +
+
tplWrapper (null):
+
+ An instance of a template manager object if any. (i.e _.template for Underscore templating system) +
+
+ + + + + + + + diff --git a/jquery.tmpload-v3.0.js b/jquery.tmpload-v3.0.js new file mode 100644 index 0000000..5c824cf --- /dev/null +++ b/jquery.tmpload-v3.0.js @@ -0,0 +1,112 @@ +/** +* jQuery Tmpload Plugin v3.0 +* +* Load and cache asyncronously local and remote jQuery templates +* +* +* @author Dumitru Glavan +* @link http://dumitruglavan.com +* @version 3.0 (11-OCT-2011) +* @requires jQuery v1.6 or later +* +* Find source on GitHub: https://github.com/doomhz/tmpload +* +* This content is released under the MIT License +* http://www.opensource.org/licenses/mit-license.php +* +*/ +(function($) { + + $.tmpload = function (options) { + var self = this, html = null; + + options = $.extend({}, $.tmpload.defaults, options); + + // Cache a template in the memory + self.cacheTemplate = function (cacheId, content) { + $.tmpload.templates[cacheId] = content; + return cacheId; + }; + + // Get a template from memory cache + self.getCachedTemplate = function (cacheId) { + return $.tmpload.templates[cacheId]; + }; + + // Find a template in the DOM, load and cache it + // Compile the template if a template engine specified + self.loadLocalTemplate = function (templateId, cacheTemplate, tplWrapper) { + var $localTemplate = $('#' + templateId); + + if ($localTemplate.length) { + html = tplWrapper ? tplWrapper($localTemplate.html()) : $localTemplate.html(); + cacheTemplate && self.cacheTemplate(templateId, html); + return html; + } else { + var exception = { + name: 'Template not found', + error: 'A local template with the id "' + options.id + '" could not be found in the DOM.' + }; + throw exception; + } + }; + + // Request a remote template, load and cache it + // Compile the template if a template engine specified + self.loadRemoteTemplate = function (templateUrl, loadCallback, cacheTemplate, tplWrapper) { + return $.ajax({ + url: templateUrl, + success: function (response) { + response = tplWrapper ? tplWrapper(response) : response; + cacheTemplate && self.cacheTemplate(templateUrl, response); + return $.isFunction(loadCallback) && loadCallback.call(self, response); + } + }); + }; + + // Make a template id work without # + options.id = options.id && options.id.replace(/^#/, ''); + + // Decide how to load the template - by id or url + var cacheKey = options.url || options.id; + + // Throw an exceptino if no id or url is specified + if (!cacheKey) { + throw { + name: 'Invalid template', + error: 'A template name or url should be specified.' + }; + } + + // Search for a cached template if wanted + if (options.cache) { + html = self.getCachedTemplate(cacheKey); + if (html) { + if ($.isFunction(options.onLoad)) { + return options.onLoad.call(self, html); + } + return html; + } + } + + // Grab a remote template or a local one + if (options.url) { + return self.loadRemoteTemplate(options.url, options.onLoad, options.cache, options.tplWrapper); + } else { + return self.loadLocalTemplate(options.id, options.cache, options.tplWrapper); + } + }; + + // Cache container + $.tmpload.templates = {}; + + // Default options + $.tmpload.defaults = { + id: null, + url: null, + cache: true, + onLoad: null, + tplWrapper: null + }; + +})(jQuery); \ No newline at end of file diff --git a/templates/test-template.html b/templates/test-template.html new file mode 100644 index 0000000..5aa7309 --- /dev/null +++ b/templates/test-template.html @@ -0,0 +1,3 @@ + +

I'm a remote template and I load slower than a local one!

+

My name is <%=name %>.

diff --git a/tests/coreTests.html b/tests/coreTests.html new file mode 100644 index 0000000..7add4ba --- /dev/null +++ b/tests/coreTests.html @@ -0,0 +1,33 @@ + + + + + tmpload Test Suite + + + + + + + + + + +

tmpload Test Suite

+

+
+

+
    + +
    + +
    +

    I'm a remote template and I load slower than a local one!

    +

    My name is <%=name %>.

    +
    +
    + + diff --git a/tests/coreTests.js b/tests/coreTests.js new file mode 100644 index 0000000..3fabfce --- /dev/null +++ b/tests/coreTests.js @@ -0,0 +1,67 @@ +var localTplToLoad = 'local-template'; +var remoteTplToLoad = 'remote-template'; +var remoteTplUrl = '../templates/test-template.html'; + +module("Core functionality", + { + setup: function() { + + }, + teardown: function() { + + } + } +); + +test("Local template gets loaded and returned", function () { + var html = $.tmpload({id: localTplToLoad}); + equal($('#' + localTplToLoad).html(), html, 'The content of the loaded template is the same as the one from the DOM.'); +}); + +test("The template name can begin with a # char", function () { + var html = $.tmpload({id: '#' + localTplToLoad}); + equal($('#' + localTplToLoad).html(), html, 'The content of the loaded template is the same as the one from the DOM.'); +}); + +test("An exception should be raised if the a template id or url was not specified", function () { + var exception = { + name: 'Invalid template', + error: 'A template name or url should be specified.' + }; + raises(function () {$.tmpload();}, function (err) {return err.name === exception.name;}, 'Raises error on template key not found'); +}); + +test("An exception should be raised if the template is not found in the DOM", function () { + var exception = { + name: 'Template not found', + error: 'A local template with the id "unexistent-template" could not be found in the DOM.' + }; + raises(function () {$.tmpload({id: 'unexistent-template'});}, function (err) {return err.name === exception.name;}, 'Raises error on template not found'); +}); + +asyncTest("Remote template gets loaded and returned", function () { + $.tmpload({ + url: remoteTplUrl, + onLoad: function (template) { + equal(template, $('#' + remoteTplToLoad).html().replace(">", '>').replace("<", '<'), 'The content of the remote loaded template is the same as the one from the DOM.'); + start(); + } + }); +}); + +asyncTest("The template should be cached when queryed the second time", function () { + equal($.tmpload.templates[remoteTplUrl], $('#' + remoteTplToLoad).html().replace(">", '>').replace("<", '<'), 'The template exists in memory cache.'); + $.tmpload({ + url: remoteTplUrl, + onLoad: function (template) { + equal(template, $('#' + remoteTplToLoad).html().replace(">", '>').replace("<", '<'), 'The content of the remote loaded template is the same as the one from the DOM.'); + start(); + } + }); +}); + +test("A compiled template object should be returned if specified in the options", function () { + delete $.tmpload.templates[localTplToLoad]; + var compiledObject = $.tmpload({id: localTplToLoad, tplWrapper: _.template}); + equal($('#' + localTplToLoad).html().replace('<%=name %>', 'Dumitru'), compiledObject({name: 'Dumitru'}), 'The content of the compiled template is the same as the one from the DOM and has the "name" var replaced by "Dumitru".'); +}); \ No newline at end of file diff --git a/tests/qunit b/tests/qunit new file mode 160000 index 0000000..2031511 --- /dev/null +++ b/tests/qunit @@ -0,0 +1 @@ +Subproject commit 20315118221a589f5ce7b32e20462de47f4e4fdc diff --git a/tmpload-v1.0.js b/tmpload-v1.0.js deleted file mode 100644 index 201a805..0000000 --- a/tmpload-v1.0.js +++ /dev/null @@ -1,48 +0,0 @@ -/* -tmpload jQuery Plugin v1.0 -Copyright 2011, Mark Dalgleish - -This content is released under the MIT License -github.com/markdalgleish/tmpload/blob/master/MIT-LICENSE.txt -*/ -(function($, undefined) { - //Template cache - var templates = {}; - - $.tmpload = function(obj, url) { - if (url === undefined) { - //Declaring template(s) - if (typeof obj === "object") { - if (obj.length) { - //Array of declaration objects - for (var i = 0; i < obj.length; i++) { - templates[obj[i].name] = obj[i].url; - } - } else { - //A single declaration object - templates[obj.name] = obj.url; - } - } - //Loading the template - else if (typeof obj === "string") { - if (typeof templates[obj] === "string") { - //The template hasn't been loaded yet - return $.Deferred(function(dfd) { - $.get(templates[obj]).success(function(d) { - templates[obj] = $.template(d); - dfd.resolve(templates[obj]); - }).error(function(d) { - dfd.reject(d); - }); - }).promise(); - } else { - //The template has already been cached - return templates[obj]; - } - } - //Declaring a single template - } else { - templates[obj] = url; - } - }; -})(jQuery); \ No newline at end of file diff --git a/tmpload-v1.0.min.js b/tmpload-v1.0.min.js deleted file mode 100644 index 483dbd2..0000000 --- a/tmpload-v1.0.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -tmpload jQuery Plugin v1.0 -Copyright 2011, Mark Dalgleish - -This content is released under the MIT License -github.com/markdalgleish/tmpload/blob/master/MIT-LICENSE.txt -*/ -(function(d,f){var b={};d.tmpload=function(a,e){if(e===f)if(typeof a==="object")if(a.length)for(var c=0;c=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,b){var d={};j(a,function(a,f){var g=b(a,f);(d[g]||(d[g]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})}; +b.difference=function(a,c){return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this, +arguments)}};b.keys=H||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)l.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]= +b[d])});return a};b.clone=function(a){return b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(l.call(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return u.call(a)==="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return!(!a||!l.call(a,"callee"))}; +b.isFunction=function(a){return!(!a||!a.constructor||!a.call||!a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||u.call(a)=="[object Boolean]"};b.isDate=function(a){return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)};b.isRegExp=function(a){return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===false))};b.isNull= +function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.noConflict=function(){r._=F;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),function(c){I(c,b[c]=a[c])})};var J=0;b.uniqueId=function(a){var b= +J++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||null,function(a, +b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",d=new Function("obj",d);return c?d(c):d};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var t=function(a,c){return c?b(a).chain():a},I=function(a,c){m.prototype[a]=function(){var a=i.call(arguments);G.call(a,this._wrapped);return t(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","), +function(a){var b=k[a];m.prototype[a]=function(){b.apply(this._wrapped,arguments);return t(this._wrapped,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return t(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}})(); \ No newline at end of file