Touchgui/www/lib/appframework/jq.appframework.min.js

changeset 0
e8ccd40d0ef6
equal deleted inserted replaced
-1:000000000000 0:099e7176eaca
1 /*! intel-appframework - v2.1.0 - 2014-09-16 */
2
3 /*
4 Intel 2013
5 @author Ian Maffett
6 @description A plugin to allow jQuery developers to use App Framework UI
7 */
8 (function(c,f){function p(a,b){if(a)if(a.nodeType)b[b.length++]=a;else for(var e=0,d=a.length;e<d;e++)b[b.length++]=a[e]}function m(a,b){a.os={};a.os.webkit=b.match(/WebKit\/([\d.]+)/)?!0:!1;a.os.android=b.match(/(Android)\s+([\d.]+)/)||b.match(/Silk-Accelerated/)?!0:!1;a.os.androidICS=a.os.android&&b.match(/(Android)\s4/)?!0:!1;a.os.ipad=b.match(/(iPad).*OS\s([\d_]+)/)?!0:!1;a.os.iphone=!a.os.ipad&&b.match(/(iPhone\sOS)\s([\d_]+)/)?!0:!1;a.os.ios7=(a.os.ipad||a.os.iphone)&&b.match(/7_/)||(a.os.ipad||
9 a.os.iphone)&&b.match(/8_/)?!0:!1;a.os.webos=b.match(/(webOS|hpwOS)[\s\/]([\d.]+)/)?!0:!1;a.os.touchpad=a.os.webos&&b.match(/TouchPad/)?!0:!1;a.os.ios=a.os.ipad||a.os.iphone;a.os.playbook=b.match(/PlayBook/)?!0:!1;a.os.blackberry10=b.match(/BB10/)?!0:!1;a.os.blackberry=a.os.playbook||a.os.blackberry10||b.match(/BlackBerry/)?!0:!1;a.os.chrome=b.match(/Chrome/)?!0:!1;a.os.opera=b.match(/Opera/)?!0:!1;a.os.fennec=b.match(/fennec/i)?!0:b.match(/Firefox/)?!0:!1;a.os.ie=b.match(/MSIE 10.0/i)||b.match(/Trident\/7/i)?
10 !0:!1;a.os.ieTouch=a.os.ie&&b.toLowerCase().match(/touch/i)?!0:!1;a.os.tizen=b.match(/Tizen/i)?!0:!1;a.os.supportsTouch=f.DocumentTouch&&h instanceof f.DocumentTouch||"ontouchstart"in f;a.os.kindle=b.match(/Silk-Accelerated/)?!0:!1;a.feat={};var e=h.documentElement.getElementsByTagName("head")[0];a.feat.nativeTouchScroll="undefined"!==typeof e.style["-webkit-overflow-scrolling"]&&(a.os.ios||a.os.blackberry10);a.feat.cssPrefix=a.os.webkit?"Webkit":a.os.fennec?"Moz":a.os.ie?"ms":a.os.opera?"O":"";a.feat.cssTransformStart=
11 !a.os.opera?"3d(":"(";a.feat.cssTransformEnd=!a.os.opera?",0)":")";a.os.android&&!a.os.webkit&&(a.os.android=!1)}jQuery.event.props.push("touches");jQuery.event.props.push("originalTouches");jQuery.event.props.push("changedTouches");var h=f.document,l={},k="object"===typeof MSApp,q=1;c.extend(c.fn,{vendorCss:function(a,b,e){return this.css(c.feat.cssPrefix+a,b,e)},cssTranslate:function(a){return this.vendorCss("Transform","translate"+c.feat.cssTransformStart+a+c.feat.cssTransformEnd)},computedStyle:function(a){if(!(0===
12 this.length||void 0==a))return f.getComputedStyle(this[0],"")[a]},replaceClass:function(a,b){if(void 0==a||void 0==b)return this;var e=function(a){c=c.replace(a in l?l[a]:l[a]=RegExp("(^|\\s)"+a+"(\\s|$)")," ")},d=0;for(;d<this.length;d++)if(void 0==a)this[d].className=b;else{var c=this[d].className;a.split(/\s+/g).concat(b.split(/\s+/g)).forEach(e);c=c.trim();this[d].className=0<c.length?(c+" "+b).trim():b}return this}});m(c,navigator.userAgent);c.__detectUA=m;c.uuid=function(){var a=function(){return(65536*
13 (1+Math.random())|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};c.getCssMatrix=function(a){c.is$(a)&&(a=a.get(0));var b=f.WebKitCSSMatrix||f.MSCSSMatrix;if(void 0===a)return b?new b:{a:0,b:0,c:0,d:0,e:0,f:0};a=f.getComputedStyle(a);a=a.webkitTransform||a.transform||a[c.feat.cssPrefix+"Transform"];return b?new b(a):a?(b=a.replace(/[^0-9\-.,]/g,"").split(","),{a:+b[0],b:+b[1],c:+b[2],d:+b[3],e:+b[4],f:+b[5]}):{a:0,b:0,c:0,d:0,e:0,f:0}};c.create=function(a,b){var e,
14 d=new c;if(b||"<"!==a[0]){b.html&&(b.innerHTML=b.html,delete b.html);e=h.createElement(a);for(var g in b)e[g]=b[g];d[d.length++]=e}else e=h.createElement("div"),k?MSApp.execUnsafeLocalFunction(function(){e.innerHTML=a.trim()}):e.innerHTML=a,p(e.childNodes,d);return d};c.query=function(a,b){try{return c(a,b)}catch(e){return c()}};c.bind=function(a,b,e){a.__events||(a.__events={});c.isArray(b)||(b=[b]);for(var d=0;d<b.length;d++)a.__events[b[d]]||(a.__events[b[d]]=[]),a.__events[b[d]].push(e)};c.trigger=
15 function(a,b,e){var d=!0;if(!a.__events)return d;c.isArray(b)||(b=[b]);c.isArray(e)||(e=[]);for(var g=0;g<b.length;g++)if(a.__events[b[g]])for(var f=a.__events[b[g]],h=0;h<f.length;h++)c.isFunction(f[h])&&!1===f[h].apply(a,e)&&(d=!1);return d};c.unbind=function(a,b,e){if(a.__events)if(void 0==b)delete a.__events;else{c.isArray(b)||(b=[b]);for(var d=0;d<b.length;d++)if(a.__events[b[d]])for(var g=a.__events[b[d]],f=0;f<g.length;f++)if(void 0==e&&delete g[f],g[f]===e){g.splice(f,1);break}}};c.cleanUpContent=
16 function(){};c.isObject=function(a){return"object"===typeof a};c.asap=function(a,b,e){if(!c.isFunction(a))throw"$.asap - argument is not a valid function";setTimeout(function(){a.apply(b,e)})};var n={};c.parseJS=function(a){if(a){if("string"===typeof a){var b=h.createElement("div");k?MSApp.execUnsafeLocalFunction(function(){b.innerHTML=a}):b.innerHTML=a;a=b}var c=a.getElementsByTagName("script");a=null;for(var d=0;d<c.length;d++)if(0<c[d].src.length&&!n[c[d].src]&&!k){var g=h.createElement("script");
17 g.type=c[d].type;g.src=c[d].src;h.getElementsByTagName("head")[0].appendChild(g);n[c[d].src]=1;g=null}else f.eval(c[d].innerHTML)}};c.is$=function(a){return a instanceof c};c.jsonP=function(a){if(k)return a.type="get",a.dataType=null,c.get(a);var b="jsonp_callback"+ ++q,e="",d,g=h.createElement("script");f[b]=function(d){clearTimeout(e);c(g).remove();delete f[b];a.success.call(void 0,d)};-1!==a.url.indexOf("callback=?")?g.src=a.url.replace(/=\?/,"="+b):(d=a.jsonp?a.jsonp:"callback",-1===a.url.indexOf("?")?
18 a.url+="?"+d+"="+b:a.url+="&"+d+"="+b,g.src=a.url);a.error&&(g.onerror=function(){clearTimeout(e);a.error.call(void 0,"","error")});c("head").append(g);0<a.timeout&&(e=setTimeout(function(){a.error.call(void 0,"","timeout")},a.timeout));return{}};f.$afm=c;f.numOnly||(f.numOnly=function(a){if(void 0===a||""===a)return 0;if(isNaN(parseFloat(a)))if(a.replace)a=a.replace(/[^0-9.-]/g,"");else return 0;return parseFloat(a)})})(jQuery,window);window.af=window.jq=jQuery;

mercurial