Add analytics
[bus.git] / busui / owa / modules / base / js / includes / jquery / jQote2 / jquery.jqote2.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * jQote2 - client-side Javascript templating engine
 * Copyright (C) 2010, aefxx
 * http://aefxx.com/
 *
 * Licensed under the DWTFYWT PUBLIC LICENSE v2
 * Copyright (C) 2004, Sam Hocevar
 *
 * Date: Sun, May 5th, 2010
 * Version: 0.9.2
 */
(function($){var A='[object Array]',F='[object Function]',S='[object String]',n=0,c='%',ts=Object.prototype.toString;$.fn.extend({jqote:function(x,y){var x=ts.call(x)===A?x:[x],d='';this.each(function(i){var f=(l=$.jqotecache[this.jqote])?l:$.jqotec(this,y||c);for(var j=0;j<x.length;j++)d+=f.call(x[j],i,j,x,f);});return d},jqoteapp:function(e,x,y){var d=$.jqote(e,x,y);return this.each(function(){$(this).append(d)})},jqotepre:function(e,x,y){var d=$.jqote(e,x,y);return this.each(function(){$(this).prepend(d)})},jqotesub:function(e,x,y){var d=$.jqote(e,x,y);return this.each(function(){$(this).html(d)})}});$.extend({jqote:function(e,x,y){var d='',l=[],y=y||c,t=ts.call(e),x=ts.call(x)===A?x:[x];if(t===F)l=[e];else if(t===A)l=ts.call(e[0])===F?e:$.map(e,function(u){return $.jqotec(u,y)});else if(t===S)l.push(e.indexOf('<'+y)<0?$.jqotec($(e),y):$.jqotec(e,y));else l=$.map($(e),function(u){return $.jqotec(u,y)});for(var i=0,q=l.length;i<q;i++)for(var j=0;j<x.length;j++)d+=l[i].call(x[j],i,j,x,l[i]);return d},jqotec: function(e, y) {var l,s='',y=y||c,t=ts.call(e),h=(t===S&&e.indexOf('<'+y)>=0)?e:(e=(t===S||e instanceof jQuery)?$(e)[0]:e).innerHTML;var a=h.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]/g,'').split('<'+y).join(y+'>\x1b').split(y+'>');for(var i=0,q=a.length;i<q;i++)s+=a[i].charAt(0)!=='\x1b'?"out+='"+a[i].replace(/([^\\])?(["'])/g,'$1\\$2')+"'":(a[i].charAt(1)==='='?'+'+a[i].substr(2)+';':';'+a[i].substr(1));l=new Function('i, j, data, fn','var out="";'+s+'; return out;');return ts.call(e)===S?l:$.jqotecache[e.jqote=e.jqote||n++]=l},jqotefn:function(e){return $.jqotecache[$(e)[0].jqote]||false},jqotetag:function(s){c=s},jqotecache:[]});})(jQuery);