code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="@VERSION@",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["intl-base"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"@VERSION@");
| mikesir87/cdnjs | ajax/libs/yui/3.7.2/yui-core/yui-core-min.js | JavaScript | mit | 21,410 |
YUI.add("datatable-column-widths",function(e,t){function i(){}var n=e.Lang.isNumber,r=e.Array.indexOf;e.Features.add("table","badColWidth",{test:function(){var t=e.one("body"),n,r;return t&&(n=t.insertBefore('<table style="position:absolute;visibility:hidden;border:0 none"><colgroup><col style="width:9px"></colgroup><tbody><tr><td style="padding:0 4px;font:normal 2px/2px arial;border:0 none">.</td></tr></tbody></table>',t.get("firstChild")),r=n.one("td").getComputedStyle("width")!=="1px",n.remove(!0)),r}}),e.mix(i.prototype,{COL_TEMPLATE:"<col/>",COLGROUP_TEMPLATE:"<colgroup/>",setColumnWidth:function(e,t){var i=this.getColumn(e),s=i&&r(this._displayColumns,i);return s>-1&&(n(t)&&(t+="px"),i.width=t,this._setColumnWidth(s,t)),this},_createColumnGroup:function(){return e.Node.create(this.COLGROUP_TEMPLATE)},initializer:function(e){this.after(["renderView","columnsChange"],this._uiSetColumnWidths)},_setColumnWidth:function(t,r){var i=this._colgroupNode,s=i&&i.all("col").item(t),o,u;s&&(r&&n(r)&&(r+="px"),s.setStyle("width",r),r&&e.Features.test("table","badColWidth")&&(o=this.getCell([0,t]),o&&(u=function(e){return parseInt(o.getComputedStyle(e),10)|0},s.setStyle("width",parseInt(r,10)-u("paddingLeft")-u("paddingRight")-u("borderLeftWidth")-u("borderRightWidth")+"px"))))},_uiSetColumnWidths:function(){if(!this.view)return;var e=this.COL_TEMPLATE,t=this._colgroupNode,n=this._displayColumns,r,i;t?t.empty():(t=this._colgroupNode=this._createColumnGroup(),this._tableNode.insertBefore(t,this._tableNode.one("> thead, > tfoot, > tbody")));for(r=0,i=n.length;r<i;++r)t.append(e),this._setColumnWidth(r,n[r].width)}},!0),e.DataTable.ColumnWidths=i,e.Base.mix(e.DataTable,[i])},"@VERSION@",{requires:["datatable-base"]});
| CarlosOhh/cdnjs | ajax/libs/yui/3.7.3/datatable-column-widths/datatable-column-widths-min.js | JavaScript | mit | 1,736 |
YUI.add('get', function (Y, NAME) {
/**
* NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
var path = require('path'),
vm = require('vm'),
fs = require('fs'),
request = require('request'),
existsSync = fs.existsSync || path.existsSync;
Y.Get = function() {
};
//Setup the default config base path
Y.config.base = path.join(__dirname, '../');
YUI.require = require;
YUI.process = process;
/**
* Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
* @method escapeWinPath
* @protected
* @param {String} p The path to modify
* @return {String} The encoded path
*/
var escapeWinPath = function(p) {
return p.replace(/\\/g, '\\\\');
};
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Callback} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
Y.Get._exec = function(data, url, cb) {
var dirName = escapeWinPath(path.dirname(url));
var fileName = escapeWinPath(url);
if (dirName.match(/^https?:\/\//)) {
dirName = '.';
fileName = 'remoteResource';
}
var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
"var __filename = '" + fileName + "'; " +
"var process = YUI.process;" +
"var require = function(file) {" +
" if (file.indexOf('./') === 0) {" +
" file = __dirname + file.replace('./', '/'); }" +
" return YUI.require(file); }; " +
data + " ;return YUI; })";
//var mod = "(function(YUI) { " + data + ";return YUI; })";
var script = vm.createScript(mod, url);
var fn = script.runInThisContext(mod);
YUI = fn(YUI);
cb(null, url);
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {String} url The URL/File path to fetch the content from
* @param {Callback} cb The callback to fire once the content has been executed via `_exec`
*/
Y.Get._include = function(url, cb) {
var self = this;
if (url.match(/^https?:\/\//)) {
var cfg = {
url: url,
timeout: self.timeout
};
request(cfg, function (err, response, body) {
if (err) {
Y.log(err, 'error', 'get');
cb(err, url);
} else {
Y.Get._exec(body, url, cb);
}
});
} else {
if (Y.config.useSync) {
//Needs to be in useSync
if (existsSync(url)) {
var mod = fs.readFileSync(url,'utf8');
Y.Get._exec(mod, url, cb);
} else {
cb('Path does not exist: ' + url, url);
}
} else {
fs.readFile(url, 'utf8', function(err, mod) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(mod, url, cb);
}
});
}
}
};
var end = function(cb, msg, result) {
//Y.log('Get end: ' + cb.onEnd);
if (Y.Lang.isFunction(cb.onEnd)) {
cb.onEnd.call(Y, msg, result);
}
}, pass = function(cb) {
//Y.log('Get pass: ' + cb.onSuccess);
if (Y.Lang.isFunction(cb.onSuccess)) {
cb.onSuccess.call(Y, cb);
}
end(cb, 'success', 'success');
}, fail = function(cb, er) {
//Y.log('Get fail: ' + er);
er.errors = [er];
if (Y.Lang.isFunction(cb.onFailure)) {
cb.onFailure.call(Y, er, cb);
}
end(cb, er, 'fail');
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
Y.Get.js = function(s, options) {
var A = Y.Array,
self = this,
urls = A(s), url, i, l = urls.length, c= 0,
check = function() {
if (c === l) {
pass(options);
}
};
for (i=0; i<l; i++) {
url = urls[i];
if (Y.Lang.isObject(url)) {
url = url.url;
}
url = url.replace(/'/g, '%27');
Y.log('URL: ' + url, 'info', 'get');
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
Y.log('After Load: ' + url, 'info', 'get');
if (err) {
fail(options, err);
Y.log('----------------------------------------------------------', 'error', 'get');
Y.log(err, 'error', 'get');
Y.log('----------------------------------------------------------', 'error', 'get');
} else {
c++;
check();
}
});
}
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
pass(cb);
};
}, '@VERSION@');
| platanus/cdnjs | ajax/libs/yui/3.8.0/get-nodejs/get-nodejs-debug.js | JavaScript | mit | 6,352 |
<?php
/**
* Save the input as a PNG file
*
* PHP versions 4 and 5
*
* Copyright (c) 2010-2013 Shinya Muramatsu
*
* 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.
*
* @author Shinya Muramatsu <revulon@gmail.com>
* @copyright 2010-2013 Shinya Muramatsu
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @link http://flashcanvas.net/
* @link http://code.google.com/p/flashcanvas/
*/
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_GET['filename'])) {
$filename = $_GET['filename'];
} else {
$filename = 'canvas.png';
}
// Force download
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $filename . '"');
if (isset($_POST['dataurl'])) {
// Decode the base64-encoded data
$data = $_POST['dataurl'];
$data = substr($data, strpos($data, ',') + 1);
echo base64_decode($data);
} else {
// Output the raw data
readfile('php://input');
}
}
| jakubfiala/cdnjs | ajax/libs/webshim/1.12.0/dev/shims/FlashCanvasPro/save.php | PHP | mit | 2,081 |
define(["coffee-script"],function(e){"use strict";var n,t,r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],o=function(){throw new Error("Environment unsupported.")},i={};return"undefined"!=typeof process&&process.versions&&process.versions.node?(n=require.nodeRequire("fs"),o=function(e,t){t(n.readFileSync(e,"utf8"))}):"undefined"!=typeof window&&window.navigator&&window.document||"undefined"!=typeof importScripts?(t=function(){var e,n,t;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(n=0;3>n;n+=1){t=r[n];try{e=new ActiveXObject(t)}catch(o){}if(e){r=[t];break}}if(!e)throw new Error("getXhr(): XMLHttpRequest not available");return e},o=function(e,n){var r=t();r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&n(r.responseText)},r.send(null)}):"undefined"!=typeof Packages&&(o=function(e,n){var t,r,o="utf-8",i=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(i),o)),s="";try{for(t=new java.lang.StringBuffer,r=f.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),t.append(r);null!==(r=f.readLine());)t.append(a),t.append(r);s=String(t.toString())}finally{f.close()}n(s)}),{fetchText:o,get:function(){return e},write:function(e,n,t){if(i.hasOwnProperty(n)){var r=i[n];t.asModule(e+"!"+n,r)}},version:"0.4.3",load:function(n,t,r,a){var f=t.toUrl(/\.((lit)?coffee|coffee\.md)$/.test(n)?n:n+".coffee");o(f,function(o){var s=a.CoffeeScript||{};s.literate=/\.(litcoffee|coffee\.md)$/.test(f);try{o=e.compile(o,s)}catch(u){throw u.message="In "+f+", "+u.message,u}a.isBuild&&(i[n]=o),a.isBuild||(o+="\r\n//@ sourceURL="+f),r.fromText(n,o),t([n],function(e){r(e)})})}}}); | r3x/cdnjs | ajax/libs/require-cs/0.4.4/cs.min.js | JavaScript | mit | 1,744 |
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsondiffpatch=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function(e){e.env.browser&&(window.diff_match_patch=require("../public/external/diff_match_patch_uncompressed")),module.exports=require("./main")}).call(this,require("_process"));
},{"../public/external/diff_match_patch_uncompressed":3,"./main":16,"_process":2}],2:[function(require,module,exports){
function noop(){}var process=module.exports={};process.nextTick=function(){var o="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(o)return function(o){return window.setImmediate(o)};if(e){var s=[];return window.addEventListener("message",function(o){var e=o.source;if((e===window||null===e)&&"process-tick"===o.data&&(o.stopPropagation(),s.length>0)){var n=s.shift();n()}},!0),function(o){s.push(o),window.postMessage("process-tick","*")}}return function(o){setTimeout(o,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")};
},{}],3:[function(require,module,exports){
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,n,e,i){"undefined"==typeof i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var h=i;if(null==t||null==n)throw new Error("Null input. (diff_main)");if(t==n)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof e&&(e=!0);var r=e,f=this.diff_commonPrefix(t,n),a=t.substring(0,f);t=t.substring(f),n=n.substring(f),f=this.diff_commonSuffix(t,n);var s=t.substring(t.length-f);t=t.substring(0,t.length-f),n=n.substring(0,n.length-f);var l=this.diff_compute_(t,n,r,h);return a&&l.unshift([DIFF_EQUAL,a]),s&&l.push([DIFF_EQUAL,s]),this.diff_cleanupMerge(l),l},diff_match_patch.prototype.diff_compute_=function(t,n,e,i){var h;if(!t)return[[DIFF_INSERT,n]];if(!n)return[[DIFF_DELETE,t]];var r=t.length>n.length?t:n,f=t.length>n.length?n:t,a=r.indexOf(f);if(-1!=a)return h=[[DIFF_INSERT,r.substring(0,a)],[DIFF_EQUAL,f],[DIFF_INSERT,r.substring(a+f.length)]],t.length>n.length&&(h[0][0]=h[2][0]=DIFF_DELETE),h;if(1==f.length)return[[DIFF_DELETE,t],[DIFF_INSERT,n]];r=f=null;var s=this.diff_halfMatch_(t,n);if(s){var l=s[0],g=s[1],c=s[2],_=s[3],o=s[4],u=this.diff_main(l,c,e,i),p=this.diff_main(g,_,e,i);return u.concat([[DIFF_EQUAL,o]],p)}return e&&t.length>100&&n.length>100?this.diff_lineMode_(t,n,i):this.diff_bisect_(t,n,i)},diff_match_patch.prototype.diff_lineMode_=function(t,n,e){var i=this.diff_linesToChars_(t,n);t=i[0],n=i[1];var h=i[2],r=this.diff_bisect_(t,n,e);this.diff_charsToLines_(r,h),this.diff_cleanupSemantic(r),r.push([DIFF_EQUAL,""]);for(var f=0,a=0,s=0,l="",g="";f<r.length;){switch(r[f][0]){case DIFF_INSERT:s++,g+=r[f][1];break;case DIFF_DELETE:a++,l+=r[f][1];break;case DIFF_EQUAL:if(a>=1&&s>=1){var i=this.diff_main(l,g,!1,e);r.splice(f-a-s,a+s),f=f-a-s;for(var c=i.length-1;c>=0;c--)r.splice(f,0,i[c]);f+=i.length}s=0,a=0,l="",g=""}f++}return r.pop(),r},diff_match_patch.prototype.diff_bisect_=function(t,n,e){for(var i=t.length,h=n.length,r=Math.ceil((i+h)/2),f=r,a=2*r,s=new Array(a),l=new Array(a),g=0;a>g;g++)s[g]=-1,l[g]=-1;s[f+1]=0,l[f+1]=0;for(var c=i-h,_=c%2!=0,o=0,u=0,p=0,d=0,F=0;r>F&&!((new Date).getTime()>e);F++){for(var E=-F+o;F-u>=E;E+=2){var D,I=f+E;D=E==-F||E!=F&&s[I-1]<s[I+1]?s[I+1]:s[I-1]+1;for(var m=D-E;i>D&&h>m&&t.charAt(D)==n.charAt(m);)D++,m++;if(s[I]=D,D>i)u+=2;else if(m>h)o+=2;else if(_){var b=f+c-E;if(b>=0&&a>b&&-1!=l[b]){var v=i-l[b];if(D>=v)return this.diff_bisectSplit_(t,n,D,m,e)}}}for(var L=-F+p;F-d>=L;L+=2){var v,b=f+L;v=L==-F||L!=F&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1;for(var T=v-L;i>v&&h>T&&t.charAt(i-v-1)==n.charAt(h-T-1);)v++,T++;if(l[b]=v,v>i)d+=2;else if(T>h)p+=2;else if(!_){var I=f+c-L;if(I>=0&&a>I&&-1!=s[I]){var D=s[I],m=f+D-I;if(v=i-v,D>=v)return this.diff_bisectSplit_(t,n,D,m,e)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,n]]},diff_match_patch.prototype.diff_bisectSplit_=function(t,n,e,i,h){var r=t.substring(0,e),f=n.substring(0,i),a=t.substring(e),s=n.substring(i),l=this.diff_main(r,f,!1,h),g=this.diff_main(a,s,!1,h);return l.concat(g)},diff_match_patch.prototype.diff_linesToChars_=function(t,n){function e(t){for(var n="",e=0,r=-1,f=i.length;r<t.length-1;){r=t.indexOf("\n",e),-1==r&&(r=t.length-1);var a=t.substring(e,r+1);e=r+1,(h.hasOwnProperty?h.hasOwnProperty(a):void 0!==h[a])?n+=String.fromCharCode(h[a]):(n+=String.fromCharCode(f),h[a]=f,i[f++]=a)}return n}var i=[],h={};i[0]="";var r=e(t),f=e(n);return[r,f,i]},diff_match_patch.prototype.diff_charsToLines_=function(t,n){for(var e=0;e<t.length;e++){for(var i=t[e][1],h=[],r=0;r<i.length;r++)h[r]=n[i.charCodeAt(r)];t[e][1]=h.join("")}},diff_match_patch.prototype.diff_commonPrefix=function(t,n){if(!t||!n||t.charAt(0)!=n.charAt(0))return 0;for(var e=0,i=Math.min(t.length,n.length),h=i,r=0;h>e;)t.substring(r,h)==n.substring(r,h)?(e=h,r=e):i=h,h=Math.floor((i-e)/2+e);return h},diff_match_patch.prototype.diff_commonSuffix=function(t,n){if(!t||!n||t.charAt(t.length-1)!=n.charAt(n.length-1))return 0;for(var e=0,i=Math.min(t.length,n.length),h=i,r=0;h>e;)t.substring(t.length-h,t.length-r)==n.substring(n.length-h,n.length-r)?(e=h,r=e):i=h,h=Math.floor((i-e)/2+e);return h},diff_match_patch.prototype.diff_commonOverlap_=function(t,n){var e=t.length,i=n.length;if(0==e||0==i)return 0;e>i?t=t.substring(e-i):i>e&&(n=n.substring(0,e));var h=Math.min(e,i);if(t==n)return h;for(var r=0,f=1;;){var a=t.substring(h-f),s=n.indexOf(a);if(-1==s)return r;f+=s,(0==s||t.substring(h-f)==n.substring(0,f))&&(r=f,f++)}},diff_match_patch.prototype.diff_halfMatch_=function(t,n){function e(t,n,e){for(var i,h,r,a,s=t.substring(e,e+Math.floor(t.length/4)),l=-1,g="";-1!=(l=n.indexOf(s,l+1));){var c=f.diff_commonPrefix(t.substring(e),n.substring(l)),_=f.diff_commonSuffix(t.substring(0,e),n.substring(0,l));g.length<_+c&&(g=n.substring(l-_,l)+n.substring(l,l+c),i=t.substring(0,e-_),h=t.substring(e+c),r=n.substring(0,l-_),a=n.substring(l+c))}return 2*g.length>=t.length?[i,h,r,a,g]:null}if(this.Diff_Timeout<=0)return null;var i=t.length>n.length?t:n,h=t.length>n.length?n:t;if(i.length<4||2*h.length<i.length)return null;var r,f=this,a=e(i,h,Math.ceil(i.length/4)),s=e(i,h,Math.ceil(i.length/2));if(!a&&!s)return null;r=s?a&&a[4].length>s[4].length?a:s:a;var l,g,c,_;t.length>n.length?(l=r[0],g=r[1],c=r[2],_=r[3]):(c=r[0],_=r[1],l=r[2],g=r[3]);var o=r[4];return[l,g,c,_,o]},diff_match_patch.prototype.diff_cleanupSemantic=function(t){for(var n=!1,e=[],i=0,h=null,r=0,f=0,a=0,s=0,l=0;r<t.length;)t[r][0]==DIFF_EQUAL?(e[i++]=r,f=s,a=l,s=0,l=0,h=t[r][1]):(t[r][0]==DIFF_INSERT?s+=t[r][1].length:l+=t[r][1].length,null!==h&&h.length<=Math.max(f,a)&&h.length<=Math.max(s,l)&&(t.splice(e[i-1],0,[DIFF_DELETE,h]),t[e[i-1]+1][0]=DIFF_INSERT,i--,i--,r=i>0?e[i-1]:-1,f=0,a=0,s=0,l=0,h=null,n=!0)),r++;for(n&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),r=1;r<t.length;){if(t[r-1][0]==DIFF_DELETE&&t[r][0]==DIFF_INSERT){var g=t[r-1][1],c=t[r][1],_=this.diff_commonOverlap_(g,c);(_>=g.length/2||_>=c.length/2)&&(t.splice(r,0,[DIFF_EQUAL,c.substring(0,_)]),t[r-1][1]=g.substring(0,g.length-_),t[r+1][1]=c.substring(_),r++),r++}r++}},diff_match_patch.prototype.diff_cleanupSemanticLossless=function(t){function n(t,n){if(!t||!n)return 5;var a=0;return(t.charAt(t.length-1).match(e)||n.charAt(0).match(e))&&(a++,(t.charAt(t.length-1).match(i)||n.charAt(0).match(i))&&(a++,(t.charAt(t.length-1).match(h)||n.charAt(0).match(h))&&(a++,(t.match(r)||n.match(f))&&a++))),a}for(var e=/[^a-zA-Z0-9]/,i=/\s/,h=/[\r\n]/,r=/\n\r?\n$/,f=/^\r?\n\r?\n/,a=1;a<t.length-1;){if(t[a-1][0]==DIFF_EQUAL&&t[a+1][0]==DIFF_EQUAL){var s=t[a-1][1],l=t[a][1],g=t[a+1][1],c=this.diff_commonSuffix(s,l);if(c){var _=l.substring(l.length-c);s=s.substring(0,s.length-c),l=_+l.substring(0,l.length-c),g=_+g}for(var o=s,u=l,p=g,d=n(s,l)+n(l,g);l.charAt(0)===g.charAt(0);){s+=l.charAt(0),l=l.substring(1)+g.charAt(0),g=g.substring(1);var F=n(s,l)+n(l,g);F>=d&&(d=F,o=s,u=l,p=g)}t[a-1][1]!=o&&(o?t[a-1][1]=o:(t.splice(a-1,1),a--),t[a][1]=u,p?t[a+1][1]=p:(t.splice(a+1,1),a--))}a++}},diff_match_patch.prototype.diff_cleanupEfficiency=function(t){for(var n=!1,e=[],i=0,h="",r=0,f=!1,a=!1,s=!1,l=!1;r<t.length;)t[r][0]==DIFF_EQUAL?(t[r][1].length<this.Diff_EditCost&&(s||l)?(e[i++]=r,f=s,a=l,h=t[r][1]):(i=0,h=""),s=l=!1):(t[r][0]==DIFF_DELETE?l=!0:s=!0,h&&(f&&a&&s&&l||h.length<this.Diff_EditCost/2&&f+a+s+l==3)&&(t.splice(e[i-1],0,[DIFF_DELETE,h]),t[e[i-1]+1][0]=DIFF_INSERT,i--,h="",f&&a?(s=l=!0,i=0):(i--,r=i>0?e[i-1]:-1,s=l=!1),n=!0)),r++;n&&this.diff_cleanupMerge(t)},diff_match_patch.prototype.diff_cleanupMerge=function(t){t.push([DIFF_EQUAL,""]);for(var n,e=0,i=0,h=0,r="",f="";e<t.length;)switch(t[e][0]){case DIFF_INSERT:h++,f+=t[e][1],e++;break;case DIFF_DELETE:i++,r+=t[e][1],e++;break;case DIFF_EQUAL:i+h>1?(0!==i&&0!==h&&(n=this.diff_commonPrefix(f,r),0!==n&&(e-i-h>0&&t[e-i-h-1][0]==DIFF_EQUAL?t[e-i-h-1][1]+=f.substring(0,n):(t.splice(0,0,[DIFF_EQUAL,f.substring(0,n)]),e++),f=f.substring(n),r=r.substring(n)),n=this.diff_commonSuffix(f,r),0!==n&&(t[e][1]=f.substring(f.length-n)+t[e][1],f=f.substring(0,f.length-n),r=r.substring(0,r.length-n))),0===i?t.splice(e-i-h,i+h,[DIFF_INSERT,f]):0===h?t.splice(e-i-h,i+h,[DIFF_DELETE,r]):t.splice(e-i-h,i+h,[DIFF_DELETE,r],[DIFF_INSERT,f]),e=e-i-h+(i?1:0)+(h?1:0)+1):0!==e&&t[e-1][0]==DIFF_EQUAL?(t[e-1][1]+=t[e][1],t.splice(e,1)):e++,h=0,i=0,r="",f=""}""===t[t.length-1][1]&&t.pop();var a=!1;for(e=1;e<t.length-1;)t[e-1][0]==DIFF_EQUAL&&t[e+1][0]==DIFF_EQUAL&&(t[e][1].substring(t[e][1].length-t[e-1][1].length)==t[e-1][1]?(t[e][1]=t[e-1][1]+t[e][1].substring(0,t[e][1].length-t[e-1][1].length),t[e+1][1]=t[e-1][1]+t[e+1][1],t.splice(e-1,1),a=!0):t[e][1].substring(0,t[e+1][1].length)==t[e+1][1]&&(t[e-1][1]+=t[e+1][1],t[e][1]=t[e][1].substring(t[e+1][1].length)+t[e+1][1],t.splice(e+1,1),a=!0)),e++;a&&this.diff_cleanupMerge(t)},diff_match_patch.prototype.diff_xIndex=function(t,n){var e,i=0,h=0,r=0,f=0;for(e=0;e<t.length&&(t[e][0]!==DIFF_INSERT&&(i+=t[e][1].length),t[e][0]!==DIFF_DELETE&&(h+=t[e][1].length),!(i>n));e++)r=i,f=h;return t.length!=e&&t[e][0]===DIFF_DELETE?f:f+(n-r)},diff_match_patch.prototype.diff_prettyHtml=function(t){for(var n=[],e=0,i=/&/g,h=/</g,r=/>/g,f=/\n/g,a=0;a<t.length;a++){var s=t[a][0],l=t[a][1],g=l.replace(i,"&").replace(h,"<").replace(r,">").replace(f,"¶<br>");switch(s){case DIFF_INSERT:n[a]='<ins style="background:#e6ffe6;">'+g+"</ins>";break;case DIFF_DELETE:n[a]='<del style="background:#ffe6e6;">'+g+"</del>";break;case DIFF_EQUAL:n[a]="<span>"+g+"</span>"}s!==DIFF_DELETE&&(e+=l.length)}return n.join("")},diff_match_patch.prototype.diff_text1=function(t){for(var n=[],e=0;e<t.length;e++)t[e][0]!==DIFF_INSERT&&(n[e]=t[e][1]);return n.join("")},diff_match_patch.prototype.diff_text2=function(t){for(var n=[],e=0;e<t.length;e++)t[e][0]!==DIFF_DELETE&&(n[e]=t[e][1]);return n.join("")},diff_match_patch.prototype.diff_levenshtein=function(t){for(var n=0,e=0,i=0,h=0;h<t.length;h++){var r=t[h][0],f=t[h][1];switch(r){case DIFF_INSERT:e+=f.length;break;case DIFF_DELETE:i+=f.length;break;case DIFF_EQUAL:n+=Math.max(e,i),e=0,i=0}}return n+=Math.max(e,i)},diff_match_patch.prototype.diff_toDelta=function(t){for(var n=[],e=0;e<t.length;e++)switch(t[e][0]){case DIFF_INSERT:n[e]="+"+encodeURI(t[e][1]);break;case DIFF_DELETE:n[e]="-"+t[e][1].length;break;case DIFF_EQUAL:n[e]="="+t[e][1].length}return n.join(" ").replace(/%20/g," ")},diff_match_patch.prototype.diff_fromDelta=function(t,n){for(var e=[],i=0,h=0,r=n.split(/\t/g),f=0;f<r.length;f++){var a=r[f].substring(1);switch(r[f].charAt(0)){case"+":try{e[i++]=[DIFF_INSERT,decodeURI(a)]}catch(s){throw new Error("Illegal escape in diff_fromDelta: "+a)}break;case"-":case"=":var l=parseInt(a,10);if(isNaN(l)||0>l)throw new Error("Invalid number in diff_fromDelta: "+a);var g=t.substring(h,h+=l);e[i++]="="==r[f].charAt(0)?[DIFF_EQUAL,g]:[DIFF_DELETE,g];break;default:if(r[f])throw new Error("Invalid diff operation in diff_fromDelta: "+r[f])}}if(h!=t.length)throw new Error("Delta length ("+h+") does not equal source text length ("+t.length+").");return e},diff_match_patch.prototype.match_main=function(t,n,e){if(null==t||null==n||null==e)throw new Error("Null input. (match_main)");return e=Math.max(0,Math.min(e,t.length)),t==n?0:t.length?t.substring(e,e+n.length)==n?e:this.match_bitap_(t,n,e):-1},diff_match_patch.prototype.match_bitap_=function(t,n,e){function i(t,i){var h=t/n.length,f=Math.abs(e-i);return r.Match_Distance?h+f/r.Match_Distance:f?1:h}if(n.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var h=this.match_alphabet_(n),r=this,f=this.Match_Threshold,a=t.indexOf(n,e);-1!=a&&(f=Math.min(i(0,a),f),a=t.lastIndexOf(n,e+n.length),-1!=a&&(f=Math.min(i(0,a),f)));var s=1<<n.length-1;a=-1;for(var l,g,c,_=n.length+t.length,o=0;o<n.length;o++){for(l=0,g=_;g>l;)i(o,e+g)<=f?l=g:_=g,g=Math.floor((_-l)/2+l);_=g;var u=Math.max(1,e-g+1),p=Math.min(e+g,t.length)+n.length,d=Array(p+2);d[p+1]=(1<<o)-1;for(var F=p;F>=u;F--){var E=h[t.charAt(F-1)];if(d[F]=0===o?(d[F+1]<<1|1)&E:(d[F+1]<<1|1)&E|((c[F+1]|c[F])<<1|1)|c[F+1],d[F]&s){var D=i(o,F-1);if(f>=D){if(f=D,a=F-1,!(a>e))break;u=Math.max(1,2*e-a)}}}if(i(o+1,e)>f)break;c=d}return a},diff_match_patch.prototype.match_alphabet_=function(t){for(var n={},e=0;e<t.length;e++)n[t.charAt(e)]=0;for(var e=0;e<t.length;e++)n[t.charAt(e)]|=1<<t.length-e-1;return n},diff_match_patch.prototype.patch_addContext_=function(t,n){if(0!=n.length){for(var e=n.substring(t.start2,t.start2+t.length1),i=0;n.indexOf(e)!=n.lastIndexOf(e)&&e.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,e=n.substring(t.start2-i,t.start2+t.length1+i);i+=this.Patch_Margin;var h=n.substring(t.start2-i,t.start2);h&&t.diffs.unshift([DIFF_EQUAL,h]);var r=n.substring(t.start2+t.length1,t.start2+t.length1+i);r&&t.diffs.push([DIFF_EQUAL,r]),t.start1-=h.length,t.start2-=h.length,t.length1+=h.length+r.length,t.length2+=h.length+r.length}},diff_match_patch.prototype.patch_make=function(t,n,e){var i,h;if("string"==typeof t&&"string"==typeof n&&"undefined"==typeof e)i=t,h=this.diff_main(i,n,!0),h.length>2&&(this.diff_cleanupSemantic(h),this.diff_cleanupEfficiency(h));else if(t&&"object"==typeof t&&"undefined"==typeof n&&"undefined"==typeof e)h=t,i=this.diff_text1(h);else if("string"==typeof t&&n&&"object"==typeof n&&"undefined"==typeof e)i=t,h=n;else{if("string"!=typeof t||"string"!=typeof n||!e||"object"!=typeof e)throw new Error("Unknown call format to patch_make.");i=t,h=e}if(0===h.length)return[];for(var r=[],f=new diff_match_patch.patch_obj,a=0,s=0,l=0,g=i,c=i,_=0;_<h.length;_++){var o=h[_][0],u=h[_][1];switch(a||o===DIFF_EQUAL||(f.start1=s,f.start2=l),o){case DIFF_INSERT:f.diffs[a++]=h[_],f.length2+=u.length,c=c.substring(0,l)+u+c.substring(l);break;case DIFF_DELETE:f.length1+=u.length,f.diffs[a++]=h[_],c=c.substring(0,l)+c.substring(l+u.length);break;case DIFF_EQUAL:u.length<=2*this.Patch_Margin&&a&&h.length!=_+1?(f.diffs[a++]=h[_],f.length1+=u.length,f.length2+=u.length):u.length>=2*this.Patch_Margin&&a&&(this.patch_addContext_(f,g),r.push(f),f=new diff_match_patch.patch_obj,a=0,g=c,s=l)}o!==DIFF_INSERT&&(s+=u.length),o!==DIFF_DELETE&&(l+=u.length)}return a&&(this.patch_addContext_(f,g),r.push(f)),r},diff_match_patch.prototype.patch_deepCopy=function(t){for(var n=[],e=0;e<t.length;e++){var i=t[e],h=new diff_match_patch.patch_obj;h.diffs=[];for(var r=0;r<i.diffs.length;r++)h.diffs[r]=i.diffs[r].slice();h.start1=i.start1,h.start2=i.start2,h.length1=i.length1,h.length2=i.length2,n[e]=h}return n},diff_match_patch.prototype.patch_apply=function(t,n){if(0==t.length)return[n,[]];t=this.patch_deepCopy(t);var e=this.patch_addPadding(t);n=e+n+e,this.patch_splitMax(t);for(var i=0,h=[],r=0;r<t.length;r++){var f,a=t[r].start2+i,s=this.diff_text1(t[r].diffs),l=-1;if(s.length>this.Match_MaxBits?(f=this.match_main(n,s.substring(0,this.Match_MaxBits),a),-1!=f&&(l=this.match_main(n,s.substring(s.length-this.Match_MaxBits),a+s.length-this.Match_MaxBits),(-1==l||f>=l)&&(f=-1))):f=this.match_main(n,s,a),-1==f)h[r]=!1,i-=t[r].length2-t[r].length1;else{h[r]=!0,i=f-a;var g;if(g=-1==l?n.substring(f,f+s.length):n.substring(f,l+this.Match_MaxBits),s==g)n=n.substring(0,f)+this.diff_text2(t[r].diffs)+n.substring(f+s.length);else{var c=this.diff_main(s,g,!1);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(c)/s.length>this.Patch_DeleteThreshold)h[r]=!1;else{this.diff_cleanupSemanticLossless(c);for(var _,o=0,u=0;u<t[r].diffs.length;u++){var p=t[r].diffs[u];p[0]!==DIFF_EQUAL&&(_=this.diff_xIndex(c,o)),p[0]===DIFF_INSERT?n=n.substring(0,f+_)+p[1]+n.substring(f+_):p[0]===DIFF_DELETE&&(n=n.substring(0,f+_)+n.substring(f+this.diff_xIndex(c,o+p[1].length))),p[0]!==DIFF_DELETE&&(o+=p[1].length)}}}}}return n=n.substring(e.length,n.length-e.length),[n,h]},diff_match_patch.prototype.patch_addPadding=function(t){for(var n=this.Patch_Margin,e="",i=1;n>=i;i++)e+=String.fromCharCode(i);for(var i=0;i<t.length;i++)t[i].start1+=n,t[i].start2+=n;var h=t[0],r=h.diffs;if(0==r.length||r[0][0]!=DIFF_EQUAL)r.unshift([DIFF_EQUAL,e]),h.start1-=n,h.start2-=n,h.length1+=n,h.length2+=n;else if(n>r[0][1].length){var f=n-r[0][1].length;r[0][1]=e.substring(r[0][1].length)+r[0][1],h.start1-=f,h.start2-=f,h.length1+=f,h.length2+=f}if(h=t[t.length-1],r=h.diffs,0==r.length||r[r.length-1][0]!=DIFF_EQUAL)r.push([DIFF_EQUAL,e]),h.length1+=n,h.length2+=n;else if(n>r[r.length-1][1].length){var f=n-r[r.length-1][1].length;r[r.length-1][1]+=e.substring(0,f),h.length1+=f,h.length2+=f}return e},diff_match_patch.prototype.patch_splitMax=function(t){for(var n=this.Match_MaxBits,e=0;e<t.length;e++)if(t[e].length1>n){var i=t[e];t.splice(e--,1);for(var h=i.start1,r=i.start2,f="";0!==i.diffs.length;){var a=new diff_match_patch.patch_obj,s=!0;for(a.start1=h-f.length,a.start2=r-f.length,""!==f&&(a.length1=a.length2=f.length,a.diffs.push([DIFF_EQUAL,f]));0!==i.diffs.length&&a.length1<n-this.Patch_Margin;){var l=i.diffs[0][0],g=i.diffs[0][1];l===DIFF_INSERT?(a.length2+=g.length,r+=g.length,a.diffs.push(i.diffs.shift()),s=!1):l===DIFF_DELETE&&1==a.diffs.length&&a.diffs[0][0]==DIFF_EQUAL&&g.length>2*n?(a.length1+=g.length,h+=g.length,s=!1,a.diffs.push([l,g]),i.diffs.shift()):(g=g.substring(0,n-a.length1-this.Patch_Margin),a.length1+=g.length,h+=g.length,l===DIFF_EQUAL?(a.length2+=g.length,r+=g.length):s=!1,a.diffs.push([l,g]),g==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(g.length))}f=this.diff_text2(a.diffs),f=f.substring(f.length-this.Patch_Margin);var c=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);""!==c&&(a.length1+=c.length,a.length2+=c.length,0!==a.diffs.length&&a.diffs[a.diffs.length-1][0]===DIFF_EQUAL?a.diffs[a.diffs.length-1][1]+=c:a.diffs.push([DIFF_EQUAL,c])),s||t.splice(++e,0,a)}}},diff_match_patch.prototype.patch_toText=function(t){for(var n=[],e=0;e<t.length;e++)n[e]=t[e];return n.join("")},diff_match_patch.prototype.patch_fromText=function(t){var n=[];if(!t)return n;for(var e=t.split("\n"),i=0,h=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<e.length;){var r=e[i].match(h);if(!r)throw new Error("Invalid patch string: "+e[i]);var f=new diff_match_patch.patch_obj;for(n.push(f),f.start1=parseInt(r[1],10),""===r[2]?(f.start1--,f.length1=1):"0"==r[2]?f.length1=0:(f.start1--,f.length1=parseInt(r[2],10)),f.start2=parseInt(r[3],10),""===r[4]?(f.start2--,f.length2=1):"0"==r[4]?f.length2=0:(f.start2--,f.length2=parseInt(r[4],10)),i++;i<e.length;){var a=e[i].charAt(0);try{var s=decodeURI(e[i].substring(1))}catch(l){throw new Error("Illegal escape in patch_fromText: "+s)}if("-"==a)f.diffs.push([DIFF_DELETE,s]);else if("+"==a)f.diffs.push([DIFF_INSERT,s]);else if(" "==a)f.diffs.push([DIFF_EQUAL,s]);else{if("@"==a)break;if(""!==a)throw new Error('Invalid patch mode "'+a+'" in: '+s)}i++}}return n},diff_match_patch.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},diff_match_patch.patch_obj.prototype.toString=function(){var t,n;t=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1,n=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;for(var e,i=["@@ -"+t+" +"+n+" @@\n"],h=0;h<this.diffs.length;h++){switch(this.diffs[h][0]){case DIFF_INSERT:e="+";break;case DIFF_DELETE:e="-";break;case DIFF_EQUAL:e=" "}i[h+1]=e+encodeURI(this.diffs[h][1])+"\n"}return i.join("").replace(/%20/g," ")},this.diff_match_patch=diff_match_patch,this.DIFF_DELETE=DIFF_DELETE,this.DIFF_INSERT=DIFF_INSERT,this.DIFF_EQUAL=DIFF_EQUAL;
},{}],4:[function(require,module,exports){
var Pipe=require("../pipe").Pipe,Context=function(){};Context.prototype.setResult=function(t){return this.result=t,this.hasResult=!0,this},Context.prototype.exit=function(){return this.exiting=!0,this},Context.prototype.switchTo=function(t,e){return"string"==typeof t||t instanceof Pipe?this.nextPipe=t:(this.next=t,e&&(this.nextPipe=e)),this},Context.prototype.push=function(t,e){return t.parent=this,"undefined"!=typeof e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(this.children[this.children.length-1].next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this,this},exports.Context=Context;
},{"../pipe":17}],5:[function(require,module,exports){
var Context=require("./context").Context,DiffContext=function(t,e){this.left=t,this.right=e,this.pipe="diff"};DiffContext.prototype=new Context,exports.DiffContext=DiffContext;
},{"./context":4}],6:[function(require,module,exports){
var Context=require("./context").Context,PatchContext=function(t,e){this.left=t,this.delta=e,this.pipe="patch"};PatchContext.prototype=new Context,exports.PatchContext=PatchContext;
},{"./context":4}],7:[function(require,module,exports){
var Context=require("./context").Context,ReverseContext=function(e){this.delta=e,this.pipe="reverse"};ReverseContext.prototype=new Context,exports.ReverseContext=ReverseContext;
},{"./context":4}],8:[function(require,module,exports){
module.exports=function(d,e){var t;return"string"==typeof e&&(t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+\-])(\d{2}):(\d{2}))$/.exec(e))?new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5],+t[6],+(t[7]||0))):e};
},{}],9:[function(require,module,exports){
var Processor=require("./processor").Processor,Pipe=require("./pipe").Pipe,DiffContext=require("./contexts/diff").DiffContext,PatchContext=require("./contexts/patch").PatchContext,ReverseContext=require("./contexts/reverse").ReverseContext,trivial=require("./filters/trivial"),nested=require("./filters/nested"),arrays=require("./filters/arrays"),dates=require("./filters/dates"),texts=require("./filters/texts"),DiffPatcher=function(e){this.processor=new Processor(e),this.processor.pipe(new Pipe("diff").append(nested.collectChildrenDiffFilter,trivial.diffFilter,dates.diffFilter,texts.diffFilter,nested.objectsDiffFilter,arrays.diffFilter).shouldHaveResult()),this.processor.pipe(new Pipe("patch").append(nested.collectChildrenPatchFilter,arrays.collectChildrenPatchFilter,trivial.patchFilter,texts.patchFilter,nested.patchFilter,arrays.patchFilter).shouldHaveResult()),this.processor.pipe(new Pipe("reverse").append(nested.collectChildrenReverseFilter,arrays.collectChildrenReverseFilter,trivial.reverseFilter,texts.reverseFilter,nested.reverseFilter,arrays.reverseFilter).shouldHaveResult())};DiffPatcher.prototype.options=function(){return this.processor.options.apply(this.processor,arguments)},DiffPatcher.prototype.diff=function(e,r){return this.processor.process(new DiffContext(e,r))},DiffPatcher.prototype.patch=function(e,r){return this.processor.process(new PatchContext(e,r))},DiffPatcher.prototype.reverse=function(e){return this.processor.process(new ReverseContext(e))},DiffPatcher.prototype.unpatch=function(e,r){return this.patch(e,this.reverse(r))},exports.DiffPatcher=DiffPatcher;
},{"./contexts/diff":5,"./contexts/patch":6,"./contexts/reverse":7,"./filters/arrays":10,"./filters/dates":11,"./filters/nested":13,"./filters/texts":14,"./filters/trivial":15,"./pipe":17,"./processor":18}],10:[function(require,module,exports){
var DiffContext=require("../contexts/diff").DiffContext,PatchContext=require("../contexts/patch").PatchContext,ReverseContext=require("../contexts/reverse").ReverseContext,lcs=require("./lcs"),ARRAY_MOVE=3,isArray="function"==typeof Array.isArray?Array.isArray:function(e){return e instanceof Array},arrayIndexOf="function"==typeof Array.prototype.indexOf?function(e,r){return e.indexOf(r)}:function(e,r){for(var t=e.length,i=0;t>i;i++)if(e[i]===r)return i;return-1},diffFilter=function(e){if(e.leftIsArray){for(var r,t,i,n,a=e.options&&e.options.objectHash,l=function(e,r,t,i,n){var l=e[t],s=r[i];if(l===s)return!0;if("object"!=typeof l||"object"!=typeof s)return!1;if(!a)return!1;var o,f;return"number"==typeof t?(n.hashCache1=n.hashCache1||[],o=n.hashCache1[t],"undefined"==typeof o&&(n.hashCache1[t]=o=a(l,t))):o=a(l),"undefined"==typeof o?!1:("number"==typeof i?(n.hashCache2=n.hashCache2||[],f=n.hashCache2[i],"undefined"==typeof f&&(n.hashCache2[i]=f=a(s,i))):f=a(s),"undefined"==typeof f?!1:o===f)},s={},o=0,f=0,c=e.left,h=e.right,d=c.length,u=h.length;d>o&&u>o&&l(c,h,o,o,s);)r=o,n=new DiffContext(e.left[r],e.right[r]),e.push(n,r),o++;for(;d>f+o&&u>f+o&&l(c,h,d-1-f,u-1-f,s);)t=d-1-f,i=u-1-f,n=new DiffContext(e.left[t],e.right[i]),e.push(n,i),f++;var v;if(o+f===d){if(d===u)return void e.setResult(void 0).exit();for(v=v||{_t:"a"},r=o;u-f>r;r++)v[r]=[h[r]];return void e.setResult(v).exit()}if(o+f===u){for(v=v||{_t:"a"},r=o;d-f>r;r++)v["_"+r]=[c[r],0,0];return void e.setResult(v).exit()}s={};var p=c.slice(o,d-f),y=h.slice(o,u-f),x=lcs.get(p,y,l,s),C=[];for(v=v||{_t:"a"},r=o;d-f>r;r++)arrayIndexOf(x.indices1,r-o)<0&&(v["_"+r]=[c[r],0,0],C.push(r));var R=!0;e.options&&e.options.arrays&&e.options.arrays.detectMove===!1&&(R=!1);var A=!1;e.options&&e.options.arrays&&e.options.arrays.includeValueOnMove&&(A=!0);var _=C.length;for(r=o;u-f>r;r++){var m=arrayIndexOf(x.indices2,r-o);if(0>m){var F=!1;if(R&&_>0)for(var g=0;_>g;g++)if(t=C[g],l(p,y,t-o,r-o,s)){v["_"+t].splice(1,2,r,ARRAY_MOVE),A||(v["_"+t][0]=""),i=r,n=new DiffContext(e.left[t],e.right[i]),e.push(n,i),C.splice(g,1),F=!0;break}F||(v[r]=[h[r]])}else t=x.indices1[m]+o,i=x.indices2[m]+o,n=new DiffContext(e.left[t],e.right[i]),e.push(n,i)}e.setResult(v).exit()}};diffFilter.filterName="arrays";var compare={numerically:function(e,r){return e-r},numericallyBy:function(e){return function(r,t){return r[e]-t[e]}}},patchFilter=function(e){if(e.nested&&"a"===e.delta._t){var r,t,i=e.delta,n=e.left,a=[],l=[],s=[];for(r in i)if("_t"!==r)if("_"===r[0]){if(0!==i[r][2]&&i[r][2]!==ARRAY_MOVE)throw new Error("only removal or move can be applied at original array indices, invalid diff type: "+i[r][2]);a.push(parseInt(r.slice(1),10))}else 1===i[r].length?l.push({index:parseInt(r,10),value:i[r][0]}):s.push({index:parseInt(r,10),delta:i[r]});for(a=a.sort(compare.numerically),r=a.length-1;r>=0;r--){t=a[r];var o=i["_"+t],f=n.splice(t,1)[0];o[2]===ARRAY_MOVE&&l.push({index:o[1],value:f})}l=l.sort(compare.numericallyBy("index"));var c=l.length;for(r=0;c>r;r++){var h=l[r];n.splice(h.index,0,h.value)}var d,u=s.length;if(u>0)for(r=0;u>r;r++){var v=s[r];d=new PatchContext(e.left[v.index],v.delta),e.push(d,v.index)}return e.children?void e.exit():void e.setResult(e.left).exit()}};patchFilter.filterName="arrays";var collectChildrenPatchFilter=function(e){if(e&&e.children&&"a"===e.delta._t){for(var r,t=e.children.length,i=0;t>i;i++)r=e.children[i],e.left[r.childName]=r.result;e.setResult(e.left).exit()}};collectChildrenPatchFilter.filterName="arraysCollectChildren";var reverseFilter=function(e){if(!e.nested)return void(e.delta[2]===ARRAY_MOVE&&(e.newName="_"+e.delta[1],e.setResult([e.delta[0],parseInt(e.childName.substr(1),10),ARRAY_MOVE]).exit()));if("a"===e.delta._t){var r,t;for(r in e.delta)"_t"!==r&&(t=new ReverseContext(e.delta[r]),e.push(t,r));e.exit()}};reverseFilter.filterName="arrays";var reverseArrayDeltaIndex=function(e,r,t){var i=r;if("string"==typeof r&&"_"===r[0])i=parseInt(r.substr(1),10);else{var n="_"+r;if(isArray(t)&&0===t[2])i=n;else for(var a in e){var l=e[a];isArray(l)&&l[2]===ARRAY_MOVE&&l[1].toString()===r&&(i=a.substr(1))}}return i},collectChildrenReverseFilter=function(e){if(e&&e.children&&"a"===e.delta._t){for(var r,t=e.children.length,i={_t:"a"},n=0;t>n;n++){r=e.children[n];var a=r.newName;"undefined"==typeof a&&(a=reverseArrayDeltaIndex(e.delta,r.childName,r.result)),i[a]!==r.result&&(i[a]=r.result)}e.setResult(i).exit()}};collectChildrenReverseFilter.filterName="arraysCollectChildren",exports.diffFilter=diffFilter,exports.patchFilter=patchFilter,exports.collectChildrenPatchFilter=collectChildrenPatchFilter,exports.reverseFilter=reverseFilter,exports.collectChildrenReverseFilter=collectChildrenReverseFilter;
},{"../contexts/diff":5,"../contexts/patch":6,"../contexts/reverse":7,"./lcs":12}],11:[function(require,module,exports){
var diffFilter=function(t){t.left instanceof Date?(t.setResult(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?[t.left,t.right]:void 0:[t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()};diffFilter.filterName="dates",exports.diffFilter=diffFilter;
},{}],12:[function(require,module,exports){
var defaultMatch=function(t,e,n,r){return t[n]===e[r]},lengthMatrix=function(t,e,n,r){var c,a,i=t.length,u=e.length,f=[i+1];for(c=0;i+1>c;c++)for(f[c]=[u+1],a=0;u+1>a;a++)f[c][a]=0;for(f.match=n,c=1;i+1>c;c++)for(a=1;u+1>a;a++)f[c][a]=n(t,e,c-1,a-1,r)?f[c-1][a-1]+1:Math.max(f[c-1][a],f[c][a-1]);return f},backtrack=function(t,e,n,r,c,a){if(0===r||0===c)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,c-1,a)){var i=backtrack(t,e,n,r-1,c-1,a);return i.sequence.push(e[r-1]),i.indices1.push(r-1),i.indices2.push(c-1),i}return t[r][c-1]>t[r-1][c]?backtrack(t,e,n,r,c-1,a):backtrack(t,e,n,r-1,c,a)},get=function(t,e,n,r){r=r||{};var c=lengthMatrix(t,e,n||defaultMatch,r),a=backtrack(c,t,e,t.length,e.length,r);return"string"==typeof t&&"string"==typeof e&&(a.sequence=a.sequence.join("")),a};exports.get=get;
},{}],13:[function(require,module,exports){
var DiffContext=require("../contexts/diff").DiffContext,PatchContext=require("../contexts/patch").PatchContext,ReverseContext=require("../contexts/reverse").ReverseContext,collectChildrenDiffFilter=function(e){if(e&&e.children){for(var t,l=e.children.length,r=e.result,i=0;l>i;i++)t=e.children[i],"undefined"!=typeof t.result&&(r=r||{},r[t.childName]=t.result);r&&e.leftIsArray&&(r._t="a"),e.setResult(r).exit()}};collectChildrenDiffFilter.filterName="collectChildren";var objectsDiffFilter=function(e){if(!e.leftIsArray&&"object"===e.leftType){var t,l;for(t in e.left)l=new DiffContext(e.left[t],e.right[t]),e.push(l,t);for(t in e.right)"undefined"==typeof e.left[t]&&(l=new DiffContext(void 0,e.right[t]),e.push(l,t));return e.children&&0!==e.children.length?void e.exit():void e.setResult(void 0).exit()}};objectsDiffFilter.filterName="objects";var patchFilter=function(e){if(e.nested&&!e.delta._t){var t,l;for(t in e.delta)l=new PatchContext(e.left[t],e.delta[t]),e.push(l,t);e.exit()}};patchFilter.filterName="objects";var collectChildrenPatchFilter=function(e){if(e&&e.children&&!e.delta._t){for(var t,l=e.children.length,r=0;l>r;r++)t=e.children[r],e.left[t.childName]!==t.result&&(e.left[t.childName]=t.result);e.setResult(e.left).exit()}};collectChildrenPatchFilter.filterName="collectChildren";var reverseFilter=function(e){if(e.nested&&!e.delta._t){var t,l;for(t in e.delta)l=new ReverseContext(e.delta[t]),e.push(l,t);e.exit()}};reverseFilter.filterName="objects";var collectChildrenReverseFilter=function(e){if(e&&e.children&&!e.delta._t){for(var t,l=e.children.length,r={},i=0;l>i;i++)t=e.children[i],r[t.childName]!==t.result&&(r[t.childName]=t.result);e.setResult(r).exit()}};collectChildrenReverseFilter.filterName="collectChildren",exports.collectChildrenDiffFilter=collectChildrenDiffFilter,exports.objectsDiffFilter=objectsDiffFilter,exports.patchFilter=patchFilter,exports.collectChildrenPatchFilter=collectChildrenPatchFilter,exports.reverseFilter=reverseFilter,exports.collectChildrenReverseFilter=collectChildrenReverseFilter;
},{"../contexts/diff":5,"../contexts/patch":6,"../contexts/reverse":7}],14:[function(require,module,exports){
var TEXT_DIFF=2,DEFAULT_MIN_LENGTH=60,cachedDiffPatch=null,getDiffMatchPatch=function(){if(!cachedDiffPatch){var t;if("undefined"!=typeof diff_match_patch)t="function"==typeof diff_match_patch?new diff_match_patch:new diff_match_patch.diff_match_patch;else if("function"==typeof require)try{var e="diff_match_patch_uncompressed",f=require("../../public/external/"+e);t=new f.diff_match_patch}catch(i){t=null}if(!t){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}cachedDiffPatch={diff:function(e,f){return t.patch_toText(t.patch_make(e,f))},patch:function(e,f){for(var i=t.patch_apply(t.patch_fromText(f),e),r=0;r<i[1].length;r++)if(!i[1][r]){var a=new Error("text patch failed");a.textPatchFailed=!0}return i[0]}}}return cachedDiffPatch},diffFilter=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||DEFAULT_MIN_LENGTH;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var f=getDiffMatchPatch().diff;t.setResult([f(t.left,t.right),0,TEXT_DIFF]).exit()}};diffFilter.filterName="texts";var patchFilter=function(t){if(!t.nested&&t.delta[2]===TEXT_DIFF){var e=getDiffMatchPatch().patch;t.setResult(e(t.left,t.delta[0])).exit()}};patchFilter.filterName="texts";var textDeltaReverse=function(t){var e,f,i,r,a,c,l,n,h=null,d=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(i=t.split("\n"),e=0,f=i.length;f>e;e++){r=i[e];var o=r.slice(0,1);"@"===o?(h=d.exec(r),c=e,l=null,n=null,i[c]="@@ -"+h[3]+","+h[4]+" +"+h[1]+","+h[2]+" @@"):"+"===o?(l=e,i[e]="-"+i[e].slice(1),"+"===i[e-1].slice(0,1)&&(a=i[e],i[e]=i[e-1],i[e-1]=a)):"-"===o&&(n=e,i[e]="+"+i[e].slice(1))}return i.join("\n")},reverseFilter=function(t){t.nested||t.delta[2]===TEXT_DIFF&&t.setResult([textDeltaReverse(t.delta[0]),0,TEXT_DIFF]).exit()};reverseFilter.filterName="texts",exports.diffFilter=diffFilter,exports.patchFilter=patchFilter,exports.reverseFilter=reverseFilter;
},{}],15:[function(require,module,exports){
var isArray="function"==typeof Array.isArray?Array.isArray:function(e){return e instanceof Array},diffFilter=function(e){if(e.left===e.right)return void e.setResult(void 0).exit();if("undefined"==typeof e.left){if("function"==typeof e.right)throw new Error("functions are not supported");return void e.setResult([e.right]).exit()}if("undefined"==typeof e.right)return void e.setResult([e.left,0,0]).exit();if("function"==typeof e.left||"function"==typeof e.right)throw new Error("functions are not supported");return e.leftType=null===e.left?"null":typeof e.left,e.rightType=null===e.right?"null":typeof e.right,e.leftType!==e.rightType?void e.setResult([e.left,e.right]).exit():"boolean"===e.leftType||"number"===e.leftType?void e.setResult([e.left,e.right]).exit():("object"===e.leftType&&(e.leftIsArray=isArray(e.left)),"object"===e.rightType&&(e.rightIsArray=isArray(e.right)),e.leftIsArray!==e.rightIsArray?void e.setResult([e.left,e.right]).exit():void 0)};diffFilter.filterName="trivial";var patchFilter=function(e){return"undefined"==typeof e.delta?void e.setResult(e.left).exit():(e.nested=!isArray(e.delta),e.nested?void 0:1===e.delta.length?void e.setResult(e.delta[0]).exit():2===e.delta.length?void e.setResult(e.delta[1]).exit():3===e.delta.length&&0===e.delta[2]?void e.setResult(void 0).exit():void 0)};patchFilter.filterName="trivial";var reverseFilter=function(e){return"undefined"==typeof e.delta?void e.setResult(e.delta).exit():(e.nested=!isArray(e.delta),e.nested?void 0:1===e.delta.length?void e.setResult([e.delta[0],0,0]).exit():2===e.delta.length?void e.setResult([e.delta[1],e.delta[0]]).exit():3===e.delta.length&&0===e.delta[2]?void e.setResult([e.delta[0]]).exit():void 0)};reverseFilter.filterName="trivial",exports.diffFilter=diffFilter,exports.patchFilter=patchFilter,exports.reverseFilter=reverseFilter;
},{}],16:[function(require,module,exports){
(function(e){var r=require("./diffpatcher").DiffPatcher;exports.DiffPatcher=r,exports.create=function(e){return new r(e)},exports.dateReviver=require("./date-reviver");var t;if(exports.diff=function(){return t||(t=new r),t.diff.apply(t,arguments)},exports.patch=function(){return t||(t=new r),t.patch.apply(t,arguments)},exports.unpatch=function(){return t||(t=new r),t.unpatch.apply(t,arguments)},exports.reverse=function(){return t||(t=new r),t.reverse.apply(t,arguments)},e.browser)exports.homepage="https://github.com/benjamine/jsondiffpatch",exports.version="0.1.10";else{var o="../package.json",a=require(o);exports.homepage=a.homepage,exports.version=a.version;var n="./formatters",p=require(n);exports.formatters=p,exports.console=p.console}}).call(this,require("_process"));
},{"./date-reviver":8,"./diffpatcher":9,"_process":2}],17:[function(require,module,exports){
var Pipe=function(t){this.name=t,this.filters=[]};Pipe.prototype.process=function(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var e=this.debug,r=this.filters.length,i=t,s=0;r>s;s++){var o=this.filters[s];if(e&&this.log("filter: "+o.filterName),o(i),"object"==typeof i&&i.exiting){i.exiting=!1;break}}!i.next&&this.resultCheck&&this.resultCheck(i)},Pipe.prototype.log=function(t){console.log("[jsondiffpatch] "+this.name+" pipe, "+t)},Pipe.prototype.append=function(){return this.filters.push.apply(this.filters,arguments),this},Pipe.prototype.prepend=function(){return this.filters.unshift.apply(this.filters,arguments),this},Pipe.prototype.indexOf=function(t){if(!t)throw new Error("a filter name is required");for(var e=0;e<this.filters.length;e++){var r=this.filters[e];if(r.filterName===t)return e}throw new Error("filter not found: "+t)},Pipe.prototype.list=function(){for(var t=[],e=0;e<this.filters.length;e++){var r=this.filters[e];t.push(r.filterName)}return t},Pipe.prototype.after=function(t){var e=this.indexOf(t),r=Array.prototype.slice.call(arguments,1);if(!r.length)throw new Error("a filter is required");return r.unshift(e+1,0),Array.prototype.splice.apply(this.filters,r),this},Pipe.prototype.before=function(t){var e=this.indexOf(t),r=Array.prototype.slice.call(arguments,1);if(!r.length)throw new Error("a filter is required");return r.unshift(e,0),Array.prototype.splice.apply(this.filters,r),this},Pipe.prototype.clear=function(){return this.filters.length=0,this},Pipe.prototype.shouldHaveResult=function(t){if(t===!1)return void(this.resultCheck=null);if(!this.resultCheck){var e=this;return this.resultCheck=function(t){if(!t.hasResult){console.log(t);var r=new Error(e.name+" failed");throw r.noResult=!0,r}},this}},exports.Pipe=Pipe;
},{}],18:[function(require,module,exports){
var Processor=function(e){this.selfOptions=e,this.pipes={}};Processor.prototype.options=function(e){return e&&(this.selfOptions=e),this.selfOptions},Processor.prototype.pipe=function(e,t){if("string"==typeof e){if("undefined"==typeof t)return this.pipes[e];this.pipes[e]=t}if(e&&e.name){if(t=e,t.processor===this)return t;this.pipes[t.name]=t}return t.processor=this,t},Processor.prototype.process=function(e,t){var s=e;s.options=this.options();for(var r,o,i=t||e.pipe||"default";i;)"undefined"!=typeof s.nextAfterChildren&&(s.next=s.nextAfterChildren,s.nextAfterChildren=null),"string"==typeof i&&(i=this.pipe(i)),i.process(s),o=s,r=i,i=null,s&&s.next&&(s=s.next,i=o.nextPipe||s.pipe||r);return s.hasResult?s.result:void 0},exports.Processor=Processor;
},{}]},{},[1])(1)
});
//# sourceMappingURL=jsondiffpatch-full.min.map | holtkamp/cdnjs | ajax/libs/jsondiffpatch/0.1.11/jsondiffpatch-full.min.js | JavaScript | mit | 41,109 |
/**
* fullPage 2.4.6
* https://github.com/alvarotrigo/fullPage.js
* MIT licensed
*
* Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
*/
html, body {
margin: 0;
padding: 0;
overflow:hidden;
/*Avoid flicker on slides transitions for mobile phones #336 */
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
#superContainer {
height: 100%;
position: relative;
/* Touch detection for Windows 8 */
-ms-touch-action: none;
/* IE 11 on Windows Phone 8.1*/
touch-action: none;
}
.fp-section {
position: relative;
-webkit-box-sizing: border-box; /* Safari<=5 Android<=3 */
-moz-box-sizing: border-box; /* <=28 */
box-sizing: border-box;
}
.fp-slide {
float: left;
}
.fp-slide, .fp-slidesContainer {
height: 100%;
display: block;
}
.fp-slides {
z-index:1;
height: 100%;
overflow: hidden;
position: relative;
-webkit-transition: all 0.3s ease-out; /* Safari<=6 Android<=4.3 */
transition: all 0.3s ease-out;
}
.fp-section.fp-table, .fp-slide.fp-table {
display: table;
width: 100%;
}
.fp-tableCell {
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}
.fp-slidesContainer {
float: left;
position: relative;
}
.fp-controlArrow {
position: absolute;
z-index: 4;
top: 50%;
cursor: pointer;
width: 0;
height: 0;
border-style: solid;
margin-top: -38px;
}
.fp-controlArrow.fp-prev {
left: 15px;
width: 0;
border-width: 38.5px 34px 38.5px 0;
border-color: transparent #fff transparent transparent;
}
.fp-controlArrow.fp-next {
right: 15px;
border-width: 38.5px 0 38.5px 34px;
border-color: transparent transparent transparent #fff;
}
.fp-scrollable {
overflow: scroll;
}
.fp-notransition {
-webkit-transition: none !important;
transition: none !important;
}
#fp-nav {
position: fixed;
z-index: 100;
margin-top: -32px;
top: 50%;
opacity: 1;
}
#fp-nav.right {
right: 17px;
}
#fp-nav.left {
left: 17px;
}
.fp-slidesNav{
position: absolute;
z-index: 4;
left: 50%;
opacity: 1;
}
.fp-slidesNav.bottom {
bottom: 17px;
}
.fp-slidesNav.top {
top: 17px;
}
#fp-nav ul,
.fp-slidesNav ul {
margin: 0;
padding: 0;
}
#fp-nav ul li,
.fp-slidesNav ul li {
display: block;
width: 14px;
height: 13px;
margin: 7px;
position:relative;
}
.fp-slidesNav ul li {
display: inline-block;
}
#fp-nav ul li a,
.fp-slidesNav ul li a {
display: block;
position: relative;
z-index: 1;
width: 100%;
height: 100%;
cursor: pointer;
text-decoration: none;
}
#fp-nav ul li a.active span,
.fp-slidesNav ul li a.active span {
background: #333;
}
#fp-nav ul li a span,
.fp-slidesNav ul li a span {
top: 2px;
left: 2px;
width: 8px;
height: 8px;
border: 1px solid #000;
background: rgba(0, 0, 0, 0);
border-radius: 50%;
position: absolute;
z-index: 1;
}
#fp-nav ul li .fp-tooltip {
position: absolute;
top: -2px;
color: #fff;
font-size: 14px;
font-family: arial, helvetica, sans-serif;
white-space: nowrap;
max-width: 220px;
overflow: hidden;
display: block;
opacity: 0;
width: 0;
}
#fp-nav ul li:hover .fp-tooltip {
-webkit-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
width: auto;
opacity: 1;
}
#fp-nav ul li .fp-tooltip.right {
right: 20px;
}
#fp-nav ul li .fp-tooltip.left {
left: 20px;
}
| DaAwesomeP/cdnjs | ajax/libs/fullPage.js/2.4.7/jquery.fullPage.css | CSS | mit | 3,693 |
<?php
/*
* 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.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Tools;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata;
/**
* ResolveTargetEntityListener
*
* Mechanism to overwrite interfaces or classes specified as association
* targets.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @since 2.2
*/
class ResolveTargetEntityListener
{
/**
* @var array
*/
private $resolveTargetEntities = array();
/**
* Adds a target-entity class name to resolve to a new class name.
*
* @param string $originalEntity
* @param string $newEntity
* @param array $mapping
*
* @return void
*/
public function addResolveTargetEntity($originalEntity, $newEntity, array $mapping)
{
$mapping['targetEntity'] = ltrim($newEntity, "\\");
$this->resolveTargetEntities[ltrim($originalEntity, "\\")] = $mapping;
}
/**
* Processes event and resolves new target entity names.
*
* @param LoadClassMetadataEventArgs $args
*
* @return void
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $args)
{
$cm = $args->getClassMetadata();
foreach ($cm->associationMappings as $mapping) {
if (isset($this->resolveTargetEntities[$mapping['targetEntity']])) {
$this->remapAssociation($cm, $mapping);
}
}
}
/**
* @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata
* @param array $mapping
*
* @return void
*/
private function remapAssociation($classMetadata, $mapping)
{
$newMapping = $this->resolveTargetEntities[$mapping['targetEntity']];
$newMapping = array_replace_recursive($mapping, $newMapping);
$newMapping['fieldName'] = $mapping['fieldName'];
unset($classMetadata->associationMappings[$mapping['fieldName']]);
switch ($mapping['type']) {
case ClassMetadata::MANY_TO_MANY:
$classMetadata->mapManyToMany($newMapping);
break;
case ClassMetadata::MANY_TO_ONE:
$classMetadata->mapManyToOne($newMapping);
break;
case ClassMetadata::ONE_TO_MANY:
$classMetadata->mapOneToMany($newMapping);
break;
case ClassMetadata::ONE_TO_ONE:
$classMetadata->mapOneToOne($newMapping);
break;
}
}
}
| Jamkyle/SiteRamisa | vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php | PHP | mit | 3,476 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['migration_none_found'] = 'No migrations were found.';
$lang['migration_not_found'] = 'No migration could be found with the version number: %s.';
$lang['migration_sequence_gap'] = 'There is a gap in the migration sequence near version number: %s.';
$lang['migration_multiple_version'] = 'There are multiple migrations with the same version number: %s.';
$lang['migration_class_doesnt_exist'] = 'The migration class "%s" could not be found.';
$lang['migration_missing_up_method'] = 'The migration class "%s" is missing an "up" method.';
$lang['migration_missing_down_method'] = 'The migration class "%s" is missing a "down" method.';
$lang['migration_invalid_filename'] = 'Migration "%s" has an invalid filename.';
| surya6837/MyProject | system/language/english/migration_lang.php | PHP | mit | 2,452 |
define(['./forOwn', '../lang/isArray'], function(forOwn, isArray) {
function containsMatch(array, pattern) {
var i = -1, length = array.length;
while (++i < length) {
if (deepMatches(array[i], pattern)) {
return true;
}
}
return false;
}
function matchArray(target, pattern) {
var i = -1, patternLength = pattern.length;
while (++i < patternLength) {
if (!containsMatch(target, pattern[i])) {
return false;
}
}
return true;
}
function matchObject(target, pattern) {
var result = true;
forOwn(pattern, function(val, key) {
if (!deepMatches(target[key], val)) {
// Return false to break out of forOwn early
return (result = false);
}
});
return result;
}
/**
* Recursively check if the objects match.
*/
function deepMatches(target, pattern){
if (target && typeof target === 'object') {
if (isArray(target) && isArray(pattern)) {
return matchArray(target, pattern);
} else {
return matchObject(target, pattern);
}
} else {
return target === pattern;
}
}
return deepMatches;
});
| ajream/todomvc | examples/lavaca_require/node_modules/mout/src/object/deepMatches.js | JavaScript | mit | 1,371 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "php");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT('simple_test',
'[meta <?php] ' +
'[keyword echo] [string "aaa"]; ' +
'[meta ?>]');
MT('variable_interpolation_non_alphanumeric',
'[meta <?php]',
'[keyword echo] [string "aaa$~$!$@$#$$$%$^$&$*$($)$.$<$>$/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]',
'[meta ?>]');
MT('variable_interpolation_digits',
'[meta <?php]',
'[keyword echo] [string "aaa$1$2$3$4$5$6$7$8$9$0aaa"]',
'[meta ?>]');
MT('variable_interpolation_simple_syntax_1',
'[meta <?php]',
'[keyword echo] [string "aaa][variable-2 $aaa][string .aaa"];',
'[meta ?>]');
MT('variable_interpolation_simple_syntax_2',
'[meta <?php]',
'[keyword echo] [string "][variable-2 $aaaa][[','[number 2]', ']][string aa"];',
'[keyword echo] [string "][variable-2 $aaaa][[','[number 2345]', ']][string aa"];',
'[keyword echo] [string "][variable-2 $aaaa][[','[number 2.3]', ']][string aa"];',
'[keyword echo] [string "][variable-2 $aaaa][[','[variable aaaaa]', ']][string aa"];',
'[keyword echo] [string "][variable-2 $aaaa][[','[variable-2 $aaaaa]',']][string aa"];',
'[keyword echo] [string "1aaa][variable-2 $aaaa][[','[number 2]', ']][string aa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa][[','[number 2345]', ']][string aa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa][[','[number 2.3]', ']][string aa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa][[','[variable aaaaa]', ']][string aa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa][[','[variable-2 $aaaaa]',']][string aa"];',
'[meta ?>]');
MT('variable_interpolation_simple_syntax_3',
'[meta <?php]',
'[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string .aaaaaa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];',
'[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];',
'[meta ?>]');
MT('variable_interpolation_escaping',
'[meta <?php] [comment /* Escaping */]',
'[keyword echo] [string "aaa\\$aaaa->aaa.aaa"];',
'[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];',
'[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];',
'[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];',
'[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];',
'[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];',
'[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];',
'[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];',
'[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];',
'[meta ?>]');
MT('variable_interpolation_complex_syntax_1',
'[meta <?php]',
'[keyword echo] [string "aaa][variable-2 $]{[variable aaaa]}[string ->aaa.aaa"];',
'[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];',
'[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];',
'[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa');
MT('variable_interpolation_complex_syntax_2',
'[meta <?php] [comment /* Monsters */]',
'[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>} $aaa<?php } */]}[string ->aaa.aaa"];',
'[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];',
'[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];');
function build_recursive_monsters(nt, t, n){
var monsters = [t];
for (var i = 1; i <= n; ++i)
monsters[i] = nt.join(monsters[i - 1]);
return monsters;
}
var m1 = build_recursive_monsters(
['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'],
'[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]',
10
);
MT('variable_interpolation_complex_syntax_3_1',
'[meta <?php] [comment /* Recursive monsters */]',
'[keyword echo] ' + m1[4] + ';',
'[keyword echo] ' + m1[7] + ';',
'[keyword echo] ' + m1[8] + ';',
'[keyword echo] ' + m1[5] + ';',
'[keyword echo] ' + m1[1] + ';',
'[keyword echo] ' + m1[6] + ';',
'[keyword echo] ' + m1[9] + ';',
'[keyword echo] ' + m1[0] + ';',
'[keyword echo] ' + m1[10] + ';',
'[keyword echo] ' + m1[2] + ';',
'[keyword echo] ' + m1[3] + ';',
'[keyword echo] [string "end"];',
'[meta ?>]');
var m2 = build_recursive_monsters(
['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'],
'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',
5
);
MT('variable_interpolation_complex_syntax_3_2',
'[meta <?php] [comment /* Recursive monsters 2 */]',
'[keyword echo] ' + m2[0] + ';',
'[keyword echo] ' + m2[1] + ';',
'[keyword echo] ' + m2[5] + ';',
'[keyword echo] ' + m2[4] + ';',
'[keyword echo] ' + m2[2] + ';',
'[keyword echo] ' + m2[3] + ';',
'[keyword echo] [string "end"];',
'[meta ?>]');
function build_recursive_monsters_2(mf1, mf2, nt, t, n){
var monsters = [t];
for (var i = 1; i <= n; ++i)
monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3];
return monsters;
}
var m3 = build_recursive_monsters_2(
m1,
m2,
['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'],
'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',
4
);
MT('variable_interpolation_complex_syntax_3_3',
'[meta <?php] [comment /* Recursive monsters 2 */]',
'[keyword echo] ' + m3[4] + ';',
'[keyword echo] ' + m3[0] + ';',
'[keyword echo] ' + m3[3] + ';',
'[keyword echo] ' + m3[1] + ';',
'[keyword echo] ' + m3[2] + ';',
'[keyword echo] [string "end"];',
'[meta ?>]');
MT("variable_interpolation_heredoc",
"[meta <?php]",
"[string <<<here]",
"[string doc ][variable-2 $]{[variable yay]}[string more]",
"[string here]; [comment // normal]");
})();
| WilliamRen/cdnjs | ajax/libs/codemirror/4.10.0/mode/php/test.js | JavaScript | mit | 6,637 |
// Load modules
var Dgram = require('dgram');
var Lab = require('lab');
var Sntp = require('../lib');
// Declare internals
var internals = {};
// Test shortcuts
var expect = Lab.expect;
var before = Lab.before;
var after = Lab.after;
var describe = Lab.experiment;
var it = Lab.test;
describe('SNTP', function () {
describe('#time', function () {
it('returns consistent result over multiple tries', function (done) {
Sntp.time(function (err, time) {
expect(err).to.not.exist;
expect(time).to.exist;
var t1 = time.t;
Sntp.time(function (err, time) {
expect(err).to.not.exist;
expect(time).to.exist;
var t2 = time.t;
expect(Math.abs(t1 - t2)).is.below(200);
done();
});
});
});
it('resolves reference IP', function (done) {
Sntp.time({ host: 'ntp.exnet.com', resolveReference: true }, function (err, time) {
expect(err).to.not.exist;
expect(time).to.exist;
expect(time.referenceHost).to.exist;
done();
});
});
it('times out on no response', function (done) {
Sntp.time({ port: 124, timeout: 100 }, function (err, time) {
expect(err).to.exist;
expect(time).to.not.exist;
expect(err.message).to.equal('Timeout');
done();
});
});
it('errors on error event', function (done) {
var orig = Dgram.createSocket;
Dgram.createSocket = function (type) {
Dgram.createSocket = orig;
var socket = Dgram.createSocket(type);
process.nextTick(function () { socket.emit('error', new Error('Fake')) });
return socket;
};
Sntp.time(function (err, time) {
expect(err).to.exist;
expect(time).to.not.exist;
expect(err.message).to.equal('Fake');
done();
});
});
it('times out on invalid host', function (done) {
Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {
expect(err).to.exist;
expect(time).to.not.exist;
expect(err.message).to.equal('getaddrinfo ENOTFOUND');
done();
});
});
it('fails on bad response buffer size', function (done) {
var server = Dgram.createSocket('udp4');
server.on('message', function (message, remote) {
var message = new Buffer(10);
server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
server.close();
});
});
server.bind(49123);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(err.message).to.equal('Invalid server response');
done();
});
});
var messup = function (bytes) {
var server = Dgram.createSocket('udp4');
server.on('message', function (message, remote) {
var message = new Buffer([
0x24, 0x01, 0x00, 0xe3,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x41, 0x43, 0x54, 0x53,
0xd4, 0xa8, 0x2d, 0xc7,
0x1c, 0x5d, 0x49, 0x1b,
0xd4, 0xa8, 0x2d, 0xe6,
0x67, 0xef, 0x9d, 0xb2,
0xd4, 0xa8, 0x2d, 0xe6,
0x71, 0xed, 0xb5, 0xfb,
0xd4, 0xa8, 0x2d, 0xe6,
0x71, 0xee, 0x6c, 0xc5
]);
for (var i = 0, il = bytes.length; i < il; ++i) {
message[bytes[i][0]] = bytes[i][1];
}
server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
server.close();
});
});
server.bind(49123);
};
it('fails on bad version', function (done) {
messup([[0, (0 << 6) + (3 << 3) + (4 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.version).to.equal(3);
expect(err.message).to.equal('Invalid server response');
done();
});
});
it('fails on bad originate timestamp and alarm li', function (done) {
messup([[0, (3 << 6) + (4 << 3) + (4 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(err.message).to.equal('Wrong originate timestamp');
expect(time.leapIndicator).to.equal('alarm');
done();
});
});
it('returns time with death stratum and last61 li', function (done) {
messup([[0, (1 << 6) + (4 << 3) + (4 << 0)], [1, 0]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(time.stratum).to.equal('death');
expect(time.leapIndicator).to.equal('last-minute-61');
done();
});
});
it('returns time with reserved stratum and last59 li', function (done) {
messup([[0, (2 << 6) + (4 << 3) + (4 << 0)], [1, 0x1f]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(time.stratum).to.equal('reserved');
expect(time.leapIndicator).to.equal('last-minute-59');
done();
});
});
it('fails on bad mode (symmetric-active)', function (done) {
messup([[0, (0 << 6) + (4 << 3) + (1 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.mode).to.equal('symmetric-active');
done();
});
});
it('fails on bad mode (symmetric-passive)', function (done) {
messup([[0, (0 << 6) + (4 << 3) + (2 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.mode).to.equal('symmetric-passive');
done();
});
});
it('fails on bad mode (client)', function (done) {
messup([[0, (0 << 6) + (4 << 3) + (3 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.mode).to.equal('client');
done();
});
});
it('fails on bad mode (broadcast)', function (done) {
messup([[0, (0 << 6) + (4 << 3) + (5 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.mode).to.equal('broadcast');
done();
});
});
it('fails on bad mode (reserved)', function (done) {
messup([[0, (0 << 6) + (4 << 3) + (6 << 0)]]);
Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
expect(err).to.exist;
expect(time.mode).to.equal('reserved');
done();
});
});
});
describe('#offset', function () {
it('gets the current offset', function (done) {
Sntp.offset(function (err, offset) {
expect(err).to.not.exist;
expect(offset).to.not.equal(0);
done();
});
});
it('gets the current offset from cache', function (done) {
Sntp.offset(function (err, offset) {
expect(err).to.not.exist;
expect(offset).to.not.equal(0);
var offset1 = offset;
Sntp.offset({}, function (err, offset) {
expect(err).to.not.exist;
expect(offset).to.equal(offset1);
done();
});
});
});
it('fails getting the current offset on invalid server', function (done) {
Sntp.offset({ host: 'error' }, function (err, offset) {
expect(err).to.exist;
expect(offset).to.equal(0);
done();
});
});
});
describe('#now', function () {
it('starts auto-sync, gets now, then stops', function (done) {
Sntp.stop();
var before = Sntp.now();
expect(before).to.equal(Date.now());
Sntp.start(function () {
var now = Sntp.now();
expect(now).to.not.equal(Date.now());
Sntp.stop();
done();
});
});
it('starts twice', function (done) {
Sntp.start(function () {
Sntp.start(function () {
var now = Sntp.now();
expect(now).to.not.equal(Date.now());
Sntp.stop();
done();
});
});
});
it('starts auto-sync, gets now, waits, gets again after timeout', function (done) {
Sntp.stop();
var before = Sntp.now();
expect(before).to.equal(Date.now());
Sntp.start({ clockSyncRefresh: 100 }, function () {
var now = Sntp.now();
expect(now).to.not.equal(Date.now());
expect(now).to.equal(Sntp.now());
setTimeout(function () {
expect(Sntp.now()).to.not.equal(now);
Sntp.stop();
done();
}, 110);
});
});
});
});
| wolfsilver/http-server | node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js | JavaScript | mit | 10,309 |
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
/* Horizontal Slider */
/* Use thumbUrl /build/slider-base/assets/skins/sam-dark/thumb-x.png */
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail,
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail-cap-left,
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail-cap-right {
background-image: url(https://yui-s.yahooapis.com/3.16.0/build/slider-base/assets/skins/sam-dark/rail-x.png);
background-repeat: repeat-x;
/* alternate: rail-x-lines.png */
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail {
height: 26px;
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-thumb {
height: 26px;
width: 15px;
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail-cap-left {
background-position: 0 -20px;
height: 20px;
left: -2px;
width: 5px;
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-rail-cap-right {
background-position: 0 -40px;
height: 20px;
right: -2px;
width: 5px;
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-thumb-image {
left: 0;
top: -10px;
}
.yui3-skin-sam-dark .yui3-slider-x .yui3-slider-thumb-shadow {
left: 0;
opacity: 0.15;
filter: alpha(opacity=15);
top: -50px;
}
/* Vertical Slider */
/* Use thumbUrl /build/slider-base/assets/skins/sam-dark/thumb-y.png */
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail,
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail-cap-top,
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-image: url(https://yui-s.yahooapis.com/3.16.0/build/slider-base/assets/skins/sam-dark/rail-y.png);
background-repeat: repeat-y;
/* alternate: rail-y-lines.png */
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail {
width: 26px;
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-thumb {
width: 26px;
height: 15px;
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail-cap-top {
background-position: -20px 0;
width: 20px;
top: -2px;
height: 5px;
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-position: -40px 0;
width: 20px;
bottom: -2px;
height: 5px;
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-thumb-image {
left: -10px;
top: 0;
}
.yui3-skin-sam-dark .yui3-slider-y .yui3-slider-thumb-shadow {
left: -50px;
opacity: 0.15;
filter: alpha(opacity=15);
top: 0;
}
| MenZil/jsdelivr | files/yui/3.16.0/slider-base/assets/skins/sam-dark/slider-base-skin.css | CSS | mit | 2,497 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Guess\Guess;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
class FormTypeGuesserChain implements FormTypeGuesserInterface
{
private $guessers = array();
/**
* Constructor.
*
* @param FormTypeGuesserInterface[] $guessers Guessers as instances of FormTypeGuesserInterface
*
* @throws UnexpectedTypeException if any guesser does not implement FormTypeGuesserInterface
*/
public function __construct(array $guessers)
{
foreach ($guessers as $guesser) {
if (!$guesser instanceof FormTypeGuesserInterface) {
throw new UnexpectedTypeException($guesser, 'Symfony\Component\Form\FormTypeGuesserInterface');
}
if ($guesser instanceof self) {
$this->guessers = array_merge($this->guessers, $guesser->guessers);
} else {
$this->guessers[] = $guesser;
}
}
}
/**
* {@inheritDoc}
*/
public function guessType($class, $property)
{
return $this->guess(function ($guesser) use ($class, $property) {
return $guesser->guessType($class, $property);
});
}
/**
* {@inheritDoc}
*/
public function guessRequired($class, $property)
{
return $this->guess(function ($guesser) use ($class, $property) {
return $guesser->guessRequired($class, $property);
});
}
/**
* {@inheritDoc}
*/
public function guessMaxLength($class, $property)
{
return $this->guess(function ($guesser) use ($class, $property) {
return $guesser->guessMaxLength($class, $property);
});
}
/**
* {@inheritDoc}
*/
public function guessPattern($class, $property)
{
return $this->guess(function ($guesser) use ($class, $property) {
return $guesser->guessPattern($class, $property);
});
}
/**
* Executes a closure for each guesser and returns the best guess from the
* return values
*
* @param \Closure $closure The closure to execute. Accepts a guesser
* as argument and should return a Guess instance
*
* @return Guess|null The guess with the highest confidence
*/
private function guess(\Closure $closure)
{
$guesses = array();
foreach ($this->guessers as $guesser) {
if ($guess = $closure($guesser)) {
$guesses[] = $guess;
}
}
return Guess::getBestGuess($guesses);
}
}
| Hralien/MarathonWeb | vendor/symfony/symfony/src/Symfony/Component/Form/FormTypeGuesserChain.php | PHP | mit | 2,880 |
/*! UIkit 2.12.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(t){var e;jQuery&&jQuery.UIkit&&(e=t(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-htmleditor",["uikit"],function(){return e||t(jQuery,jQuery.UIkit)})}(function(t,e){"use strict";var i=[];return e.component("htmleditor",{defaults:{iframe:!1,mode:"split",markdown:!1,autocomplete:!0,height:500,maxsplitsize:1e3,markedOptions:{gfm:!0,tables:!0,breaks:!0,pedantic:!0,sanitize:!1,smartLists:!0,smartypants:!1,langPrefix:"lang-"},codemirror:{mode:"htmlmixed",lineWrapping:!0,dragDrop:!1,autoCloseTags:!0,matchTags:!0,autoCloseBrackets:!0,matchBrackets:!0,indentUnit:4,indentWithTabs:!1,tabSize:4,hintOptions:{completionSingle:!1}},toolbar:["bold","italic","strike","link","image","blockquote","listUl","listOl"],lblPreview:"Preview",lblCodeview:"HTML",lblMarkedview:"Markdown"},init:function(){var o=this,r=e.components.htmleditor.template;this.CodeMirror=this.options.CodeMirror||CodeMirror,this.buttons={},r=r.replace(/\{:lblPreview\}/g,this.options.lblPreview),r=r.replace(/\{:lblCodeview\}/g,this.options.lblCodeview),this.htmleditor=t(r),this.content=this.htmleditor.find(".uk-htmleditor-content"),this.toolbar=this.htmleditor.find(".uk-htmleditor-toolbar"),this.preview=this.htmleditor.find(".uk-htmleditor-preview").children().eq(0),this.code=this.htmleditor.find(".uk-htmleditor-code"),this.element.before(this.htmleditor).appendTo(this.code),this.editor=this.CodeMirror.fromTextArea(this.element[0],this.options.codemirror),this.editor.htmleditor=this,this.editor.on("change",e.Utils.debounce(function(){o.render()},150)),this.editor.on("change",function(){o.editor.save()}),this.code.find(".CodeMirror").css("height",this.options.height),this.options.iframe?(this.iframe=t('<iframe class="uk-htmleditor-iframe" frameborder="0" scrolling="auto" height="100" width="100%"></iframe>'),this.preview.append(this.iframe),this.iframe[0].contentWindow.document.open(),this.iframe[0].contentWindow.document.close(),this.preview.container=t(this.iframe[0].contentWindow.document).find("body"),"string"==typeof this.options.iframe&&this.preview.container.parent().append('<link rel="stylesheet" href="'+this.options.iframe+'">')):this.preview.container=this.preview,e.$win.on("resize",e.Utils.debounce(function(){o.fit()},200));var n=this.iframe?this.preview.container:o.preview.parent(),l=this.code.find(".CodeMirror-sizer"),s=this.code.find(".CodeMirror-scroll").on("scroll",e.Utils.debounce(function(){if("tab"!=o.htmleditor.attr("data-mode")){var t=l.height()-s.height(),e=n[0].scrollHeight-(o.iframe?o.iframe.height():n.height()),i=e/t,r=s.scrollTop()*i;n.scrollTop(r)}},10));this.htmleditor.on("click",".uk-htmleditor-button-code, .uk-htmleditor-button-preview",function(e){e.preventDefault(),"tab"==o.htmleditor.attr("data-mode")&&(o.htmleditor.find(".uk-htmleditor-button-code, .uk-htmleditor-button-preview").removeClass("uk-active").filter(this).addClass("uk-active"),o.activetab=t(this).hasClass("uk-htmleditor-button-code")?"code":"preview",o.htmleditor.attr("data-active-tab",o.activetab),o.editor.refresh())}),this.htmleditor.on("click","a[data-htmleditor-button]",function(){o.code.is(":visible")&&o.trigger("action."+t(this).data("htmleditor-button"),[o.editor])}),this.preview.parent().css("height",this.code.height()),this.options.autocomplete&&this.CodeMirror.showHint&&this.CodeMirror.hint&&this.CodeMirror.hint.html&&this.editor.on("inputRead",e.Utils.debounce(function(){var t=o.editor.getDoc(),e=t.getCursor(),i=o.CodeMirror.innerMode(o.editor.getMode(),o.editor.getTokenAt(e).state).mode.name;if("xml"==i){var r=o.editor.getCursor(),n=o.editor.getTokenAt(r);("<"==n.string.charAt(0)||"attribute"==n.type)&&o.CodeMirror.showHint(o.editor,o.CodeMirror.hint.html,{completeSingle:!1})}},100)),this.debouncedRedraw=e.Utils.debounce(function(){o.redraw()},5),this.on("uk.component.init",function(){o.redraw()}),this.element.attr("data-uk-check-display",1).on("uk.check.display",function(){this.htmleditor.is(":visible")&&this.fit()}.bind(this)),i.push(this)},addButton:function(t,e){this.buttons[t]=e},addButtons:function(e){t.extend(this.buttons,e)},replaceInPreview:function(t,e){function i(t){var e=o.getValue().substring(0,t).split("\n");return{line:e.length-1,ch:e[e.length-1].length}}var o=this.editor,r=[],n=o.getValue(),l=-1;return this.currentvalue=this.currentvalue.replace(t,function(){l=n.indexOf(arguments[0],++l);var t={matches:arguments,from:i(l),to:i(l+arguments[0].length),replace:function(e){o.replaceRange(e,t.from,t.to)},inRange:function(e){return e.line===t.from.line&&e.line===t.to.line?e.ch>=t.from.ch&&e.ch<t.to.ch:e.line===t.from.line&&e.ch>=t.from.ch||e.line>t.from.line&&e.line<t.to.line||e.line===t.to.line&&e.ch<t.to.ch}},s=e(t);return 0==s?arguments[0]:(r.push(t),s)}),r},_buildtoolbar:function(){if(this.options.toolbar&&this.options.toolbar.length){var t=this,e=[];this.toolbar.empty(),this.options.toolbar.forEach(function(i){if(t.buttons[i]){var o=t.buttons[i].title?t.buttons[i].title:i;e.push('<li><a data-htmleditor-button="'+i+'" title="'+o+'" data-uk-tooltip>'+t.buttons[i].label+"</a></li>")}}),this.toolbar.html(e.join("\n"))}},fit:function(){var t=this.options.mode;"split"==t&&this.htmleditor.width()<this.options.maxsplitsize&&(t="tab"),"tab"==t&&(this.activetab||(this.activetab="code",this.htmleditor.attr("data-active-tab",this.activetab)),this.htmleditor.find(".uk-htmleditor-button-code, .uk-htmleditor-button-preview").removeClass("uk-active").filter("code"==this.activetab?".uk-htmleditor-button-code":".uk-htmleditor-button-preview").addClass("uk-active")),this.editor.refresh(),this.preview.parent().css("height",this.code.height()),this.htmleditor.attr("data-mode",t)},redraw:function(){this._buildtoolbar(),this.render(),this.fit()},getMode:function(){return this.editor.getOption("mode")},getCursorMode:function(){var t={mode:"html"};return this.trigger("cursorMode",[t]),t.mode},render:function(){return this.currentvalue=this.editor.getValue(),this.currentvalue?(this.trigger("render",[this]),this.trigger("renderLate",[this]),this.preview.container.html(this.currentvalue),void 0):(this.element.val(""),this.preview.container.html(""),void 0)},addShortcut:function(e,i){var o={};return t.isArray(e)||(e=[e]),e.forEach(function(t){o[t]=i}),this.editor.addKeyMap(o),o},addShortcutAction:function(t,e){var i=this;this.addShortcut(e,function(){i.element.trigger("action."+t,[i.editor])})},replaceSelection:function(t){var e=this.editor.getSelection();if(!e.length){for(var i=this.editor.getCursor(),o=this.editor.getLine(i.line),r=i.ch,n=r;n<o.length&&/[\w$]+/.test(o.charAt(n));)++n;for(;r&&/[\w$]+/.test(o.charAt(r-1));)--r;var l=r!=n&&o.slice(r,n);l&&(this.editor.setSelection({line:i.line,ch:r},{line:i.line,ch:n}),e=l)}var s=t.replace("$1",e);this.editor.replaceSelection(s,"end"),this.editor.focus()},replaceLine:function(t){var e=this.editor.getDoc().getCursor(),i=this.editor.getLine(e.line),o=t.replace("$1",i);this.editor.replaceRange(o,{line:e.line,ch:0},{line:e.line,ch:i.length}),this.editor.setCursor({line:e.line,ch:o.length}),this.editor.focus()},save:function(){this.editor.save()}}),e.components.htmleditor.template=['<div class="uk-htmleditor uk-clearfix" data-mode="split">','<div class="uk-htmleditor-navbar">','<ul class="uk-htmleditor-navbar-nav uk-htmleditor-toolbar"></ul>','<div class="uk-htmleditor-navbar-flip">','<ul class="uk-htmleditor-navbar-nav">','<li class="uk-htmleditor-button-code"><a>{:lblCodeview}</a></li>','<li class="uk-htmleditor-button-preview"><a>{:lblPreview}</a></li>','<li><a data-htmleditor-button="fullscreen"><i class="uk-icon-expand"></i></a></li>',"</ul>","</div>","</div>",'<div class="uk-htmleditor-content">','<div class="uk-htmleditor-code"></div>','<div class="uk-htmleditor-preview"><div></div></div>',"</div>","</div>"].join(""),e.plugin("htmleditor","base",{init:function(t){function i(e,i,o){t.on("action."+e,function(){"html"==t.getCursorMode()&&t["replaceLine"==o?"replaceLine":"replaceSelection"](i)})}t.addButtons({fullscreen:{title:"Fullscreen",label:'<i class="uk-icon-expand"></i>'},bold:{title:"Bold",label:'<i class="uk-icon-bold"></i>'},italic:{title:"Italic",label:'<i class="uk-icon-italic"></i>'},strike:{title:"Strikethrough",label:'<i class="uk-icon-strikethrough"></i>'},blockquote:{title:"Blockquote",label:'<i class="uk-icon-quote-right"></i>'},link:{title:"Link",label:'<i class="uk-icon-link"></i>'},image:{title:"Image",label:'<i class="uk-icon-picture-o"></i>'},listUl:{title:"Unordered List",label:'<i class="uk-icon-list-ul"></i>'},listOl:{title:"Ordered List",label:'<i class="uk-icon-list-ol"></i>'}}),i("bold","<strong>$1</strong>"),i("italic","<em>$1</em>"),i("strike","<del>$1</del>"),i("blockquote","<blockquote><p>$1</p></blockquote>","replaceLine"),i("link",'<a href="http://">$1</a>'),i("image",'<img src="http://" alt="$1">');var o=function(){if("html"==t.getCursorMode()){for(var e=t.editor,i=e.getDoc().getCursor(!0),o=e.getDoc().getCursor(!1),r=i.line;r<o.line+1;r++)e.replaceRange("<li>"+e.getLine(r)+"</li>",{line:r,ch:0},{line:r,ch:e.getLine(r).length});e.setCursor({line:o.line,ch:e.getLine(o.line).length}),e.focus()}};t.on("action.listUl",function(){o()}),t.on("action.listOl",function(){o()}),t.htmleditor.on("click",'a[data-htmleditor-button="fullscreen"]',function(){t.htmleditor.toggleClass("uk-htmleditor-fullscreen");var i=t.editor.getWrapperElement();if(t.htmleditor.hasClass("uk-htmleditor-fullscreen"))t.editor.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:i.style.width,height:i.style.height},i.style.width="",i.style.height=t.content.height()+"px",document.documentElement.style.overflow="hidden";else{document.documentElement.style.overflow="";var o=t.editor.state.fullScreenRestore;i.style.width=o.width,i.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop)}setTimeout(function(){t.fit(),e.$win.trigger("resize")},50)}),t.addShortcut(["Ctrl-S","Cmd-S"],function(){t.element.trigger("htmleditor-save",[t])}),t.addShortcutAction("bold",["Ctrl-B","Cmd-B"])}}),e.plugin("htmleditor","markdown",{init:function(e){function i(){e.editor.setOption("mode","gfm"),e.htmleditor.find(".uk-htmleditor-button-code a").html(e.options.lblMarkedview)}function o(t,i,o){e.on("action."+t,function(){"markdown"==e.getCursorMode()&&e["replaceLine"==o?"replaceLine":"replaceSelection"](i)})}var r=e.options.marked||marked;r&&(r.setOptions(e.options.markedOptions),e.options.markdown&&i(),o("bold","**$1**"),o("italic","*$1*"),o("strike","~~$1~~"),o("blockquote","> $1","replaceLine"),o("link","[$1](http://)"),o("image",""),e.on("action.listUl",function(){if("markdown"==e.getCursorMode()){for(var t=e.editor,i=t.getDoc().getCursor(!0),o=t.getDoc().getCursor(!1),r=i.line;r<o.line+1;r++)t.replaceRange("* "+t.getLine(r),{line:r,ch:0},{line:r,ch:t.getLine(r).length});t.setCursor({line:o.line,ch:t.getLine(o.line).length}),t.focus()}}),e.on("action.listOl",function(){if("markdown"==e.getCursorMode()){var t=e.editor,i=t.getDoc().getCursor(!0),o=t.getDoc().getCursor(!1),r=1;if(i.line>0){var n,l=t.getLine(i.line-1);(n=l.match(/^(\d+)\./))&&(r=Number(n[1])+1)}for(var s=i.line;s<o.line+1;s++)t.replaceRange(r+". "+t.getLine(s),{line:s,ch:0},{line:s,ch:t.getLine(s).length}),r++;t.setCursor({line:o.line,ch:t.getLine(o.line).length}),t.focus()}}),e.on("renderLate",function(){"gfm"==e.editor.options.mode&&(e.currentvalue=r(e.currentvalue))}),e.on("cursorMode",function(t,i){if("gfm"==e.editor.options.mode){var o=e.editor.getDoc().getCursor();e.editor.getTokenAt(o).state.base.htmlState||(i.mode="markdown")}}),t.extend(e,{enableMarkdown:function(){i(),this.render()},disableMarkdown:function(){this.editor.setOption("mode","htmlmixed"),this.htmleditor.find(".uk-htmleditor-button-code a").html(this.options.lblCodeview),this.render()}}),e.on({enableMarkdown:function(){e.enableMarkdown()},disableMarkdown:function(){e.disableMarkdown()}}))}}),e.ready(function(i){t("textarea[data-uk-htmleditor]",i).each(function(){var i,o=t(this);o.data("htmleditor")||(i=e.htmleditor(o,e.Utils.options(o.attr("data-uk-htmleditor"))))})}),e.htmleditor}); | hanssens/cdnjs | ajax/libs/uikit/2.12.0/js/components/htmleditor.min.js | JavaScript | mit | 12,190 |
/*! Dust - Asynchronous Templating - v2.3.4
* http://linkedin.github.io/dustjs/
* Copyright (c) 2014 Aleksander Williams; Released under the MIT License */
!function(root){function Context(a,b,c,d){this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",loggingLevels=[DEBUG,INFO,WARN,ERROR,NONE],EMPTY_FUNC=function(){},logger={},originalLog,loggerContext;dust.debugLevel=NONE,dust.silenceErrors=!1,root&&root.console&&root.console.log&&(loggerContext=root.console,originalLog=root.console.log),logger.log=loggerContext?function(){logger.log="function"==typeof originalLog?function(){originalLog.apply(loggerContext,arguments)}:function(){var a=Array.prototype.slice.apply(arguments).join(" ");originalLog(a)},logger.log.apply(this,arguments)}:function(){},dust.log=function(a,b){if(dust.isDebug&&dust.debugLevel===NONE&&(logger.log('[!!!DEPRECATION WARNING!!!]: dust.isDebug is deprecated. Set dust.debugLevel instead to the level of logging you want ["debug","info","warn","error","none"]'),dust.debugLevel=INFO),b=b||INFO,dust.indexInArray(loggingLevels,b)>=dust.indexInArray(loggingLevels,dust.debugLevel)&&(dust.logQueue||(dust.logQueue=[]),dust.logQueue.push({message:a,type:b}),logger.log("[DUST "+b+"]: "+a)),!dust.silenceErrors&&b===ERROR)throw"string"==typeof a?new Error(a):a},dust.onError=function(a,b){if(logger.log("[!!!DEPRECATION WARNING!!!]: dust.onError will no longer return a chunk object."),dust.log(a.message||a,ERROR),dust.silenceErrors)return b;throw a},dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{dust.load(a,d,Context.wrap(b,a)).end()}catch(e){dust.log(e,ERROR)}},dust.stream=function(a,b){var c=new Stream;return dust.nextTick(function(){try{dust.load(a,c.head,Context.wrap(b,a)).end()}catch(d){dust.log(d,ERROR)}}),c},dust.renderSource=function(a,b,c){return dust.compileFn(a)(b,c)},dust.compileFn=function(a,b){b=b||null;var c=dust.loadSource(dust.compile(a,b));return function(a,d){var e=d?new Stub(d):new Stream;return dust.nextTick(function(){"function"==typeof c?c(e.head,Context.wrap(a,b)).end():dust.log(new Error("Template ["+b+"] cannot be resolved to a Dust function"),ERROR)}),e}},dust.load=function(a,b,c){var d=dust.cache[a];return d?d(b,c):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,c).end())})}):b.setError(new Error("Template Not Found: "+a))},dust.loadSource=function(source,path){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.indexInArray=function(a,b,c){if(c=+c||0,Array.prototype.indexOf)return a.indexOf(b,c);if(void 0===a||null===a)throw new TypeError('cannot call method "indexOf" of null');var d=a.length;for(1/0===Math.abs(c)&&(c=0),0>c&&(c+=d,0>c&&(c=0));d>c;c++)if(a[c]===b)return c;return-1},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return dust.isArray(a)&&!a.length?!0:0===a?!1:!a},dust.filter=function(a,b,c){if(c)for(var d=0,e=c.length;e>d;d++){var f=c[d];"s"===f?(b=null,dust.log("Using unescape filter on ["+a+"]",DEBUG)):"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter ["+f+"]",WARN)}return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return JSON?JSON.stringify(a):(dust.log("JSON is undefined. JSON stringify has not been used on ["+a+"]",WARN),a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined. JSON parse has not been used on ["+a+"]",WARN),a)}},dust.makeBase=function(a){return new Context(new Stack,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(new Stack(a),{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g=this.stack,h=1;if(dust.log("Searching for reference [{"+b.join(".")+"}] in template ["+this.getTemplateName()+"]",DEBUG),d=b[0],e=b.length,a&&0===e)f=g,g=g.head;else{if(a)g&&(g=g.head?g.head[d]:void 0);else{for(;g&&(!g.isObject||(f=g.head,c=g.head[d],void 0===c));)g=g.tail;g=void 0!==c?c:this.global?this.global[d]:void 0}for(;g&&e>h;)f=g,g=g[b[h]],h++}if("function"==typeof g){var i=function(){try{return g.apply(f,arguments)}catch(a){return dust.log(a,ERROR)}};return i.isFunction=!0,i}return void 0===g&&dust.log("Cannot find the value for reference [{"+b.join(".")+"}] in template ["+this.getTemplateName()+"]"),g},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return new Context(new Stack(a,this.stack,b,c),this.global,this.blocks,this.getTemplateName())},Context.prototype.rebase=function(a){return new Context(new Stack(a),this.global,this.blocks,this.getTemplateName())},Context.prototype.current=function(){return this.stack.head},Context.prototype.getBlock=function(a){if("function"==typeof a){var b=new Chunk;a=a(b,this).data.join("")}var c=this.blocks;if(!c)return void dust.log("No blocks for context[{"+a+"}] in template ["+this.getTemplateName()+"]",DEBUG);for(var d,e=c.length;e--;)if(d=c[e][a])return d},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Chunk error ["+a.error+"] thrown. Ceasing to render this template.",WARN),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),dust.log("Chunk error ["+a.error+"] thrown. Ceasing to render this template.",WARN),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){if(!this.events)return dust.log("No events to emit",INFO),!1;var c=this.events[a];if(!c)return dust.log("Event type ["+a+"] does not exist",WARN),!1;if("function"==typeof c)c(b);else if(dust.isArray(c))for(var d=c.slice(0),e=0,f=d.length;f>e;e++)d[e](b);else dust.log("Event Handler ["+c+"] is not of a type that is handled by emit",WARN)},Stream.prototype.on=function(a,b){return this.events||(this.events={}),this.events[a]?"function"==typeof this.events[a]?this.events[a]=[this.events[a],b]:this.events[a].push(b):(dust.log("Event type ["+a+"] does not exist. Using just the specified callback.",WARN),b?this.events[a]=b:dust.log("Callback for type ["+a+"] does not exist. Listener not registered.",WARN)),this},Stream.prototype.pipe=function(a){return this.on("data",function(b){try{a.write(b,"utf8")}catch(c){dust.log(c,ERROR)}}).on("end",function(){try{return a.end()}catch(b){dust.log(b,ERROR)}}).on("error",function(b){a.error(b)}),this},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);return this.next=c,this.flushable=!0,a(c),b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a&&(a.isFunction=!0,a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk)?a:dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){if("function"==typeof a&&(a=a.apply(b.current(),[this,b,c,d]),a instanceof Chunk))return a;var e=c.block,f=c["else"];if(d&&(b=b.push(d)),dust.isArray(a)){if(e){var g=a.length,h=this;if(g>0){b.stack.head&&(b.stack.head.$len=g);for(var i=0;g>i;i++)b.stack.head&&(b.stack.head.$idx=i),h=e(h,b.push(a[i],i,g));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),h}if(f)return f(this,b)}}else if(a===!0){if(e)return e(this,b)}else if(a||0===a){if(e)return e(this,b.push(a))}else if(f)return f(this,b);return dust.log("Not rendering section (#) block in template ["+b.getTemplateName()+"], because above key was not found",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else if(d)return d(this,b);return dust.log("Not rendering exists (?) block in template ["+b.getTemplateName()+"], because above key was not found",DEBUG),this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b)}else if(e)return e(this,b);return dust.log("Not rendering not exists (^) block check in template ["+b.getTemplateName()+"], because above key was found",DEBUG),this},Chunk.prototype.block=function(a,b,c){var d=c.block;return a&&(d=a),d?d(this,b):this},Chunk.prototype.partial=function(a,b,c){var d;d=dust.makeBase(b.global),d.blocks=b.blocks,b.stack&&b.stack.tail&&(d.stack=b.stack.tail),c&&(d=d.push(c)),"string"==typeof a&&(d.templateName=a),d=d.push(b.stack.head);var e;return e="function"==typeof a?this.capture(a,d,function(a,b){d.templateName=d.templateName||a,dust.load(a,b,d).end()}):dust.load(a,this,d)},Chunk.prototype.helper=function(a,b,c,d){var e=this;try{return dust.helpers[a]?dust.helpers[a](e,b,c,d):(dust.log("Invalid helper ["+a+"]",WARN),e)}catch(f){return dust.log(f,ERROR),e}},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this},Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=new RegExp(/[&<>\"\']/),AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a?HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a:a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},"object"==typeof exports?module.exports=dust:root.dust=dust}(this); | hasantayyar/cdnjs | ajax/libs/dustjs-linkedin/2.3.4/dust-core.min.js | JavaScript | mit | 11,313 |
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(P)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;kb.nonEnumArgs&&a.length&&h(a)&&(a=mb.call(a));var d=kb.enumPrototypes&&"function"==typeof a,e=kb.enumErrorProps&&(a===eb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(kb.nonEnumShadows&&a!==fb){var g=a.constructor,i=-1,j=ib.length;if(a===(g&&g.prototype))var k=a===stringProto?ab:a===eb?X:bb.call(a),l=jb[k];for(;++i<j;)f=ib[i],l&&l[f]||!cb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?bb.call(a)==T:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=bb.call(a),l=bb.call(b);if(k==T&&(k=$),l==T&&(l=$),k!=l)return!1;switch(k){case V:case W:return+a==+b;case Z:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case _:case ab:return a==String(b)}var m=k==U;if(!m){if(k!=$||!kb.nodeClass&&(g(a)||g(b)))return!1;var n=!kb.argsObject&&h(a)?Object:a.constructor,o=!kb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||cb.call(a,"constructor")&&cb.call(b,"constructor")||N(n)&&n instanceof n&&N(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0;if(result=!0,c.push(a),d.push(b),m){if(p=a.length,q=b.length,result=q==p)for(;q--;){var r=b[q];if(!(result=i(a[q],r,c,d)))break}}else f(b,function(b,e,f){return cb.call(f,e)?(q++,result=cb.call(a,e)&&i(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return cb.call(c,b)?result=--q>-1:void 0});return c.pop(),d.pop(),result}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:mb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(a){return"number"==typeof a&&z.isFinite(a)}function o(b){return b[Q]!==a}function p(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function q(a){var b=+a.length;return isNaN(b)?0:0!==b&&n(b)?(b=p(b)*Math.floor(Math.abs(b)),0>=b?0:b>fc?fc:b):b}function r(a){return"[object Function]"===Object.prototype.toString.call(a)&&"function"==typeof a}function s(a,b){return new pc(function(c){var d=new zb,e=new Ab;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}M(f)&&(f=cc(f)),d=new zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new pc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function u(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?cc(e):e}).concatAll()}function v(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function w(a){this.comparer=a,this.set=[]}function x(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?cc(e):e}).mergeObservable()}var y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},z=y[typeof window]&&window||this,A=y[typeof exports]&&exports&&!exports.nodeType&&exports,B=y[typeof module]&&module&&!module.nodeType&&module,C=B&&B.exports===A&&A,D=y[typeof global]&&global;!D||D.global!==D&&D.window!==D||(z=D);var E={internals:{},config:{Promise:z.Promise},helpers:{}},F=E.helpers.noop=function(){},G=(E.helpers.notDefined=function(a){return"undefined"==typeof a},E.helpers.isScheduler=function(a){return a instanceof E.Scheduler}),H=E.helpers.identity=function(a){return a},I=(E.helpers.pluck=function(a){return function(b){return b[a]}},E.helpers.just=function(a){return function(){return a}},E.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),J=E.helpers.defaultComparer=function(a,b){return lb(a,b)},K=E.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},L=(E.helpers.defaultKeySerializer=function(a){return a.toString()},E.helpers.defaultError=function(a){throw a}),M=E.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},N=(E.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},E.helpers.not=function(a){return!a},E.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==bb.call(a)}),a}()),O="Argument out of range",P="Object has been disposed",Q="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";z.Set&&"function"==typeof(new z.Set)["@@iterator"]&&(Q="@@iterator");var R=E.doneEnumerator={done:!0,value:a};E.iterator=Q;var S,T="[object Arguments]",U="[object Array]",V="[object Boolean]",W="[object Date]",X="[object Error]",Y="[object Function]",Z="[object Number]",$="[object Object]",_="[object RegExp]",ab="[object String]",bb=Object.prototype.toString,cb=Object.prototype.hasOwnProperty,db=bb.call(arguments)==T,eb=Error.prototype,fb=Object.prototype,gb=fb.propertyIsEnumerable;try{S=!(bb.call(document)==$&&!({toString:0}+""))}catch(hb){S=!0}var ib=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jb={};jb[U]=jb[W]=jb[Z]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},jb[V]=jb[ab]={constructor:!0,toString:!0,valueOf:!0},jb[X]=jb[Y]=jb[_]={constructor:!0,toString:!0},jb[$]={constructor:!0};var kb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);kb.enumErrorProps=gb.call(eb,"message")||gb.call(eb,"name"),kb.enumPrototypes=gb.call(a,"prototype"),kb.nonEnumArgs=0!=c,kb.nonEnumShadows=!/valueOf/.test(b)}(1),db||(h=function(a){return a&&"object"==typeof a?cb.call(a,"callee"):!1});var lb=E.internals.isEqual=function(a,b){return i(a,b,[],[])},mb=Array.prototype.slice,nb=({}.hasOwnProperty,this.inherits=E.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),ob=E.internals.addProperties=function(a){for(var b=mb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},pb=E.internals.addRef=function(a,b){return new pc(function(c){return new ub(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=mb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(mb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(mb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var qb=Object("a"),rb="a"!=qb[0]||!(0 in qb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=rb&&{}.toString.call(this)==ab?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Y)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=rb&&{}.toString.call(this)==ab?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Y)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==U}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var sb=E.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},tb=sb.prototype;tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},tb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},tb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},tb.peek=function(){return this.items[0].value},tb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},tb.enqueue=function(a){var b=this.length++;this.items[b]=new l(sb.count++,a),this.percolate(b)},tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},sb.count=0;var ub=E.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},vb=ub.prototype;vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},vb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},vb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},vb.toArray=function(){return this.disposables.slice(0)};var wb=E.Disposable=function(a){this.isDisposed=!1,this.action=a||F};wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var xb=wb.create=function(a){return new wb(a)},yb=wb.empty={dispose:F},zb=E.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Ab=E.SerialDisposable=zb,Bb=E.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?yb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Cb=E.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||K,this.disposable=new zb};Cb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Cb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Cb.prototype.isCancelled=function(){return this.disposable.isDisposed},Cb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Db=E.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),yb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=I,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Eb=Db.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),yb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Db.prototype),function(){Db.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Db.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof z.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=z.setInterval(function(){d=c(d)},b);return xb(function(){z.clearInterval(e)})}}(Db.prototype),function(a){a.catchError=a["catch"]=function(a){return new Mb(this,a)}}(Db.prototype);var Fb,Gb=(E.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Db.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Eb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Db(I,a,b,c)}()),Hb=Db.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Db.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Db.normalize(c),g=new Cb(this,b,d,f);if(e)e.enqueue(g);else{e=new sb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Db(I,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ib=F,Jb=function(){var a,b=F;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!z.setTimeout)throw new Error("No concurrency detected!");a=z.setTimeout,b=z.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Kb=Jb.setTimeout,Lb=Jb.clearTimeout;!function(){function a(){if(!z.postMessage||z.importScripts)return!1;var a=!1,b=z.onmessage;return z.onmessage=function(){a=!0},z.postMessage("","*"),z.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(bb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=D&&C&&D.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=D&&C&&D.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Fb=process.nextTick;else if("function"==typeof d)Fb=d,Ib=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;z.addEventListener?z.addEventListener("message",b,!1):z.attachEvent("onmessage",b,!1),Fb=function(a){var b=h++;g[b]=a,z.postMessage(f+b,"*")}}else if(z.MessageChannel){var i=new z.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Fb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in z&&"onreadystatechange"in z.document.createElement("script")?Fb=function(a){var b=z.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},z.document.documentElement.appendChild(b)}:(Fb=function(a){return Kb(a,0)},Ib=Lb)}();var Mb=(Db.timeout=function(){function a(a,b){var c=this,d=new zb,e=Fb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ub(d,xb(function(){Ib(e)}))}function b(a,b,c){var d=this,e=Db.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new zb,g=Kb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ub(f,xb(function(){Lb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Db(I,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return nb(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return yb}}},f.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new zb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},f}(Db)),Nb=E.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return G(a)||(a=Gb),new pc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ob=Nb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Nb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Pb=Nb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Nb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Qb=Nb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Nb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Rb=E.internals.Enumerator=function(a){this._next=a};Rb.prototype.next=function(){return this._next()},Rb.prototype[Q]=function(){return this};var Sb=E.internals.Enumerable=function(a){this._iterator=a};Sb.prototype[Q]=function(){return this._iterator()},Sb.prototype.concat=function(){var a=this;return new pc(function(b){var c;try{c=a[Q]()}catch(d){return void b.onError()}var e,f=new Ab,g=Gb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;M(h)&&(h=cc(h));var i=new zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new ub(f,g,xb(function(){e=!0}))})},Sb.prototype.catchException=function(){var a=this;return new pc(function(b){var c;try{c=a[Q]()}catch(d){return void b.onError()}var e,f,g=new Ab,h=Gb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;M(i)&&(i=cc(i));var j=new zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new ub(g,h,xb(function(){e=!0}))})};var Tb=Sb.repeat=function(a,b){return null==b&&(b=-1),new Sb(function(){var c=b;return new Rb(function(){return 0===c?R:(c>0&&c--,{done:!1,value:a})})})},Ub=Sb.of=function(a,b,c){return b||(b=H),new Sb(function(){var d=-1;return new Rb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:R})})},Vb=E.Observer=function(){};Vb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Vb.prototype.asObserver=function(){return new Zb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Vb.prototype.checked=function(){return new $b(this)};var Wb=Vb.create=function(a,b,c){return a||(a=F),b||(b=L),c||(c=F),new Zb(a,b,c)};Vb.fromNotifier=function(a,b){return new Zb(function(c){return a.call(b,Ob(c))},function(c){return a.call(b,Pb(c))},function(){return a.call(b,Qb())})},Vb.notifyOn=function(a){return new ac(a,this)};var Xb,Yb=E.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return nb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Vb),Zb=E.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return nb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Yb),$b=function(a){function b(b){a.call(this),this._observer=b,this._state=0}nb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Vb),_b=E.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ab}return nb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Yb),ac=function(a){function b(){a.apply(this,arguments)}return nb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(_b),bc=E.Observable=function(){function a(a){this._subscribe=a}return Xb=a.prototype,Xb.subscribe=Xb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Wb(a,b,c))},Xb.subscribeOnNext=function(a,b){return this._subscribe(Wb(2===arguments.length?function(c){a.call(b,c)}:a))},Xb.subscribeOnError=function(a,b){return this._subscribe(Wb(null,2===arguments.length?function(c){a.call(b,c)}:a))},Xb.subscribeOnCompleted=function(a,b){return this._subscribe(Wb(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();Xb.observeOn=function(a){var b=this;return new pc(function(c){return b.subscribe(new ac(a,c))})},Xb.subscribeOn=function(a){var b=this;return new pc(function(c){var d=new zb,e=new Ab;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var cc=bc.fromPromise=function(a){return dc(function(){var b=new E.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};Xb.toPromise=function(a){if(a||(a=E.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},Xb.toArray=function(){var a=this;return new pc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},bc.create=bc.createWithDisposable=function(a){return new pc(a)};var dc=bc.defer=function(a){return new pc(function(b){var c;try{c=a()}catch(d){return jc(d).subscribe(b)}return M(c)&&(c=cc(c)),c.subscribe(b)})},ec=bc.empty=function(a){return G(a)||(a=Gb),new pc(function(b){return a.schedule(function(){b.onCompleted()})})},fc=Math.pow(2,53)-1;bc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!r(b))throw new Error("mapFn when provided must be a function");return G(d)||(d=Hb),new pc(function(e){var f=Object(a),g=o(f),h=g?0:q(f),i=g?f[Q]():null,j=0;return d.scheduleRecursive(function(a){if(h>j||g){var d;if(g){var k=i.next();if(k.done)return void e.onCompleted();d=k.value}else d=f[j];if(b&&r(b))try{d=c?b.call(c,d,j):b(d,j)}catch(l){return void e.onError(l)}e.onNext(d),j++,a()}else e.onCompleted()})})};var gc=bc.fromArray=function(a,b){return G(b)||(b=Hb),new pc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};bc.generate=function(a,b,c,d,e){return G(e)||(e=Hb),new pc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var hc=bc.never=function(){return new pc(function(){return yb})};bc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return gc(b)};bc.ofWithScheduler=function(a){for(var b=arguments.length-1,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d+1];return gc(c,a)};bc.range=function(a,b,c){return G(c)||(c=Hb),new pc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},bc.repeat=function(a,b,c){return G(c)||(c=Hb),ic(a,c).repeat(null==b?-1:b)};var ic=bc["return"]=bc.returnValue=bc.just=function(a,b){return G(b)||(b=Gb),new pc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},jc=bc["throw"]=bc.throwException=bc.throwError=function(a,b){return G(b)||(b=Gb),new pc(function(c){return b.schedule(function(){c.onError(a)})})};bc.using=function(a,b){return new pc(function(c){var d,e,f=yb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new ub(jc(g).subscribe(c),f)}return new ub(e.subscribe(c),f)})},Xb.amb=function(a){var b=this;return new pc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new zb,j=new zb;return M(a)&&(a=cc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new ub(i,j)})},bc.amb=function(){function a(a,b){return a.amb(b)}for(var b=hc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Xb["catch"]=Xb.catchError=Xb.catchException=function(a){return"function"==typeof a?s(this,a):kc([this,a])};var kc=bc.catchException=bc.catchError=bc["catch"]=function(){return Ub(j(arguments,0)).catchException()};Xb.combineLatest=function(){var a=mb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),lc.apply(this,a)};var lc=bc.combineLatest=function(){var a=mb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new pc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(H))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(H)&&c.onCompleted()}function e(a){j[a]=!0,j.every(H)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new zb;M(f)&&(f=cc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new ub(m)})};Xb.concat=function(){var a=mb.call(arguments,0);return a.unshift(this),mc.apply(this,a)};var mc=bc.concat=function(){return Ub(j(arguments,0)).concat()};Xb.concatObservable=Xb.concatAll=function(){return this.merge(1)},Xb.merge=function(a){if("number"!=typeof a)return nc(this,a);var b=this;return new pc(function(c){function d(a){var b=new zb;f.add(b),M(a)&&(a=cc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new ub,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var nc=bc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=mb.call(arguments,1)):(a=Gb,b=mb.call(arguments,0)):(a=Gb,b=mb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),gc(b,a).mergeObservable()};Xb.mergeObservable=Xb.mergeAll=function(){var a=this;return new pc(function(b){var c=new ub,d=!1,e=new zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new zb;c.add(e),M(a)&&(a=cc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},Xb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return oc([this,a])};var oc=bc.onErrorResumeNext=function(){var a=j(arguments,0);return new pc(function(b){var c=0,d=new Ab,e=Gb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],M(f)&&(f=cc(f)),g=new zb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()
});return new ub(d,e)})};Xb.skipUntil=function(a){var b=this;return new pc(function(c){var d=!1,e=new ub(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));M(a)&&(a=cc(a));var f=new zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Xb["switch"]=Xb.switchLatest=function(){var a=this;return new pc(function(b){var c=!1,d=new Ab,e=!1,f=0,g=a.subscribe(function(a){var g=new zb,h=++f;c=!0,d.setDisposable(g),M(a)&&(a=cc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new ub(g,d)})},Xb.takeUntil=function(a){var b=this;return new pc(function(c){return M(a)&&(a=cc(a)),new ub(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),F))})},Xb.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=mb.call(arguments),c=b.pop();return b.unshift(a),new pc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(H)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new zb;M(c)&&(c=cc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new ub(j)})},bc.zip=function(){var a=mb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},bc.zipArray=function(){var a=j(arguments,0);return new pc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(H))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(H)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new zb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new ub(h);return j.add(xb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Xb.asObservable=function(){return new pc(this.subscribe.bind(this))},Xb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Xb.dematerialize=function(){var a=this;return new pc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Xb.distinctUntilChanged=function(a,b){var c=this;return a||(a=H),b||(b=J),new pc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Xb["do"]=Xb.doAction=Xb.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new pc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},Xb.doOnNext=Xb.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},Xb.doOnError=Xb.tapOnError=function(a,b){return this.tap(F,2===arguments.length?function(c){a.call(b,c)}:a)},Xb.doOnCompleted=Xb.tapOnCompleted=function(a,b){return this.tap(F,null,2===arguments.length?function(){a.call(b)}:a)},Xb["finally"]=Xb.finallyAction=function(a){var b=this;return new pc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Xb.ignoreElements=function(){var a=this;return new pc(function(b){return a.subscribe(F,b.onError.bind(b),b.onCompleted.bind(b))})},Xb.materialize=function(){var a=this;return new pc(function(b){return a.subscribe(function(a){b.onNext(Ob(a))},function(a){b.onNext(Pb(a)),b.onCompleted()},function(){b.onNext(Qb()),b.onCompleted()})})},Xb.repeat=function(a){return Tb(this,a).concat()},Xb.retry=function(a){return Tb(this,a).catchException()},Xb.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new pc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Xb.skipLast=function(a){var b=this;return new pc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Xb.startWith=function(){var a,b,c=0;return arguments.length&&G(arguments[0])?(b=arguments[0],c=1):b=Gb,a=mb.call(arguments,c),Ub([gc(a,b),this]).concat()},Xb.takeLast=function(a){var b=this;return new pc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},Xb.takeLastBuffer=function(a){var b=this;return new pc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Xb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(O);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(O);return new pc(function(d){function e(){var a=new sc;i.push(a),d.onNext(pb(a,g))}var f=new zb,g=new Bb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},Xb.selectConcat=Xb.concatMap=function(a,b,c){return b?this.concatMap(function(c,d){var e=a(c,d),f=M(e)?cc(e):e;return f.map(function(a){return b(c,a,d)})}):"function"==typeof a?u(this,a,c):u(this,function(){return a})},Xb.concatMapObserver=Xb.selectConcatObserver=function(a,b,c,d){var e=this;return new pc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=cc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},Xb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new pc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},w.prototype.push=function(a){var b=-1===v(this.set,a,this.comparer);return b&&this.set.push(a),b},Xb.distinct=function(a,b){var c=this;return b||(b=J),new pc(function(d){var e=new w(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.select=Xb.map=function(a,b){var c=this;return new pc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.pluck=function(a){return this.map(function(b){return b[a]})},Xb.selectMany=Xb.flatMap=function(a,b,c){return b?this.flatMap(function(c,d){var e=a(c,d),f=M(e)?cc(e):e;return f.map(function(a){return b(c,a,d)})},c):"function"==typeof a?x(this,a,c):x(this,function(){return a})},Xb.flatMapObserver=Xb.selectManyObserver=function(a,b,c,d){var e=this;return new pc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=cc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},Xb.selectSwitch=Xb.flatMapLatest=Xb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Xb.skip=function(a){if(0>a)throw new Error(O);var b=this;return new pc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Xb.skipWhile=function(a,b){var c=this;return new pc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.take=function(a,b){if(0>a)throw new RangeError(O);if(0===a)return ec(b);var c=this;return new pc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Xb.takeWhile=function(a,b){var c=this;return new pc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.where=Xb.filter=function(a,b){var c=this;return new pc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.exclusive=function(){var a=this;return new pc(function(b){var c=!1,d=!1,e=new zb,f=new ub;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,M(a)&&(a=cc(a));var e=new zb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f})},Xb.exclusiveMap=function(a,b){var c=this;return new pc(function(d){var e=0,f=!1,g=!0,h=new zb,i=new ub;return i.add(h),h.setDisposable(c.subscribe(function(c){f||(f=!0,innerSubscription=new zb,i.add(innerSubscription),M(c)&&(c=cc(c)),innerSubscription.setDisposable(c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),function(){i.remove(innerSubscription),f=!1,g&&1===i.length&&d.onCompleted()})))},d.onError.bind(d),function(){g=!0,1!==i.length||f||d.onCompleted()})),i})};var pc=E.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?xb(a):yb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new qc(a);return Hb.scheduleRequired()?Hb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return nb(c,a),c}(bc),qc=function(a){function b(b){a.call(this),this.observer=b,this.m=new zb}nb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Yb),rc=function(a,b){this.subject=a,this.observer=b};rc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var sc=E.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),yb):(a.onCompleted(),yb):(this.observers.push(a),new rc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return nb(d,a),ob(d.prototype,Vb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new tc(a,b)},d}(bc),tc=(E.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new rc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),yb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return nb(d,a),ob(d.prototype,Vb,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(bc),E.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return nb(b,a),ob(b.prototype,Vb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(bc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(z.Rx=E,define(function(){return E})):A&&B?C?(B.exports=E).Rx=E:A.Rx=E:z.Rx=E}).call(this);
//# sourceMappingURL=rx.compat.map | cedricbousmanne/jsdelivr | files/rxjs/2.3.13/rx.compat.min.js | JavaScript | mit | 46,736 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Core\Exception;
/**
* UsernameNotFoundException is thrown if a User cannot be found by its username.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Alexander <iam.asm89@gmail.com>
*/
class UsernameNotFoundException extends AuthenticationException
{
private $username;
/**
* {@inheritDoc}
*/
public function getMessageKey()
{
return 'Username could not be found.';
}
/**
* Get the username.
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* Set the username.
*
* @param string $username
*/
public function setUsername($username)
{
$this->username = $username;
}
/**
* {@inheritDoc}
*/
public function serialize()
{
return serialize(array(
$this->username,
parent::serialize(),
));
}
/**
* {@inheritDoc}
*/
public function unserialize($str)
{
list($this->username, $parentData) = unserialize($str);
parent::unserialize($parentData);
}
}
| Isto/sf2.3-base | vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/UsernameNotFoundException.php | PHP | mit | 1,405 |
/*
Name: Base16 Default Dark
Author: Chris Kempson (http://chriskempson.com)
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
*/
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;}
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }
.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}
.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}
.cm-s-base16-dark span.cm-comment {color: #8f5536;}
.cm-s-base16-dark span.cm-atom {color: #aa759f;}
.cm-s-base16-dark span.cm-number {color: #aa759f;}
.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;}
.cm-s-base16-dark span.cm-keyword {color: #ac4142;}
.cm-s-base16-dark span.cm-string {color: #f4bf75;}
.cm-s-base16-dark span.cm-variable {color: #90a959;}
.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;}
.cm-s-base16-dark span.cm-def {color: #d28445;}
.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;}
.cm-s-base16-dark span.cm-tag {color: #ac4142;}
.cm-s-base16-dark span.cm-link {color: #aa759f;}
.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}
.cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;}
.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
| LSleutsky/cdnjs | ajax/libs/codemirror/4.8.0/theme/base16-dark.css | CSS | mit | 1,696 |
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license Highmaps JS v1.0.3 (2014-07-03)
*
* (c) 2009-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
// JSLint options:
/*global Highcharts, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console, each, grep */
/*jslint ass: true, sloppy: true, forin: true, plusplus: true, nomen: true, vars: true, regexp: true, newcap: true, browser: true, continue: true, white: true */
(function () {
// encapsulated variables
var UNDEFINED,
doc = document,
win = window,
math = Math,
mathRound = math.round,
mathFloor = math.floor,
mathCeil = math.ceil,
mathMax = math.max,
mathMin = math.min,
mathAbs = math.abs,
mathCos = math.cos,
mathSin = math.sin,
mathPI = math.PI,
deg2rad = mathPI * 2 / 360,
// some variables
userAgent = navigator.userAgent,
isOpera = win.opera,
isIE = /msie/i.test(userAgent) && !isOpera,
docMode8 = doc.documentMode === 8,
isWebKit = /AppleWebKit/.test(userAgent),
isFirefox = /Firefox/.test(userAgent),
isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent),
SVG_NS = 'http://www.w3.org/2000/svg',
hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,
hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38
useCanVG = !hasSVG && !isIE && !!doc.createElement('canvas').getContext,
Renderer,
hasTouch,
symbolSizes = {},
idCounter = 0,
garbageBin,
defaultOptions,
dateFormat, // function
globalAnimation,
pathAnim,
timeUnits,
error,
noop = function () { return UNDEFINED; },
charts = [],
chartCount = 0,
PRODUCT = 'Highmaps',
VERSION = '1.0.3',
// some constants for frequently used strings
DIV = 'div',
ABSOLUTE = 'absolute',
RELATIVE = 'relative',
HIDDEN = 'hidden',
PREFIX = 'highcharts-',
VISIBLE = 'visible',
PX = 'px',
NONE = 'none',
M = 'M',
L = 'L',
numRegex = /^[0-9]+$/,
NORMAL_STATE = '',
HOVER_STATE = 'hover',
SELECT_STATE = 'select',
// Object for extending Axis
AxisPlotLineOrBandExtension,
// constants for attributes
STROKE_WIDTH = 'stroke-width',
// time methods, changed based on whether or not UTC is used
makeTime,
timezoneOffset,
getMinutes,
getHours,
getDay,
getDate,
getMonth,
getFullYear,
setMinutes,
setHours,
setDate,
setMonth,
setFullYear,
// lookup over the types and the associated classes
seriesTypes = {},
Highcharts;
// The Highcharts namespace
if (win.Highcharts) {
error(16, true);
} else {
Highcharts = win.Highcharts = {};
}
/**
* Extend an object with the members of another
* @param {Object} a The object to be extended
* @param {Object} b The object to add to the first one
*/
function extend(a, b) {
var n;
if (!a) {
a = {};
}
for (n in b) {
a[n] = b[n];
}
return a;
}
/**
* Deep merge two or more objects and return a third object. If the first argument is
* true, the contents of the second object is copied into the first object.
* Previously this function redirected to jQuery.extend(true), but this had two limitations.
* First, it deep merged arrays, which lead to workarounds in Highcharts. Second,
* it copied properties from extended prototypes.
*/
function merge() {
var i,
args = arguments,
len,
ret = {},
doCopy = function (copy, original) {
var value, key;
// An object is replacing a primitive
if (typeof copy !== 'object') {
copy = {};
}
for (key in original) {
if (original.hasOwnProperty(key)) {
value = original[key];
// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'
&& key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);
// Primitives and arrays are copied over directly
} else {
copy[key] = original[key];
}
}
}
return copy;
};
// If first argument is true, copy into the existing object. Used in setOptions.
if (args[0] === true) {
ret = args[1];
args = Array.prototype.slice.call(args, 2);
}
// For each argument, extend the return
len = args.length;
for (i = 0; i < len; i++) {
ret = doCopy(ret, args[i]);
}
return ret;
}
/**
* Shortcut for parseInt
* @param {Object} s
* @param {Number} mag Magnitude
*/
function pInt(s, mag) {
return parseInt(s, mag || 10);
}
/**
* Check for string
* @param {Object} s
*/
function isString(s) {
return typeof s === 'string';
}
/**
* Check for object
* @param {Object} obj
*/
function isObject(obj) {
return obj && typeof obj === 'object';
}
/**
* Check for array
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}
/**
* Check for number
* @param {Object} n
*/
function isNumber(n) {
return typeof n === 'number';
}
function log2lin(num) {
return math.log(num) / math.LN10;
}
function lin2log(num) {
return math.pow(10, num);
}
/**
* Remove last occurence of an item from an array
* @param {Array} arr
* @param {Mixed} item
*/
function erase(arr, item) {
var i = arr.length;
while (i--) {
if (arr[i] === item) {
arr.splice(i, 1);
break;
}
}
//return arr;
}
/**
* Returns true if the object is not null or undefined. Like MooTools' $.defined.
* @param {Object} obj
*/
function defined(obj) {
return obj !== UNDEFINED && obj !== null;
}
/**
* Set or get an attribute or an object of attributes. Can't use jQuery attr because
* it attempts to set expando properties on the SVG element, which is not allowed.
*
* @param {Object} elem The DOM element to receive the attribute(s)
* @param {String|Object} prop The property or an abject of key-value pairs
* @param {String} value The value if a single property is set
*/
function attr(elem, prop, value) {
var key,
ret;
// if the prop is a string
if (isString(prop)) {
// set the value
if (defined(value)) {
elem.setAttribute(prop, value);
// get the value
} else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...
ret = elem.getAttribute(prop);
}
// else if prop is defined, it is a hash of key/value pairs
} else if (defined(prop) && isObject(prop)) {
for (key in prop) {
elem.setAttribute(key, prop[key]);
}
}
return ret;
}
/**
* Check if an element is an array, and if not, make it into an array. Like
* MooTools' $.splat.
*/
function splat(obj) {
return isArray(obj) ? obj : [obj];
}
/**
* Return the first value that is defined. Like MooTools' $.pick.
*/
function pick() {
var args = arguments,
i,
arg,
length = args.length;
for (i = 0; i < length; i++) {
arg = args[i];
if (arg !== UNDEFINED && arg !== null) {
return arg;
}
}
}
/**
* Set CSS on a given element
* @param {Object} el
* @param {Object} styles Style object with camel case property names
*/
function css(el, styles) {
if (isIE && !hasSVG) { // #2686
if (styles && styles.opacity !== UNDEFINED) {
styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
}
}
extend(el.style, styles);
}
/**
* Utility function to create element with attributes and styles
* @param {Object} tag
* @param {Object} attribs
* @param {Object} styles
* @param {Object} parent
* @param {Object} nopad
*/
function createElement(tag, attribs, styles, parent, nopad) {
var el = doc.createElement(tag);
if (attribs) {
extend(el, attribs);
}
if (nopad) {
css(el, {padding: 0, border: NONE, margin: 0});
}
if (styles) {
css(el, styles);
}
if (parent) {
parent.appendChild(el);
}
return el;
}
/**
* Extend a prototyped class by new members
* @param {Object} parent
* @param {Object} members
*/
function extendClass(parent, members) {
var object = function () { return UNDEFINED; };
object.prototype = new parent();
extend(object.prototype, members);
return object;
}
/**
* Format a number and return a string based on input settings
* @param {Number} number The input number to format
* @param {Number} decimals The amount of decimals
* @param {String} decPoint The decimal point, defaults to the one given in the lang options
* @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options
*/
function numberFormat(number, decimals, decPoint, thousandsSep) {
var lang = defaultOptions.lang,
// http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
n = +number || 0,
c = decimals === -1 ?
(n.toString().split('.')[1] || '').length : // preserve decimals
(isNaN(decimals = mathAbs(decimals)) ? 2 : decimals),
d = decPoint === undefined ? lang.decimalPoint : decPoint,
t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,
s = n < 0 ? "-" : "",
i = String(pInt(n = mathAbs(n).toFixed(c))),
j = i.length > 3 ? i.length % 3 : 0;
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) +
(c ? d + mathAbs(n - i).toFixed(c).slice(2) : "");
}
/**
* Pad a string to a given length by adding 0 to the beginning
* @param {Number} number
* @param {Number} length
*/
function pad(number, length) {
// Create an array of the remaining length +1 and join it with 0's
return new Array((length || 2) + 1 - String(number).length).join(0) + number;
}
/**
* Wrap a method with extended functionality, preserving the original function
* @param {Object} obj The context object that the method belongs to
* @param {String} method The name of the method to extend
* @param {Function} func A wrapper function callback. This function is called with the same arguments
* as the original function, except that the original function is unshifted and passed as the first
* argument.
*/
function wrap(obj, method, func) {
var proceed = obj[method];
obj[method] = function () {
var args = Array.prototype.slice.call(arguments);
args.unshift(proceed);
return func.apply(this, args);
};
}
/**
* Based on http://www.php.net/manual/en/function.strftime.php
* @param {String} format
* @param {Number} timestamp
* @param {Boolean} capitalize
*/
dateFormat = function (format, timestamp, capitalize) {
if (!defined(timestamp) || isNaN(timestamp)) {
return 'Invalid date';
}
format = pick(format, '%Y-%m-%d %H:%M:%S');
var date = new Date(timestamp - timezoneOffset),
key, // used in for constuct below
// get the basic time values
hours = date[getHours](),
day = date[getDay](),
dayOfMonth = date[getDate](),
month = date[getMonth](),
fullYear = date[getFullYear](),
lang = defaultOptions.lang,
langWeekdays = lang.weekdays,
// List all format keys. Custom formats can be added from the outside.
replacements = extend({
// Day
'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
'A': langWeekdays[day], // Long weekday, like 'Monday'
'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
'e': dayOfMonth, // Day of the month, 1 through 31
// Week (none implemented)
//'W': weekNumber(),
// Month
'b': lang.shortMonths[month], // Short month, like 'Jan'
'B': lang.months[month], // Long month, like 'January'
'm': pad(month + 1), // Two digit month number, 01 through 12
// Year
'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
'Y': fullYear, // Four digits year, like 2009
// Time
'H': pad(hours), // Two digits hours in 24h format, 00 through 23
'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59
'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)
}, Highcharts.dateFormats);
// do the replaces
for (key in replacements) {
while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster
format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]);
}
}
// Optionally capitalize the string and return
return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;
};
/**
* Format a single variable. Similar to sprintf, without the % prefix.
*/
function formatSingle(format, val) {
var floatRegex = /f$/,
decRegex = /\.([0-9])/,
lang = defaultOptions.lang,
decimals;
if (floatRegex.test(format)) { // float
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
val = numberFormat(
val,
decimals,
lang.decimalPoint,
format.indexOf(',') > -1 ? lang.thousandsSep : ''
);
}
} else {
val = dateFormat(format, val);
}
return val;
}
/**
* Format a string according to a subset of the rules of Python's String.format method.
*/
function format(str, ctx) {
var splitter = '{',
isInside = false,
segment,
valueAndFormat,
path,
i,
len,
ret = [],
val,
index;
while ((index = str.indexOf(splitter)) !== -1) {
segment = str.slice(0, index);
if (isInside) { // we're on the closing bracket looking back
valueAndFormat = segment.split(':');
path = valueAndFormat.shift().split('.'); // get first and leave format
len = path.length;
val = ctx;
// Assign deeper paths
for (i = 0; i < len; i++) {
val = val[path[i]];
}
// Format the replacement
if (valueAndFormat.length) {
val = formatSingle(valueAndFormat.join(':'), val);
}
// Push the result and advance the cursor
ret.push(val);
} else {
ret.push(segment);
}
str = str.slice(index + 1); // the rest
isInside = !isInside; // toggle
splitter = isInside ? '}' : '{'; // now look for next matching bracket
}
ret.push(str);
return ret.join('');
}
/**
* Get the magnitude of a number
*/
function getMagnitude(num) {
return math.pow(10, mathFloor(math.log(num) / math.LN10));
}
/**
* Take an interval and normalize it to multiples of 1, 2, 2.5 and 5
* @param {Number} interval
* @param {Array} multiples
* @param {Number} magnitude
* @param {Object} options
*/
function normalizeTickInterval(interval, multiples, magnitude, options) {
var normalized, i;
// round to a tenfold of 1, 2, 2.5 or 5
magnitude = pick(magnitude, 1);
normalized = interval / magnitude;
// multiples for a linear scale
if (!multiples) {
multiples = [1, 2, 2.5, 5, 10];
// the allowDecimals option
if (options && options.allowDecimals === false) {
if (magnitude === 1) {
multiples = [1, 2, 5, 10];
} else if (magnitude <= 0.1) {
multiples = [1 / magnitude];
}
}
}
// normalize the interval to the nearest multiple
for (i = 0; i < multiples.length; i++) {
interval = multiples[i];
if (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2) {
break;
}
}
// multiply back to the correct magnitude
interval *= magnitude;
return interval;
}
/**
* Utility method that sorts an object array and keeping the order of equal items.
* ECMA script standard does not specify the behaviour when items are equal.
*/
function stableSort(arr, sortFunction) {
var length = arr.length,
sortValue,
i;
// Add index to each item
for (i = 0; i < length; i++) {
arr[i].ss_i = i; // stable sort index
}
arr.sort(function (a, b) {
sortValue = sortFunction(a, b);
return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
});
// Remove index from items
for (i = 0; i < length; i++) {
delete arr[i].ss_i; // stable sort index
}
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMin(data) {
var i = data.length,
min = data[0];
while (i--) {
if (data[i] < min) {
min = data[i];
}
}
return min;
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMax(data) {
var i = data.length,
max = data[0];
while (i--) {
if (data[i] > max) {
max = data[i];
}
}
return max;
}
/**
* Utility method that destroys any SVGElement or VMLElement that are properties on the given object.
* It loops all properties and invokes destroy if there is a destroy method. The property is
* then delete'ed.
* @param {Object} The object to destroy properties on
* @param {Object} Exception, do not destroy this property, only delete it.
*/
function destroyObjectProperties(obj, except) {
var n;
for (n in obj) {
// If the object is non-null and destroy is defined
if (obj[n] && obj[n] !== except && obj[n].destroy) {
// Invoke the destroy
obj[n].destroy();
}
// Delete the property from the object.
delete obj[n];
}
}
/**
* Discard an element by moving it to the bin and delete
* @param {Object} The HTML node to discard
*/
function discardElement(element) {
// create a garbage bin element, not part of the DOM
if (!garbageBin) {
garbageBin = createElement(DIV);
}
// move the node and empty bin
if (element) {
garbageBin.appendChild(element);
}
garbageBin.innerHTML = '';
}
/**
* Provide error messages for debugging, with links to online explanation
*/
error = function (code, stop) {
var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;
if (stop) {
throw msg;
}
// else ...
if (win.console) {
console.log(msg);
}
};
/**
* Fix JS round off float errors
* @param {Number} num
*/
function correctFloat(num) {
return parseFloat(
num.toPrecision(14)
);
}
/**
* Set the global animation to either a given value, or fall back to the
* given chart's animation option
* @param {Object} animation
* @param {Object} chart
*/
function setAnimation(animation, chart) {
globalAnimation = pick(animation, chart.animation);
}
/**
* The time unit lookup
*/
timeUnits = {
millisecond: 1,
second: 1000,
minute: 60000,
hour: 3600000,
day: 24 * 3600000,
week: 7 * 24 * 3600000,
month: 31 * 24 * 3600000,
year: 31556952000
};
/**
* Path interpolation algorithm used across adapters
*/
pathAnim = {
/**
* Prepare start and end values so that the path can be animated one to one
*/
init: function (elem, fromD, toD) {
fromD = fromD || '';
var shift = elem.shift,
bezier = fromD.indexOf('C') > -1,
numParams = bezier ? 7 : 3,
endLength,
slice,
i,
start = fromD.split(' '),
end = [].concat(toD), // copy
startBaseLine,
endBaseLine,
sixify = function (arr) { // in splines make move points have six parameters like bezier curves
i = arr.length;
while (i--) {
if (arr[i] === M) {
arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
}
}
};
if (bezier) {
sixify(start);
sixify(end);
}
// pull out the base lines before padding
if (elem.isArea) {
startBaseLine = start.splice(start.length - 6, 6);
endBaseLine = end.splice(end.length - 6, 6);
}
// if shifting points, prepend a dummy point to the end path
if (shift <= end.length / numParams && start.length === end.length) {
while (shift--) {
end = [].concat(end).splice(0, numParams).concat(end);
}
}
elem.shift = 0; // reset for following animations
// copy and append last point until the length matches the end length
if (start.length) {
endLength = end.length;
while (start.length < endLength) {
//bezier && sixify(start);
slice = [].concat(start).splice(start.length - numParams, numParams);
if (bezier) { // disable first control point
slice[numParams - 6] = slice[numParams - 2];
slice[numParams - 5] = slice[numParams - 1];
}
start = start.concat(slice);
}
}
if (startBaseLine) { // append the base lines for areas
start = start.concat(startBaseLine);
end = end.concat(endBaseLine);
}
return [start, end];
},
/**
* Interpolate each value of the path and return the array
*/
step: function (start, end, pos, complete) {
var ret = [],
i = start.length,
startVal;
if (pos === 1) { // land on the final path without adjustment points appended in the ends
ret = complete;
} else if (i === end.length && pos < 1) {
while (i--) {
startVal = parseFloat(start[i]);
ret[i] =
isNaN(startVal) ? // a letter instruction like M or L
start[i] :
pos * (parseFloat(end[i] - startVal)) + startVal;
}
} else { // if animation is finished or length not matching, land on right value
ret = end;
}
return ret;
}
};
(function ($) {
/**
* The default HighchartsAdapter for jQuery
*/
win.HighchartsAdapter = win.HighchartsAdapter || ($ && {
/**
* Initialize the adapter by applying some extensions to jQuery
*/
init: function (pathAnim) {
// extend the animate function to allow SVG animations
var Fx = $.fx,
Step = Fx.step,
dSetter,
Tween = $.Tween,
propHooks = Tween && Tween.propHooks,
opacityHook = $.cssHooks.opacity;
/*jslint unparam: true*//* allow unused param x in this function */
$.extend($.easing, {
easeOutQuad: function (x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b;
}
});
/*jslint unparam: false*/
// extend some methods to check for elem.attr, which means it is a Highcharts SVG object
$.each(['cur', '_default', 'width', 'height', 'opacity'], function (i, fn) {
var obj = Step,
base;
// Handle different parent objects
if (fn === 'cur') {
obj = Fx.prototype; // 'cur', the getter, relates to Fx.prototype
} else if (fn === '_default' && Tween) { // jQuery 1.8 model
obj = propHooks[fn];
fn = 'set';
}
// Overwrite the method
base = obj[fn];
if (base) { // step.width and step.height don't exist in jQuery < 1.7
// create the extended function replacement
obj[fn] = function (fx) {
var elem;
// Fx.prototype.cur does not use fx argument
fx = i ? fx : this;
// Don't run animations on textual properties like align (#1821)
if (fx.prop === 'align') {
return;
}
// shortcut
elem = fx.elem;
// Fx.prototype.cur returns the current value. The other ones are setters
// and returning a value has no effect.
return elem.attr ? // is SVG element wrapper
elem.attr(fx.prop, fn === 'cur' ? UNDEFINED : fx.now) : // apply the SVG wrapper's method
base.apply(this, arguments); // use jQuery's built-in method
};
}
});
// Extend the opacity getter, needed for fading opacity with IE9 and jQuery 1.10+
wrap(opacityHook, 'get', function (proceed, elem, computed) {
return elem.attr ? (elem.opacity || 0) : proceed.call(this, elem, computed);
});
// Define the setter function for d (path definitions)
dSetter = function (fx) {
var elem = fx.elem,
ends;
// Normally start and end should be set in state == 0, but sometimes,
// for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped
// in these cases
if (!fx.started) {
ends = pathAnim.init(elem, elem.d, elem.toD);
fx.start = ends[0];
fx.end = ends[1];
fx.started = true;
}
// interpolate each value of the path
elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));
};
// jQuery 1.8 style
if (Tween) {
propHooks.d = {
set: dSetter
};
// pre 1.8
} else {
// animate paths
Step.d = dSetter;
}
/**
* Utility for iterating over an array. Parameters are reversed compared to jQuery.
* @param {Array} arr
* @param {Function} fn
*/
this.each = Array.prototype.forEach ?
function (arr, fn) { // modern browsers
return Array.prototype.forEach.call(arr, fn);
} :
function (arr, fn) { // legacy
var i,
len = arr.length;
for (i = 0; i < len; i++) {
if (fn.call(arr[i], arr[i], i, arr) === false) {
return i;
}
}
};
/**
* Register Highcharts as a plugin in the respective framework
*/
$.fn.highcharts = function () {
var constr = 'Chart', // default constructor
args = arguments,
options,
ret,
chart;
if (this[0]) {
if (isString(args[0])) {
constr = args[0];
args = Array.prototype.slice.call(args, 1);
}
options = args[0];
// Create the chart
if (options !== UNDEFINED) {
/*jslint unused:false*/
options.chart = options.chart || {};
options.chart.renderTo = this[0];
chart = new Highcharts[constr](options, args[1]);
ret = this;
/*jslint unused:true*/
}
// When called without parameters or with the return argument, get a predefined chart
if (options === UNDEFINED) {
ret = charts[attr(this[0], 'data-highcharts-chart')];
}
}
return ret;
};
},
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
getScript: $.getScript,
/**
* Return the index of an item in an array, or -1 if not found
*/
inArray: $.inArray,
/**
* A direct link to jQuery methods. MooTools and Prototype adapters must be implemented for each case of method.
* @param {Object} elem The HTML element
* @param {String} method Which method to run on the wrapped element
*/
adapterRun: function (elem, method) {
return $(elem)[method]();
},
/**
* Filter an array
*/
grep: $.grep,
/**
* Map an array
* @param {Array} arr
* @param {Function} fn
*/
map: function (arr, fn) {
//return jQuery.map(arr, fn);
var results = [],
i = 0,
len = arr.length;
for (; i < len; i++) {
results[i] = fn.call(arr[i], arr[i], i, arr);
}
return results;
},
/**
* Get the position of an element relative to the top left of the page
*/
offset: function (el) {
return $(el).offset();
},
/**
* Add an event listener
* @param {Object} el A HTML element or custom object
* @param {String} event The event type
* @param {Function} fn The event handler
*/
addEvent: function (el, event, fn) {
$(el).bind(event, fn);
},
/**
* Remove event added with addEvent
* @param {Object} el The object
* @param {String} eventType The event type. Leave blank to remove all events.
* @param {Function} handler The function to remove
*/
removeEvent: function (el, eventType, handler) {
// workaround for jQuery issue with unbinding custom events:
// http://forum.jQuery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jQuery-1-4-2
var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';
if (doc[func] && el && !el[func]) {
el[func] = function () {};
}
$(el).unbind(eventType, handler);
},
/**
* Fire an event on a custom object
* @param {Object} el
* @param {String} type
* @param {Object} eventArguments
* @param {Function} defaultFunction
*/
fireEvent: function (el, type, eventArguments, defaultFunction) {
var event = $.Event(type),
detachedType = 'detached' + type,
defaultPrevented;
// Remove warnings in Chrome when accessing returnValue (#2790), layerX and layerY. Although Highcharts
// never uses these properties, Chrome includes them in the default click event and
// raises the warning when they are copied over in the extend statement below.
//
// To avoid problems in IE (see #1010) where we cannot delete the properties and avoid
// testing if they are there (warning in chrome) the only option is to test if running IE.
if (!isIE && eventArguments) {
delete eventArguments.layerX;
delete eventArguments.layerY;
delete eventArguments.returnValue;
}
extend(event, eventArguments);
// Prevent jQuery from triggering the object method that is named the
// same as the event. For example, if the event is 'select', jQuery
// attempts calling el.select and it goes into a loop.
if (el[type]) {
el[detachedType] = el[type];
el[type] = null;
}
// Wrap preventDefault and stopPropagation in try/catch blocks in
// order to prevent JS errors when cancelling events on non-DOM
// objects. #615.
/*jslint unparam: true*/
$.each(['preventDefault', 'stopPropagation'], function (i, fn) {
var base = event[fn];
event[fn] = function () {
try {
base.call(event);
} catch (e) {
if (fn === 'preventDefault') {
defaultPrevented = true;
}
}
};
});
/*jslint unparam: false*/
// trigger it
$(el).trigger(event);
// attach the method
if (el[detachedType]) {
el[type] = el[detachedType];
el[detachedType] = null;
}
if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {
defaultFunction(event);
}
},
/**
* Extension method needed for MooTools
*/
washMouseEvent: function (e) {
var ret = e.originalEvent || e;
// computed by jQuery, needed by IE8
if (ret.pageX === UNDEFINED) { // #1236
ret.pageX = e.pageX;
ret.pageY = e.pageY;
}
return ret;
},
/**
* Animate a HTML element or SVG element wrapper
* @param {Object} el
* @param {Object} params
* @param {Object} options jQuery-like animation options: duration, easing, callback
*/
animate: function (el, params, options) {
var $el = $(el);
if (!el.style) {
el.style = {}; // #1881
}
if (params.d) {
el.toD = params.d; // keep the array form for paths, used in $.fx.step.d
params.d = 1; // because in jQuery, animating to an array has a different meaning
}
$el.stop();
if (params.opacity !== UNDEFINED && el.attr) {
params.opacity += 'px'; // force jQuery to use same logic as width and height (#2161)
}
$el.animate(params, options);
},
/**
* Stop running animation
*/
stop: function (el) {
$(el).stop();
}
});
}(win.jQuery));
// check for a custom HighchartsAdapter defined prior to this file
var globalAdapter = win.HighchartsAdapter,
adapter = globalAdapter || {};
// Initialize the adapter
if (globalAdapter) {
globalAdapter.init.call(globalAdapter, pathAnim);
}
// Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object
// and all the utility functions will be null. In that case they are populated by the
// default adapters below.
var adapterRun = adapter.adapterRun,
getScript = adapter.getScript,
inArray = adapter.inArray,
each = adapter.each,
grep = adapter.grep,
offset = adapter.offset,
map = adapter.map,
addEvent = adapter.addEvent,
removeEvent = adapter.removeEvent,
fireEvent = adapter.fireEvent,
washMouseEvent = adapter.washMouseEvent,
animate = adapter.animate,
stop = adapter.stop;
/* ****************************************************************************
* Handle the options *
*****************************************************************************/
var
defaultLabelOptions = {
enabled: true,
// rotation: 0,
// align: 'center',
x: 0,
y: 15,
/*formatter: function () {
return this.value;
},*/
style: {
color: '#606060',
cursor: 'default',
fontSize: '11px'
}
};
defaultOptions = {
colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c',
'#8085e9', '#f15c80', '#e4d354', '#8085e8', '#8d4653', '#91e8e1'],
symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],
lang: {
loading: 'Loading...',
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
decimalPoint: '.',
numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels
resetZoom: 'Reset zoom',
resetZoomTitle: 'Reset zoom level 1:1',
thousandsSep: ','
},
global: {
useUTC: true,
//timezoneOffset: 0,
canvasToolsURL: 'http://code.highcharts.com/maps/1.0.3/modules/canvas-tools.js',
VMLRadialGradientURL: 'http://code.highcharts.com/maps/1.0.3/gfx/vml-radial-gradient.png'
},
chart: {
//animation: true,
//alignTicks: false,
//reflow: true,
//className: null,
//events: { load, selection },
//margin: [null],
//marginTop: null,
//marginRight: null,
//marginBottom: null,
//marginLeft: null,
borderColor: '#4572A7',
//borderWidth: 0,
borderRadius: 0,
defaultSeriesType: 'line',
ignoreHiddenSeries: true,
//inverted: false,
//shadow: false,
spacing: [10, 10, 15, 10],
//spacingTop: 10,
//spacingRight: 10,
//spacingBottom: 15,
//spacingLeft: 10,
//style: {
// fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font
// fontSize: '12px'
//},
backgroundColor: '#FFFFFF',
//plotBackgroundColor: null,
plotBorderColor: '#C0C0C0',
//plotBorderWidth: 0,
//plotShadow: false,
//zoomType: ''
resetZoomButton: {
theme: {
zIndex: 20
},
position: {
align: 'right',
x: -10,
//verticalAlign: 'top',
y: 10
}
// relativeTo: 'plot'
}
},
title: {
text: 'Chart title',
align: 'center',
// floating: false,
margin: 15,
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#333333',
fontSize: '18px'
}
},
subtitle: {
text: '',
align: 'center',
// floating: false
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#555555'
}
},
plotOptions: {
line: { // base series options
allowPointSelect: false,
showCheckbox: false,
animation: {
duration: 1000
},
//connectNulls: false,
//cursor: 'default',
//clip: true,
//dashStyle: null,
//enableMouseTracking: true,
events: {},
//legendIndex: 0,
//linecap: 'round',
lineWidth: 2,
//shadow: false,
// stacking: null,
marker: {
//enabled: true,
//symbol: null,
lineWidth: 0,
radius: 4,
lineColor: '#FFFFFF',
//fillColor: null,
states: { // states for a single point
hover: {
enabled: true,
lineWidthPlus: 1,
radiusPlus: 2
},
select: {
fillColor: '#FFFFFF',
lineColor: '#000000',
lineWidth: 2
}
}
},
point: {
events: {}
},
dataLabels: merge(defaultLabelOptions, {
align: 'center',
//defer: true,
enabled: false,
formatter: function () {
return this.y === null ? '' : numberFormat(this.y, -1);
},
verticalAlign: 'bottom', // above singular point
y: 0
// backgroundColor: undefined,
// borderColor: undefined,
// borderRadius: undefined,
// borderWidth: undefined,
// padding: 3,
// shadow: false
}),
cropThreshold: 300, // draw points outside the plot area when the number of points is less than this
pointRange: 0,
//pointStart: 0,
//pointInterval: 1,
//showInLegend: null, // auto: true for standalone series, false for linked series
states: { // states for the entire series
hover: {
//enabled: false,
lineWidthPlus: 1,
marker: {
// lineWidth: base + 1,
// radius: base + 1
},
halo: {
size: 10,
opacity: 0.25
}
},
select: {
marker: {}
}
},
stickyTracking: true,
//tooltip: {
//pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.y}</b>'
//valueDecimals: null,
//xDateFormat: '%A, %b %e, %Y',
//valuePrefix: '',
//ySuffix: ''
//}
turboThreshold: 1000
// zIndex: null
}
},
labels: {
//items: [],
style: {
//font: defaultFont,
position: ABSOLUTE,
color: '#3E576F'
}
},
legend: {
enabled: true,
align: 'center',
//floating: false,
layout: 'horizontal',
labelFormatter: function () {
return this.name;
},
//borderWidth: 0,
borderColor: '#909090',
borderRadius: 0,
navigation: {
// animation: true,
activeColor: '#274b6d',
// arrowSize: 12
inactiveColor: '#CCC'
// style: {} // text styles
},
// margin: 20,
// reversed: false,
shadow: false,
// backgroundColor: null,
/*style: {
padding: '5px'
},*/
itemStyle: {
color: '#333333',
fontSize: '12px',
fontWeight: 'bold'
},
itemHoverStyle: {
//cursor: 'pointer', removed as of #601
color: '#000'
},
itemHiddenStyle: {
color: '#CCC'
},
itemCheckboxStyle: {
position: ABSOLUTE,
width: '13px', // for IE precision
height: '13px'
},
// itemWidth: undefined,
// symbolRadius: 0,
// symbolWidth: 16,
symbolPadding: 5,
verticalAlign: 'bottom',
// width: undefined,
x: 0,
y: 0,
title: {
//text: null,
style: {
fontWeight: 'bold'
}
}
},
loading: {
// hideDuration: 100,
labelStyle: {
fontWeight: 'bold',
position: RELATIVE,
top: '45%'
},
// showDuration: 0,
style: {
position: ABSOLUTE,
backgroundColor: 'white',
opacity: 0.5,
textAlign: 'center'
}
},
tooltip: {
enabled: true,
animation: hasSVG,
//crosshairs: null,
backgroundColor: 'rgba(249, 249, 249, .85)',
borderWidth: 1,
borderRadius: 3,
dateTimeLabelFormats: {
millisecond: '%A, %b %e, %H:%M:%S.%L',
second: '%A, %b %e, %H:%M:%S',
minute: '%A, %b %e, %H:%M',
hour: '%A, %b %e, %H:%M',
day: '%A, %b %e, %Y',
week: 'Week from %A, %b %e, %Y',
month: '%B %Y',
year: '%Y'
},
//formatter: defaultFormatter,
headerFormat: '<span style="font-size: 10px">{point.key}</span><br/>',
pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>',
shadow: true,
//shape: 'callout',
//shared: false,
snap: isTouchDevice ? 25 : 10,
style: {
color: '#333333',
cursor: 'default',
fontSize: '12px',
padding: '8px',
whiteSpace: 'nowrap'
}
//xDateFormat: '%A, %b %e, %Y',
//valueDecimals: null,
//valuePrefix: '',
//valueSuffix: ''
},
credits: {
enabled: true,
text: 'Highcharts.com',
href: 'http://www.highcharts.com',
position: {
align: 'right',
x: -10,
verticalAlign: 'bottom',
y: -5
},
style: {
cursor: 'pointer',
color: '#909090',
fontSize: '9px'
}
}
};
// Series defaults
var defaultPlotOptions = defaultOptions.plotOptions,
defaultSeriesOptions = defaultPlotOptions.line;
// set the default time methods
setTimeMethods();
/**
* Set the time methods globally based on the useUTC option. Time method can be either
* local time or UTC (default).
*/
function setTimeMethods() {
var useUTC = defaultOptions.global.useUTC,
GET = useUTC ? 'getUTC' : 'get',
SET = useUTC ? 'setUTC' : 'set';
timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;
makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {
return new Date(
year,
month,
pick(date, 1),
pick(hours, 0),
pick(minutes, 0),
pick(seconds, 0)
).getTime();
};
getMinutes = GET + 'Minutes';
getHours = GET + 'Hours';
getDay = GET + 'Day';
getDate = GET + 'Date';
getMonth = GET + 'Month';
getFullYear = GET + 'FullYear';
setMinutes = SET + 'Minutes';
setHours = SET + 'Hours';
setDate = SET + 'Date';
setMonth = SET + 'Month';
setFullYear = SET + 'FullYear';
}
/**
* Merge the default options with custom options and return the new options structure
* @param {Object} options The new custom options
*/
function setOptions(options) {
// Copy in the default options
defaultOptions = merge(true, defaultOptions, options);
// Apply UTC
setTimeMethods();
return defaultOptions;
}
/**
* Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules
* wasn't enough because the setOptions method created a new object.
*/
function getOptions() {
return defaultOptions;
}
/**
* Handle color operations. The object methods are chainable.
* @param {String} input The input color in either rbga or hex format
*/
var rgbaRegEx = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,
hexRegEx = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
rgbRegEx = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/;
var Color = function (input) {
// declare variables
var rgba = [], result, stops;
/**
* Parse the input color to rgba array
* @param {String} input
*/
function init(input) {
// Gradients
if (input && input.stops) {
stops = map(input.stops, function (stop) {
return Color(stop[1]);
});
// Solid colors
} else {
// rgba
result = rgbaRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];
} else {
// hex
result = hexRegEx.exec(input);
if (result) {
rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];
} else {
// rgb
result = rgbRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1];
}
}
}
}
}
/**
* Return the color a specified format
* @param {String} format
*/
function get(format) {
var ret;
if (stops) {
ret = merge(input);
ret.stops = [].concat(ret.stops);
each(stops, function (stop, i) {
ret.stops[i] = [ret.stops[i][0], stop.get(format)];
});
// it's NaN if gradient colors on a column chart
} else if (rgba && !isNaN(rgba[0])) {
if (format === 'rgb') {
ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
} else if (format === 'a') {
ret = rgba[3];
} else {
ret = 'rgba(' + rgba.join(',') + ')';
}
} else {
ret = input;
}
return ret;
}
/**
* Brighten the color
* @param {Number} alpha
*/
function brighten(alpha) {
if (stops) {
each(stops, function (stop) {
stop.brighten(alpha);
});
} else if (isNumber(alpha) && alpha !== 0) {
var i;
for (i = 0; i < 3; i++) {
rgba[i] += pInt(alpha * 255);
if (rgba[i] < 0) {
rgba[i] = 0;
}
if (rgba[i] > 255) {
rgba[i] = 255;
}
}
}
return this;
}
/**
* Set the color's opacity to a given alpha value
* @param {Number} alpha
*/
function setOpacity(alpha) {
rgba[3] = alpha;
return this;
}
// initialize: parse the input
init(input);
// public methods
return {
get: get,
brighten: brighten,
rgba: rgba,
setOpacity: setOpacity
};
};
/**
* A wrapper object for SVG elements
*/
function SVGElement() {}
SVGElement.prototype = {
// Default base for animation
opacity: 1,
// For labels, these CSS properties are applied to the <text> node directly
textProps: ['fontSize', 'fontWeight', 'fontFamily', 'color',
'lineHeight', 'width', 'textDecoration', 'textShadow', 'HcTextStroke'],
/**
* Initialize the SVG renderer
* @param {Object} renderer
* @param {String} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this;
wrapper.element = nodeName === 'span' ?
createElement(nodeName) :
doc.createElementNS(SVG_NS, nodeName);
wrapper.renderer = renderer;
},
/**
* Animate a given attribute
* @param {Object} params
* @param {Number} options The same options as in jQuery animation
* @param {Function} complete Function to perform at the end of animation
*/
animate: function (params, options, complete) {
var animOptions = pick(options, globalAnimation, true);
stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)
if (animOptions) {
animOptions = merge(animOptions, {}); //#2625
if (complete) { // allows using a callback with the global animation without overwriting it
animOptions.complete = complete;
}
animate(this, params, animOptions);
} else {
this.attr(params);
if (complete) {
complete();
}
}
return this;
},
/**
* Build an SVG gradient out of a common JavaScript configuration object
*/
colorGradient: function (color, prop, elem) {
var renderer = this.renderer,
colorObject,
gradName,
gradAttr,
gradients,
gradientObject,
stops,
stopColor,
stopOpacity,
radialReference,
n,
id,
key = [];
// Apply linear or radial gradients
if (color.linearGradient) {
gradName = 'linearGradient';
} else if (color.radialGradient) {
gradName = 'radialGradient';
}
if (gradName) {
gradAttr = color[gradName];
gradients = renderer.gradients;
stops = color.stops;
radialReference = elem.radialReference;
// Keep < 2.2 kompatibility
if (isArray(gradAttr)) {
color[gradName] = gradAttr = {
x1: gradAttr[0],
y1: gradAttr[1],
x2: gradAttr[2],
y2: gradAttr[3],
gradientUnits: 'userSpaceOnUse'
};
}
// Correct the radial gradient for the radial reference system
if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) {
gradAttr = merge(gradAttr, {
cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2],
cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2],
r: gradAttr.r * radialReference[2],
gradientUnits: 'userSpaceOnUse'
});
}
// Build the unique key to detect whether we need to create a new element (#1282)
for (n in gradAttr) {
if (n !== 'id') {
key.push(n, gradAttr[n]);
}
}
for (n in stops) {
key.push(stops[n]);
}
key = key.join(',');
// Check if a gradient object with the same config object is created within this renderer
if (gradients[key]) {
id = gradients[key].attr('id');
} else {
// Set the id and create the element
gradAttr.id = id = PREFIX + idCounter++;
gradients[key] = gradientObject = renderer.createElement(gradName)
.attr(gradAttr)
.add(renderer.defs);
// The gradient needs to keep a list of stops to be able to destroy them
gradientObject.stops = [];
each(stops, function (stop) {
var stopObject;
if (stop[1].indexOf('rgba') === 0) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
stopObject = renderer.createElement('stop').attr({
offset: stop[0],
'stop-color': stopColor,
'stop-opacity': stopOpacity
}).add(gradientObject);
// Add the stop element to the gradient
gradientObject.stops.push(stopObject);
});
}
// Set the reference to the gradient object
elem.setAttribute(prop, 'url(' + renderer.url + '#' + id + ')');
}
},
/**
* Set or get a given attribute
* @param {Object|String} hash
* @param {Mixed|Undefined} val
*/
attr: function (hash, val) {
var key,
value,
element = this.element,
hasSetSymbolSize,
ret = this,
skipAttr;
// single key-value pair
if (typeof hash === 'string' && val !== UNDEFINED) {
key = hash;
hash = {};
hash[key] = val;
}
// used as a getter: first argument is a string, second is undefined
if (typeof hash === 'string') {
ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);
// setter
} else {
for (key in hash) {
value = hash[key];
skipAttr = false;
if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
if (!hasSetSymbolSize) {
this.symbolAttr(hash);
hasSetSymbolSize = true;
}
skipAttr = true;
}
if (this.rotation && (key === 'x' || key === 'y')) {
this.doTransform = true;
}
if (!skipAttr) {
(this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);
}
// Let the shadow follow the main element
if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {
this.updateShadows(key, value);
}
}
// Update transform. Do this outside the loop to prevent redundant updating for batch setting
// of attributes.
if (this.doTransform) {
this.updateTransform();
this.doTransform = false;
}
}
return ret;
},
updateShadows: function (key, value) {
var shadows = this.shadows,
i = shadows.length;
while (i--) {
shadows[i].setAttribute(
key,
key === 'height' ?
mathMax(value - (shadows[i].cutHeight || 0), 0) :
key === 'd' ? this.d : value
);
}
},
/**
* Add a class name to an element
*/
addClass: function (className) {
var element = this.element,
currentClassName = attr(element, 'class') || '';
if (currentClassName.indexOf(className) === -1) {
attr(element, 'class', currentClassName + ' ' + className);
}
return this;
},
/* hasClass and removeClass are not (yet) needed
hasClass: function (className) {
return attr(this.element, 'class').indexOf(className) !== -1;
},
removeClass: function (className) {
attr(this.element, 'class', attr(this.element, 'class').replace(className, ''));
return this;
},
*/
/**
* If one of the symbol size affecting parameters are changed,
* check all the others only once for each call to an element's
* .attr() method
* @param {Object} hash
*/
symbolAttr: function (hash) {
var wrapper = this;
each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) {
wrapper[key] = pick(hash[key], wrapper[key]);
});
wrapper.attr({
d: wrapper.renderer.symbols[wrapper.symbolName](
wrapper.x,
wrapper.y,
wrapper.width,
wrapper.height,
wrapper
)
});
},
/**
* Apply a clipping path to this object
* @param {String} id
*/
clip: function (clipRect) {
return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE);
},
/**
* Calculate the coordinates needed for drawing a rectangle crisply and return the
* calculated attributes
* @param {Number} strokeWidth
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
crisp: function (rect) {
var wrapper = this,
key,
attribs = {},
normalizer,
strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0;
normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors
// normalize for crisp edges
rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer;
rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer;
rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer);
rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer);
rect.strokeWidth = strokeWidth;
for (key in rect) {
if (wrapper[key] !== rect[key]) { // only set attribute if changed
wrapper[key] = attribs[key] = rect[key];
}
}
return attribs;
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: function (styles) {
var elemWrapper = this,
oldStyles = elemWrapper.styles,
newStyles = {},
elem = elemWrapper.element,
textWidth,
n,
serializedCss = '',
hyphenate,
hasNew = !oldStyles;
// convert legacy
if (styles && styles.color) {
styles.fill = styles.color;
}
// Filter out existing styles to increase performance (#2640)
if (oldStyles) {
for (n in styles) {
if (styles[n] !== oldStyles[n]) {
newStyles[n] = styles[n];
hasNew = true;
}
}
}
if (hasNew) {
textWidth = elemWrapper.textWidth = styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width);
// Merge the new styles with the old ones
if (oldStyles) {
styles = extend(
oldStyles,
newStyles
);
}
// store object
elemWrapper.styles = styles;
if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) {
delete styles.width;
}
// serialize and set style attribute
if (isIE && !hasSVG) {
css(elemWrapper.element, styles);
} else {
/*jslint unparam: true*/
hyphenate = function (a, b) { return '-' + b.toLowerCase(); };
/*jslint unparam: false*/
for (n in styles) {
serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';';
}
attr(elem, 'style', serializedCss); // #1881
}
// re-build text
if (textWidth && elemWrapper.added) {
elemWrapper.renderer.buildText(elemWrapper);
}
}
return elemWrapper;
},
/**
* Add an event listener
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
var svgElement = this,
element = svgElement.element;
// touch
if (hasTouch && eventType === 'click') {
element.ontouchstart = function (e) {
svgElement.touchEventFired = Date.now();
e.preventDefault();
handler.call(element, e);
};
element.onclick = function (e) {
if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269
handler.call(element, e);
}
};
} else {
// simplest possible event model for internal use
element['on' + eventType] = handler;
}
return this;
},
/**
* Set the coordinates needed to draw a consistent radial gradient across
* pie slices regardless of positioning inside the chart. The format is
* [centerX, centerY, diameter] in pixels.
*/
setRadialReference: function (coordinates) {
this.element.radialReference = coordinates;
return this;
},
/**
* Move an object and its children by x and y values
* @param {Number} x
* @param {Number} y
*/
translate: function (x, y) {
return this.attr({
translateX: x,
translateY: y
});
},
/**
* Invert a group, rotate and flip
*/
invert: function () {
var wrapper = this;
wrapper.inverted = true;
wrapper.updateTransform();
return wrapper;
},
/**
* Private method to update the transform attribute based on internal
* properties
*/
updateTransform: function () {
var wrapper = this,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
scaleX = wrapper.scaleX,
scaleY = wrapper.scaleY,
inverted = wrapper.inverted,
rotation = wrapper.rotation,
element = wrapper.element,
transform;
// flipping affects translate as adjustment for flipping around the group's axis
if (inverted) {
translateX += wrapper.attr('width');
translateY += wrapper.attr('height');
}
// Apply translate. Nearly all transformed elements have translation, so instead
// of checking for translate = 0, do it always (#1767, #1846).
transform = ['translate(' + translateX + ',' + translateY + ')'];
// apply rotation
if (inverted) {
transform.push('rotate(90) scale(-1,1)');
} else if (rotation) { // text rotation
transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
}
// apply scale
if (defined(scaleX) || defined(scaleY)) {
transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
}
if (transform.length) {
element.setAttribute('transform', transform.join(' '));
}
},
/**
* Bring the element to the front
*/
toFront: function () {
var element = this.element;
element.parentNode.appendChild(element);
return this;
},
/**
* Break down alignment options like align, verticalAlign, x and y
* to x and y relative to the chart.
*
* @param {Object} alignOptions
* @param {Boolean} alignByTranslate
* @param {String[Object} box The box to align to, needs a width and height. When the
* box is a string, it refers to an object in the Renderer. For example, when
* box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height
* x and y properties.
*
*/
align: function (alignOptions, alignByTranslate, box) {
var align,
vAlign,
x,
y,
attribs = {},
alignTo,
renderer = this.renderer,
alignedObjects = renderer.alignedObjects;
// First call on instanciate
if (alignOptions) {
this.alignOptions = alignOptions;
this.alignByTranslate = alignByTranslate;
if (!box || isString(box)) { // boxes other than renderer handle this internally
this.alignTo = alignTo = box || 'renderer';
erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize
alignedObjects.push(this);
box = null; // reassign it below
}
// When called on resize, no arguments are supplied
} else {
alignOptions = this.alignOptions;
alignByTranslate = this.alignByTranslate;
alignTo = this.alignTo;
}
box = pick(box, renderer[alignTo], renderer);
// Assign variables
align = alignOptions.align;
vAlign = alignOptions.verticalAlign;
x = (box.x || 0) + (alignOptions.x || 0); // default: left align
y = (box.y || 0) + (alignOptions.y || 0); // default: top align
// Align
if (align === 'right' || align === 'center') {
x += (box.width - (alignOptions.width || 0)) /
{ right: 1, center: 2 }[align];
}
attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x);
// Vertical align
if (vAlign === 'bottom' || vAlign === 'middle') {
y += (box.height - (alignOptions.height || 0)) /
({ bottom: 1, middle: 2 }[vAlign] || 1);
}
attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y);
// Animate only if already placed
this[this.placed ? 'animate' : 'attr'](attribs);
this.placed = true;
this.alignAttr = attribs;
return this;
},
/**
* Get the bounding box (width, height, x and y) for the element
*/
getBBox: function () {
var wrapper = this,
bBox = wrapper.bBox,
renderer = wrapper.renderer,
width,
height,
rotation = wrapper.rotation,
element = wrapper.element,
styles = wrapper.styles,
rad = rotation * deg2rad,
textStr = wrapper.textStr,
cacheKey;
// Since numbers are monospaced, and numerical labels appear a lot in a chart,
// we assume that a label of n characters has the same bounding box as others
// of the same length.
if (textStr === '' || numRegex.test(textStr)) {
cacheKey = 'num.' + textStr.toString().length + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');
} //else { // This code block made demo/waterfall fail, related to buildText
// Caching all strings reduces rendering time by 4-5%.
// TODO: Check how this affects places where bBox is found on the element
//cacheKey = textStr + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');
//}
if (cacheKey) {
bBox = renderer.cache[cacheKey];
}
// No cache found
if (!bBox) {
// SVG elements
if (element.namespaceURI === SVG_NS || renderer.forExport) {
try { // Fails in Firefox if the container has display: none.
bBox = element.getBBox ?
// SVG: use extend because IE9 is not allowed to change width and height in case
// of rotation (below)
extend({}, element.getBBox()) :
// Canvas renderer and legacy IE in export mode
{
width: element.offsetWidth,
height: element.offsetHeight
};
} catch (e) {}
// If the bBox is not set, the try-catch block above failed. The other condition
// is for Opera that returns a width of -Infinity on hidden elements.
if (!bBox || bBox.width < 0) {
bBox = { width: 0, height: 0 };
}
// VML Renderer or useHTML within SVG
} else {
bBox = wrapper.htmlGetBBox();
}
// True SVG elements as well as HTML elements in modern browsers using the .useHTML option
// need to compensated for rotation
if (renderer.isSVG) {
width = bBox.width;
height = bBox.height;
// Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568)
if (isIE && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') {
bBox.height = height = 14;
}
// Adjust for rotated text
if (rotation) {
bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad));
bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad));
}
}
// Cache it
wrapper.bBox = bBox;
if (cacheKey) {
renderer.cache[cacheKey] = bBox;
}
}
return bBox;
},
/**
* Show the element
*/
show: function (inherit) {
// IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881)
if (inherit && this.element.namespaceURI === SVG_NS) {
this.element.removeAttribute('visibility');
return this;
} else {
return this.attr({ visibility: inherit ? 'inherit' : VISIBLE });
}
},
/**
* Hide the element
*/
hide: function () {
return this.attr({ visibility: HIDDEN });
},
fadeOut: function (duration) {
var elemWrapper = this;
elemWrapper.animate({
opacity: 0
}, {
duration: duration || 150,
complete: function () {
elemWrapper.hide();
}
});
},
/**
* Add the element
* @param {Object|Undefined} parent Can be an element, an element wrapper or undefined
* to append the element to the renderer.box.
*/
add: function (parent) {
var renderer = this.renderer,
parentWrapper = parent || renderer,
parentNode = parentWrapper.element || renderer.box,
childNodes,
element = this.element,
zIndex = this.zIndex,
otherElement,
otherZIndex,
i,
inserted;
if (parent) {
this.parentGroup = parent;
}
// mark as inverted
this.parentInverted = parent && parent.inverted;
// build formatted text
if (this.textStr !== undefined) {
renderer.buildText(this);
}
// mark the container as having z indexed children
if (zIndex) {
parentWrapper.handleZ = true;
zIndex = pInt(zIndex);
}
// insert according to this and other elements' zIndex
if (parentWrapper.handleZ) { // this element or any of its siblings has a z index
childNodes = parentNode.childNodes;
for (i = 0; i < childNodes.length; i++) {
otherElement = childNodes[i];
otherZIndex = attr(otherElement, 'zIndex');
if (otherElement !== element && (
// insert before the first element with a higher zIndex
pInt(otherZIndex) > zIndex ||
// if no zIndex given, insert before the first element with a zIndex
(!defined(zIndex) && defined(otherZIndex))
)) {
parentNode.insertBefore(element, otherElement);
inserted = true;
break;
}
}
}
// default: append at the end
if (!inserted) {
parentNode.appendChild(element);
}
// mark as added
this.added = true;
// fire an event for internal hooks
if (this.onAdd) {
this.onAdd();
}
return this;
},
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
var parentNode = element.parentNode;
if (parentNode) {
parentNode.removeChild(element);
}
},
/**
* Destroy the element and element wrapper
*/
destroy: function () {
var wrapper = this,
element = wrapper.element || {},
shadows = wrapper.shadows,
parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup,
grandParent,
key,
i;
// remove events
element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null;
stop(wrapper); // stop running animations
if (wrapper.clipPath) {
wrapper.clipPath = wrapper.clipPath.destroy();
}
// Destroy stops in case this is a gradient object
if (wrapper.stops) {
for (i = 0; i < wrapper.stops.length; i++) {
wrapper.stops[i] = wrapper.stops[i].destroy();
}
wrapper.stops = null;
}
// remove element
wrapper.safeRemoveChild(element);
// destroy shadows
if (shadows) {
each(shadows, function (shadow) {
wrapper.safeRemoveChild(shadow);
});
}
// In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697).
while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) {
grandParent = parentToClean.parentGroup;
wrapper.safeRemoveChild(parentToClean.div);
delete parentToClean.div;
parentToClean = grandParent;
}
// remove from alignObjects
if (wrapper.alignTo) {
erase(wrapper.renderer.alignedObjects, wrapper);
}
for (key in wrapper) {
delete wrapper[key];
}
return null;
},
/**
* Add a shadow to the element. Must be done after the element is added to the DOM
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
shadow,
element = this.element,
strokeWidth,
shadowWidth,
shadowElementOpacity,
// compensate for inverted plot area
transform;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
transform = this.parentInverted ?
'(-1,-1)' :
'(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')';
for (i = 1; i <= shadowWidth; i++) {
shadow = element.cloneNode(0);
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
attr(shadow, {
'isShadow': 'true',
'stroke': shadowOptions.color || 'black',
'stroke-opacity': shadowElementOpacity * i,
'stroke-width': strokeWidth,
'transform': 'translate' + transform,
'fill': NONE
});
if (cutOff) {
attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0));
shadow.cutHeight = strokeWidth;
}
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
xGetter: function (key) {
if (this.element.nodeName === 'circle') {
key = { x: 'cx', y: 'cy' }[key] || key;
}
return this._defaultGetter(key);
},
/**
* Get the current value of an attribute or pseudo attribute, used mainly
* for animation.
*/
_defaultGetter: function (key) {
var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0);
if (/^[\-0-9\.]+$/.test(ret)) { // is numerical
ret = parseFloat(ret);
}
return ret;
},
dSetter: function (value, key, element) {
if (value && value.join) { // join path
value = value.join(' ');
}
if (/(NaN| {2}|^$)/.test(value)) {
value = 'M 0 0';
}
element.setAttribute(key, value);
this[key] = value;
},
dashstyleSetter: function (value) {
var i;
value = value && value.toLowerCase();
if (value) {
value = value
.replace('shortdashdotdot', '3,1,1,1,1,1,')
.replace('shortdashdot', '3,1,1,1')
.replace('shortdot', '1,1,')
.replace('shortdash', '3,1,')
.replace('longdash', '8,3,')
.replace(/dot/g, '1,3,')
.replace('dash', '4,3,')
.replace(/,$/, '')
.replace('solid', 1)
.split(','); // ending comma
i = value.length;
while (i--) {
value[i] = pInt(value[i]) * this['stroke-width'];
}
value = value.join(',');
this.element.setAttribute('stroke-dasharray', value);
}
},
alignSetter: function (value) {
this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]);
},
opacitySetter: function (value, key, element) {
this[key] = value;
element.setAttribute(key, value);
},
titleSetter: function (value) {
var titleNode = this.element.getElementsByTagName('title')[0];
if (!titleNode) {
titleNode = doc.createElementNS(SVG_NS, 'title');
this.element.appendChild(titleNode);
}
titleNode.textContent = value;
},
textSetter: function (value) {
if (value !== this.textStr) {
// Delete bBox memo when the text changes
delete this.bBox;
this.textStr = value;
if (this.added) {
this.renderer.buildText(this);
}
}
},
fillSetter: function (value, key, element) {
if (typeof value === 'string') {
element.setAttribute(key, value);
} else if (value) {
this.colorGradient(value, key, element);
}
},
zIndexSetter: function (value, key, element) {
element.setAttribute(key, value);
this[key] = value;
},
_defaultSetter: function (value, key, element) {
element.setAttribute(key, value);
}
};
// Some shared setters and getters
SVGElement.prototype.yGetter = SVGElement.prototype.xGetter;
SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter =
SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter =
SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) {
this[key] = value;
this.doTransform = true;
};
// WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the
// stroke attribute altogether. #1270, #1369, #3065, #3072.
SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) {
this[key] = value;
// Only apply the stroke attribute if the stroke width is defined and larger than 0
if (this.stroke && this['stroke-width']) {
this.strokeWidth = this['stroke-width'];
SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden
element.setAttribute('stroke-width', this['stroke-width']);
this.hasStroke = true;
} else if (key === 'stroke-width' && value === 0 && this.hasStroke) {
element.removeAttribute('stroke');
this.hasStroke = false;
}
};
/**
* The default SVG renderer
*/
var SVGRenderer = function () {
this.init.apply(this, arguments);
};
SVGRenderer.prototype = {
Element: SVGElement,
/**
* Initialize the SVGRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
* @param {Boolean} forExport
*/
init: function (container, width, height, style, forExport) {
var renderer = this,
loc = location,
boxWrapper,
element,
desc;
boxWrapper = renderer.createElement('svg')
.attr({
version: '1.1'
})
.css(this.getStyle(style));
element = boxWrapper.element;
container.appendChild(element);
// For browsers other than IE, add the namespace attribute (#1978)
if (container.innerHTML.indexOf('xmlns') === -1) {
attr(element, 'xmlns', SVG_NS);
}
// object properties
renderer.isSVG = true;
renderer.box = element;
renderer.boxWrapper = boxWrapper;
renderer.alignedObjects = [];
// Page url used for internal references. #24, #672, #1070
renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ?
loc.href
.replace(/#.*?$/, '') // remove the hash
.replace(/([\('\)])/g, '\\$1') // escape parantheses and quotes
.replace(/ /g, '%20') : // replace spaces (needed for Safari only)
'';
// Add description
desc = this.createElement('desc').add();
desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION));
renderer.defs = this.createElement('defs').add();
renderer.forExport = forExport;
renderer.gradients = {}; // Object where gradient SvgElements are stored
renderer.cache = {}; // Cache for numerical bounding boxes
renderer.setSize(width, height, false);
// Issue 110 workaround:
// In Firefox, if a div is positioned by percentage, its pixel position may land
// between pixels. The container itself doesn't display this, but an SVG element
// inside this container will be drawn at subpixel precision. In order to draw
// sharp lines, this must be compensated for. This doesn't seem to work inside
// iframes though (like in jsFiddle).
var subPixelFix, rect;
if (isFirefox && container.getBoundingClientRect) {
renderer.subPixelFix = subPixelFix = function () {
css(container, { left: 0, top: 0 });
rect = container.getBoundingClientRect();
css(container, {
left: (mathCeil(rect.left) - rect.left) + PX,
top: (mathCeil(rect.top) - rect.top) + PX
});
};
// run the fix now
subPixelFix();
// run it on resize
addEvent(win, 'resize', subPixelFix);
}
},
getStyle: function (style) {
return (this.style = extend({
fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', // default font
fontSize: '12px'
}, style));
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none. #608.
*/
isHidden: function () {
return !this.boxWrapper.getBBox().width;
},
/**
* Destroys the renderer and its allocated members.
*/
destroy: function () {
var renderer = this,
rendererDefs = renderer.defs;
renderer.box = null;
renderer.boxWrapper = renderer.boxWrapper.destroy();
// Call destroy on all gradient elements
destroyObjectProperties(renderer.gradients || {});
renderer.gradients = null;
// Defs are null in VMLRenderer
// Otherwise, destroy them here.
if (rendererDefs) {
renderer.defs = rendererDefs.destroy();
}
// Remove sub pixel fix handler
// We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed
// See issue #982
if (renderer.subPixelFix) {
removeEvent(win, 'resize', renderer.subPixelFix);
}
renderer.alignedObjects = null;
return null;
},
/**
* Create a wrapper for an SVG element
* @param {Object} nodeName
*/
createElement: function (nodeName) {
var wrapper = new this.Element();
wrapper.init(this, nodeName);
return wrapper;
},
/**
* Dummy function for use in canvas renderer
*/
draw: function () {},
/**
* Parse a simple HTML string into SVG tspans
*
* @param {Object} textNode The parent text SVG node
*/
buildText: function (wrapper) {
var textNode = wrapper.element,
renderer = this,
forExport = renderer.forExport,
textStr = pick(wrapper.textStr, '').toString(),
hasMarkup = textStr.indexOf('<') !== -1,
lines,
childNodes = textNode.childNodes,
styleRegex,
hrefRegex,
parentX = attr(textNode, 'x'),
textStyles = wrapper.styles,
width = wrapper.textWidth,
textLineHeight = textStyles && textStyles.lineHeight,
textStroke = textStyles && textStyles.HcTextStroke,
i = childNodes.length,
getLineHeight = function (tspan) {
return textLineHeight ?
pInt(textLineHeight) :
renderer.fontMetrics(
/(px|em)$/.test(tspan && tspan.style.fontSize) ?
tspan.style.fontSize :
((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
tspan
).h;
};
/// remove old text
while (i--) {
textNode.removeChild(childNodes[i]);
}
// Skip tspans, add text directly to text node. The forceTSpan is a hook
// used in text outline hack.
if (!hasMarkup && !textStroke && textStr.indexOf(' ') === -1) {
textNode.appendChild(doc.createTextNode(textStr));
return;
// Complex strings, add more logic
} else {
styleRegex = /<.*style="([^"]+)".*>/;
hrefRegex = /<.*href="(http[^"]+)".*>/;
if (width && !wrapper.added) {
this.box.appendChild(textNode); // attach it to the DOM to read offset width
}
if (hasMarkup) {
lines = textStr
.replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
.replace(/<(i|em)>/g, '<span style="font-style:italic">')
.replace(/<a/g, '<span')
.replace(/<\/(b|strong|i|em|a)>/g, '</span>')
.split(/<br.*?>/g);
} else {
lines = [textStr];
}
// remove empty line at end
if (lines[lines.length - 1] === '') {
lines.pop();
}
// build the lines
each(lines, function (line, lineNo) {
var spans, spanNo = 0;
line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
spans = line.split('|||');
each(spans, function (span) {
if (span !== '' || spans.length === 1) {
var attributes = {},
tspan = doc.createElementNS(SVG_NS, 'tspan'),
spanStyle; // #390
if (styleRegex.test(span)) {
spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
attr(tspan, 'style', spanStyle);
}
if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
css(tspan, { cursor: 'pointer' });
}
span = (span.replace(/<(.|\n)*?>/g, '') || ' ')
.replace(/</g, '<')
.replace(/>/g, '>');
// Nested tags aren't supported, and cause crash in Safari (#1596)
if (span !== ' ') {
// add the text node
tspan.appendChild(doc.createTextNode(span));
if (!spanNo) { // first span in a line, align it to the left
if (lineNo && parentX !== null) {
attributes.x = parentX;
}
} else {
attributes.dx = 0; // #16
}
// add attributes
attr(tspan, attributes);
// Append it
textNode.appendChild(tspan);
// first span on subsequent line, add the line height
if (!spanNo && lineNo) {
// allow getting the right offset height in exporting in IE
if (!hasSVG && forExport) {
css(tspan, { display: 'block' });
}
// Set the line height based on the font size of either
// the text element or the tspan element
attr(
tspan,
'dy',
getLineHeight(tspan)
);
}
// check width and apply soft breaks
if (width) {
var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
hasWhiteSpace = spans.length > 1 || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
tooLong,
actualWidth,
hcHeight = textStyles.HcHeight,
rest = [],
dy = getLineHeight(tspan),
softLineNo = 1,
bBox;
while (hasWhiteSpace && (words.length || rest.length)) {
delete wrapper.bBox; // delete cache
bBox = wrapper.getBBox();
actualWidth = bBox.width;
// Old IE cannot measure the actualWidth for SVG elements (#2314)
if (!hasSVG && renderer.forExport) {
actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
}
tooLong = actualWidth > width;
if (!tooLong || words.length === 1) { // new line needed
words = rest;
rest = [];
if (words.length) {
softLineNo++;
if (hcHeight && softLineNo * dy > hcHeight) {
words = ['...'];
wrapper.attr('title', wrapper.textStr);
} else {
tspan = doc.createElementNS(SVG_NS, 'tspan');
attr(tspan, {
dy: dy,
x: parentX
});
if (spanStyle) { // #390
attr(tspan, 'style', spanStyle);
}
textNode.appendChild(tspan);
}
}
if (actualWidth > width) { // a single word is pressing it out
width = actualWidth;
}
} else { // append to existing line tspan
tspan.removeChild(tspan.firstChild);
rest.unshift(words.pop());
}
if (words.length) {
tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
}
}
}
spanNo++;
}
}
});
});
}
},
/**
* Create a button with preset states
* @param {String} text
* @param {Number} x
* @param {Number} y
* @param {Function} callback
* @param {Object} normalState
* @param {Object} hoverState
* @param {Object} pressedState
*/
button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
curState = 0,
stateOptions,
stateStyle,
normalStyle,
hoverStyle,
pressedStyle,
disabledStyle,
verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 };
// Normal state - prepare the attributes
normalState = merge({
'stroke-width': 1,
stroke: '#CCCCCC',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FEFEFE'],
[1, '#F6F6F6']
]
},
r: 2,
padding: 5,
style: {
color: 'black'
}
}, normalState);
normalStyle = normalState.style;
delete normalState.style;
// Hover state
hoverState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FFF'],
[1, '#ACF']
]
}
}, hoverState);
hoverStyle = hoverState.style;
delete hoverState.style;
// Pressed state
pressedState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#9BD'],
[1, '#CDF']
]
}
}, pressedState);
pressedStyle = pressedState.style;
delete pressedState.style;
// Disabled state
disabledState = merge(normalState, {
style: {
color: '#CCC'
}
}, disabledState);
disabledStyle = disabledState.style;
delete disabledState.style;
// Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667).
addEvent(label.element, isIE ? 'mouseover' : 'mouseenter', function () {
if (curState !== 3) {
label.attr(hoverState)
.css(hoverStyle);
}
});
addEvent(label.element, isIE ? 'mouseout' : 'mouseleave', function () {
if (curState !== 3) {
stateOptions = [normalState, hoverState, pressedState][curState];
stateStyle = [normalStyle, hoverStyle, pressedStyle][curState];
label.attr(stateOptions)
.css(stateStyle);
}
});
label.setState = function (state) {
label.state = curState = state;
if (!state) {
label.attr(normalState)
.css(normalStyle);
} else if (state === 2) {
label.attr(pressedState)
.css(pressedStyle);
} else if (state === 3) {
label.attr(disabledState)
.css(disabledStyle);
}
};
return label
.on('click', function () {
if (curState !== 3) {
callback.call(label);
}
})
.attr(normalState)
.css(extend({ cursor: 'default' }, normalStyle));
},
/**
* Make a straight line crisper by not spilling out to neighbour pixels
* @param {Array} points
* @param {Number} width
*/
crispLine: function (points, width) {
// points format: [M, 0, 0, L, 100, 0]
// normalize to a crisp line
if (points[1] === points[4]) {
// Substract due to #1129. Now bottom and left axis gridlines behave the same.
points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2);
}
if (points[2] === points[5]) {
points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2);
}
return points;
},
/**
* Draw a path
* @param {Array} path An SVG path in array form
*/
path: function (path) {
var attr = {
fill: NONE
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
return this.createElement('path').attr(attr);
},
/**
* Draw and return an SVG circle
* @param {Number} x The x position
* @param {Number} y The y position
* @param {Number} r The radius
*/
circle: function (x, y, r) {
var attr = isObject(x) ?
x :
{
x: x,
y: y,
r: r
},
wrapper = this.createElement('circle');
wrapper.xSetter = function (value) {
this.element.setAttribute('cx', value);
};
wrapper.ySetter = function (value) {
this.element.setAttribute('cy', value);
};
return wrapper.attr(attr);
},
/**
* Draw and return an arc
* @param {Number} x X position
* @param {Number} y Y position
* @param {Number} r Radius
* @param {Number} innerR Inner radius like used in donut charts
* @param {Number} start Starting angle
* @param {Number} end Ending angle
*/
arc: function (x, y, r, innerR, start, end) {
var arc;
if (isObject(x)) {
y = x.y;
r = x.r;
innerR = x.innerR;
start = x.start;
end = x.end;
x = x.x;
}
// Arcs are defined as symbols for the ability to set
// attributes in attr and animate
arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, {
innerR: innerR || 0,
start: start || 0,
end: end || 0
});
arc.r = r; // #959
return arc;
},
/**
* Draw and return a rectangle
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Number} width
* @param {Number} height
* @param {Number} r Border corner radius
* @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing
*/
rect: function (x, y, width, height, r, strokeWidth) {
r = isObject(x) ? x.r : r;
var wrapper = this.createElement('rect'),
attribs = isObject(x) ? x : x === UNDEFINED ? {} : {
x: x,
y: y,
width: mathMax(width, 0),
height: mathMax(height, 0)
};
if (strokeWidth !== UNDEFINED) {
attribs.strokeWidth = strokeWidth;
attribs = wrapper.crisp(attribs);
}
if (r) {
attribs.r = r;
}
wrapper.rSetter = function (value) {
attr(this.element, {
rx: value,
ry: value
});
};
return wrapper.attr(attribs);
},
/**
* Resize the box and re-align all aligned elements
* @param {Object} width
* @param {Object} height
* @param {Boolean} animate
*
*/
setSize: function (width, height, animate) {
var renderer = this,
alignedObjects = renderer.alignedObjects,
i = alignedObjects.length;
renderer.width = width;
renderer.height = height;
renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({
width: width,
height: height
});
while (i--) {
alignedObjects[i].align();
}
},
/**
* Create a group
* @param {String} name The group will be given a class name of 'highcharts-{name}'.
* This can be used for styling and scripting.
*/
g: function (name) {
var elem = this.createElement('g');
return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem;
},
/**
* Display an image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var attribs = {
preserveAspectRatio: NONE
},
elemWrapper;
// optional properties
if (arguments.length > 1) {
extend(attribs, {
x: x,
y: y,
width: width,
height: height
});
}
elemWrapper = this.createElement('image').attr(attribs);
// set the href in the xlink namespace
if (elemWrapper.element.setAttributeNS) {
elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink',
'href', src);
} else {
// could be exporting in IE
// using href throws "not supported" in ie7 and under, requries regex shim to fix later
elemWrapper.element.setAttribute('hc-svg-href', src);
}
return elemWrapper;
},
/**
* Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object.
*
* @param {Object} symbol
* @param {Object} x
* @param {Object} y
* @param {Object} radius
* @param {Object} options
*/
symbol: function (symbol, x, y, width, height, options) {
var obj,
// get the symbol definition function
symbolFn = this.symbols[symbol],
// check if there's a path defined for this symbol
path = symbolFn && symbolFn(
mathRound(x),
mathRound(y),
width,
height,
options
),
imageElement,
imageRegex = /^url\((.*?)\)$/,
imageSrc,
imageSize,
centerImage;
if (path) {
obj = this.path(path);
// expando properties for use in animate and attr
extend(obj, {
symbolName: symbol,
x: x,
y: y,
width: width,
height: height
});
if (options) {
extend(obj, options);
}
// image symbols
} else if (imageRegex.test(symbol)) {
// On image load, set the size and position
centerImage = function (img, size) {
if (img.element) { // it may be destroyed in the meantime (#1390)
img.attr({
width: size[0],
height: size[1]
});
if (!img.alignByTranslate) { // #185
img.translate(
mathRound((width - size[0]) / 2), // #1378
mathRound((height - size[1]) / 2)
);
}
}
};
imageSrc = symbol.match(imageRegex)[1];
imageSize = symbolSizes[imageSrc];
// Ireate the image synchronously, add attribs async
obj = this.image(imageSrc)
.attr({
x: x,
y: y
});
obj.isImg = true;
if (imageSize) {
centerImage(obj, imageSize);
} else {
// Initialize image to be 0 size so export will still function if there's no cached sizes.
//
obj.attr({ width: 0, height: 0 });
// Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8,
// the created element must be assigned to a variable in order to load (#292).
imageElement = createElement('img', {
onload: function () {
centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]);
},
src: imageSrc
});
}
}
return obj;
},
/**
* An extendable collection of functions for defining symbol paths.
*/
symbols: {
'circle': function (x, y, w, h) {
var cpw = 0.166 * w;
return [
M, x + w / 2, y,
'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h,
'C', x - cpw, y + h, x - cpw, y, x + w / 2, y,
'Z'
];
},
'square': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w, y + h,
x, y + h,
'Z'
];
},
'triangle': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h,
x, y + h,
'Z'
];
},
'triangle-down': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w / 2, y + h,
'Z'
];
},
'diamond': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h / 2,
x + w / 2, y + h,
x, y + h / 2,
'Z'
];
},
'arc': function (x, y, w, h, options) {
var start = options.start,
radius = options.r || w || h,
end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)
innerRadius = options.innerR,
open = options.open,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
longArc = options.end - start < mathPI ? 0 : 1;
return [
M,
x + radius * cosStart,
y + radius * sinStart,
'A', // arcTo
radius, // x radius
radius, // y radius
0, // slanting
longArc, // long or short arc
1, // clockwise
x + radius * cosEnd,
y + radius * sinEnd,
open ? M : L,
x + innerRadius * cosEnd,
y + innerRadius * sinEnd,
'A', // arcTo
innerRadius, // x radius
innerRadius, // y radius
0, // slanting
longArc, // long or short arc
0, // clockwise
x + innerRadius * cosStart,
y + innerRadius * sinStart,
open ? '' : 'Z' // close
];
},
/**
* Callout shape used for default tooltips, also used for rounded rectangles in VML
*/
callout: function (x, y, w, h, options) {
var arrowLength = 6,
halfDistance = 6,
r = mathMin((options && options.r) || 0, w, h),
safeDistance = r + halfDistance,
anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;
x += normalizer;
y += normalizer;
path = [
'M', x + r, y,
'L', x + w - r, y, // top side
'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
'L', x + w, y + h - r, // right side
'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
'L', x + r, y + h, // bottom side
'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
'L', x, y + r, // left side
'C', x, y, x, y, x + r, y // top-right corner
];
if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
path.splice(13, 3,
'L', x + w, anchorY - halfDistance,
x + w + arrowLength, anchorY,
x + w, anchorY + halfDistance,
x + w, y + h - r
);
} else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
path.splice(33, 3,
'L', x, anchorY + halfDistance,
x - arrowLength, anchorY,
x, anchorY - halfDistance,
x, y + r
);
} else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
path.splice(23, 3,
'L', anchorX + halfDistance, y + h,
anchorX, y + h + arrowLength,
anchorX - halfDistance, y + h,
x + r, y + h
);
} else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
path.splice(3, 3,
'L', anchorX - halfDistance, y,
anchorX, y - arrowLength,
anchorX + halfDistance, y,
w - r, y
);
}
return path;
}
},
/**
* Define a clipping rectangle
* @param {String} id
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
var wrapper,
id = PREFIX + idCounter++,
clipPath = this.createElement('clipPath').attr({
id: id
}).add(this.defs);
wrapper = this.rect(x, y, width, height, 0).add(clipPath);
wrapper.id = id;
wrapper.clipPath = clipPath;
return wrapper;
},
/**
* Add text to the SVG object
* @param {String} str
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Boolean} useHTML Use HTML to render the text
*/
text: function (str, x, y, useHTML) {
// declare variables
var renderer = this,
fakeSVG = useCanVG || (!hasSVG && renderer.forExport),
wrapper,
attr = {};
if (useHTML && !renderer.forExport) {
return renderer.html(str, x, y);
}
attr.x = Math.round(x || 0); // X is always needed for line-wrap logic
if (y) {
attr.y = Math.round(y);
}
if (str || str === 0) {
attr.text = str;
}
wrapper = renderer.createElement('text')
.attr(attr);
// Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063)
if (fakeSVG) {
wrapper.css({
position: ABSOLUTE
});
}
if (!useHTML) {
wrapper.xSetter = function (value, key, element) {
var tspans = element.getElementsByTagName('tspan'),
tspan,
parentVal = element.getAttribute(key),
i;
for (i = 0; i < tspans.length; i++) {
tspan = tspans[i];
// If the x values are equal, the tspan represents a linebreak
if (tspan.getAttribute(key) === parentVal) {
tspan.setAttribute(key, value);
}
}
element.setAttribute(key, value);
};
}
return wrapper;
},
/**
* Utility to return the baseline offset and total line height from the font size
*/
fontMetrics: function (fontSize, elem) {
fontSize = fontSize || this.style.fontSize;
if (elem && win.getComputedStyle) {
elem = elem.element || elem; // SVGElement
fontSize = win.getComputedStyle(elem, "").fontSize;
}
fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12;
// Empirical values found by comparing font size and bounding box height.
// Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/
var lineHeight = fontSize < 24 ? fontSize + 4 : mathRound(fontSize * 1.2),
baseline = mathRound(lineHeight * 0.8);
return {
h: lineHeight,
b: baseline,
f: fontSize
};
},
/**
* Add a label, a text item that can hold a colored or gradient background
* as well as a border and shadow.
* @param {string} str
* @param {Number} x
* @param {Number} y
* @param {String} shape
* @param {Number} anchorX In case the shape has a pointer, like a flag, this is the
* coordinates it should be pinned to
* @param {Number} anchorY
* @param {Boolean} baseline Whether to position the label relative to the text baseline,
* like renderer.text, or to the upper border of the rectangle.
* @param {String} className Class name for the group
*/
label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
var renderer = this,
wrapper = renderer.g(className),
text = renderer.text('', 0, 0, useHTML)
.attr({
zIndex: 1
}),
//.add(wrapper),
box,
bBox,
alignFactor = 0,
padding = 3,
paddingLeft = 0,
width,
height,
wrapperX,
wrapperY,
crispAdjust = 0,
deferredAttr = {},
baselineOffset,
needsBox;
/**
* This function runs after the label is added to the DOM (when the bounding box is
* available), and after the text of the label is updated to detect the new bounding
* box and reflect it in the border box.
*/
function updateBoxSize() {
var boxX,
boxY,
style = text.element.style;
bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && text.textStr &&
text.getBBox();
wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;
wrapper.height = (height || bBox.height || 0) + 2 * padding;
// update the label-scoped y offset
baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;
if (needsBox) {
// create the border box if it is not already present
if (!box) {
boxX = mathRound(-alignFactor * padding);
boxY = baseline ? -baselineOffset : 0;
wrapper.box = box = shape ?
renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :
renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);
box.attr('fill', NONE).add(wrapper);
}
// apply the box attributes
if (!box.isImg) { // #1630
box.attr(extend({
width: mathRound(wrapper.width),
height: mathRound(wrapper.height)
}, deferredAttr));
}
deferredAttr = null;
}
}
/**
* This function runs after setting text or padding, but only if padding is changed
*/
function updateTextPadding() {
var styles = wrapper.styles,
textAlign = styles && styles.textAlign,
x = paddingLeft + padding * (1 - alignFactor),
y;
// determin y based on the baseline
y = baseline ? 0 : baselineOffset;
// compensate for alignment
if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {
x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);
}
// update if anything changed
if (x !== text.x || y !== text.y) {
text.attr('x', x);
if (y !== UNDEFINED) {
text.attr('y', y);
}
}
// record current values
text.x = x;
text.y = y;
}
/**
* Set a box attribute, or defer it if the box is not yet created
* @param {Object} key
* @param {Object} value
*/
function boxAttr(key, value) {
if (box) {
box.attr(key, value);
} else {
deferredAttr[key] = value;
}
}
/**
* After the text element is added, get the desired size of the border box
* and add it before the text in the DOM.
*/
wrapper.onAdd = function () {
text.add(wrapper);
wrapper.attr({
text: str || '', // alignment is available now
x: x,
y: y
});
if (box && defined(anchorX)) {
wrapper.attr({
anchorX: anchorX,
anchorY: anchorY
});
}
};
/*
* Add specific attribute setters.
*/
// only change local variables
wrapper.widthSetter = function (value) {
width = value;
};
wrapper.heightSetter = function (value) {
height = value;
};
wrapper.paddingSetter = function (value) {
if (defined(value) && value !== padding) {
padding = value;
updateTextPadding();
}
};
wrapper.paddingLeftSetter = function (value) {
if (defined(value) && value !== paddingLeft) {
paddingLeft = value;
updateTextPadding();
}
};
// change local variable and prevent setting attribute on the group
wrapper.alignSetter = function (value) {
alignFactor = { left: 0, center: 0.5, right: 1 }[value];
};
// apply these to the box and the text alike
wrapper.textSetter = function (value) {
if (value !== UNDEFINED) {
text.textSetter(value);
}
updateBoxSize();
updateTextPadding();
};
// apply these to the box but not to the text
wrapper['stroke-widthSetter'] = function (value, key) {
if (value) {
needsBox = true;
}
crispAdjust = value % 2 / 2;
boxAttr(key, value);
};
wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) {
if (key === 'fill' && value) {
needsBox = true;
}
boxAttr(key, value);
};
wrapper.anchorXSetter = function (value, key) {
anchorX = value;
boxAttr(key, value + crispAdjust - wrapperX);
};
wrapper.anchorYSetter = function (value, key) {
anchorY = value;
boxAttr(key, value - wrapperY);
};
// rename attributes
wrapper.xSetter = function (value) {
wrapper.x = value; // for animation getter
if (alignFactor) {
value -= alignFactor * ((width || bBox.width) + padding);
}
wrapperX = mathRound(value);
wrapper.attr('translateX', wrapperX);
};
wrapper.ySetter = function (value) {
wrapperY = wrapper.y = mathRound(value);
wrapper.attr('translateY', wrapperY);
};
// Redirect certain methods to either the box or the text
var baseCss = wrapper.css;
return extend(wrapper, {
/**
* Pick up some properties and apply them to the text instead of the wrapper
*/
css: function (styles) {
if (styles) {
var textStyles = {};
styles = merge(styles); // create a copy to avoid altering the original object (#537)
each(wrapper.textProps, function (prop) {
if (styles[prop] !== UNDEFINED) {
textStyles[prop] = styles[prop];
delete styles[prop];
}
});
text.css(textStyles);
}
return baseCss.call(wrapper, styles);
},
/**
* Return the bounding box of the box, not the group
*/
getBBox: function () {
return {
width: bBox.width + 2 * padding,
height: bBox.height + 2 * padding,
x: bBox.x - padding,
y: bBox.y - padding
};
},
/**
* Apply the shadow to the box
*/
shadow: function (b) {
if (box) {
box.shadow(b);
}
return wrapper;
},
/**
* Destroy and release memory.
*/
destroy: function () {
// Added by button implementation
removeEvent(wrapper.element, 'mouseenter');
removeEvent(wrapper.element, 'mouseleave');
if (text) {
text = text.destroy();
}
if (box) {
box = box.destroy();
}
// Call base implementation to destroy the rest
SVGElement.prototype.destroy.call(wrapper);
// Release local pointers (#1298)
wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null;
}
});
}
}; // end SVGRenderer
// general renderer
Renderer = SVGRenderer;
// extend SvgElement for useHTML option
extend(SVGElement.prototype, {
/**
* Apply CSS to HTML elements. This is used in text within SVG rendering and
* by the VML renderer
*/
htmlCss: function (styles) {
var wrapper = this,
element = wrapper.element,
textWidth = styles && element.tagName === 'SPAN' && styles.width;
if (textWidth) {
delete styles.width;
wrapper.textWidth = textWidth;
wrapper.updateTransform();
}
wrapper.styles = extend(wrapper.styles, styles);
css(wrapper.element, styles);
return wrapper;
},
/**
* VML and useHTML method for calculating the bounding box based on offsets
* @param {Boolean} refresh Whether to force a fresh value from the DOM or to
* use the cached value
*
* @return {Object} A hash containing values for x, y, width and height
*/
htmlGetBBox: function () {
var wrapper = this,
element = wrapper.element,
bBox = wrapper.bBox;
// faking getBBox in exported SVG in legacy IE
if (!bBox) {
// faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?)
if (element.nodeName === 'text') {
element.style.position = ABSOLUTE;
}
bBox = wrapper.bBox = {
x: element.offsetLeft,
y: element.offsetTop,
width: element.offsetWidth,
height: element.offsetHeight
};
}
return bBox;
},
/**
* VML override private method to update elements based on internal
* properties based on SVG transform
*/
htmlUpdateTransform: function () {
// aligning non added elements is expensive
if (!this.added) {
this.alignOnAdd = true;
return;
}
var wrapper = this,
renderer = wrapper.renderer,
elem = wrapper.element,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
x = wrapper.x || 0,
y = wrapper.y || 0,
align = wrapper.textAlign || 'left',
alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
shadows = wrapper.shadows;
// apply translate
css(elem, {
marginLeft: translateX,
marginTop: translateY
});
if (shadows) { // used in labels/tooltip
each(shadows, function (shadow) {
css(shadow, {
marginLeft: translateX + 1,
marginTop: translateY + 1
});
});
}
// apply inversion
if (wrapper.inverted) { // wrapper is a group
each(elem.childNodes, function (child) {
renderer.invertChild(child, elem);
});
}
if (elem.tagName === 'SPAN') {
var width,
rotation = wrapper.rotation,
baseline,
textWidth = pInt(wrapper.textWidth),
currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');
if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed
baseline = renderer.fontMetrics(elem.style.fontSize).b;
// Renderer specific handling of span rotation
if (defined(rotation)) {
wrapper.setSpanRotation(rotation, alignCorrection, baseline);
}
width = pick(wrapper.elemWidth, elem.offsetWidth);
// Update textWidth
if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
css(elem, {
width: textWidth + PX,
display: 'block',
whiteSpace: 'normal'
});
width = textWidth;
}
wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);
}
// apply position with correction
css(elem, {
left: (x + (wrapper.xCorr || 0)) + PX,
top: (y + (wrapper.yCorr || 0)) + PX
});
// force reflow in webkit to apply the left and top on useHTML element (#1249)
if (isWebKit) {
baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose
}
// record current text transform
wrapper.cTT = currentTextTransform;
}
},
/**
* Set the rotation of an individual HTML span
*/
setSpanRotation: function (rotation, alignCorrection, baseline) {
var rotationStyle = {},
cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';
rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';
rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';
css(this.element, rotationStyle);
},
/**
* Get the correction in X and Y positioning as the element is rotated.
*/
getSpanCorrection: function (width, baseline, alignCorrection) {
this.xCorr = -width * alignCorrection;
this.yCorr = -baseline;
}
});
// Extend SvgRenderer for useHTML option.
extend(SVGRenderer.prototype, {
/**
* Create HTML text node. This is used by the VML renderer as well as the SVG
* renderer through the useHTML option.
*
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
html: function (str, x, y) {
var wrapper = this.createElement('span'),
element = wrapper.element,
renderer = wrapper.renderer;
// Text setter
wrapper.textSetter = function (value) {
if (value !== element.innerHTML) {
delete this.bBox;
}
element.innerHTML = this.textStr = value;
};
// Various setters which rely on update transform
wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) {
if (key === 'align') {
key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML.
}
wrapper[key] = value;
wrapper.htmlUpdateTransform();
};
// Set the default attributes
wrapper.attr({
text: str,
x: mathRound(x),
y: mathRound(y)
})
.css({
position: ABSOLUTE,
whiteSpace: 'nowrap',
fontFamily: this.style.fontFamily,
fontSize: this.style.fontSize
});
// Use the HTML specific .css method
wrapper.css = wrapper.htmlCss;
// This is specific for HTML within SVG
if (renderer.isSVG) {
wrapper.add = function (svgGroupWrapper) {
var htmlGroup,
container = renderer.box.parentNode,
parentGroup,
parents = [];
this.parentGroup = svgGroupWrapper;
// Create a mock group to hold the HTML elements
if (svgGroupWrapper) {
htmlGroup = svgGroupWrapper.div;
if (!htmlGroup) {
// Read the parent chain into an array and read from top down
parentGroup = svgGroupWrapper;
while (parentGroup) {
parents.push(parentGroup);
// Move up to the next parent group
parentGroup = parentGroup.parentGroup;
}
// Ensure dynamically updating position when any parent is translated
each(parents.reverse(), function (parentGroup) {
var htmlGroupStyle;
// Create a HTML div and append it to the parent div to emulate
// the SVG group structure
htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, {
className: attr(parentGroup.element, 'class')
}, {
position: ABSOLUTE,
left: (parentGroup.translateX || 0) + PX,
top: (parentGroup.translateY || 0) + PX
}, htmlGroup || container); // the top group is appended to container
// Shortcut
htmlGroupStyle = htmlGroup.style;
// Set listeners to update the HTML div's position whenever the SVG group
// position is changed
extend(parentGroup, {
translateXSetter: function (value, key) {
htmlGroupStyle.left = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
translateYSetter: function (value, key) {
htmlGroupStyle.top = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
visibilitySetter: function (value, key) {
htmlGroupStyle[key] = value;
}
});
});
}
} else {
htmlGroup = container;
}
htmlGroup.appendChild(element);
// Shared with VML:
wrapper.added = true;
if (wrapper.alignOnAdd) {
wrapper.htmlUpdateTransform();
}
return wrapper;
};
}
return wrapper;
}
});
/* ****************************************************************************
* *
* START OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
* For applications and websites that don't need IE support, like platform *
* targeted mobile apps and web apps, this code can be removed. *
* *
*****************************************************************************/
/**
* @constructor
*/
var VMLRenderer, VMLElement;
if (!hasSVG && !useCanVG) {
/**
* The VML element wrapper.
*/
VMLElement = {
/**
* Initialize a new VML element wrapper. It builds the markup as a string
* to minimize DOM traffic.
* @param {Object} renderer
* @param {Object} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this,
markup = ['<', nodeName, ' filled="f" stroked="f"'],
style = ['position: ', ABSOLUTE, ';'],
isDiv = nodeName === DIV;
// divs and shapes need size
if (nodeName === 'shape' || isDiv) {
style.push('left:0;top:0;width:1px;height:1px;');
}
style.push('visibility: ', isDiv ? HIDDEN : VISIBLE);
markup.push(' style="', style.join(''), '"/>');
// create element with default attributes and style
if (nodeName) {
markup = isDiv || nodeName === 'span' || nodeName === 'img' ?
markup.join('')
: renderer.prepVML(markup);
wrapper.element = createElement(markup);
}
wrapper.renderer = renderer;
},
/**
* Add the node to the given parent
* @param {Object} parent
*/
add: function (parent) {
var wrapper = this,
renderer = wrapper.renderer,
element = wrapper.element,
box = renderer.box,
inverted = parent && parent.inverted,
// get the parent node
parentNode = parent ?
parent.element || parent :
box;
// if the parent group is inverted, apply inversion on all children
if (inverted) { // only on groups
renderer.invertChild(element, parentNode);
}
// append it
parentNode.appendChild(element);
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.updateTransform();
}
// fire an event for internal hooks
if (wrapper.onAdd) {
wrapper.onAdd();
}
return wrapper;
},
/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,
/**
* Set the rotation of a span with oldIE's filter
*/
setSpanRotation: function () {
// Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented
// but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+
// has support for CSS3 transform. The getBBox method also needs to be updated
// to compensate for the rotation, like it currently does for SVG.
// Test case: http://jsfiddle.net/highcharts/Ybt44/
var rotation = this.rotation,
costheta = mathCos(rotation * deg2rad),
sintheta = mathSin(rotation * deg2rad);
css(this.element, {
filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta,
', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta,
', sizingMethod=\'auto expand\')'].join('') : NONE
});
},
/**
* Get the positioning correction for the span after rotating.
*/
getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) {
var costheta = rotation ? mathCos(rotation * deg2rad) : 1,
sintheta = rotation ? mathSin(rotation * deg2rad) : 0,
height = pick(this.elemHeight, this.element.offsetHeight),
quad,
nonLeft = align && align !== 'left';
// correct x and y
this.xCorr = costheta < 0 && -width;
this.yCorr = sintheta < 0 && -height;
// correct for baseline and corners spilling out after rotation
quad = costheta * sintheta < 0;
this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection);
this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1);
// correct for the length/height of the text
if (nonLeft) {
this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1);
if (rotation) {
this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1);
}
css(this.element, {
textAlign: align
});
}
},
/**
* Converts a subset of an SVG path definition to its VML counterpart. Takes an array
* as the parameter and returns a string.
*/
pathToVML: function (value) {
// convert paths
var i = value.length,
path = [];
while (i--) {
// Multiply by 10 to allow subpixel precision.
// Substracting half a pixel seems to make the coordinates
// align with SVG, but this hasn't been tested thoroughly
if (isNumber(value[i])) {
path[i] = mathRound(value[i] * 10) - 5;
} else if (value[i] === 'Z') { // close the path
path[i] = 'x';
} else {
path[i] = value[i];
// When the start X and end X coordinates of an arc are too close,
// they are rounded to the same value above. In this case, substract or
// add 1 from the end X and Y positions. #186, #760, #1371, #1410.
if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) {
// Start and end X
if (path[i + 5] === path[i + 7]) {
path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1;
}
// Start and end Y
if (path[i + 6] === path[i + 8]) {
path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1;
}
}
}
}
// Loop up again to handle path shortcuts (#2132)
/*while (i++ < path.length) {
if (path[i] === 'H') { // horizontal line to
path[i] = 'L';
path.splice(i + 2, 0, path[i - 1]);
} else if (path[i] === 'V') { // vertical line to
path[i] = 'L';
path.splice(i + 1, 0, path[i - 2]);
}
}*/
return path.join(' ') || 'x';
},
/**
* Set the element's clipping to a predefined rectangle
*
* @param {String} id The id of the clip rectangle
*/
clip: function (clipRect) {
var wrapper = this,
clipMembers,
cssRet;
if (clipRect) {
clipMembers = clipRect.members;
erase(clipMembers, wrapper); // Ensure unique list of elements (#1258)
clipMembers.push(wrapper);
wrapper.destroyClip = function () {
erase(clipMembers, wrapper);
};
cssRet = clipRect.getCSS(wrapper);
} else {
if (wrapper.destroyClip) {
wrapper.destroyClip();
}
cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214
}
return wrapper.css(cssRet);
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: SVGElement.prototype.htmlCss,
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
// discardElement will detach the node from its parent before attaching it
// to the garbage bin. Therefore it is important that the node is attached and have parent.
if (element.parentNode) {
discardElement(element);
}
},
/**
* Extend element.destroy by removing it from the clip members array
*/
destroy: function () {
if (this.destroyClip) {
this.destroyClip();
}
return SVGElement.prototype.destroy.apply(this);
},
/**
* Add an event listener. VML override for normalizing event parameters.
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
// simplest possible event model for internal use
this.element['on' + eventType] = function () {
var evt = win.event;
evt.target = evt.srcElement;
handler(evt);
};
return this;
},
/**
* In stacked columns, cut off the shadows so that they don't overlap
*/
cutOffPath: function (path, length) {
var len;
path = path.split(/[ ,]/);
len = path.length;
if (len === 9 || len === 11) {
path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length;
}
return path.join(' ');
},
/**
* Apply a drop shadow by copying elements and giving them different strokes
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
element = this.element,
renderer = this.renderer,
shadow,
elemStyle = element.style,
markup,
path = element.path,
strokeWidth,
modifiedPath,
shadowWidth,
shadowElementOpacity;
// some times empty paths are not strings
if (path && typeof path.value !== 'string') {
path = 'x';
}
modifiedPath = path;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
for (i = 1; i <= 3; i++) {
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
// Cut off shadows for stacked column items
if (cutOff) {
modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5);
}
markup = ['<shape isShadow="true" strokeweight="', strokeWidth,
'" filled="false" path="', modifiedPath,
'" coordsize="10 10" style="', element.style.cssText, '" />'];
shadow = createElement(renderer.prepVML(markup),
null, {
left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1),
top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1)
}
);
if (cutOff) {
shadow.cutOff = strokeWidth + 1;
}
// apply the opacity
markup = ['<stroke color="', shadowOptions.color || 'black', '" opacity="', shadowElementOpacity * i, '"/>'];
createElement(renderer.prepVML(markup), null, null, shadow);
// insert it
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
// record it
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
updateShadows: noop, // Used in SVG only
setAttr: function (key, value) {
if (docMode8) { // IE8 setAttribute bug
this.element[key] = value;
} else {
this.element.setAttribute(key, value);
}
},
classSetter: function (value) {
// IE8 Standards mode has problems retrieving the className unless set like this
this.element.className = value;
},
dashstyleSetter: function (value, key, element) {
var strokeElem = element.getElementsByTagName('stroke')[0] ||
createElement(this.renderer.prepVML(['<stroke/>']), null, null, element);
strokeElem[key] = value || 'solid';
this[key] = value; /* because changing stroke-width will change the dash length
and cause an epileptic effect */
},
dSetter: function (value, key, element) {
var i,
shadows = this.shadows;
value = value || [];
this.d = value.join && value.join(' '); // used in getter for animation
element.path = value = this.pathToVML(value);
// update shadows
if (shadows) {
i = shadows.length;
while (i--) {
shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value;
}
}
this.setAttr(key, value);
},
fillSetter: function (value, key, element) {
var nodeName = element.nodeName;
if (nodeName === 'SPAN') { // text color
element.style.color = value;
} else if (nodeName !== 'IMG') { // #1336
element.filled = value !== NONE;
this.setAttr('fillcolor', this.renderer.color(value, element, key, this));
}
},
opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts
rotationSetter: function (value, key, element) {
var style = element.style;
this[key] = style[key] = value; // style is for #1873
// Correction for the 1x1 size of the shape container. Used in gauge needles.
style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX;
style.top = mathRound(mathCos(value * deg2rad)) + PX;
},
strokeSetter: function (value, key, element) {
this.setAttr('strokecolor', this.renderer.color(value, element, key));
},
'stroke-widthSetter': function (value, key, element) {
element.stroked = !!value; // VML "stroked" attribute
this[key] = value; // used in getter, issue #113
if (isNumber(value)) {
value += PX;
}
this.setAttr('strokeweight', value);
},
titleSetter: function (value, key) {
this.setAttr(key, value);
},
visibilitySetter: function (value, key, element) {
// Handle inherited visibility
if (value === 'inherit') {
value = VISIBLE;
}
// Let the shadow follow the main element
if (this.shadows) {
each(this.shadows, function (shadow) {
shadow.style[key] = value;
});
}
// Instead of toggling the visibility CSS property, move the div out of the viewport.
// This works around #61 and #586
if (element.nodeName === 'DIV') {
value = value === HIDDEN ? '-999em' : 0;
// In order to redraw, IE7 needs the div to be visible when tucked away
// outside the viewport. So the visibility is actually opposite of
// the expected value. This applies to the tooltip only.
if (!docMode8) {
element.style[key] = value ? VISIBLE : HIDDEN;
}
key = 'top';
}
element.style[key] = value;
},
xSetter: function (value, key, element) {
this[key] = value; // used in getter
if (key === 'x') {
key = 'left';
} else if (key === 'y') {
key = 'top';
}/* else {
value = mathMax(0, value); // don't set width or height below zero (#311)
}*/
// clipping rectangle special
if (this.updateClipping) {
this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y'
this.updateClipping();
} else {
// normal
element.style[key] = value;
}
},
zIndexSetter: function (value, key, element) {
element.style[key] = value;
}
};
Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement);
// Some shared setters
VMLElement.prototype.ySetter =
VMLElement.prototype.widthSetter =
VMLElement.prototype.heightSetter =
VMLElement.prototype.xSetter;
/**
* The VML renderer
*/
var VMLRendererExtension = { // inherit SVGRenderer
Element: VMLElement,
isIE8: userAgent.indexOf('MSIE 8.0') > -1,
/**
* Initialize the VMLRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
*/
init: function (container, width, height, style) {
var renderer = this,
boxWrapper,
box,
css;
renderer.alignedObjects = [];
boxWrapper = renderer.createElement(DIV)
.css(extend(this.getStyle(style), { position: RELATIVE}));
box = boxWrapper.element;
container.appendChild(boxWrapper.element);
// generate the containing box
renderer.isVML = true;
renderer.box = box;
renderer.boxWrapper = boxWrapper;
renderer.cache = {};
renderer.setSize(width, height, false);
// The only way to make IE6 and IE7 print is to use a global namespace. However,
// with IE8 the only way to make the dynamic shapes visible in screen and print mode
// seems to be to add the xmlns attribute and the behaviour style inline.
if (!doc.namespaces.hcv) {
doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml');
// Setup default CSS (#2153, #2368, #2384)
css = 'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' +
'{ behavior:url(#default#VML); display: inline-block; } ';
try {
doc.createStyleSheet().cssText = css;
} catch (e) {
doc.styleSheets[0].cssText += css;
}
}
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none
*/
isHidden: function () {
return !this.box.offsetWidth;
},
/**
* Define a clipping rectangle. In VML it is accomplished by storing the values
* for setting the CSS style to all associated members.
*
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
// create a dummy element
var clipRect = this.createElement(),
isObj = isObject(x);
// mimic a rectangle with its style object for automatic updating in attr
return extend(clipRect, {
members: [],
left: (isObj ? x.x : x) + 1,
top: (isObj ? x.y : y) + 1,
width: (isObj ? x.width : width) - 1,
height: (isObj ? x.height : height) - 1,
getCSS: function (wrapper) {
var element = wrapper.element,
nodeName = element.nodeName,
isShape = nodeName === 'shape',
inverted = wrapper.inverted,
rect = this,
top = rect.top - (isShape ? element.offsetTop : 0),
left = rect.left,
right = left + rect.width,
bottom = top + rect.height,
ret = {
clip: 'rect(' +
mathRound(inverted ? left : top) + 'px,' +
mathRound(inverted ? bottom : right) + 'px,' +
mathRound(inverted ? right : bottom) + 'px,' +
mathRound(inverted ? top : left) + 'px)'
};
// issue 74 workaround
if (!inverted && docMode8 && nodeName === 'DIV') {
extend(ret, {
width: right + PX,
height: bottom + PX
});
}
return ret;
},
// used in attr and animation to update the clipping of all members
updateClipping: function () {
each(clipRect.members, function (member) {
if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do.
member.css(clipRect.getCSS(member));
}
});
}
});
},
/**
* Take a color and return it if it's a string, make it a gradient if it's a
* gradient configuration object, and apply opacity.
*
* @param {Object} color The color or config object
*/
color: function (color, elem, prop, wrapper) {
var renderer = this,
colorObject,
regexRgba = /^rgba/,
markup,
fillType,
ret = NONE;
// Check for linear or radial gradient
if (color && color.linearGradient) {
fillType = 'gradient';
} else if (color && color.radialGradient) {
fillType = 'pattern';
}
if (fillType) {
var stopColor,
stopOpacity,
gradient = color.linearGradient || color.radialGradient,
x1,
y1,
x2,
y2,
opacity1,
opacity2,
color1,
color2,
fillAttr = '',
stops = color.stops,
firstStop,
lastStop,
colors = [],
addFillNode = function () {
// Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2
// are reversed.
markup = ['<fill colors="' + colors.join(',') + '" opacity="', opacity2, '" o:opacity2="', opacity1,
'" type="', fillType, '" ', fillAttr, 'focus="100%" method="any" />'];
createElement(renderer.prepVML(markup), null, null, elem);
};
// Extend from 0 to 1
firstStop = stops[0];
lastStop = stops[stops.length - 1];
if (firstStop[0] > 0) {
stops.unshift([
0,
firstStop[1]
]);
}
if (lastStop[0] < 1) {
stops.push([
1,
lastStop[1]
]);
}
// Compute the stops
each(stops, function (stop, i) {
if (regexRgba.test(stop[1])) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
// Build the color attribute
colors.push((stop[0] * 100) + '% ' + stopColor);
// Only start and end opacities are allowed, so we use the first and the last
if (!i) {
opacity1 = stopOpacity;
color2 = stopColor;
} else {
opacity2 = stopOpacity;
color1 = stopColor;
}
});
// Apply the gradient to fills only.
if (prop === 'fill') {
// Handle linear gradient angle
if (fillType === 'gradient') {
x1 = gradient.x1 || gradient[0] || 0;
y1 = gradient.y1 || gradient[1] || 0;
x2 = gradient.x2 || gradient[2] || 0;
y2 = gradient.y2 || gradient[3] || 0;
fillAttr = 'angle="' + (90 - math.atan(
(y2 - y1) / // y vector
(x2 - x1) // x vector
) * 180 / mathPI) + '"';
addFillNode();
// Radial (circular) gradient
} else {
var r = gradient.r,
sizex = r * 2,
sizey = r * 2,
cx = gradient.cx,
cy = gradient.cy,
radialReference = elem.radialReference,
bBox,
applyRadialGradient = function () {
if (radialReference) {
bBox = wrapper.getBBox();
cx += (radialReference[0] - bBox.x) / bBox.width - 0.5;
cy += (radialReference[1] - bBox.y) / bBox.height - 0.5;
sizex *= radialReference[2] / bBox.width;
sizey *= radialReference[2] / bBox.height;
}
fillAttr = 'src="' + defaultOptions.global.VMLRadialGradientURL + '" ' +
'size="' + sizex + ',' + sizey + '" ' +
'origin="0.5,0.5" ' +
'position="' + cx + ',' + cy + '" ' +
'color2="' + color2 + '" ';
addFillNode();
};
// Apply radial gradient
if (wrapper.added) {
applyRadialGradient();
} else {
// We need to know the bounding box to get the size and position right
wrapper.onAdd = applyRadialGradient;
}
// The fill element's color attribute is broken in IE8 standards mode, so we
// need to set the parent shape's fillcolor attribute instead.
ret = color1;
}
// Gradients are not supported for VML stroke, return the first color. #722.
} else {
ret = stopColor;
}
// if the color is an rgba color, split it and add a fill node
// to hold the opacity component
} else if (regexRgba.test(color) && elem.tagName !== 'IMG') {
colorObject = Color(color);
markup = ['<', prop, ' opacity="', colorObject.get('a'), '"/>'];
createElement(this.prepVML(markup), null, null, elem);
ret = colorObject.get('rgb');
} else {
var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node
if (propNodes.length) {
propNodes[0].opacity = 1;
propNodes[0].type = 'solid';
}
ret = color;
}
return ret;
},
/**
* Take a VML string and prepare it for either IE8 or IE6/IE7.
* @param {Array} markup A string array of the VML markup to prepare
*/
prepVML: function (markup) {
var vmlStyle = 'display:inline-block;behavior:url(#default#VML);',
isIE8 = this.isIE8;
markup = markup.join('');
if (isIE8) { // add xmlns and style inline
markup = markup.replace('/>', ' xmlns="urn:schemas-microsoft-com:vml" />');
if (markup.indexOf('style="') === -1) {
markup = markup.replace('/>', ' style="' + vmlStyle + '" />');
} else {
markup = markup.replace('style="', 'style="' + vmlStyle);
}
} else { // add namespace
markup = markup.replace('<', '<hcv:');
}
return markup;
},
/**
* Create rotated and aligned text
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
text: SVGRenderer.prototype.html,
/**
* Create and return a path element
* @param {Array} path
*/
path: function (path) {
var attr = {
// subpixel precision down to 0.1 (width and height = 1px)
coordsize: '10 10'
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
// create the shape
return this.createElement('shape').attr(attr);
},
/**
* Create and return a circle element. In VML circles are implemented as
* shapes, which is faster than v:oval
* @param {Number} x
* @param {Number} y
* @param {Number} r
*/
circle: function (x, y, r) {
var circle = this.symbol('circle');
if (isObject(x)) {
r = x.r;
y = x.y;
x = x.x;
}
circle.isCircle = true; // Causes x and y to mean center (#1682)
circle.r = r;
return circle.attr({ x: x, y: y });
},
/**
* Create a group using an outer div and an inner v:group to allow rotating
* and flipping. A simple v:group would have problems with positioning
* child HTML elements and CSS clip.
*
* @param {String} name The name of the group
*/
g: function (name) {
var wrapper,
attribs;
// set the class name
if (name) {
attribs = { 'className': PREFIX + name, 'class': PREFIX + name };
}
// the div to hold HTML and clipping
wrapper = this.createElement(DIV).attr(attribs);
return wrapper;
},
/**
* VML override to create a regular HTML image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var obj = this.createElement('img')
.attr({ src: src });
if (arguments.length > 1) {
obj.attr({
x: x,
y: y,
width: width,
height: height
});
}
return obj;
},
/**
* For rectangles, VML uses a shape for rect to overcome bugs and rotation problems
*/
createElement: function (nodeName) {
return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName);
},
/**
* In the VML renderer, each child of an inverted div (group) is inverted
* @param {Object} element
* @param {Object} parentNode
*/
invertChild: function (element, parentNode) {
var ren = this,
parentStyle = parentNode.style,
imgStyle = element.tagName === 'IMG' && element.style; // #1111
css(element, {
flip: 'x',
left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1),
top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1),
rotation: -90
});
// Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806.
each(element.childNodes, function (child) {
ren.invertChild(child, element);
});
},
/**
* Symbol definitions that override the parent SVG renderer's symbols
*
*/
symbols: {
// VML specific arc function
arc: function (x, y, w, h, options) {
var start = options.start,
end = options.end,
radius = options.r || w || h,
innerRadius = options.innerR,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
ret;
if (end - start === 0) { // no angle, don't show it.
return ['x'];
}
ret = [
'wa', // clockwise arc to
x - radius, // left
y - radius, // top
x + radius, // right
y + radius, // bottom
x + radius * cosStart, // start x
y + radius * sinStart, // start y
x + radius * cosEnd, // end x
y + radius * sinEnd // end y
];
if (options.open && !innerRadius) {
ret.push(
'e',
M,
x,// - innerRadius,
y// - innerRadius
);
}
ret.push(
'at', // anti clockwise arc to
x - innerRadius, // left
y - innerRadius, // top
x + innerRadius, // right
y + innerRadius, // bottom
x + innerRadius * cosEnd, // start x
y + innerRadius * sinEnd, // start y
x + innerRadius * cosStart, // end x
y + innerRadius * sinStart, // end y
'x', // finish path
'e' // close
);
ret.isArc = true;
return ret;
},
// Add circle symbol path. This performs significantly faster than v:oval.
circle: function (x, y, w, h, wrapper) {
if (wrapper) {
w = h = 2 * wrapper.r;
}
// Center correction, #1682
if (wrapper && wrapper.isCircle) {
x -= w / 2;
y -= h / 2;
}
// Return the path
return [
'wa', // clockwisearcto
x, // left
y, // top
x + w, // right
y + h, // bottom
x + w, // start x
y + h / 2, // start y
x + w, // end x
y + h / 2, // end y
//'x', // finish path
'e' // close
];
},
/**
* Add rectangle symbol path which eases rotation and omits arcsize problems
* compared to the built-in VML roundrect shape. When borders are not rounded,
* use the simpler square path, else use the callout path without the arrow.
*/
rect: function (x, y, w, h, options) {
return SVGRenderer.prototype.symbols[
!defined(options) || !options.r ? 'square' : 'callout'
].call(0, x, y, w, h, options);
}
}
};
Highcharts.VMLRenderer = VMLRenderer = function () {
this.init.apply(this, arguments);
};
VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension);
// general renderer
Renderer = VMLRenderer;
}
// This method is used with exporting in old IE, when emulating SVG (see #2314)
SVGRenderer.prototype.measureSpanWidth = function (text, styles) {
var measuringSpan = doc.createElement('span'),
offsetWidth,
textNode = doc.createTextNode(text);
measuringSpan.appendChild(textNode);
css(measuringSpan, styles);
this.box.appendChild(measuringSpan);
offsetWidth = measuringSpan.offsetWidth;
discardElement(measuringSpan); // #2463
return offsetWidth;
};
/* ****************************************************************************
* *
* END OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
*****************************************************************************/
/* ****************************************************************************
* *
* START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT *
* TARGETING THAT SYSTEM. *
* *
*****************************************************************************/
var CanVGRenderer,
CanVGController;
if (useCanVG) {
/**
* The CanVGRenderer is empty from start to keep the source footprint small.
* When requested, the CanVGController downloads the rest of the source packaged
* together with the canvg library.
*/
Highcharts.CanVGRenderer = CanVGRenderer = function () {
// Override the global SVG namespace to fake SVG/HTML that accepts CSS
SVG_NS = 'http://www.w3.org/1999/xhtml';
};
/**
* Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but
* the implementation from SvgRenderer will not be merged in until first render.
*/
CanVGRenderer.prototype.symbols = {};
/**
* Handles on demand download of canvg rendering support.
*/
CanVGController = (function () {
// List of renderering calls
var deferredRenderCalls = [];
/**
* When downloaded, we are ready to draw deferred charts.
*/
function drawDeferred() {
var callLength = deferredRenderCalls.length,
callIndex;
// Draw all pending render calls
for (callIndex = 0; callIndex < callLength; callIndex++) {
deferredRenderCalls[callIndex]();
}
// Clear the list
deferredRenderCalls = [];
}
return {
push: function (func, scriptLocation) {
// Only get the script once
if (deferredRenderCalls.length === 0) {
getScript(scriptLocation, drawDeferred);
}
// Register render call
deferredRenderCalls.push(func);
}
};
}());
Renderer = CanVGRenderer;
} // end CanVGRenderer
/* ****************************************************************************
* *
* END OF ANDROID < 3 SPECIFIC CODE *
* *
*****************************************************************************/
/**
* The Tick class
*/
function Tick(axis, pos, type, noLabel) {
this.axis = axis;
this.pos = pos;
this.type = type || '';
this.isNew = true;
if (!type && !noLabel) {
this.addLabel();
}
}
Tick.prototype = {
/**
* Write the tick label
*/
addLabel: function () {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
horiz = axis.horiz,
categories = axis.categories,
names = axis.names,
pos = tick.pos,
labelOptions = options.labels,
rotation = labelOptions.rotation,
str,
tickPositions = axis.tickPositions,
width = (horiz && categories &&
!labelOptions.step && !labelOptions.staggerLines &&
!labelOptions.rotation &&
chart.plotWidth / tickPositions.length) ||
(!horiz && (chart.margin[3] || chart.chartWidth * 0.33)), // #1580, #1931
isFirst = pos === tickPositions[0],
isLast = pos === tickPositions[tickPositions.length - 1],
css,
attr,
value = categories ?
pick(categories[pos], names[pos], pos) :
pos,
label = tick.label,
tickPositionInfo = tickPositions.info,
dateTimeLabelFormat;
// Set the datetime label format. If a higher rank is set for this position, use that. If not,
// use the general format.
if (axis.isDatetimeAxis && tickPositionInfo) {
dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];
}
// set properties for access in render method
tick.isFirst = isFirst;
tick.isLast = isLast;
// get the string
str = axis.labelFormatter.call({
axis: axis,
chart: chart,
isFirst: isFirst,
isLast: isLast,
dateTimeLabelFormat: dateTimeLabelFormat,
value: axis.isLog ? correctFloat(lin2log(value)) : value
});
// prepare CSS
css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };
css = extend(css, labelOptions.style);
// first call
if (!defined(label)) {
attr = {
align: axis.labelAlign
};
if (isNumber(rotation)) {
attr.rotation = rotation;
}
if (width && labelOptions.ellipsis) {
css.HcHeight = axis.len / tickPositions.length;
}
tick.label = label =
defined(str) && labelOptions.enabled ?
chart.renderer.text(
str,
0,
0,
labelOptions.useHTML
)
.attr(attr)
// without position absolute, IE export sometimes is wrong
.css(css)
.add(axis.labelGroup) :
null;
// Set the tick baseline and correct for rotation (#1764)
axis.tickBaseline = chart.renderer.fontMetrics(labelOptions.style.fontSize, label).b;
if (rotation && axis.side === 2) {
axis.tickBaseline *= mathCos(rotation * deg2rad);
}
// update
} else if (label) {
label.attr({
text: str
})
.css(css);
}
tick.yOffset = label ? pick(labelOptions.y, axis.tickBaseline + (axis.side === 2 ? 8 : -(label.getBBox().height / 2))) : 0;
},
/**
* Get the offset height or width of the label
*/
getLabelSize: function () {
var label = this.label,
axis = this.axis;
return label ?
label.getBBox()[axis.horiz ? 'height' : 'width'] :
0;
},
/**
* Find how far the labels extend to the right and left of the tick's x position. Used for anti-collision
* detection with overflow logic.
*/
getLabelSides: function () {
var bBox = this.label.getBBox(),
axis = this.axis,
horiz = axis.horiz,
options = axis.options,
labelOptions = options.labels,
size = horiz ? bBox.width : bBox.height,
leftSide = horiz ?
labelOptions.x - size * { left: 0, center: 0.5, right: 1 }[axis.labelAlign] :
0,
rightSide = horiz ?
size + leftSide :
size;
return [leftSide, rightSide];
},
/**
* Handle the label overflow by adjusting the labels to the left and right edge, or
* hide them if they collide into the neighbour label.
*/
handleOverflow: function (index, xy) {
var show = true,
axis = this.axis,
isFirst = this.isFirst,
isLast = this.isLast,
horiz = axis.horiz,
pxPos = horiz ? xy.x : xy.y,
reversed = axis.reversed,
tickPositions = axis.tickPositions,
sides = this.getLabelSides(),
leftSide = sides[0],
rightSide = sides[1],
axisLeft,
axisRight,
neighbour,
neighbourEdge,
line = this.label.line || 0,
labelEdge = axis.labelEdge,
justifyLabel = axis.justifyLabels && (isFirst || isLast),
justifyToPlot;
// Hide it if it now overlaps the neighbour label
if (labelEdge[line] === UNDEFINED || pxPos + leftSide > labelEdge[line]) {
labelEdge[line] = pxPos + rightSide;
} else if (!justifyLabel) {
show = false;
}
if (justifyLabel) {
justifyToPlot = axis.justifyToPlot;
axisLeft = justifyToPlot ? axis.pos : 0;
axisRight = justifyToPlot ? axisLeft + axis.len : axis.chart.chartWidth;
// Find the firsth neighbour on the same line
do {
index += (isFirst ? 1 : -1);
neighbour = axis.ticks[tickPositions[index]];
} while (tickPositions[index] && (!neighbour || !neighbour.label || neighbour.label.line !== line)); // #3044
neighbourEdge = neighbour && neighbour.label.xy && neighbour.label.xy.x + neighbour.getLabelSides()[isFirst ? 0 : 1];
if ((isFirst && !reversed) || (isLast && reversed)) {
// Is the label spilling out to the left of the plot area?
if (pxPos + leftSide < axisLeft) {
// Align it to plot left
pxPos = axisLeft - leftSide;
// Hide it if it now overlaps the neighbour label
if (neighbour && pxPos + rightSide > neighbourEdge) {
show = false;
}
}
} else {
// Is the label spilling out to the right of the plot area?
if (pxPos + rightSide > axisRight) {
// Align it to plot right
pxPos = axisRight - rightSide;
// Hide it if it now overlaps the neighbour label
if (neighbour && pxPos + leftSide < neighbourEdge) {
show = false;
}
}
}
// Set the modified x position of the label
xy.x = pxPos;
}
return show;
},
/**
* Get the x and y position for ticks and labels
*/
getPosition: function (horiz, pos, tickmarkOffset, old) {
var axis = this.axis,
chart = axis.chart,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight;
return {
x: horiz ?
axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB :
axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0),
y: horiz ?
cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) :
cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB
};
},
/**
* Get the x, y position of the tick label
*/
getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
var axis = this.axis,
transA = axis.transA,
reversed = axis.reversed,
staggerLines = axis.staggerLines;
x = x + labelOptions.x - (tickmarkOffset && horiz ?
tickmarkOffset * transA * (reversed ? -1 : 1) : 0);
y = y + this.yOffset - (tickmarkOffset && !horiz ?
tickmarkOffset * transA * (reversed ? 1 : -1) : 0);
// Correct for staggered labels
if (staggerLines) {
label.line = (index / (step || 1) % staggerLines);
y += label.line * (axis.labelOffset / staggerLines);
}
return {
x: x,
y: y
};
},
/**
* Extendible method to return the path of the marker
*/
getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) {
return renderer.crispLine([
M,
x,
y,
L,
x + (horiz ? 0 : -tickLength),
y + (horiz ? tickLength : 0)
], tickWidth);
},
/**
* Put everything in place
*
* @param index {Number}
* @param old {Boolean} Use old coordinates to prepare an animation into new position
*/
render: function (index, old, opacity) {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
renderer = chart.renderer,
horiz = axis.horiz,
type = tick.type,
label = tick.label,
pos = tick.pos,
labelOptions = options.labels,
gridLine = tick.gridLine,
gridPrefix = type ? type + 'Grid' : 'grid',
tickPrefix = type ? type + 'Tick' : 'tick',
gridLineWidth = options[gridPrefix + 'LineWidth'],
gridLineColor = options[gridPrefix + 'LineColor'],
dashStyle = options[gridPrefix + 'LineDashStyle'],
tickLength = options[tickPrefix + 'Length'],
tickWidth = options[tickPrefix + 'Width'] || 0,
tickColor = options[tickPrefix + 'Color'],
tickPosition = options[tickPrefix + 'Position'],
gridLinePath,
mark = tick.mark,
markPath,
step = labelOptions.step,
attribs,
show = true,
tickmarkOffset = axis.tickmarkOffset,
xy = tick.getPosition(horiz, pos, tickmarkOffset, old),
x = xy.x,
y = xy.y,
reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687
opacity = pick(opacity, 1);
this.isActive = true;
// create the grid line
if (gridLineWidth) {
gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true);
if (gridLine === UNDEFINED) {
attribs = {
stroke: gridLineColor,
'stroke-width': gridLineWidth
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
}
if (!type) {
attribs.zIndex = 1;
}
if (old) {
attribs.opacity = 0;
}
tick.gridLine = gridLine =
gridLineWidth ?
renderer.path(gridLinePath)
.attr(attribs).add(axis.gridGroup) :
null;
}
// If the parameter 'old' is set, the current call will be followed
// by another call, therefore do not do any animations this time
if (!old && gridLine && gridLinePath) {
gridLine[tick.isNew ? 'attr' : 'animate']({
d: gridLinePath,
opacity: opacity
});
}
}
// create the tick mark
if (tickWidth && tickLength) {
// negate the length
if (tickPosition === 'inside') {
tickLength = -tickLength;
}
if (axis.opposite) {
tickLength = -tickLength;
}
markPath = tick.getMarkPath(x, y, tickLength, tickWidth * reverseCrisp, horiz, renderer);
if (mark) { // updating
mark.animate({
d: markPath,
opacity: opacity
});
} else { // first time
tick.mark = renderer.path(
markPath
).attr({
stroke: tickColor,
'stroke-width': tickWidth,
opacity: opacity
}).add(axis.axisGroup);
}
}
// the label is created on init - now move it into place
if (label && !isNaN(x)) {
label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);
// Apply show first and show last. If the tick is both first and last, it is
// a single centered tick, in which case we show the label anyway (#2100).
if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) ||
(tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) {
show = false;
// Handle label overflow and show or hide accordingly
} else if (!axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) {
show = tick.handleOverflow(index, xy);
}
// apply step
if (step && index % step) {
// show those indices dividable by step
show = false;
}
// Set the new position, and show or hide
if (show && !isNaN(xy.y)) {
xy.opacity = opacity;
label[tick.isNew ? 'attr' : 'animate'](xy);
tick.isNew = false;
} else {
label.attr('y', -9999); // #1338
}
}
},
/**
* Destructor for the tick prototype
*/
destroy: function () {
destroyObjectProperties(this, this.axis);
}
};
/**
* Create a new axis object
* @param {Object} chart
* @param {Object} options
*/
function Axis() {
this.init.apply(this, arguments);
}
Axis.prototype = {
/**
* Default options for the X axis - the Y axis has extended defaults
*/
defaultOptions: {
// allowDecimals: null,
// alternateGridColor: null,
// categories: [],
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
},
endOnTick: false,
gridLineColor: '#C0C0C0',
// gridLineDashStyle: 'solid',
// gridLineWidth: 0,
// reversed: false,
labels: defaultLabelOptions,
// { step: null },
lineColor: '#C0D0E0',
lineWidth: 1,
//linkedTo: null,
//max: undefined,
//min: undefined,
minPadding: 0.01,
maxPadding: 0.01,
//minRange: null,
minorGridLineColor: '#E0E0E0',
// minorGridLineDashStyle: null,
minorGridLineWidth: 1,
minorTickColor: '#A0A0A0',
//minorTickInterval: null,
minorTickLength: 2,
minorTickPosition: 'outside', // inside or outside
//minorTickWidth: 0,
//opposite: false,
//offset: 0,
//plotBands: [{
// events: {},
// zIndex: 1,
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//plotLines: [{
// events: {}
// dashStyle: {}
// zIndex:
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//reversed: false,
// showFirstLabel: true,
// showLastLabel: true,
startOfWeek: 1,
startOnTick: false,
tickColor: '#C0D0E0',
//tickInterval: null,
tickLength: 10,
tickmarkPlacement: 'between', // on or between
tickPixelInterval: 100,
tickPosition: 'outside',
tickWidth: 1,
title: {
//text: null,
align: 'middle', // low, middle or high
//margin: 0 for horizontal, 10 for vertical axes,
//rotation: 0,
//side: 'outside',
style: {
color: '#707070'
}
//x: 0,
//y: 0
},
type: 'linear' // linear, logarithmic or datetime
},
/**
* This options set extends the defaultOptions for Y axes
*/
defaultYAxisOptions: {
endOnTick: true,
gridLineWidth: 1,
tickPixelInterval: 72,
showLastLabel: true,
labels: {
x: -8,
y: 3
},
lineWidth: 0,
maxPadding: 0.05,
minPadding: 0.05,
startOnTick: true,
tickWidth: 0,
title: {
rotation: 270,
text: 'Values'
},
stackLabels: {
enabled: false,
//align: dynamic,
//y: dynamic,
//x: dynamic,
//verticalAlign: dynamic,
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
return numberFormat(this.total, -1);
},
style: defaultLabelOptions.style
}
},
/**
* These options extend the defaultOptions for left axes
*/
defaultLeftAxisOptions: {
labels: {
x: -15,
y: null
},
title: {
rotation: 270
}
},
/**
* These options extend the defaultOptions for right axes
*/
defaultRightAxisOptions: {
labels: {
x: 15,
y: null
},
title: {
rotation: 90
}
},
/**
* These options extend the defaultOptions for bottom axes
*/
defaultBottomAxisOptions: {
labels: {
x: 0,
y: null // based on font size
// overflow: undefined,
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* These options extend the defaultOptions for left axes
*/
defaultTopAxisOptions: {
labels: {
x: 0,
y: -15
// overflow: undefined
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* Initialize the axis
*/
init: function (chart, userOptions) {
var isXAxis = userOptions.isX,
axis = this;
// Flag, is the axis horizontal
axis.horiz = chart.inverted ? !isXAxis : isXAxis;
// Flag, isXAxis
axis.isXAxis = isXAxis;
axis.coll = isXAxis ? 'xAxis' : 'yAxis';
axis.opposite = userOptions.opposite; // needed in setOptions
axis.side = userOptions.side || (axis.horiz ?
(axis.opposite ? 0 : 2) : // top : bottom
(axis.opposite ? 1 : 3)); // right : left
axis.setOptions(userOptions);
var options = this.options,
type = options.type,
isDatetimeAxis = type === 'datetime';
axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format
// Flag, stagger lines or not
axis.userOptions = userOptions;
//axis.axisTitleMargin = UNDEFINED,// = options.title.margin,
axis.minPixelPadding = 0;
//axis.ignoreMinPadding = UNDEFINED; // can be set to true by a column or bar series
//axis.ignoreMaxPadding = UNDEFINED;
axis.chart = chart;
axis.reversed = options.reversed;
axis.zoomEnabled = options.zoomEnabled !== false;
// Initial categories
axis.categories = options.categories || type === 'category';
axis.names = [];
// Elements
//axis.axisGroup = UNDEFINED;
//axis.gridGroup = UNDEFINED;
//axis.axisTitle = UNDEFINED;
//axis.axisLine = UNDEFINED;
// Shorthand types
axis.isLog = type === 'logarithmic';
axis.isDatetimeAxis = isDatetimeAxis;
// Flag, if axis is linked to another axis
axis.isLinked = defined(options.linkedTo);
// Linked axis.
//axis.linkedParent = UNDEFINED;
// Tick positions
//axis.tickPositions = UNDEFINED; // array containing predefined positions
// Tick intervals
//axis.tickInterval = UNDEFINED;
//axis.minorTickInterval = UNDEFINED;
axis.tickmarkOffset = (axis.categories && options.tickmarkPlacement === 'between') ? 0.5 : 0;
// Major ticks
axis.ticks = {};
axis.labelEdge = [];
// Minor ticks
axis.minorTicks = {};
//axis.tickAmount = UNDEFINED;
// List of plotLines/Bands
axis.plotLinesAndBands = [];
// Alternate bands
axis.alternateBands = {};
// Axis metrics
//axis.left = UNDEFINED;
//axis.top = UNDEFINED;
//axis.width = UNDEFINED;
//axis.height = UNDEFINED;
//axis.bottom = UNDEFINED;
//axis.right = UNDEFINED;
//axis.transA = UNDEFINED;
//axis.transB = UNDEFINED;
//axis.oldTransA = UNDEFINED;
axis.len = 0;
//axis.oldMin = UNDEFINED;
//axis.oldMax = UNDEFINED;
//axis.oldUserMin = UNDEFINED;
//axis.oldUserMax = UNDEFINED;
//axis.oldAxisLength = UNDEFINED;
axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;
axis.range = options.range;
axis.offset = options.offset || 0;
// Dictionary for stacks
axis.stacks = {};
axis.oldStacks = {};
// Min and max in the data
//axis.dataMin = UNDEFINED,
//axis.dataMax = UNDEFINED,
// The axis range
axis.max = null;
axis.min = null;
// User set min and max
//axis.userMin = UNDEFINED,
//axis.userMax = UNDEFINED,
// Crosshair options
axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false);
// Run Axis
var eventType,
events = axis.options.events;
// Register
if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update()
if (isXAxis && !this.isColorAxis) { // #2713
chart.axes.splice(chart.xAxis.length, 0, axis);
} else {
chart.axes.push(axis);
}
chart[axis.coll].push(axis);
}
axis.series = axis.series || []; // populated by Series
// inverted charts have reversed xAxes as default
if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) {
axis.reversed = true;
}
axis.removePlotBand = axis.removePlotBandOrLine;
axis.removePlotLine = axis.removePlotBandOrLine;
// register event listeners
for (eventType in events) {
addEvent(axis, eventType, events[eventType]);
}
// extend logarithmic axis
if (axis.isLog) {
axis.val2lin = log2lin;
axis.lin2val = lin2log;
}
},
/**
* Merge and set options
*/
setOptions: function (userOptions) {
this.options = merge(
this.defaultOptions,
this.isXAxis ? {} : this.defaultYAxisOptions,
[this.defaultTopAxisOptions, this.defaultRightAxisOptions,
this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side],
merge(
defaultOptions[this.coll], // if set in setOptions (#1053)
userOptions
)
);
},
/**
* The default label formatter. The context is a special config object for the label.
*/
defaultLabelFormatter: function () {
var axis = this.axis,
value = this.value,
categories = axis.categories,
dateTimeLabelFormat = this.dateTimeLabelFormat,
numericSymbols = defaultOptions.lang.numericSymbols,
i = numericSymbols && numericSymbols.length,
multi,
ret,
formatOption = axis.options.labels.format,
// make sure the same symbol is added for all labels on a linear axis
numericSymbolDetector = axis.isLog ? value : axis.tickInterval;
if (formatOption) {
ret = format(formatOption, this);
} else if (categories) {
ret = value;
} else if (dateTimeLabelFormat) { // datetime axis
ret = dateFormat(dateTimeLabelFormat, value);
} else if (i && numericSymbolDetector >= 1000) {
// Decide whether we should add a numeric symbol like k (thousands) or M (millions).
// If we are to enable this in tooltip or other places as well, we can move this
// logic to the numberFormatter and enable it by a parameter.
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
ret = numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
ret = numberFormat(value, 0);
} else { // small numbers
ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
return ret;
},
/**
* Get the minimum and maximum for the series of each axis
*/
getSeriesExtremes: function () {
var axis = this,
chart = axis.chart;
axis.hasVisibleSeries = false;
// reset dataMin and dataMax in case we're redrawing
axis.dataMin = axis.dataMax = null;
if (axis.buildStacks) {
axis.buildStacks();
}
// loop through this axis' series
each(axis.series, function (series) {
if (series.visible || !chart.options.chart.ignoreHiddenSeries) {
var seriesOptions = series.options,
xData,
threshold = seriesOptions.threshold,
seriesDataMin,
seriesDataMax;
axis.hasVisibleSeries = true;
// Validate threshold in logarithmic axes
if (axis.isLog && threshold <= 0) {
threshold = null;
}
// Get dataMin and dataMax for X axes
if (axis.isXAxis) {
xData = series.xData;
if (xData.length) {
axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));
axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));
}
// Get dataMin and dataMax for Y axes, as well as handle stacking and processed data
} else {
// Get this particular series extremes
series.getExtremes();
seriesDataMax = series.dataMax;
seriesDataMin = series.dataMin;
// Get the dataMin and dataMax so far. If percentage is used, the min and max are
// always 0 and 100. If seriesDataMin and seriesDataMax is null, then series
// doesn't have active y data, we continue with nulls
if (defined(seriesDataMin) && defined(seriesDataMax)) {
axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);
axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);
}
// Adjust to threshold
if (defined(threshold)) {
if (axis.dataMin >= threshold) {
axis.dataMin = threshold;
axis.ignoreMinPadding = true;
} else if (axis.dataMax < threshold) {
axis.dataMax = threshold;
axis.ignoreMaxPadding = true;
}
}
}
}
});
},
/**
* Translate from axis value to pixel position on the chart, or back
*
*/
translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
var axis = this,
sign = 1,
cvsOffset = 0,
localA = old ? axis.oldTransA : axis.transA,
localMin = old ? axis.oldMin : axis.min,
returnValue,
minPixelPadding = axis.minPixelPadding,
postTranslate = (axis.options.ordinal || (axis.isLog && handleLog)) && axis.lin2val;
if (!localA) {
localA = axis.transA;
}
// In vertical axes, the canvas coordinates start from 0 at the top like in
// SVG.
if (cvsCoord) {
sign *= -1; // canvas coordinates inverts the value
cvsOffset = axis.len;
}
// Handle reversed axis
if (axis.reversed) {
sign *= -1;
cvsOffset -= sign * (axis.sector || axis.len);
}
// From pixels to value
if (backwards) { // reverse translation
val = val * sign + cvsOffset;
val -= minPixelPadding;
returnValue = val / localA + localMin; // from chart pixel to value
if (postTranslate) { // log and ordinal axes
returnValue = axis.lin2val(returnValue);
}
// From value to pixels
} else {
if (postTranslate) { // log and ordinal axes
val = axis.val2lin(val);
}
if (pointPlacement === 'between') {
pointPlacement = 0.5;
}
returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +
(isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);
}
return returnValue;
},
/**
* Utility method to translate an axis value to pixel position.
* @param {Number} value A value in terms of axis units
* @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart
* or just the axis/pane itself.
*/
toPixels: function (value, paneCoordinates) {
return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos);
},
/*
* Utility method to translate a pixel position in to an axis value
* @param {Number} pixel The pixel value coordinate
* @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the
* axis/pane itself.
*/
toValue: function (pixel, paneCoordinates) {
return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);
},
/**
* Create the path for a plot line that goes from the given value on
* this axis, across the plot to the opposite side
* @param {Number} value
* @param {Number} lineWidth Used for calculation crisp line
* @param {Number] old Use old coordinates (for resizing and rescaling)
*/
getPlotLinePath: function (value, lineWidth, old, force, translatedValue) {
var axis = this,
chart = axis.chart,
axisLeft = axis.left,
axisTop = axis.top,
x1,
y1,
x2,
y2,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight,
cWidth = (old && chart.oldChartWidth) || chart.chartWidth,
skip,
transB = axis.transB;
translatedValue = pick(translatedValue, axis.translate(value, null, null, old));
x1 = x2 = mathRound(translatedValue + transB);
y1 = y2 = mathRound(cHeight - translatedValue - transB);
if (isNaN(translatedValue)) { // no min or max
skip = true;
} else if (axis.horiz) {
y1 = axisTop;
y2 = cHeight - axis.bottom;
if (x1 < axisLeft || x1 > axisLeft + axis.width) {
skip = true;
}
} else {
x1 = axisLeft;
x2 = cWidth - axis.right;
if (y1 < axisTop || y1 > axisTop + axis.height) {
skip = true;
}
}
return skip && !force ?
null :
chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1);
},
/**
* Set the tick positions of a linear axis to round values like whole tens or every five.
*/
getLinearTickPositions: function (tickInterval, min, max) {
var pos,
lastPos,
roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),
roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),
tickPositions = [];
// For single points, add a tick regardless of the relative position (#2662)
if (min === max && isNumber(min)) {
return [min];
}
// Populate the intermediate values
pos = roundedMin;
while (pos <= roundedMax) {
// Place the tick on the rounded value
tickPositions.push(pos);
// Always add the raw tickInterval, not the corrected one.
pos = correctFloat(pos + tickInterval);
// If the interval is not big enough in the current min - max range to actually increase
// the loop variable, we need to break out to prevent endless loop. Issue #619
if (pos === lastPos) {
break;
}
// Record the last value
lastPos = pos;
}
return tickPositions;
},
/**
* Return the minor tick positions. For logarithmic axes, reuse the same logic
* as for major ticks.
*/
getMinorTickPositions: function () {
var axis = this,
options = axis.options,
tickPositions = axis.tickPositions,
minorTickInterval = axis.minorTickInterval,
minorTickPositions = [],
pos,
i,
len;
if (axis.isLog) {
len = tickPositions.length;
for (i = 1; i < len; i++) {
minorTickPositions = minorTickPositions.concat(
axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)
);
}
} else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314
minorTickPositions = minorTickPositions.concat(
axis.getTimeTicks(
axis.normalizeTimeTickInterval(minorTickInterval),
axis.min,
axis.max,
options.startOfWeek
)
);
if (minorTickPositions[0] < axis.min) {
minorTickPositions.shift();
}
} else {
for (pos = axis.min + (tickPositions[0] - axis.min) % minorTickInterval; pos <= axis.max; pos += minorTickInterval) {
minorTickPositions.push(pos);
}
}
return minorTickPositions;
},
/**
* Adjust the min and max for the minimum range. Keep in mind that the series data is
* not yet processed, so we don't have information on data cropping and grouping, or
* updated axis.pointRange or series.pointRange. The data can't be processed until
* we have finally established min and max.
*/
adjustForMinRange: function () {
var axis = this,
options = axis.options,
min = axis.min,
max = axis.max,
zoomOffset,
spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange,
closestDataRange,
i,
distance,
xData,
loopLength,
minArgs,
maxArgs;
// Set the automatic minimum range based on the closest point distance
if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) {
if (defined(options.min) || defined(options.max)) {
axis.minRange = null; // don't do this again
} else {
// Find the closest distance between raw data points, as opposed to
// closestPointRange that applies to processed points (cropped and grouped)
each(axis.series, function (series) {
xData = series.xData;
loopLength = series.xIncrement ? 1 : xData.length - 1;
for (i = loopLength; i > 0; i--) {
distance = xData[i] - xData[i - 1];
if (closestDataRange === UNDEFINED || distance < closestDataRange) {
closestDataRange = distance;
}
}
});
axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin);
}
}
// if minRange is exceeded, adjust
if (max - min < axis.minRange) {
var minRange = axis.minRange;
zoomOffset = (minRange - max + min) / 2;
// if min and max options have been set, don't go beyond it
minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)];
if (spaceAvailable) { // if space is available, stay within the data range
minArgs[2] = axis.dataMin;
}
min = arrayMax(minArgs);
maxArgs = [min + minRange, pick(options.max, min + minRange)];
if (spaceAvailable) { // if space is availabe, stay within the data range
maxArgs[2] = axis.dataMax;
}
max = arrayMin(maxArgs);
// now if the max is adjusted, adjust the min back
if (max - min < minRange) {
minArgs[0] = max - minRange;
minArgs[1] = pick(options.min, max - minRange);
min = arrayMax(minArgs);
}
}
// Record modified extremes
axis.min = min;
axis.max = max;
},
/**
* Update translation information
*/
setAxisTranslation: function (saveOld) {
var axis = this,
range = axis.max - axis.min,
pointRange = axis.axisPointRange || 0,
closestPointRange,
minPointOffset = 0,
pointRangePadding = 0,
linkedParent = axis.linkedParent,
ordinalCorrection,
hasCategories = !!axis.categories,
transA = axis.transA;
// Adjust translation for padding. Y axis with categories need to go through the same (#1784).
if (axis.isXAxis || hasCategories || pointRange) {
if (linkedParent) {
minPointOffset = linkedParent.minPointOffset;
pointRangePadding = linkedParent.pointRangePadding;
} else {
each(axis.series, function (series) {
var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
pointPlacement = series.options.pointPlacement,
seriesClosestPointRange = series.closestPointRange;
if (seriesPointRange > range) { // #1446
seriesPointRange = 0;
}
pointRange = mathMax(pointRange, seriesPointRange);
// minPointOffset is the value padding to the left of the axis in order to make
// room for points with a pointRange, typically columns. When the pointPlacement option
// is 'between' or 'on', this padding does not apply.
minPointOffset = mathMax(
minPointOffset,
isString(pointPlacement) ? 0 : seriesPointRange / 2
);
// Determine the total padding needed to the length of the axis to make room for the
// pointRange. If the series' pointPlacement is 'on', no padding is added.
pointRangePadding = mathMax(
pointRangePadding,
pointPlacement === 'on' ? 0 : seriesPointRange
);
// Set the closestPointRange
if (!series.noSharedTooltip && defined(seriesClosestPointRange)) {
closestPointRange = defined(closestPointRange) ?
mathMin(closestPointRange, seriesClosestPointRange) :
seriesClosestPointRange;
}
});
}
// Record minPointOffset and pointRangePadding
ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853
axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection;
axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection;
// pointRange means the width reserved for each point, like in a column chart
axis.pointRange = mathMin(pointRange, range);
// closestPointRange means the closest distance between points. In columns
// it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange
// is some other value
axis.closestPointRange = closestPointRange;
}
// Secondary values
if (saveOld) {
axis.oldTransA = transA;
}
axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1);
axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend
axis.minPixelPadding = transA * minPointOffset;
},
/**
* Set the tick positions to round values and optionally extend the extremes
* to the nearest tick
*/
setTickPositions: function (secondPass) {
var axis = this,
chart = axis.chart,
options = axis.options,
startOnTick = options.startOnTick,
endOnTick = options.endOnTick,
isLog = axis.isLog,
isDatetimeAxis = axis.isDatetimeAxis,
isXAxis = axis.isXAxis,
isLinked = axis.isLinked,
tickPositioner = axis.options.tickPositioner,
maxPadding = options.maxPadding,
minPadding = options.minPadding,
length,
linkedParentExtremes,
tickIntervalOption = options.tickInterval,
minTickIntervalOption = options.minTickInterval,
tickPixelIntervalOption = options.tickPixelInterval,
tickPositions,
keepTwoTicksOnly,
categories = axis.categories;
// linked axis gets the extremes from the parent axis
if (isLinked) {
axis.linkedParent = chart[axis.coll][options.linkedTo];
linkedParentExtremes = axis.linkedParent.getExtremes();
axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);
axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);
if (options.type !== axis.linkedParent.options.type) {
error(11, 1); // Can't link axes of different type
}
} else { // initial min and max from the extreme data values
axis.min = pick(axis.userMin, options.min, axis.dataMin);
axis.max = pick(axis.userMax, options.max, axis.dataMax);
}
if (isLog) {
if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978
error(10, 1); // Can't plot negative values on log axis
}
axis.min = correctFloat(log2lin(axis.min)); // correctFloat cures #934
axis.max = correctFloat(log2lin(axis.max));
}
// handle zoomed range
if (axis.range && defined(axis.max)) {
axis.userMin = axis.min = mathMax(axis.min, axis.max - axis.range); // #618
axis.userMax = axis.max;
axis.range = null; // don't use it when running setExtremes
}
// Hook for adjusting this.min and this.max. Used by bubble series.
if (axis.beforePadding) {
axis.beforePadding();
}
// adjust min and max for the minimum range
axis.adjustForMinRange();
// Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding
// into account, we do this after computing tick interval (#1337).
if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) {
length = axis.max - axis.min;
if (length) {
if (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {
axis.min -= length * minPadding;
}
if (!defined(options.max) && !defined(axis.userMax) && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {
axis.max += length * maxPadding;
}
}
}
// Stay within floor and ceiling
if (isNumber(options.floor)) {
axis.min = mathMax(axis.min, options.floor);
}
if (isNumber(options.ceiling)) {
axis.max = mathMin(axis.max, options.ceiling);
}
// get tickInterval
if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) {
axis.tickInterval = 1;
} else if (isLinked && !tickIntervalOption &&
tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) {
axis.tickInterval = axis.linkedParent.tickInterval;
} else {
axis.tickInterval = pick(
tickIntervalOption,
categories ? // for categoried axis, 1 is default, for linear axis use tickPix
1 :
// don't let it be more than the data range
(axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption)
);
// For squished axes, set only two ticks
if (!defined(tickIntervalOption) && axis.len < tickPixelIntervalOption && !this.isRadial &&
!this.isLog && !categories && startOnTick && endOnTick) {
keepTwoTicksOnly = true;
axis.tickInterval /= 4; // tick extremes closer to the real values
}
}
// Now we're finished detecting min and max, crop and group series data. This
// is in turn needed in order to find tick positions in ordinal axes.
if (isXAxis && !secondPass) {
each(axis.series, function (series) {
series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax);
});
}
// set the translation factor used in translate function
axis.setAxisTranslation(true);
// hook for ordinal axes and radial axes
if (axis.beforeSetTickPositions) {
axis.beforeSetTickPositions();
}
// hook for extensions, used in Highstock ordinal axes
if (axis.postProcessTickInterval) {
axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval);
}
// In column-like charts, don't cramp in more ticks than there are points (#1943)
if (axis.pointRange) {
axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval);
}
// Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined.
if (!tickIntervalOption && axis.tickInterval < minTickIntervalOption) {
axis.tickInterval = minTickIntervalOption;
}
// for linear axes, get magnitude and normalize the interval
if (!isDatetimeAxis && !isLog) { // linear
if (!tickIntervalOption) {
axis.tickInterval = normalizeTickInterval(axis.tickInterval, null, getMagnitude(axis.tickInterval), options);
}
}
// get minorTickInterval
axis.minorTickInterval = options.minorTickInterval === 'auto' && axis.tickInterval ?
axis.tickInterval / 5 : options.minorTickInterval;
// find the tick positions
axis.tickPositions = tickPositions = options.tickPositions ?
[].concat(options.tickPositions) : // Work on a copy (#1565)
(tickPositioner && tickPositioner.apply(axis, [axis.min, axis.max]));
if (!tickPositions) {
// Too many ticks
if (!axis.ordinalPositions && (axis.max - axis.min) / axis.tickInterval > mathMax(2 * axis.len, 200)) {
error(19, true);
}
if (isDatetimeAxis) {
tickPositions = axis.getTimeTicks(
axis.normalizeTimeTickInterval(axis.tickInterval, options.units),
axis.min,
axis.max,
options.startOfWeek,
axis.ordinalPositions,
axis.closestPointRange,
true
);
} else if (isLog) {
tickPositions = axis.getLogTickPositions(axis.tickInterval, axis.min, axis.max);
} else {
tickPositions = axis.getLinearTickPositions(axis.tickInterval, axis.min, axis.max);
}
if (keepTwoTicksOnly) {
tickPositions.splice(1, tickPositions.length - 2);
}
axis.tickPositions = tickPositions;
}
if (!isLinked) {
// reset min/max or remove extremes based on start/end on tick
var roundedMin = tickPositions[0],
roundedMax = tickPositions[tickPositions.length - 1],
minPointOffset = axis.minPointOffset || 0,
singlePad;
// Prevent all ticks from being removed (#3195)
if (!startOnTick && !endOnTick && !categories && tickPositions.length === 2) {
tickPositions.splice(1, 0, (roundedMax + roundedMin) / 2);
}
if (startOnTick) {
axis.min = roundedMin;
} else if (axis.min - minPointOffset > roundedMin) {
tickPositions.shift();
}
if (endOnTick) {
axis.max = roundedMax;
} else if (axis.max + minPointOffset < roundedMax) {
tickPositions.pop();
}
// When there is only one point, or all points have the same value on this axis, then min
// and max are equal and tickPositions.length is 0 or 1. In this case, add some padding
// in order to center the point, but leave it with one tick. #1337.
if (tickPositions.length === 1) {
singlePad = mathAbs(axis.max) > 10e12 ? 1 : 0.001; // The lowest possible number to avoid extra padding on columns (#2619, #2846)
axis.min -= singlePad;
axis.max += singlePad;
}
}
},
/**
* Set the max ticks of either the x and y axis collection
*/
setMaxTicks: function () {
var chart = this.chart,
maxTicks = chart.maxTicks || {},
tickPositions = this.tickPositions,
key = this._maxTicksKey = [this.coll, this.pos, this.len].join('-');
if (!this.isLinked && !this.isDatetimeAxis && tickPositions && tickPositions.length > (maxTicks[key] || 0) && this.options.alignTicks !== false) {
maxTicks[key] = tickPositions.length;
}
chart.maxTicks = maxTicks;
},
/**
* When using multiple axes, adjust the number of ticks to match the highest
* number of ticks in that group
*/
adjustTickAmount: function () {
var axis = this,
chart = axis.chart,
key = axis._maxTicksKey,
tickPositions = axis.tickPositions,
maxTicks = chart.maxTicks;
if (maxTicks && maxTicks[key] && !axis.isDatetimeAxis && !axis.categories && !axis.isLinked &&
axis.options.alignTicks !== false && this.min !== UNDEFINED) {
var oldTickAmount = axis.tickAmount,
calculatedTickAmount = tickPositions.length,
tickAmount;
// set the axis-level tickAmount to use below
axis.tickAmount = tickAmount = maxTicks[key];
if (calculatedTickAmount < tickAmount) {
while (tickPositions.length < tickAmount) {
tickPositions.push(correctFloat(
tickPositions[tickPositions.length - 1] + axis.tickInterval
));
}
axis.transA *= (calculatedTickAmount - 1) / (tickAmount - 1);
axis.max = tickPositions[tickPositions.length - 1];
}
if (defined(oldTickAmount) && tickAmount !== oldTickAmount) {
axis.isDirty = true;
}
}
},
/**
* Set the scale based on data min and max, user set min and max or options
*
*/
setScale: function () {
var axis = this,
stacks = axis.stacks,
type,
i,
isDirtyData,
isDirtyAxisLength;
axis.oldMin = axis.min;
axis.oldMax = axis.max;
axis.oldAxisLength = axis.len;
// set the new axisLength
axis.setAxisSize();
//axisLength = horiz ? axisWidth : axisHeight;
isDirtyAxisLength = axis.len !== axis.oldAxisLength;
// is there new data?
each(axis.series, function (series) {
if (series.isDirtyData || series.isDirty ||
series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well
isDirtyData = true;
}
});
// do we really need to go through all this?
if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw ||
axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax) {
// reset stacks
if (!axis.isXAxis) {
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].total = null;
stacks[type][i].cum = 0;
}
}
}
axis.forceRedraw = false;
// get data extremes if needed
axis.getSeriesExtremes();
// get fixed positions based on tickInterval
axis.setTickPositions();
// record old values to decide whether a rescale is necessary later on (#540)
axis.oldUserMin = axis.userMin;
axis.oldUserMax = axis.userMax;
// Mark as dirty if it is not already set to dirty and extremes have changed. #595.
if (!axis.isDirty) {
axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax;
}
} else if (!axis.isXAxis) {
if (axis.oldStacks) {
stacks = axis.stacks = axis.oldStacks;
}
// reset stacks
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].cum = stacks[type][i].total;
}
}
}
// Set the maximum tick amount
axis.setMaxTicks();
},
/**
* Set the extremes and optionally redraw
* @param {Number} newMin
* @param {Number} newMax
* @param {Boolean} redraw
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
* @param {Object} eventArguments
*
*/
setExtremes: function (newMin, newMax, redraw, animation, eventArguments) {
var axis = this,
chart = axis.chart;
redraw = pick(redraw, true); // defaults to true
// Extend the arguments with min and max
eventArguments = extend(eventArguments, {
min: newMin,
max: newMax
});
// Fire the event
fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler
axis.userMin = newMin;
axis.userMax = newMax;
axis.eventArgs = eventArguments;
// Mark for running afterSetExtremes
axis.isDirtyExtremes = true;
// redraw
if (redraw) {
chart.redraw(animation);
}
});
},
/**
* Overridable method for zooming chart. Pulled out in a separate method to allow overriding
* in stock charts.
*/
zoom: function (newMin, newMax) {
var dataMin = this.dataMin,
dataMax = this.dataMax,
options = this.options;
// Prevent pinch zooming out of range. Check for defined is for #1946. #1734.
if (!this.allowZoomOutside) {
if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {
newMin = UNDEFINED;
}
if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {
newMax = UNDEFINED;
}
}
// In full view, displaying the reset zoom button is not required
this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;
// Do it
this.setExtremes(
newMin,
newMax,
false,
UNDEFINED,
{ trigger: 'zoom' }
);
return true;
},
/**
* Update the axis metrics
*/
setAxisSize: function () {
var chart = this.chart,
options = this.options,
offsetLeft = options.offsetLeft || 0,
offsetRight = options.offsetRight || 0,
horiz = this.horiz,
width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight),
height = pick(options.height, chart.plotHeight),
top = pick(options.top, chart.plotTop),
left = pick(options.left, chart.plotLeft + offsetLeft),
percentRegex = /%$/;
// Check for percentage based input values
if (percentRegex.test(height)) {
height = parseInt(height, 10) / 100 * chart.plotHeight;
}
if (percentRegex.test(top)) {
top = parseInt(top, 10) / 100 * chart.plotHeight + chart.plotTop;
}
// Expose basic values to use in Series object and navigator
this.left = left;
this.top = top;
this.width = width;
this.height = height;
this.bottom = chart.chartHeight - height - top;
this.right = chart.chartWidth - width - left;
// Direction agnostic properties
this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905
this.pos = horiz ? left : top; // distance from SVG origin
},
/**
* Get the actual axis extremes
*/
getExtremes: function () {
var axis = this,
isLog = axis.isLog;
return {
min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,
max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,
dataMin: axis.dataMin,
dataMax: axis.dataMax,
userMin: axis.userMin,
userMax: axis.userMax
};
},
/**
* Get the zero plane either based on zero or on the min or max value.
* Used in bar and area plots
*/
getThreshold: function (threshold) {
var axis = this,
isLog = axis.isLog;
var realMin = isLog ? lin2log(axis.min) : axis.min,
realMax = isLog ? lin2log(axis.max) : axis.max;
if (realMin > threshold || threshold === null) {
threshold = realMin;
} else if (realMax < threshold) {
threshold = realMax;
}
return axis.translate(threshold, 0, 1, 0, 1);
},
/**
* Compute auto alignment for the axis label based on which side the axis is on
* and the given rotation for the label
*/
autoLabelAlign: function (rotation) {
var ret,
angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360;
if (angle > 15 && angle < 165) {
ret = 'right';
} else if (angle > 195 && angle < 345) {
ret = 'left';
} else {
ret = 'center';
}
return ret;
},
/**
* Render the tick labels to a preliminary position to get their sizes
*/
getOffset: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
tickPositions = axis.tickPositions,
ticks = axis.ticks,
horiz = axis.horiz,
side = axis.side,
invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side,
hasData,
showAxis,
titleOffset = 0,
titleOffsetOption,
titleMargin = 0,
axisTitleOptions = options.title,
labelOptions = options.labels,
labelOffset = 0, // reset
labelOffsetPadded,
axisOffset = chart.axisOffset,
clipOffset = chart.clipOffset,
directionFactor = [-1, 1, 1, -1][side],
n,
i,
autoStaggerLines = 1,
maxStaggerLines = pick(labelOptions.maxStaggerLines, 5),
sortedPositions,
lastRight,
overlap,
pos,
bBox,
x,
w,
lineNo,
lineHeightCorrection;
// For reuse in Axis.render
axis.hasData = hasData = (axis.hasVisibleSeries || (defined(axis.min) && defined(axis.max) && !!tickPositions));
axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
// Set/reset staggerLines
axis.staggerLines = axis.horiz && labelOptions.staggerLines;
// Create the axisGroup and gridGroup elements on first iteration
if (!axis.axisGroup) {
axis.gridGroup = renderer.g('grid')
.attr({ zIndex: options.gridZIndex || 1 })
.add();
axis.axisGroup = renderer.g('axis')
.attr({ zIndex: options.zIndex || 2 })
.add();
axis.labelGroup = renderer.g('axis-labels')
.attr({ zIndex: labelOptions.zIndex || 7 })
.addClass(PREFIX + axis.coll.toLowerCase() + '-labels')
.add();
}
if (hasData || axis.isLinked) {
// Set the explicit or automatic label alignment
axis.labelAlign = pick(labelOptions.align || axis.autoLabelAlign(labelOptions.rotation));
// Generate ticks
each(tickPositions, function (pos) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
} else {
ticks[pos].addLabel(); // update labels depending on tick interval
}
});
// Handle automatic stagger lines
if (axis.horiz && !axis.staggerLines && maxStaggerLines && !labelOptions.rotation) {
sortedPositions = axis.reversed ? [].concat(tickPositions).reverse() : tickPositions;
while (autoStaggerLines < maxStaggerLines) {
lastRight = [];
overlap = false;
for (i = 0; i < sortedPositions.length; i++) {
pos = sortedPositions[i];
bBox = ticks[pos].label && ticks[pos].label.getBBox();
w = bBox ? bBox.width : 0;
lineNo = i % autoStaggerLines;
if (w) {
x = axis.translate(pos); // don't handle log
if (lastRight[lineNo] !== UNDEFINED && x < lastRight[lineNo]) {
overlap = true;
}
lastRight[lineNo] = x + w;
}
}
if (overlap) {
autoStaggerLines++;
} else {
break;
}
}
if (autoStaggerLines > 1) {
axis.staggerLines = autoStaggerLines;
}
}
each(tickPositions, function (pos) {
// left side must be align: right and right side must have align: left for labels
if (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign) {
// get the highest offset
labelOffset = mathMax(
ticks[pos].getLabelSize(),
labelOffset
);
}
});
if (axis.staggerLines) {
labelOffset *= axis.staggerLines;
axis.labelOffset = labelOffset;
}
} else { // doesn't have data
for (n in ticks) {
ticks[n].destroy();
delete ticks[n];
}
}
if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) {
if (!axis.axisTitle) {
axis.axisTitle = renderer.text(
axisTitleOptions.text,
0,
0,
axisTitleOptions.useHTML
)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation || 0,
align:
axisTitleOptions.textAlign ||
{ low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]
})
.addClass(PREFIX + this.coll.toLowerCase() + '-title')
.css(axisTitleOptions.style)
.add(axis.axisGroup);
axis.axisTitle.isNew = true;
}
if (showAxis) {
titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];
titleOffsetOption = axisTitleOptions.offset;
titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10);
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[showAxis ? 'show' : 'hide']();
}
// handle automatic or user set offset
axis.offset = directionFactor * pick(options.offset, axisOffset[side]);
lineHeightCorrection = side === 2 ? axis.tickBaseline : 0;
labelOffsetPadded = labelOffset + titleMargin +
(labelOffset && (directionFactor * (horiz ? pick(labelOptions.y, axis.tickBaseline + 8) : labelOptions.x) - lineHeightCorrection));
axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);
axisOffset[side] = mathMax(
axisOffset[side],
axis.axisTitleMargin + titleOffset + directionFactor * axis.offset,
labelOffsetPadded // #3027
);
clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], mathFloor(options.lineWidth / 2) * 2);
},
/**
* Get the path for the axis line
*/
getLinePath: function (lineWidth) {
var chart = this.chart,
opposite = this.opposite,
offset = this.offset,
horiz = this.horiz,
lineLeft = this.left + (opposite ? this.width : 0) + offset,
lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset;
if (opposite) {
lineWidth *= -1; // crispify the other way - #1480, #1687
}
return chart.renderer.crispLine([
M,
horiz ?
this.left :
lineLeft,
horiz ?
lineTop :
this.top,
L,
horiz ?
chart.chartWidth - this.right :
lineLeft,
horiz ?
lineTop :
chart.chartHeight - this.bottom
], lineWidth);
},
/**
* Position the title
*/
getTitlePosition: function () {
// compute anchor points for each of the title align options
var horiz = this.horiz,
axisLeft = this.left,
axisTop = this.top,
axisLength = this.len,
axisTitleOptions = this.options.title,
margin = horiz ? axisLeft : axisTop,
opposite = this.opposite,
offset = this.offset,
fontSize = pInt(axisTitleOptions.style.fontSize || 12),
// the position in the length direction of the axis
alongAxis = {
low: margin + (horiz ? 0 : axisLength),
middle: margin + axisLength / 2,
high: margin + (horiz ? axisLength : 0)
}[axisTitleOptions.align],
// the position in the perpendicular direction of the axis
offAxis = (horiz ? axisTop + this.height : axisLeft) +
(horiz ? 1 : -1) * // horizontal axis reverses the margin
(opposite ? -1 : 1) * // so does opposite axes
this.axisTitleMargin +
(this.side === 2 ? fontSize : 0);
return {
x: horiz ?
alongAxis :
offAxis + (opposite ? this.width : 0) + offset +
(axisTitleOptions.x || 0), // x
y: horiz ?
offAxis - (opposite ? this.height : 0) + offset :
alongAxis + (axisTitleOptions.y || 0) // y
};
},
/**
* Render the axis
*/
render: function () {
var axis = this,
horiz = axis.horiz,
reversed = axis.reversed,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
isLog = axis.isLog,
isLinked = axis.isLinked,
tickPositions = axis.tickPositions,
sortedPositions,
axisTitle = axis.axisTitle,
ticks = axis.ticks,
minorTicks = axis.minorTicks,
alternateBands = axis.alternateBands,
stackLabelOptions = options.stackLabels,
alternateGridColor = options.alternateGridColor,
tickmarkOffset = axis.tickmarkOffset,
lineWidth = options.lineWidth,
linePath,
hasRendered = chart.hasRendered,
slideInTicks = hasRendered && defined(axis.oldMin) && !isNaN(axis.oldMin),
hasData = axis.hasData,
showAxis = axis.showAxis,
from,
overflow = options.labels.overflow,
justifyLabels = axis.justifyLabels = horiz && overflow !== false,
to;
// Reset
axis.labelEdge.length = 0;
axis.justifyToPlot = overflow === 'justify';
// Mark all elements inActive before we go over and mark the active ones
each([ticks, minorTicks, alternateBands], function (coll) {
var pos;
for (pos in coll) {
coll[pos].isActive = false;
}
});
// If the series has data draw the ticks. Else only the line and title
if (hasData || isLinked) {
// minor ticks
if (axis.minorTickInterval && !axis.categories) {
each(axis.getMinorTickPositions(), function (pos) {
if (!minorTicks[pos]) {
minorTicks[pos] = new Tick(axis, pos, 'minor');
}
// render new ticks in old position
if (slideInTicks && minorTicks[pos].isNew) {
minorTicks[pos].render(null, true);
}
minorTicks[pos].render(null, false, 1);
});
}
// Major ticks. Pull out the first item and render it last so that
// we can get the position of the neighbour label. #808.
if (tickPositions.length) { // #1300
sortedPositions = tickPositions.slice();
if ((horiz && reversed) || (!horiz && !reversed)) {
sortedPositions.reverse();
}
if (justifyLabels) {
sortedPositions = sortedPositions.slice(1).concat([sortedPositions[0]]);
}
each(sortedPositions, function (pos, i) {
// Reorganize the indices
if (justifyLabels) {
i = (i === sortedPositions.length - 1) ? 0 : i + 1;
}
// linked axes need an extra check to find out if
if (!isLinked || (pos >= axis.min && pos <= axis.max)) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
}
// render new ticks in old position
if (slideInTicks && ticks[pos].isNew) {
ticks[pos].render(i, true, 0.1);
}
ticks[pos].render(i);
}
});
// In a categorized axis, the tick marks are displayed between labels. So
// we need to add a tick mark and grid line at the left edge of the X axis.
if (tickmarkOffset && axis.min === 0) {
if (!ticks[-1]) {
ticks[-1] = new Tick(axis, -1, null, true);
}
ticks[-1].render(-1);
}
}
// alternate grid color
if (alternateGridColor) {
each(tickPositions, function (pos, i) {
if (i % 2 === 0 && pos < axis.max) {
if (!alternateBands[pos]) {
alternateBands[pos] = new Highcharts.PlotLineOrBand(axis);
}
from = pos + tickmarkOffset; // #949
to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max;
alternateBands[pos].options = {
from: isLog ? lin2log(from) : from,
to: isLog ? lin2log(to) : to,
color: alternateGridColor
};
alternateBands[pos].render();
alternateBands[pos].isActive = true;
}
});
}
// custom plot lines and bands
if (!axis._addedPlotLB) { // only first time
each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) {
axis.addPlotBandOrLine(plotLineOptions);
});
axis._addedPlotLB = true;
}
} // end if hasData
// Remove inactive ticks
each([ticks, minorTicks, alternateBands], function (coll) {
var pos,
i,
forDestruction = [],
delay = globalAnimation ? globalAnimation.duration || 500 : 0,
destroyInactiveItems = function () {
i = forDestruction.length;
while (i--) {
// When resizing rapidly, the same items may be destroyed in different timeouts,
// or the may be reactivated
if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) {
coll[forDestruction[i]].destroy();
delete coll[forDestruction[i]];
}
}
};
for (pos in coll) {
if (!coll[pos].isActive) {
// Render to zero opacity
coll[pos].render(pos, false, 0);
coll[pos].isActive = false;
forDestruction.push(pos);
}
}
// When the objects are finished fading out, destroy them
if (coll === alternateBands || !chart.hasRendered || !delay) {
destroyInactiveItems();
} else if (delay) {
setTimeout(destroyInactiveItems, delay);
}
});
// Static items. As the axis group is cleared on subsequent calls
// to render, these items are added outside the group.
// axis line
if (lineWidth) {
linePath = axis.getLinePath(lineWidth);
if (!axis.axisLine) {
axis.axisLine = renderer.path(linePath)
.attr({
stroke: options.lineColor,
'stroke-width': lineWidth,
zIndex: 7
})
.add(axis.axisGroup);
} else {
axis.axisLine.animate({ d: linePath });
}
// show or hide the line depending on options.showEmpty
axis.axisLine[showAxis ? 'show' : 'hide']();
}
if (axisTitle && showAxis) {
axisTitle[axisTitle.isNew ? 'attr' : 'animate'](
axis.getTitlePosition()
);
axisTitle.isNew = false;
}
// Stacked totals:
if (stackLabelOptions && stackLabelOptions.enabled) {
axis.renderStackTotals();
}
// End stacked totals
axis.isDirty = false;
},
/**
* Redraw the axis to reflect changes in the data or axis extremes
*/
redraw: function () {
// render the axis
this.render();
// move plot lines and bands
each(this.plotLinesAndBands, function (plotLine) {
plotLine.render();
});
// mark associated series as dirty and ready for redraw
each(this.series, function (series) {
series.isDirty = true;
});
},
/**
* Destroys an Axis instance.
*/
destroy: function (keepEvents) {
var axis = this,
stacks = axis.stacks,
stackKey,
plotLinesAndBands = axis.plotLinesAndBands,
i;
// Remove the events
if (!keepEvents) {
removeEvent(axis);
}
// Destroy each stack total
for (stackKey in stacks) {
destroyObjectProperties(stacks[stackKey]);
stacks[stackKey] = null;
}
// Destroy collections
each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) {
destroyObjectProperties(coll);
});
i = plotLinesAndBands.length;
while (i--) { // #1975
plotLinesAndBands[i].destroy();
}
// Destroy local variables
each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'cross', 'gridGroup', 'labelGroup'], function (prop) {
if (axis[prop]) {
axis[prop] = axis[prop].destroy();
}
});
// Destroy crosshair
if (this.cross) {
this.cross.destroy();
}
},
/**
* Draw the crosshair
*/
drawCrosshair: function (e, point) {
if (!this.crosshair) { return; }// Do not draw crosshairs if you don't have too.
if ((defined(point) || !pick(this.crosshair.snap, true)) === false) {
this.hideCrosshair();
return;
}
var path,
options = this.crosshair,
animation = options.animation,
pos;
// Get the path
if (!pick(options.snap, true)) {
pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos);
} else if (defined(point)) {
/*jslint eqeq: true*/
pos = (this.chart.inverted != this.horiz) ? point.plotX : this.len - point.plotY;
/*jslint eqeq: false*/
}
if (this.isRadial) {
path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y));
} else {
path = this.getPlotLinePath(null, null, null, null, pos);
}
if (path === null) {
this.hideCrosshair();
return;
}
// Draw the cross
if (this.cross) {
this.cross
.attr({ visibility: VISIBLE })[animation ? 'animate' : 'attr']({ d: path }, animation);
} else {
var attribs = {
'stroke-width': options.width || 1,
stroke: options.color || '#C0C0C0',
zIndex: options.zIndex || 2
};
if (options.dashStyle) {
attribs.dashstyle = options.dashStyle;
}
this.cross = this.chart.renderer.path(path).attr(attribs).add();
}
},
/**
* Hide the crosshair.
*/
hideCrosshair: function () {
if (this.cross) {
this.cross.hide();
}
}
}; // end Axis
extend(Axis.prototype, AxisPlotLineOrBandExtension);
/**
* Methods defined on the Axis prototype
*/
/**
* Set the tick positions of a logarithmic axis
*/
Axis.prototype.getLogTickPositions = function (interval, min, max, minor) {
var axis = this,
options = axis.options,
axisLength = axis.len,
// Since we use this method for both major and minor ticks,
// use a local variable and return the result
positions = [];
// Reset
if (!minor) {
axis._minorAutoInterval = null;
}
// First case: All ticks fall on whole logarithms: 1, 10, 100 etc.
if (interval >= 0.5) {
interval = mathRound(interval);
positions = axis.getLinearTickPositions(interval, min, max);
// Second case: We need intermediary ticks. For example
// 1, 2, 4, 6, 8, 10, 20, 40 etc.
} else if (interval >= 0.08) {
var roundedMin = mathFloor(min),
intermediate,
i,
j,
len,
pos,
lastPos,
break2;
if (interval > 0.3) {
intermediate = [1, 2, 4];
} else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 4, 6, 8];
} else { // 0.1 equals ten minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];
}
for (i = roundedMin; i < max + 1 && !break2; i++) {
len = intermediate.length;
for (j = 0; j < len && !break2; j++) {
pos = log2lin(lin2log(i) * intermediate[j]);
if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113
positions.push(lastPos);
}
if (lastPos > max) {
break2 = true;
}
lastPos = pos;
}
}
// Third case: We are so deep in between whole logarithmic values that
// we might as well handle the tick positions like a linear axis. For
// example 1.01, 1.02, 1.03, 1.04.
} else {
var realMin = lin2log(min),
realMax = lin2log(max),
tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'],
filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption,
tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1),
totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength;
interval = pick(
filteredTickIntervalOption,
axis._minorAutoInterval,
(realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1)
);
interval = normalizeTickInterval(
interval,
null,
getMagnitude(interval)
);
positions = map(axis.getLinearTickPositions(
interval,
realMin,
realMax
), log2lin);
if (!minor) {
axis._minorAutoInterval = interval / 5;
}
}
// Set the axis-level tickInterval variable
if (!minor) {
axis.tickInterval = interval;
}
return positions;
};/**
* The tooltip object
* @param {Object} chart The chart instance
* @param {Object} options Tooltip options
*/
var Tooltip = Highcharts.Tooltip = function () {
this.init.apply(this, arguments);
};
Tooltip.prototype = {
init: function (chart, options) {
var borderWidth = options.borderWidth,
style = options.style,
padding = pInt(style.padding);
// Save the chart and options
this.chart = chart;
this.options = options;
// Keep track of the current series
//this.currentSeries = UNDEFINED;
// List of crosshairs
this.crosshairs = [];
// Current values of x and y when animating
this.now = { x: 0, y: 0 };
// The tooltip is initially hidden
this.isHidden = true;
// create the label
this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip')
.attr({
padding: padding,
fill: options.backgroundColor,
'stroke-width': borderWidth,
r: options.borderRadius,
zIndex: 8
})
.css(style)
.css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117)
.add()
.attr({ y: -9999 }); // #2301, #2657
// When using canVG the shadow shows up as a gray circle
// even if the tooltip is hidden.
if (!useCanVG) {
this.label.shadow(options.shadow);
}
// Public property for getting the shared state.
this.shared = options.shared;
},
/**
* Destroy the tooltip and its elements.
*/
destroy: function () {
// Destroy and clear local variables
if (this.label) {
this.label = this.label.destroy();
}
clearTimeout(this.hideTimer);
clearTimeout(this.tooltipTimeout);
},
/**
* Provide a soft movement for the tooltip
*
* @param {Number} x
* @param {Number} y
* @private
*/
move: function (x, y, anchorX, anchorY) {
var tooltip = this,
now = tooltip.now,
animate = tooltip.options.animation !== false && !tooltip.isHidden &&
// When we get close to the target position, abort animation and land on the right place (#3056)
(mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1),
skipAnchor = tooltip.followPointer || tooltip.len > 1;
// Get intermediate values for animation
extend(now, {
x: animate ? (2 * now.x + x) / 3 : x,
y: animate ? (now.y + y) / 2 : y,
anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,
anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY
});
// Move to the intermediate value
tooltip.label.attr(now);
// Run on next tick of the mouse tracker
if (animate) {
// Never allow two timeouts
clearTimeout(this.tooltipTimeout);
// Set the fixed interval ticking for the smooth tooltip
this.tooltipTimeout = setTimeout(function () {
// The interval function may still be running during destroy, so check that the chart is really there before calling.
if (tooltip) {
tooltip.move(x, y, anchorX, anchorY);
}
}, 32);
}
},
/**
* Hide the tooltip
*/
hide: function () {
var tooltip = this,
hoverPoints;
clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766)
if (!this.isHidden) {
hoverPoints = this.chart.hoverPoints;
this.hideTimer = setTimeout(function () {
tooltip.label.fadeOut();
tooltip.isHidden = true;
}, pick(this.options.hideDelay, 500));
// hide previous hoverPoints and set new
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
this.chart.hoverPoints = null;
}
},
/**
* Extendable method to get the anchor position of the tooltip
* from a point or set of points
*/
getAnchor: function (points, mouseEvent) {
var ret,
chart = this.chart,
inverted = chart.inverted,
plotTop = chart.plotTop,
plotX = 0,
plotY = 0,
yAxis;
points = splat(points);
// Pie uses a special tooltipPos
ret = points[0].tooltipPos;
// When tooltip follows mouse, relate the position to the mouse
if (this.followPointer && mouseEvent) {
if (mouseEvent.chartX === UNDEFINED) {
mouseEvent = chart.pointer.normalize(mouseEvent);
}
ret = [
mouseEvent.chartX - chart.plotLeft,
mouseEvent.chartY - plotTop
];
}
// When shared, use the average position
if (!ret) {
each(points, function (point) {
yAxis = point.series.yAxis;
plotX += point.plotX;
plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) +
(!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151
});
plotX /= points.length;
plotY /= points.length;
ret = [
inverted ? chart.plotWidth - plotY : plotX,
this.shared && !inverted && points.length > 1 && mouseEvent ?
mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424)
inverted ? chart.plotHeight - plotX : plotY
];
}
return map(ret, mathRound);
},
/**
* Place the tooltip in a chart without spilling over
* and not covering the point it self.
*/
getPosition: function (boxWidth, boxHeight, point) {
var chart = this.chart,
distance = this.distance,
ret = {},
swapped,
first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop],
second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft],
// The far side is right or bottom
preferFarSide = point.ttBelow || (chart.inverted && !point.negative) || (!chart.inverted && point.negative),
/**
* Handle the preferred dimension. When the preferred dimension is tooltip
* on top or bottom of the point, it will look for space there.
*/
firstDimension = function (dim, outerSize, innerSize, point) {
var roomLeft = innerSize < point - distance,
roomRight = point + distance + innerSize < outerSize,
alignedLeft = point - distance - innerSize,
alignedRight = point + distance;
if (preferFarSide && roomRight) {
ret[dim] = alignedRight;
} else if (!preferFarSide && roomLeft) {
ret[dim] = alignedLeft;
} else if (roomLeft) {
ret[dim] = alignedLeft;
} else if (roomRight) {
ret[dim] = alignedRight;
} else {
return false;
}
},
/**
* Handle the secondary dimension. If the preferred dimension is tooltip
* on top or bottom of the point, the second dimension is to align the tooltip
* above the point, trying to align center but allowing left or right
* align within the chart box.
*/
secondDimension = function (dim, outerSize, innerSize, point) {
// Too close to the edge, return false and swap dimensions
if (point < distance || point > outerSize - distance) {
return false;
// Align left/top
} else if (point < innerSize / 2) {
ret[dim] = 1;
// Align right/bottom
} else if (point > outerSize - innerSize / 2) {
ret[dim] = outerSize - innerSize - 2;
// Align center
} else {
ret[dim] = point - innerSize / 2;
}
},
/**
* Swap the dimensions
*/
swap = function (count) {
var temp = first;
first = second;
second = temp;
swapped = count;
},
run = function () {
if (firstDimension.apply(0, first) !== false) {
if (secondDimension.apply(0, second) === false && !swapped) {
swap(true);
run();
}
} else if (!swapped) {
swap(true);
run();
} else {
ret.x = ret.y = 0;
}
};
// Under these conditions, prefer the tooltip on the side of the point
if (chart.inverted || this.len > 1) {
swap();
}
run();
return ret;
},
/**
* In case no user defined formatter is given, this will be used. Note that the context
* here is an object holding point, series, x, y etc.
*/
defaultFormatter: function (tooltip) {
var items = this.points || splat(this),
series = items[0].series,
s;
// build the header
s = [tooltip.tooltipHeaderFormatter(items[0])];
// build the values
each(items, function (item) {
series = item.series;
s.push((series.tooltipFormatter && series.tooltipFormatter(item)) ||
item.point.tooltipFormatter(series.tooltipOptions.pointFormat));
});
// footer
s.push(tooltip.options.footerFormat || '');
return s.join('');
},
/**
* Refresh the tooltip's text and position.
* @param {Object} point
*/
refresh: function (point, mouseEvent) {
var tooltip = this,
chart = tooltip.chart,
label = tooltip.label,
options = tooltip.options,
x,
y,
anchor,
textConfig = {},
text,
pointConfig = [],
formatter = options.formatter || tooltip.defaultFormatter,
hoverPoints = chart.hoverPoints,
borderColor,
shared = tooltip.shared,
currentSeries;
clearTimeout(this.hideTimer);
// get the reference point coordinates (pie charts use tooltipPos)
tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
anchor = tooltip.getAnchor(point, mouseEvent);
x = anchor[0];
y = anchor[1];
// shared tooltip, array is sent over
if (shared && !(point.series && point.series.noSharedTooltip)) {
// hide previous hoverPoints and set new
chart.hoverPoints = point;
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(point, function (item) {
item.setState(HOVER_STATE);
pointConfig.push(item.getLabelConfig());
});
textConfig = {
x: point[0].category,
y: point[0].y
};
textConfig.points = pointConfig;
this.len = pointConfig.length;
point = point[0];
// single point tooltip
} else {
textConfig = point.getLabelConfig();
}
text = formatter.call(textConfig, tooltip);
// register the current series
currentSeries = point.series;
this.distance = pick(currentSeries.tooltipOptions.distance, 16);
// update the inner HTML
if (text === false) {
this.hide();
} else {
// show it
if (tooltip.isHidden) {
stop(label);
label.attr('opacity', 1).show();
}
// update text
label.attr({
text: text
});
// set the stroke color of the box
borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
label.attr({
stroke: borderColor
});
tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });
this.isHidden = false;
}
fireEvent(chart, 'tooltipRefresh', {
text: text,
x: x + chart.plotLeft,
y: y + chart.plotTop,
borderColor: borderColor
});
},
/**
* Find the new position and perform the move
*/
updatePosition: function (point) {
var chart = this.chart,
label = this.label,
pos = (this.options.positioner || this.getPosition).call(
this,
label.width,
label.height,
point
);
// do the move
this.move(
mathRound(pos.x),
mathRound(pos.y),
point.plotX + chart.plotLeft,
point.plotY + chart.plotTop
);
},
/**
* Format the header of the tooltip
*/
tooltipHeaderFormatter: function (point) {
var series = point.series,
tooltipOptions = series.tooltipOptions,
dateTimeLabelFormats = tooltipOptions.dateTimeLabelFormats,
xDateFormat = tooltipOptions.xDateFormat,
xAxis = series.xAxis,
isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(point.key),
headerFormat = tooltipOptions.headerFormat,
closestPointRange = xAxis && xAxis.closestPointRange,
n;
// Guess the best date format based on the closest point distance (#568)
if (isDateTime && !xDateFormat) {
if (closestPointRange) {
for (n in timeUnits) {
if (timeUnits[n] >= closestPointRange ||
// If the point is placed every day at 23:59, we need to show
// the minutes as well. This logic only works for time units less than
// a day, since all higher time units are dividable by those. #2637.
(timeUnits[n] <= timeUnits.day && point.key % timeUnits[n] > 0)) {
xDateFormat = dateTimeLabelFormats[n];
break;
}
}
} else {
xDateFormat = dateTimeLabelFormats.day;
}
xDateFormat = xDateFormat || dateTimeLabelFormats.year; // #2546, 2581
}
// Insert the header date format if any
if (isDateTime && xDateFormat) {
headerFormat = headerFormat.replace('{point.key}', '{point.key:' + xDateFormat + '}');
}
return format(headerFormat, {
point: point,
series: series
});
}
};
var hoverChartIndex;
// Global flag for touch support
hasTouch = doc.documentElement.ontouchstart !== UNDEFINED;
/**
* The mouse tracker object. All methods starting with "on" are primary DOM event handlers.
* Subsequent methods should be named differently from what they are doing.
* @param {Object} chart The Chart instance
* @param {Object} options The root options object
*/
var Pointer = Highcharts.Pointer = function (chart, options) {
this.init(chart, options);
};
Pointer.prototype = {
/**
* Initialize Pointer
*/
init: function (chart, options) {
var chartOptions = options.chart,
chartEvents = chartOptions.events,
zoomType = useCanVG ? '' : chartOptions.zoomType,
inverted = chart.inverted,
zoomX,
zoomY;
// Store references
this.options = options;
this.chart = chart;
// Zoom status
this.zoomX = zoomX = /x/.test(zoomType);
this.zoomY = zoomY = /y/.test(zoomType);
this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);
this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);
this.hasZoom = zoomX || zoomY;
// Do we need to handle click on a touch device?
this.runChartClick = chartEvents && !!chartEvents.click;
this.pinchDown = [];
this.lastValidTouch = {};
if (Highcharts.Tooltip && options.tooltip.enabled) {
chart.tooltip = new Tooltip(chart, options.tooltip);
this.followTouchMove = options.tooltip.followTouchMove;
}
this.setDOMEvents();
},
/**
* Add crossbrowser support for chartX and chartY
* @param {Object} e The event object in standard browsers
*/
normalize: function (e, chartPosition) {
var chartX,
chartY,
ePos;
// common IE normalizing
e = e || window.event;
// Framework specific normalizing (#1165)
e = washMouseEvent(e);
// More IE normalizing, needs to go after washMouseEvent
if (!e.target) {
e.target = e.srcElement;
}
// iOS (#2757)
ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;
// Get mouse position
if (!chartPosition) {
this.chartPosition = chartPosition = offset(this.chart.container);
}
// chartX and chartY
if (ePos.pageX === UNDEFINED) { // IE < 9. #886.
chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is
// for IE10 quirks mode within framesets
chartY = e.y;
} else {
chartX = ePos.pageX - chartPosition.left;
chartY = ePos.pageY - chartPosition.top;
}
return extend(e, {
chartX: mathRound(chartX),
chartY: mathRound(chartY)
});
},
/**
* Get the click position in terms of axis values.
*
* @param {Object} e A pointer event
*/
getCoordinates: function (e) {
var coordinates = {
xAxis: [],
yAxis: []
};
each(this.chart.axes, function (axis) {
coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({
axis: axis,
value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])
});
});
return coordinates;
},
/**
* Return the index in the tooltipPoints array, corresponding to pixel position in
* the plot area.
*/
getIndex: function (e) {
var chart = this.chart;
return chart.inverted ?
chart.plotHeight + chart.plotTop - e.chartY :
e.chartX - chart.plotLeft;
},
/**
* With line type charts with a single tracker, get the point closest to the mouse.
* Run Point.onMouseOver and display tooltip for the point or points.
*/
runPointActions: function (e) {
var pointer = this,
chart = pointer.chart,
series = chart.series,
tooltip = chart.tooltip,
followPointer,
point,
points,
hoverPoint = chart.hoverPoint,
hoverSeries = chart.hoverSeries,
i,
j,
distance = chart.chartWidth,
index = pointer.getIndex(e),
anchor;
// shared tooltip
if (tooltip && pointer.options.tooltip.shared && !(hoverSeries && hoverSeries.noSharedTooltip)) {
points = [];
// loop over all series and find the ones with points closest to the mouse
i = series.length;
for (j = 0; j < i; j++) {
if (series[j].visible &&
series[j].options.enableMouseTracking !== false &&
!series[j].noSharedTooltip && series[j].singularTooltips !== true && series[j].tooltipPoints.length) {
point = series[j].tooltipPoints[index];
if (point && point.series) { // not a dummy point, #1544
point._dist = mathAbs(index - point.clientX);
distance = mathMin(distance, point._dist);
points.push(point);
}
}
}
// remove furthest points
i = points.length;
while (i--) {
if (points[i]._dist > distance) {
points.splice(i, 1);
}
}
// refresh the tooltip if necessary
if (points.length && (points[0].clientX !== pointer.hoverX)) {
tooltip.refresh(points, e);
pointer.hoverX = points[0].clientX;
}
}
// Separate tooltip and general mouse events
followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
if (hoverSeries && hoverSeries.tracker && !followPointer) { // #2584, #2830
// get the point
point = hoverSeries.tooltipPoints[index];
// a new point is hovered, refresh the tooltip
if (point && point !== hoverPoint) {
// trigger the events
point.onMouseOver(e);
}
} else if (tooltip && followPointer && !tooltip.isHidden) {
anchor = tooltip.getAnchor([{}], e);
tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });
}
// Start the event listener to pick up the tooltip
if (tooltip && !pointer._onDocumentMouseMove) {
pointer._onDocumentMouseMove = function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.onDocumentMouseMove(e);
}
};
addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
}
// Draw independent crosshairs
each(chart.axes, function (axis) {
axis.drawCrosshair(e, pick(point, hoverPoint));
});
},
/**
* Reset the tracking by hiding the tooltip, the hover series state and the hover point
*
* @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible
*/
reset: function (allowMove) {
var pointer = this,
chart = pointer.chart,
hoverSeries = chart.hoverSeries,
hoverPoint = chart.hoverPoint,
tooltip = chart.tooltip,
tooltipPoints = tooltip && tooltip.shared ? chart.hoverPoints : hoverPoint;
// Narrow in allowMove
allowMove = allowMove && tooltip && tooltipPoints;
// Check if the points have moved outside the plot area, #1003
if (allowMove && splat(tooltipPoints)[0].plotX === UNDEFINED) {
allowMove = false;
}
// Just move the tooltip, #349
if (allowMove) {
tooltip.refresh(tooltipPoints);
if (hoverPoint) { // #2500
hoverPoint.setState(hoverPoint.state, true);
}
// Full reset
} else {
if (hoverPoint) {
hoverPoint.onMouseOut();
}
if (hoverSeries) {
hoverSeries.onMouseOut();
}
if (tooltip) {
tooltip.hide();
}
if (pointer._onDocumentMouseMove) {
removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
pointer._onDocumentMouseMove = null;
}
// Remove crosshairs
each(chart.axes, function (axis) {
axis.hideCrosshair();
});
pointer.hoverX = null;
}
},
/**
* Scale series groups to a certain scale and translation
*/
scaleGroups: function (attribs, clip) {
var chart = this.chart,
seriesAttribs;
// Scale each series
each(chart.series, function (series) {
seriesAttribs = attribs || series.getPlotBox(); // #1701
if (series.xAxis && series.xAxis.zoomEnabled) {
series.group.attr(seriesAttribs);
if (series.markerGroup) {
series.markerGroup.attr(seriesAttribs);
series.markerGroup.clip(clip ? chart.clipRect : null);
}
if (series.dataLabelsGroup) {
series.dataLabelsGroup.attr(seriesAttribs);
}
}
});
// Clip
chart.clipRect.attr(clip || chart.clipBox);
},
/**
* Start a drag operation
*/
dragStart: function (e) {
var chart = this.chart;
// Record the start position
chart.mouseIsDown = e.type;
chart.cancelClick = false;
chart.mouseDownX = this.mouseDownX = e.chartX;
chart.mouseDownY = this.mouseDownY = e.chartY;
},
/**
* Perform a drag operation in response to a mousemove event while the mouse is down
*/
drag: function (e) {
var chart = this.chart,
chartOptions = chart.options.chart,
chartX = e.chartX,
chartY = e.chartY,
zoomHor = this.zoomHor,
zoomVert = this.zoomVert,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
clickedInside,
size,
mouseDownX = this.mouseDownX,
mouseDownY = this.mouseDownY,
panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key'];
// If the mouse is outside the plot area, adjust to cooordinates
// inside to prevent the selection marker from going outside
if (chartX < plotLeft) {
chartX = plotLeft;
} else if (chartX > plotLeft + plotWidth) {
chartX = plotLeft + plotWidth;
}
if (chartY < plotTop) {
chartY = plotTop;
} else if (chartY > plotTop + plotHeight) {
chartY = plotTop + plotHeight;
}
// determine if the mouse has moved more than 10px
this.hasDragged = Math.sqrt(
Math.pow(mouseDownX - chartX, 2) +
Math.pow(mouseDownY - chartY, 2)
);
if (this.hasDragged > 10) {
clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop);
// make a selection
if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) {
if (!this.selectionMarker) {
this.selectionMarker = chart.renderer.rect(
plotLeft,
plotTop,
zoomHor ? 1 : plotWidth,
zoomVert ? 1 : plotHeight,
0
)
.attr({
fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)',
zIndex: 7
})
.add();
}
}
// adjust the width of the selection marker
if (this.selectionMarker && zoomHor) {
size = chartX - mouseDownX;
this.selectionMarker.attr({
width: mathAbs(size),
x: (size > 0 ? 0 : size) + mouseDownX
});
}
// adjust the height of the selection marker
if (this.selectionMarker && zoomVert) {
size = chartY - mouseDownY;
this.selectionMarker.attr({
height: mathAbs(size),
y: (size > 0 ? 0 : size) + mouseDownY
});
}
// panning
if (clickedInside && !this.selectionMarker && chartOptions.panning) {
chart.pan(e, chartOptions.panning);
}
}
},
/**
* On mouse up or touch end across the entire document, drop the selection.
*/
drop: function (e) {
var chart = this.chart,
hasPinched = this.hasPinched;
if (this.selectionMarker) {
var selectionData = {
xAxis: [],
yAxis: [],
originalEvent: e.originalEvent || e
},
selectionBox = this.selectionMarker,
selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
runZoom;
// a selection has been made
if (this.hasDragged || hasPinched) {
// record each axis' min and max
each(chart.axes, function (axis) {
if (axis.zoomEnabled) {
var horiz = axis.horiz,
minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);
if (!isNaN(selectionMin) && !isNaN(selectionMax)) { // #859
selectionData[axis.coll].push({
axis: axis,
min: mathMin(selectionMin, selectionMax), // for reversed axes,
max: mathMax(selectionMin, selectionMax)
});
runZoom = true;
}
}
});
if (runZoom) {
fireEvent(chart, 'selection', selectionData, function (args) {
chart.zoom(extend(args, hasPinched ? { animation: false } : null));
});
}
}
this.selectionMarker = this.selectionMarker.destroy();
// Reset scaling preview
if (hasPinched) {
this.scaleGroups();
}
}
// Reset all
if (chart) { // it may be destroyed on mouse up - #877
css(chart.container, { cursor: chart._cursor });
chart.cancelClick = this.hasDragged > 10; // #370
chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
this.pinchDown = [];
}
},
onContainerMouseDown: function (e) {
e = this.normalize(e);
// issue #295, dragging not always working in Firefox
if (e.preventDefault) {
e.preventDefault();
}
this.dragStart(e);
},
onDocumentMouseUp: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
},
/**
* Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea.
* Issue #149 workaround. The mouseleave event does not always fire.
*/
onDocumentMouseMove: function (e) {
var chart = this.chart,
chartPosition = this.chartPosition,
hoverSeries = chart.hoverSeries;
e = this.normalize(e, chartPosition);
// If we're outside, hide the tooltip
if (chartPosition && hoverSeries && !this.inClass(e.target, 'highcharts-tracker') &&
!chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
this.reset();
}
},
/**
* When mouse leaves the container, hide the tooltip.
*/
onContainerMouseLeave: function () {
var chart = charts[hoverChartIndex];
if (chart) {
chart.pointer.reset();
chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix
}
},
// The mousemove, touchmove and touchstart event handler
onContainerMouseMove: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
e = this.normalize(e);
e.returnValue = false; // #2251, #3224
if (chart.mouseIsDown === 'mousedown') {
this.drag(e);
}
// Show the tooltip and run mouse over events (#977)
if ((this.inClass(e.target, 'highcharts-tracker') ||
chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) {
this.runPointActions(e);
}
},
/**
* Utility to detect whether an element has, or has a parent with, a specific
* class name. Used on detection of tracker objects and on deciding whether
* hovering the tooltip should cause the active series to mouse out.
*/
inClass: function (element, className) {
var elemClassName;
while (element) {
elemClassName = attr(element, 'class');
if (elemClassName) {
if (elemClassName.indexOf(className) !== -1) {
return true;
} else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {
return false;
}
}
element = element.parentNode;
}
},
onTrackerMouseOut: function (e) {
var series = this.chart.hoverSeries,
relatedTarget = e.relatedTarget || e.toElement,
relatedSeries = relatedTarget && relatedTarget.point && relatedTarget.point.series; // #2499
if (series && !series.options.stickyTracking && !this.inClass(relatedTarget, PREFIX + 'tooltip') &&
relatedSeries !== series) {
series.onMouseOut();
}
},
onContainerClick: function (e) {
var chart = this.chart,
hoverPoint = chart.hoverPoint,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop;
e = this.normalize(e);
e.cancelBubble = true; // IE specific
if (!chart.cancelClick) {
// On tracker click, fire the series and point events. #783, #1583
if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) {
// the series click event
fireEvent(hoverPoint.series, 'click', extend(e, {
point: hoverPoint
}));
// the point click event
if (chart.hoverPoint) { // it may be destroyed (#1844)
hoverPoint.firePointEvent('click', e);
}
// When clicking outside a tracker, fire a chart event
} else {
extend(e, this.getCoordinates(e));
// fire a click event in the chart
if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {
fireEvent(chart, 'click', e);
}
}
}
},
/**
* Set the JS DOM events on the container and document. This method should contain
* a one-to-one assignment between methods and their handlers. Any advanced logic should
* be moved to the handler reflecting the event's name.
*/
setDOMEvents: function () {
var pointer = this,
container = pointer.chart.container;
container.onmousedown = function (e) {
pointer.onContainerMouseDown(e);
};
container.onmousemove = function (e) {
pointer.onContainerMouseMove(e);
};
container.onclick = function (e) {
pointer.onContainerClick(e);
};
addEvent(container, 'mouseleave', pointer.onContainerMouseLeave);
if (chartCount === 1) {
addEvent(doc, 'mouseup', pointer.onDocumentMouseUp);
}
if (hasTouch) {
container.ontouchstart = function (e) {
pointer.onContainerTouchStart(e);
};
container.ontouchmove = function (e) {
pointer.onContainerTouchMove(e);
};
if (chartCount === 1) {
addEvent(doc, 'touchend', pointer.onDocumentTouchEnd);
}
}
},
/**
* Destroys the Pointer object and disconnects DOM events.
*/
destroy: function () {
var prop;
removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);
if (!chartCount) {
removeEvent(doc, 'mouseup', this.onDocumentMouseUp);
removeEvent(doc, 'touchend', this.onDocumentTouchEnd);
}
// memory and CPU leak
clearInterval(this.tooltipTimeout);
for (prop in this) {
this[prop] = null;
}
}
};
/* Support for touch devices */
extend(Highcharts.Pointer.prototype, {
/**
* Run translation operations
*/
pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
if (this.zoomHor || this.pinchHor) {
this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
if (this.zoomVert || this.pinchVert) {
this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
},
/**
* Run translation operations for each direction (horizontal and vertical) independently
*/
pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {
var chart = this.chart,
xy = horiz ? 'x' : 'y',
XY = horiz ? 'X' : 'Y',
sChartXY = 'chart' + XY,
wh = horiz ? 'width' : 'height',
plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],
selectionWH,
selectionXY,
clipXY,
scale = forcedScale || 1,
inverted = chart.inverted,
bounds = chart.bounds[horiz ? 'h' : 'v'],
singleTouch = pinchDown.length === 1,
touch0Start = pinchDown[0][sChartXY],
touch0Now = touches[0][sChartXY],
touch1Start = !singleTouch && pinchDown[1][sChartXY],
touch1Now = !singleTouch && touches[1][sChartXY],
outOfBounds,
transformScale,
scaleKey,
setScale = function () {
if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis
scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start);
}
clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;
selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale;
};
// Set the scale, first pass
setScale();
selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not
// Out of bounds
if (selectionXY < bounds.min) {
selectionXY = bounds.min;
outOfBounds = true;
} else if (selectionXY + selectionWH > bounds.max) {
selectionXY = bounds.max - selectionWH;
outOfBounds = true;
}
// Is the chart dragged off its bounds, determined by dataMin and dataMax?
if (outOfBounds) {
// Modify the touchNow position in order to create an elastic drag movement. This indicates
// to the user that the chart is responsive but can't be dragged further.
touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);
if (!singleTouch) {
touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);
}
// Set the scale, second pass to adapt to the modified touchNow positions
setScale();
} else {
lastValidTouch[xy] = [touch0Now, touch1Now];
}
// Set geometry for clipping, selection and transformation
if (!inverted) { // TODO: implement clipping for inverted charts
clip[xy] = clipXY - plotLeftTop;
clip[wh] = selectionWH;
}
scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;
transformScale = inverted ? 1 / scale : scale;
selectionMarker[wh] = selectionWH;
selectionMarker[xy] = selectionXY;
transform[scaleKey] = scale;
transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start));
},
/**
* Handle touch events with two touches
*/
pinch: function (e) {
var self = this,
chart = self.chart,
pinchDown = self.pinchDown,
followTouchMove = self.followTouchMove,
touches = e.touches,
touchesLength = touches.length,
lastValidTouch = self.lastValidTouch,
hasZoom = self.hasZoom,
selectionMarker = self.selectionMarker,
transform = {},
fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') &&
chart.runTrackerClick) || chart.runChartClick),
clip = {};
// On touch devices, only proceed to trigger click if a handler is defined
if ((hasZoom || followTouchMove) && !fireClickEvent) {
e.preventDefault();
}
// Normalize each touch
map(touches, function (e) {
return self.normalize(e);
});
// Register the touch start position
if (e.type === 'touchstart') {
each(touches, function (e, i) {
pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };
});
lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX];
lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY];
// Identify the data bounds in pixels
each(chart.axes, function (axis) {
if (axis.zoomEnabled) {
var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],
minPixelPadding = axis.minPixelPadding,
min = axis.toPixels(pick(axis.options.min, axis.dataMin)),
max = axis.toPixels(pick(axis.options.max, axis.dataMax)),
absMin = mathMin(min, max),
absMax = mathMax(min, max);
// Store the bounds for use in the touchmove handler
bounds.min = mathMin(axis.pos, absMin - minPixelPadding);
bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding);
}
});
// Event type is touchmove, handle panning and pinching
} else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first
// Set the marker
if (!selectionMarker) {
self.selectionMarker = selectionMarker = extend({
destroy: noop
}, chart.plotBox);
}
self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
self.hasPinched = hasZoom;
// Scale and translate the groups to provide visual feedback during pinching
self.scaleGroups(transform, clip);
// Optionally move the tooltip on touchmove
if (!hasZoom && followTouchMove && touchesLength === 1) {
this.runPointActions(self.normalize(e));
}
}
},
onContainerTouchStart: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
if (e.touches.length === 1) {
e = this.normalize(e);
if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
// Run mouse events and display tooltip etc
this.runPointActions(e);
this.pinch(e);
} else {
// Hide the tooltip on touching outside the plot area (#1203)
this.reset();
}
} else if (e.touches.length === 2) {
this.pinch(e);
}
},
onContainerTouchMove: function (e) {
if (e.touches.length === 1 || e.touches.length === 2) {
this.pinch(e);
}
},
onDocumentTouchEnd: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
}
});
if (win.PointerEvent || win.MSPointerEvent) {
// The touches object keeps track of the points being touched at all times
var touches = {},
hasPointerEvent = !!win.PointerEvent,
getWebkitTouches = function () {
var key, fake = [];
fake.item = function (i) { return this[i]; };
for (key in touches) {
if (touches.hasOwnProperty(key)) {
fake.push({
pageX: touches[key].pageX,
pageY: touches[key].pageY,
target: touches[key].target
});
}
}
return fake;
},
translateMSPointer = function (e, method, wktype, callback) {
var p;
e = e.originalEvent || e;
if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) {
callback(e);
p = charts[hoverChartIndex].pointer;
p[method]({
type: wktype,
target: e.currentTarget,
preventDefault: noop,
touches: getWebkitTouches()
});
}
};
/**
* Extend the Pointer prototype with methods for each event handler and more
*/
extend(Pointer.prototype, {
onContainerPointerDown: function (e) {
translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget };
});
},
onContainerPointerMove: function (e) {
translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY };
if (!touches[e.pointerId].target) {
touches[e.pointerId].target = e.currentTarget;
}
});
},
onDocumentPointerUp: function (e) {
translateMSPointer(e, 'onContainerTouchEnd', 'touchend', function (e) {
delete touches[e.pointerId];
});
},
/**
* Add or remove the MS Pointer specific events
*/
batchMSEvents: function (fn) {
fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown);
fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove);
fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp);
}
});
// Disable default IE actions for pinch and such on chart element
wrap(Pointer.prototype, 'init', function (proceed, chart, options) {
proceed.call(this, chart, options);
if (this.hasZoom || this.followTouchMove) {
css(chart.container, {
'-ms-touch-action': NONE,
'touch-action': NONE
});
}
});
// Add IE specific touch events to chart
wrap(Pointer.prototype, 'setDOMEvents', function (proceed) {
proceed.apply(this);
if (this.hasZoom || this.followTouchMove) {
this.batchMSEvents(addEvent);
}
});
// Destroy MS events also
wrap(Pointer.prototype, 'destroy', function (proceed) {
this.batchMSEvents(removeEvent);
proceed.call(this);
});
}
/**
* The overview of the chart's series
*/
var Legend = Highcharts.Legend = function (chart, options) {
this.init(chart, options);
};
Legend.prototype = {
/**
* Initialize the legend
*/
init: function (chart, options) {
var legend = this,
itemStyle = options.itemStyle,
padding = pick(options.padding, 8),
itemMarginTop = options.itemMarginTop || 0;
this.options = options;
if (!options.enabled) {
return;
}
legend.itemStyle = itemStyle;
legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle);
legend.itemMarginTop = itemMarginTop;
legend.padding = padding;
legend.initialItemX = padding;
legend.initialItemY = padding - 5; // 5 is the number of pixels above the text
legend.maxItemWidth = 0;
legend.chart = chart;
legend.itemHeight = 0;
legend.lastLineHeight = 0;
legend.symbolWidth = pick(options.symbolWidth, 16);
legend.pages = [];
// Render it
legend.render();
// move checkboxes
addEvent(legend.chart, 'endResize', function () {
legend.positionCheckboxes();
});
},
/**
* Set the colors for the legend item
* @param {Object} item A Series or Point instance
* @param {Object} visible Dimmed or colored
*/
colorizeItem: function (item, visible) {
var legend = this,
options = legend.options,
legendItem = item.legendItem,
legendLine = item.legendLine,
legendSymbol = item.legendSymbol,
hiddenColor = legend.itemHiddenStyle.color,
textColor = visible ? options.itemStyle.color : hiddenColor,
symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,
markerOptions = item.options && item.options.marker,
symbolAttr = { fill: symbolColor },
key,
val;
if (legendItem) {
legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE
}
if (legendLine) {
legendLine.attr({ stroke: symbolColor });
}
if (legendSymbol) {
// Apply marker options
if (markerOptions && legendSymbol.isMarker) { // #585
symbolAttr.stroke = symbolColor;
markerOptions = item.convertAttribs(markerOptions);
for (key in markerOptions) {
val = markerOptions[key];
if (val !== UNDEFINED) {
symbolAttr[key] = val;
}
}
}
legendSymbol.attr(symbolAttr);
}
},
/**
* Position the legend item
* @param {Object} item A Series or Point instance
*/
positionItem: function (item) {
var legend = this,
options = legend.options,
symbolPadding = options.symbolPadding,
ltr = !options.rtl,
legendItemPos = item._legendItemPos,
itemX = legendItemPos[0],
itemY = legendItemPos[1],
checkbox = item.checkbox;
if (item.legendGroup) {
item.legendGroup.translate(
ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4,
itemY
);
}
if (checkbox) {
checkbox.x = itemX;
checkbox.y = itemY;
}
},
/**
* Destroy a single legend item
* @param {Object} item The series or point
*/
destroyItem: function (item) {
var checkbox = item.checkbox;
// destroy SVG elements
each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) {
if (item[key]) {
item[key] = item[key].destroy();
}
});
if (checkbox) {
discardElement(item.checkbox);
}
},
/**
* Destroys the legend.
*/
destroy: function () {
var legend = this,
legendGroup = legend.group,
box = legend.box;
if (box) {
legend.box = box.destroy();
}
if (legendGroup) {
legend.group = legendGroup.destroy();
}
},
/**
* Position the checkboxes after the width is determined
*/
positionCheckboxes: function (scrollOffset) {
var alignAttr = this.group.alignAttr,
translateY,
clipHeight = this.clipHeight || this.legendHeight;
if (alignAttr) {
translateY = alignAttr.translateY;
each(this.allItems, function (item) {
var checkbox = item.checkbox,
top;
if (checkbox) {
top = (translateY + checkbox.y + (scrollOffset || 0) + 3);
css(checkbox, {
left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX,
top: top + PX,
display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE
});
}
});
}
},
/**
* Render the legend title on top of the legend
*/
renderTitle: function () {
var options = this.options,
padding = this.padding,
titleOptions = options.title,
titleHeight = 0,
bBox;
if (titleOptions.text) {
if (!this.title) {
this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')
.attr({ zIndex: 1 })
.css(titleOptions.style)
.add(this.group);
}
bBox = this.title.getBBox();
titleHeight = bBox.height;
this.offsetWidth = bBox.width; // #1717
this.contentGroup.attr({ translateY: titleHeight });
}
this.titleHeight = titleHeight;
},
/**
* Render a single specific legend item
* @param {Object} item A series or point
*/
renderItem: function (item) {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
options = legend.options,
horizontal = options.layout === 'horizontal',
symbolWidth = legend.symbolWidth,
symbolPadding = options.symbolPadding,
itemStyle = legend.itemStyle,
itemHiddenStyle = legend.itemHiddenStyle,
padding = legend.padding,
itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,
ltr = !options.rtl,
itemHeight,
widthOption = options.width,
itemMarginBottom = options.itemMarginBottom || 0,
itemMarginTop = legend.itemMarginTop,
initialItemX = legend.initialItemX,
bBox,
itemWidth,
li = item.legendItem,
series = item.series && item.series.drawLegendSymbol ? item.series : item,
seriesOptions = series.options,
showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,
useHTML = options.useHTML;
if (!li) { // generate it once, later move it
// Generate the group box
// A group to hold the symbol and text. Text is to be appended in Legend class.
item.legendGroup = renderer.g('legend-item')
.attr({ zIndex: 1 })
.add(legend.scrollGroup);
// Generate the list item text and add it to the group
item.legendItem = li = renderer.text(
options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
ltr ? symbolWidth + symbolPadding : -symbolPadding,
legend.baseline || 0,
useHTML
)
.css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
.attr({
align: ltr ? 'left' : 'right',
zIndex: 2
})
.add(item.legendGroup);
// Get the baseline for the first item - the font size is equal for all
if (!legend.baseline) {
legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;
li.attr('y', legend.baseline);
}
// Draw the legend symbol inside the group box
series.drawLegendSymbol(legend, item);
if (legend.setItemEvents) {
legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);
}
// Colorize the items
legend.colorizeItem(item, item.visible);
// add the HTML checkbox on top
if (showCheckbox) {
legend.createCheckboxForItem(item);
}
}
// calculate the positions for the next line
bBox = li.getBBox();
itemWidth = item.checkboxOffset =
options.itemWidth ||
item.legendItemWidth ||
symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);
legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);
// if the item exceeds the width, start a new line
if (horizontal && legend.itemX - initialItemX + itemWidth >
(widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {
legend.itemX = initialItemX;
legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
legend.lastLineHeight = 0; // reset for next line
}
// If the item exceeds the height, start a new column
/*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
legend.itemY = legend.initialItemY;
legend.itemX += legend.maxItemWidth;
legend.maxItemWidth = 0;
}*/
// Set the edge positions
legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915
// cache the position of the newly generated or reordered items
item._legendItemPos = [legend.itemX, legend.itemY];
// advance
if (horizontal) {
legend.itemX += itemWidth;
} else {
legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
legend.lastLineHeight = itemHeight;
}
// the width of the widest item
legend.offsetWidth = widthOption || mathMax(
(horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
legend.offsetWidth
);
},
/**
* Get all items, which is one item per series for normal series and one item per point
* for pie series.
*/
getAllItems: function () {
var allItems = [];
each(this.chart.series, function (series) {
var seriesOptions = series.options;
// Handle showInLegend. If the series is linked to another series, defaults to false.
if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) {
return;
}
// use points or series for the legend item depending on legendType
allItems = allItems.concat(
series.legendItems ||
(seriesOptions.legendType === 'point' ?
series.data :
series)
);
});
return allItems;
},
/**
* Render the legend. This method can be called both before and after
* chart.render. If called after, it will only rearrange items instead
* of creating new ones.
*/
render: function () {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
legendGroup = legend.group,
allItems,
display,
legendWidth,
legendHeight,
box = legend.box,
options = legend.options,
padding = legend.padding,
legendBorderWidth = options.borderWidth,
legendBackgroundColor = options.backgroundColor;
legend.itemX = legend.initialItemX;
legend.itemY = legend.initialItemY;
legend.offsetWidth = 0;
legend.lastItemY = 0;
if (!legendGroup) {
legend.group = legendGroup = renderer.g('legend')
.attr({ zIndex: 7 })
.add();
legend.contentGroup = renderer.g()
.attr({ zIndex: 1 }) // above background
.add(legendGroup);
legend.scrollGroup = renderer.g()
.add(legend.contentGroup);
}
legend.renderTitle();
// add each series or point
allItems = legend.getAllItems();
// sort by legendIndex
stableSort(allItems, function (a, b) {
return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);
});
// reversed legend
if (options.reversed) {
allItems.reverse();
}
legend.allItems = allItems;
legend.display = display = !!allItems.length;
// render the items
each(allItems, function (item) {
legend.renderItem(item);
});
// Draw the border
legendWidth = options.width || legend.offsetWidth;
legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;
legendHeight = legend.handleOverflow(legendHeight);
if (legendBorderWidth || legendBackgroundColor) {
legendWidth += padding;
legendHeight += padding;
if (!box) {
legend.box = box = renderer.rect(
0,
0,
legendWidth,
legendHeight,
options.borderRadius,
legendBorderWidth || 0
).attr({
stroke: options.borderColor,
'stroke-width': legendBorderWidth || 0,
fill: legendBackgroundColor || NONE
})
.add(legendGroup)
.shadow(options.shadow);
box.isNew = true;
} else if (legendWidth > 0 && legendHeight > 0) {
box[box.isNew ? 'attr' : 'animate'](
box.crisp({ width: legendWidth, height: legendHeight })
);
box.isNew = false;
}
// hide the border if no items
box[display ? 'show' : 'hide']();
}
legend.legendWidth = legendWidth;
legend.legendHeight = legendHeight;
// Now that the legend width and height are established, put the items in the
// final position
each(allItems, function (item) {
legend.positionItem(item);
});
// 1.x compatibility: positioning based on style
/*var props = ['left', 'right', 'top', 'bottom'],
prop,
i = 4;
while (i--) {
prop = props[i];
if (options.style[prop] && options.style[prop] !== 'auto') {
options[i < 2 ? 'align' : 'verticalAlign'] = prop;
options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);
}
}*/
if (display) {
legendGroup.align(extend({
width: legendWidth,
height: legendHeight
}, options), true, 'spacingBox');
}
if (!chart.isResizing) {
this.positionCheckboxes();
}
},
/**
* Set up the overflow handling by adding navigation with up and down arrows below the
* legend.
*/
handleOverflow: function (legendHeight) {
var legend = this,
chart = this.chart,
renderer = chart.renderer,
options = this.options,
optionsY = options.y,
alignTop = options.verticalAlign === 'top',
spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding,
maxHeight = options.maxHeight,
clipHeight,
clipRect = this.clipRect,
navOptions = options.navigation,
animation = pick(navOptions.animation, true),
arrowSize = navOptions.arrowSize || 12,
nav = this.nav,
pages = this.pages,
lastY,
allItems = this.allItems;
// Adjust the height
if (options.layout === 'horizontal') {
spaceHeight /= 2;
}
if (maxHeight) {
spaceHeight = mathMin(spaceHeight, maxHeight);
}
// Reset the legend height and adjust the clipping rectangle
pages.length = 0;
if (legendHeight > spaceHeight && !options.useHTML) {
this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - this.padding, 0);
this.currentPage = pick(this.currentPage, 1);
this.fullHeight = legendHeight;
// Fill pages with Y positions so that the top of each a legend item defines
// the scroll top for each page (#2098)
each(allItems, function (item, i) {
var y = item._legendItemPos[1],
h = mathRound(item.legendItem.getBBox().height),
len = pages.length;
if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) {
pages.push(lastY || y);
len++;
}
if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) {
pages.push(y);
}
if (y !== lastY) {
lastY = y;
}
});
// Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787)
if (!clipRect) {
clipRect = legend.clipRect = renderer.clipRect(0, this.padding, 9999, 0);
legend.contentGroup.clip(clipRect);
}
clipRect.attr({
height: clipHeight
});
// Add navigation elements
if (!nav) {
this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group);
this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(-1, animation);
})
.add(nav);
this.pager = renderer.text('', 15, 10)
.css(navOptions.style)
.add(nav);
this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(1, animation);
})
.add(nav);
}
// Set initial position
legend.scroll(0);
legendHeight = spaceHeight;
} else if (nav) {
clipRect.attr({
height: chart.chartHeight
});
nav.hide();
this.scrollGroup.attr({
translateY: 1
});
this.clipHeight = 0; // #1379
}
return legendHeight;
},
/**
* Scroll the legend by a number of pages
* @param {Object} scrollBy
* @param {Object} animation
*/
scroll: function (scrollBy, animation) {
var pages = this.pages,
pageCount = pages.length,
currentPage = this.currentPage + scrollBy,
clipHeight = this.clipHeight,
navOptions = this.options.navigation,
activeColor = navOptions.activeColor,
inactiveColor = navOptions.inactiveColor,
pager = this.pager,
padding = this.padding,
scrollOffset;
// When resizing while looking at the last page
if (currentPage > pageCount) {
currentPage = pageCount;
}
if (currentPage > 0) {
if (animation !== UNDEFINED) {
setAnimation(animation, this.chart);
}
this.nav.attr({
translateX: padding,
translateY: clipHeight + this.padding + 7 + this.titleHeight,
visibility: VISIBLE
});
this.up.attr({
fill: currentPage === 1 ? inactiveColor : activeColor
})
.css({
cursor: currentPage === 1 ? 'default' : 'pointer'
});
pager.attr({
text: currentPage + '/' + pageCount
});
this.down.attr({
x: 18 + this.pager.getBBox().width, // adjust to text width
fill: currentPage === pageCount ? inactiveColor : activeColor
})
.css({
cursor: currentPage === pageCount ? 'default' : 'pointer'
});
scrollOffset = -pages[currentPage - 1] + this.initialItemY;
this.scrollGroup.animate({
translateY: scrollOffset
});
this.currentPage = currentPage;
this.positionCheckboxes(scrollOffset);
}
}
};
/*
* LegendSymbolMixin
*/
var LegendSymbolMixin = Highcharts.LegendSymbolMixin = {
/**
* Get the series' symbol in the legend
*
* @param {Object} legend The legend object
* @param {Object} item The series (this) or point
*/
drawRectangle: function (legend, item) {
var symbolHeight = legend.options.symbolHeight || 12;
item.legendSymbol = this.chart.renderer.rect(
0,
legend.baseline - 5 - (symbolHeight / 2),
legend.symbolWidth,
symbolHeight,
legend.options.symbolRadius || 0
).attr({
zIndex: 3
}).add(item.legendGroup);
},
/**
* Get the series' symbol in the legend. This method should be overridable to create custom
* symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols.
*
* @param {Object} legend The legend object
*/
drawLineMarker: function (legend) {
var options = this.options,
markerOptions = options.marker,
radius,
legendOptions = legend.options,
legendSymbol,
symbolWidth = legend.symbolWidth,
renderer = this.chart.renderer,
legendItemGroup = this.legendGroup,
verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),
attr;
// Draw the line
if (options.lineWidth) {
attr = {
'stroke-width': options.lineWidth
};
if (options.dashStyle) {
attr.dashstyle = options.dashStyle;
}
this.legendLine = renderer.path([
M,
0,
verticalCenter,
L,
symbolWidth,
verticalCenter
])
.attr(attr)
.add(legendItemGroup);
}
// Draw the marker
if (markerOptions && markerOptions.enabled !== false) {
radius = markerOptions.radius;
this.legendSymbol = legendSymbol = renderer.symbol(
this.symbol,
(symbolWidth / 2) - radius,
verticalCenter - radius,
2 * radius,
2 * radius
)
.add(legendItemGroup);
legendSymbol.isMarker = true;
}
}
};
// Workaround for #2030, horizontal legend items not displaying in IE11 Preview,
// and for #2580, a similar drawing flaw in Firefox 26.
// TODO: Explore if there's a general cause for this. The problem may be related
// to nested group elements, as the legend item texts are within 4 group elements.
if (/Trident\/7\.0/.test(userAgent) || isFirefox) {
wrap(Legend.prototype, 'positionItem', function (proceed, item) {
var legend = this,
runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030)
if (item._legendItemPos) {
proceed.call(legend, item);
}
};
// Do it now, for export and to get checkbox placement
runPositionItem();
// Do it after to work around the core issue
setTimeout(runPositionItem);
});
}
/**
* The chart class
* @param {Object} options
* @param {Function} callback Function to run when the chart has loaded
*/
function Chart() {
this.init.apply(this, arguments);
}
Chart.prototype = {
/**
* Initialize the chart
*/
init: function (userOptions, callback) {
// Handle regular options
var options,
seriesOptions = userOptions.series; // skip merging data points to increase performance
userOptions.series = null;
options = merge(defaultOptions, userOptions); // do the merge
options.series = userOptions.series = seriesOptions; // set back the series data
this.userOptions = userOptions;
var optionsChart = options.chart;
// Create margin & spacing array
this.margin = this.splashArray('margin', optionsChart);
this.spacing = this.splashArray('spacing', optionsChart);
var chartEvents = optionsChart.events;
//this.runChartClick = chartEvents && !!chartEvents.click;
this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom
this.callback = callback;
this.isResizing = 0;
this.options = options;
//chartTitleOptions = UNDEFINED;
//chartSubtitleOptions = UNDEFINED;
this.axes = [];
this.series = [];
this.hasCartesianSeries = optionsChart.showAxes;
//this.axisOffset = UNDEFINED;
//this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes
//this.inverted = UNDEFINED;
//this.loadingShown = UNDEFINED;
//this.container = UNDEFINED;
//this.chartWidth = UNDEFINED;
//this.chartHeight = UNDEFINED;
//this.marginRight = UNDEFINED;
//this.marginBottom = UNDEFINED;
//this.containerWidth = UNDEFINED;
//this.containerHeight = UNDEFINED;
//this.oldChartWidth = UNDEFINED;
//this.oldChartHeight = UNDEFINED;
//this.renderTo = UNDEFINED;
//this.renderToClone = UNDEFINED;
//this.spacingBox = UNDEFINED
//this.legend = UNDEFINED;
// Elements
//this.chartBackground = UNDEFINED;
//this.plotBackground = UNDEFINED;
//this.plotBGImage = UNDEFINED;
//this.plotBorder = UNDEFINED;
//this.loadingDiv = UNDEFINED;
//this.loadingSpan = UNDEFINED;
var chart = this,
eventType;
// Add the chart to the global lookup
chart.index = charts.length;
charts.push(chart);
chartCount++;
// Set up auto resize
if (optionsChart.reflow !== false) {
addEvent(chart, 'load', function () {
chart.initReflow();
});
}
// Chart event handlers
if (chartEvents) {
for (eventType in chartEvents) {
addEvent(chart, eventType, chartEvents[eventType]);
}
}
chart.xAxis = [];
chart.yAxis = [];
// Expose methods and variables
chart.animation = useCanVG ? false : pick(optionsChart.animation, true);
chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;
chart.firstRender();
},
/**
* Initialize an individual series, called internally before render time
*/
initSeries: function (options) {
var chart = this,
optionsChart = chart.options.chart,
type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
series,
constr = seriesTypes[type];
// No such series type
if (!constr) {
error(17, true);
}
series = new constr();
series.init(this, options);
return series;
},
/**
* Check whether a given point is within the plot area
*
* @param {Number} plotX Pixel x relative to the plot area
* @param {Number} plotY Pixel y relative to the plot area
* @param {Boolean} inverted Whether the chart is inverted
*/
isInsidePlot: function (plotX, plotY, inverted) {
var x = inverted ? plotY : plotX,
y = inverted ? plotX : plotY;
return x >= 0 &&
x <= this.plotWidth &&
y >= 0 &&
y <= this.plotHeight;
},
/**
* Adjust all axes tick amounts
*/
adjustTickAmounts: function () {
if (this.options.chart.alignTicks !== false) {
each(this.axes, function (axis) {
axis.adjustTickAmount();
});
}
this.maxTicks = null;
},
/**
* Redraw legend, axes or series based on updated data
*
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
redraw: function (animation) {
var chart = this,
axes = chart.axes,
series = chart.series,
pointer = chart.pointer,
legend = chart.legend,
redrawLegend = chart.isDirtyLegend,
hasStackedSeries,
hasDirtyStacks,
hasCartesianSeries = chart.hasCartesianSeries,
isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?
seriesLength = series.length,
i = seriesLength,
serie,
renderer = chart.renderer,
isHiddenChart = renderer.isHidden(),
afterRedraw = [];
setAnimation(animation, chart);
if (isHiddenChart) {
chart.cloneRenderTo();
}
// Adjust title layout (reflow multiline text)
chart.layOutTitles();
// link stacked series
while (i--) {
serie = series[i];
if (serie.options.stacking) {
hasStackedSeries = true;
if (serie.isDirty) {
hasDirtyStacks = true;
break;
}
}
}
if (hasDirtyStacks) { // mark others as dirty
i = seriesLength;
while (i--) {
serie = series[i];
if (serie.options.stacking) {
serie.isDirty = true;
}
}
}
// handle updated data in the series
each(series, function (serie) {
if (serie.isDirty) { // prepare the data so axis can read it
if (serie.options.legendType === 'point') {
redrawLegend = true;
}
}
});
// handle added or removed series
if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed
// draw legend graphics
legend.render();
chart.isDirtyLegend = false;
}
// reset stacks
if (hasStackedSeries) {
chart.getStacks();
}
if (hasCartesianSeries) {
if (!chart.isResizing) {
// reset maxTicks
chart.maxTicks = null;
// set axes scales
each(axes, function (axis) {
axis.setScale();
});
}
chart.adjustTickAmounts();
}
chart.getMargins(); // #3098
if (hasCartesianSeries) {
// If one axis is dirty, all axes must be redrawn (#792, #2169)
each(axes, function (axis) {
if (axis.isDirty) {
isDirtyBox = true;
}
});
// redraw axes
each(axes, function (axis) {
// Fire 'afterSetExtremes' only if extremes are set
if (axis.isDirtyExtremes) { // #821
axis.isDirtyExtremes = false;
afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119)
fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751
delete axis.eventArgs;
});
}
if (isDirtyBox || hasStackedSeries) {
axis.redraw();
}
});
}
// the plot areas size has changed
if (isDirtyBox) {
chart.drawChartBox();
}
// redraw affected series
each(series, function (serie) {
if (serie.isDirty && serie.visible &&
(!serie.isCartesian || serie.xAxis)) { // issue #153
serie.redraw();
}
});
// move tooltip or reset
if (pointer) {
pointer.reset(true);
}
// redraw if canvas
renderer.draw();
// fire the event
fireEvent(chart, 'redraw'); // jQuery breaks this when calling it from addEvent. Overwrites chart.redraw
if (isHiddenChart) {
chart.cloneRenderTo(true);
}
// Fire callbacks that are put on hold until after the redraw
each(afterRedraw, function (callback) {
callback.call();
});
},
/**
* Get an axis, series or point object by id.
* @param id {String} The id as given in the configuration options
*/
get: function (id) {
var chart = this,
axes = chart.axes,
series = chart.series;
var i,
j,
points;
// search axes
for (i = 0; i < axes.length; i++) {
if (axes[i].options.id === id) {
return axes[i];
}
}
// search series
for (i = 0; i < series.length; i++) {
if (series[i].options.id === id) {
return series[i];
}
}
// search points
for (i = 0; i < series.length; i++) {
points = series[i].points || [];
for (j = 0; j < points.length; j++) {
if (points[j].id === id) {
return points[j];
}
}
}
return null;
},
/**
* Create the Axis instances based on the config options
*/
getAxes: function () {
var chart = this,
options = this.options,
xAxisOptions = options.xAxis = splat(options.xAxis || {}),
yAxisOptions = options.yAxis = splat(options.yAxis || {}),
optionsArray,
axis;
// make sure the options are arrays and add some members
each(xAxisOptions, function (axis, i) {
axis.index = i;
axis.isX = true;
});
each(yAxisOptions, function (axis, i) {
axis.index = i;
});
// concatenate all axis options into one array
optionsArray = xAxisOptions.concat(yAxisOptions);
each(optionsArray, function (axisOptions) {
axis = new Axis(chart, axisOptions);
});
chart.adjustTickAmounts();
},
/**
* Get the currently selected points from all series
*/
getSelectedPoints: function () {
var points = [];
each(this.series, function (serie) {
points = points.concat(grep(serie.points || [], function (point) {
return point.selected;
}));
});
return points;
},
/**
* Get the currently selected series
*/
getSelectedSeries: function () {
return grep(this.series, function (serie) {
return serie.selected;
});
},
/**
* Generate stacks for each series and calculate stacks total values
*/
getStacks: function () {
var chart = this;
// reset stacks for each yAxis
each(chart.yAxis, function (axis) {
if (axis.stacks && axis.hasVisibleSeries) {
axis.oldStacks = axis.stacks;
}
});
each(chart.series, function (series) {
if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) {
series.stackKey = series.type + pick(series.options.stack, '');
}
});
},
/**
* Show the title and subtitle of the chart
*
* @param titleOptions {Object} New title options
* @param subtitleOptions {Object} New subtitle options
*
*/
setTitle: function (titleOptions, subtitleOptions, redraw) {
var chart = this,
options = chart.options,
chartTitleOptions,
chartSubtitleOptions;
chartTitleOptions = options.title = merge(options.title, titleOptions);
chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions);
// add title and subtitle
each([
['title', titleOptions, chartTitleOptions],
['subtitle', subtitleOptions, chartSubtitleOptions]
], function (arr) {
var name = arr[0],
title = chart[name],
titleOptions = arr[1],
chartTitleOptions = arr[2];
if (title && titleOptions) {
chart[name] = title = title.destroy(); // remove old
}
if (chartTitleOptions && chartTitleOptions.text && !title) {
chart[name] = chart.renderer.text(
chartTitleOptions.text,
0,
0,
chartTitleOptions.useHTML
)
.attr({
align: chartTitleOptions.align,
'class': PREFIX + name,
zIndex: chartTitleOptions.zIndex || 4
})
.css(chartTitleOptions.style)
.add();
}
});
chart.layOutTitles(redraw);
},
/**
* Lay out the chart titles and cache the full offset height for use in getMargins
*/
layOutTitles: function (redraw) {
var titleOffset = 0,
title = this.title,
subtitle = this.subtitle,
options = this.options,
titleOptions = options.title,
subtitleOptions = options.subtitle,
requiresDirtyBox,
renderer = this.renderer,
autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button
if (title) {
title
.css({ width: (titleOptions.width || autoWidth) + PX })
.align(extend({
y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3
}, titleOptions), false, 'spacingBox');
if (!titleOptions.floating && !titleOptions.verticalAlign) {
titleOffset = title.getBBox().height;
}
}
if (subtitle) {
subtitle
.css({ width: (subtitleOptions.width || autoWidth) + PX })
.align(extend({
y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b
}, subtitleOptions), false, 'spacingBox');
if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
}
}
requiresDirtyBox = this.titleOffset !== titleOffset;
this.titleOffset = titleOffset; // used in getMargins
if (!this.isDirtyBox && requiresDirtyBox) {
this.isDirtyBox = requiresDirtyBox;
// Redraw if necessary (#2719, #2744)
if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {
this.redraw();
}
}
},
/**
* Get chart width and height according to options and container size
*/
getChartSize: function () {
var chart = this,
optionsChart = chart.options.chart,
widthOption = optionsChart.width,
heightOption = optionsChart.height,
renderTo = chart.renderToClone || chart.renderTo;
// get inner width and height from jQuery (#824)
if (!defined(widthOption)) {
chart.containerWidth = adapterRun(renderTo, 'width');
}
if (!defined(heightOption)) {
chart.containerHeight = adapterRun(renderTo, 'height');
}
chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
chart.chartHeight = mathMax(0, pick(heightOption,
// the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
chart.containerHeight > 19 ? chart.containerHeight : 400));
},
/**
* Create a clone of the chart's renderTo div and place it outside the viewport to allow
* size computation on chart.render and chart.redraw
*/
cloneRenderTo: function (revert) {
var clone = this.renderToClone,
container = this.container;
// Destroy the clone and bring the container back to the real renderTo div
if (revert) {
if (clone) {
this.renderTo.appendChild(container);
discardElement(clone);
delete this.renderToClone;
}
// Set up the clone
} else {
if (container && container.parentNode === this.renderTo) {
this.renderTo.removeChild(container); // do not clone this
}
this.renderToClone = clone = this.renderTo.cloneNode(0);
css(clone, {
position: ABSOLUTE,
top: '-9999px',
display: 'block' // #833
});
if (clone.style.setProperty) { // #2631
clone.style.setProperty('display', 'block', 'important');
}
doc.body.appendChild(clone);
if (container) {
clone.appendChild(container);
}
}
},
/**
* Get the containing element, determine the size and create the inner container
* div to hold the chart
*/
getContainer: function () {
var chart = this,
container,
optionsChart = chart.options.chart,
chartWidth,
chartHeight,
renderTo,
indexAttrName = 'data-highcharts-chart',
oldChartIndex,
containerId;
chart.renderTo = renderTo = optionsChart.renderTo;
containerId = PREFIX + idCounter++;
if (isString(renderTo)) {
chart.renderTo = renderTo = doc.getElementById(renderTo);
}
// Display an error if the renderTo is wrong
if (!renderTo) {
error(13, true);
}
// If the container already holds a chart, destroy it. The check for hasRendered is there
// because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart
// attribute and the SVG contents, but not an interactive chart. So in this case,
// charts[oldChartIndex] will point to the wrong chart if any (#2609).
oldChartIndex = pInt(attr(renderTo, indexAttrName));
if (!isNaN(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) {
charts[oldChartIndex].destroy();
}
// Make a reference to the chart from the div
attr(renderTo, indexAttrName, chart.index);
// remove previous chart
renderTo.innerHTML = '';
// If the container doesn't have an offsetWidth, it has or is a child of a node
// that has display:none. We need to temporarily move it out to a visible
// state to determine the size, else the legend and tooltips won't render
// properly. The allowClone option is used in sparklines as a micro optimization,
// saving about 1-2 ms each chart.
if (!optionsChart.skipClone && !renderTo.offsetWidth) {
chart.cloneRenderTo();
}
// get the width and height
chart.getChartSize();
chartWidth = chart.chartWidth;
chartHeight = chart.chartHeight;
// create the inner container
chart.container = container = createElement(DIV, {
className: PREFIX + 'container' +
(optionsChart.className ? ' ' + optionsChart.className : ''),
id: containerId
}, extend({
position: RELATIVE,
overflow: HIDDEN, // needed for context menu (avoid scrollbars) and
// content overflow in IE
width: chartWidth + PX,
height: chartHeight + PX,
textAlign: 'left',
lineHeight: 'normal', // #427
zIndex: 0, // #1072
'-webkit-tap-highlight-color': 'rgba(0,0,0,0)'
}, optionsChart.style),
chart.renderToClone || renderTo
);
// cache the cursor (#1650)
chart._cursor = container.style.cursor;
// Initialize the renderer
chart.renderer =
optionsChart.forExport ? // force SVG, used for SVG export
new SVGRenderer(container, chartWidth, chartHeight, optionsChart.style, true) :
new Renderer(container, chartWidth, chartHeight, optionsChart.style);
if (useCanVG) {
// If we need canvg library, extend and configure the renderer
// to get the tracker for translating mouse events
chart.renderer.create(chart, container, chartWidth, chartHeight);
}
},
/**
* Calculate margins by rendering axis labels in a preliminary position. Title,
* subtitle and legend have already been rendered at this stage, but will be
* moved into their final positions
*/
getMargins: function () {
var chart = this,
spacing = chart.spacing,
axisOffset,
legend = chart.legend,
margin = chart.margin,
legendOptions = chart.options.legend,
legendMargin = pick(legendOptions.margin, 20),
legendX = legendOptions.x,
legendY = legendOptions.y,
align = legendOptions.align,
verticalAlign = legendOptions.verticalAlign,
titleOffset = chart.titleOffset;
chart.resetMargins();
axisOffset = chart.axisOffset;
// Adjust for title and subtitle
if (titleOffset && !defined(margin[0])) {
chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);
}
// Adjust for legend
if (legend.display && !legendOptions.floating) {
if (align === 'right') { // horizontal alignment handled first
if (!defined(margin[1])) {
chart.marginRight = mathMax(
chart.marginRight,
legend.legendWidth - legendX + legendMargin + spacing[1]
);
}
} else if (align === 'left') {
if (!defined(margin[3])) {
chart.plotLeft = mathMax(
chart.plotLeft,
legend.legendWidth + legendX + legendMargin + spacing[3]
);
}
} else if (verticalAlign === 'top') {
if (!defined(margin[0])) {
chart.plotTop = mathMax(
chart.plotTop,
legend.legendHeight + legendY + legendMargin + spacing[0]
);
}
} else if (verticalAlign === 'bottom') {
if (!defined(margin[2])) {
chart.marginBottom = mathMax(
chart.marginBottom,
legend.legendHeight - legendY + legendMargin + spacing[2]
);
}
}
}
// adjust for scroller
if (chart.extraBottomMargin) {
chart.marginBottom += chart.extraBottomMargin;
}
if (chart.extraTopMargin) {
chart.plotTop += chart.extraTopMargin;
}
// pre-render axes to get labels offset width
if (chart.hasCartesianSeries) {
each(chart.axes, function (axis) {
axis.getOffset();
});
}
if (!defined(margin[3])) {
chart.plotLeft += axisOffset[3];
}
if (!defined(margin[0])) {
chart.plotTop += axisOffset[0];
}
if (!defined(margin[2])) {
chart.marginBottom += axisOffset[2];
}
if (!defined(margin[1])) {
chart.marginRight += axisOffset[1];
}
chart.setChartSize();
},
/**
* Resize the chart to its container if size is not explicitly set
*/
reflow: function (e) {
var chart = this,
optionsChart = chart.options.chart,
renderTo = chart.renderTo,
width = optionsChart.width || adapterRun(renderTo, 'width'),
height = optionsChart.height || adapterRun(renderTo, 'height'),
target = e ? e.target : win, // #805 - MooTools doesn't supply e
doReflow = function () {
if (chart.container) { // It may have been destroyed in the meantime (#1257)
chart.setSize(width, height, false);
chart.hasUserSize = null;
}
};
// Width and height checks for display:none. Target is doc in IE8 and Opera,
// win in Firefox, Chrome and IE9.
if (!chart.hasUserSize && width && height && (target === win || target === doc)) {
if (width !== chart.containerWidth || height !== chart.containerHeight) {
clearTimeout(chart.reflowTimeout);
if (e) { // Called from window.resize
chart.reflowTimeout = setTimeout(doReflow, 100);
} else { // Called directly (#2224)
doReflow();
}
}
chart.containerWidth = width;
chart.containerHeight = height;
}
},
/**
* Add the event handlers necessary for auto resizing
*/
initReflow: function () {
var chart = this,
reflow = function (e) {
chart.reflow(e);
};
addEvent(win, 'resize', reflow);
addEvent(chart, 'destroy', function () {
removeEvent(win, 'resize', reflow);
});
},
/**
* Resize the chart to a given width and height
* @param {Number} width
* @param {Number} height
* @param {Object|Boolean} animation
*/
setSize: function (width, height, animation) {
var chart = this,
chartWidth,
chartHeight,
fireEndResize;
// Handle the isResizing counter
chart.isResizing += 1;
fireEndResize = function () {
if (chart) {
fireEvent(chart, 'endResize', null, function () {
chart.isResizing -= 1;
});
}
};
// set the animation for the current process
setAnimation(animation, chart);
chart.oldChartHeight = chart.chartHeight;
chart.oldChartWidth = chart.chartWidth;
if (defined(width)) {
chart.chartWidth = chartWidth = mathMax(0, mathRound(width));
chart.hasUserSize = !!chartWidth;
}
if (defined(height)) {
chart.chartHeight = chartHeight = mathMax(0, mathRound(height));
}
// Resize the container with the global animation applied if enabled (#2503)
(globalAnimation ? animate : css)(chart.container, {
width: chartWidth + PX,
height: chartHeight + PX
}, globalAnimation);
chart.setChartSize(true);
chart.renderer.setSize(chartWidth, chartHeight, animation);
// handle axes
chart.maxTicks = null;
each(chart.axes, function (axis) {
axis.isDirty = true;
axis.setScale();
});
// make sure non-cartesian series are also handled
each(chart.series, function (serie) {
serie.isDirty = true;
});
chart.isDirtyLegend = true; // force legend redraw
chart.isDirtyBox = true; // force redraw of plot and chart border
chart.layOutTitles(); // #2857
chart.getMargins();
chart.redraw(animation);
chart.oldChartHeight = null;
fireEvent(chart, 'resize');
// fire endResize and set isResizing back
// If animation is disabled, fire without delay
if (globalAnimation === false) {
fireEndResize();
} else { // else set a timeout with the animation duration
setTimeout(fireEndResize, (globalAnimation && globalAnimation.duration) || 500);
}
},
/**
* Set the public chart properties. This is done before and after the pre-render
* to determine margin sizes
*/
setChartSize: function (skipAxes) {
var chart = this,
inverted = chart.inverted,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
optionsChart = chart.options.chart,
spacing = chart.spacing,
clipOffset = chart.clipOffset,
clipX,
clipY,
plotLeft,
plotTop,
plotWidth,
plotHeight,
plotBorderWidth;
chart.plotLeft = plotLeft = mathRound(chart.plotLeft);
chart.plotTop = plotTop = mathRound(chart.plotTop);
chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight));
chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom));
chart.plotSizeX = inverted ? plotHeight : plotWidth;
chart.plotSizeY = inverted ? plotWidth : plotHeight;
chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;
// Set boxes used for alignment
chart.spacingBox = renderer.spacingBox = {
x: spacing[3],
y: spacing[0],
width: chartWidth - spacing[3] - spacing[1],
height: chartHeight - spacing[0] - spacing[2]
};
chart.plotBox = renderer.plotBox = {
x: plotLeft,
y: plotTop,
width: plotWidth,
height: plotHeight
};
plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2);
clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2);
clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2);
chart.clipBox = {
x: clipX,
y: clipY,
width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX),
height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY))
};
if (!skipAxes) {
each(chart.axes, function (axis) {
axis.setAxisSize();
axis.setAxisTranslation();
});
}
},
/**
* Initial margins before auto size margins are applied
*/
resetMargins: function () {
var chart = this,
spacing = chart.spacing,
margin = chart.margin;
chart.plotTop = pick(margin[0], spacing[0]);
chart.marginRight = pick(margin[1], spacing[1]);
chart.marginBottom = pick(margin[2], spacing[2]);
chart.plotLeft = pick(margin[3], spacing[3]);
chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left
chart.clipOffset = [0, 0, 0, 0];
},
/**
* Draw the borders and backgrounds for chart and plot area
*/
drawChartBox: function () {
var chart = this,
optionsChart = chart.options.chart,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
chartBackground = chart.chartBackground,
plotBackground = chart.plotBackground,
plotBorder = chart.plotBorder,
plotBGImage = chart.plotBGImage,
chartBorderWidth = optionsChart.borderWidth || 0,
chartBackgroundColor = optionsChart.backgroundColor,
plotBackgroundColor = optionsChart.plotBackgroundColor,
plotBackgroundImage = optionsChart.plotBackgroundImage,
plotBorderWidth = optionsChart.plotBorderWidth || 0,
mgn,
bgAttr,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
plotBox = chart.plotBox,
clipRect = chart.clipRect,
clipBox = chart.clipBox;
// Chart area
mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);
if (chartBorderWidth || chartBackgroundColor) {
if (!chartBackground) {
bgAttr = {
fill: chartBackgroundColor || NONE
};
if (chartBorderWidth) { // #980
bgAttr.stroke = optionsChart.borderColor;
bgAttr['stroke-width'] = chartBorderWidth;
}
chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn,
optionsChart.borderRadius, chartBorderWidth)
.attr(bgAttr)
.addClass(PREFIX + 'background')
.add()
.shadow(optionsChart.shadow);
} else { // resize
chartBackground.animate(
chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn })
);
}
}
// Plot background
if (plotBackgroundColor) {
if (!plotBackground) {
chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0)
.attr({
fill: plotBackgroundColor
})
.add()
.shadow(optionsChart.plotShadow);
} else {
plotBackground.animate(plotBox);
}
}
if (plotBackgroundImage) {
if (!plotBGImage) {
chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight)
.add();
} else {
plotBGImage.animate(plotBox);
}
}
// Plot clip
if (!clipRect) {
chart.clipRect = renderer.clipRect(clipBox);
} else {
clipRect.animate({
width: clipBox.width,
height: clipBox.height
});
}
// Plot area border
if (plotBorderWidth) {
if (!plotBorder) {
chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth)
.attr({
stroke: optionsChart.plotBorderColor,
'stroke-width': plotBorderWidth,
fill: NONE,
zIndex: 1
})
.add();
} else {
plotBorder.animate(
plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight })
);
}
}
// reset
chart.isDirtyBox = false;
},
/**
* Detect whether a certain chart property is needed based on inspecting its options
* and series. This mainly applies to the chart.invert property, and in extensions to
* the chart.angular and chart.polar properties.
*/
propFromSeries: function () {
var chart = this,
optionsChart = chart.options.chart,
klass,
seriesOptions = chart.options.series,
i,
value;
each(['inverted', 'angular', 'polar'], function (key) {
// The default series type's class
klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType];
// Get the value from available chart-wide properties
value = (
chart[key] || // 1. it is set before
optionsChart[key] || // 2. it is set in the options
(klass && klass.prototype[key]) // 3. it's default series class requires it
);
// 4. Check if any the chart's series require it
i = seriesOptions && seriesOptions.length;
while (!value && i--) {
klass = seriesTypes[seriesOptions[i].type];
if (klass && klass.prototype[key]) {
value = true;
}
}
// Set the chart property
chart[key] = value;
});
},
/**
* Link two or more series together. This is done initially from Chart.render,
* and after Chart.addSeries and Series.remove.
*/
linkSeries: function () {
var chart = this,
chartSeries = chart.series;
// Reset links
each(chartSeries, function (series) {
series.linkedSeries.length = 0;
});
// Apply new links
each(chartSeries, function (series) {
var linkedTo = series.options.linkedTo;
if (isString(linkedTo)) {
if (linkedTo === ':previous') {
linkedTo = chart.series[series.index - 1];
} else {
linkedTo = chart.get(linkedTo);
}
if (linkedTo) {
linkedTo.linkedSeries.push(series);
series.linkedParent = linkedTo;
}
}
});
},
/**
* Render series for the chart
*/
renderSeries: function () {
each(this.series, function (serie) {
serie.translate();
if (serie.setTooltipPoints) {
serie.setTooltipPoints();
}
serie.render();
});
},
/**
* Render labels for the chart
*/
renderLabels: function () {
var chart = this,
labels = chart.options.labels;
if (labels.items) {
each(labels.items, function (label) {
var style = extend(labels.style, label.style),
x = pInt(style.left) + chart.plotLeft,
y = pInt(style.top) + chart.plotTop + 12;
// delete to prevent rewriting in IE
delete style.left;
delete style.top;
chart.renderer.text(
label.html,
x,
y
)
.attr({ zIndex: 2 })
.css(style)
.add();
});
}
},
/**
* Render all graphics for the chart
*/
render: function () {
var chart = this,
axes = chart.axes,
renderer = chart.renderer,
options = chart.options;
// Title
chart.setTitle();
// Legend
chart.legend = new Legend(chart, options.legend);
chart.getStacks(); // render stacks
// Get margins by pre-rendering axes
// set axes scales
each(axes, function (axis) {
axis.setScale();
});
chart.getMargins();
chart.maxTicks = null; // reset for second pass
each(axes, function (axis) {
axis.setTickPositions(true); // update to reflect the new margins
axis.setMaxTicks();
});
chart.adjustTickAmounts();
chart.getMargins(); // second pass to check for new labels
// Draw the borders and backgrounds
chart.drawChartBox();
// Axes
if (chart.hasCartesianSeries) {
each(axes, function (axis) {
axis.render();
});
}
// The series
if (!chart.seriesGroup) {
chart.seriesGroup = renderer.g('series-group')
.attr({ zIndex: 3 })
.add();
}
chart.renderSeries();
// Labels
chart.renderLabels();
// Credits
chart.showCredits(options.credits);
// Set flag
chart.hasRendered = true;
},
/**
* Show chart credits based on config options
*/
showCredits: function (credits) {
if (credits.enabled && !this.credits) {
this.credits = this.renderer.text(
credits.text,
0,
0
)
.on('click', function () {
if (credits.href) {
location.href = credits.href;
}
})
.attr({
align: credits.position.align,
zIndex: 8
})
.css(credits.style)
.add()
.align(credits.position);
}
},
/**
* Clean up memory usage
*/
destroy: function () {
var chart = this,
axes = chart.axes,
series = chart.series,
container = chart.container,
i,
parentNode = container && container.parentNode;
// fire the chart.destoy event
fireEvent(chart, 'destroy');
// Delete the chart from charts lookup array
charts[chart.index] = UNDEFINED;
chartCount--;
chart.renderTo.removeAttribute('data-highcharts-chart');
// remove events
removeEvent(chart);
// ==== Destroy collections:
// Destroy axes
i = axes.length;
while (i--) {
axes[i] = axes[i].destroy();
}
// Destroy each series
i = series.length;
while (i--) {
series[i] = series[i].destroy();
}
// ==== Destroy chart properties:
each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage',
'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller',
'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) {
var prop = chart[name];
if (prop && prop.destroy) {
chart[name] = prop.destroy();
}
});
// remove container and all SVG
if (container) { // can break in IE when destroyed before finished loading
container.innerHTML = '';
removeEvent(container);
if (parentNode) {
discardElement(container);
}
}
// clean it all up
for (i in chart) {
delete chart[i];
}
},
/**
* VML namespaces can't be added until after complete. Listening
* for Perini's doScroll hack is not enough.
*/
isReadyToRender: function () {
var chart = this;
// Note: in spite of JSLint's complaints, win == win.top is required
/*jslint eqeq: true*/
if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) {
/*jslint eqeq: false*/
if (useCanVG) {
// Delay rendering until canvg library is downloaded and ready
CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL);
} else {
doc.attachEvent('onreadystatechange', function () {
doc.detachEvent('onreadystatechange', chart.firstRender);
if (doc.readyState === 'complete') {
chart.firstRender();
}
});
}
return false;
}
return true;
},
/**
* Prepare for first rendering after all data are loaded
*/
firstRender: function () {
var chart = this,
options = chart.options,
callback = chart.callback;
// Check whether the chart is ready to render
if (!chart.isReadyToRender()) {
return;
}
// Create the container
chart.getContainer();
// Run an early event after the container and renderer are established
fireEvent(chart, 'init');
chart.resetMargins();
chart.setChartSize();
// Set the common chart properties (mainly invert) from the given series
chart.propFromSeries();
// get axes
chart.getAxes();
// Initialize the series
each(options.series || [], function (serieOptions) {
chart.initSeries(serieOptions);
});
chart.linkSeries();
// Run an event after axes and series are initialized, but before render. At this stage,
// the series data is indexed and cached in the xData and yData arrays, so we can access
// those before rendering. Used in Highstock.
fireEvent(chart, 'beforeRender');
// depends on inverted and on margins being set
if (Highcharts.Pointer) {
chart.pointer = new Pointer(chart, options);
}
chart.render();
// add canvas
chart.renderer.draw();
// run callbacks
if (callback) {
callback.apply(chart, [chart]);
}
each(chart.callbacks, function (fn) {
fn.apply(chart, [chart]);
});
// If the chart was rendered outside the top container, put it back in
chart.cloneRenderTo(true);
fireEvent(chart, 'load');
},
/**
* Creates arrays for spacing and margin from given options.
*/
splashArray: function (target, options) {
var oVar = options[target],
tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar];
return [pick(options[target + 'Top'], tArray[0]),
pick(options[target + 'Right'], tArray[1]),
pick(options[target + 'Bottom'], tArray[2]),
pick(options[target + 'Left'], tArray[3])];
}
}; // end Chart
// Hook for exporting module
Chart.prototype.callbacks = [];
/**
* The Point object and prototype. Inheritable and used as base for PiePoint
*/
var Point = function () {};
Point.prototype = {
/**
* Initialize the point
* @param {Object} series The series object containing this point
* @param {Object} options The data in either number, array or object format
*/
init: function (series, options, x) {
var point = this,
colors;
point.series = series;
point.applyOptions(options, x);
point.pointAttr = {};
if (series.options.colorByPoint) {
colors = series.options.colors || series.chart.options.colors;
point.color = point.color || colors[series.colorCounter++];
// loop back to zero
if (series.colorCounter === colors.length) {
series.colorCounter = 0;
}
}
series.chart.pointCount++;
return point;
},
/**
* Apply the options containing the x and y data and possible some extra properties.
* This is called on point init or from point.update.
*
* @param {Object} options
*/
applyOptions: function (options, x) {
var point = this,
series = point.series,
pointValKey = series.options.pointValKey || series.pointValKey;
options = Point.prototype.optionsToObject.call(this, options);
// copy options directly to point
extend(point, options);
point.options = point.options ? extend(point.options, options) : options;
// For higher dimension series types. For instance, for ranges, point.y is mapped to point.low.
if (pointValKey) {
point.y = point[pointValKey];
}
// If no x is set by now, get auto incremented value. All points must have an
// x value, however the y value can be null to create a gap in the series
if (point.x === UNDEFINED && series) {
point.x = x === UNDEFINED ? series.autoIncrement() : x;
}
return point;
},
/**
* Transform number or array configs into objects
*/
optionsToObject: function (options) {
var ret = {},
series = this.series,
pointArrayMap = series.pointArrayMap || ['y'],
valueCount = pointArrayMap.length,
firstItemType,
i = 0,
j = 0;
if (typeof options === 'number' || options === null) {
ret[pointArrayMap[0]] = options;
} else if (isArray(options)) {
// with leading x value
if (options.length > valueCount) {
firstItemType = typeof options[0];
if (firstItemType === 'string') {
ret.name = options[0];
} else if (firstItemType === 'number') {
ret.x = options[0];
}
i++;
}
while (j < valueCount) {
ret[pointArrayMap[j++]] = options[i++];
}
} else if (typeof options === 'object') {
ret = options;
// This is the fastest way to detect if there are individual point dataLabels that need
// to be considered in drawDataLabels. These can only occur in object configs.
if (options.dataLabels) {
series._hasPointLabels = true;
}
// Same approach as above for markers
if (options.marker) {
series._hasPointMarkers = true;
}
}
return ret;
},
/**
* Destroy a point to clear memory. Its reference still stays in series.data.
*/
destroy: function () {
var point = this,
series = point.series,
chart = series.chart,
hoverPoints = chart.hoverPoints,
prop;
chart.pointCount--;
if (hoverPoints) {
point.setState();
erase(hoverPoints, point);
if (!hoverPoints.length) {
chart.hoverPoints = null;
}
}
if (point === chart.hoverPoint) {
point.onMouseOut();
}
// remove all events
if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive
removeEvent(point);
point.destroyElements();
}
if (point.legendItem) { // pies have legend items
chart.legend.destroyItem(point);
}
for (prop in point) {
point[prop] = null;
}
},
/**
* Destroy SVG elements associated with the point
*/
destroyElements: function () {
var point = this,
props = ['graphic', 'dataLabel', 'dataLabelUpper', 'group', 'connector', 'shadowGroup'],
prop,
i = 6;
while (i--) {
prop = props[i];
if (point[prop]) {
point[prop] = point[prop].destroy();
}
}
},
/**
* Return the configuration hash needed for the data label and tooltip formatters
*/
getLabelConfig: function () {
var point = this;
return {
x: point.category,
y: point.y,
key: point.name || point.category,
series: point.series,
point: point,
percentage: point.percentage,
total: point.total || point.stackTotal
};
},
/**
* Extendable method for formatting each point's tooltip line
*
* @return {String} A string to be concatenated in to the common tooltip text
*/
tooltipFormatter: function (pointFormat) {
// Insert options for valueDecimals, valuePrefix, and valueSuffix
var series = this.series,
seriesTooltipOptions = series.tooltipOptions,
valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''),
valuePrefix = seriesTooltipOptions.valuePrefix || '',
valueSuffix = seriesTooltipOptions.valueSuffix || '';
// Loop over the point array map and replace unformatted values with sprintf formatting markup
each(series.pointArrayMap || ['y'], function (key) {
key = '{point.' + key; // without the closing bracket
if (valuePrefix || valueSuffix) {
pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix);
}
pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}');
});
return format(pointFormat, {
point: this,
series: this.series
});
},
/**
* Fire an event on the Point object. Must not be renamed to fireEvent, as this
* causes a name clash in MooTools
* @param {String} eventType
* @param {Object} eventArgs Additional event arguments
* @param {Function} defaultFunction Default event handler
*/
firePointEvent: function (eventType, eventArgs, defaultFunction) {
var point = this,
series = this.series,
seriesOptions = series.options;
// load event handlers on demand to save time on mouseover/out
if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {
this.importEvents();
}
// add default handler if in selection mode
if (eventType === 'click' && seriesOptions.allowPointSelect) {
defaultFunction = function (event) {
// Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera
point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);
};
}
fireEvent(this, eventType, eventArgs, defaultFunction);
}
};/**
* @classDescription The base function which all other series types inherit from. The data in the series is stored
* in various arrays.
*
* - First, series.options.data contains all the original config options for
* each point whether added by options or methods like series.addPoint.
* - Next, series.data contains those values converted to points, but in case the series data length
* exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It
* only contains the points that have been created on demand.
* - Then there's series.points that contains all currently visible point objects. In case of cropping,
* the cropped-away points are not part of this array. The series.points array starts at series.cropStart
* compared to series.data and series.options.data. If however the series data is grouped, these can't
* be correlated one to one.
* - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points.
* - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points.
*
* @param {Object} chart
* @param {Object} options
*/
var Series = function () {};
Series.prototype = {
isCartesian: true,
type: 'line',
pointClass: Point,
sorted: true, // requires the data to be sorted
requireSorting: true,
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'lineColor',
'stroke-width': 'lineWidth',
fill: 'fillColor',
r: 'radius'
},
axisTypes: ['xAxis', 'yAxis'],
colorCounter: 0,
parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData
init: function (chart, options) {
var series = this,
eventType,
events,
chartSeries = chart.series,
sortByIndex = function (a, b) {
return pick(a.options.index, a._i) - pick(b.options.index, b._i);
};
series.chart = chart;
series.options = options = series.setOptions(options); // merge with plotOptions
series.linkedSeries = [];
// bind the axes
series.bindAxes();
// set some variables
extend(series, {
name: options.name,
state: NORMAL_STATE,
pointAttr: {},
visible: options.visible !== false, // true by default
selected: options.selected === true // false by default
});
// special
if (useCanVG) {
options.animation = false;
}
// register event listeners
events = options.events;
for (eventType in events) {
addEvent(series, eventType, events[eventType]);
}
if (
(events && events.click) ||
(options.point && options.point.events && options.point.events.click) ||
options.allowPointSelect
) {
chart.runTrackerClick = true;
}
series.getColor();
series.getSymbol();
// Set the data
each(series.parallelArrays, function (key) {
series[key + 'Data'] = [];
});
series.setData(options.data, false);
// Mark cartesian
if (series.isCartesian) {
chart.hasCartesianSeries = true;
}
// Register it in the chart
chartSeries.push(series);
series._i = chartSeries.length - 1;
// Sort series according to index option (#248, #1123, #2456)
stableSort(chartSeries, sortByIndex);
if (this.yAxis) {
stableSort(this.yAxis.series, sortByIndex);
}
each(chartSeries, function (series, i) {
series.index = i;
series.name = series.name || 'Series ' + (i + 1);
});
},
/**
* Set the xAxis and yAxis properties of cartesian series, and register the series
* in the axis.series array
*/
bindAxes: function () {
var series = this,
seriesOptions = series.options,
chart = series.chart,
axisOptions;
each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis
each(chart[AXIS], function (axis) { // loop through the chart's axis objects
axisOptions = axis.options;
// apply if the series xAxis or yAxis option mathches the number of the
// axis, or if undefined, use the first axis
if ((seriesOptions[AXIS] === axisOptions.index) ||
(seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) ||
(seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {
// register this series in the axis.series lookup
axis.series.push(series);
// set this series.xAxis or series.yAxis reference
series[AXIS] = axis;
// mark dirty for redraw
axis.isDirty = true;
}
});
// The series needs an X and an Y axis
if (!series[AXIS] && series.optionalAxis !== AXIS) {
error(18, true);
}
});
},
/**
* For simple series types like line and column, the data values are held in arrays like
* xData and yData for quick lookup to find extremes and more. For multidimensional series
* like bubble and map, this can be extended with arrays like zData and valueData by
* adding to the series.parallelArrays array.
*/
updateParallelArrays: function (point, i) {
var series = point.series,
args = arguments,
fn = typeof i === 'number' ?
// Insert the value in the given position
function (key) {
var val = key === 'y' && series.toYData ? series.toYData(point) : point[key];
series[key + 'Data'][i] = val;
} :
// Apply the method specified in i with the following arguments as arguments
function (key) {
Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2));
};
each(series.parallelArrays, fn);
},
/**
* Return an auto incremented x value based on the pointStart and pointInterval options.
* This is only used if an x value is not given for the point that calls autoIncrement.
*/
autoIncrement: function () {
var series = this,
options = series.options,
xIncrement = series.xIncrement;
xIncrement = pick(xIncrement, options.pointStart, 0);
series.pointInterval = pick(series.pointInterval, options.pointInterval, 1);
series.xIncrement = xIncrement + series.pointInterval;
return xIncrement;
},
/**
* Divide the series data into segments divided by null values.
*/
getSegments: function () {
var series = this,
lastNull = -1,
segments = [],
i,
points = series.points,
pointsLength = points.length;
if (pointsLength) { // no action required for []
// if connect nulls, just remove null points
if (series.options.connectNulls) {
i = pointsLength;
while (i--) {
if (points[i].y === null) {
points.splice(i, 1);
}
}
if (points.length) {
segments = [points];
}
// else, split on null points
} else {
each(points, function (point, i) {
if (point.y === null) {
if (i > lastNull + 1) {
segments.push(points.slice(lastNull + 1, i));
}
lastNull = i;
} else if (i === pointsLength - 1) { // last value
segments.push(points.slice(lastNull + 1, i + 1));
}
});
}
}
// register it
series.segments = segments;
},
/**
* Set the series options by merging from the options tree
* @param {Object} itemOptions
*/
setOptions: function (itemOptions) {
var chart = this.chart,
chartOptions = chart.options,
plotOptions = chartOptions.plotOptions,
userOptions = chart.userOptions || {},
userPlotOptions = userOptions.plotOptions || {},
typeOptions = plotOptions[this.type],
options;
this.userOptions = itemOptions;
options = merge(
typeOptions,
plotOptions.series,
itemOptions
);
// The tooltip options are merged between global and series specific options
this.tooltipOptions = merge(
defaultOptions.tooltip,
defaultOptions.plotOptions[this.type].tooltip,
userOptions.tooltip,
userPlotOptions.series && userPlotOptions.series.tooltip,
userPlotOptions[this.type] && userPlotOptions[this.type].tooltip,
itemOptions.tooltip
);
// Delete marker object if not allowed (#1125)
if (typeOptions.marker === null) {
delete options.marker;
}
return options;
},
getCyclic: function (prop, value, defaults) {
var i,
userOptions = this.userOptions,
indexName = '_' + prop + 'Index',
counterName = prop + 'Counter';
if (!value) {
if (defined(userOptions[indexName])) { // after Series.update()
i = userOptions[indexName];
} else {
userOptions[indexName] = i = this.chart[counterName] % defaults.length;
this.chart[counterName] += 1;
}
value = defaults[i];
}
this[prop] = value;
},
/**
* Get the series' color
*/
getColor: function () {
if (!this.options.colorByPoint) {
this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);
}
},
/**
* Get the series' symbol
*/
getSymbol: function () {
var seriesMarkerOption = this.options.marker;
this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);
// don't substract radius in image symbols (#604)
if (/^url/.test(this.symbol)) {
seriesMarkerOption.radius = 0;
}
},
drawLegendSymbol: LegendSymbolMixin.drawLineMarker,
/**
* Replace the series data with a new set of data
* @param {Object} data
* @param {Object} redraw
*/
setData: function (data, redraw, animation, updatePoints) {
var series = this,
oldData = series.points,
oldDataLength = (oldData && oldData.length) || 0,
dataLength,
options = series.options,
chart = series.chart,
firstPoint = null,
xAxis = series.xAxis,
hasCategories = xAxis && !!xAxis.categories,
tooltipPoints = series.tooltipPoints,
i,
turboThreshold = options.turboThreshold,
pt,
xData = this.xData,
yData = this.yData,
pointArrayMap = series.pointArrayMap,
valueCount = pointArrayMap && pointArrayMap.length;
data = data || [];
dataLength = data.length;
redraw = pick(redraw, true);
// If the point count is the same as is was, just run Point.update which is
// cheaper, allows animation, and keeps references to points.
if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData) {
each(data, function (point, i) {
oldData[i].update(point, false);
});
} else {
// Reset properties
series.xIncrement = null;
series.pointRange = hasCategories ? 1 : options.pointRange;
series.colorCounter = 0; // for series with colorByPoint (#1547)
// Update parallel arrays
each(this.parallelArrays, function (key) {
series[key + 'Data'].length = 0;
});
// In turbo mode, only one- or twodimensional arrays of numbers are allowed. The
// first value is tested, and we assume that all the rest are defined the same
// way. Although the 'for' loops are similar, they are repeated inside each
// if-else conditional for max performance.
if (turboThreshold && dataLength > turboThreshold) {
// find the first non-null point
i = 0;
while (firstPoint === null && i < dataLength) {
firstPoint = data[i];
i++;
}
if (isNumber(firstPoint)) { // assume all points are numbers
var x = pick(options.pointStart, 0),
pointInterval = pick(options.pointInterval, 1);
for (i = 0; i < dataLength; i++) {
xData[i] = x;
yData[i] = data[i];
x += pointInterval;
}
series.xIncrement = x;
} else if (isArray(firstPoint)) { // assume all points are arrays
if (valueCount) { // [x, low, high] or [x, o, h, l, c]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt.slice(1, valueCount + 1);
}
} else { // [x, y]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt[1];
}
}
} else {
error(12); // Highcharts expects configs to be numbers or arrays in turbo mode
}
} else {
for (i = 0; i < dataLength; i++) {
if (data[i] !== UNDEFINED) { // stray commas in oldIE
pt = { series: series };
series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);
series.updateParallelArrays(pt, i);
if (hasCategories && pt.name) {
xAxis.names[pt.x] = pt.name; // #2046
}
}
}
}
// Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON
if (isString(yData[0])) {
error(14, true);
}
series.data = [];
series.options.data = data;
//series.zData = zData;
// destroy old points
i = oldDataLength;
while (i--) {
if (oldData[i] && oldData[i].destroy) {
oldData[i].destroy();
}
}
if (tooltipPoints) { // #2594
tooltipPoints.length = 0;
}
// reset minRange (#878)
if (xAxis) {
xAxis.minRange = xAxis.userMinRange;
}
// redraw
series.isDirty = series.isDirtyData = chart.isDirtyBox = true;
animation = false;
}
if (redraw) {
chart.redraw(animation);
}
},
/**
* Process the data by cropping away unused data points if the series is longer
* than the crop threshold. This saves computing time for lage series.
*/
processData: function (force) {
var series = this,
processedXData = series.xData, // copied during slice operation below
processedYData = series.yData,
dataLength = processedXData.length,
croppedData,
cropStart = 0,
cropped,
distance,
closestPointRange,
xAxis = series.xAxis,
i, // loop variable
options = series.options,
cropThreshold = options.cropThreshold,
activePointCount = 0,
isCartesian = series.isCartesian,
xExtremes,
min,
max;
// If the series data or axes haven't changed, don't go through this. Return false to pass
// the message on to override methods like in data grouping.
if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {
return false;
}
// optionally filter out points outside the plot area
if (isCartesian && series.sorted && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) {
xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053)
min = xExtremes.min;
max = xExtremes.max;
// it's outside current extremes
if (processedXData[dataLength - 1] < min || processedXData[0] > max) {
processedXData = [];
processedYData = [];
// only crop if it's actually spilling out
} else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {
croppedData = this.cropData(series.xData, series.yData, min, max);
processedXData = croppedData.xData;
processedYData = croppedData.yData;
cropStart = croppedData.start;
cropped = true;
activePointCount = processedXData.length;
}
}
// Find the closest distance between processed points
for (i = processedXData.length - 1; i >= 0; i--) {
distance = processedXData[i] - processedXData[i - 1];
if (!cropped && processedXData[i] > min && processedXData[i] < max) {
activePointCount++;
}
if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) {
closestPointRange = distance;
// Unsorted data is not supported by the line tooltip, as well as data grouping and
// navigation in Stock charts (#725) and width calculation of columns (#1900)
} else if (distance < 0 && series.requireSorting) {
error(15);
}
}
// Record the properties
series.cropped = cropped; // undefined or true
series.cropStart = cropStart;
series.processedXData = processedXData;
series.processedYData = processedYData;
series.activePointCount = activePointCount;
if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
series.pointRange = closestPointRange || 1;
}
series.closestPointRange = closestPointRange;
},
/**
* Iterate over xData and crop values between min and max. Returns object containing crop start/end
* cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range
*/
cropData: function (xData, yData, min, max) {
var dataLength = xData.length,
cropStart = 0,
cropEnd = dataLength,
cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside
i;
// iterate up to find slice start
for (i = 0; i < dataLength; i++) {
if (xData[i] >= min) {
cropStart = mathMax(0, i - cropShoulder);
break;
}
}
// proceed to find slice end
for (; i < dataLength; i++) {
if (xData[i] > max) {
cropEnd = i + cropShoulder;
break;
}
}
return {
xData: xData.slice(cropStart, cropEnd),
yData: yData.slice(cropStart, cropEnd),
start: cropStart,
end: cropEnd
};
},
/**
* Generate the data point after the data has been processed by cropping away
* unused points and optionally grouped in Highcharts Stock.
*/
generatePoints: function () {
var series = this,
options = series.options,
dataOptions = options.data,
data = series.data,
dataLength,
processedXData = series.processedXData,
processedYData = series.processedYData,
pointClass = series.pointClass,
processedDataLength = processedXData.length,
cropStart = series.cropStart || 0,
cursor,
hasGroupedData = series.hasGroupedData,
point,
points = [],
i;
if (!data && !hasGroupedData) {
var arr = [];
arr.length = dataOptions.length;
data = series.data = arr;
}
for (i = 0; i < processedDataLength; i++) {
cursor = cropStart + i;
if (!hasGroupedData) {
if (data[cursor]) {
point = data[cursor];
} else if (dataOptions[cursor] !== UNDEFINED) { // #970
data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]);
}
points[i] = point;
} else {
// splat the y data in case of ohlc data array
points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i])));
}
}
// Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when
// swithching view from non-grouped data to grouped data (#637)
if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {
for (i = 0; i < dataLength; i++) {
if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points
i += processedDataLength;
}
if (data[i]) {
data[i].destroyElements();
data[i].plotX = UNDEFINED; // #1003
}
}
}
series.data = data;
series.points = points;
},
/**
* Calculate Y extremes for visible data
*/
getExtremes: function (yData) {
var xAxis = this.xAxis,
yAxis = this.yAxis,
xData = this.processedXData,
yDataLength,
activeYData = [],
activeCounter = 0,
xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis
xMin = xExtremes.min,
xMax = xExtremes.max,
validValue,
withinRange,
dataMin,
dataMax,
x,
y,
i,
j;
yData = yData || this.stackedYData || this.processedYData;
yDataLength = yData.length;
for (i = 0; i < yDataLength; i++) {
x = xData[i];
y = yData[i];
// For points within the visible range, including the first point outside the
// visible range, consider y extremes
validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));
withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin &&
(xData[i - 1] || x) <= xMax);
if (validValue && withinRange) {
j = y.length;
if (j) { // array, like ohlc or range data
while (j--) {
if (y[j] !== null) {
activeYData[activeCounter++] = y[j];
}
}
} else {
activeYData[activeCounter++] = y;
}
}
}
this.dataMin = pick(dataMin, arrayMin(activeYData));
this.dataMax = pick(dataMax, arrayMax(activeYData));
},
/**
* Translate data points from raw data values to chart specific positioning data
* needed later in drawPoints, drawGraph and drawTracker.
*/
translate: function () {
if (!this.processedXData) { // hidden series
this.processData();
}
this.generatePoints();
var series = this,
options = series.options,
stacking = options.stacking,
xAxis = series.xAxis,
categories = xAxis.categories,
yAxis = series.yAxis,
points = series.points,
dataLength = points.length,
hasModifyValue = !!series.modifyValue,
i,
pointPlacement = options.pointPlacement,
dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement),
threshold = options.threshold;
// Translate each point
for (i = 0; i < dataLength; i++) {
var point = points[i],
xValue = point.x,
yValue = point.y,
yBottom = point.low,
stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey],
pointStack,
stackValues;
// Discard disallowed y values for log axes
if (yAxis.isLog && yValue <= 0) {
point.y = yValue = null;
}
// Get the plotX translation
point.plotX = xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags'); // Math.round fixes #591
// Calculate the bottom y value for stacked series
if (stacking && series.visible && stack && stack[xValue]) {
pointStack = stack[xValue];
stackValues = pointStack.points[series.index + ',' + i];
yBottom = stackValues[0];
yValue = stackValues[1];
if (yBottom === 0) {
yBottom = pick(threshold, yAxis.min);
}
if (yAxis.isLog && yBottom <= 0) { // #1200, #1232
yBottom = null;
}
point.total = point.stackTotal = pointStack.total;
point.percentage = pointStack.total && (point.y / pointStack.total * 100);
point.stackY = yValue;
// Place the stack label
pointStack.setOffset(series.pointXOffset || 0, series.barW || 0);
}
// Set translated yBottom or remove it
point.yBottom = defined(yBottom) ?
yAxis.translate(yBottom, 0, 1, 0, 1) :
null;
// general hook, used for Highstock compare mode
if (hasModifyValue) {
yValue = series.modifyValue(yValue, point);
}
// Set the the plotY value, reset it for redraws
point.plotY = (typeof yValue === 'number' && yValue !== Infinity) ?
//mathRound(yAxis.translate(yValue, 0, 1, 0, 1) * 10) / 10 : // Math.round fixes #591
yAxis.translate(yValue, 0, 1, 0, 1) :
UNDEFINED;
// Set client related positions for mouse tracking
point.clientX = dynamicallyPlaced ? xAxis.translate(xValue, 0, 0, 0, 1) : point.plotX; // #1514
point.negative = point.y < (threshold || 0);
// some API data
point.category = categories && categories[point.x] !== UNDEFINED ?
categories[point.x] : point.x;
}
// now that we have the cropped data, build the segments
series.getSegments();
},
/**
* Animate in the series
*/
animate: function (init) {
var series = this,
chart = series.chart,
renderer = chart.renderer,
clipRect,
markerClipRect,
animation = series.options.animation,
clipBox = series.clipBox || chart.clipBox,
inverted = chart.inverted,
sharedClipKey;
// Animation option is set to true
if (animation && !isObject(animation)) {
animation = defaultPlotOptions[series.type].animation;
}
sharedClipKey = ['_sharedClip', animation.duration, animation.easing, clipBox.height].join(',');
// Initialize the animation. Set up the clipping rectangle.
if (init) {
// If a clipping rectangle with the same properties is currently present in the chart, use that.
clipRect = chart[sharedClipKey];
markerClipRect = chart[sharedClipKey + 'm'];
if (!clipRect) {
chart[sharedClipKey] = clipRect = renderer.clipRect(
extend(clipBox, { width: 0 })
);
chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect(
-99, // include the width of the first marker
inverted ? -chart.plotLeft : -chart.plotTop,
99,
inverted ? chart.chartWidth : chart.chartHeight
);
}
series.group.clip(clipRect);
series.markerGroup.clip(markerClipRect);
series.sharedClipKey = sharedClipKey;
// Run the animation
} else {
clipRect = chart[sharedClipKey];
if (clipRect) {
clipRect.animate({
width: chart.plotSizeX
}, animation);
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'].animate({
width: chart.plotSizeX + 99
}, animation);
}
// Delete this function to allow it only once
series.animate = null;
}
},
/**
* This runs after animation to land on the final plot clipping
*/
afterAnimate: function () {
var chart = this.chart,
sharedClipKey = this.sharedClipKey,
group = this.group,
clipBox = this.clipBox;
if (group && this.options.clip !== false) {
if (!sharedClipKey || !clipBox) {
group.clip(clipBox ? chart.renderer.clipRect(clipBox) : chart.clipRect);
}
this.markerGroup.clip(); // no clip
}
fireEvent(this, 'afterAnimate');
// Remove the shared clipping rectancgle when all series are shown
setTimeout(function () {
if (sharedClipKey && chart[sharedClipKey]) {
if (!clipBox) {
chart[sharedClipKey] = chart[sharedClipKey].destroy();
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();
}
}
}, 100);
},
/**
* Draw the markers
*/
drawPoints: function () {
var series = this,
pointAttr,
points = series.points,
chart = series.chart,
plotX,
plotY,
i,
point,
radius,
symbol,
isImage,
graphic,
options = series.options,
seriesMarkerOptions = options.marker,
seriesPointAttr = series.pointAttr[''],
pointMarkerOptions,
enabled,
isInside,
markerGroup = series.markerGroup,
globallyEnabled = pick(
seriesMarkerOptions.enabled,
series.activePointCount < (0.5 * series.xAxis.len / seriesMarkerOptions.radius)
);
if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) {
i = points.length;
while (i--) {
point = points[i];
plotX = mathFloor(point.plotX); // #1843
plotY = point.plotY;
graphic = point.graphic;
pointMarkerOptions = point.marker || {};
enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled;
isInside = chart.isInsidePlot(mathRound(plotX), plotY, chart.inverted); // #1858
// only draw the point if y is defined
if (enabled && plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
// shortcuts
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr;
radius = pointAttr.r;
symbol = pick(pointMarkerOptions.symbol, series.symbol);
isImage = symbol.indexOf('url') === 0;
if (graphic) { // update
graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled
.animate(extend({
x: plotX - radius,
y: plotY - radius
}, graphic.symbolName ? { // don't apply to image symbols #507
width: 2 * radius,
height: 2 * radius
} : {}));
} else if (isInside && (radius > 0 || isImage)) {
point.graphic = graphic = chart.renderer.symbol(
symbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius
)
.attr(pointAttr)
.add(markerGroup);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
}
}
},
/**
* Convert state properties from API naming conventions to SVG attributes
*
* @param {Object} options API options object
* @param {Object} base1 SVG attribute object to inherit from
* @param {Object} base2 Second level SVG attribute object to inherit from
*/
convertAttribs: function (options, base1, base2, base3) {
var conversion = this.pointAttrToOptions,
attr,
option,
obj = {};
options = options || {};
base1 = base1 || {};
base2 = base2 || {};
base3 = base3 || {};
for (attr in conversion) {
option = conversion[attr];
obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]);
}
return obj;
},
/**
* Get the state attributes. Each series type has its own set of attributes
* that are allowed to change on a point's state change. Series wide attributes are stored for
* all series, and additionally point specific attributes are stored for all
* points with individual marker options. If such options are not defined for the point,
* a reference to the series wide attributes is stored in point.pointAttr.
*/
getAttribs: function () {
var series = this,
seriesOptions = series.options,
normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
stateOptions = normalOptions.states,
stateOptionsHover = stateOptions[HOVER_STATE],
pointStateOptionsHover,
seriesColor = series.color,
normalDefaults = {
stroke: seriesColor,
fill: seriesColor
},
points = series.points || [], // #927
i,
point,
seriesPointAttr = [],
pointAttr,
pointAttrToOptions = series.pointAttrToOptions,
hasPointSpecificOptions = series.hasPointSpecificOptions,
negativeColor = seriesOptions.negativeColor,
defaultLineColor = normalOptions.lineColor,
defaultFillColor = normalOptions.fillColor,
turboThreshold = seriesOptions.turboThreshold,
attr,
key;
// series type specific modifications
if (seriesOptions.marker) { // line, spline, area, areaspline, scatter
// if no hover radius is given, default to normal radius + 2
stateOptionsHover.radius = stateOptionsHover.radius || normalOptions.radius + stateOptionsHover.radiusPlus;
stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus;
} else { // column, bar, pie
// if no hover color is given, brighten the normal color
stateOptionsHover.color = stateOptionsHover.color ||
Color(stateOptionsHover.color || seriesColor)
.brighten(stateOptionsHover.brightness).get();
}
// general point attributes for the series normal state
seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults);
// HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius
each([HOVER_STATE, SELECT_STATE], function (state) {
seriesPointAttr[state] =
series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]);
});
// set it
series.pointAttr = seriesPointAttr;
// Generate the point-specific attribute collections if specific point
// options are given. If not, create a referance to the series wide point
// attributes
i = points.length;
if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) {
while (i--) {
point = points[i];
normalOptions = (point.options && point.options.marker) || point.options;
if (normalOptions && normalOptions.enabled === false) {
normalOptions.radius = 0;
}
if (point.negative && negativeColor) {
point.color = point.fillColor = negativeColor;
}
hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868
// check if the point has specific visual options
if (point.options) {
for (key in pointAttrToOptions) {
if (defined(normalOptions[pointAttrToOptions[key]])) {
hasPointSpecificOptions = true;
}
}
}
// a specific marker config object is defined for the individual point:
// create it's own attribute collection
if (hasPointSpecificOptions) {
normalOptions = normalOptions || {};
pointAttr = [];
stateOptions = normalOptions.states || {}; // reassign for individual point
pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {};
// Handle colors for column and pies
if (!seriesOptions.marker) { // column, bar, point
// If no hover color is given, brighten the normal color. #1619, #2579
pointStateOptionsHover.color = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover.color) ||
Color(point.color)
.brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness)
.get();
}
// normal point state inherits series wide normal state
attr = { color: point.color }; // #868
if (!defaultFillColor) { // Individual point color or negative color markers (#2219)
attr.fillColor = point.color;
}
if (!defaultLineColor) {
attr.lineColor = point.color; // Bubbles take point color, line markers use white
}
pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]);
// inherit from point normal and series hover
pointAttr[HOVER_STATE] = series.convertAttribs(
stateOptions[HOVER_STATE],
seriesPointAttr[HOVER_STATE],
pointAttr[NORMAL_STATE]
);
// inherit from point normal and series hover
pointAttr[SELECT_STATE] = series.convertAttribs(
stateOptions[SELECT_STATE],
seriesPointAttr[SELECT_STATE],
pointAttr[NORMAL_STATE]
);
// no marker config object is created: copy a reference to the series-wide
// attribute collection
} else {
pointAttr = seriesPointAttr;
}
point.pointAttr = pointAttr;
}
}
},
/**
* Clear DOM objects and free up memory
*/
destroy: function () {
var series = this,
chart = series.chart,
issue134 = /AppleWebKit\/533/.test(userAgent),
destroy,
i,
data = series.data || [],
point,
prop,
axis;
// add event hook
fireEvent(series, 'destroy');
// remove all events
removeEvent(series);
// erase from axes
each(series.axisTypes || [], function (AXIS) {
axis = series[AXIS];
if (axis) {
erase(axis.series, series);
axis.isDirty = axis.forceRedraw = true;
}
});
// remove legend items
if (series.legendItem) {
series.chart.legend.destroyItem(series);
}
// destroy all points with their elements
i = data.length;
while (i--) {
point = data[i];
if (point && point.destroy) {
point.destroy();
}
}
series.points = null;
// Clear the animation timeout if we are destroying the series during initial animation
clearTimeout(series.animationTimeout);
// destroy all SVGElements associated to the series
each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',
'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {
if (series[prop]) {
// issue 134 workaround
destroy = issue134 && prop === 'group' ?
'hide' :
'destroy';
series[prop][destroy]();
}
});
// remove from hoverSeries
if (chart.hoverSeries === series) {
chart.hoverSeries = null;
}
erase(chart.series, series);
// clear all members
for (prop in series) {
delete series[prop];
}
},
/**
* Return the graph path of a segment
*/
getSegmentPath: function (segment) {
var series = this,
segmentPath = [],
step = series.options.step;
// build the segment line
each(segment, function (point, i) {
var plotX = point.plotX,
plotY = point.plotY,
lastPoint;
if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object
segmentPath.push.apply(segmentPath, series.getPointSpline(segment, point, i));
} else {
// moveTo or lineTo
segmentPath.push(i ? L : M);
// step line?
if (step && i) {
lastPoint = segment[i - 1];
if (step === 'right') {
segmentPath.push(
lastPoint.plotX,
plotY
);
} else if (step === 'center') {
segmentPath.push(
(lastPoint.plotX + plotX) / 2,
lastPoint.plotY,
(lastPoint.plotX + plotX) / 2,
plotY
);
} else {
segmentPath.push(
plotX,
lastPoint.plotY
);
}
}
// normal line to next point
segmentPath.push(
point.plotX,
point.plotY
);
}
});
return segmentPath;
},
/**
* Get the graph path
*/
getGraphPath: function () {
var series = this,
graphPath = [],
segmentPath,
singlePoints = []; // used in drawTracker
// Divide into segments and build graph and area paths
each(series.segments, function (segment) {
segmentPath = series.getSegmentPath(segment);
// add the segment to the graph, or a single point for tracking
if (segment.length > 1) {
graphPath = graphPath.concat(segmentPath);
} else {
singlePoints.push(segment[0]);
}
});
// Record it for use in drawGraph and drawTracker, and return graphPath
series.singlePoints = singlePoints;
series.graphPath = graphPath;
return graphPath;
},
/**
* Draw the actual graph
*/
drawGraph: function () {
var series = this,
options = this.options,
props = [['graph', options.lineColor || this.color]],
lineWidth = options.lineWidth,
dashStyle = options.dashStyle,
roundCap = options.linecap !== 'square',
graphPath = this.getGraphPath(),
negativeColor = options.negativeColor;
if (negativeColor) {
props.push(['graphNeg', negativeColor]);
}
// draw the graph
each(props, function (prop, i) {
var graphKey = prop[0],
graph = series[graphKey],
attribs;
if (graph) {
stop(graph); // cancel running animations, #459
graph.animate({ d: graphPath });
} else if (lineWidth && graphPath.length) { // #1487
attribs = {
stroke: prop[1],
'stroke-width': lineWidth,
fill: NONE,
zIndex: 1 // #1069
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
} else if (roundCap) {
attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
}
series[graphKey] = series.chart.renderer.path(graphPath)
.attr(attribs)
.add(series.group)
.shadow(!i && options.shadow);
}
});
},
/**
* Clip the graphs into the positive and negative coloured graphs
*/
clipNeg: function () {
var options = this.options,
chart = this.chart,
renderer = chart.renderer,
negativeColor = options.negativeColor || options.negativeFillColor,
translatedThreshold,
posAttr,
negAttr,
graph = this.graph,
area = this.area,
posClip = this.posClip,
negClip = this.negClip,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
chartSizeMax = mathMax(chartWidth, chartHeight),
yAxis = this.yAxis,
above,
below;
if (negativeColor && (graph || area)) {
translatedThreshold = mathRound(yAxis.toPixels(options.threshold || 0, true));
if (translatedThreshold < 0) {
chartSizeMax -= translatedThreshold; // #2534
}
above = {
x: 0,
y: 0,
width: chartSizeMax,
height: translatedThreshold
};
below = {
x: 0,
y: translatedThreshold,
width: chartSizeMax,
height: chartSizeMax
};
if (chart.inverted) {
above.height = below.y = chart.plotWidth - translatedThreshold;
if (renderer.isVML) {
above = {
x: chart.plotWidth - translatedThreshold - chart.plotLeft,
y: 0,
width: chartWidth,
height: chartHeight
};
below = {
x: translatedThreshold + chart.plotLeft - chartWidth,
y: 0,
width: chart.plotLeft + translatedThreshold,
height: chartWidth
};
}
}
if (yAxis.reversed) {
posAttr = below;
negAttr = above;
} else {
posAttr = above;
negAttr = below;
}
if (posClip) { // update
posClip.animate(posAttr);
negClip.animate(negAttr);
} else {
this.posClip = posClip = renderer.clipRect(posAttr);
this.negClip = negClip = renderer.clipRect(negAttr);
if (graph && this.graphNeg) {
graph.clip(posClip);
this.graphNeg.clip(negClip);
}
if (area) {
area.clip(posClip);
this.areaNeg.clip(negClip);
}
}
}
},
/**
* Initialize and perform group inversion on series.group and series.markerGroup
*/
invertGroups: function () {
var series = this,
chart = series.chart;
// Pie, go away (#1736)
if (!series.xAxis) {
return;
}
// A fixed size is needed for inversion to work
function setInvert() {
var size = {
width: series.yAxis.len,
height: series.xAxis.len
};
each(['group', 'markerGroup'], function (groupName) {
if (series[groupName]) {
series[groupName].attr(size).invert();
}
});
}
addEvent(chart, 'resize', setInvert); // do it on resize
addEvent(series, 'destroy', function () {
removeEvent(chart, 'resize', setInvert);
});
// Do it now
setInvert(); // do it now
// On subsequent render and redraw, just do setInvert without setting up events again
series.invertGroups = setInvert;
},
/**
* General abstraction for creating plot groups like series.group, series.dataLabelsGroup and
* series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.
*/
plotGroup: function (prop, name, visibility, zIndex, parent) {
var group = this[prop],
isNew = !group;
// Generate it on first call
if (isNew) {
this[prop] = group = this.chart.renderer.g(name)
.attr({
visibility: visibility,
zIndex: zIndex || 0.1 // IE8 needs this
})
.add(parent);
}
// Place it on first and subsequent (redraw) calls
group[isNew ? 'attr' : 'animate'](this.getPlotBox());
return group;
},
/**
* Get the translation and scale for the plot area of this series
*/
getPlotBox: function () {
var chart = this.chart,
xAxis = this.xAxis,
yAxis = this.yAxis;
// Swap axes for inverted (#2339)
if (chart.inverted) {
xAxis = yAxis;
yAxis = this.xAxis;
}
return {
translateX: xAxis ? xAxis.left : chart.plotLeft,
translateY: yAxis ? yAxis.top : chart.plotTop,
scaleX: 1, // #1623
scaleY: 1
};
},
/**
* Render the graph and markers
*/
render: function () {
var series = this,
chart = series.chart,
group,
options = series.options,
animation = options.animation,
// Animation doesn't work in IE8 quirks when the group div is hidden,
// and looks bad in other oldIE
animDuration = (animation && !!series.animate && chart.renderer.isSVG && pick(animation.duration, 500)) || 0,
visibility = series.visible ? VISIBLE : HIDDEN,
zIndex = options.zIndex,
hasRendered = series.hasRendered,
chartSeriesGroup = chart.seriesGroup;
// the group
group = series.plotGroup(
'group',
'series',
visibility,
zIndex,
chartSeriesGroup
);
series.markerGroup = series.plotGroup(
'markerGroup',
'markers',
visibility,
zIndex,
chartSeriesGroup
);
// initiate the animation
if (animDuration) {
series.animate(true);
}
// cache attributes for shapes
series.getAttribs();
// SVGRenderer needs to know this before drawing elements (#1089, #1795)
group.inverted = series.isCartesian ? chart.inverted : false;
// draw the graph if any
if (series.drawGraph) {
series.drawGraph();
series.clipNeg();
}
// draw the data labels (inn pies they go before the points)
if (series.drawDataLabels) {
series.drawDataLabels();
}
// draw the points
if (series.visible) {
series.drawPoints();
}
// draw the mouse tracking area
if (series.drawTracker && series.options.enableMouseTracking !== false) {
series.drawTracker();
}
// Handle inverted series and tracker groups
if (chart.inverted) {
series.invertGroups();
}
// Initial clipping, must be defined after inverting groups for VML
if (options.clip !== false && !series.sharedClipKey && !hasRendered) {
group.clip(chart.clipRect);
}
// Run the animation
if (animDuration) {
series.animate();
}
// Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option
// which should be available to the user).
if (!hasRendered) {
if (animDuration) {
series.animationTimeout = setTimeout(function () {
series.afterAnimate();
}, animDuration);
} else {
series.afterAnimate();
}
}
series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
series.hasRendered = true;
},
/**
* Redraw the series after an update in the axes.
*/
redraw: function () {
var series = this,
chart = series.chart,
wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
group = series.group,
xAxis = series.xAxis,
yAxis = series.yAxis;
// reposition on resize
if (group) {
if (chart.inverted) {
group.attr({
width: chart.plotWidth,
height: chart.plotHeight
});
}
group.animate({
translateX: pick(xAxis && xAxis.left, chart.plotLeft),
translateY: pick(yAxis && yAxis.top, chart.plotTop)
});
}
series.translate();
if (series.setTooltipPoints) {
series.setTooltipPoints(true);
}
series.render();
if (wasDirtyData) {
fireEvent(series, 'updatedData');
}
}
}; // end Series prototype
// Extend the Chart prototype for dynamic methods
extend(Chart.prototype, {
/**
* Add a series dynamically after time
*
* @param {Object} options The config options
* @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
* @return {Object} series The newly created series object
*/
addSeries: function (options, redraw, animation) {
var series,
chart = this;
if (options) {
redraw = pick(redraw, true); // defaults to true
fireEvent(chart, 'addSeries', { options: options }, function () {
series = chart.initSeries(options);
chart.isDirtyLegend = true; // the series array is out of sync with the display
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
return series;
},
/**
* Add an axis to the chart
* @param {Object} options The axis option
* @param {Boolean} isX Whether it is an X axis or a value axis
*/
addAxis: function (options, isX, redraw, animation) {
var key = isX ? 'xAxis' : 'yAxis',
chartOptions = this.options,
axis;
/*jslint unused: false*/
axis = new Axis(this, merge(options, {
index: this[key].length,
isX: isX
}));
/*jslint unused: true*/
// Push the new axis options to the chart options
chartOptions[key] = splat(chartOptions[key] || {});
chartOptions[key].push(options);
if (pick(redraw, true)) {
this.redraw(animation);
}
},
/**
* Dim the chart and show a loading text or symbol
* @param {String} str An optional text to show in the loading label instead of the default one
*/
showLoading: function (str) {
var chart = this,
options = chart.options,
loadingDiv = chart.loadingDiv,
loadingOptions = options.loading,
setLoadingSize = function () {
if (loadingDiv) {
css(loadingDiv, {
left: chart.plotLeft + PX,
top: chart.plotTop + PX,
width: chart.plotWidth + PX,
height: chart.plotHeight + PX
});
}
};
// create the layer at the first call
if (!loadingDiv) {
chart.loadingDiv = loadingDiv = createElement(DIV, {
className: PREFIX + 'loading'
}, extend(loadingOptions.style, {
zIndex: 10,
display: NONE
}), chart.container);
chart.loadingSpan = createElement(
'span',
null,
loadingOptions.labelStyle,
loadingDiv
);
addEvent(chart, 'redraw', setLoadingSize); // #1080
}
// update text
chart.loadingSpan.innerHTML = str || options.lang.loading;
// show it
if (!chart.loadingShown) {
css(loadingDiv, {
opacity: 0,
display: ''
});
animate(loadingDiv, {
opacity: loadingOptions.style.opacity
}, {
duration: loadingOptions.showDuration || 0
});
chart.loadingShown = true;
}
setLoadingSize();
},
/**
* Hide the loading layer
*/
hideLoading: function () {
var options = this.options,
loadingDiv = this.loadingDiv;
if (loadingDiv) {
animate(loadingDiv, {
opacity: 0
}, {
duration: options.loading.hideDuration || 100,
complete: function () {
css(loadingDiv, { display: NONE });
}
});
}
this.loadingShown = false;
}
});
// extend the Point prototype for dynamic methods
extend(Point.prototype, {
/**
* Update the point with new options (typically x/y data) and optionally redraw the series.
*
* @param {Object} options Point options as defined in the series.data array
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
*/
update: function (options, redraw, animation) {
var point = this,
series = point.series,
graphic = point.graphic,
i,
data = series.data,
chart = series.chart,
seriesOptions = series.options;
redraw = pick(redraw, true);
// fire the event with a default handler of doing the update
point.firePointEvent('update', { options: options }, function () {
point.applyOptions(options);
// update visuals
if (isObject(options)) {
series.getAttribs();
if (graphic) {
if (options && options.marker && options.marker.symbol) {
point.graphic = graphic.destroy();
} else {
graphic.attr(point.pointAttr[point.state || '']);
}
}
if (options && options.dataLabels && point.dataLabel) { // #2468
point.dataLabel = point.dataLabel.destroy();
}
}
// record changes in the parallel arrays
i = inArray(point, data);
series.updateParallelArrays(point, i);
seriesOptions.data[i] = point.options;
// redraw
series.isDirty = series.isDirtyData = true;
if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320
chart.isDirtyBox = true;
}
if (seriesOptions.legendType === 'point') { // #1831, #1885
chart.legend.destroyItem(point);
}
if (redraw) {
chart.redraw(animation);
}
});
},
/**
* Remove a point and optionally redraw the series and if necessary the axes
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
var point = this,
series = point.series,
points = series.points,
chart = series.chart,
i,
data = series.data;
setAnimation(animation, chart);
redraw = pick(redraw, true);
// fire the event with a default handler of removing the point
point.firePointEvent('remove', null, function () {
// splice all the parallel arrays
i = inArray(point, data);
if (data.length === points.length) {
points.splice(i, 1);
}
data.splice(i, 1);
series.options.data.splice(i, 1);
series.updateParallelArrays(point, 'splice', i, 1);
point.destroy();
// redraw
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
chart.redraw();
}
});
}
});
// Extend the series prototype for dynamic methods
extend(Series.prototype, {
/**
* Add a point dynamically after chart load time
* @param {Object} options Point options as given in series.data
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean} shift If shift is true, a point is shifted off the start
* of the series as one is appended to the end.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
addPoint: function (options, redraw, shift, animation) {
var series = this,
seriesOptions = series.options,
data = series.data,
graph = series.graph,
area = series.area,
chart = series.chart,
names = series.xAxis && series.xAxis.names,
currentShift = (graph && graph.shift) || 0,
dataOptions = seriesOptions.data,
point,
isInTheMiddle,
xData = series.xData,
x,
i;
setAnimation(animation, chart);
// Make graph animate sideways
if (shift) {
each([graph, area, series.graphNeg, series.areaNeg], function (shape) {
if (shape) {
shape.shift = currentShift + 1;
}
});
}
if (area) {
area.isArea = true; // needed in animation, both with and without shift
}
// Optional redraw, defaults to true
redraw = pick(redraw, true);
// Get options and push the point to xData, yData and series.options. In series.generatePoints
// the Point instance will be created on demand and pushed to the series.data array.
point = { series: series };
series.pointClass.prototype.applyOptions.apply(point, [options]);
x = point.x;
// Get the insertion point
i = xData.length;
if (series.requireSorting && x < xData[i - 1]) {
isInTheMiddle = true;
while (i && xData[i - 1] > x) {
i--;
}
}
series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item
series.updateParallelArrays(point, i); // update it
if (names) {
names[x] = point.name;
}
dataOptions.splice(i, 0, options);
if (isInTheMiddle) {
series.data.splice(i, 0, null);
series.processData();
}
// Generate points to be added to the legend (#1329)
if (seriesOptions.legendType === 'point') {
series.generatePoints();
}
// Shift the first point off the parallel arrays
// todo: consider series.removePoint(i) method
if (shift) {
if (data[0] && data[0].remove) {
data[0].remove(false);
} else {
data.shift();
series.updateParallelArrays(point, 'shift');
dataOptions.shift();
}
}
// redraw
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
series.getAttribs(); // #1937
chart.redraw();
}
},
/**
* Remove a series and optionally redraw the chart
*
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
var series = this,
chart = series.chart;
redraw = pick(redraw, true);
if (!series.isRemoving) { /* prevent triggering native event in jQuery
(calling the remove function from the remove event) */
series.isRemoving = true;
// fire the event with a default handler of removing the point
fireEvent(series, 'remove', null, function () {
// destroy elements
series.destroy();
// redraw
chart.isDirtyLegend = chart.isDirtyBox = true;
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
series.isRemoving = false;
},
/**
* Update the series with a new set of options
*/
update: function (newOptions, redraw) {
var series = this,
chart = this.chart,
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type,
proto = seriesTypes[oldType].prototype,
preserve = ['group', 'markerGroup', 'dataLabelsGroup'],
n;
// Make sure groups are not destroyed (#3094)
each(preserve, function (prop) {
preserve[prop] = series[prop];
delete series[prop];
});
// Do the merge, with some forced options
newOptions = merge(oldOptions, {
animation: false,
index: this.index,
pointStart: this.xData[0] // when updating after addPoint
}, { data: this.options.data }, newOptions);
// Destroy the series and reinsert methods from the type prototype
this.remove(false);
for (n in proto) { // Overwrite series-type specific methods (#2270)
if (proto.hasOwnProperty(n)) {
this[n] = UNDEFINED;
}
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);
// Re-register groups (#3094)
each(preserve, function (prop) {
series[prop] = preserve[prop];
});
this.init(chart, newOptions);
chart.linkSeries(); // Links are lost in this.remove (#3028)
if (pick(redraw, true)) {
chart.redraw(false);
}
}
});
// Extend the Axis.prototype for dynamic methods
extend(Axis.prototype, {
/**
* Update the axis with a new options structure
*/
update: function (newOptions, redraw) {
var chart = this.chart;
newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions);
this.destroy(true);
this._addedPlotLB = UNDEFINED; // #1611, #2887
this.init(chart, extend(newOptions, { events: UNDEFINED }));
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Remove the axis from the chart
*/
remove: function (redraw) {
var chart = this.chart,
key = this.coll, // xAxis or yAxis
axisSeries = this.series,
i = axisSeries.length;
// Remove associated series (#2687)
while (i--) {
if (axisSeries[i]) {
axisSeries[i].remove(false);
}
}
// Remove the axis
erase(chart.axes, this);
erase(chart[key], this);
chart.options[key].splice(this.options.index, 1);
each(chart[key], function (axis, i) { // Re-index, #1706
axis.options.index = i;
});
this.destroy();
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Update the axis title by options
*/
setTitle: function (newTitleOptions, redraw) {
this.update({ title: newTitleOptions }, redraw);
},
/**
* Set new axis categories and optionally redraw
* @param {Array} categories
* @param {Boolean} redraw
*/
setCategories: function (categories, redraw) {
this.update({ categories: categories }, redraw);
}
});
/**
* LineSeries object
*/
var LineSeries = extendClass(Series);
seriesTypes.line = LineSeries;
/**
* Set the default options for column
*/
defaultPlotOptions.column = merge(defaultSeriesOptions, {
borderColor: '#FFFFFF',
//borderWidth: 1,
borderRadius: 0,
//colorByPoint: undefined,
groupPadding: 0.2,
//grouping: true,
marker: null, // point options are specified in the base options
pointPadding: 0.1,
//pointWidth: null,
minPointLength: 0,
cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes
pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories
states: {
hover: {
brightness: 0.1,
shadow: false,
halo: false
},
select: {
color: '#C0C0C0',
borderColor: '#000000',
shadow: false
}
},
dataLabels: {
align: null, // auto
verticalAlign: null, // auto
y: null
},
stickyTracking: false,
tooltip: {
distance: 6
},
threshold: 0
});
/**
* ColumnSeries object
*/
var ColumnSeries = extendClass(Series, {
type: 'column',
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
fill: 'color',
r: 'borderRadius'
},
cropShoulder: 0,
trackerGroups: ['group', 'dataLabelsGroup'],
negStacks: true, // use separate negative stacks, unlike area stacks where a negative
// point is substracted from previous (#1910)
/**
* Initialize the series
*/
init: function () {
Series.prototype.init.apply(this, arguments);
var series = this,
chart = series.chart;
// if the series is added dynamically, force redraw of other
// series affected by a new column
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
},
/**
* Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding,
* pointWidth etc.
*/
getColumnMetrics: function () {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
reversedXAxis = xAxis.reversed,
stackKey,
stackGroups = {},
columnIndex,
columnCount = 0;
// Get the total number of column type series.
// This is called on every series. Consider moving this logic to a
// chart.orderStacks() function and call it on init, addSeries and removeSeries
if (options.grouping === false) {
columnCount = 1;
} else {
each(series.chart.series, function (otherSeries) {
var otherOptions = otherSeries.options,
otherYAxis = otherSeries.yAxis;
if (otherSeries.type === series.type && otherSeries.visible &&
yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086
if (otherOptions.stacking) {
stackKey = otherSeries.stackKey;
if (stackGroups[stackKey] === UNDEFINED) {
stackGroups[stackKey] = columnCount++;
}
columnIndex = stackGroups[stackKey];
} else if (otherOptions.grouping !== false) { // #1162
columnIndex = columnCount++;
}
otherSeries.columnIndex = columnIndex;
}
});
}
var categoryWidth = mathMin(
mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610
xAxis.len // #1535
),
groupPadding = categoryWidth * options.groupPadding,
groupWidth = categoryWidth - 2 * groupPadding,
pointOffsetWidth = groupWidth / columnCount,
optionPointWidth = options.pointWidth,
pointPadding = defined(optionPointWidth) ? (pointOffsetWidth - optionPointWidth) / 2 :
pointOffsetWidth * options.pointPadding,
pointWidth = pick(optionPointWidth, pointOffsetWidth - 2 * pointPadding), // exact point width, used in polar charts
colIndex = (reversedXAxis ?
columnCount - (series.columnIndex || 0) : // #1251
series.columnIndex) || 0,
pointXOffset = pointPadding + (groupPadding + colIndex *
pointOffsetWidth - (categoryWidth / 2)) *
(reversedXAxis ? -1 : 1);
// Save it for reading in linked series (Error bars particularly)
return (series.columnMetrics = {
width: pointWidth,
offset: pointXOffset
});
},
/**
* Translate each point to the plot area coordinate system and find shape positions
*/
translate: function () {
var series = this,
chart = series.chart,
options = series.options,
borderWidth = series.borderWidth = pick(
options.borderWidth,
series.activePointCount > 0.5 * series.xAxis.len ? 0 : 1
),
yAxis = series.yAxis,
threshold = options.threshold,
translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),
minPointLength = pick(options.minPointLength, 5),
metrics = series.getColumnMetrics(),
pointWidth = metrics.width,
seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width
pointXOffset = series.pointXOffset = metrics.offset,
xCrisp = -(borderWidth % 2 ? 0.5 : 0),
yCrisp = borderWidth % 2 ? 0.5 : 1;
if (chart.renderer.isVML && chart.inverted) {
yCrisp += 1;
}
// When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual
// columns to have individual sizes. When pointPadding is greater, we strive for equal-width
// columns (#2694).
if (options.pointPadding) {
seriesBarW = mathCeil(seriesBarW);
}
Series.prototype.translate.apply(series);
// Record the new values
each(series.points, function (point) {
var yBottom = pick(point.yBottom, translatedThreshold),
plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)
barX = point.plotX + pointXOffset,
barW = seriesBarW,
barY = mathMin(plotY, yBottom),
right,
bottom,
fromTop,
barH = mathMax(plotY, yBottom) - barY;
// Handle options.minPointLength
if (mathAbs(barH) < minPointLength) {
if (minPointLength) {
barH = minPointLength;
barY =
mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked
yBottom - minPointLength : // keep position
translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)
}
}
// Cache for access in polar
point.barX = barX;
point.pointWidth = pointWidth;
// Fix the tooltip on center of grouped columns (#1216)
point.tooltipPos = chart.inverted ? [yAxis.len - plotY, series.xAxis.len - barX - barW / 2] : [barX + barW / 2, plotY];
// Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)
right = mathRound(barX + barW) + xCrisp;
barX = mathRound(barX) + xCrisp;
barW = right - barX;
fromTop = mathAbs(barY) < 0.5;
bottom = mathRound(barY + barH) + yCrisp;
barY = mathRound(barY) + yCrisp;
barH = bottom - barY;
// Top edges are exceptions
if (fromTop) {
barY -= 1;
barH += 1;
}
// Register shape type and arguments to be used in drawPoints
point.shapeType = 'rect';
point.shapeArgs = {
x: barX,
y: barY,
width: barW,
height: barH
};
});
},
getSymbol: noop,
/**
* Use a solid rectangle like the area series types
*/
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* Columns have no graph
*/
drawGraph: noop,
/**
* Draw the columns. For bars, the series.group is rotated, so the same coordinates
* apply for columns and bars. This method is inherited by scatter series.
*
*/
drawPoints: function () {
var series = this,
chart = this.chart,
options = series.options,
renderer = chart.renderer,
animationLimit = options.animationLimit || 250,
shapeArgs,
pointAttr;
// draw the columns
each(series.points, function (point) {
var plotY = point.plotY,
graphic = point.graphic,
borderAttr;
if (plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
shapeArgs = point.shapeArgs;
borderAttr = defined(series.borderWidth) ? {
'stroke-width': series.borderWidth
} : {};
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE];
if (graphic) { // update
stop(graphic);
graphic.attr(borderAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs));
} else {
point.graphic = graphic = renderer[point.shapeType](shapeArgs)
.attr(pointAttr)
.attr(borderAttr)
.add(series.group)
.shadow(options.shadow, null, options.stacking && !options.borderRadius);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
});
},
/**
* Animate the column heights one by one from zero
* @param {Boolean} init Whether to initialize the animation or run it
*/
animate: function (init) {
var series = this,
yAxis = this.yAxis,
options = series.options,
inverted = this.chart.inverted,
attr = {},
translatedThreshold;
if (hasSVG) { // VML is too slow anyway
if (init) {
attr.scaleY = 0.001;
translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold)));
if (inverted) {
attr.translateX = translatedThreshold - yAxis.len;
} else {
attr.translateY = translatedThreshold;
}
series.group.attr(attr);
} else { // run the animation
attr.scaleY = 1;
attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos;
series.group.animate(attr, series.options.animation);
// delete this function to allow it only once
series.animate = null;
}
}
},
/**
* Remove this series from the chart
*/
remove: function () {
var series = this,
chart = series.chart;
// column and bar series affects other series of the same type
// as they are either stacked or grouped
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
Series.prototype.remove.apply(series, arguments);
}
});
seriesTypes.column = ColumnSeries;
/**
* Set the default options for scatter
*/
defaultPlotOptions.scatter = merge(defaultSeriesOptions, {
lineWidth: 0,
tooltip: {
headerFormat: '<span style="color:{series.color}">\u25CF</span> <span style="font-size: 10px;"> {series.name}</span><br/>',
pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>'
},
stickyTracking: false
});
/**
* The scatter series class
*/
var ScatterSeries = extendClass(Series, {
type: 'scatter',
sorted: false,
requireSorting: false,
noSharedTooltip: true,
trackerGroups: ['markerGroup', 'dataLabelsGroup'],
takeOrdinalPosition: false, // #2342
singularTooltips: true,
drawGraph: function () {
if (this.options.lineWidth) {
Series.prototype.drawGraph.call(this);
}
}
});
seriesTypes.scatter = ScatterSeries;
/**
* Draw the data labels
*/
Series.prototype.drawDataLabels = function () {
var series = this,
seriesOptions = series.options,
cursor = seriesOptions.cursor,
options = seriesOptions.dataLabels,
points = series.points,
pointOptions,
generalOptions,
str,
dataLabelsGroup;
if (options.enabled || series._hasPointLabels) {
// Process default alignment of data labels for columns
if (series.dlProcessOptions) {
series.dlProcessOptions(options);
}
// Create a separate group for the data labels to avoid rotation
dataLabelsGroup = series.plotGroup(
'dataLabelsGroup',
'data-labels',
options.defer ? HIDDEN : VISIBLE,
options.zIndex || 6
);
if (!series.hasRendered && pick(options.defer, true)) {
dataLabelsGroup.attr({ opacity: 0 });
addEvent(series, 'afterAnimate', function () {
if (series.visible) { // #3023, #3024
dataLabelsGroup.show();
}
dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 });
});
}
// Make the labels for each point
generalOptions = options;
each(points, function (point) {
var enabled,
dataLabel = point.dataLabel,
labelConfig,
attr,
name,
rotation,
connector = point.connector,
isNew = true;
// Determine if each data label is enabled
pointOptions = point.options && point.options.dataLabels;
enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled); // #2282
// If the point is outside the plot area, destroy it. #678, #820
if (dataLabel && !enabled) {
point.dataLabel = dataLabel.destroy();
// Individual labels are disabled if the are explicitly disabled
// in the point options, or if they fall outside the plot area.
} else if (enabled) {
// Create individual options structure that can be extended without
// affecting others
options = merge(generalOptions, pointOptions);
rotation = options.rotation;
// Get the string
labelConfig = point.getLabelConfig();
str = options.format ?
format(options.format, labelConfig) :
options.formatter.call(labelConfig, options);
// Determine the color
options.style.color = pick(options.color, options.style.color, series.color, 'black');
// update existing label
if (dataLabel) {
if (defined(str)) {
dataLabel
.attr({
text: str
});
isNew = false;
} else { // #1437 - the label is shown conditionally
point.dataLabel = dataLabel = dataLabel.destroy();
if (connector) {
point.connector = connector.destroy();
}
}
// create new label
} else if (defined(str)) {
attr = {
//align: align,
fill: options.backgroundColor,
stroke: options.borderColor,
'stroke-width': options.borderWidth,
r: options.borderRadius || 0,
rotation: rotation,
padding: options.padding,
zIndex: 1
};
// Remove unused attributes (#947)
for (name in attr) {
if (attr[name] === UNDEFINED) {
delete attr[name];
}
}
dataLabel = point.dataLabel = series.chart.renderer[rotation ? 'text' : 'label']( // labels don't support rotation
str,
0,
-999,
null,
null,
null,
options.useHTML
)
.attr(attr)
.css(extend(options.style, cursor && { cursor: cursor }))
.add(dataLabelsGroup)
.shadow(options.shadow);
}
if (dataLabel) {
// Now the data label is created and placed at 0,0, so we need to align it
series.alignDataLabel(point, dataLabel, options, null, isNew);
}
}
});
}
};
/**
* Align each individual data label
*/
Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var chart = this.chart,
inverted = chart.inverted,
plotX = pick(point.plotX, -999),
plotY = pick(point.plotY, -999),
bBox = dataLabel.getBBox(),
// Math.round for rounding errors (#2683), alignTo to allow column labels (#2700)
visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) ||
(alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))),
alignAttr; // the final position;
if (visible) {
// The alignment box is a singular point
alignTo = extend({
x: inverted ? chart.plotWidth - plotY : plotX,
y: mathRound(inverted ? chart.plotHeight - plotX : plotY),
width: 0,
height: 0
}, alignTo);
// Add the text size for alignment calculation
extend(options, {
width: bBox.width,
height: bBox.height
});
// Allow a hook for changing alignment in the last moment, then do the alignment
if (options.rotation) { // Fancy box alignment isn't supported for rotated text
dataLabel[isNew ? 'attr' : 'animate']({
x: alignTo.x + options.x + alignTo.width / 2,
y: alignTo.y + options.y + alignTo.height / 2
})
.attr({ // #3003
align: options.align
});
} else {
dataLabel.align(options, null, alignTo);
alignAttr = dataLabel.alignAttr;
// Handle justify or crop
if (pick(options.overflow, 'justify') === 'justify') {
this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew);
} else if (pick(options.crop, true)) {
// Now check that the data label is within the plot area
visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height);
}
}
}
// Show or hide based on the final aligned position
if (!visible) {
dataLabel.attr({ y: -999 });
dataLabel.placed = false; // don't animate back in
}
};
/**
* If data labels fall partly outside the plot area, align them back in, in a way that
* doesn't hide the point.
*/
Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {
var chart = this.chart,
align = options.align,
verticalAlign = options.verticalAlign,
off,
justified;
// Off left
off = alignAttr.x;
if (off < 0) {
if (align === 'right') {
options.align = 'left';
} else {
options.x = -off;
}
justified = true;
}
// Off right
off = alignAttr.x + bBox.width;
if (off > chart.plotWidth) {
if (align === 'left') {
options.align = 'right';
} else {
options.x = chart.plotWidth - off;
}
justified = true;
}
// Off top
off = alignAttr.y;
if (off < 0) {
if (verticalAlign === 'bottom') {
options.verticalAlign = 'top';
} else {
options.y = -off;
}
justified = true;
}
// Off bottom
off = alignAttr.y + bBox.height;
if (off > chart.plotHeight) {
if (verticalAlign === 'top') {
options.verticalAlign = 'bottom';
} else {
options.y = chart.plotHeight - off;
}
justified = true;
}
if (justified) {
dataLabel.placed = !isNew;
dataLabel.align(options, null, alignTo);
}
};
/**
* Override the base drawDataLabels method by pie specific functionality
*/
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawDataLabels = function () {
var series = this,
data = series.data,
point,
chart = series.chart,
options = series.options.dataLabels,
connectorPadding = pick(options.connectorPadding, 10),
connectorWidth = pick(options.connectorWidth, 1),
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
connector,
connectorPath,
softConnector = pick(options.softConnector, true),
distanceOption = options.distance,
seriesCenter = series.center,
radius = seriesCenter[2] / 2,
centerY = seriesCenter[1],
outside = distanceOption > 0,
dataLabel,
dataLabelWidth,
labelPos,
labelHeight,
halves = [// divide the points into right and left halves for anti collision
[], // right
[] // left
],
x,
y,
visibility,
rankArr,
i,
j,
overflow = [0, 0, 0, 0], // top, right, bottom, left
sort = function (a, b) {
return b.y - a.y;
};
// get out if not enabled
if (!series.visible || (!options.enabled && !series._hasPointLabels)) {
return;
}
// run parent method
Series.prototype.drawDataLabels.apply(series);
// arrange points for detection collision
each(data, function (point) {
if (point.dataLabel && point.visible) { // #407, #2510
halves[point.half].push(point);
}
});
/* Loop over the points in each half, starting from the top and bottom
* of the pie to detect overlapping labels.
*/
i = 2;
while (i--) {
var slots = [],
slotsLength,
usedSlots = [],
points = halves[i],
pos,
bottom,
length = points.length,
slotIndex;
if (!length) {
continue;
}
// Sort by angle
series.sortByAngle(points, i - 0.5);
// Assume equal label heights on either hemisphere (#2630)
j = labelHeight = 0;
while (!labelHeight && points[j]) { // #1569
labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968
j++;
}
// Only do anti-collision when we are outside the pie and have connectors (#856)
if (distanceOption > 0) {
// Build the slots
bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight);
for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) {
slots.push(pos);
}
slotsLength = slots.length;
/* Visualize the slots
if (!series.slotElements) {
series.slotElements = [];
}
if (i === 1) {
series.slotElements.forEach(function (elem) {
elem.destroy();
});
series.slotElements.length = 0;
}
slots.forEach(function (pos, no) {
var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0),
slotY = pos + chart.plotTop;
if (!isNaN(slotX)) {
series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1)
.attr({
'stroke-width': 1,
stroke: 'silver',
fill: 'rgba(0,0,255,0.1)'
})
.add());
series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4)
.attr({
fill: 'silver'
}).add());
}
});
// */
// if there are more values than available slots, remove lowest values
if (length > slotsLength) {
// create an array for sorting and ranking the points within each quarter
rankArr = [].concat(points);
rankArr.sort(sort);
j = length;
while (j--) {
rankArr[j].rank = j;
}
j = length;
while (j--) {
if (points[j].rank >= slotsLength) {
points.splice(j, 1);
}
}
length = points.length;
}
// The label goes to the nearest open slot, but not closer to the edge than
// the label's index.
for (j = 0; j < length; j++) {
point = points[j];
labelPos = point.labelPos;
var closest = 9999,
distance,
slotI;
// find the closest slot index
for (slotI = 0; slotI < slotsLength; slotI++) {
distance = mathAbs(slots[slotI] - labelPos[1]);
if (distance < closest) {
closest = distance;
slotIndex = slotI;
}
}
// if that slot index is closer to the edges of the slots, move it
// to the closest appropriate slot
if (slotIndex < j && slots[j] !== null) { // cluster at the top
slotIndex = j;
} else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom
slotIndex = slotsLength - length + j;
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
} else {
// Slot is taken, find next free slot below. In the next run, the next slice will find the
// slot above these, because it is the closest one
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
}
usedSlots.push({ i: slotIndex, y: slots[slotIndex] });
slots[slotIndex] = null; // mark as taken
}
// sort them in order to fill in from the top
usedSlots.sort(sort);
}
// now the used slots are sorted, fill them up sequentially
for (j = 0; j < length; j++) {
var slot, naturalY;
point = points[j];
labelPos = point.labelPos;
dataLabel = point.dataLabel;
visibility = point.visible === false ? HIDDEN : VISIBLE;
naturalY = labelPos[1];
if (distanceOption > 0) {
slot = usedSlots.pop();
slotIndex = slot.i;
// if the slot next to currrent slot is free, the y value is allowed
// to fall back to the natural position
y = slot.y;
if ((naturalY > y && slots[slotIndex + 1] !== null) ||
(naturalY < y && slots[slotIndex - 1] !== null)) {
y = mathMin(mathMax(0, naturalY), chart.plotHeight);
}
} else {
y = naturalY;
}
// get the x - use the natural x position for first and last slot, to prevent the top
// and botton slice connectors from touching each other on either side
x = options.justify ?
seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) :
series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i);
// Record the placement and visibility
dataLabel._attr = {
visibility: visibility,
align: labelPos[6]
};
dataLabel._pos = {
x: x + options.x +
({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0),
y: y + options.y - 10 // 10 is for the baseline (label vs text)
};
dataLabel.connX = x;
dataLabel.connY = y;
// Detect overflowing data labels
if (this.options.size === null) {
dataLabelWidth = dataLabel.width;
// Overflow left
if (x - dataLabelWidth < connectorPadding) {
overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]);
// Overflow right
} else if (x + dataLabelWidth > plotWidth - connectorPadding) {
overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]);
}
// Overflow top
if (y - labelHeight / 2 < 0) {
overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]);
// Overflow left
} else if (y + labelHeight / 2 > plotHeight) {
overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]);
}
}
} // for each point
} // for each half
// Do not apply the final placement and draw the connectors until we have verified
// that labels are not spilling over.
if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) {
// Place the labels in the final position
this.placeDataLabels();
// Draw the connectors
if (outside && connectorWidth) {
each(this.points, function (point) {
connector = point.connector;
labelPos = point.labelPos;
dataLabel = point.dataLabel;
if (dataLabel && dataLabel._pos) {
visibility = dataLabel._attr.visibility;
x = dataLabel.connX;
y = dataLabel.connY;
connectorPath = softConnector ? [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
'C',
x, y, // first break, next to the label
2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5],
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
] : [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
L,
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
];
if (connector) {
connector.animate({ d: connectorPath });
connector.attr('visibility', visibility);
} else {
point.connector = connector = series.chart.renderer.path(connectorPath).attr({
'stroke-width': connectorWidth,
stroke: options.connectorColor || point.color || '#606060',
visibility: visibility
//zIndex: 0 // #2722 (reversed)
})
.add(series.dataLabelsGroup);
}
} else if (connector) {
point.connector = connector.destroy();
}
});
}
}
};
/**
* Perform the final placement of the data labels after we have verified that they
* fall within the plot area.
*/
seriesTypes.pie.prototype.placeDataLabels = function () {
each(this.points, function (point) {
var dataLabel = point.dataLabel,
_pos;
if (dataLabel) {
_pos = dataLabel._pos;
if (_pos) {
dataLabel.attr(dataLabel._attr);
dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos);
dataLabel.moved = true;
} else if (dataLabel) {
dataLabel.attr({ y: -999 });
}
}
});
};
seriesTypes.pie.prototype.alignDataLabel = noop;
/**
* Verify whether the data labels are allowed to draw, or we should run more translation and data
* label positioning to keep them inside the plot area. Returns true when data labels are ready
* to draw.
*/
seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) {
var center = this.center,
options = this.options,
centerOption = options.center,
minSize = options.minSize || 80,
newSize = minSize,
ret;
// Handle horizontal size and center
if (centerOption[0] !== null) { // Fixed center
newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize);
} else { // Auto center
newSize = mathMax(
center[2] - overflow[1] - overflow[3], // horizontal overflow
minSize
);
center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center
}
// Handle vertical size and center
if (centerOption[1] !== null) { // Fixed center
newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize);
} else { // Auto center
newSize = mathMax(
mathMin(
newSize,
center[2] - overflow[0] - overflow[2] // vertical overflow
),
minSize
);
center[1] += (overflow[0] - overflow[2]) / 2; // vertical center
}
// If the size must be decreased, we need to run translate and drawDataLabels again
if (newSize < center[2]) {
center[2] = newSize;
this.translate(center);
each(this.points, function (point) {
if (point.dataLabel) {
point.dataLabel._pos = null; // reset
}
});
if (this.drawDataLabels) {
this.drawDataLabels();
}
// Else, return true to indicate that the pie and its labels is within the plot area
} else {
ret = true;
}
return ret;
};
}
if (seriesTypes.column) {
/**
* Override the basic data label alignment by adjusting for the position of the column
*/
seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var chart = this.chart,
inverted = chart.inverted,
dlBox = point.dlBox || point.shapeArgs, // data label box for alignment
below = point.below || (point.plotY > pick(this.translatedThreshold, chart.plotSizeY)),
inside = pick(options.inside, !!this.options.stacking); // draw it inside the box?
// Align to the column itself, or the top of it
if (dlBox) { // Area range uses this method but not alignTo
alignTo = merge(dlBox);
if (inverted) {
alignTo = {
x: chart.plotWidth - alignTo.y - alignTo.height,
y: chart.plotHeight - alignTo.x - alignTo.width,
width: alignTo.height,
height: alignTo.width
};
}
// Compute the alignment box
if (!inside) {
if (inverted) {
alignTo.x += below ? 0 : alignTo.width;
alignTo.width = 0;
} else {
alignTo.y += below ? alignTo.height : 0;
alignTo.height = 0;
}
}
}
// When alignment is undefined (typically columns and bars), display the individual
// point below or above the point depending on the threshold
options.align = pick(
options.align,
!inverted || inside ? 'center' : below ? 'right' : 'left'
);
options.verticalAlign = pick(
options.verticalAlign,
inverted || inside ? 'middle' : below ? 'top' : 'bottom'
);
// Call the parent method
Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);
};
}
/**
* Override to use the extreme coordinates from the SVG shape, not the
* data values
*/
wrap(Axis.prototype, 'getSeriesExtremes', function (proceed) {
var isXAxis = this.isXAxis,
dataMin,
dataMax,
xData = [],
useMapGeometry;
// Remove the xData array and cache it locally so that the proceed method doesn't use it
if (isXAxis) {
each(this.series, function (series, i) {
if (series.useMapGeometry) {
xData[i] = series.xData;
series.xData = [];
}
});
}
// Call base to reach normal cartesian series (like mappoint)
proceed.call(this);
// Run extremes logic for map and mapline
if (isXAxis) {
dataMin = pick(this.dataMin, Number.MAX_VALUE);
dataMax = pick(this.dataMax, Number.MIN_VALUE);
each(this.series, function (series, i) {
if (series.useMapGeometry) {
dataMin = Math.min(dataMin, pick(series.minX, dataMin));
dataMax = Math.max(dataMax, pick(series.maxX, dataMin));
series.xData = xData[i]; // Reset xData array
useMapGeometry = true;
}
});
if (useMapGeometry) {
this.dataMin = dataMin;
this.dataMax = dataMax;
}
}
});
/**
* Override axis translation to make sure the aspect ratio is always kept
*/
wrap(Axis.prototype, 'setAxisTranslation', function (proceed) {
var chart = this.chart,
mapRatio,
plotRatio = chart.plotWidth / chart.plotHeight,
adjustedAxisLength,
xAxis = chart.xAxis[0],
padAxis,
fixTo,
fixDiff;
// Run the parent method
proceed.call(this);
// On Y axis, handle both
if (chart.options.chart.preserveAspectRatio && this.coll === 'yAxis' && xAxis.transA !== UNDEFINED) {
// Use the same translation for both axes
this.transA = xAxis.transA = Math.min(this.transA, xAxis.transA);
mapRatio = plotRatio / ((xAxis.max - xAxis.min) / (this.max - this.min));
// What axis to pad to put the map in the middle
padAxis = mapRatio < 1 ? this : xAxis;
// Pad it
adjustedAxisLength = (padAxis.max - padAxis.min) * padAxis.transA;
padAxis.pixelPadding = padAxis.len - adjustedAxisLength;
padAxis.minPixelPadding = padAxis.pixelPadding / 2;
fixTo = padAxis.fixTo;
if (fixTo) {
fixDiff = fixTo[1] - padAxis.toValue(fixTo[0], true);
fixDiff *= padAxis.transA;
if (Math.abs(fixDiff) > padAxis.minPixelPadding || (padAxis.min === padAxis.dataMin && padAxis.max === padAxis.dataMax)) { // zooming out again, keep within restricted area
fixDiff = 0;
}
padAxis.minPixelPadding -= fixDiff;
}
}
});
/**
* Override Axis.render in order to delete the fixTo prop
*/
wrap(Axis.prototype, 'render', function (proceed) {
proceed.call(this);
this.fixTo = null;
});
/**
* The ColorAxis object for inclusion in gradient legends
*/
var ColorAxis = Highcharts.ColorAxis = function () {
this.isColorAxis = true;
this.init.apply(this, arguments);
};
extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
endOnTick: true,
offset: 0,
marker: {
animation: {
duration: 50
},
color: 'gray',
width: 0.01
},
labels: {
overflow: 'justify'
},
minColor: '#EFEFFF',
maxColor: '#003875',
tickLength: 5
},
init: function (chart, userOptions) {
var horiz = chart.options.legend.layout !== 'vertical',
options;
// Build the options
options = merge(this.defaultColorAxisOptions, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
isX: horiz,
opposite: !horiz,
showEmpty: false,
title: null,
isColor: true
});
Axis.prototype.init.call(this, chart, options);
// Base init() pushes it to the xAxis array, now pop it again
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
// Prepare data classes
if (userOptions.dataClasses) {
this.initDataClasses(userOptions);
}
this.initStops(userOptions);
// Override original axis properties
this.isXAxis = true;
this.horiz = horiz;
this.zoomEnabled = false;
},
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color
*/
tweenColors: function (from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha = (to.rgba[3] !== 1 || from.rgba[3] !== 1);
return (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to.rgba[0] + (from.rgba[0] - to.rgba[0]) * (1 - pos)) + ',' +
Math.round(to.rgba[1] + (from.rgba[1] - to.rgba[1]) * (1 - pos)) + ',' +
Math.round(to.rgba[2] + (from.rgba[2] - to.rgba[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to.rgba[3] + (from.rgba[3] - to.rgba[3]) * (1 - pos))) : '') + ')';
},
initDataClasses: function (userOptions) {
var axis = this,
chart = this.chart,
dataClasses,
colorCounter = 0,
options = this.options;
this.dataClasses = dataClasses = [];
this.legendItems = [];
each(userOptions.dataClasses, function (dataClass, i) {
var colors;
dataClass = merge(dataClass);
dataClasses.push(dataClass);
if (!dataClass.color) {
if (options.dataClassColor === 'category') {
colors = chart.options.colors;
dataClass.color = colors[colorCounter++];
// loop back to zero
if (colorCounter === colors.length) {
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(Color(options.minColor), Color(options.maxColor), i / (userOptions.dataClasses.length - 1));
}
}
});
},
initStops: function (userOptions) {
this.stops = userOptions.stops || [
[0, this.options.minColor],
[1, this.options.maxColor]
];
each(this.stops, function (stop) {
stop.color = Color(stop[1]);
});
},
/**
* Extend the setOptions method to process extreme colors and color
* stops.
*/
setOptions: function (userOptions) {
Axis.prototype.setOptions.call(this, userOptions);
this.options.crosshair = this.options.marker;
this.coll = 'colorAxis';
},
setAxisSize: function () {
var symbol = this.legendSymbol,
chart = this.chart,
x,
y,
width,
height;
if (symbol) {
this.left = x = symbol.attr('x');
this.top = y = symbol.attr('y');
this.width = width = symbol.attr('width');
this.height = height = symbol.attr('height');
this.right = chart.chartWidth - x - width;
this.bottom = chart.chartHeight - y - height;
this.len = this.horiz ? width : height;
this.pos = this.horiz ? x : y;
}
},
/**
* Translate from a value to a color
*/
toColor: function (value, point) {
var pos,
stops = this.stops,
from,
to,
color,
dataClasses = this.dataClasses,
dataClass,
i;
if (dataClasses) {
i = dataClasses.length;
while (i--) {
dataClass = dataClasses[i];
from = dataClass.from;
to = dataClass.to;
if ((from === UNDEFINED || value >= from) && (to === UNDEFINED || value <= to)) {
color = dataClass.color;
if (point) {
point.dataClass = i;
}
break;
}
}
} else {
if (this.isLog) {
value = this.val2lin(value);
}
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1));
i = stops.length;
while (i--) {
if (pos > stops[i][0]) {
break;
}
}
from = stops[i] || stops[i + 1];
to = stops[i + 1] || from;
// The position within the gradient
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
color = this.tweenColors(
from.color,
to.color,
pos
);
}
return color;
},
getOffset: function () {
var group = this.legendGroup,
sideOffset = this.chart.axisOffset[this.side];
if (group) {
Axis.prototype.getOffset.call(this);
if (!this.axisGroup.parentGroup) {
// Move the axis elements inside the legend group
this.axisGroup.add(group);
this.gridGroup.add(group);
this.labelGroup.add(group);
this.added = true;
}
// Reset it to avoid color axis reserving space
this.chart.axisOffset[this.side] = sideOffset;
}
},
/**
* Create the color gradient
*/
setLegendColor: function () {
var grad,
horiz = this.horiz,
options = this.options;
grad = horiz ? [0, 0, 1, 0] : [0, 0, 0, 1];
this.legendColor = {
linearGradient: { x1: grad[0], y1: grad[1], x2: grad[2], y2: grad[3] },
stops: options.stops || [
[0, options.minColor],
[1, options.maxColor]
]
};
},
/**
* The color axis appears inside the legend and has its own legend symbol
*/
drawLegendSymbol: function (legend, item) {
var padding = legend.padding,
legendOptions = legend.options,
horiz = this.horiz,
box,
width = pick(legendOptions.symbolWidth, horiz ? 200 : 12),
height = pick(legendOptions.symbolHeight, horiz ? 12 : 200),
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30),
itemDistance = pick(legendOptions.itemDistance, 10);
this.setLegendColor();
// Create the gradient
item.legendSymbol = this.chart.renderer.rect(
0,
legend.baseline - 11,
width,
height
).attr({
zIndex: 1
}).add(item.legendGroup);
box = item.legendSymbol.getBBox();
// Set how much space this legend item takes up
this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
},
/**
* Fool the legend
*/
setState: noop,
visible: true,
setVisible: noop,
getSeriesExtremes: function () {
var series;
if (this.series.length) {
series = this.series[0];
this.dataMin = series.valueMin;
this.dataMax = series.valueMax;
}
},
drawCrosshair: function (e, point) {
var newCross = !this.cross,
plotX = point && point.plotX,
plotY = point && point.plotY,
crossPos,
axisPos = this.pos,
axisLen = this.len;
if (point) {
crossPos = this.toPixels(point.value);
if (crossPos < axisPos) {
crossPos = axisPos - 2;
} else if (crossPos > axisPos + axisLen) {
crossPos = axisPos + axisLen + 2;
}
point.plotX = crossPos;
point.plotY = this.len - crossPos;
Axis.prototype.drawCrosshair.call(this, e, point);
point.plotX = plotX;
point.plotY = plotY;
if (!newCross && this.cross) {
this.cross
.attr({
fill: this.crosshair.color
})
.add(this.labelGroup);
}
}
},
getPlotLinePath: function (a, b, c, d, pos) {
if (pos) { // crosshairs only
return this.horiz ?
['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] :
['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z'];
} else {
return Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
}
},
update: function (newOptions, redraw) {
each(this.series, function (series) {
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
});
Axis.prototype.update.call(this, newOptions, redraw);
if (this.legendItem) {
this.setLegendColor();
this.chart.legend.colorizeItem(this, true);
}
},
/**
* Get the legend item symbols for data classes
*/
getDataClassLegendSymbols: function () {
var axis = this,
chart = this.chart,
legendItems = this.legendItems,
legendOptions = chart.options.legend,
valueDecimals = legendOptions.valueDecimals,
valueSuffix = legendOptions.valueSuffix || '',
name;
if (!legendItems.length) {
each(this.dataClasses, function (dataClass, i) {
var vis = true,
from = dataClass.from,
to = dataClass.to;
// Assemble the default name. This can be overridden by legend.options.labelFormatter
name = '';
if (from === UNDEFINED) {
name = '< ';
} else if (to === UNDEFINED) {
name = '> ';
}
if (from !== UNDEFINED) {
name += numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== UNDEFINED && to !== UNDEFINED) {
name += ' - ';
}
if (to !== UNDEFINED) {
name += numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
legendItems.push(extend({
chart: chart,
name: name,
options: {},
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
visible: true,
setState: noop,
setVisible: function () {
vis = this.visible = !vis;
each(axis.series, function (series) {
each(series.points, function (point) {
if (point.dataClass === i) {
point.setVisible(vis);
}
});
});
chart.legend.colorizeItem(this, vis);
}
}, dataClass));
});
}
return legendItems;
},
name: '' // Prevents 'undefined' in legend in IE8
});
/**
* Extend the chart getAxes method to also get the color axis
*/
wrap(Chart.prototype, 'getAxes', function (proceed) {
var options = this.options,
colorAxisOptions = options.colorAxis;
proceed.call(this);
this.colorAxis = [];
if (colorAxisOptions) {
proceed = new ColorAxis(this, colorAxisOptions); // Fake assignment for jsLint
}
});
/**
* Wrap the legend getAllItems method to add the color axis. This also removes the
* axis' own series to prevent them from showing up individually.
*/
wrap(Legend.prototype, 'getAllItems', function (proceed) {
var allItems = [],
colorAxis = this.chart.colorAxis[0];
if (colorAxis) {
// Data classes
if (colorAxis.options.dataClasses) {
allItems = allItems.concat(colorAxis.getDataClassLegendSymbols());
// Gradient legend
} else {
// Add this axis on top
allItems.push(colorAxis);
}
// Don't add the color axis' series
each(colorAxis.series, function (series) {
series.options.showInLegend = false;
});
}
return allItems.concat(proceed.call(this));
});/**
* Mixin for maps and heatmaps
*/
var colorSeriesMixin = {
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
'stroke-width': 'borderWidth',
fill: 'color',
dashstyle: 'dashStyle'
},
pointArrayMap: ['value'],
axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
optionalAxis: 'colorAxis',
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',
/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function () {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis,
colorKey = this.colorKey;
each(this.data, function (point) {
var value = point[colorKey],
color;
color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
if (color) {
point.color = color;
}
});
}
};
/**
* Wrap the buildText method and add the hook for add text stroke
*/
wrap(SVGRenderer.prototype, 'buildText', function (proceed, wrapper) {
var textStroke = wrapper.styles && wrapper.styles.HcTextStroke;
proceed.call(this, wrapper);
// Apply the text stroke
if (textStroke && wrapper.applyTextStroke) {
wrapper.applyTextStroke(textStroke);
}
});
/**
* Apply an outside text stroke to data labels, based on the custom CSS property, HcTextStroke.
* Consider moving this to Highcharts core, also makes sense on stacked columns etc.
*/
SVGRenderer.prototype.Element.prototype.applyTextStroke = function (textStroke) {
var elem = this.element,
tspans,
firstChild;
textStroke = textStroke.split(' ');
tspans = elem.getElementsByTagName('tspan');
firstChild = elem.firstChild;
// In order to get the right y position of the clones,
// copy over the y setter
this.ySetter = this.xSetter;
each([].slice.call(tspans), function (tspan, y) {
var clone;
if (y === 0) {
tspan.setAttribute('x', elem.getAttribute('x'));
if ((y = elem.getAttribute('y')) !== null) {
tspan.setAttribute('y', y);
}
}
clone = tspan.cloneNode(1);
clone.setAttribute('stroke', textStroke[1]);
clone.setAttribute('stroke-width', textStroke[0]);
clone.setAttribute('stroke-linejoin', 'round');
elem.insertBefore(clone, firstChild);
});
};
/**
* Extend the default options with map options
*/
defaultPlotOptions.map = merge(defaultPlotOptions.scatter, {
allAreas: true,
animation: false, // makes the complex shapes slow
nullColor: '#F8F8F8',
borderColor: 'silver',
borderWidth: 1,
marker: null,
stickyTracking: false,
dataLabels: {
formatter: function () { // #2945
return this.point.value;
},
verticalAlign: 'middle',
crop: false,
overflow: false,
padding: 0,
style: {
color: 'white',
fontWeight: 'bold',
HcTextStroke: '3px rgba(0,0,0,0.5)'
}
},
turboThreshold: 0,
tooltip: {
followPointer: true,
pointFormat: '{point.name}: {point.value}<br/>'
},
states: {
normal: {
animation: true
},
hover: {
brightness: 0.2,
halo: null
}
}
});
/**
* The MapAreaPoint object
*/
var MapAreaPoint = extendClass(Point, {
/**
* Extend the Point object to split paths
*/
applyOptions: function (options, x) {
var point = Point.prototype.applyOptions.call(this, options, x),
series = this.series,
joinBy = series.joinBy,
mapPoint;
if (series.mapData) {
mapPoint = point[joinBy[1]] && series.mapMap[point[joinBy[1]]];
if (mapPoint) {
// This applies only to bubbles
if (series.xyFromShape) {
point.x = mapPoint._midX;
point.y = mapPoint._midY;
}
extend(point, mapPoint); // copy over properties
} else {
point.value = point.value || null;
}
}
return point;
},
/**
* Set the visibility of a single map area
*/
setVisible: function (vis) {
var point = this,
method = vis ? 'show' : 'hide';
// Show and hide associated elements
each(['graphic', 'dataLabel'], function (key) {
if (point[key]) {
point[key][method]();
}
});
},
/**
* Stop the fade-out
*/
onMouseOver: function (e) {
clearTimeout(this.colorInterval);
if (this.value !== null) {
Point.prototype.onMouseOver.call(this, e);
}
},
/**
* Custom animation for tweening out the colors. Animation reduces blinking when hovering
* over islands and coast lines. We run a custom implementation of animation becuase we
* need to be able to run this independently from other animations like zoom redraw. Also,
* adding color animation to the adapters would introduce almost the same amount of code.
*/
onMouseOut: function () {
var point = this,
start = +new Date(),
normalColor = Color(point.color),
hoverColor = Color(point.pointAttr.hover.fill),
animation = point.series.options.states.normal.animation,
duration = animation && (animation.duration || 500),
fill;
if (duration && normalColor.rgba.length === 4 && hoverColor.rgba.length === 4 && point.state !== 'select') {
fill = point.pointAttr[''].fill;
delete point.pointAttr[''].fill; // avoid resetting it in Point.setState
clearTimeout(point.colorInterval);
point.colorInterval = setInterval(function () {
var pos = (new Date() - start) / duration,
graphic = point.graphic;
if (pos > 1) {
pos = 1;
}
if (graphic) {
graphic.attr('fill', ColorAxis.prototype.tweenColors.call(0, hoverColor, normalColor, pos));
}
if (pos >= 1) {
clearTimeout(point.colorInterval);
}
}, 13);
}
Point.prototype.onMouseOut.call(point);
if (fill) {
point.pointAttr[''].fill = fill;
}
},
/**
* Zoom the chart to view a specific area point
*/
zoomTo: function () {
var point = this,
series = point.series;
series.xAxis.setExtremes(
point._minX,
point._maxX,
false
);
series.yAxis.setExtremes(
point._minY,
point._maxY,
false
);
series.chart.redraw();
}
});
/**
* Add the series type
*/
seriesTypes.map = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, {
type: 'map',
pointClass: MapAreaPoint,
supportsDrilldown: true,
getExtremesFromAll: true,
useMapGeometry: true, // get axis extremes from paths, not values
forceDL: true,
/**
* Get the bounding box of all paths in the map combined.
*/
getBox: function (paths) {
var MAX_VALUE = Number.MAX_VALUE,
maxX = -MAX_VALUE,
minX = MAX_VALUE,
maxY = -MAX_VALUE,
minY = MAX_VALUE,
minRange = MAX_VALUE,
xAxis = this.xAxis,
yAxis = this.yAxis,
hasBox;
// Find the bounding box
each(paths || [], function (point) {
if (point.path) {
if (typeof point.path === 'string') {
point.path = Highcharts.splitPath(point.path);
}
var path = point.path || [],
i = path.length,
even = false, // while loop reads from the end
pointMaxX = -MAX_VALUE,
pointMinX = MAX_VALUE,
pointMaxY = -MAX_VALUE,
pointMinY = MAX_VALUE,
properties = point.properties;
// The first time a map point is used, analyze its box
if (!point._foundBox) {
while (i--) {
if (typeof path[i] === 'number' && !isNaN(path[i])) {
if (even) { // even = x
pointMaxX = Math.max(pointMaxX, path[i]);
pointMinX = Math.min(pointMinX, path[i]);
} else { // odd = Y
pointMaxY = Math.max(pointMaxY, path[i]);
pointMinY = Math.min(pointMinY, path[i]);
}
even = !even;
}
}
// Cache point bounding box for use to position data labels, bubbles etc
point._midX = pointMinX + (pointMaxX - pointMinX) *
(point.middleX || (properties && properties['hc-middle-x']) || 0.5); // pick is slower and very marginally needed
point._midY = pointMinY + (pointMaxY - pointMinY) *
(point.middleY || (properties && properties['hc-middle-y']) || 0.5);
point._maxX = pointMaxX;
point._minX = pointMinX;
point._maxY = pointMaxY;
point._minY = pointMinY;
point.labelrank = pick(point.labelrank, (pointMaxX - pointMinX) * (pointMaxY - pointMinY));
point._foundBox = true;
}
maxX = Math.max(maxX, point._maxX);
minX = Math.min(minX, point._minX);
maxY = Math.max(maxY, point._maxY);
minY = Math.min(minY, point._minY);
minRange = Math.min(point._maxX - point._minX, point._maxY - point._minY, minRange);
hasBox = true;
}
});
// Set the box for the whole series
if (hasBox) {
this.minY = Math.min(minY, pick(this.minY, MAX_VALUE));
this.maxY = Math.max(maxY, pick(this.maxY, -MAX_VALUE));
this.minX = Math.min(minX, pick(this.minX, MAX_VALUE));
this.maxX = Math.max(maxX, pick(this.maxX, -MAX_VALUE));
// If no minRange option is set, set the default minimum zooming range to 5 times the
// size of the smallest element
if (xAxis && xAxis.options.minRange === undefined) {
xAxis.minRange = Math.min(5 * minRange, (this.maxX - this.minX) / 5, xAxis.minRange || MAX_VALUE);
}
if (yAxis && yAxis.options.minRange === undefined) {
yAxis.minRange = Math.min(5 * minRange, (this.maxY - this.minY) / 5, yAxis.minRange || MAX_VALUE);
}
}
},
getExtremes: function () {
// Get the actual value extremes for colors
Series.prototype.getExtremes.call(this, this.valueData);
// Recalculate box on updated data
if (this.chart.hasRendered && this.isDirtyData) {
this.getBox(this.options.data);
}
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Extremes for the mock Y axis
this.dataMin = this.minY;
this.dataMax = this.maxY;
},
/**
* Translate the path so that it automatically fits into the plot area box
* @param {Object} path
*/
translatePath: function (path) {
var series = this,
even = false, // while loop reads from the end
xAxis = series.xAxis,
yAxis = series.yAxis,
xMin = xAxis.min,
xTransA = xAxis.transA,
xMinPixelPadding = xAxis.minPixelPadding,
yMin = yAxis.min,
yTransA = yAxis.transA,
yMinPixelPadding = yAxis.minPixelPadding,
i,
ret = []; // Preserve the original
// Do the translation
if (path) {
i = path.length;
while (i--) {
if (typeof path[i] === 'number') {
ret[i] = even ?
(path[i] - xMin) * xTransA + xMinPixelPadding :
(path[i] - yMin) * yTransA + yMinPixelPadding;
even = !even;
} else {
ret[i] = path[i];
}
}
}
return ret;
},
/**
* Extend setData to join in mapData. If the allAreas option is true, all areas
* from the mapData are used, and those that don't correspond to a data value
* are given null values.
*/
setData: function (data, redraw) {
var options = this.options,
mapData = options.mapData,
joinBy = options.joinBy,
joinByNull = joinBy === null,
dataUsed = [],
mapPoint,
props,
i;
if (joinByNull) {
joinBy = '_i';
}
joinBy = this.joinBy = Highcharts.splat(joinBy);
if (!joinBy[1]) {
joinBy[1] = joinBy[0];
}
// Pick up numeric values, add index
if (data) {
each(data, function (val, i) {
if (typeof val === 'number') {
data[i] = {
value: val
};
}
if (joinByNull) {
data[i]._i = i;
}
});
}
this.getBox(data);
if (mapData) {
if (mapData.type === 'FeatureCollection') {
mapData = Highcharts.geojson(mapData, this.type, this);
}
this.getBox(mapData);
this.mapData = mapData;
this.mapMap = {};
for (i = 0; i < mapData.length; i++) {
mapPoint = mapData[i];
props = mapPoint.properties;
mapPoint._i = i;
// Copy the property over to root for faster access
if (joinBy[0] && props && props[joinBy[0]]) {
mapPoint[joinBy[0]] = props[joinBy[0]];
}
this.mapMap[mapPoint[joinBy[0]]] = mapPoint;
}
if (options.allAreas) {
data = data || [];
// Registered the point codes that actually hold data
if (joinBy[1]) {
each(data, function (point) {
dataUsed.push(point[joinBy[1]]);
});
}
// Add those map points that don't correspond to data, which will be drawn as null points
dataUsed = '|' + dataUsed.join('|') + '|'; // String search is faster than array.indexOf
each(mapData, function (mapPoint) {
if (!joinBy[0] || dataUsed.indexOf('|' + mapPoint[joinBy[0]] + '|') === -1) {
data.push(merge(mapPoint, { value: null }));
}
});
}
}
Series.prototype.setData.call(this, data, redraw);
},
/**
* No graph for the map series
*/
drawGraph: noop,
/**
* We need the points' bounding boxes in order to draw the data labels, so
* we skip it now and call it from drawPoints instead.
*/
drawDataLabels: noop,
/**
* Allow a quick redraw by just translating the area group. Used for zooming and panning
* in capable browsers.
*/
doFullTranslate: function () {
return this.isDirtyData || this.chart.renderer.isVML || !this.baseTrans;
},
/**
* Add the path option for data points. Find the max value for color calculation.
*/
translate: function () {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
doFullTranslate = series.doFullTranslate();
series.generatePoints();
each(series.data, function (point) {
// Record the middle point (loosely based on centroid), determined
// by the middleX and middleY options.
point.plotX = xAxis.toPixels(point._midX, true);
point.plotY = yAxis.toPixels(point._midY, true);
if (doFullTranslate) {
point.shapeType = 'path';
point.shapeArgs = {
//d: display ? series.translatePath(point.path) : ''
d: series.translatePath(point.path),
'vector-effect': 'non-scaling-stroke'
};
}
});
series.translateColors();
},
/**
* Use the drawPoints method of column, that is able to handle simple shapeArgs.
* Extend it by assigning the tooltip position.
*/
drawPoints: function () {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
group = series.group,
chart = series.chart,
renderer = chart.renderer,
scaleX,
scaleY,
translateX,
translateY,
baseTrans = this.baseTrans;
// Set a group that handles transform during zooming and panning in order to preserve clipping
// on series.group
if (!series.transformGroup) {
series.transformGroup = renderer.g()
.attr({
scaleX: 1,
scaleY: 1
})
.add(group);
}
// Draw the shapes again
if (series.doFullTranslate()) {
// Individual point actions
if (chart.hasRendered && series.pointAttrToOptions.fill === 'color') {
each(series.points, function (point) {
// Reset color on update/redraw
if (point.graphic) {
point.graphic.attr('fill', point.color);
}
});
}
// Draw them in transformGroup
series.group = series.transformGroup;
seriesTypes.column.prototype.drawPoints.apply(series);
series.group = group; // Reset
// Add class names
each(series.points, function (point) {
if (point.graphic) {
if (point.name) {
point.graphic.addClass('highcharts-name-' + point.name.replace(' ', '-').toLowerCase());
}
if (point.properties && point.properties['hc-key']) {
point.graphic.addClass('highcharts-key-' + point.properties['hc-key'].toLowerCase());
}
}
});
// Set the base for later scale-zooming. The originX and originY properties are the
// axis values in the plot area's upper left corner.
this.baseTrans = {
originX: xAxis.min - xAxis.minPixelPadding / xAxis.transA,
originY: yAxis.min - yAxis.minPixelPadding / yAxis.transA + (yAxis.reversed ? 0 : yAxis.len / yAxis.transA),
transAX: xAxis.transA,
transAY: yAxis.transA
};
// Just update the scale and transform for better performance
} else {
scaleX = xAxis.transA / baseTrans.transAX;
scaleY = yAxis.transA / baseTrans.transAY;
if (scaleX > 0.99 && scaleX < 1.01 && scaleY > 0.99 && scaleY < 1.01) { // rounding errors
translateX = 0;
translateY = 0;
scaleX = 1;
scaleY = 1;
} else {
translateX = xAxis.toPixels(baseTrans.originX, true);
translateY = yAxis.toPixels(baseTrans.originY, true);
}
this.transformGroup.animate({
translateX: translateX,
translateY: translateY,
scaleX: scaleX,
scaleY: scaleY
});
}
this.drawMapDataLabels();
},
/**
* Draw the data labels. Special for maps is the time that the data labels are drawn (after points),
* and the clipping of the dataLabelsGroup.
*/
drawMapDataLabels: function () {
Series.prototype.drawDataLabels.call(this);
if (this.dataLabelsGroup) {
this.dataLabelsGroup.clip(this.chart.clipRect);
}
this.hideOverlappingDataLabels();
},
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
hideOverlappingDataLabels: function () {
var points = this.points,
len = points.length,
i,
j,
label1,
label2,
intersectRect = function (pos1, pos2, size1, size2) {
return !(
pos2.x > pos1.x + size1.width ||
pos2.x + size2.width < pos1.x ||
pos2.y > pos1.y + size1.height ||
pos2.y + size2.height < pos1.y
);
};
// Mark with initial opacity
each(points, function (point, label) {
label = point.dataLabel;
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
});
// Detect overlapping labels
for (i = 0; i < len - 1; ++i) {
label1 = points[i].dataLabel;
for (j = i + 1; j < len; ++j) {
label2 = points[j].dataLabel;
if (label1 && label2 && label1.newOpacity !== 0 && label2.newOpacity !== 0 &&
intersectRect(label1.alignAttr, label2.alignAttr, label1, label2)) {
(points[i].labelrank < points[j].labelrank ? label1 : label2).newOpacity = 0;
}
}
}
// Hide or show
each(points, function (point, label) {
label = point.dataLabel;
if (label) {
if (label.oldOpacity !== label.newOpacity) {
label[label.isOld ? 'animate' : 'attr'](extend({ opacity: label.newOpacity }, label.alignAttr));
}
label.isOld = true;
}
});
},
/**
* Override render to throw in an async call in IE8. Otherwise it chokes on the US counties demo.
*/
render: function () {
var series = this,
render = Series.prototype.render;
// Give IE8 some time to breathe.
if (series.chart.renderer.isVML && series.data.length > 3000) {
setTimeout(function () {
render.call(series);
});
} else {
render.call(series);
}
},
/**
* The initial animation for the map series. By default, animation is disabled.
* Animation of map shapes is not at all supported in VML browsers.
*/
animate: function (init) {
var chart = this.chart,
animation = this.options.animation,
group = this.group,
xAxis = this.xAxis,
yAxis = this.yAxis,
left = xAxis.pos,
top = yAxis.pos;
if (chart.renderer.isSVG) {
if (animation === true) {
animation = {
duration: 1000
};
}
// Initialize the animation
if (init) {
// Scale down the group and place it in the center
group.attr({
translateX: left + xAxis.len / 2,
translateY: top + yAxis.len / 2,
scaleX: 0.001, // #1499
scaleY: 0.001
});
// Run the animation
} else {
group.animate({
translateX: left,
translateY: top,
scaleX: 1,
scaleY: 1
}, animation);
// Delete this function to allow it only once
this.animate = null;
}
}
},
/**
* Animate in the new series from the clicked point in the old series.
* Depends on the drilldown.js module
*/
animateDrilldown: function (init) {
var toBox = this.chart.plotBox,
level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
fromBox = level.bBox,
animationOptions = this.chart.options.drilldown.animation,
scale;
if (!init) {
scale = Math.min(fromBox.width / toBox.width, fromBox.height / toBox.height);
level.shapeArgs = {
scaleX: scale,
scaleY: scale,
translateX: fromBox.x,
translateY: fromBox.y
};
// TODO: Animate this.group instead
each(this.points, function (point) {
point.graphic
.attr(level.shapeArgs)
.animate({
scaleX: 1,
scaleY: 1,
translateX: 0,
translateY: 0
}, animationOptions);
});
this.animate = null;
}
},
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* When drilling up, pull out the individual point graphics from the lower series
* and animate them into the origin point in the upper series.
*/
animateDrillupFrom: function (level) {
seriesTypes.column.prototype.animateDrillupFrom.call(this, level);
},
/**
* When drilling up, keep the upper series invisible until the lower series has
* moved into place
*/
animateDrillupTo: function (init) {
seriesTypes.column.prototype.animateDrillupTo.call(this, init);
}
}));
// Add events to the Chart object itself
extend(Chart.prototype, {
renderMapNavigation: function () {
var chart = this,
options = this.options.mapNavigation,
buttons = options.buttons,
n,
button,
buttonOptions,
attr,
states,
outerHandler = function () {
this.handler.call(chart);
};
if (pick(options.enableButtons, options.enabled) && !chart.renderer.forExport) {
for (n in buttons) {
if (buttons.hasOwnProperty(n)) {
buttonOptions = merge(options.buttonOptions, buttons[n]);
attr = buttonOptions.theme;
states = attr.states;
button = chart.renderer.button(
buttonOptions.text,
0,
0,
outerHandler,
attr,
states && states.hover,
states && states.select,
0,
n === 'zoomIn' ? 'topbutton' : 'bottombutton'
)
.attr({
width: buttonOptions.width,
height: buttonOptions.height,
title: chart.options.lang[n],
zIndex: 5
})
.css(buttonOptions.style)
.add();
button.handler = buttonOptions.onclick;
button.align(extend(buttonOptions, { width: button.width, height: 2 * button.height }), null, buttonOptions.alignTo);
}
}
}
},
/**
* Fit an inner box to an outer. If the inner box overflows left or right, align it to the sides of the
* outer. If it overflows both sides, fit it within the outer. This is a pattern that occurs more places
* in Highcharts, perhaps it should be elevated to a common utility function.
*/
fitToBox: function (inner, outer) {
each([['x', 'width'], ['y', 'height']], function (dim) {
var pos = dim[0],
size = dim[1];
if (inner[pos] + inner[size] > outer[pos] + outer[size]) { // right overflow
if (inner[size] > outer[size]) { // the general size is greater, fit fully to outer
inner[size] = outer[size];
inner[pos] = outer[pos];
} else { // align right
inner[pos] = outer[pos] + outer[size] - inner[size];
}
}
if (inner[size] > outer[size]) {
inner[size] = outer[size];
}
if (inner[pos] < outer[pos]) {
inner[pos] = outer[pos];
}
});
return inner;
},
/**
* Zoom the map in or out by a certain amount. Less than 1 zooms in, greater than 1 zooms out.
*/
mapZoom: function (howMuch, centerXArg, centerYArg, mouseX, mouseY) {
/*if (this.isMapZooming) {
this.mapZoomQueue = arguments;
return;
}*/
var chart = this,
xAxis = chart.xAxis[0],
xRange = xAxis.max - xAxis.min,
centerX = pick(centerXArg, xAxis.min + xRange / 2),
newXRange = xRange * howMuch,
yAxis = chart.yAxis[0],
yRange = yAxis.max - yAxis.min,
centerY = pick(centerYArg, yAxis.min + yRange / 2),
newYRange = yRange * howMuch,
fixToX = mouseX ? ((mouseX - xAxis.pos) / xAxis.len) : 0.5,
fixToY = mouseY ? ((mouseY - yAxis.pos) / yAxis.len) : 0.5,
newXMin = centerX - newXRange * fixToX,
newYMin = centerY - newYRange * fixToY,
newExt = chart.fitToBox({
x: newXMin,
y: newYMin,
width: newXRange,
height: newYRange
}, {
x: xAxis.dataMin,
y: yAxis.dataMin,
width: xAxis.dataMax - xAxis.dataMin,
height: yAxis.dataMax - yAxis.dataMin
});
// When mousewheel zooming, fix the point under the mouse
if (mouseX) {
xAxis.fixTo = [mouseX - xAxis.pos, centerXArg];
}
if (mouseY) {
yAxis.fixTo = [mouseY - yAxis.pos, centerYArg];
}
// Zoom
if (howMuch !== undefined) {
xAxis.setExtremes(newExt.x, newExt.x + newExt.width, false);
yAxis.setExtremes(newExt.y, newExt.y + newExt.height, false);
// Reset zoom
} else {
xAxis.setExtremes(undefined, undefined, false);
yAxis.setExtremes(undefined, undefined, false);
}
// Prevent zooming until this one is finished animating
/*chart.holdMapZoom = true;
setTimeout(function () {
chart.holdMapZoom = false;
}, 200);*/
/*delay = animation ? animation.duration || 500 : 0;
if (delay) {
chart.isMapZooming = true;
setTimeout(function () {
chart.isMapZooming = false;
if (chart.mapZoomQueue) {
chart.mapZoom.apply(chart, chart.mapZoomQueue);
}
chart.mapZoomQueue = null;
}, delay);
}*/
chart.redraw();
}
});
/**
* Extend the Chart.render method to add zooming and panning
*/
wrap(Chart.prototype, 'render', function (proceed) {
var chart = this,
mapNavigation = chart.options.mapNavigation;
// Render the plus and minus buttons. Doing this before the shapes makes getBBox much quicker, at least in Chrome.
chart.renderMapNavigation();
proceed.call(chart);
// Add the double click event
if (pick(mapNavigation.enableDoubleClickZoom, mapNavigation.enabled) || mapNavigation.enableDoubleClickZoomTo) {
addEvent(chart.container, 'dblclick', function (e) {
chart.pointer.onContainerDblClick(e);
});
}
// Add the mousewheel event
if (pick(mapNavigation.enableMouseWheelZoom, mapNavigation.enabled)) {
addEvent(chart.container, document.onmousewheel === undefined ? 'DOMMouseScroll' : 'mousewheel', function (e) {
chart.pointer.onContainerMouseWheel(e);
return false;
});
}
});
// Extend the Pointer
extend(Pointer.prototype, {
/**
* The event handler for the doubleclick event
*/
onContainerDblClick: function (e) {
var chart = this.chart;
e = this.normalize(e);
if (chart.options.mapNavigation.enableDoubleClickZoomTo) {
if (chart.pointer.inClass(e.target, 'highcharts-tracker')) {
chart.hoverPoint.zoomTo();
}
} else if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
chart.mapZoom(
0.5,
chart.xAxis[0].toValue(e.chartX),
chart.yAxis[0].toValue(e.chartY),
e.chartX,
e.chartY
);
}
},
/**
* The event handler for the mouse scroll event
*/
onContainerMouseWheel: function (e) {
var chart = this.chart,
delta;
e = this.normalize(e);
// Firefox uses e.detail, WebKit and IE uses wheelDelta
delta = e.detail || -(e.wheelDelta / 120);
if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
chart.mapZoom(
//delta > 0 ? 2 : 0.5,
Math.pow(2, delta),
chart.xAxis[0].toValue(e.chartX),
chart.yAxis[0].toValue(e.chartY),
e.chartX,
e.chartY
);
}
}
});
// Implement the pinchType option
wrap(Pointer.prototype, 'init', function (proceed, chart, options) {
proceed.call(this, chart, options);
// Pinch status
if (pick(options.mapNavigation.enableTouchZoom, options.mapNavigation.enabled)) {
this.pinchX = this.pinchHor = this.pinchY = this.pinchVert = this.hasZoom = true;
}
});
// Extend the pinchTranslate method to preserve fixed ratio when zooming
wrap(Pointer.prototype, 'pinchTranslate', function (proceed, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
var xBigger;
proceed.call(this, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
// Keep ratio
if (this.chart.options.chart.type === 'map' && this.hasZoom) {
xBigger = transform.scaleX > transform.scaleY;
this.pinchTranslateDirection(
!xBigger,
pinchDown,
touches,
transform,
selectionMarker,
clip,
lastValidTouch,
xBigger ? transform.scaleX : transform.scaleY
);
}
});
// The mapline series type
defaultPlotOptions.mapline = merge(defaultPlotOptions.map, {
lineWidth: 1,
fillColor: 'none'
});
seriesTypes.mapline = extendClass(seriesTypes.map, {
type: 'mapline',
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'color',
'stroke-width': 'lineWidth',
fill: 'fillColor',
dashstyle: 'dashStyle'
},
drawLegendSymbol: seriesTypes.line.prototype.drawLegendSymbol
});
// The mappoint series type
defaultPlotOptions.mappoint = merge(defaultPlotOptions.scatter, {
dataLabels: {
enabled: true,
formatter: function () { // #2945
return this.point.name;
},
color: 'black',
crop: false,
defer: false,
overflow: false,
style: {
HcTextStroke: '3px rgba(255,255,255,0.5)'
}
}
});
seriesTypes.mappoint = extendClass(seriesTypes.scatter, {
type: 'mappoint',
forceDL: true
});/* ****************************************************************************
* Start Bubble series code *
*****************************************************************************/
// 1 - set default options
defaultPlotOptions.bubble = merge(defaultPlotOptions.scatter, {
dataLabels: {
formatter: function () { // #2945
return this.point.z;
},
inside: true,
style: {
color: 'white',
textShadow: '0px 0px 3px black'
},
verticalAlign: 'middle'
},
// displayNegative: true,
marker: {
// fillOpacity: 0.5,
lineColor: null, // inherit from series.color
lineWidth: 1
},
minSize: 8,
maxSize: '20%',
// negativeColor: null,
// sizeBy: 'area'
states: {
hover: {
halo: {
size: 5
}
}
},
tooltip: {
pointFormat: '({point.x}, {point.y}), Size: {point.z}'
},
turboThreshold: 0,
zThreshold: 0
});
var BubblePoint = extendClass(Point, {
haloPath: function () {
return Point.prototype.haloPath.call(this, this.shapeArgs.r + this.series.options.states.hover.halo.size);
}
});
// 2 - Create the series object
seriesTypes.bubble = extendClass(seriesTypes.scatter, {
type: 'bubble',
pointClass: BubblePoint,
pointArrayMap: ['y', 'z'],
parallelArrays: ['x', 'y', 'z'],
trackerGroups: ['group', 'dataLabelsGroup'],
bubblePadding: true,
/**
* Mapping between SVG attributes and the corresponding options
*/
pointAttrToOptions: {
stroke: 'lineColor',
'stroke-width': 'lineWidth',
fill: 'fillColor'
},
/**
* Apply the fillOpacity to all fill positions
*/
applyOpacity: function (fill) {
var markerOptions = this.options.marker,
fillOpacity = pick(markerOptions.fillOpacity, 0.5);
// When called from Legend.colorizeItem, the fill isn't predefined
fill = fill || markerOptions.fillColor || this.color;
if (fillOpacity !== 1) {
fill = Color(fill).setOpacity(fillOpacity).get('rgba');
}
return fill;
},
/**
* Extend the convertAttribs method by applying opacity to the fill
*/
convertAttribs: function () {
var obj = Series.prototype.convertAttribs.apply(this, arguments);
obj.fill = this.applyOpacity(obj.fill);
return obj;
},
/**
* Get the radius for each point based on the minSize, maxSize and each point's Z value. This
* must be done prior to Series.translate because the axis needs to add padding in
* accordance with the point sizes.
*/
getRadii: function (zMin, zMax, minSize, maxSize) {
var len,
i,
pos,
zData = this.zData,
radii = [],
sizeByArea = this.options.sizeBy !== 'width',
zRange;
// Set the shape type and arguments to be picked up in drawPoints
for (i = 0, len = zData.length; i < len; i++) {
zRange = zMax - zMin;
pos = zRange > 0 ? // relative size, a number between 0 and 1
(zData[i] - zMin) / (zMax - zMin) :
0.5;
if (sizeByArea && pos >= 0) {
pos = Math.sqrt(pos);
}
radii.push(math.ceil(minSize + pos * (maxSize - minSize)) / 2);
}
this.radii = radii;
},
/**
* Perform animation on the bubbles
*/
animate: function (init) {
var animation = this.options.animation;
if (!init) { // run the animation
each(this.points, function (point) {
var graphic = point.graphic,
shapeArgs = point.shapeArgs;
if (graphic && shapeArgs) {
// start values
graphic.attr('r', 1);
// animate
graphic.animate({
r: shapeArgs.r
}, animation);
}
});
// delete this function to allow it only once
this.animate = null;
}
},
/**
* Extend the base translate method to handle bubble size
*/
translate: function () {
var i,
data = this.data,
point,
radius,
radii = this.radii;
// Run the parent method
seriesTypes.scatter.prototype.translate.call(this);
// Set the shape type and arguments to be picked up in drawPoints
i = data.length;
while (i--) {
point = data[i];
radius = radii ? radii[i] : 0; // #1737
// Flag for negativeColor to be applied in Series.js
point.negative = point.z < (this.options.zThreshold || 0);
if (radius >= this.minPxSize / 2) {
// Shape arguments
point.shapeType = 'circle';
point.shapeArgs = {
x: point.plotX,
y: point.plotY,
r: radius
};
// Alignment box for the data label
point.dlBox = {
x: point.plotX - radius,
y: point.plotY - radius,
width: 2 * radius,
height: 2 * radius
};
} else { // below zThreshold
point.shapeArgs = point.plotY = point.dlBox = UNDEFINED; // #1691
}
}
},
/**
* Get the series' symbol in the legend
*
* @param {Object} legend The legend object
* @param {Object} item The series (this) or point
*/
drawLegendSymbol: function (legend, item) {
var radius = pInt(legend.itemStyle.fontSize) / 2;
item.legendSymbol = this.chart.renderer.circle(
radius,
legend.baseline - radius,
radius
).attr({
zIndex: 3
}).add(item.legendGroup);
item.legendSymbol.isMarker = true;
},
drawPoints: seriesTypes.column.prototype.drawPoints,
alignDataLabel: seriesTypes.column.prototype.alignDataLabel
});
/**
* Add logic to pad each axis with the amount of pixels
* necessary to avoid the bubbles to overflow.
*/
Axis.prototype.beforePadding = function () {
var axis = this,
axisLength = this.len,
chart = this.chart,
pxMin = 0,
pxMax = axisLength,
isXAxis = this.isXAxis,
dataKey = isXAxis ? 'xData' : 'yData',
min = this.min,
extremes = {},
smallestSize = math.min(chart.plotWidth, chart.plotHeight),
zMin = Number.MAX_VALUE,
zMax = -Number.MAX_VALUE,
range = this.max - min,
transA = axisLength / range,
activeSeries = [];
// Handle padding on the second pass, or on redraw
if (this.tickPositions) {
each(this.series, function (series) {
var seriesOptions = series.options,
zData;
if (series.bubblePadding && (series.visible || !chart.options.chart.ignoreHiddenSeries)) {
// Correction for #1673
axis.allowZoomOutside = true;
// Cache it
activeSeries.push(series);
if (isXAxis) { // because X axis is evaluated first
// For each series, translate the size extremes to pixel values
each(['minSize', 'maxSize'], function (prop) {
var length = seriesOptions[prop],
isPercent = /%$/.test(length);
length = pInt(length);
extremes[prop] = isPercent ?
smallestSize * length / 100 :
length;
});
series.minPxSize = extremes.minSize;
// Find the min and max Z
zData = series.zData;
if (zData.length) { // #1735
zMin = pick(seriesOptions.zMin, math.min(
zMin,
math.max(
arrayMin(zData),
seriesOptions.displayNegative === false ? seriesOptions.zThreshold : -Number.MAX_VALUE
)
));
zMax = pick(seriesOptions.zMax, math.max(zMax, arrayMax(zData)));
}
}
}
});
each(activeSeries, function (series) {
var data = series[dataKey],
i = data.length,
radius;
if (isXAxis) {
series.getRadii(zMin, zMax, extremes.minSize, extremes.maxSize);
}
if (range > 0) {
while (i--) {
if (typeof data[i] === 'number') {
radius = series.radii[i];
pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);
pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);
}
}
}
});
if (activeSeries.length && range > 0 && pick(this.options.min, this.userMin) === UNDEFINED && pick(this.options.max, this.userMax) === UNDEFINED) {
pxMax -= axisLength;
transA *= (axisLength + pxMin - pxMax) / axisLength;
this.min += pxMin / transA;
this.max += pxMax / transA;
}
}
};
/* ****************************************************************************
* End Bubble series code *
*****************************************************************************/
// The mapbubble series type
if (seriesTypes.bubble) {
defaultPlotOptions.mapbubble = merge(defaultPlotOptions.bubble, {
animationLimit: 500,
tooltip: {
pointFormat: '{point.name}: {point.z}'
}
});
seriesTypes.mapbubble = extendClass(seriesTypes.bubble, {
pointClass: extendClass(Point, {
applyOptions: MapAreaPoint.prototype.applyOptions
}),
xyFromShape: true,
type: 'mapbubble',
pointArrayMap: ['z'], // If one single value is passed, it is interpreted as z
/**
* Return the map area identified by the dataJoinBy option
*/
getMapData: seriesTypes.map.prototype.getMapData,
getBox: seriesTypes.map.prototype.getBox,
setData: seriesTypes.map.prototype.setData
});
}
/**
* Convert a geojson object to map data of a given Highcharts type (map, mappoint or mapline).
*/
Highcharts.geojson = function (geojson, hType, series) {
var mapData = [],
path = [],
polygonToPath = function (polygon) {
var i = 0,
len = polygon.length;
path.push('M');
for (; i < len; i++) {
if (i === 1) {
path.push('L');
}
path.push(polygon[i][0], -polygon[i][1]);
}
};
hType = hType || 'map';
each(geojson.features, function (feature) {
var geometry = feature.geometry,
type = geometry.type,
coordinates = geometry.coordinates,
properties = feature.properties,
point;
path = [];
if (hType === 'map' || hType === 'mapbubble') {
if (type === 'Polygon') {
each(coordinates, polygonToPath);
path.push('Z');
} else if (type === 'MultiPolygon') {
each(coordinates, function (items) {
each(items, polygonToPath);
});
path.push('Z');
}
if (path.length) {
point = { path: path };
}
} else if (hType === 'mapline') {
if (type === 'LineString') {
polygonToPath(coordinates);
} else if (type === 'MultiLineString') {
each(coordinates, polygonToPath);
}
if (path.length) {
point = { path: path };
}
} else if (hType === 'mappoint') {
if (type === 'Point') {
point = {
x: coordinates[0],
y: -coordinates[1]
};
}
}
if (point) {
mapData.push(extend(point, {
name: properties.name || properties.NAME,
properties: properties
}));
}
});
// Create a credits text that includes map source, to be picked up in Chart.showCredits
if (series) {
series.chart.mapCredits = '<a href="http://www.highcharts.com">Highcharts</a> \u00A9 ' +
'<a href="' + geojson.copyrightUrl + '">' + geojson.copyrightShort + '</a>';
}
return mapData;
};
/**
* Override showCredits to include map source by default
*/
wrap(Chart.prototype, 'showCredits', function (proceed, credits) {
if (defaultOptions.credits.text === this.options.credits.text && this.mapCredits) { // default text and mapCredits is set
credits.text = this.mapCredits;
credits.href = null;
}
proceed.call(this, credits);
});
// Add language
extend(defaultOptions.lang, {
zoomIn: 'Zoom in',
zoomOut: 'Zoom out'
});
// Set the default map navigation options
defaultOptions.mapNavigation = {
buttonOptions: {
alignTo: 'plotBox',
align: 'left',
verticalAlign: 'top',
x: 0,
width: 18,
height: 18,
style: {
fontSize: '15px',
fontWeight: 'bold',
textAlign: 'center'
},
theme: {
'stroke-width': 1
}
},
buttons: {
zoomIn: {
onclick: function () {
this.mapZoom(0.5);
},
text: '+',
y: 0
},
zoomOut: {
onclick: function () {
this.mapZoom(2);
},
text: '-',
y: 28
}
}
// enabled: false,
// enableButtons: null, // inherit from enabled
// enableTouchZoom: null, // inherit from enabled
// enableDoubleClickZoom: null, // inherit from enabled
// enableDoubleClickZoomTo: false
// enableMouseWheelZoom: null, // inherit from enabled
};
/**
* Utility for reading SVG paths directly.
*/
Highcharts.splitPath = function (path) {
var i;
// Move letters apart
path = path.replace(/([A-Za-z])/g, ' $1 ');
// Trim
path = path.replace(/^\s*/, "").replace(/\s*$/, "");
// Split on spaces and commas
path = path.split(/[ ,]+/);
// Parse numbers
for (i = 0; i < path.length; i++) {
if (!/[a-zA-Z]/.test(path[i])) {
path[i] = parseFloat(path[i]);
}
}
return path;
};
// A placeholder for map definitions
Highcharts.maps = {};
// Create symbols for the zoom buttons
function selectiveRoundedRect(attr, x, y, w, h, rTopLeft, rTopRight, rBottomRight, rBottomLeft) {
var normalize = (attr['stroke-width'] % 2 / 2);
x -= normalize;
y -= normalize;
return ['M', x + rTopLeft, y,
// top side
'L', x + w - rTopRight, y,
// top right corner
'C', x + w - rTopRight / 2, y, x + w, y + rTopRight / 2, x + w, y + rTopRight,
// right side
'L', x + w, y + h - rBottomRight,
// bottom right corner
'C', x + w, y + h - rBottomRight / 2, x + w - rBottomRight / 2, y + h, x + w - rBottomRight, y + h,
// bottom side
'L', x + rBottomLeft, y + h,
// bottom left corner
'C', x + rBottomLeft / 2, y + h, x, y + h - rBottomLeft / 2, x, y + h - rBottomLeft,
// left side
'L', x, y + rTopLeft,
// top left corner
'C', x, y + rTopLeft / 2, x + rTopLeft / 2, y, x + rTopLeft, y,
'Z'
];
}
SVGRenderer.prototype.symbols.topbutton = function (x, y, w, h, attr) {
return selectiveRoundedRect(attr, x, y, w, h, attr.r, attr.r, 0, 0);
};
SVGRenderer.prototype.symbols.bottombutton = function (x, y, w, h, attr) {
return selectiveRoundedRect(attr, x, y, w, h, 0, 0, attr.r, attr.r);
};
// The symbol callbacks are generated on the SVGRenderer object in all browsers. Even
// VML browsers need this in order to generate shapes in export. Now share
// them with the VMLRenderer.
if (Renderer === VMLRenderer) {
each(['topbutton', 'bottombutton'], function (shape) {
VMLRenderer.prototype.symbols[shape] = SVGRenderer.prototype.symbols[shape];
});
}
/**
* A wrapper for Chart with all the default values for a Map
*/
Highcharts.Map = function (options, callback) {
var hiddenAxis = {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
startOnTick: false,
title: null,
tickPositions: []
},
seriesOptions;
/* For visual testing
hiddenAxis.gridLineWidth = 1;
hiddenAxis.gridZIndex = 10;
hiddenAxis.tickPositions = undefined;
// */
// Don't merge the data
seriesOptions = options.series;
options.series = null;
options = merge({
chart: {
panning: 'xy',
type: 'map'
},
xAxis: hiddenAxis,
yAxis: merge(hiddenAxis, { reversed: true })
},
options, // user's options
{ // forced options
chart: {
inverted: false,
alignTicks: false,
preserveAspectRatio: true
}
});
options.series = seriesOptions;
return new Chart(options, callback);
};
/**
* Extend the default options with map options
*/
defaultOptions.plotOptions.heatmap = merge(defaultOptions.plotOptions.scatter, {
animation: false,
borderWidth: 0,
nullColor: '#F8F8F8',
dataLabels: {
formatter: function () { // #2945
return this.point.value;
},
verticalAlign: 'middle',
crop: false,
overflow: false,
style: {
color: 'white',
fontWeight: 'bold',
HcTextStroke: '1px rgba(0,0,0,0.5)'
}
},
marker: null,
tooltip: {
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
},
states: {
normal: {
animation: true
},
hover: {
brightness: 0.2
}
}
});
// The Heatmap series type
seriesTypes.heatmap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, {
type: 'heatmap',
pointArrayMap: ['y', 'value'],
hasPointSpecificOptions: true,
supportsDrilldown: true,
getExtremesFromAll: true,
init: function () {
seriesTypes.scatter.prototype.init.apply(this, arguments);
this.pointRange = this.options.colsize || 1;
this.yAxis.axisPointRange = this.options.rowsize || 1; // general point range
},
translate: function () {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis;
series.generatePoints();
each(series.points, function (point) {
var xPad = (options.colsize || 1) / 2,
yPad = (options.rowsize || 1) / 2,
x1 = Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)),
x2 = Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)),
y1 = Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)),
y2 = Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1));
// Set plotX and plotY for use in K-D-Tree and more
point.plotX = (x1 + x2) / 2;
point.plotY = (y1 + y2) / 2;
point.shapeType = 'rect';
point.shapeArgs = {
x: Math.min(x1, x2),
y: Math.min(y1, y2),
width: Math.abs(x2 - x1),
height: Math.abs(y2 - y1)
};
});
series.translateColors();
// Make sure colors are updated on colorAxis update (#2893)
if (this.chart.hasRendered) {
each(series.points, function (point) {
point.shapeArgs.fill = point.color;
});
}
},
drawPoints: seriesTypes.column.prototype.drawPoints,
animate: noop,
getBox: noop,
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
getExtremes: function () {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.valueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
}
}));
/**
* TrackerMixin for points and graphs
*/
var TrackerMixin = Highcharts.TrackerMixin = {
drawTrackerPoint: function () {
var series = this,
chart = series.chart,
pointer = chart.pointer,
cursor = series.options.cursor,
css = cursor && { cursor: cursor },
onMouseOver = function (e) {
var target = e.target,
point;
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
while (target && !point) {
point = target.point;
target = target.parentNode;
}
if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart
point.onMouseOver(e);
}
};
// Add reference to the point
each(series.points, function (point) {
if (point.graphic) {
point.graphic.element.point = point;
}
if (point.dataLabel) {
point.dataLabel.element.point = point;
}
});
// Add the event listeners, we need to do this only once
if (!series._hasTracking) {
each(series.trackerGroups, function (key) {
if (series[key]) { // we don't always have dataLabelsGroup
series[key]
.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
series[key].on('touchstart', onMouseOver);
}
}
});
series._hasTracking = true;
}
},
/**
* Draw the tracker object that sits above all data labels and markers to
* track mouse events on the graph or points. For the line type charts
* the tracker uses the same graphPath, but with a greater stroke width
* for better control.
*/
drawTrackerGraph: function () {
var series = this,
options = series.options,
trackByArea = options.trackByArea,
trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),
trackerPathLength = trackerPath.length,
chart = series.chart,
pointer = chart.pointer,
renderer = chart.renderer,
snap = chart.options.tooltip.snap,
tracker = series.tracker,
cursor = options.cursor,
css = cursor && { cursor: cursor },
singlePoints = series.singlePoints,
singlePoint,
i,
onMouseOver = function () {
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
},
/*
* Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable
* IE6: 0.002
* IE7: 0.002
* IE8: 0.002
* IE9: 0.00000000001 (unlimited)
* IE10: 0.0001 (exporting only)
* FF: 0.00000000001 (unlimited)
* Chrome: 0.000001
* Safari: 0.000001
* Opera: 0.00000000001 (unlimited)
*/
TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')';
// Extend end points. A better way would be to use round linecaps,
// but those are not clickable in VML.
if (trackerPathLength && !trackByArea) {
i = trackerPathLength + 1;
while (i--) {
if (trackerPath[i] === M) { // extend left side
trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L);
}
if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side
trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]);
}
}
}
// handle single points
for (i = 0; i < singlePoints.length; i++) {
singlePoint = singlePoints[i];
trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,
L, singlePoint.plotX + snap, singlePoint.plotY);
}
// draw the tracker
if (tracker) {
tracker.attr({ d: trackerPath });
} else { // create
series.tracker = renderer.path(trackerPath)
.attr({
'stroke-linejoin': 'round', // #1225
visibility: series.visible ? VISIBLE : HIDDEN,
stroke: TRACKER_FILL,
fill: trackByArea ? TRACKER_FILL : NONE,
'stroke-width' : options.lineWidth + (trackByArea ? 0 : 2 * snap),
zIndex: 2
})
.add(series.group);
// The tracker is added to the series group, which is clipped, but is covered
// by the marker group. So the marker group also needs to capture events.
each([series.tracker, series.markerGroup], function (tracker) {
tracker.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
tracker.on('touchstart', onMouseOver);
}
});
}
}
};
/* End TrackerMixin */
/**
* Add tracking event listener to the series group, so the point graphics
* themselves act as trackers
*/
if (seriesTypes.column) {
ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.scatter) {
ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
/*
* Extend Legend for item events
*/
extend(Legend.prototype, {
setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) {
var legend = this;
// Set the events on the item group, or in case of useHTML, the item itself (#1249)
(useHTML ? legendItem : item.legendGroup).on('mouseover', function () {
item.setState(HOVER_STATE);
legendItem.css(legend.options.itemHoverStyle);
})
.on('mouseout', function () {
legendItem.css(item.visible ? itemStyle : itemHiddenStyle);
item.setState();
})
.on('click', function (event) {
var strLegendItemClick = 'legendItemClick',
fnLegendItemClick = function () {
item.setVisible();
};
// Pass over the click/touch event. #4.
event = {
browserEvent: event
};
// click the name or symbol
if (item.firePointEvent) { // point
item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);
} else {
fireEvent(item, strLegendItemClick, event, fnLegendItemClick);
}
});
},
createCheckboxForItem: function (item) {
var legend = this;
item.checkbox = createElement('input', {
type: 'checkbox',
checked: item.selected,
defaultChecked: item.selected // required by IE7
}, legend.options.itemCheckboxStyle, legend.chart.container);
addEvent(item.checkbox, 'click', function (event) {
var target = event.target;
fireEvent(item, 'checkboxClick', {
checked: target.checked
},
function () {
item.select();
}
);
});
}
});
/*
* Add pointer cursor to legend itemstyle in defaultOptions
*/
defaultOptions.legend.itemStyle.cursor = 'pointer';
/*
* Extend the Chart object with interaction
*/
extend(Chart.prototype, {
/**
* Display the zoom button
*/
showResetZoom: function () {
var chart = this,
lang = defaultOptions.lang,
btnOptions = chart.options.chart.resetZoomButton,
theme = btnOptions.theme,
states = theme.states,
alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox';
this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, function () { chart.zoomOut(); }, theme, states && states.hover)
.attr({
align: btnOptions.position.align,
title: lang.resetZoomTitle
})
.add()
.align(btnOptions.position, false, alignTo);
},
/**
* Zoom out to 1:1
*/
zoomOut: function () {
var chart = this;
fireEvent(chart, 'selection', { resetSelection: true }, function () {
chart.zoom();
});
},
/**
* Zoom into a given portion of the chart given by axis coordinates
* @param {Object} event
*/
zoom: function (event) {
var chart = this,
hasZoomed,
pointer = chart.pointer,
displayButton = false,
resetZoomButton;
// If zoom is called with no arguments, reset the axes
if (!event || event.resetSelection) {
each(chart.axes, function (axis) {
hasZoomed = axis.zoom();
});
} else { // else, zoom in on all axes
each(event.xAxis.concat(event.yAxis), function (axisData) {
var axis = axisData.axis,
isXAxis = axis.isXAxis;
// don't zoom more than minRange
if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) {
hasZoomed = axis.zoom(axisData.min, axisData.max);
if (axis.displayBtn) {
displayButton = true;
}
}
});
}
// Show or hide the Reset zoom button
resetZoomButton = chart.resetZoomButton;
if (displayButton && !resetZoomButton) {
chart.showResetZoom();
} else if (!displayButton && isObject(resetZoomButton)) {
chart.resetZoomButton = resetZoomButton.destroy();
}
// Redraw
if (hasZoomed) {
chart.redraw(
pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation
);
}
},
/**
* Pan the chart by dragging the mouse across the pane. This function is called
* on mouse move, and the distance to pan is computed from chartX compared to
* the first chartX position in the dragging operation.
*/
pan: function (e, panning) {
var chart = this,
hoverPoints = chart.hoverPoints,
doRedraw;
// remove active points for shared tooltip
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps
var mousePos = e[isX ? 'chartX' : 'chartY'],
axis = chart[isX ? 'xAxis' : 'yAxis'][0],
startPos = chart[isX ? 'mouseDownX' : 'mouseDownY'],
halfPointRange = (axis.pointRange || 0) / 2,
extremes = axis.getExtremes(),
newMin = axis.toValue(startPos - mousePos, true) + halfPointRange,
newMax = axis.toValue(startPos + chart[isX ? 'plotWidth' : 'plotHeight'] - mousePos, true) - halfPointRange;
if (axis.series.length && newMin > mathMin(extremes.dataMin, extremes.min) && newMax < mathMax(extremes.dataMax, extremes.max)) {
axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' });
doRedraw = true;
}
chart[isX ? 'mouseDownX' : 'mouseDownY'] = mousePos; // set new reference for next run
});
if (doRedraw) {
chart.redraw(false);
}
css(chart.container, { cursor: 'move' });
}
});
/*
* Extend the Point object with interaction
*/
extend(Point.prototype, {
/**
* Toggle the selection status of a point
* @param {Boolean} selected Whether to select or unselect the point.
* @param {Boolean} accumulate Whether to add to the previous selection. By default,
* this happens if the control key (Cmd on Mac) was pressed during clicking.
*/
select: function (selected, accumulate) {
var point = this,
series = point.series,
chart = series.chart;
selected = pick(selected, !point.selected);
// fire the event with the defalut handler
point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {
point.selected = point.options.selected = selected;
series.options.data[inArray(point, series.data)] = point.options;
point.setState(selected && SELECT_STATE);
// unselect all other points unless Ctrl or Cmd + click
if (!accumulate) {
each(chart.getSelectedPoints(), function (loopPoint) {
if (loopPoint.selected && loopPoint !== point) {
loopPoint.selected = loopPoint.options.selected = false;
series.options.data[inArray(loopPoint, series.data)] = loopPoint.options;
loopPoint.setState(NORMAL_STATE);
loopPoint.firePointEvent('unselect');
}
});
}
});
},
/**
* Runs on mouse over the point
*/
onMouseOver: function (e) {
var point = this,
series = point.series,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// set normal state to previous series
if (hoverPoint && hoverPoint !== point) {
hoverPoint.onMouseOut();
}
// trigger the event
point.firePointEvent('mouseOver');
// update the tooltip
if (tooltip && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.refresh(point, e);
}
// hover this
point.setState(HOVER_STATE);
chart.hoverPoint = point;
},
/**
* Runs on mouse out from the point
*/
onMouseOut: function () {
var chart = this.series.chart,
hoverPoints = chart.hoverPoints;
this.firePointEvent('mouseOut');
if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240
this.setState();
chart.hoverPoint = null;
}
},
/**
* Import events from the series' and point's options. Only do it on
* demand, to save processing time on hovering.
*/
importEvents: function () {
if (!this.hasImportedEvents) {
var point = this,
options = merge(point.series.options.point, point.options),
events = options.events,
eventType;
point.events = events;
for (eventType in events) {
addEvent(point, eventType, events[eventType]);
}
this.hasImportedEvents = true;
}
},
/**
* Set the point's state
* @param {String} state
*/
setState: function (state, move) {
var point = this,
plotX = point.plotX,
plotY = point.plotY,
series = point.series,
stateOptions = series.options.states,
markerOptions = defaultPlotOptions[series.type].marker && series.options.marker,
normalDisabled = markerOptions && !markerOptions.enabled,
markerStateOptions = markerOptions && markerOptions.states[state],
stateDisabled = markerStateOptions && markerStateOptions.enabled === false,
stateMarkerGraphic = series.stateMarkerGraphic,
pointMarker = point.marker || {},
chart = series.chart,
radius,
halo = series.halo,
haloOptions,
newSymbol,
pointAttr;
state = state || NORMAL_STATE; // empty string
pointAttr = point.pointAttr[state] || series.pointAttr[state];
if (
// already has this state
(state === point.state && !move) ||
// selected points don't respond to hover
(point.selected && state !== SELECT_STATE) ||
// series' state options is disabled
(stateOptions[state] && stateOptions[state].enabled === false) ||
// general point marker's state options is disabled
(state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) ||
// individual point marker's state options is disabled
(state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610
) {
return;
}
// apply hover styles to the existing point
if (point.graphic) {
radius = markerOptions && point.graphic.symbolName && pointAttr.r;
point.graphic.attr(merge(
pointAttr,
radius ? { // new symbol attributes (#507, #612)
x: plotX - radius,
y: plotY - radius,
width: 2 * radius,
height: 2 * radius
} : {}
));
// Zooming in from a range with no markers to a range with markers
if (stateMarkerGraphic) {
stateMarkerGraphic.hide();
}
} else {
// if a graphic is not applied to each point in the normal state, create a shared
// graphic for the hover state
if (state && markerStateOptions) {
radius = markerStateOptions.radius;
newSymbol = pointMarker.symbol || series.symbol;
// If the point has another symbol than the previous one, throw away the
// state marker graphic and force a new one (#1459)
if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) {
stateMarkerGraphic = stateMarkerGraphic.destroy();
}
// Add a new state marker graphic
if (!stateMarkerGraphic) {
if (newSymbol) {
series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol(
newSymbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius
)
.attr(pointAttr)
.add(series.markerGroup);
stateMarkerGraphic.currentSymbol = newSymbol;
}
// Move the existing graphic
} else {
stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054
x: plotX - radius,
y: plotY - radius
});
}
}
if (stateMarkerGraphic) {
stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450
}
}
// Show me your halo
haloOptions = stateOptions[state] && stateOptions[state].halo;
if (haloOptions && haloOptions.size) {
if (!halo) {
series.halo = halo = chart.renderer.path()
.add(series.seriesGroup);
}
halo.attr(extend({
fill: Color(point.color || series.color).setOpacity(haloOptions.opacity).get()
}, haloOptions.attributes))[move ? 'animate' : 'attr']({
d: point.haloPath(haloOptions.size)
});
} else if (halo) {
halo.attr({ d: [] });
}
point.state = state;
},
haloPath: function (size) {
var series = this.series,
chart = series.chart,
plotBox = series.getPlotBox(),
inverted = chart.inverted;
return chart.renderer.symbols.circle(
plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : this.plotX) - size,
plotBox.translateY + (inverted ? series.xAxis.len - this.plotX : this.plotY) - size,
size * 2,
size * 2
);
}
});
/*
* Extend the Series object with interaction
*/
extend(Series.prototype, {
/**
* Series mouse over handler
*/
onMouseOver: function () {
var series = this,
chart = series.chart,
hoverSeries = chart.hoverSeries;
// set normal state to previous series
if (hoverSeries && hoverSeries !== series) {
hoverSeries.onMouseOut();
}
// trigger the event, but to save processing time,
// only if defined
if (series.options.events.mouseOver) {
fireEvent(series, 'mouseOver');
}
// hover this
series.setState(HOVER_STATE);
chart.hoverSeries = series;
},
/**
* Series mouse out handler
*/
onMouseOut: function () {
// trigger the event only if listeners exist
var series = this,
options = series.options,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// trigger mouse out on the point, which must be in this series
if (hoverPoint) {
hoverPoint.onMouseOut();
}
// fire the mouse out event
if (series && options.events.mouseOut) {
fireEvent(series, 'mouseOut');
}
// hide the tooltip
if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.hide();
}
// set normal state
series.setState();
chart.hoverSeries = null;
},
/**
* Set the state of the graph
*/
setState: function (state) {
var series = this,
options = series.options,
graph = series.graph,
graphNeg = series.graphNeg,
stateOptions = options.states,
lineWidth = options.lineWidth,
attribs;
state = state || NORMAL_STATE;
if (series.state !== state) {
series.state = state;
if (stateOptions[state] && stateOptions[state].enabled === false) {
return;
}
if (state) {
lineWidth = stateOptions[state].lineWidth || lineWidth + (stateOptions[state].lineWidthPlus || 0);
}
if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML
attribs = {
'stroke-width': lineWidth
};
// use attr because animate will cause any other animation on the graph to stop
graph.attr(attribs);
if (graphNeg) {
graphNeg.attr(attribs);
}
}
}
},
/**
* Set the visibility of the graph
*
* @param vis {Boolean} True to show the series, false to hide. If UNDEFINED,
* the visibility is toggled.
*/
setVisible: function (vis, redraw) {
var series = this,
chart = series.chart,
legendItem = series.legendItem,
showOrHide,
ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,
oldVisibility = series.visible;
// if called without an argument, toggle visibility
series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;
showOrHide = vis ? 'show' : 'hide';
// show or hide elements
each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {
if (series[key]) {
series[key][showOrHide]();
}
});
// hide tooltip (#1361)
if (chart.hoverSeries === series) {
series.onMouseOut();
}
if (legendItem) {
chart.legend.colorizeItem(series, vis);
}
// rescale or adapt to resized chart
series.isDirty = true;
// in a stack, all other series are affected
if (series.options.stacking) {
each(chart.series, function (otherSeries) {
if (otherSeries.options.stacking && otherSeries.visible) {
otherSeries.isDirty = true;
}
});
}
// show or hide linked series
each(series.linkedSeries, function (otherSeries) {
otherSeries.setVisible(vis, false);
});
if (ignoreHiddenSeries) {
chart.isDirtyBox = true;
}
if (redraw !== false) {
chart.redraw();
}
fireEvent(series, showOrHide);
},
/**
* Memorize tooltip texts and positions
*/
setTooltipPoints: function (renew) {
var series = this,
points = [],
pointsLength,
low,
high,
xAxis = series.xAxis,
xExtremes = xAxis && xAxis.getExtremes(),
axisLength = xAxis ? (xAxis.tooltipLen || xAxis.len) : series.chart.plotSizeX, // tooltipLen and tooltipPosName used in polar
point,
pointX,
nextPoint,
i,
tooltipPoints = []; // a lookup array for each pixel in the x dimension
// don't waste resources if tracker is disabled
if (series.options.enableMouseTracking === false || series.singularTooltips) {
return;
}
// renew
if (renew) {
series.tooltipPoints = null;
}
// concat segments to overcome null values
each(series.segments || series.points, function (segment) {
points = points.concat(segment);
});
// Reverse the points in case the X axis is reversed
if (xAxis && xAxis.reversed) {
points = points.reverse();
}
// Polar needs additional shaping
if (series.orderTooltipPoints) {
series.orderTooltipPoints(points);
}
// Assign each pixel position to the nearest point
pointsLength = points.length;
for (i = 0; i < pointsLength; i++) {
point = points[i];
pointX = point.x;
if (pointX >= xExtremes.min && pointX <= xExtremes.max) { // #1149
nextPoint = points[i + 1];
// Set this range's low to the last range's high plus one
low = high === UNDEFINED ? 0 : high + 1;
// Now find the new high
high = points[i + 1] ?
mathMin(mathMax(0, mathFloor( // #2070
(point.clientX + (nextPoint ? (nextPoint.wrappedClientX || nextPoint.clientX) : axisLength)) / 2
)), axisLength) :
axisLength;
while (low >= 0 && low <= high) {
tooltipPoints[low++] = point;
}
}
}
series.tooltipPoints = tooltipPoints;
},
/**
* Show the graph
*/
show: function () {
this.setVisible(true);
},
/**
* Hide the graph
*/
hide: function () {
this.setVisible(false);
},
/**
* Set the selected state of the graph
*
* @param selected {Boolean} True to select the series, false to unselect. If
* UNDEFINED, the selection state is toggled.
*/
select: function (selected) {
var series = this;
// if called without an argument, toggle
series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
if (series.checkbox) {
series.checkbox.checked = selected;
}
fireEvent(series, selected ? 'select' : 'unselect');
},
drawTracker: TrackerMixin.drawTrackerGraph
});
// global variables
extend(Highcharts, {
// Constructors
Axis: Axis,
Chart: Chart,
Color: Color,
Point: Point,
Tick: Tick,
Renderer: Renderer,
Series: Series,
SVGElement: SVGElement,
SVGRenderer: SVGRenderer,
// Various
arrayMin: arrayMin,
arrayMax: arrayMax,
charts: charts,
dateFormat: dateFormat,
format: format,
pathAnim: pathAnim,
getOptions: getOptions,
hasBidiBug: hasBidiBug,
isTouchDevice: isTouchDevice,
numberFormat: numberFormat,
seriesTypes: seriesTypes,
setOptions: setOptions,
addEvent: addEvent,
removeEvent: removeEvent,
createElement: createElement,
discardElement: discardElement,
css: css,
each: each,
extend: extend,
map: map,
merge: merge,
pick: pick,
splat: splat,
extendClass: extendClass,
pInt: pInt,
wrap: wrap,
svg: hasSVG,
canvas: useCanVG,
vml: !hasSVG && !useCanVG,
product: PRODUCT,
version: VERSION
});
}());
| shallaa/cdnjs | ajax/libs/highmaps/1.0.3/highmaps.src.js | JavaScript | mit | 487,114 |
(function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)})(function(e,t){function a(e,t){var a=e.split("_");return 1===t%10&&11!==t%100?a[0]:t%10>=2&&4>=t%10&&(10>t%100||t%100>=20)?a[1]:a[2]}function n(e,t,n){var r={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+a(r[n],+e)}function r(e,t){var a={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},n=/D[oD]? *MMMM?/.test(t)?"accusative":"nominative";return a[n][e.month()]}function i(e,t){var a={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},n=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative";return a[n][e.day()]}function o(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}(t.defineLocale||t.lang).call(t,"uk",{months:r,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:i,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., LT",LLLL:"dddd, D MMMM YYYY р., LT"},calendar:{sameDay:o("[Сьогодні "),nextDay:o("[Завтра "),lastDay:o("[Вчора "),nextWeek:o("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return o("[Минулої] dddd [").call(this);case 1:case 2:case 4:return o("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiem:function(e){return 4>e?"ночі":12>e?"ранку":17>e?"дня":"вечора"},ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}}),e.fullCalendar.datepickerLang("uk","uk",{closeText:"Закрити",prevText:"<",nextText:">",currentText:"Сьогодні",monthNames:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],monthNamesShort:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],dayNames:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"],dayNamesShort:["нед","пнд","вів","срд","чтв","птн","сбт"],dayNamesMin:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],weekHeader:"Тиж",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),e.fullCalendar.lang("uk",{defaultButtonText:{month:"Місяць",week:"Тиждень",day:"День",list:"Порядок денний"},allDayText:"Увесь день"})}); | dbeckwith/cdnjs | ajax/libs/fullcalendar/2.0.3/lang/uk.js | JavaScript | mit | 3,893 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang['el']={"editor":"Επεξεργαστής Πλούσιου Κειμένου","editorPanel":"Πίνακας Επεξεργαστή Πλούσιου Κειμένου","common":{"editorHelp":"Πατήστε το ALT 0 για βοήθεια","browseServer":"Εξερεύνηση Διακομιστή","url":"URL","protocol":"Πρωτόκολλο","upload":"Αποστολή","uploadSubmit":"Αποστολή στον Διακομιστή","image":"Εικόνα","flash":"Flash","form":"Φόρμα","checkbox":"Κουτί Επιλογής","radio":"Κουμπί Επιλογής","textField":"Πεδίο Κειμένου","textarea":"Περιοχή Κειμένου","hiddenField":"Κρυφό Πεδίο","button":"Κουμπί","select":"Πεδίο Επιλογής","imageButton":"Κουμπί Εικόνας","notSet":"<δεν έχει ρυθμιστεί>","id":"Id","name":"Όνομα","langDir":"Κατεύθυνση Κειμένου","langDirLtr":"Αριστερά προς Δεξιά (LTR)","langDirRtl":"Δεξιά προς Αριστερά (RTL)","langCode":"Κωδικός Γλώσσας","longDescr":"Αναλυτική Περιγραφή URL","cssClass":"Κλάσεις Φύλλων Στυλ","advisoryTitle":"Ενδεικτικός Τίτλος","cssStyle":"Μορφή Κειμένου","ok":"OK","cancel":"Ακύρωση","close":"Κλείσιμο","preview":"Προεπισκόπηση","resize":"Αλλαγή Μεγέθους","generalTab":"Γενικά","advancedTab":"Για Προχωρημένους","validateNumberFailed":"Αυτή η τιμή δεν είναι αριθμός.","confirmNewPage":"Οι όποιες αλλαγές στο περιεχόμενο θα χαθούν. Είσαστε σίγουροι ότι θέλετε να φορτώσετε μια νέα σελίδα;","confirmCancel":"Μερικές επιλογές έχουν αλλάξει. Είσαστε σίγουροι ότι θέλετε να κλείσετε το παράθυρο διαλόγου;","options":"Επιλογές","target":"Προορισμός","targetNew":"Νέο Παράθυρο (_blank)","targetTop":"Αρχική Περιοχή (_top)","targetSelf":"Ίδιο Παράθυρο (_self)","targetParent":"Γονεϊκό Παράθυρο (_parent)","langDirLTR":"Αριστερά προς Δεξιά (LTR)","langDirRTL":"Δεξιά προς Αριστερά (RTL)","styles":"Μορφή","cssClasses":"Κλάσεις Φύλλων Στυλ","width":"Πλάτος","height":"Ύψος","align":"Στοίχιση","alignLeft":"Αριστερά","alignRight":"Δεξιά","alignCenter":"Κέντρο","alignTop":"Πάνω","alignMiddle":"Μέση","alignBottom":"Κάτω","invalidValue":"Μη έγκυρη τιμή.","invalidHeight":"Το ύψος πρέπει να είναι ένας αριθμός.","invalidWidth":"Το πλάτος πρέπει να είναι ένας αριθμός.","invalidCssLength":"Η τιμή που ορίζεται για το πεδίο \"%1\" πρέπει να είναι ένας θετικός αριθμός με ή χωρίς μια έγκυρη μονάδα μέτρησης CSS (px, %, in, cm, mm, em, ex, pt, ή pc).","invalidHtmlLength":"Η τιμή που ορίζεται για το πεδίο \"%1\" πρέπει να είναι ένας θετικός αριθμός με ή χωρίς μια έγκυρη μονάδα μέτρησης HTML (px ή %).","invalidInlineStyle":"Η τιμή για το εν σειρά στυλ πρέπει να περιέχει ένα ή περισσότερα ζεύγη με την μορφή \"όνομα: τιμή\" διαχωρισμένα με Ελληνικό ερωτηματικό.","cssLengthTooltip":"Εισάγεται μια τιμή σε pixel ή έναν αριθμό μαζί με μια έγκυρη μονάδα μέτρησης CSS (px, %, in, cm, mm, em, ex, pt, ή pc).","unavailable":"%1<span class=\"cke_accessibility\">, δεν είναι διαθέσιμο</span>"},"about":{"copy":"Πνευματικά δικαιώματα © $1 Με επιφύλαξη παντός δικαιώματος.","dlgTitle":"Περί του CKEditor","help":"Ελέγξτε το $1 για βοήθεια.","moreInfo":"Για πληροφορίες αδειών παρακαλούμε επισκεφθείτε την ιστοσελίδα μας:","title":"Περί του CKEditor","userGuide":"Οδηγίες Χρήστη CKEditor"},"basicstyles":{"bold":"Έντονη","italic":"Πλάγια","strike":"Διακριτή Διαγραφή","subscript":"Δείκτης","superscript":"Εκθέτης","underline":"Υπογράμμιση"},"blockquote":{"toolbar":"Περιοχή Παράθεσης"},"clipboard":{"copy":"Αντιγραφή","copyError":"Οι ρυθμίσεις ασφαλείας του περιηγητή σας δεν επιτρέπουν την επιλεγμένη εργασία αντιγραφής. Παρακαλώ χρησιμοποιείστε το πληκτρολόγιο (Ctrl/Cmd+C).","cut":"Αποκοπή","cutError":"Οι ρυθμίσεις ασφαλείας του περιηγητή σας δεν επιτρέπουν την επιλεγμένη εργασία αποκοπής. Παρακαλώ χρησιμοποιείστε το πληκτρολόγιο (Ctrl/Cmd+X).","paste":"Επικόλληση","pasteArea":"Περιοχή Επικόλλησης","pasteMsg":"Παρακαλώ επικολλήστε στο ακόλουθο κουτί χρησιμοποιώντας το πληκτρολόγιο (<strong>Ctrl/Cmd+V</strong>) και πατήστε OK.","securityMsg":"Λόγων των ρυθμίσεων ασφάλειας του περιηγητή σας, ο επεξεργαστής δεν μπορεί να έχει πρόσβαση στην μνήμη επικόλλησης. Χρειάζεται να επικολλήσετε ξανά σε αυτό το παράθυρο.","title":"Επικόλληση"},"contextmenu":{"options":"Επιλογές Αναδυόμενου Μενού"},"toolbar":{"toolbarCollapse":"Σύμπτυξη Εργαλειοθήκης","toolbarExpand":"Ανάπτυξη Εργαλειοθήκης","toolbarGroups":{"document":"Έγγραφο","clipboard":"Πρόχειρο/Αναίρεση","editing":"Επεξεργασία","forms":"Φόρμες","basicstyles":"Βασικά Στυλ","paragraph":"Παράγραφος","links":"Σύνδεσμοι","insert":"Εισαγωγή","styles":"Στυλ","colors":"Χρώματα","tools":"Εργαλεία"},"toolbars":"Εργαλειοθήκες επεξεργαστή"},"elementspath":{"eleLabel":"Διαδρομή Στοιχείων","eleTitle":"Στοιχείο %1"},"format":{"label":"Μορφοποίηση","panelTitle":"Μορφοποίηση Παραγράφου","tag_address":"Διεύθυνση","tag_div":"Κανονική (DIV)","tag_h1":"Κεφαλίδα 1","tag_h2":"Κεφαλίδα 2","tag_h3":"Κεφαλίδα 3","tag_h4":"Κεφαλίδα 4","tag_h5":"Κεφαλίδα 5","tag_h6":"Κεφαλίδα 6","tag_p":"Κανονική","tag_pre":"Προ-μορφοποιημένη"},"horizontalrule":{"toolbar":"Εισαγωγή Οριζόντιας Γραμμής"},"image":{"alertUrl":"Εισάγετε την τοποθεσία (URL) της εικόνας","alt":"Εναλλακτικό Κείμενο","border":"Περίγραμμα","btnUpload":"Αποστολή στον Διακομιστή","button2Img":"Θέλετε να μετατρέψετε το επιλεγμένο κουμπί εικόνας σε απλή εικόνα;","hSpace":"HSpace","img2Button":"Θέλετε να μεταμορφώσετε την επιλεγμένη εικόνα που είναι πάνω σε ένα κουμπί;","infoTab":"Πληροφορίες Εικόνας","linkTab":"Σύνδεσμος","lockRatio":"Κλείδωμα Αναλογίας","menu":"Ιδιότητες Εικόνας","resetSize":"Επαναφορά Αρχικού Μεγέθους","title":"Ιδιότητες Εικόνας","titleButton":"Ιδιότητες Κουμπιού Εικόνας","upload":"Αποστολή","urlMissing":"Το URL πηγής για την εικόνα λείπει.","vSpace":"VSpace","validateBorder":"Το περίγραμμα πρέπει να είναι ένας ακέραιος αριθμός.","validateHSpace":"Το HSpace πρέπει να είναι ένας ακέραιος αριθμός.","validateVSpace":"Το VSpace πρέπει να είναι ένας ακέραιος αριθμός."},"indent":{"indent":"Αύξηση Εσοχής","outdent":"Μείωση Εσοχής"},"fakeobjects":{"anchor":"Άγκυρα","flash":"Ταινία Flash","hiddenfield":"Κρυφό Πεδίο","iframe":"IFrame","unknown":"Άγνωστο Αντικείμενο"},"link":{"acccessKey":"Συντόμευση","advanced":"Για Προχωρημένους","advisoryContentType":"Ενδεικτικός Τύπος Περιεχομένου","advisoryTitle":"Ενδεικτικός Τίτλος","anchor":{"toolbar":"Εισαγωγή/επεξεργασία Άγκυρας","menu":"Ιδιότητες άγκυρας","title":"Ιδιότητες άγκυρας","name":"Όνομα άγκυρας","errorName":"Παρακαλούμε εισάγετε όνομα άγκυρας","remove":"Αφαίρεση Άγκυρας"},"anchorId":"Βάσει του Element Id","anchorName":"Βάσει του Ονόματος Άγκυρας","charset":"Κωδικοποίηση Χαρακτήρων Προσαρτημένης Πηγής","cssClasses":"Κλάσεις Φύλλων Στυλ","emailAddress":"Διεύθυνση E-mail","emailBody":"Κείμενο Μηνύματος","emailSubject":"Θέμα Μηνύματος","id":"Id","info":"Πληροφορίες Συνδέσμου","langCode":"Κατεύθυνση Κειμένου","langDir":"Κατεύθυνση Κειμένου","langDirLTR":"Αριστερά προς Δεξιά (LTR)","langDirRTL":"Δεξιά προς Αριστερά (RTL)","menu":"Επεξεργασία Συνδέσμου","name":"Όνομα","noAnchors":"(Δεν υπάρχουν άγκυρες στο κείμενο)","noEmail":"Εισάγετε τη διεύθυνση ηλεκτρονικού ταχυδρομείου","noUrl":"Εισάγετε την τοποθεσία (URL) του συνδέσμου","other":"<άλλο>","popupDependent":"Εξαρτημένο (Netscape)","popupFeatures":"Επιλογές Αναδυόμενου Παραθύρου","popupFullScreen":"Πλήρης Οθόνη (IE)","popupLeft":"Θέση Αριστερά","popupLocationBar":"Γραμμή Τοποθεσίας","popupMenuBar":"Γραμμή Επιλογών","popupResizable":"Προσαρμοζόμενο Μέγεθος","popupScrollBars":"Μπάρες Κύλισης","popupStatusBar":"Γραμμή Κατάστασης","popupToolbar":"Εργαλειοθήκη","popupTop":"Θέση Πάνω","rel":"Σχέση","selectAnchor":"Επιλέξτε μια Άγκυρα","styles":"Μορφή","tabIndex":"Σειρά Μεταπήδησης","target":"Παράθυρο Προορισμού","targetFrame":"<πλαίσιο>","targetFrameName":"Όνομα Πλαισίου Προορισμού","targetPopup":"<αναδυόμενο παράθυρο>","targetPopupName":"Όνομα Αναδυόμενου Παραθύρου","title":"Σύνδεσμος","toAnchor":"Άγκυρα σε αυτήν τη σελίδα","toEmail":"E-Mail","toUrl":"URL","toolbar":"Σύνδεσμος","type":"Τύπος Συνδέσμου","unlink":"Αφαίρεση Συνδέσμου","upload":"Αποστολή"},"list":{"bulletedlist":"Εισαγωγή/Απομάκρυνση Λίστας Κουκκίδων","numberedlist":"Εισαγωγή/Απομάκρυνση Αριθμημένης Λίστας"},"magicline":{"title":"Εισάγετε παράγραφο εδώ"},"maximize":{"maximize":"Μεγιστοποίηση","minimize":"Ελαχιστοποίηση"},"pastetext":{"button":"Επικόλληση ως απλό κείμενο","title":"Επικόλληση ως απλό κείμενο"},"pastefromword":{"confirmCleanup":"Το κείμενο που επικολλάται φαίνεται να είναι αντιγραμμένο από το Word. Μήπως θα θέλατε να καθαριστεί προτού επικολληθεί;","error":"Δεν ήταν δυνατό να καθαριστούν τα δεδομένα λόγω ενός εσωτερικού σφάλματος","title":"Επικόλληση από το Word","toolbar":"Επικόλληση από το Word"},"removeformat":{"toolbar":"Εκκαθάριση Μορφοποίησης"},"sourcearea":{"toolbar":"Κώδικας"},"specialchar":{"options":"Επιλογές Ειδικών Χαρακτήρων","title":"Επιλέξτε Έναν Ειδικό Χαρακτήρα","toolbar":"Εισαγωγή Ειδικού Χαρακτήρα"},"scayt":{"about":"About SCAYT","aboutTab":"Περί","addWord":"Προσθήκη στο λεξικό","allCaps":"Να αγνοούνται όλες οι λέξεις σε κεφαλαία","dic_create":"Δημιουργία","dic_delete":"Διαγραφή","dic_field_name":"Όνομα λεξικού","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Μετονομασία","dic_restore":"Ανάκτηση","dictionariesTab":"Λεξικά","disable":"Disable SCAYT","emptyDic":"Το όνομα του λεξικού δεν πρέπει να είναι κενό.","enable":"Enable SCAYT","ignore":"Αγνόησε το","ignoreAll":"Να αγνοηθούν όλα","ignoreDomainNames":"Ignore Domain Names","langs":"Γλώσσες","languagesTab":"Γλώσσες","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"Περισσότερες προτάσεις","opera_title":"Not supported by Opera","options":"Επιλογές","optionsTab":"Επιλογές","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"Μορφές","panelTitle":"Στυλ Μορφοποίησης","panelTitle1":"Στυλ Τμημάτων","panelTitle2":"Στυλ Εν Σειρά","panelTitle3":"Στυλ Αντικειμένων"},"table":{"border":"Πάχος Περιγράμματος","caption":"Λεζάντα","cell":{"menu":"Κελί","insertBefore":"Εισαγωγή Κελιού Πριν","insertAfter":"Εισαγωγή Κελιού Μετά","deleteCell":"Διαγραφή Κελιών","merge":"Ενοποίηση Κελιών","mergeRight":"Συγχώνευση Με Δεξιά","mergeDown":"Συγχώνευση Με Κάτω","splitHorizontal":"Οριζόντια Διαίρεση Κελιού","splitVertical":"Κατακόρυφη Διαίρεση Κελιού","title":"Ιδιότητες Κελιού","cellType":"Τύπος Κελιού","rowSpan":"Εύρος Γραμμών","colSpan":"Εύρος Στηλών","wordWrap":"Αναδίπλωση Λέξεων","hAlign":"Οριζόντια Στοίχιση","vAlign":"Κάθετη Στοίχιση","alignBaseline":"Baseline","bgColor":"Χρώμα Φόντου","borderColor":"Χρώμα Περιγράμματος","data":"Δεδομένα","header":"Κεφαλίδα","yes":"Ναι","no":"Όχι","invalidWidth":"Το πλάτος του κελιού πρέπει να είναι αριθμός.","invalidHeight":"Το ύψος του κελιού πρέπει να είναι αριθμός.","invalidRowSpan":"Το εύρος των γραμμών πρέπει να είναι ακέραιος αριθμός.","invalidColSpan":"Το εύρος των στηλών πρέπει να είναι ακέραιος αριθμός.","chooseColor":"Επιλέξτε"},"cellPad":"Αναπλήρωση κελιών","cellSpace":"Απόσταση κελιών","column":{"menu":"Στήλη","insertBefore":"Εισαγωγή Στήλης Πριν","insertAfter":"Εισαγωγή Στήλης Μετά","deleteColumn":"Διαγραφή Στηλών"},"columns":"Στήλες","deleteTable":"Διαγραφή Πίνακα","headers":"Κεφαλίδες","headersBoth":"Και τα δύο","headersColumn":"Πρώτη στήλη","headersNone":"Κανένα","headersRow":"Πρώτη Γραμμή","invalidBorder":"Το πάχος του περιγράμματος πρέπει να είναι ένας αριθμός.","invalidCellPadding":"Η αναπλήρωση των κελιών πρέπει να είναι θετικός αριθμός.","invalidCellSpacing":"Η απόσταση μεταξύ των κελιών πρέπει να είναι ένας θετικός αριθμός.","invalidCols":"Ο αριθμός των στηλών πρέπει να είναι μεγαλύτερος από 0.","invalidHeight":"Το ύψος του πίνακα πρέπει να είναι αριθμός.","invalidRows":"Ο αριθμός των σειρών πρέπει να είναι μεγαλύτερος από 0.","invalidWidth":"Το πλάτος του πίνακα πρέπει να είναι ένας αριθμός.","menu":"Ιδιότητες Πίνακα","row":{"menu":"Γραμμή","insertBefore":"Εισαγωγή Γραμμής Πριν","insertAfter":"Εισαγωγή Γραμμής Μετά","deleteRow":"Διαγραφή Γραμμών"},"rows":"Γραμμές","summary":"Περίληψη","title":"Ιδιότητες Πίνακα","toolbar":"Πίνακας","widthPc":"τοις εκατό","widthPx":"pixel","widthUnit":"μονάδα πλάτους"},"undo":{"redo":"Επανάληψη","undo":"Αναίρεση"},"wsc":{"btnIgnore":"Αγνόηση","btnIgnoreAll":"Αγνόηση όλων","btnReplace":"Αντικατάσταση","btnReplaceAll":"Αντικατάσταση όλων","btnUndo":"Αναίρεση","changeTo":"Αλλαγή σε","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Δεν υπάρχει εγκατεστημένος ορθογράφος. Θέλετε να τον κατεβάσετε τώρα;","manyChanges":"Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Άλλαξαν %1 λέξεις","noChanges":"Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν άλλαξαν λέξεις","noMispell":"Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν βρέθηκαν λάθη","noSuggestions":"- Δεν υπάρχουν προτάσεις -","notAvailable":"Η υπηρεσία δεν είναι διαθέσιμη αυτήν την στιγμή.","notInDic":"Δεν υπάρχει στο λεξικό","oneChange":"Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Άλλαξε μια λέξη","progress":"Γίνεται ορθογραφικός έλεγχος...","title":"Ορθογραφικός Έλεγχος","toolbar":"Ορθογραφικός Έλεγχος"}}; | addeye/labadministrasi | js/plugins/ckeditor/lang/el.js | JavaScript | mit | 19,475 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.';
$lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.';
$lang['db_unable_to_select'] = 'Unable to select the specified database: %s';
$lang['db_unable_to_create'] = 'Unable to create the specified database: %s';
$lang['db_invalid_query'] = 'The query you submitted is not valid.';
$lang['db_must_set_table'] = 'You must set the database table to be used with your query.';
$lang['db_must_use_set'] = 'You must use the "set" method to update an entry.';
$lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.';
$lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.';
$lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.';
$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.';
$lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.';
$lang['db_unsupported_function'] = 'This feature is not available for the database you are using.';
$lang['db_transaction_failure'] = 'Transaction failure: Rollback performed.';
$lang['db_unable_to_drop'] = 'Unable to drop the specified database.';
$lang['db_unsupported_feature'] = 'Unsupported feature of the database platform you are using.';
$lang['db_unsupported_compression'] = 'The file compression format you chose is not supported by your server.';
$lang['db_filepath_error'] = 'Unable to write data to the file path you have submitted.';
$lang['db_invalid_cache_path'] = 'The cache path you submitted is not valid or writable.';
$lang['db_table_name_required'] = 'A table name is required for that operation.';
$lang['db_column_name_required'] = 'A column name is required for that operation.';
$lang['db_column_definition_required'] = 'A column definition is required for that operation.';
$lang['db_unable_to_set_charset'] = 'Unable to set client connection character set: %s';
$lang['db_error_heading'] = 'A Database Error Occurred';
| nilesh74/Event | system/language/english/db_lang.php | PHP | mit | 3,916 |
/*
* # Semantic UI
* https://github.com/Semantic-Org/Semantic-UI
* http://www.semantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
.transition{-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-timing-function:ease;animation-timing-function:ease;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animating.transition{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible!important}.loading.transition{position:absolute;top:-99999px;left:-99999px}.hidden.transition{display:none;visibility:hidden}.visible.transition{display:block!important;visibility:visible!important;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0)}.disabled.transition{-webkit-animation-play-state:paused;animation-play-state:paused}.looping.transition{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.flash.transition{-webkit-animation-name:flash;animation-name:flash}.shake.transition{-webkit-animation-name:shake;animation-name:shake}.bounce.transition{-webkit-animation-name:bounce;animation-name:bounce}.tada.transition{-webkit-animation-name:tada;animation-name:tada}.pulse.transition{-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg);transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@keyframes tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg);transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(0.9);transform:scale(0.9);opacity:.7}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(0.9);transform:scale(0.9);opacity:.7}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.slide.down.transition.in{-webkit-animation-name:slideIn;animation-name:slideIn;transform-origin:50% 0;-ms-transform-origin:50% 0;-webkit-transform-origin:50% 0}.slide.down.transition.out{-webkit-animation-name:slideOut;animation-name:slideOut;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0}.slide.up.transition.in{-webkit-animation-name:slideIn;animation-name:slideIn;-webkit-transform-origin:50% 100%;-ms-transform-origin:50% 100%;transform-origin:50% 100%}.slide.up.transition.out{-webkit-animation-name:slideOut;animation-name:slideOut;-webkit-transform-origin:50% 100%;-ms-transform-origin:50% 100%;transform-origin:50% 100%}@-webkit-keyframes slideIn{0%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes slideIn{0%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes slideOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes slideOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}}.flip.transition.in,.flip.transition.out{-webkit-perspective:2000px;perspective:2000px}.horizontal.flip.transition.in{-webkit-animation-name:horizontalFlipIn;animation-name:horizontalFlipIn}.horizontal.flip.transition.out{-webkit-animation-name:horizontalFlipOut;animation-name:horizontalFlipOut}.vertical.flip.transition.in{-webkit-animation-name:verticalFlipIn;animation-name:verticalFlipIn}.vertical.flip.transition.out{-webkit-animation-name:verticalFlipOut;animation-name:verticalFlipOut}@-webkit-keyframes horizontalFlipIn{0%{-webkit-transform:rotateY(-90deg);transform:rotateY(-90deg);opacity:0}100%{-webkit-transform:rotateY(0deg);transform:rotateY(0deg);opacity:1}}@keyframes horizontalFlipIn{0%{-webkit-transform:rotateY(-90deg);transform:rotateY(-90deg);opacity:0}100%{-webkit-transform:rotateY(0deg);transform:rotateY(0deg);opacity:1}}@-webkit-keyframes horizontalFlipOut{0%{-webkit-transform:rotateY(0deg);transform:rotateY(0deg);opacity:1}100%{-webkit-transform:rotateY(90deg);transform:rotateY(90deg);opacity:0}}@keyframes horizontalFlipOut{0%{-webkit-transform:rotateY(0deg);transform:rotateY(0deg);opacity:1}100%{-webkit-transform:rotateY(90deg);transform:rotateY(90deg);opacity:0}}@-webkit-keyframes verticalFlipIn{0%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg);opacity:1}}@keyframes verticalFlipIn{0%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg);opacity:1}}@-webkit-keyframes verticalFlipOut{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg);opacity:1}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}}@keyframes verticalFlipOut{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg);opacity:1}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}}.fade.transition.in{-webkit-animation-name:fadeIn;animation-name:fadeIn}.fade.transition.out{-webkit-animation-name:fadeOut;animation-name:fadeOut}.fade.up.transition.in{-webkit-animation-name:fadeUpIn;animation-name:fadeUpIn}.fade.up.transition.out{-webkit-animation-name:fadeUpOut;animation-name:fadeUpOut}.fade.down.transition.in{-webkit-animation-name:fadeDownIn;animation-name:fadeDownIn}.fade.down.transition.out{-webkit-animation-name:fadeDownOut;animation-name:fadeDownOut}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeUpIn{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}100%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}}@keyframes fadeUpIn{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}100%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}}@-webkit-keyframes fadeUpOut{0%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}100%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}}@keyframes fadeUpOut{0%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}100%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}}@-webkit-keyframes fadeDownIn{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}100%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}}@keyframes fadeDownIn{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}100%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}}@-webkit-keyframes fadeDownOut{0%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}100%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}}@keyframes fadeDownOut{0%{opacity:1;-webkit-transform:translateY(0%);transform:translateY(0%)}100%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}}.scale.transition.in{-webkit-animation-name:scaleIn;animation-name:scaleIn}.scale.transition.out{-webkit-animation-name:scaleOut;animation-name:scaleOut}@-webkit-keyframes scaleIn{0%{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleIn{0%{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes scaleOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}}@keyframes scaleOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}}.drop.transition{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-timing-function:cubic-bezier(0.34,1.61,.7,1);animation-timing-function:cubic-bezier(0.34,1.61,.7,1)}.drop.transition.in{-webkit-animation-name:dropIn;animation-name:dropIn}.drop.transition.out{-webkit-animation-name:dropOut;animation-name:dropOut}@-webkit-keyframes dropIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes dropIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes dropOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes dropOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}.browse.transition.in{-webkit-animation-name:browseIn;animation-name:browseIn;-webkit-animation-timing-function:ease;animation-timing-function:ease}.browse.transition.out,.browse.transition.out.left{-webkit-animation-name:browseOutLeft;animation-name:browseOutLeft;-webkit-animation-timing-function:ease;animation-timing-function:ease}.browse.transition.out.right{-webkit-animation-name:browseOutRight;animation-name:browseOutRight;-webkit-animation-timing-function:ease;animation-timing-function:ease}@-webkit-keyframes browseIn{0%{-webkit-transform:scale(0.8) translateZ(0px);transform:scale(0.8) translateZ(0px);z-index:-1}10%{-webkit-transform:scale(0.8) translateZ(0px);transform:scale(0.8) translateZ(0px);z-index:-1;opacity:.7}80%{-webkit-transform:scale(1.05) translateZ(0px);transform:scale(1.05) translateZ(0px);opacity:1;z-index:999}100%{-webkit-transform:scale(1) translateZ(0px);transform:scale(1) translateZ(0px);z-index:999}}@keyframes browseIn{0%{-webkit-transform:scale(0.8) translateZ(0px);transform:scale(0.8) translateZ(0px);z-index:-1}10%{-webkit-transform:scale(0.8) translateZ(0px);transform:scale(0.8) translateZ(0px);z-index:-1;opacity:.7}80%{-webkit-transform:scale(1.05) translateZ(0px);transform:scale(1.05) translateZ(0px);opacity:1;z-index:999}100%{-webkit-transform:scale(1) translateZ(0px);transform:scale(1) translateZ(0px);z-index:999}}@-webkit-keyframes browseOutLeft{0%{z-index:999;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg);transform:translateX(0%) rotateY(0deg) rotateX(0deg)}50%{z-index:-1;-webkit-transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:-1;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);opacity:0}}@keyframes browseOutLeft{0%{z-index:999;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg);transform:translateX(0%) rotateY(0deg) rotateX(0deg)}50%{z-index:-1;-webkit-transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:-1;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);opacity:0}}@-webkit-keyframes browseOutRight{0%{z-index:999;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg);transform:translateX(0%) rotateY(0deg) rotateX(0deg)}50%{z-index:1;-webkit-transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:1;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);opacity:0}}@keyframes browseOutRight{0%{z-index:999;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg);transform:translateX(0%) rotateY(0deg) rotateX(0deg)}50%{z-index:1;-webkit-transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:1;-webkit-transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);transform:translateX(0%) rotateY(0deg) rotateX(0deg) translateZ(-10px);opacity:0}} | nolsherry/cdnjs | ajax/libs/semantic-ui/1.1.1/components/transition.min.css | CSS | mit | 14,187 |
/**
@overview Export the jsdoc comments in a json file
@version 1.0
*/
'use strict';
var path = require('jsdoc/path');
function findClass(parentNode, className)
{
var elements =
parentNode.classes
.filter(function (element) {
return (element.name === className);
});
return elements[0];
}
function graft2(parentNode, childNodes) {
if (!parentNode.classes) {
parentNode.classes = [];
}
childNodes.forEach(function (element, index) {
if (element.kind === 'class') {
var thisClass = {
'name': element.longname,
'description': element.classdesc || element.description || '',
'constructor': {
'name': element.name,
'description': element.description || '',
'parameters': []
},
'functions': [],
'members': []
};
if (element.params) {
for (i = 0, len = element.params.length; i < len; i++) {
thisClass.constructor.parameters.push({
'name': element.params[i].name,
'type': element.params[i].type ? (element.params[i].type.names.length === 1 ? element.params[i].type.names[0] : element.params[i].type.names) : '',
'description': element.params[i].description || '',
'default': element.params[i].defaultvalue || '',
'optional': typeof element.params[i].optional === 'boolean' ? element.params[i].optional : '',
'nullable': typeof element.params[i].nullable === 'boolean' ? element.params[i].nullable : ''
});
}
}
parentNode.classes.push(thisClass);
}
else if (element.kind === 'function')
{
var parentClass = findClass(parentNode, element.memberof);
var thisFunction = {
'name': element.name,
'description': element.description || '',
'parameters': []
};
if (parentClass != null) {
parentClass.functions.push(thisFunction);
if (element.returns) {
thisFunction.returns = {
'type': element.returns[0].type ? (element.returns[0].type.names.length === 1 ? element.returns[0].type.names[0] : element.returns[0].type.names) : '',
'description': element.returns[0].description || ''
};
}
if (element.params) {
for (i = 0, len = element.params.length; i < len; i++) {
thisFunction.parameters.push({
'name': element.params[i].name,
'type': element.params[i].type ? (element.params[i].type.names.length === 1 ? element.params[i].type.names[0] : element.params[i].type.names) : '',
'description': element.params[i].description || '',
'default': element.params[i].defaultvalue || '',
'optional': typeof element.params[i].optional === 'boolean' ? element.params[i].optional : '',
'nullable': typeof element.params[i].nullable === 'boolean' ? element.params[i].nullable : ''
});
}
}
}
}
else if ((element.kind === 'member') || (element.kind == 'constant')) {
var parentClass = findClass(parentNode, element.memberof);
if (parentClass != null) {
parentClass.members.push({
'name': element.name,
'access': element.access || '',
'virtual': !!element.virtual,
'description': element.description || (((element.properties !== undefined) && (element.properties.length === 1)) ? (element.properties[0].description || '') : ''), //properties
'type': element.type ? (element.type.length === 1 ? element.type[0] : element.type) : '',
'default': element.defaultvalue || '',
});
}
}
});
}
/**
@param {TAFFY} data
@param {object} opts
*/
exports.publish = function (data, opts) {
var root = {};
data({undocumented: true}).remove();
graft2(root, data().get());
var fs = require('fs');
fs.writeFileSync(path.join(env.opts.destination, 'docs.json'), JSON.stringify(root), 'utf8');
};
| mperalt3/ctg2 | resources/jsdoc Export JSON/template/publish.js | JavaScript | mit | 4,658 |
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Cache class that stores cached content in XCache.
*
* @package symfony
* @subpackage cache
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id: sfXCacheCache.class.php 17865 2009-05-02 09:23:55Z FabianLange $
*/
class sfXCacheCache extends sfCache
{
/**
* Initializes this sfCache instance.
*
* Available options:
*
* * see sfCache for options available for all drivers
*
* @see sfCache
*/
public function initialize($options = array())
{
parent::initialize($options);
if (!function_exists('xcache_set'))
{
throw new sfInitializationException('You must have XCache installed and enabled to use sfXCacheCache class.');
}
if (!ini_get('xcache.var_size'))
{
throw new sfInitializationException('You must set the "xcache.var_size" variable to a value greater than 0 to use sfXCacheCache class.');
}
}
/**
* @see sfCache
*/
public function get($key, $default = null)
{
$set = $this->getBaseValue($key);
if (!is_array($set) || !array_key_exists('data', $set))
{
return $default;
}
return $set['data'];
}
/**
* @see sfCache
*/
public function has($key)
{
return xcache_isset($this->getOption('prefix').$key);
}
/**
* @see sfCache
*/
public function set($key, $data, $lifetime = null)
{
$lifetime = $this->getLifetime($lifetime);
$set = array(
'timeout' => time() + $lifetime,
'data' => $data,
'ctime' => time()
);
return xcache_set($this->getOption('prefix').$key, $set, $lifetime);
}
/**
* @see sfCache
*/
public function remove($key)
{
return xcache_unset($this->getOption('prefix').$key);
}
/**
* @see sfCache
*/
public function clean($mode = sfCache::ALL)
{
if ($mode !== sfCache::ALL)
{
return true;
}
$this->checkAuth();
for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)
{
if (false === xcache_clear_cache(XC_TYPE_VAR, $i))
{
return false;
}
}
return true;
}
/**
* @see sfCache
*/
public function getLastModified($key)
{
$set = $this->getBaseValue($key);
if (!is_array($set) || !array_key_exists('ctime', $set))
{
return 0;
}
return $set['ctime'];
}
/**
* @see sfCache
*/
public function getTimeout($key)
{
$set = $this->getBaseValue($key);
if (!is_array($set) || !array_key_exists('timeout', $set))
{
return 0;
}
return $set['timeout'];
}
public function getBaseValue($key)
{
return xcache_isset($this->getOption('prefix').$key) ? xcache_get($this->getOption('prefix').$key) : null;
}
/**
* @see sfCache
*/
public function removePattern($pattern)
{
$this->checkAuth();
$regexp = self::patternToRegexp($this->getOption('prefix').$pattern);
for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)
{
$infos = xcache_list(XC_TYPE_VAR, $i);
if (!is_array($infos['cache_list']))
{
return;
}
foreach ($infos['cache_list'] as $info)
{
if (preg_match($regexp, $info['name']))
{
xcache_unset($info['name']);
}
}
}
}
public function getCacheInfo($key)
{
$this->checkAuth();
for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)
{
$infos = xcache_list(XC_TYPE_VAR, $i);
if (is_array($infos['cache_list']))
{
foreach ($infos['cache_list'] as $info)
{
if ($this->getOption('prefix').$key == $info['name'])
{
return $info;
}
}
}
}
return null;
}
protected function checkAuth()
{
if (ini_get('xcache.admin.enable_auth'))
{
throw new sfConfigurationException('To use all features of the "sfXCacheCache" class, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.');
}
}
}
| siwapp/siwapp-sf1 | lib/vendor/symfony/lib/cache/sfXCacheCache.class.php | PHP | mit | 4,337 |
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<x-meta id="core-animated-pages" label="Animated Pages" group="Core" isContainer>
<!--
TODO(sorvell):
- can't transition without contents; must document or fix.
- transitions syntax awkward: should be space separated
- hero-transition should be renamed `hero`
- hero and cross-fade-all should be always enabled.
-->
<template>
<core-animated-pages style="width:420px;height:582px;overflow:hidden;background-color:#eee;">
<section layout horizontal center center-justified>
</section>
<section>
</section>
<section>
</section>
</core-animated-pages>
</template>
<template id="imports">
<link rel="import" href="core-animated-pages.html">
<link rel="import" href="transitions/hero-transition.html">
<link rel="import" href="transitions/cross-fade.html">
<link rel="import" href="transitions/slide-down.html">
<link rel="import" href="transitions/slide-up.html">
<link rel="import" href="transitions/tile-cascade.html">
</template>
</x-meta>
| cgvarela/polymer-router-demos | no-router/bower_components/core-animated-pages/metadata.html | HTML | mit | 1,591 |
div.selector,div.selector span,div.checker span,div.radio span,div.uploader,div.uploader span.action,div.button,div.button span{background-image:url("../images/sprite.png");background-repeat:no-repeat;-webkit-font-smoothing:antialiased}div.selector,div.checker,div.button,div.radio,div.uploader{display:-moz-inline-box;display:inline-block;*display:inline;zoom:1;vertical-align:middle}div.selector:focus,div.checker:focus,div.button:focus,div.radio:focus,div.uploader:focus{outline:0}div.selector,div.selector *,div.radio,div.radio *,div.checker,div.checker *,div.uploader,div.uploader *,div.button,div.button *{margin:0;padding:0}.highContrastDetect{background:url("../images/bg-input.png") repeat-x 0 0;width:0px;height:0px}input.uniform-input,select.uniform-multiselect,textarea.uniform{padding:3px;background:url("../images/bg-input.png") repeat-x 0 0;outline:0}input.uniform-input.active,select.uniform-multiselect.active,textarea.uniform.active{background:url("../images/bg-input-focus.png") repeat-x 0 0}div.checker input,input[type="search"],input[type="search"]:active{-moz-appearance:none;-webkit-appearance:none}div.selector{background-position:0 -130px;line-height:26px;height:26px;padding:0 0 0 10px;position:relative;overflow:hidden}div.selector span{text-overflow:ellipsis;display:block;overflow:hidden;white-space:nowrap;background-position:right 0;height:26px;line-height:26px;padding-right:25px;cursor:pointer;width:100%;display:block}div.selector.fixedWidth{width:190px}div.selector.fixedWidth span{width:155px}div.selector select{opacity:0;filter:alpha(opacity=0);-moz-opacity:0;border:none;background:none;position:absolute;height:22px;top:2px;left:0px;width:100%}div.selector.active{background-position:0 -156px}div.selector.active span{background-position:right -26px}div.selector.hover,div.selector.focus{background-position:0 -182px}div.selector.hover span,div.selector.focus span{background-position:right -52px}div.selector.hover.active,div.selector.focus.active{background-position:0 -208px}div.selector.hover.active span,div.selector.focus.active span{background-position:right -78px}div.selector.disabled,div.selector.disabled.active{background-position:0 -234px}div.selector.disabled span,div.selector.disabled.active span{background-position:right -104px}div.checker{position:relative}div.checker,div.checker span,div.checker input{width:19px;height:19px}div.checker span{display:-moz-inline-box;display:inline-block;*display:inline;zoom:1;text-align:center;background-position:0 -260px}div.checker span.checked{background-position:-76px -260px}div.checker input{opacity:0;filter:alpha(opacity=0);-moz-opacity:0;border:none;background:none;display:-moz-inline-box;display:inline-block;*display:inline;zoom:1}div.checker.active span{background-position:-19px -260px}div.checker.active span.checked{background-position:-95px -260px}div.checker.hover span,div.checker.focus span{background-position:-38px -260px}div.checker.hover span.checked,div.checker.focus span.checked{background-position:-114px -260px}div.checker.hover.active span,div.checker.focus.active span{background-position:-57px -260px}div.checker.hover.active span.checked,div.checker.focus.active span.checked{background-position:-133px -260px}div.checker.disabled span,div.checker.disabled.active span{background-position:-152px -260px}div.checker.disabled span.checked,div.checker.disabled.active span.checked{background-position:-171px -260px}div.radio{position:relative}div.radio,div.radio span,div.radio input{width:18px;height:18px}div.radio span{display:-moz-inline-box;display:inline-block;*display:inline;zoom:1;text-align:center;background-position:0 -279px}div.radio span.checked{background-position:-72px -279px}div.radio input{opacity:0;filter:alpha(opacity=0);-moz-opacity:0;border:none;background:none;display:-moz-inline-box;display:inline-block;*display:inline;zoom:1;text-align:center}div.radio.active span{background-position:-18px -279px}div.radio.active span.checked{background-position:-90px -279px}div.radio.hover span,div.radio.focus span{background-position:-36px -279px}div.radio.hover span.checked,div.radio.focus span.checked{background-position:-108px -279px}div.radio.hover.active span,div.radio.focus.active span{background-position:-54px -279px}div.radio.hover.active span.checked,div.radio.focus.active span.checked{background-position:-126px -279px}div.radio.disabled span,div.radio.disabled.active span{background-position:-144px -279px}div.radio.disabled span.checked,div.radio.disabled.active span.checked{background-position:-162px -279px}div.uploader{background-position:0 -297px;height:28px;width:190px;cursor:pointer;position:relative;overflow:hidden}div.uploader span.action{background-position:right -409px;height:28px;line-height:28px;width:82px;text-align:center;float:left;display:inline;overflow:hidden;cursor:pointer}div.uploader span.filename{text-overflow:ellipsis;display:block;overflow:hidden;white-space:nowrap;float:left;cursor:default;height:24px;margin:2px 0 2px 2px;line-height:24px;width:85px;padding:0 10px}div.uploader input{opacity:0;filter:alpha(opacity=0);-moz-opacity:0;border:none;background:none;position:absolute;top:0;right:0;float:right;cursor:default;width:100%;height:100%}div.uploader.active span.action{background-position:right -465px}div.uploader.hover,div.uploader.focus{background-position:0 -353px}div.uploader.hover span.action,div.uploader.focus span.action{background-position:right -437px}div.uploader.hover.active span.action,div.uploader.focus.active span.action{background-position:right -493px}div.uploader.disabled,div.uploader.disabled.active{background-position:0 -325px}div.uploader.disabled span.action,div.uploader.disabled.active span.action{background-position:right -381px}div.button{background-position:0 -641px;height:30px;cursor:pointer;position:relative}div.button a,div.button button,div.button input{opacity:0.01;filter:alpha(opacity=1);-moz-opacity:0.01;display:block;top:0;left:0;right:0;bottom:0;position:absolute}div.button span{display:-moz-inline-box;display:inline-block;*display:inline;zoom:1;line-height:22px;text-align:center;background-position:right -521px;height:22px;margin-left:13px;padding:8px 15px 0 2px}div.button.active{background-position:0 -671px}div.button.active span{background-position:right -551px;cursor:default}div.button.hover,div.button.focus{background-position:0 -701px}div.button.hover span,div.button.focus span{background-position:right -581px}div.button.disabled,div.button.disabled.active{background-position:0 -731px}div.button.disabled span,div.button.disabled.active span{background-position:right -611px;cursor:default}input.uniform-input,select.uniform-multiselect,textarea.uniform{font-size:12px;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-weight:normal;color:#777;border-top:solid 1px #aaa;border-left:solid 1px #aaa;border-bottom:solid 1px #ccc;border-right:solid 1px #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}input.uniform-input.hover,input.uniform-input.focus,select.uniform-multiselect.hover,select.uniform-multiselect.focus,textarea.uniform.hover,textarea.uniform.focus{-webkit-box-shadow:0px 0px 4px rgba(0,0,0,0.3);-moz-box-shadow:0px 0px 4px rgba(0,0,0,0.3);box-shadow:0px 0px 4px rgba(0,0,0,0.3);border-color:#999}div.button span{font-weight:bold;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-size:12px;letter-spacing:1px;text-transform:uppercase}div.button.hover span,div.button.focus span{color:#555}div.button.disabled span,div.button.disabled.active span{color:#bbb}div.selector{font-size:12px}div.selector span{color:#666;text-shadow:0 1px 0 #fff}div.selector select{font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-size:12px}div.selector.disabled span,div.selector.disabled.active span{color:#bbb}div.checker{margin-right:5px}div.radio{margin-right:3px}div.uploader span.action{text-shadow:#fff 0px 1px 0px;background-color:#fff;font-size:11px;font-weight:bold}div.uploader span.filename{color:#777;border-right:solid 1px #bbb;font-size:11px}div.uploader.disabled span.action,div.uploader.disabled.active span.action{color:#aaa}div.uploader.disabled span.filename,div.uploader.disabled.active span.filename{border-color:#ddd;color:#aaa}input.uniform-input,input.uniform-input:focus{background-color:#fff}
| Amomo/cdnjs | ajax/libs/Uniform.js/2.2.0/themes/default/css/uniform.default.min.css | CSS | mit | 8,344 |
// Type definitions for gulp-remember
// Project: https://github.com/ahaurw01/gulp-remember
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module "gulp-remember"
{
interface ICache
{
[path: string]: NodeJS.ReadWriteStream;
}
interface IGulpRemember
{
/**
* Return a through stream that will:
* 1. Remember all files that ever pass through it.
* 2. Add all remembered files back into the stream when not present.
* @param cacheName Name to give your cache
*/
(cacheName?: string): NodeJS.ReadWriteStream;
/**
* Forget about a file.
* A warning is logged if either the named cache or file do not exist.
* @param path Path of the file to forget
*/
forget(path: string): void;
/**
* Forget about a file.
* A warning is logged if either the named cache or file do not exist.
* @param cacheName Name of the cache from which to drop the file
* @param path Path of the file to forget
*/
forget(cacheName: string, path: string): void;
/**
* Forget all files in one cache.
* A warning is logged if the cache does not exist.
*
* @param cacheName Name of the cache to wipe
*/
forgetAll(cacheName?: string): void;
/**
* Return a raw cache by name.
* Useful for checking state. Manually adding or removing files is NOT recommended.
*
* @param cacheName Name of the cache to retrieve
*/
cacheFor(cacheName?: string): ICache;
}
const remember: IGulpRemember;
export = remember;
}
| vincentw56/DefinitelyTyped | gulp-remember/gulp-remember.d.ts | TypeScript | mit | 1,843 |
//! moment.js locale configuration
//! locale : khmer (km)
//! author : Kruy Vanna : https://github.com/kruyvanna
import moment from '../moment';
export default moment.defineLocale('km', {
months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS : 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
nextDay: '[ស្អែក ម៉ោង] LT',
nextWeek: 'dddd [ម៉ោង] LT',
lastDay: '[ម្សិលមិញ ម៉ោង] LT',
lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
sameElse: 'L'
},
relativeTime: {
future: '%sទៀត',
past: '%sមុន',
s: 'ប៉ុន្មានវិនាទី',
m: 'មួយនាទី',
mm: '%d នាទី',
h: 'មួយម៉ោង',
hh: '%d ម៉ោង',
d: 'មួយថ្ងៃ',
dd: '%d ថ្ងៃ',
M: 'មួយខែ',
MM: '%d ខែ',
y: 'មួយឆ្នាំ',
yy: '%d ឆ្នាំ'
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
| titimoby/connected | jsserver/node_modules/mosca/node_modules/moment/src/locale/km.js | JavaScript | mit | 2,275 |
/*
Highcharts funnel module
(c) 2010-2014 Torstein Honsi
License: www.highcharts.com/license
*/
(function(b){var d=b.getOptions(),v=d.plotOptions,q=b.seriesTypes,E=b.merge,D=function(){},A=b.each;v.funnel=E(v.pie,{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}});q.funnel=b.extendClass(q.pie,{type:"funnel",animate:D,singularTooltips:!0,translate:function(){var a=function(j,a){return/%$/.test(j)?a*parseInt(j,
10)/100:parseInt(j,10)},B=0,f=this.chart,c=this.options,g=c.reversed,b=f.plotWidth,n=f.plotHeight,o=0,f=c.center,h=a(f[0],b),d=a(f[1],n),q=a(c.width,b),k,r,e=a(c.height,n),s=a(c.neckWidth,b),t=a(c.neckHeight,n),w=e-t,a=this.data,x,y,v=c.dataLabels.position==="left"?1:0,z,l,C,p,i,u,m;this.getWidthAt=r=function(j){return j>e-t||e===t?s:s+(q-s)*((e-t-j)/(e-t))};this.getX=function(j,a){return h+(a?-1:1)*(r(g?n-j:j)/2+c.dataLabels.distance)};this.center=[h,d,e];this.centerX=h;A(a,function(a){B+=a.y});
A(a,function(a){m=null;y=B?a.y/B:0;l=d-e/2+o*e;i=l+y*e;k=r(l);z=h-k/2;C=z+k;k=r(i);p=h-k/2;u=p+k;l>w?(z=p=h-s/2,C=u=h+s/2):i>w&&(m=i,k=r(w),p=h-k/2,u=p+k,i=w);g&&(l=e-l,i=e-i,m=m?e-m:null);x=["M",z,l,"L",C,l,u,i];m&&x.push(u,m,p,m);x.push(p,i,"Z");a.shapeType="path";a.shapeArgs={d:x};a.percentage=y*100;a.plotX=h;a.plotY=(l+(m||i))/2;a.tooltipPos=[h,a.plotY];a.slice=D;a.half=v;o+=y})},drawPoints:function(){var a=this,b=a.options,f=a.chart.renderer;A(a.data,function(c){var g=c.graphic,d=c.shapeArgs;
g?g.animate(d):c.graphic=f.path(d).attr({fill:c.color,stroke:b.borderColor,"stroke-width":b.borderWidth}).add(a.group)})},sortByAngle:function(a){a.sort(function(a,b){return a.plotY-b.plotY})},drawDataLabels:function(){var a=this.data,b=this.options.dataLabels.distance,f,c,g,d=a.length,n,o;for(this.center[2]-=2*b;d--;)g=a[d],c=(f=g.half)?1:-1,o=g.plotY,n=this.getX(o,f),g.labelPos=[0,o,n+(b-5)*c,o,n+b*c,o,f?"right":"left",0];q.pie.prototype.drawDataLabels.call(this)}});d.plotOptions.pyramid=b.merge(d.plotOptions.funnel,
{neckWidth:"0%",neckHeight:"0%",reversed:!0});b.seriesTypes.pyramid=b.extendClass(b.seriesTypes.funnel,{type:"pyramid"})})(Highcharts);
| chuycepeda/polymer-elements | my_elements/highcharts-element/Highcharts-4.0.4/exporting-server/phantomjs/funnel.js | JavaScript | mit | 2,271 |
({"dateFormatItem-yM":"M/yyyy","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q yyyy","field-minute":"minut","eraNames":["aC","dC"],"dateFormatItem-MMMEd":"E MMM d","field-weekday":"dia de la setmana","dateFormatItem-yQQQ":"QQQ yyyy","days-standAlone-wide":["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],"dateFormatItem-MMM":"LLL","patternChars":"GuMtkHmsSEDFwWahKzUeygAZvcL","months-standAlone-narrow":["g","f","m","a","m","j","j","a","s","o","n","d"],"field-era":"era","field-hour":"hora","dateFormatItem-hhmm":"hh:mm a","quarters-standAlone-abbr":["1T","2T","3T","4T"],"dateFormatItem-y":"yyyy","timeFormat-full":"H:mm:ss v","months-standAlone-abbr":["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],"dateFormatItem-yMMM":"MMM yyyy","days-standAlone-narrow":["g","l","t","c","j","v","s"],"eraAbbr":["aC","dC"],"dateFormatItem-yyyyMM":"MM/yyyy","dateFormat-long":"d 'de' MMMM 'de' yyyy","timeFormat-medium":"H:mm:ss","field-zone":"zona","dateFormatItem-Hm":"H:mm","dateFormat-medium":"dd/MM/yyyy","quarters-standAlone-wide":["1r trimestre","2n trimestre","3r trimestre","4t trimestre"],"dateTimeFormat":"{1} {0}","dateFormatItem-yMMMM":"LLLL 'del' yyyy","dateFormatItem-ms":"mm:ss","field-year":"any","quarters-standAlone-narrow":["1","2","3","4"],"field-week":"setmana","months-standAlone-wide":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],"dateFormatItem-MMMMEd":"E d MMMM","dateFormatItem-MMMd":"MMM d","dateFormatItem-yyQ":"Q yy","timeFormat-long":"H:mm:ss z","months-format-abbr":["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],"timeFormat-short":"H:mm","field-month":"mes","dateFormatItem-MMMMd":"d MMMM","quarters-format-abbr":["1T","2T","3T","4T"],"days-format-abbr":["dg.","dl.","dt.","dc.","dj.","dv.","ds."],"pm":"PM","dateFormatItem-M":"L","dateFormatItem-mmss":"mm:ss","days-format-narrow":["g","l","t","c","j","v","s"],"field-second":"segon","field-day":"dia","dateFormatItem-MEd":"E d/M","months-format-narrow":["g","f","m","a","m","j","j","a","s","o","n","d"],"dateFormatItem-hhmmss":"hh:mm:ss a","am":"AM","days-standAlone-abbr":["dg","dl","dt","dc","dj","dv","ds"],"dateFormat-short":"dd/MM/yy","dateFormatItem-yMMMEd":"EEE d MMM yyyy","dateFormat-full":"EEEE d 'de' MMMM 'de' yyyy","dateFormatItem-Md":"d/M","dateFormatItem-yMEd":"E d/M/yyyy","months-format-wide":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],"dateFormatItem-d":"d","quarters-format-wide":["1r trimestre","2n trimestre","3r trimestre","4t trimestre"],"days-format-wide":["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],"eraNarrow":["aC","dC"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateTimeFormats-appendItem-Era":"{0} {1}","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","quarters-format-narrow":["1","2","3","4"],"dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}"}) | pombredanne/cdnjs | ajax/libs/dojo/1.3.0/cldr/nls/ca/gregorian.js | JavaScript | mit | 3,384 |
/**
* Select2 Georgian (Kartuli) translation.
*
* Author: Dimitri Kurashvili dimakura@gmail.com
*/
(function ($) {
"use strict";
$.fn.select2.locales['ka'] = {
formatNoMatches: function () { return "ვერ მოიძებნა"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; },
formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; },
formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; },
formatSearching: function () { return "ძებნა…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ka']);
})(jQuery);
| barcadictni/cdnjs | ajax/libs/select2/3.5.1/select2_locale_ka.js | JavaScript | mit | 1,078 |
YUI.add("event-flick",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="end",o="move",u="ownerDocument",a="minVelocity",f="minDistance",l="preventDefault",c="_fs",h="_fsh",p="_feh",d="_fmh",v="nodeType";e.Event.define("flick",{on:function(e,t,n){var s=e.on(r[i],this._onStart,this,e,t,n);t[h]=s},detach:function(e,t,n){var r=t[h],i=t[p];r&&(r.detach(),t[h]=null),i&&(i.detach(),t[p]=null)},processArgs:function(t){var n=t.length>3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"@VERSION@",{requires:["node-base","event-touch","event-synthetic"]});
| rlugojr/cdnjs | ajax/libs/yui/3.12.0/event-flick/event-flick-min.js | JavaScript | mit | 1,780 |
YUI.add("swf",function(e,t){function d(t,n,d){this._id=e.guid("yuiswf");var v=this._id,m=o.one(t),d=d||{},g=d.version||l,y=(g+"").split("."),b=r.isFlashVersionAtLeast(parseInt(y[0],10),parseInt(y[1],10),parseInt(y[2],10)),w=r.isFlashVersionAtLeast(8,0,0),E=w&&!b&&d.useExpressInstall,S=E?c:n,x="<object ",T,N,C="yId="+e.id+"&YUISwfId="+v+"&YUIBridgeCallback="+h+"&allowedDomain="+document.location.hostname;e.SWF._instances[v]=this;if(m&&(b||E)&&S){x+='id="'+v+'" ',s.ie?x+='classid="'+a+'" ':x+='type="'+f+'" data="'+u.html(S)+'" ',T="100%",N="100%",x+='width="'+T+'" height="'+N+'">',s.ie&&(x+='<param name="movie" value="'+u.html(S)+'"/>');for(var k in d.fixedAttributes)p.hasOwnProperty(k)&&(x+='<param name="'+u.html(k)+'" value="'+u.html(d.fixedAttributes[k])+'"/>');for(var L in d.flashVars){var A=d.flashVars[L];i.isString(A)&&(C+="&"+u.html(L)+"="+u.html(encodeURIComponent(A)))}C&&(x+='<param name="flashVars" value="'+C+'"/>'),x+="</object>",m.set("innerHTML",x),this._swf=o.one("#"+v)}else{var O={};O.type="wrongflashversion",this.publish("wrongflashversion",{fireOnce:!0}),this.fire("wrongflashversion",O)}}var n=e.Event,r=e.SWFDetect,i=e.Lang,s=e.UA,o=e.Node,u=e.Escape,a="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",f="application/x-shockwave-flash",l="10.0.22",c="http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random(),h="SWF.eventHandler",p={align:"",allowFullScreen:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",loop:"",menu:"",name:"",play:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};d._instances=d._instances||{},d.eventHandler=function(e,t){d._instances[e]._eventHandler(t)},d.prototype={_eventHandler:function(e){e.type==="swfReady"?(this.publish("swfReady",{fireOnce:!0}),this.fire("swfReady",e)):e.type!=="log"&&this.fire(e.type,e)},callSWF:function(e,t){return t||(t=[]),this._swf._node[e]?this._swf._node[e].apply(this._swf._node,t):null},toString:function(){return"SWF "+this._id}},e.augment(d,e.EventTarget),e.SWF=d},"@VERSION@",{requires:["event-custom","node","swfdetect","escape"]});
| ripple0328/cdnjs | ajax/libs/yui/3.10.2/swf/swf-min.js | JavaScript | mit | 2,087 |
YUI.add("text-wordbreak",function(e,t){var n=e.Text,r=n.Data.WordBreak,i=0,s=1,o=2,u=3,a=4,f=5,l=6,c=7,h=8,p=9,d=10,v=11,m=12,g=[new RegExp(r.aletter),new RegExp(r.midnumlet),new RegExp(r.midletter),new RegExp(r.midnum),new RegExp(r.numeric),new RegExp(r.cr),new RegExp(r.lf),new RegExp(r.newline),new RegExp(r.extend),new RegExp(r.format),new RegExp(r.katakana),new RegExp(r.extendnumlet)],y="",b=new RegExp("^"+r.punctuation+"$"),w=/\s/,E={getWords:function(e,t){var n=0,r=E._classify(e),i=r.length,s=[],o=[],u,a,f;t||(t={}),t.ignoreCase&&(e=e.toLowerCase()),a=t.includePunctuation,f=t.includeWhitespace;for(;n<i;++n)u=e.charAt(n),s.push(u),E._isWordBoundary(r,n)&&(s=s.join(y),s&&(f||!w.test(s))&&(a||!b.test(s))&&o.push(s),s=[]);return o},getUniqueWords:function(t,n){return e.Array.unique(E.getWords(t,n))},isWordBoundary:function(e,t){return E._isWordBoundary(E._classify(e),t)},_classify:function(e){var t,n=[],r=0,i,s,o=e.length,u=g.length,a;for(;r<o;++r){t=e.charAt(r),a=m;for(i=0;i<u;++i){s=g[i];if(s&&s.test(t)){a=i;break}}n.push(a)}return n},_isWordBoundary:function(e,t){var n,r=e[t],m=e[t+1],g;return t<0||t>e.length-1&&t!==0?!1:r===i&&m===i?!1:(g=e[t+2],r!==i||m!==o&&m!==s||g!==i?(n=e[t-1],r!==o&&r!==s||m!==i||n!==i?r!==a&&r!==i||m!==a&&m!==i?r!==u&&r!==s||m!==a||n!==a?r!==a||m!==u&&m!==s||g!==a?r===h||r===p||n===h||n===p||m===h||m===p?!1:r===f&&m===l?!1:r===c||r===f||r===l?!0:m===c||m===f||m===l?!0:r===d&&m===d?!1:m!==v||r!==i&&r!==a&&r!==d&&r!==v?r!==v||m!==i&&m!==a&&m!==d?!0:!1:!1:!1:!1:!1:!1):!1)}};n.WordBreak=E},"@VERSION@",{requires:["array-extras","text-data-wordbreak"]});
| andyinabox/cdnjs | ajax/libs/yui/3.8.0/text-wordbreak/text-wordbreak-min.js | JavaScript | mit | 1,604 |
YUI.add("slider-base",function(e,t){function r(){r.superclass.constructor.apply(this,arguments)}var n=e.Attribute.INVALID_VALUE;e.SliderBase=e.extend(r,e.Widget,{initializer:function(){this.axis=this.get("axis"),this._key={dim:this.axis==="y"?"height":"width",minEdge:this.axis==="y"?"top":"left",maxEdge:this.axis==="y"?"bottom":"right",xyIndex:this.axis==="y"?1:0},this.publish("thumbMove",{defaultFn:this._defThumbMoveFn,queuable:!0})},renderUI:function(){var e=this.get("contentBox");this.rail=this.renderRail(),this._uiSetRailLength(this.get("length")),this.thumb=this.renderThumb(),this.rail.appendChild(this.thumb),e.appendChild(this.rail),e.addClass(this.getClassName(this.axis))},renderRail:function(){var t=this.getClassName("rail","cap",this._key.minEdge),n=this.getClassName("rail","cap",this._key.maxEdge);return e.Node.create(e.Lang.sub(this.RAIL_TEMPLATE,{railClass:this.getClassName("rail"),railMinCapClass:t,railMaxCapClass:n}))},_uiSetRailLength:function(e){this.rail.setStyle(this._key.dim,e)},renderThumb:function(){this._initThumbUrl();var t=this.get("thumbUrl");return e.Node.create(e.Lang.sub(this.THUMB_TEMPLATE,{thumbClass:this.getClassName("thumb"),thumbShadowClass:this.getClassName("thumb","shadow"),thumbImageClass:this.getClassName("thumb","image"),thumbShadowUrl:t,thumbImageUrl:t,thumbAriaLabelId:this.getClassName("label",e.guid())}))},_onThumbClick:function(e){this.thumb.focus()},bindUI:function(){var t=this.get("boundingBox"),n=e.UA.opera?"press:":"down:",r=n+"38,40,33,34,35,36",i=n+"37,39",s=n+"37+meta,39+meta";t.on("key",this._onDirectionKey,r,this),t.on("key",this._onLeftRightKey,i,this),t.on("key",this._onLeftRightKeyMeta,s,this),this.thumb.on("click",this._onThumbClick,this),this._bindThumbDD(),this._bindValueLogic(),this.after("disabledChange",this._afterDisabledChange),this.after("lengthChange",this._afterLengthChange)},_incrMinor:function(){this.set("value",this.get("value")+this.get("minorStep"))},_decrMinor:function(){this.set("value",this.get("value")-this.get("minorStep"))},_incrMajor:function(){this.set("value",this.get("value")+this.get("majorStep"))},_decrMajor:function(){this.set("value",this.get("value")-this.get("majorStep"))},_setToMin:function(e){this.set("value",this.get("min"))},_setToMax:function(e){this.set("value",this.get("max"))},_onDirectionKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 38:this._incrMinor();break;case 40:this._decrMinor();break;case 36:this._setToMin();break;case 35:this._setToMax();break;case 33:this._incrMajor();break;case 34:this._decrMajor()}},_onLeftRightKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._decrMinor();break;case 39:this._incrMinor()}},_onLeftRightKeyMeta:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._setToMin();break;case 39:this._setToMax()}},_bindThumbDD:function(){var t={constrain:this.rail};t["stick"+this.axis.toUpperCase()]=!0,this._dd=new e.DD.Drag({node:this.thumb,bubble:!1,on:{"drag:start":e.bind(this._onDragStart,this)},after:{"drag:drag":e.bind(this._afterDrag,this),"drag:end":e.bind(this._afterDragEnd,this)}}),this._dd.plug(e.Plugin.DDConstrained,t)},_bindValueLogic:function(){},_uiMoveThumb:function(e,t){this.thumb&&(this.thumb.setStyle(this._key.minEdge,e+"px"),t||(t={}),t.offset=e,this.fire("thumbMove",t))},_onDragStart:function(e){this.fire("slideStart",{ddEvent:e,originEvent:e})},_afterDrag:function(e){var t=e.info.xy[this._key.xyIndex],n=e.target.con._regionCache[this._key.minEdge];this.fire("thumbMove",{offset:t-n,ddEvent:e,originEvent:e})},_afterDragEnd:function(e){this.fire("slideEnd",{ddEvent:e,originEvent:e})},_afterDisabledChange:function(e){this._dd.set("lock",e.newVal)},_afterLengthChange:function(e){this.get("rendered")&&(this._uiSetRailLength(e.newVal),this.syncUI())},syncUI:function(){this._dd.con.resetCache(),this._syncThumbPosition(),this.thumb.set("aria-valuemin",this.get("min")),this.thumb.set("aria-valuemax",this.get("max")),this._dd.set("lock",this.get("disabled"))},_syncThumbPosition:function(){},_setAxis:function(e){return e=(e+"").toLowerCase(),e==="x"||e==="y"?e:n},_setLength:function(e){e=(e+"").toLowerCase();var t=parseFloat(e,10),r=e.replace(/[\d\.\-]/g,"")||this.DEF_UNIT;return t>0?t+r:n},_initThumbUrl:function(){if(!this.get("thumbUrl")){var t=this.getSkinName()||"sam",n=e.config.base;n.indexOf("http://yui.yahooapis.com/combo")===0&&(n="http://yui.yahooapis.com/"+e.version+"/build/"),this.set("thumbUrl",n+"slider-base/assets/skins/"+t+"/thumb-"+this.axis+".png")}},BOUNDING_TEMPLATE:"<span></span>",CONTENT_TEMPLATE:"<span></span>",RAIL_TEMPLATE:'<span class="{railClass}"><span class="{railMinCapClass}"></span><span class="{railMaxCapClass}"></span></span>',THUMB_TEMPLATE:'<span class="{thumbClass}" aria-labelledby="{thumbAriaLabelId}" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0"><img src="{thumbShadowUrl}" alt="Slider thumb shadow" class="{thumbShadowClass}"><img src="{thumbImageUrl}" alt="Slider thumb" class="{thumbImageClass}"></span>'},{NAME:"sliderBase",ATTRS:{axis:{value:"x",writeOnce:!0,setter:"_setAxis",lazyAdd:!1},length:{value:"150px",setter:"_setLength"},thumbUrl:{value:null,validator:e.Lang.isString}}})},"@VERSION@",{requires:["widget","dd-constrain","event-key"],skinnable:!0});
| paleozogt/cdnjs | ajax/libs/yui/3.10.0pr1/slider-base/slider-base-min.js | JavaScript | mit | 5,389 |
YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"@VERSION@",{requires:["dom-screen","node-base"]});
| hikaMaeng/cdnjs | ajax/libs/yui/3.9.1/node-screen/node-screen-min.js | JavaScript | mit | 1,644 |
YUI.add("file-flash",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_swfEventHandler:function(e){if(e.id===this.get("id"))switch(e.type){case"uploadstart":this.fire("uploadstart",{uploader:this.get("uploader")});break;case"uploadprogress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,percentLoaded:Math.min(100,Math.round(1e4*e.bytesLoaded/e.bytesTotal)/100)}),this._set("bytesUploaded",e.bytesLoaded);break;case"uploadcomplete":this.fire("uploadfinished",{originEvent:e});break;case"uploadcompletedata":this.fire("uploadcomplete",{originEvent:e,data:e.data});break;case"uploadcancel":this.fire("uploadcancel",{originEvent:e});break;case"uploaderror":this.fire("uploaderror",{originEvent:e,status:e.status,statusText:e.message,source:e.source})}},startUpload:function(e,t,n){if(this.get("uploader")){var r=this.get("uploader"),i=n||"Filedata",s=this.get("id"),o=t||null;this._set("bytesUploaded",0),r.on("uploadstart",this._swfEventHandler,this),r.on("uploadprogress",this._swfEventHandler,this),r.on("uploadcomplete",this._swfEventHandler,this),r.on("uploadcompletedata",this._swfEventHandler,this),r.on("uploaderror",this._swfEventHandler,this),r.callSWF("upload",[s,e,o,i])}},cancelUpload:function(){this.get("uploader")&&(this.get("uploader").callSWF("cancel",[this.get("id")]),this.fire("uploadcancel"))}},{NAME:"file",TYPE:"flash",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},uploader:{writeOnce:"initOnly",value:null}}}),e.FileFlash=n},"@VERSION@",{requires:["base"]});
| algolia/cdnjs | ajax/libs/yui/3.10.0/file-flash/file-flash-min.js | JavaScript | mit | 1,890 |
YUI.add("file-flash",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_swfEventHandler:function(e){if(e.id===this.get("id"))switch(e.type){case"uploadstart":this.fire("uploadstart",{uploader:this.get("uploader")});break;case"uploadprogress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,percentLoaded:Math.min(100,Math.round(1e4*e.bytesLoaded/e.bytesTotal)/100)}),this._set("bytesUploaded",e.bytesLoaded);break;case"uploadcomplete":this.fire("uploadfinished",{originEvent:e});break;case"uploadcompletedata":this.fire("uploadcomplete",{originEvent:e,data:e.data});break;case"uploadcancel":this.fire("uploadcancel",{originEvent:e});break;case"uploaderror":this.fire("uploaderror",{originEvent:e,status:e.status,statusText:e.message,source:e.source})}},startUpload:function(e,t,n){if(this.get("uploader")){var r=this.get("uploader"),i=n||"Filedata",s=this.get("id"),o=t||null;this._set("bytesUploaded",0),r.on("uploadstart",this._swfEventHandler,this),r.on("uploadprogress",this._swfEventHandler,this),r.on("uploadcomplete",this._swfEventHandler,this),r.on("uploadcompletedata",this._swfEventHandler,this),r.on("uploaderror",this._swfEventHandler,this),r.callSWF("upload",[s,e,o,i])}},cancelUpload:function(){this.get("uploader")&&(this.get("uploader").callSWF("cancel",[this.get("id")]),this.fire("uploadcancel"))}},{NAME:"file",TYPE:"flash",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},uploader:{writeOnce:"initOnly",value:null}}}),e.FileFlash=n},"@VERSION@",{requires:["base"]});
| thejsj/cdnjs | ajax/libs/yui/3.9.0/file-flash/file-flash-min.js | JavaScript | mit | 1,890 |
YUI.add("recordset-sort",function(e,t){function i(e,t,n){i.superclass.constructor.apply(this,arguments)}var n=e.ArraySort.compare,r=e.Lang.isValue;e.mix(i,{NS:"sort",NAME:"recordsetSort",ATTRS:{lastSortProperties:{value:{field:undefined,desc:!0,sorter:undefined},validator:function(e){return r(e.field)&&r(e.desc)&&r(e.sorter)}},defaultSorter:{value:function(e,t,r,i){var s=n(e.getValue(r),t.getValue(r),i);return s===0?n(e.get("id"),t.get("id"),i):s}},isSorted:{value:!1}}}),e.extend(i,e.Plugin.Base,{initializer:function(t){var n=this,r=this.get("host");this.publish("sort",{defaultFn:e.bind("_defSortFn",this)}),this.on("sort",function(){n.set("isSorted",!0)}),this.onHostEvent("add",function(){n.set("isSorted",!1)},r),this.onHostEvent("update",function(){n.set("isSorted",!1)},r)},destructor:function(e){},_defSortFn:function(e){this.get("host")._items.sort(function(t,n){return e.sorter(t,n,e.field,e.desc)}),this.set("lastSortProperties",e)},sort:function(e,t,n){this.fire("sort",{field:e,desc:t,sorter:n||this.get("defaultSorter")})},resort:function(){var e=this.get("lastSortProperties");this.fire("sort",{field:e.field,desc:e.desc,sorter:e.sorter||this.get("defaultSorter")})},reverse:function(){this.get("host")._items.reverse()},flip:function(){var e=this.get("lastSortProperties");r(e.field)&&this.fire("sort",{field:e.field,desc:!e.desc,sorter:e.sorter||this.get("defaultSorter")})}}),e.namespace("Plugin").RecordsetSort=i},"@VERSION@",{requires:["arraysort","recordset-base","plugin"]});
| emmansun/cdnjs | ajax/libs/yui/3.9.0pr3/recordset-sort/recordset-sort-min.js | JavaScript | mit | 1,503 |
YUI.add("widget-uievents",function(e,t){var n="boundingBox",r=e.Widget,i="render",s=e.Lang,o=":",u=e.Widget._uievts=e.Widget._uievts||{};e.mix(r.prototype,{_destroyUIEvents:function(){var t=e.stamp(this,!0);e.each(u,function(n,r){n.instances[t]&&(delete n.instances[t],e.Object.isEmpty(n.instances)&&(n.handle.detach(),u[r]&&delete u[r]))})},UI_EVENTS:e.Node.DOM_EVENTS,_getUIEventNode:function(){return this.get(n)},_createUIEvent:function(t){var n=this._getUIEventNode(),i=e.stamp(n)+t,s=u[i],o;s||(o=n.delegate(t,function(e){var t=r.getByNode(this);t&&t._filterUIEvent(e)&&t.fire(e.type,{domEvent:e})},"."+e.Widget.getClassName()),u[i]=s={instances:{},handle:o}),s.instances[e.stamp(this)]=1},_filterUIEvent:function(e){return e.currentTarget.compareTo(e.container)||e.container.compareTo(this._getUIEventNode())},_getUIEvent:function(e){if(s.isString(e)){var t=this.parseType(e)[1],n,r;return t&&(n=t.indexOf(o),n>-1&&(t=t.substring(n+o.length)),this.UI_EVENTS[t]&&(r=t)),r}},_initUIEvent:function(e){var t=this._getUIEvent(e),n=this._uiEvtsInitQueue||{};t&&!n[t]&&(this._uiEvtsInitQueue=n[t]=1,this.after(i,function(){this._createUIEvent(t),delete this._uiEvtsInitQueue[t]}))},on:function(e){return this._initUIEvent(e),r.superclass.on.apply(this,arguments)},publish:function(e,t){var n=this._getUIEvent(e);return n&&t&&t.defaultFn&&this._initUIEvent(n),r.superclass.publish.apply(this,arguments)}},!0)},"@VERSION@",{requires:["node-event-delegate","widget-base"]});
| hpneo/cdnjs | ajax/libs/yui/3.8.1/widget-uievents/widget-uievents-min.js | JavaScript | mit | 1,472 |
YUI.add("autocomplete-filters",function(e,t){var n=e.Array,r=e.Object,i=e.Text.WordBreak,s=e.mix(e.namespace("AutoCompleteFilters"),{charMatch:function(e,t,r){if(!e)return t;var i=n.unique((r?e:e.toLowerCase()).split(""));return n.filter(t,function(e){return e=e.text,r||(e=e.toLowerCase()),n.every(i,function(t){return e.indexOf(t)!==-1})})},charMatchCase:function(e,t){return s.charMatch(e,t,!0)},phraseMatch:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)!==-1})):t},phraseMatchCase:function(e,t){return s.phraseMatch(e,t,!0)},startsWith:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)===0})):t},startsWithCase:function(e,t){return s.startsWith(e,t,!0)},subWordMatch:function(e,t,r){if(!e)return t;var s=i.getUniqueWords(e,{ignoreCase:!r});return n.filter(t,function(e){var t=r?e.text:e.text.toLowerCase();return n.every(s,function(e){return t.indexOf(e)!==-1})})},subWordMatchCase:function(e,t){return s.subWordMatch(e,t,!0)},wordMatch:function(e,t,s){if(!e)return t;var o={ignoreCase:!s},u=i.getUniqueWords(e,o);return n.filter(t,function(e){var t=n.hash(i.getUniqueWords(e.text,o));return n.every(u,function(e){return r.owns(t,e)})})},wordMatchCase:function(e,t){return s.wordMatch(e,t,!0)}})},"@VERSION@",{requires:["array-extras","text-wordbreak"]});
| warpech/cdnjs | ajax/libs/yui/3.9.0/autocomplete-filters/autocomplete-filters-min.js | JavaScript | mit | 1,405 |
YUI.add("datasource-get",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.DataSource.Get=e.extend(n,e.DataSource.Local,{_defRequestFn:function(t){var n=this.get("source"),r=this.get("get"),i=e.guid().replace(/\-/g,"_"),s=this.get("generateRequestCallback"),o=t.details[0],u=this;return this._last=i,YUI.Env.DataSource.callbacks[i]=function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId];var r=u.get("asyncMode")!=="ignoreStaleResponses"||u._last===i;r&&(o.data=n,u.fire("data",o))},n+=t.request+s.call(this,i),e.DataSource.Local.transactions[t.tId]=r.script(n,{autopurge:!0,onFailure:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data failure"),u.fire("data",o)},onTimeout:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data timeout"),u.fire("data",o)}}),t.tId},_generateRequest:function(e){return"&"+this.get("scriptCallbackParam")+"=YUI.Env.DataSource.callbacks."+e}},{NAME:"dataSourceGet",ATTRS:{get:{value:e.Get,cloneDefaultValue:!1},asyncMode:{value:"allowAll"},scriptCallbackParam:{value:"callback"},generateRequestCallback:{value:function(){return this._generateRequest.apply(this,arguments)}}}}),YUI.namespace("Env.DataSource.callbacks")},"@VERSION@",{requires:["datasource-local","get"]});
| nouveller/cdnjs | ajax/libs/yui/3.7.0/datasource-get/datasource-get-min.js | JavaScript | mit | 1,449 |
YUI.add("history-hash-ie",function(e,t){if(e.UA.ie&&!e.HistoryBase.nativeHashChange){var n=e.Do,r=YUI.namespace("Env.HistoryHash"),i=e.HistoryHash,s=r._iframe,o=e.config.win;i.getIframeHash=function(){if(!s||!s.contentWindow)return"";var e=i.hashPrefix,t=s.contentWindow.location.hash.substr(1);return e&&t.indexOf(e)===0?t.replace(e,""):t},i._updateIframe=function(e,t){var n=s&&s.contentWindow&&s.contentWindow.document,r=n&&n.location;if(!n||!r)return;t?r.replace(e.charAt(0)==="#"?e:"#"+e):(n.open().close(),r.hash=e)},n.before(i._updateIframe,i,"replaceHash",i,!0),s||e.on("domready",function(){var t=i.getHash();s=r._iframe=e.Node.getDOMNode(e.Node.create('<iframe src="javascript:0" style="display:none" height="0" width="0" tabindex="-1" title="empty"/>')),e.config.doc.documentElement.appendChild(s),i._updateIframe(t||"#"),e.on("hashchange",function(e){t=e.newHash,i.getIframeHash()!==t&&i._updateIframe(t)},o),e.later(50,null,function(){var e=i.getIframeHash();e!==t&&i.setHash(e)},null,!0)})}},"@VERSION@",{requires:["history-hash","node-base"]});
| pc035860/cdnjs | ajax/libs/yui/3.12.0/history-hash-ie/history-hash-ie-min.js | JavaScript | mit | 1,060 |
YUI.add('dump', function (Y, NAME) {
/**
* Returns a simple string representation of the object or array.
* Other types of objects will be returned unprocessed. Arrays
* are expected to be indexed. Use object notation for
* associative arrays.
*
* If included, the dump method is added to the YUI instance.
*
* @module dump
*/
var L = Y.Lang,
OBJ = '{...}',
FUN = 'f(){...}',
COMMA = ', ',
ARROW = ' => ',
/**
* Returns a simple string representation of the object or array.
* Other types of objects will be returned unprocessed. Arrays
* are expected to be indexed.
*
* @method dump
* @param {Object} o The object to dump.
* @param {Number} d How deep to recurse child objects, default 3.
* @return {String} the dump result.
* @for YUI
*/
dump = function(o, d) {
var i, len, s = [], type = L.type(o);
// Cast non-objects to string
// Skip dates because the std toString is what we want
// Skip HTMLElement-like objects because trying to dump
// an element will cause an unhandled exception in FF 2.x
if (!L.isObject(o)) {
return o + '';
} else if (type == 'date') {
return o;
} else if (o.nodeType && o.tagName) {
return o.tagName + '#' + o.id;
} else if (o.document && o.navigator) {
return 'window';
} else if (o.location && o.body) {
return 'document';
} else if (type == 'function') {
return FUN;
}
// dig into child objects the depth specifed. Default 3
d = (L.isNumber(d)) ? d : 3;
// arrays [1, 2, 3]
if (type == 'array') {
s.push('[');
for (i = 0, len = o.length; i < len; i = i + 1) {
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
if (s.length > 1) {
s.pop();
}
s.push(']');
// regexp /foo/
} else if (type == 'regexp') {
s.push(o.toString());
// objects {k1 => v1, k2 => v2}
} else {
s.push('{');
for (i in o) {
if (o.hasOwnProperty(i)) {
try {
s.push(i + ARROW);
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
} catch (e) {
s.push('Error: ' + e.message);
}
}
}
if (s.length > 1) {
s.pop();
}
s.push('}');
}
return s.join('');
};
Y.dump = dump;
L.dump = dump;
}, '@VERSION@', {"requires": ["yui-base"]});
| fbender/cdnjs | ajax/libs/yui/3.14.0/dump/dump-debug.js | JavaScript | mit | 3,104 |
YUI.add('app-transitions', function (Y, NAME) {
/**
`Y.App` extension that provides view transitions in browsers which support
native CSS3 transitions.
@module app
@submodule app-transitions
@since 3.5.0
**/
/**
`Y.App` extension that provides view transitions in browsers which support
native CSS3 transitions.
View transitions provide an nice way to move from one "page" to the next that is
both pleasant to the user and helps to communicate a hierarchy between sections
of an application.
When the `"app-transitions"` module is used, it will automatically mix itself
into `Y.App` and transition between `activeView` changes using the following
effects:
- **`fade`**: Cross-fades between the old an new active views.
- **`slideLeft`**: The old and new active views are positioned next to each
other and both slide to the left.
- **`slideRight`**: The old and new active views are positioned next to each
other and both slide to the right.
**Note:** Transitions are an opt-in feature and are enabled via an app's
`transitions` attribute.
@class App.Transitions
@uses App.TransitionsNative
@extensionfor App
@since 3.5.0
**/
function AppTransitions() {}
AppTransitions.ATTRS = {
/**
Whether or not this application should use view transitions, and if so then
which ones or `true` for the defaults which are specified by the
`transitions` prototype property.
**Note:** Transitions are an opt-in feature and will only be used in
browsers which support native CSS3 transitions.
@attribute transitions
@type Boolean|Object
@default false
@since 3.5.0
**/
transitions: {
setter: '_setTransitions',
value : false
}
};
/**
Collect of transitions -> fx.
A transition (e.g. "fade") is a simple name given to a configuration of fx to
apply, consisting of `viewIn` and `viewOut` properties who's values are names of
fx registered on `Y.Transition.fx`.
By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.
@property FX
@type Object
@static
@since 3.5.0
**/
AppTransitions.FX = {
fade: {
viewIn : 'app:fadeIn',
viewOut: 'app:fadeOut'
},
slideLeft: {
viewIn : 'app:slideLeft',
viewOut: 'app:slideLeft'
},
slideRight: {
viewIn : 'app:slideRight',
viewOut: 'app:slideRight'
}
};
AppTransitions.prototype = {
// -- Public Properties ----------------------------------------------------
/**
Default transitions to use when the `activeView` changes.
The following are types of changes for which transitions can be defined that
correspond to the relationship between the new and previous `activeView`:
* `navigate`: The default transition to use when changing the `activeView`
of the application.
* `toChild`: The transition to use when the new `activeView` is configured
as a child of the previously active view via its `parent` property as
defined in this app's `views`.
* `toParent`: The transition to use when the new `activeView` is
configured as the `parent` of the previously active view as defined in
this app's `views`.
**Note:** Transitions are an opt-in feature and will only be used in
browsers which support native CSS3 transitions.
@property transitions
@type Object
@default
{
navigate: 'fade',
toChild : 'slideLeft',
toParent: 'slideRight'
}
@since 3.5.0
**/
transitions: {
navigate: 'fade',
toChild : 'slideLeft',
toParent: 'slideRight'
},
// -- Public Methods -------------------------------------------------------
/**
Sets which view is active/visible for the application. This will set the
app's `activeView` attribute to the specified `view`.
The `view` will be "attached" to this app, meaning it will be both rendered
into this app's `viewContainer` node and all of its events will bubble to
the app. The previous `activeView` will be "detached" from this app.
When a string-name is provided for a view which has been registered on this
app's `views` object, the referenced metadata will be used and the
`activeView` will be set to either a preserved view instance, or a new
instance of the registered view will be created using the specified `config`
object passed-into this method.
A callback function can be specified as either the third or fourth argument,
and this function will be called after the new `view` becomes the
`activeView`, is rendered to the `viewContainer`, and is ready to use.
@example
var app = new Y.App({
views: {
usersView: {
// Imagine that `Y.UsersView` has been defined.
type: Y.UsersView
}
},
transitions: true,
users : new Y.ModelList()
});
app.route('/users/', function () {
this.showView('usersView', {users: this.get('users')});
});
app.render();
app.navigate('/uses/');
// => Creates a new `Y.UsersView` and transitions to it.
@method showView
@param {String|View} view The name of a view defined in the `views` object,
or a view instance which should become this app's `activeView`.
@param {Object} [config] Optional configuration to use when creating a new
view instance. This config object can also be used to update an existing
or preserved view's attributes when `options.update` is `true`.
@param {Object} [options] Optional object containing any of the following
properties:
@param {Function} [options.callback] Optional callback function to call
after new `activeView` is ready to use, the function will be passed:
@param {View} options.callback.view A reference to the new
`activeView`.
@param {Boolean} [options.prepend=false] Whether the `view` should be
prepended instead of appended to the `viewContainer`.
@param {Boolean} [options.render] Whether the `view` should be rendered.
**Note:** If no value is specified, a view instance will only be
rendered if it's newly created by this method.
@param {Boolean|String} [options.transition] Optional transition override.
A transition can be specified which will override the default, or
`false` for no transition.
@param {Boolean} [options.update=false] Whether an existing view should
have its attributes updated by passing the `config` object to its
`setAttrs()` method. **Note:** This option does not have an effect if
the `view` instance is created as a result of calling this method.
@param {Function} [callback] Optional callback Function to call after the
new `activeView` is ready to use. **Note:** this will override
`options.callback` and it can be specified as either the third or fourth
argument. The function will be passed the following:
@param {View} callback.view A reference to the new `activeView`.
@chainable
@since 3.5.0
**/
// Does not override `showView()` but does use `options.transitions`.
// -- Protected Methods ----------------------------------------------------
/**
Setter for `transitions` attribute.
When specified as `true`, the defaults will be use as specified by the
`transitions` prototype property.
@method _setTransitions
@param {Boolean|Object} transitions The new `transitions` attribute value.
@return {Mixed} The processed value which represents the new state.
@protected
@see App.Base.showView()
@since 3.5.0
**/
_setTransitions: function (transitions) {
var defTransitions = this.transitions;
if (transitions && transitions === true) {
return Y.merge(defTransitions);
}
return transitions;
}
};
// -- Namespace ----------------------------------------------------------------
Y.App.Transitions = AppTransitions;
Y.Base.mix(Y.App, [AppTransitions]);
Y.mix(Y.App.CLASS_NAMES, {
transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')
});
}, '@VERSION@', {"requires": ["app-base"]});
| schoren/cdnjs | ajax/libs/yui/3.7.0pr2/app-transitions/app-transitions-debug.js | JavaScript | mit | 8,337 |
//
// RACSubscriberExamples.m
// ReactiveCocoa
//
// Created by Justin Spahr-Summers on 2012-11-27.
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import "RACSubscriberExamples.h"
#import "NSObject+RACDeallocating.h"
#import "RACCompoundDisposable.h"
#import "RACDisposable.h"
#import "RACSubject.h"
#import "RACSubscriber.h"
NSString * const RACSubscriberExamples = @"RACSubscriberExamples";
NSString * const RACSubscriberExampleSubscriber = @"RACSubscriberExampleSubscriber";
NSString * const RACSubscriberExampleValuesReceivedBlock = @"RACSubscriberExampleValuesReceivedBlock";
NSString * const RACSubscriberExampleErrorReceivedBlock = @"RACSubscriberExampleErrorReceivedBlock";
NSString * const RACSubscriberExampleSuccessBlock = @"RACSubscriberExampleSuccessBlock";
QuickConfigurationBegin(RACSubscriberExampleGroups)
+ (void)configure:(Configuration *)configuration {
sharedExamples(RACSubscriberExamples, ^(QCKDSLSharedExampleContext exampleContext) {
__block NSArray * (^valuesReceived)(void);
__block NSError * (^errorReceived)(void);
__block BOOL (^success)(void);
__block id<RACSubscriber> subscriber;
qck_beforeEach(^{
valuesReceived = exampleContext()[RACSubscriberExampleValuesReceivedBlock];
errorReceived = exampleContext()[RACSubscriberExampleErrorReceivedBlock];
success = exampleContext()[RACSubscriberExampleSuccessBlock];
subscriber = exampleContext()[RACSubscriberExampleSubscriber];
expect(subscriber).notTo(beNil());
});
qck_it(@"should accept a nil error", ^{
[subscriber sendError:nil];
expect(@(success())).to(beFalsy());
expect(errorReceived()).to(beNil());
expect(valuesReceived()).to(equal(@[]));
});
qck_describe(@"with values", ^{
__block NSSet *values;
qck_beforeEach(^{
NSMutableSet *mutableValues = [NSMutableSet set];
for (NSUInteger i = 0; i < 20; i++) {
[mutableValues addObject:@(i)];
}
values = [mutableValues copy];
});
qck_it(@"should send nexts serially, even when delivered from multiple threads", ^{
NSArray *allValues = values.allObjects;
dispatch_apply(allValues.count, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [^(size_t index) {
[subscriber sendNext:allValues[index]];
} copy]);
expect(@(success())).to(beTruthy());
expect(errorReceived()).to(beNil());
NSSet *valuesReceivedSet = [NSSet setWithArray:valuesReceived()];
expect(valuesReceivedSet).to(equal(values));
});
});
qck_describe(@"multiple subscriptions", ^{
__block RACSubject *first;
__block RACSubject *second;
qck_beforeEach(^{
first = [RACSubject subject];
[first subscribe:subscriber];
second = [RACSubject subject];
[second subscribe:subscriber];
});
qck_it(@"should send values from all subscriptions", ^{
[first sendNext:@"foo"];
[second sendNext:@"bar"];
[first sendNext:@"buzz"];
[second sendNext:@"baz"];
expect(@(success())).to(beTruthy());
expect(errorReceived()).to(beNil());
NSArray *expected = @[ @"foo", @"bar", @"buzz", @"baz" ];
expect(valuesReceived()).to(equal(expected));
});
qck_it(@"should terminate after the first error from any subscription", ^{
NSError *error = [NSError errorWithDomain:@"" code:-1 userInfo:nil];
[first sendNext:@"foo"];
[second sendError:error];
[first sendNext:@"buzz"];
expect(@(success())).to(beFalsy());
expect(errorReceived()).to(equal(error));
NSArray *expected = @[ @"foo" ];
expect(valuesReceived()).to(equal(expected));
});
qck_it(@"should terminate after the first completed from any subscription", ^{
[first sendNext:@"foo"];
[second sendNext:@"bar"];
[first sendCompleted];
[second sendNext:@"baz"];
expect(@(success())).to(beTruthy());
expect(errorReceived()).to(beNil());
NSArray *expected = @[ @"foo", @"bar" ];
expect(valuesReceived()).to(equal(expected));
});
qck_it(@"should dispose of all current subscriptions upon termination", ^{
__block BOOL firstDisposed = NO;
RACSignal *firstDisposableSignal = [RACSignal createSignal:^(id<RACSubscriber> subscriber) {
return [RACDisposable disposableWithBlock:^{
firstDisposed = YES;
}];
}];
__block BOOL secondDisposed = NO;
RACSignal *secondDisposableSignal = [RACSignal createSignal:^(id<RACSubscriber> subscriber) {
return [RACDisposable disposableWithBlock:^{
secondDisposed = YES;
}];
}];
[firstDisposableSignal subscribe:subscriber];
[secondDisposableSignal subscribe:subscriber];
expect(@(firstDisposed)).to(beFalsy());
expect(@(secondDisposed)).to(beFalsy());
[first sendCompleted];
expect(@(firstDisposed)).to(beTruthy());
expect(@(secondDisposed)).to(beTruthy());
});
qck_it(@"should dispose of future subscriptions upon termination", ^{
__block BOOL disposed = NO;
RACSignal *disposableSignal = [RACSignal createSignal:^(id<RACSubscriber> subscriber) {
return [RACDisposable disposableWithBlock:^{
disposed = YES;
}];
}];
[first sendCompleted];
expect(@(disposed)).to(beFalsy());
[disposableSignal subscribe:subscriber];
expect(@(disposed)).to(beTruthy());
});
});
qck_describe(@"memory management", ^{
qck_it(@"should not retain disposed disposables", ^{
__block BOOL disposableDeallocd = NO;
@autoreleasepool {
RACCompoundDisposable *disposable __attribute__((objc_precise_lifetime)) = [RACCompoundDisposable disposableWithBlock:^{}];
[disposable.rac_deallocDisposable addDisposable:[RACDisposable disposableWithBlock:^{
disposableDeallocd = YES;
}]];
[subscriber didSubscribeWithDisposable:disposable];
[disposable dispose];
}
expect(@(disposableDeallocd)).to(beTruthy());
});
});
});
}
QuickConfigurationEnd
| nikita-leonov/ReactiveCocoa | ReactiveCocoaTests/Objective-C/RACSubscriberExamples.m | Matlab | mit | 5,926 |
/*!
* # Semantic UI 2.0.2 - Site
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin);body,html{height:100%}html{font-size:14px}body{margin:0;padding:0;overflow-x:hidden;min-width:320px;background:#fff;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:14px;line-height:1.4285em;color:rgba(0,0,0,.87);font-smoothing:antialiased}h1,h2,h3,h4,h5{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;line-height:1.2857em;margin:calc(2rem - .14285em) 0 1rem;font-weight:700;padding:0}h1{min-height:1rem;font-size:2rem}h2{font-size:1.714rem}h3{font-size:1.28rem}h4{font-size:1.071rem}h5{font-size:1rem}h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,p:first-child{margin-top:0}h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,p:last-child{margin-bottom:0}p{margin:0 0 1em;line-height:1.4285em}a{color:#4183c4;text-decoration:none}a:hover{color:#1e70bf;text-decoration:none}::-webkit-selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}::-moz-selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}input::-webkit-selection,textarea::-webkit-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::-moz-selection,textarea::-moz-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::selection,textarea::selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)} | keicheng/cdnjs | ajax/libs/semantic-ui/2.0.2/components/site.min.css | CSS | mit | 1,659 |
!function(e,a){if("function"==typeof define&&define.amd)define("element/locale/lt",["module","exports"],a);else if("undefined"!=typeof exports)a(module,exports);else{var t={exports:{}};a(t,t.exports),e.ELEMENT.lang=e.ELEMENT.lang||{},e.ELEMENT.lang.lt=t.exports}}(this,function(e,a){"use strict";a.__esModule=!0,a.default={el:{colorpicker:{confirm:"OK",clear:"Valyti"},datepicker:{now:"Dabar",today:"Šiandien",cancel:"Atšaukti",clear:"Valyti",confirm:"OK",selectDate:"Pasirink datą",selectTime:"Pasirink laiką",startDate:"Data nuo",startTime:"Laikas nuo",endDate:"Data iki",endTime:"Laikas iki",prevYear:"Metai atgal",nextYear:"Metai į priekį",prevMonth:"Mėn. atgal",nextMonth:"Mėn. į priekį",year:"",month1:"Sausis",month2:"Vasaris",month3:"Kovas",month4:"Balandis",month5:"Gegužė",month6:"Birželis",month7:"Liepa",month8:"Rugpjūtis",month9:"Rugsėjis",month10:"Spalis",month11:"Lapkritis",month12:"Gruodis",weeks:{sun:"S.",mon:"Pr.",tue:"A.",wed:"T.",thu:"K.",fri:"Pn.",sat:"Š."},months:{jan:"Sau",feb:"Vas",mar:"Kov",apr:"Bal",may:"Geg",jun:"Bir",jul:"Lie",aug:"Rugp",sep:"Rugs",oct:"Spa",nov:"Lap",dec:"Gruo"}},select:{loading:"Kraunasi",noMatch:"Duomenų nerasta",noData:"Nėra duomenų",placeholder:"Pasirink"},cascader:{noMatch:"Duomenų nerasta",loading:"Kraunasi",placeholder:"Pasirink"},pagination:{goto:"Eiti į",pagesize:"/p",total:"Viso {total}",pageClassifier:""},messagebox:{title:"Žinutė",confirm:"OK",cancel:"Atšaukti",error:"Klaida įvestuose duomenyse"},upload:{deleteTip:'spauskite "Trinti" norėdami pašalinti',delete:"Trinti",preview:"Peržiūrėti",continue:"Toliau"},table:{emptyText:"Duomenų nerasta",confirmFilter:"Patvirtinti",resetFilter:"Atstatyti",clearFilter:"Išvalyti",sumText:"Suma"},tree:{emptyText:"Nėra duomenų"},transfer:{noMatch:"Duomenų nerasta",noData:"Nėra duomenų",titles:["Sąrašas 1","Sąrašas 2"],filterPlaceholder:"Įvesk raktažodį",noCheckedFormat:"Viso: {total}",hasCheckedFormat:"Pažymėta {checked} iš {total}"}}},e.exports=a.default}); | ahocevar/cdnjs | ajax/libs/element-ui/2.4.0/locale/lt.min.js | JavaScript | mit | 2,018 |
(function(f,a,c,g,e){var h={};function b(i){return c.translate(i)||i}function d(i){i.html('<div class="plupload_wrapper"><div class="ui-widget-content plupload_container"><div class="plupload"><div class="ui-state-default ui-widget-header plupload_header"><div class="plupload_header_content"><div class="plupload_header_title">'+b("Select files")+'</div><div class="plupload_header_text">'+b("Add files to the upload queue and click the start button.")+'</div></div></div><div class="plupload_content"><table class="plupload_filelist"><tr class="ui-widget-header plupload_filelist_header"><td class="plupload_cell plupload_file_name">'+b("Filename")+'</td><td class="plupload_cell plupload_file_status">'+b("Status")+'</td><td class="plupload_cell plupload_file_size">'+b("Size")+'</td><td class="plupload_cell plupload_file_action"> </td></tr></table><div class="plupload_scroll"><table class="plupload_filelist_content"></table></div><table class="plupload_filelist"><tr class="ui-widget-header ui-widget-content plupload_filelist_footer"><td class="plupload_cell plupload_file_name"><div class="plupload_buttons"><!-- Visible --><a class="plupload_button plupload_add">'+b("Add Files")+'</a> <a class="plupload_button plupload_start">'+b("Start Upload")+'</a> <a class="plupload_button plupload_stop plupload_hidden">'+b("Stop Upload")+'</a> </div><div class="plupload_started plupload_hidden"><!-- Hidden --><div class="plupload_progress plupload_right"><div class="plupload_progress_container"></div></div><div class="plupload_cell plupload_upload_status"></div><div class="plupload_clearer"> </div></div></td><td class="plupload_file_status"><span class="plupload_total_status">0%</span></td><td class="plupload_file_size"><span class="plupload_total_file_size">0 kb</span></td><td class="plupload_file_action"></td></tr></table></div></div></div><input class="plupload_count" value="0" type="hidden"></div>')}g.widget("ui.plupload",{contents_bak:"",runtime:null,options:{browse_button_hover:"ui-state-hover",browse_button_active:"ui-state-active",dragdrop:true,multiple_queues:true,buttons:{browse:true,start:true,stop:true},autostart:false,sortable:false,rename:false,max_file_count:0},FILE_COUNT_ERROR:-9001,_create:function(){var i=this,k,j;k=this.element.attr("id");if(!k){k=c.guid();this.element.attr("id",k)}this.id=k;this.contents_bak=this.element.html();d(this.element);this.container=g(".plupload_container",this.element).attr("id",k+"_container");this.filelist=g(".plupload_filelist_content",this.container).attr("id",k+"_filelist");this.browse_button=g(".plupload_add",this.container).attr("id",k+"_browse");this.start_button=g(".plupload_start",this.container).attr("id",k+"_start");this.stop_button=g(".plupload_stop",this.container).attr("id",k+"_stop");if(g.ui.button){this.browse_button.button({icons:{primary:"ui-icon-circle-plus"}});this.start_button.button({icons:{primary:"ui-icon-circle-arrow-e"},disabled:true});this.stop_button.button({icons:{primary:"ui-icon-circle-close"}})}if(!this.options.buttons.browse){this.browse_button.button("disable").hide();g("#"+k+i.runtime+"_container").hide()}if(!this.options.buttons.start){this.start_button.button("disable").hide()}if(!this.options.buttons.stop){this.stop_button.button("disable").hide()}this.progressbar=g(".plupload_progress_container",this.container);if(g.ui.progressbar){this.progressbar.progressbar()}this.counter=g(".plupload_count",this.element).attr({id:k+"_count",name:k+"_count"});j=this.uploader=h[k]=new c.Uploader(g.extend({container:k,browse_button:k+"_browse"},this.options));j.bind("Init",function(l,m){if(!i.options.unique_names&&i.options.rename){i._enableRenaming()}if(j.features.dragdrop&&i.options.dragdrop){i._enableDragAndDrop()}i.container.attr("title",b("Using runtime: ")+(i.runtime=m.runtime));i.start_button.click(function(n){if(!g(this).button("option","disabled")){i.start()}n.preventDefault()});i.stop_button.click(function(n){j.stop();n.preventDefault()})});if(i.options.max_file_count){j.bind("FilesAdded",function(l,n){var m=n.length,o=[];if(m>i.options.max_file_count){o=n.splice(i.options.max_file_count);l.trigger("Error",{code:i.FILE_COUNT_ERROR,message:b("File count error."),file:o})}})}j.init();j.bind("FilesAdded",function(l,m){i._trigger("selected",null,{up:l,files:m});if(i.options.autostart){i.start()}});j.bind("FilesRemoved",function(l,m){i._trigger("removed",null,{up:l,files:m})});j.bind("QueueChanged",function(){i._updateFileList()});j.bind("StateChanged",function(){i._handleState()});j.bind("UploadFile",function(l,m){i._handleFileStatus(m)});j.bind("FileUploaded",function(l,m){i._handleFileStatus(m);i._trigger("uploaded",null,{up:l,file:m})});j.bind("UploadProgress",function(l,m){g("#"+m.id+" .plupload_file_status",i.element).html(m.percent+"%");i._handleFileStatus(m);i._updateTotalProgress();i._trigger("progress",null,{up:l,file:m})});j.bind("UploadComplete",function(l,m){i._trigger("complete",null,{up:l,files:m})});j.bind("Error",function(l,p){var n=p.file,o,m;if(n){o="<strong>"+p.message+"</strong>";m=p.details;if(m){o+=" <br /><i>"+p.details+"</i>"}else{switch(p.code){case c.FILE_EXTENSION_ERROR:m=b("File: %s").replace("%s",n.name);break;case c.FILE_SIZE_ERROR:m=b("File: %f, size: %s, max file size: %m").replace(/%([fsm])/g,function(r,q){switch(q){case"f":return n.name;case"s":return n.size;case"m":return c.parseSize(i.options.max_file_size)}});break;case i.FILE_COUNT_ERROR:m=b("Upload element accepts only %d file(s) at a time. Extra files were stripped.").replace("%d",i.options.max_file_count);break;case c.IMAGE_FORMAT_ERROR:m=c.translate("Image format either wrong or not supported.");break;case c.IMAGE_MEMORY_ERROR:m=c.translate("Runtime ran out of available memory.");break;case c.IMAGE_DIMENSIONS_ERROR:m=c.translate("Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.").replace(/%([swh])/g,function(r,q){switch(q){case"s":return l.runtime;case"w":return l.features.maxWidth;case"h":return l.features.maxHeight}});break;case c.HTTP_ERROR:m=b("Upload URL might be wrong or doesn't exist");break}o+=" <br /><i>"+m+"</i>"}i._notify("error",o);i._trigger("error",null,{up:l,file:n,error:o})}})},_setOption:function(j,k){var i=this;if(j=="buttons"&&typeof(k)=="object"){k=g.extend(i.options.buttons,k);if(!k.browse){i.browse_button.button("disable").hide();g("#"+i.id+i.runtime+"_container").hide()}else{i.browse_button.button("enable").show();g("#"+i.id+i.runtime+"_container").show()}if(!k.start){i.start_button.button("disable").hide()}else{i.start_button.button("enable").show()}if(!k.stop){i.stop_button.button("disable").hide()}else{i.start_button.button("enable").show()}}i.uploader.settings[j]=k},start:function(){this.uploader.start();this._trigger("start",null)},stop:function(){this.uploader.stop();this._trigger("stop",null)},getFile:function(j){var i;if(typeof j==="number"){i=this.uploader.files[j]}else{i=this.uploader.getFile(j)}return i},removeFile:function(j){var i=this.getFile(j);if(i){this.uploader.removeFile(i)}},clearQueue:function(){this.uploader.splice()},getUploader:function(){return this.uploader},refresh:function(){this.uploader.refresh()},_handleState:function(){var i=this,j=this.uploader;if(j.state===c.STARTED){g(i.start_button).button("disable");g([]).add(i.stop_button).add(".plupload_started").removeClass("plupload_hidden");g(".plupload_upload_status",i.element).text(b("Uploaded %d/%d files").replace("%d/%d",j.total.uploaded+"/"+j.files.length));g(".plupload_header_content",i.element).addClass("plupload_header_content_bw")}else{g([]).add(i.stop_button).add(".plupload_started").addClass("plupload_hidden");if(i.options.multiple_queues){g(i.start_button).button("enable");g(".plupload_header_content",i.element).removeClass("plupload_header_content_bw")}i._updateFileList()}},_handleFileStatus:function(l){var n,j;switch(l.status){case c.DONE:n="plupload_done";j="ui-icon ui-icon-circle-check";break;case c.FAILED:n="ui-state-error plupload_failed";j="ui-icon ui-icon-alert";break;case c.QUEUED:n="plupload_delete";j="ui-icon ui-icon-circle-minus";break;case c.UPLOADING:n="ui-state-highlight plupload_uploading";j="ui-icon ui-icon-circle-arrow-w";var i=g(".plupload_scroll",this.container),m=i.scrollTop(),o=i.height(),k=g("#"+l.id).position().top+g("#"+l.id).height();if(o<k){i.scrollTop(m+k-o)}break}n+=" ui-state-default plupload_file";g("#"+l.id).attr("class",n).find(".ui-icon").attr("class",j)},_updateTotalProgress:function(){var i=this.uploader;this.progressbar.progressbar("value",i.total.percent);g(".plupload_total_status",this.element).html(i.total.percent+"%");g(".plupload_upload_status",this.element).text(b("Uploaded %d/%d files").replace("%d/%d",i.total.uploaded+"/"+i.files.length))},_updateFileList:function(){var j=this,n=this.uploader,l=this.filelist,k=0,o,m=this.id+"_",i;if(g.ui.sortable&&this.options.sortable){g("tbody",l).sortable("destroy")}l.empty();g.each(n.files,function(q,p){i="";o=m+k;if(p.status===c.DONE){if(p.target_name){i+='<input type="hidden" name="'+o+'_tmpname" value="'+c.xmlEncode(p.target_name)+'" />'}i+='<input type="hidden" name="'+o+'_name" value="'+c.xmlEncode(p.name)+'" />';i+='<input type="hidden" name="'+o+'_status" value="'+(p.status===c.DONE?"done":"failed")+'" />';k++;j.counter.val(k)}l.append('<tr class="ui-state-default plupload_file" id="'+p.id+'"><td class="plupload_cell plupload_file_name"><span>'+p.name+'</span></td><td class="plupload_cell plupload_file_status">'+p.percent+'%</td><td class="plupload_cell plupload_file_size">'+c.formatSize(p.size)+'</td><td class="plupload_cell plupload_file_action"><div class="ui-icon"></div>'+i+"</td></tr>");j._handleFileStatus(p);g("#"+p.id+".plupload_delete .ui-icon, #"+p.id+".plupload_done .ui-icon").click(function(r){g("#"+p.id).remove();n.removeFile(p);r.preventDefault()});j._trigger("updatelist",null,l)});g(".plupload_total_file_size",j.element).html(c.formatSize(n.total.size));if(n.total.queued===0){g(".ui-button-text",j.browse_button).text(b("Add Files"))}else{g(".ui-button-text",j.browse_button).text(b("%d files queued").replace("%d",n.total.queued))}if(n.files.length===(n.total.uploaded+n.total.failed)){j.start_button.button("disable")}else{j.start_button.button("enable")}l[0].scrollTop=l[0].scrollHeight;j._updateTotalProgress();if(!n.files.length&&n.features.dragdrop&&n.settings.dragdrop){g("#"+o+"_filelist").append('<tr><td class="plupload_droptext">'+b("Drag files here.")+"</td></tr>")}else{if(j.options.sortable&&g.ui.sortable){j._enableSortingList()}}},_enableRenaming:function(){var i=this;g(".plupload_file_name span",this.filelist).live("click",function(o){var m=g(o.target),k,n,j,l="";k=i.uploader.getFile(m.parents("tr")[0].id);j=k.name;n=/^(.+)(\.[^.]+)$/.exec(j);if(n){j=n[1];l=n[2]}m.hide().after('<input class="plupload_file_rename" type="text" />');m.next().val(j).focus().blur(function(){m.show().next().remove()}).keydown(function(q){var p=g(this);if(g.inArray(q.keyCode,[13,27])!==-1){q.preventDefault();if(q.keyCode===13){k.name=p.val()+l;m.text(k.name)}p.blur()}})})},_enableDragAndDrop:function(){this.filelist.append('<tr><td class="plupload_droptext">'+b("Drag files here.")+"</td></tr>");this.filelist.parent().attr("id",this.id+"_dropbox");this.uploader.settings.drop_element=this.options.drop_element=this.id+"_dropbox"},_enableSortingList:function(){var j,i=this;if(g("tbody tr",this.filelist).length<2){return}g("tbody",this.filelist).sortable({containment:"parent",items:".plupload_delete",helper:function(l,k){return k.clone(true).find("td:not(.plupload_file_name)").remove().end().css("width","100%")},start:function(l,k){j=g("tr",this).index(k.item)},stop:function(q,p){var l,o,k,n=[],m=g("tr",this).index(p.item);for(l=0,o=i.uploader.files.length;l<o;l++){if(l===m){k=j}else{if(l===j){k=m}else{k=l}}n[n.length]=i.uploader.files[k]}n.unshift(n.length);n.unshift(0);Array.prototype.splice.apply(i.uploader.files,n)}})},_notify:function(j,k){var i=g('<div class="plupload_message"><span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+b("Close")+'"></span><p><span class="ui-icon"></span>'+k+"</p></div>");i.addClass("ui-state-"+(j==="error"?"error":"highlight")).find("p .ui-icon").addClass("ui-icon-"+(j==="error"?"alert":"info")).end().find(".plupload_message_close").click(function(){i.remove()}).end().appendTo(".plupload_header_content",this.container)},destroy:function(){g(".plupload_button",this.element).unbind();if(g.ui.button){g(".plupload_add, .plupload_start, .plupload_stop",this.container).button("destroy")}if(g.ui.progressbar){this.progressbar.progressbar("destroy")}if(g.ui.sortable&&this.options.sortable){g("tbody",this.filelist).sortable("destroy")}this.uploader.destroy();this.element.empty().html(this.contents_bak);this.contents_bak="";g.Widget.prototype.destroy.apply(this)}})}(window,document,plupload,jQuery)); | hpneo/cdnjs | ajax/libs/plupload/1.4.3.2/jquery.ui.plupload/jquery.ui.plupload.js | JavaScript | mit | 12,886 |
/*
AngularJS v1.2.15
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(Q,T,s){'use strict';function z(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.2.15/"+(b?b+"/":"")+a;for(c=1;c<arguments.length;c++)a=a+(1==c?"?":"&")+"p"+(c-1)+"="+encodeURIComponent("function"==typeof arguments[c]?arguments[c].toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof arguments[c]?"undefined":"string"!=typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c]);return Error(a)}}function $a(b){if(null==b||Aa(b))return!1;
var a=b.length;return 1===b.nodeType&&a?!0:x(b)||M(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function r(b,a,c){var d;if(b)if(D(b))for(d in b)"prototype"==d||("length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d))||a.call(c,b[d],d);else if(b.forEach&&b.forEach!==r)b.forEach(a,c);else if($a(b))for(d=0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function Ob(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function Qc(b,
a,c){for(var d=Ob(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function Pb(b){return function(a,c){b(c,a)}}function ab(){for(var b=ia.length,a;b;){b--;a=ia[b].charCodeAt(0);if(57==a)return ia[b]="A",ia.join("");if(90==a)ia[b]="0";else return ia[b]=String.fromCharCode(a+1),ia.join("")}ia.unshift("0");return ia.join("")}function Qb(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function v(b){var a=b.$$hashKey;r(arguments,function(a){a!==b&&r(a,function(a,c){b[c]=a})});Qb(b,a);return b}function R(b){return parseInt(b,
10)}function Rb(b,a){return v(new (v(function(){},{prototype:b})),a)}function B(){}function Ba(b){return b}function Y(b){return function(){return b}}function E(b){return"undefined"===typeof b}function u(b){return"undefined"!==typeof b}function W(b){return null!=b&&"object"===typeof b}function x(b){return"string"===typeof b}function ub(b){return"number"===typeof b}function Ma(b){return"[object Date]"===ta.call(b)}function M(b){return"[object Array]"===ta.call(b)}function D(b){return"function"===typeof b}
function bb(b){return"[object RegExp]"===ta.call(b)}function Aa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function Rc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Sc(b,a,c){var d=[];r(b,function(b,f,g){d.push(a.call(c,b,f,g))});return d}function cb(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Na(b,a){var c=cb(b,a);0<=c&&b.splice(c,1);return a}function $(b,a){if(Aa(b)||b&&b.$evalAsync&&b.$watch)throw Oa("cpws");
if(a){if(b===a)throw Oa("cpi");if(M(b))for(var c=a.length=0;c<b.length;c++)a.push($(b[c]));else{c=a.$$hashKey;r(a,function(b,c){delete a[c]});for(var d in b)a[d]=$(b[d]);Qb(a,c)}}else(a=b)&&(M(b)?a=$(b,[]):Ma(b)?a=new Date(b.getTime()):bb(b)?a=RegExp(b.source):W(b)&&(a=$(b,{})));return a}function Sb(b,a){a=a||{};for(var c in b)!b.hasOwnProperty(c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(a[c]=b[c]);return a}function ua(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;
var c=typeof b,d;if(c==typeof a&&"object"==c)if(M(b)){if(!M(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ua(b[d],a[d]))return!1;return!0}}else{if(Ma(b))return Ma(a)&&b.getTime()==a.getTime();if(bb(b)&&bb(a))return b.toString()==a.toString();if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||Aa(b)||Aa(a)||M(a))return!1;c={};for(d in b)if("$"!==d.charAt(0)&&!D(b[d])){if(!ua(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c.hasOwnProperty(d)&&"$"!==d.charAt(0)&&a[d]!==s&&!D(a[d]))return!1;
return!0}return!1}function Tb(){return T.securityPolicy&&T.securityPolicy.isActive||T.querySelector&&!(!T.querySelector("[ng-csp]")&&!T.querySelector("[data-ng-csp]"))}function db(b,a){var c=2<arguments.length?va.call(arguments,2):[];return!D(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,c.concat(va.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Tc(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)?c=
s:Aa(a)?c="$WINDOW":a&&T===a?c="$DOCUMENT":a&&(a.$evalAsync&&a.$watch)&&(c="$SCOPE");return c}function oa(b,a){return"undefined"===typeof b?s:JSON.stringify(b,Tc,a?" ":null)}function Ub(b){return x(b)?JSON.parse(b):b}function Pa(b){"function"===typeof b?b=!0:b&&0!==b.length?(b=O(""+b),b=!("f"==b||"0"==b||"false"==b||"no"==b||"n"==b||"[]"==b)):b=!1;return b}function fa(b){b=w(b).clone();try{b.empty()}catch(a){}var c=w("<div>").append(b).html();try{return 3===b[0].nodeType?O(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,
function(a,b){return"<"+O(b)})}catch(d){return O(c)}}function Vb(b){try{return decodeURIComponent(b)}catch(a){}}function Wb(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.split("="),d=Vb(c[0]),u(d)&&(b=u(c[1])?Vb(c[1]):!0,a[d]?M(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Xb(b){var a=[];r(b,function(b,d){M(b)?r(b,function(b){a.push(wa(d,!0)+(!0===b?"":"="+wa(b,!0)))}):a.push(wa(d,!0)+(!0===b?"":"="+wa(b,!0)))});return a.length?a.join("&"):""}function vb(b){return wa(b,
!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function wa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function Uc(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,g=["ng:app","ng-app","x-ng-app","data-ng-app"],h=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(g,function(a){g[a]=!0;c(T.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(r(b.querySelectorAll("."+a),c),r(b.querySelectorAll("."+
a+"\\:"),c),r(b.querySelectorAll("["+a+"]"),c))});r(d,function(a){if(!e){var b=h.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):r(a.attributes,function(b){!e&&g[b.name]&&(e=a,f=b.value)})}});e&&a(e,f?[f]:[])}function Yb(b,a){var c=function(){b=w(b);if(b.injector()){var c=b[0]===T?"document":fa(b);throw Oa("btstrpd",c);}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=Zb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",
function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(Q&&!d.test(Q.name))return c();Q.name=Q.name.replace(d,"");Ca.resumeBootstrap=function(b){r(b,function(b){a.push(b)});c()}}function eb(b,a){a=a||"_";return b.replace(Vc,function(b,d){return(d?a:"")+b.toLowerCase()})}function wb(b,a,c){if(!b)throw Oa("areq",a||"?",c||"required");return b}function Qa(b,a,c){c&&M(b)&&(b=b[b.length-1]);wb(D(b),a,"not a function, got "+(b&&"object"==typeof b?
b.constructor.name||"Object":typeof b));return b}function xa(b,a){if("hasOwnProperty"===b)throw Oa("badname",a);}function $b(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&D(b)?db(e,b):b}function xb(b){var a=b[0];b=b[b.length-1];if(a===b)return w(a);var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return w(c)}function Wc(b){var a=z("$injector"),c=z("ng");b=b.angular||(b.angular={});b.$$minErr=b.$$minErr||z;return b.module||
(b.module=function(){var b={};return function(e,f,g){if("hasOwnProperty"===e)throw c("badname","module");f&&b.hasOwnProperty(e)&&(b[e]=null);return b[e]||(b[e]=function(){function b(a,d,e){return function(){c[e||"push"]([a,d,arguments]);return n}}if(!f)throw a("nomod",e);var c=[],d=[],l=b("$injector","invoke"),n={_invokeQueue:c,_runBlocks:d,requires:f,name:e,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:b("$provide","value"),constant:b("$provide",
"constant","unshift"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:l,run:function(a){d.push(a);return this}};g&&l(g);return n}())}}())}function Xc(b){v(b,{bootstrap:Yb,copy:$,extend:v,equals:ua,element:w,forEach:r,injector:Zb,noop:B,bind:db,toJson:oa,fromJson:Ub,identity:Ba,isUndefined:E,isDefined:u,isString:x,isFunction:D,isObject:W,isNumber:ub,isElement:Rc,isArray:M,
version:Yc,isDate:Ma,lowercase:O,uppercase:Da,callbacks:{counter:0},$$minErr:z,$$csp:Tb});Ra=Wc(Q);try{Ra("ngLocale")}catch(a){Ra("ngLocale",[]).provider("$locale",Zc)}Ra("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:$c});a.provider("$compile",ac).directive({a:ad,input:bc,textarea:bc,form:bd,script:cd,select:dd,style:ed,option:fd,ngBind:gd,ngBindHtml:hd,ngBindTemplate:id,ngClass:jd,ngClassEven:kd,ngClassOdd:ld,ngCloak:md,ngController:nd,ngForm:od,ngHide:pd,ngIf:qd,ngInclude:rd,
ngInit:sd,ngNonBindable:td,ngPluralize:ud,ngRepeat:vd,ngShow:wd,ngStyle:xd,ngSwitch:yd,ngSwitchWhen:zd,ngSwitchDefault:Ad,ngOptions:Bd,ngTransclude:Cd,ngModel:Dd,ngList:Ed,ngChange:Fd,required:cc,ngRequired:cc,ngValue:Gd}).directive({ngInclude:Hd}).directive(yb).directive(dc);a.provider({$anchorScroll:Id,$animate:Jd,$browser:Kd,$cacheFactory:Ld,$controller:Md,$document:Nd,$exceptionHandler:Od,$filter:ec,$interpolate:Pd,$interval:Qd,$http:Rd,$httpBackend:Sd,$location:Td,$log:Ud,$parse:Vd,$rootScope:Wd,
$q:Xd,$sce:Yd,$sceDelegate:Zd,$sniffer:$d,$templateCache:ae,$timeout:be,$window:ce,$$rAF:de,$$asyncCallback:ee})}])}function Sa(b){return b.replace(fe,function(a,b,d,e){return e?d.toUpperCase():d}).replace(ge,"Moz$1")}function zb(b,a,c,d){function e(b){var e=c&&b?[this.filter(b)]:[this],m=a,k,l,n,q,p,t;if(!d||null!=b)for(;e.length;)for(k=e.shift(),l=0,n=k.length;l<n;l++)for(q=w(k[l]),m?q.triggerHandler("$destroy"):m=!m,p=0,q=(t=q.children()).length;p<q;p++)e.push(Ea(t[p]));return f.apply(this,arguments)}
var f=Ea.fn[b],f=f.$original||f;e.$original=f;Ea.fn[b]=e}function L(b){if(b instanceof L)return b;x(b)&&(b=aa(b));if(!(this instanceof L)){if(x(b)&&"<"!=b.charAt(0))throw Ab("nosel");return new L(b)}if(x(b)){var a=T.createElement("div");a.innerHTML="<div> </div>"+b;a.removeChild(a.firstChild);Bb(this,a.childNodes);w(T.createDocumentFragment()).append(this)}else Bb(this,b)}function Cb(b){return b.cloneNode(!0)}function Fa(b){fc(b);var a=0;for(b=b.childNodes||[];a<b.length;a++)Fa(b[a])}function gc(b,
a,c,d){if(u(d))throw Ab("offargs");var e=ja(b,"events");ja(b,"handle")&&(E(a)?r(e,function(a,c){Db(b,c,a);delete e[c]}):r(a.split(" "),function(a){E(c)?(Db(b,a,e[a]),delete e[a]):Na(e[a]||[],c)}))}function fc(b,a){var c=b[fb],d=Ta[c];d&&(a?delete Ta[c].data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),gc(b)),delete Ta[c],b[fb]=s))}function ja(b,a,c){var d=b[fb],d=Ta[d||-1];if(u(c))d||(b[fb]=d=++he,d=Ta[d]={}),d[a]=c;else return d&&d[a]}function hc(b,a,c){var d=ja(b,"data"),e=u(c),f=!e&&
u(a),g=f&&!W(a);d||g||ja(b,"data",d={});if(e)d[a]=c;else if(f){if(g)return d&&d[a];v(d,a)}else return d}function Eb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function gb(b,a){a&&b.setAttribute&&r(a.split(" "),function(a){b.setAttribute("class",aa((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+aa(a)+" "," ")))})}function hb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
" ");r(a.split(" "),function(a){a=aa(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",aa(c))}}function Bb(b,a){if(a){a=a.nodeName||!u(a.length)||Aa(a)?[a]:a;for(var c=0;c<a.length;c++)b.push(a[c])}}function ic(b,a){return ib(b,"$"+(a||"ngController")+"Controller")}function ib(b,a,c){b=w(b);9==b[0].nodeType&&(b=b.find("html"));for(a=M(a)?a:[a];b.length;){for(var d=b[0],e=0,f=a.length;e<f;e++)if((c=b.data(a[e]))!==s)return c;b=w(d.parentNode||11===d.nodeType&&d.host)}}function jc(b){for(var a=
0,c=b.childNodes;a<c.length;a++)Fa(c[a]);for(;b.firstChild;)b.removeChild(b.firstChild)}function kc(b,a){var c=jb[a.toLowerCase()];return c&&lc[b.nodeName]&&c}function ie(b,a){var c=function(c,e){c.preventDefault||(c.preventDefault=function(){c.returnValue=!1});c.stopPropagation||(c.stopPropagation=function(){c.cancelBubble=!0});c.target||(c.target=c.srcElement||T);if(E(c.defaultPrevented)){var f=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;f.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=
function(){return c.defaultPrevented||!1===c.returnValue};var g=Sb(a[e||c.type]||[]);r(g,function(a){a.call(b,c)});8>=P?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ga(b){var a=typeof b,c;"object"==a&&null!==b?"function"==typeof(c=b.$$hashKey)?c=b.$$hashKey():c===s&&(c=b.$$hashKey=ab()):c=b;return a+":"+c}function Ua(b){r(b,this.put,this)}function mc(b){var a,c;"function"==
typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(je,""),c=c.match(ke),r(c[1].split(le),function(b){b.replace(me,function(b,c,d){a.push(d)})})),b.$inject=a):M(b)?(c=b.length-1,Qa(b[c],"fn"),a=b.slice(0,c)):Qa(b,"fn",!0);return a}function Zb(b){function a(a){return function(b,c){if(W(b))r(b,Pb(a));else return a(b,c)}}function c(a,b){xa(a,"service");if(D(b)||M(b))b=n.instantiate(b);if(!b.$get)throw Va("pget",a);return l[a+h]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],
c,d,f,h;r(a,function(a){if(!k.get(a)){k.put(a,!0);try{if(x(a))for(c=Ra(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,f=0,h=d.length;f<h;f++){var g=d[f],m=n.get(g[0]);m[g[1]].apply(m,g[2])}else D(a)?b.push(n.invoke(a)):M(a)?b.push(n.invoke(a)):Qa(a,"module")}catch(l){throw M(a)&&(a=a[a.length-1]),l.message&&(l.stack&&-1==l.stack.indexOf(l.message))&&(l=l.message+"\n"+l.stack),Va("modulerr",a,l.stack||l.message||l);}}});return b}function f(a,b){function c(d){if(a.hasOwnProperty(d)){if(a[d]===
g)throw Va("cdep",m.join(" <- "));return a[d]}try{return m.unshift(d),a[d]=g,a[d]=b(d)}catch(e){throw a[d]===g&&delete a[d],e;}finally{m.shift()}}function d(a,b,e){var f=[],h=mc(a),g,k,m;k=0;for(g=h.length;k<g;k++){m=h[k];if("string"!==typeof m)throw Va("itkn",m);f.push(e&&e.hasOwnProperty(m)?e[m]:c(m))}a.$inject||(a=a[g]);return a.apply(b,f)}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(M(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return W(e)||D(e)?e:c},get:c,
annotate:mc,has:function(b){return l.hasOwnProperty(b+h)||a.hasOwnProperty(b)}}}var g={},h="Provider",m=[],k=new Ua,l={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,Y(b))}),constant:a(function(a,b){xa(a,"constant");l[a]=b;q[a]=b}),decorator:function(a,b){var c=n.get(a+h),d=c.$get;c.$get=function(){var a=p.invoke(d,c);return p.invoke(b,null,{$delegate:a})}}}},n=l.$injector=f(l,function(){throw Va("unpr",
m.join(" <- "));}),q={},p=q.$injector=f(q,function(a){a=n.get(a+h);return p.invoke(a.$get,a)});r(e(b),function(a){p.invoke(a||B)});return p}function Id(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;r(a,function(a){b||"a"!==O(a.nodeName)||(b=a)});return b}function f(){var b=c.hash(),d;b?(d=g.getElementById(b))?d.scrollIntoView():(d=e(g.getElementsByName(b)))?d.scrollIntoView():"top"===b&&a.scrollTo(0,0):
a.scrollTo(0,0)}var g=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(f)});return f}]}function ee(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function ne(b,a,c,d){function e(a){try{a.apply(null,va.call(arguments,1))}finally{if(t--,0===t)for(;H.length;)try{H.pop()()}catch(b){c.error(b)}}}function f(a,b){(function kb(){r(C,function(a){a()});A=b(kb,a)})()}function g(){y=null;J!=h.url()&&(J=h.url(),
r(ba,function(a){a(h.url())}))}var h=this,m=a[0],k=b.location,l=b.history,n=b.setTimeout,q=b.clearTimeout,p={};h.isMock=!1;var t=0,H=[];h.$$completeOutstandingRequest=e;h.$$incOutstandingRequestCount=function(){t++};h.notifyWhenNoOutstandingRequests=function(a){r(C,function(a){a()});0===t?a():H.push(a)};var C=[],A;h.addPollFn=function(a){E(A)&&f(100,n);C.push(a);return a};var J=k.href,F=a.find("base"),y=null;h.url=function(a,c){k!==b.location&&(k=b.location);l!==b.history&&(l=b.history);if(a){if(J!=
a)return J=a,d.history?c?l.replaceState(null,"",a):(l.pushState(null,"",a),F.attr("href",F.attr("href"))):(y=a,c?k.replace(a):k.href=a),h}else return y||k.href.replace(/%27/g,"'")};var ba=[],S=!1;h.onUrlChange=function(a){if(!S){if(d.history)w(b).on("popstate",g);if(d.hashchange)w(b).on("hashchange",g);else h.addPollFn(g);S=!0}ba.push(a);return a};h.baseHref=function(){var a=F.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var N={},Z="",U=h.baseHref();h.cookies=function(a,b){var d,
e,f,h;if(a)b===s?m.cookie=escape(a)+"=;path="+U+";expires=Thu, 01 Jan 1970 00:00:00 GMT":x(b)&&(d=(m.cookie=escape(a)+"="+escape(b)+";path="+U).length+1,4096<d&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"));else{if(m.cookie!==Z)for(Z=m.cookie,d=Z.split("; "),N={},f=0;f<d.length;f++)e=d[f],h=e.indexOf("="),0<h&&(a=unescape(e.substring(0,h)),N[a]===s&&(N[a]=unescape(e.substring(h+1))));return N}};h.defer=function(a,b){var c;t++;c=n(function(){delete p[c];
e(a)},b||0);p[c]=!0;return c};h.defer.cancel=function(a){return p[a]?(delete p[a],q(a),e(B),!0):!1}}function Kd(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new ne(b,d,a,c)}]}function Ld(){this.$get=function(){function b(b,d){function e(a){a!=n&&(q?q==a&&(q=a.n):q=a,f(a.n,a.p),f(a,n),n=a,n.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw z("$cacheFactory")("iid",b);var g=0,h=v({},d,{id:b}),m={},k=d&&d.capacity||Number.MAX_VALUE,l={},n=null,q=null;
return a[b]={put:function(a,b){if(k<Number.MAX_VALUE){var c=l[a]||(l[a]={key:a});e(c)}if(!E(b))return a in m||g++,m[a]=b,g>k&&this.remove(q.key),b},get:function(a){if(k<Number.MAX_VALUE){var b=l[a];if(!b)return;e(b)}return m[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=l[a];if(!b)return;b==n&&(n=b.p);b==q&&(q=b.n);f(b.n,b.p);delete l[a]}delete m[a];g--},removeAll:function(){m={};g=0;l={};n=q=null},destroy:function(){l=h=m=null;delete a[b]},info:function(){return v({},h,{size:g})}}}var a={};
b.info=function(){var b={};r(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function ae(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function ac(b,a){var c={},d="Directive",e=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,f=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g=/^<\s*(tr|th|td|thead|tbody|tfoot)(\s+[^>]*)?>/i,h=/^(on[a-z]+|formaction)$/;this.directive=function k(a,e){xa(a,"directive");x(a)?(wb(e,"directiveFactory"),c.hasOwnProperty(a)||(c[a]=[],b.factory(a+
d,["$injector","$exceptionHandler",function(b,d){var e=[];r(c[a],function(c,f){try{var h=b.invoke(c);D(h)?h={compile:Y(h)}:!h.compile&&h.link&&(h.compile=Y(h.link));h.priority=h.priority||0;h.index=f;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"A";e.push(h)}catch(g){d(g)}});return e}])),c[a].push(e)):r(a,Pb(k));return this};this.aHrefSanitizationWhitelist=function(b){return u(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=
function(b){return u(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,n,q,p,t,H,C,A,J,F,y){function ba(a,b,c,d,e){a instanceof w||(a=w(a));r(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=w(b).wrap("<span></span>").parent()[0])});var f=N(a,b,a,c,d,e);S(a,"ng-scope");return function(b,
c,d){wb(b,"scope");var e=c?Ha.clone.call(a):a;r(d,function(a,b){e.data("$"+b+"Controller",a)});d=0;for(var h=e.length;d<h;d++){var g=e[d].nodeType;1!==g&&9!==g||e.eq(d).data("$scope",b)}c&&c(e,b);f&&f(b,e,e);return e}}function S(a,b){try{a.addClass(b)}catch(c){}}function N(a,b,c,d,e,f){function h(a,c,d,e){var f,k,l,n,p,t,q;f=c.length;var ca=Array(f);for(p=0;p<f;p++)ca[p]=c[p];q=p=0;for(t=g.length;p<t;q++)k=ca[q],c=g[p++],f=g[p++],l=w(k),c?(c.scope?(n=a.$new(),l.data("$scope",n)):n=a,(l=c.transclude)||
!e&&b?c(f,n,k,d,Z(a,l||b)):c(f,n,k,d,e)):f&&f(a,k.childNodes,s,e)}for(var g=[],k,l,n,p,t=0;t<a.length;t++)k=new Fb,l=U(a[t],[],k,0===t?d:s,e),(f=l.length?Wa(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&S(w(a[t]),"ng-scope"),k=f&&f.terminal||!(n=a[t].childNodes)||!n.length?null:N(n,f?f.transclude:b),g.push(f,k),p=p||f||k,f=null;return p?h:null}function Z(a,b){return function(c,d,e){var f=!1;c||(c=a.$new(),f=c.$$transcluded=!0);d=b(c,d,e);if(f)d.on("$destroy",db(c,c.$destroy));return d}}function U(a,
b,c,d,h){var g=c.$attr,k;switch(a.nodeType){case 1:u(b,ka(Ia(a).toLowerCase()),"E",d,h);var l,n,p;k=a.attributes;for(var t=0,q=k&&k.length;t<q;t++){var H=!1,C=!1;l=k[t];if(!P||8<=P||l.specified){n=l.name;p=ka(n);la.test(p)&&(n=eb(p.substr(6),"-"));var J=p.replace(/(Start|End)$/,"");p===J+"Start"&&(H=n,C=n.substr(0,n.length-5)+"end",n=n.substr(0,n.length-6));p=ka(n.toLowerCase());g[p]=n;c[p]=l=aa(l.value);kc(a,p)&&(c[p]=!0);ga(a,b,l,p);u(b,p,"A",d,h,H,C)}}a=a.className;if(x(a)&&""!==a)for(;k=f.exec(a);)p=
ka(k[2]),u(b,p,"C",d,h)&&(c[p]=aa(k[3])),a=a.substr(k.index+k[0].length);break;case 3:L(b,a.nodeValue);break;case 8:try{if(k=e.exec(a.nodeValue))p=ka(k[1]),u(b,p,"M",d,h)&&(c[p]=aa(k[2]))}catch(y){}}b.sort(z);return b}function I(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ha("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return w(d)}function ya(a,b,c){return function(d,e,f,h,g){e=I(e[0],
b,c);return a(d,e,f,h,g)}}function Wa(a,c,d,e,f,h,g,k,p){function q(a,b,c,d){if(a){c&&(a=ya(a,c,d));a.require=G.require;if(N===G||G.$$isolateScope)a=nc(a,{isolateScope:!0});g.push(a)}if(b){c&&(b=ya(b,c,d));b.require=G.require;if(N===G||G.$$isolateScope)b=nc(b,{isolateScope:!0});k.push(b)}}function C(a,b,c){var d,e="data",f=!1;if(x(a)){for(;"^"==(d=a.charAt(0))||"?"==d;)a=a.substr(1),"^"==d&&(e="inheritedData"),f=f||"?"==d;d=null;c&&"data"===e&&(d=c[a]);d=d||b[e]("$"+a+"Controller");if(!d&&!f)throw ha("ctreq",
a,ga);}else M(a)&&(d=[],r(a,function(a){d.push(C(a,b,c))}));return d}function J(a,e,f,h,p){function q(a,b){var c;2>arguments.length&&(b=a,a=s);Ja&&(c=ya);return p(a,b,c)}var y,ca,A,I,ba,U,ya={},u;y=c===f?d:Sb(d,new Fb(w(f),d.$attr));ca=y.$$element;if(N){var oe=/^\s*([@=&])(\??)\s*(\w*)\s*$/;h=w(f);U=e.$new(!0);Z&&Z===N.$$originalDirective?h.data("$isolateScope",U):h.data("$isolateScopeNoTemplate",U);S(h,"ng-isolate-scope");r(N.scope,function(a,c){var d=a.match(oe)||[],f=d[3]||c,h="?"==d[2],d=d[1],
g,k,p,n;U.$$isolateBindings[c]=d+f;switch(d){case "@":y.$observe(f,function(a){U[c]=a});y.$$observers[f].$$scope=e;y[f]&&(U[c]=b(y[f])(e));break;case "=":if(h&&!y[f])break;k=t(y[f]);n=k.literal?ua:function(a,b){return a===b};p=k.assign||function(){g=U[c]=k(e);throw ha("nonassign",y[f],N.name);};g=U[c]=k(e);U.$watch(function(){var a=k(e);n(a,U[c])||(n(a,g)?p(e,a=U[c]):U[c]=a);return g=a},null,k.literal);break;case "&":k=t(y[f]);U[c]=function(a){return k(e,a)};break;default:throw ha("iscp",N.name,c,
a);}})}u=p&&q;F&&r(F,function(a){var b={$scope:a===N||a.$$isolateScope?U:e,$element:ca,$attrs:y,$transclude:u},c;ba=a.controller;"@"==ba&&(ba=y[a.name]);c=H(ba,b);ya[a.name]=c;Ja||ca.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});h=0;for(A=g.length;h<A;h++)try{I=g[h],I(I.isolateScope?U:e,ca,y,I.require&&C(I.require,ca,ya),u)}catch(v){n(v,fa(ca))}h=e;N&&(N.template||null===N.templateUrl)&&(h=U);a&&a(h,f.childNodes,s,p);for(h=k.length-1;0<=h;h--)try{I=k[h],I(I.isolateScope?
U:e,ca,y,I.require&&C(I.require,ca,ya),u)}catch(K){n(K,fa(ca))}}p=p||{};for(var y=-Number.MAX_VALUE,A,F=p.controllerDirectives,N=p.newIsolateScopeDirective,Z=p.templateDirective,u=p.nonTlbTranscludeDirective,Wa=!1,Ja=p.hasElementTranscludeDirective,K=d.$$element=w(c),G,ga,v,z=e,L,la=0,P=a.length;la<P;la++){G=a[la];var R=G.$$start,V=G.$$end;R&&(K=I(c,R,V));v=s;if(y>G.priority)break;if(v=G.scope)A=A||G,G.templateUrl||(Q("new/isolated scope",N,G,K),W(v)&&(N=G));ga=G.name;!G.templateUrl&&G.controller&&
(v=G.controller,F=F||{},Q("'"+ga+"' controller",F[ga],G,K),F[ga]=G);if(v=G.transclude)Wa=!0,G.$$tlb||(Q("transclusion",u,G,K),u=G),"element"==v?(Ja=!0,y=G.priority,v=I(c,R,V),K=d.$$element=w(T.createComment(" "+ga+": "+d[ga]+" ")),c=K[0],lb(f,w(va.call(v,0)),c),z=ba(v,e,y,h&&h.name,{nonTlbTranscludeDirective:u})):(v=w(Cb(c)).contents(),K.empty(),z=ba(v,e));if(G.template)if(Q("template",Z,G,K),Z=G,v=D(G.template)?G.template(K,d):G.template,v=oc(v),G.replace){h=G;v=E(v);c=v[0];if(1!=v.length||1!==c.nodeType)throw ha("tplrt",
ga,"");lb(f,K,c);P={$attr:{}};v=U(c,[],P);var X=a.splice(la+1,a.length-(la+1));N&&kb(v);a=a.concat(v).concat(X);B(d,P);P=a.length}else K.html(v);if(G.templateUrl)Q("template",Z,G,K),Z=G,G.replace&&(h=G),J=O(a.splice(la,a.length-la),K,d,f,z,g,k,{controllerDirectives:F,newIsolateScopeDirective:N,templateDirective:Z,nonTlbTranscludeDirective:u}),P=a.length;else if(G.compile)try{L=G.compile(K,d,z),D(L)?q(null,L,R,V):L&&q(L.pre,L.post,R,V)}catch(Y){n(Y,fa(K))}G.terminal&&(J.terminal=!0,y=Math.max(y,G.priority))}J.scope=
A&&!0===A.scope;J.transclude=Wa&&z;p.hasElementTranscludeDirective=Ja;return J}function kb(a){for(var b=0,c=a.length;b<c;b++)a[b]=Rb(a[b],{$$isolateScope:!0})}function u(b,e,f,h,g,l,p){if(e===g)return null;g=null;if(c.hasOwnProperty(e)){var t;e=a.get(e+d);for(var q=0,H=e.length;q<H;q++)try{t=e[q],(h===s||h>t.priority)&&-1!=t.restrict.indexOf(f)&&(l&&(t=Rb(t,{$$start:l,$$end:p})),b.push(t),g=t)}catch(y){n(y)}}return g}function B(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=e.charAt(0)&&
(b[e]&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(S(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function E(a){var b;a=aa(a);if(b=g.exec(a)){b=b[1].toLowerCase();a=w("<table>"+a+"</table>");if(/(thead|tbody|tfoot)/.test(b))return a.children(b);a=a.children("tbody");return"tr"===b?a.children("tr"):a.children("tr").contents()}return w("<div>"+
a+"</div>").contents()}function O(a,b,c,d,e,f,h,g){var k=[],l,n,t=b[0],H=a.shift(),y=v({},H,{templateUrl:null,transclude:null,replace:null,$$originalDirective:H}),C=D(H.templateUrl)?H.templateUrl(b,c):H.templateUrl;b.empty();q.get(J.getTrustedResourceUrl(C),{cache:p}).success(function(p){var q,J;p=oc(p);if(H.replace){p=E(p);q=p[0];if(1!=p.length||1!==q.nodeType)throw ha("tplrt",H.name,C);p={$attr:{}};lb(d,b,q);var A=U(q,[],p);W(H.scope)&&kb(A);a=A.concat(a);B(c,p)}else q=t,b.html(p);a.unshift(y);
l=Wa(a,q,c,e,b,H,f,h,g);r(d,function(a,c){a==q&&(d[c]=b[0])});for(n=N(b[0].childNodes,e);k.length;){p=k.shift();J=k.shift();var I=k.shift(),F=k.shift(),A=b[0];if(J!==t){var ba=J.className;g.hasElementTranscludeDirective&&H.replace||(A=Cb(q));lb(I,w(J),A);S(w(A),ba)}J=l.transclude?Z(p,l.transclude):F;l(n,p,A,d,J)}k=null}).error(function(a,b,c,d){throw ha("tpload",d.url);});return function(a,b,c,d,e){k?(k.push(b),k.push(c),k.push(d),k.push(e)):l(n,b,c,d,e)}}function z(a,b){var c=b.priority-a.priority;
return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function Q(a,b,c,d){if(b)throw ha("multidir",b.name,c.name,a,fa(d));}function L(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:Y(function(a,b){var c=b.parent(),e=c.data("$binding")||[];e.push(d);S(c.data("$binding",e),"ng-binding");a.$watch(d,function(a){b[0].nodeValue=a})})})}function Ja(a,b){if("srcdoc"==b)return J.HTML;var c=Ia(a);if("xlinkHref"==b||"FORM"==c&&"action"==b||"IMG"!=c&&("src"==b||"ngSrc"==b))return J.RESOURCE_URL}
function ga(a,c,d,e){var f=b(d,!0);if(f){if("multiple"===e&&"SELECT"===Ia(a))throw ha("selmulti",fa(a));c.push({priority:100,compile:function(){return{pre:function(c,d,g){d=g.$$observers||(g.$$observers={});if(h.test(e))throw ha("nodomevents");if(f=b(g[e],!0,Ja(a,e)))g[e]=f(c),(d[e]||(d[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||c).$watch(f,function(a,b){"class"===e&&a!=b?g.$updateClass(a,b):g.$set(e,a)})}}}})}}function lb(a,b,c){var d=b[0],e=b.length,f=d.parentNode,h,g;if(a)for(h=
0,g=a.length;h<g;h++)if(a[h]==d){a[h++]=c;g=h+e-1;for(var k=a.length;h<k;h++,g++)g<k?a[h]=a[g]:delete a[h];a.length-=e-1;break}f&&f.replaceChild(c,d);a=T.createDocumentFragment();a.appendChild(d);c[w.expando]=d[w.expando];d=1;for(e=b.length;d<e;d++)f=b[d],w(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function nc(a,b){return v(function(){return a.apply(null,arguments)},a,b)}var Fb=function(a,b){this.$$element=a;this.$attr=b||{}};Fb.prototype={$normalize:ka,$addClass:function(a){a&&0<
a.length&&F.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&F.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=pc(a,b),d=pc(b,a);0===c.length?F.removeClass(this.$$element,d):0===d.length?F.addClass(this.$$element,c):F.setClass(this.$$element,c,d)},$set:function(a,b,c,d){var e=kc(this.$$element[0],a);e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=eb(a,"-"));e=Ia(this.$$element);if("A"===e&&"href"===a||"IMG"===e&&
"src"===a)this[a]=b=y(b,"src"===a);!1!==c&&(null===b||b===s?this.$$element.removeAttr(d):this.$$element.attr(d,b));(c=this.$$observers)&&r(c[a],function(a){try{a(b)}catch(c){n(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);C.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var R=b.startSymbol(),V=b.endSymbol(),oc="{{"==R||"}}"==V?Ba:function(a){return a.replace(/\{\{/g,R).replace(/}}/g,V)},la=/^ngAttr[A-Z]/;return ba}]}function ka(b){return Sa(b.replace(pe,
""))}function pc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Md(){var b={},a=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,d){xa(a,"controller");W(a)?v(b,a):b[a]=d};this.$get=["$injector","$window",function(c,d){return function(e,f){var g,h,m;x(e)&&(g=e.match(a),h=g[1],m=g[3],e=b.hasOwnProperty(h)?b[h]:$b(f.$scope,h,!0)||$b(d,h,!0),Qa(e,h,!0));g=c.instantiate(e,f);
if(m){if(!f||"object"!=typeof f.$scope)throw z("$controller")("noscp",h||e.name,m);f.$scope[m]=g}return g}}]}function Nd(){this.$get=["$window",function(b){return w(b.document)}]}function Od(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function qc(b){var a={},c,d,e;if(!b)return a;r(b.split("\n"),function(b){e=b.indexOf(":");c=O(aa(b.substr(0,e)));d=aa(b.substr(e+1));c&&(a[c]=a[c]?a[c]+(", "+d):d)});return a}function rc(b){var a=W(b)?b:s;return function(c){a||
(a=qc(b));return c?a[O(c)]||null:a}}function sc(b,a,c){if(D(c))return c(b,a);r(c,function(c){b=c(b,a)});return b}function Rd(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d={"Content-Type":"application/json;charset=utf-8"},e=this.defaults={transformResponse:[function(d){x(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=Ub(d)));return d}],transformRequest:[function(a){return W(a)&&"[object File]"!==ta.call(a)&&"[object Blob]"!==ta.call(a)?oa(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},
post:$(d),put:$(d),patch:$(d)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},f=this.interceptors=[],g=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,d,n,q){function p(a){function c(a){var b=v({},a,{data:sc(a.data,a.headers,d.transformResponse)});return 200<=a.status&&300>a.status?b:n.reject(b)}var d={method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},f=function(a){function b(a){var c;
r(a,function(b,d){D(b)&&(c=b(),null!=c?a[d]=c:delete a[d])})}var c=e.headers,d=v({},a.headers),f,h,c=v({},c.common,c[O(a.method)]);b(c);b(d);a:for(f in c){a=O(f);for(h in d)if(O(h)===a)continue a;d[f]=c[f]}return d}(a);v(d,a);d.headers=f;d.method=Da(d.method);(a=Gb(d.url)?b.cookies()[d.xsrfCookieName||e.xsrfCookieName]:s)&&(f[d.xsrfHeaderName||e.xsrfHeaderName]=a);var h=[function(a){f=a.headers;var b=sc(a.data,rc(f),a.transformRequest);E(a.data)&&r(f,function(a,b){"content-type"===O(b)&&delete f[b]});
E(a.withCredentials)&&!E(e.withCredentials)&&(a.withCredentials=e.withCredentials);return t(a,b,f).then(c,c)},s],g=n.when(d);for(r(A,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&h.push(a.response,a.responseError)});h.length;){a=h.shift();var k=h.shift(),g=g.then(a,k)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,d)});return g};g.error=function(a){g.then(null,function(b){a(b.data,b.status,b.headers,d)});return g};
return g}function t(b,c,f){function g(a,b,c){A&&(200<=a&&300>a?A.put(s,[a,b,qc(c)]):A.remove(s));k(b,a,c);d.$$phase||d.$apply()}function k(a,c,d){c=Math.max(c,0);(200<=c&&300>c?t.resolve:t.reject)({data:a,status:c,headers:rc(d),config:b})}function m(){var a=cb(p.pendingRequests,b);-1!==a&&p.pendingRequests.splice(a,1)}var t=n.defer(),q=t.promise,A,r,s=H(b.url,b.params);p.pendingRequests.push(b);q.then(m,m);(b.cache||e.cache)&&(!1!==b.cache&&"GET"==b.method)&&(A=W(b.cache)?b.cache:W(e.cache)?e.cache:
C);if(A)if(r=A.get(s),u(r)){if(r.then)return r.then(m,m),r;M(r)?k(r[1],r[0],$(r[2])):k(r,200,{})}else A.put(s,q);E(r)&&a(b.method,s,c,g,f,b.timeout,b.withCredentials,b.responseType);return q}function H(a,b){if(!b)return a;var c=[];Qc(b,function(a,b){null===a||E(a)||(M(a)||(a=[a]),r(a,function(a){W(a)&&(a=oa(a));c.push(wa(b)+"="+wa(a))}))});0<c.length&&(a+=(-1==a.indexOf("?")?"?":"&")+c.join("&"));return a}var C=c("$http"),A=[];r(f,function(a){A.unshift(x(a)?q.get(a):q.invoke(a))});r(g,function(a,
b){var c=x(a)?q.get(a):q.invoke(a);A.splice(b,0,{response:function(a){return c(n.when(a))},responseError:function(a){return c(n.reject(a))}})});p.pendingRequests=[];(function(a){r(arguments,function(a){p[a]=function(b,c){return p(v(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){p[a]=function(b,c,d){return p(v(d||{},{method:a,url:b,data:c}))}})})("post","put");p.defaults=e;return p}]}function qe(b){if(8>=P&&(!b.match(/^(get|post|head|put|delete|options)$/i)||
!Q.XMLHttpRequest))return new Q.ActiveXObject("Microsoft.XMLHTTP");if(Q.XMLHttpRequest)return new Q.XMLHttpRequest;throw z("$httpBackend")("noxhr");}function Sd(){this.$get=["$browser","$window","$document",function(b,a,c){return re(b,qe,b.defer,a.angular.callbacks,c[0])}]}function re(b,a,c,d,e){function f(a,b){var c=e.createElement("script"),d=function(){c.onreadystatechange=c.onload=c.onerror=null;e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;P&&8>=P?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&
d()}:c.onload=c.onerror=function(){d()};e.body.appendChild(c);return d}var g=-1;return function(e,m,k,l,n,q,p,t){function H(){A=g;F&&F();y&&y.abort()}function C(a,d,e,f){S&&c.cancel(S);F=y=null;0===d&&(d=e?200:"file"==pa(m).protocol?404:0);a(1223==d?204:d,e,f);b.$$completeOutstandingRequest(B)}var A;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==O(e)){var J="_"+(d.counter++).toString(36);d[J]=function(a){d[J].data=a};var F=f(m.replace("JSON_CALLBACK","angular.callbacks."+J),function(){d[J].data?
C(l,200,d[J].data):C(l,A||-2);d[J]=Ca.noop})}else{var y=a(e);y.open(e,m,!0);r(n,function(a,b){u(a)&&y.setRequestHeader(b,a)});y.onreadystatechange=function(){if(y&&4==y.readyState){var a=null,b=null;A!==g&&(a=y.getAllResponseHeaders(),b="response"in y?y.response:y.responseText);C(l,A||y.status,b,a)}};p&&(y.withCredentials=!0);if(t)try{y.responseType=t}catch(s){if("json"!==t)throw s;}y.send(k||null)}if(0<q)var S=c(H,q);else q&&q.then&&q.then(H)}}function Pd(){var b="{{",a="}}";this.startSymbol=function(a){return a?
(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(f,k,l){for(var n,q,p=0,t=[],H=f.length,C=!1,A=[];p<H;)-1!=(n=f.indexOf(b,p))&&-1!=(q=f.indexOf(a,n+g))?(p!=n&&t.push(f.substring(p,n)),t.push(p=c(C=f.substring(n+g,q))),p.exp=C,p=q+h,C=!0):(p!=H&&t.push(f.substring(p)),p=H);(H=t.length)||(t.push(""),H=1);if(l&&1<t.length)throw tc("noconcat",f);if(!k||C)return A.length=H,p=function(a){try{for(var b=0,c=H,h;b<c;b++)"function"==
typeof(h=t[b])&&(h=h(a),h=l?e.getTrusted(l,h):e.valueOf(h),null===h||E(h)?h="":"string"!=typeof h&&(h=oa(h))),A[b]=h;return A.join("")}catch(g){a=tc("interr",f,g.toString()),d(a)}},p.exp=f,p.parts=t,p}var g=b.length,h=a.length;f.startSymbol=function(){return b};f.endSymbol=function(){return a};return f}]}function Qd(){this.$get=["$rootScope","$window","$q",function(b,a,c){function d(d,g,h,m){var k=a.setInterval,l=a.clearInterval,n=c.defer(),q=n.promise,p=0,t=u(m)&&!m;h=u(h)?h:0;q.then(null,null,d);
q.$$intervalId=k(function(){n.notify(p++);0<h&&p>=h&&(n.resolve(p),l(q.$$intervalId),delete e[q.$$intervalId]);t||b.$apply()},g);e[q.$$intervalId]=n;return q}var e={};d.cancel=function(a){return a&&a.$$intervalId in e?(e[a.$$intervalId].reject("canceled"),clearInterval(a.$$intervalId),delete e[a.$$intervalId],!0):!1};return d}]}function Zc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",
gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a",
"short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function uc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=vb(b[a]);return b.join("/")}function vc(b,a,c){b=pa(b,c);a.$$protocol=b.protocol;a.$$host=b.hostname;a.$$port=R(b.port)||se[b.protocol]||null}function wc(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=pa(b,c);a.$$path=decodeURIComponent(d&&
"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=Wb(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ma(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Xa(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Hb(b){return b.substr(0,Xa(b).lastIndexOf("/")+1)}function xc(b,a){this.$$html5=!0;a=a||"";var c=Hb(b);vc(b,this,b);this.$$parse=function(a){var e=ma(c,a);if(!x(e))throw Ib("ipthprfx",
a,c);wc(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Xb(this.$$search),b=this.$$hash?"#"+vb(this.$$hash):"";this.$$url=uc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;if((e=ma(b,d))!==s)return d=e,(e=ma(a,e))!==s?c+(ma("/",e)||e):b+d;if((e=ma(c,d))!==s)return c+e;if(c==d+"/")return c}}function Jb(b,a){var c=Hb(b);vc(b,this,b);this.$$parse=function(d){var e=ma(b,d)||ma(c,d),e="#"==e.charAt(0)?ma(a,e):
this.$$html5?e:"";if(!x(e))throw Ib("ihshprfx",d,a);wc(e,this,b);d=this.$$path;var f=/^\/?.*?:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Xb(this.$$search),e=this.$$hash?"#"+vb(this.$$hash):"";this.$$url=uc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(Xa(b)==Xa(a))return a}}function yc(b,a){this.$$html5=!0;Jb.apply(this,arguments);var c=Hb(b);
this.$$rewrite=function(d){var e;if(b==Xa(d))return d;if(e=ma(c,d))return b+a+e;if(c===d+"/")return c}}function mb(b){return function(){return this[b]}}function zc(b,a){return function(c){if(E(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Td(){var b="",a=!1;this.hashPrefix=function(a){return u(a)?(b=a,this):b};this.html5Mode=function(b){return u(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function g(a){c.$broadcast("$locationChangeSuccess",
h.absUrl(),a)}var h,m=d.baseHref(),k=d.url();a?(m=k.substring(0,k.indexOf("/",k.indexOf("//")+2))+(m||"/"),e=e.history?xc:yc):(m=Xa(k),e=Jb);h=new e(m,"#"+b);h.$$parse(h.$$rewrite(k));f.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var b=w(a.target);"a"!==O(b[0].nodeName);)if(b[0]===f[0]||!(b=b.parent())[0])return;var e=b.prop("href");W(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=pa(e.animVal).href);var g=h.$$rewrite(e);e&&(!b.attr("target")&&g&&!a.isDefaultPrevented())&&
(a.preventDefault(),g!=d.url()&&(h.$$parse(g),c.$apply(),Q.angular["ff-684208-preventDefault"]=!0))}});h.absUrl()!=k&&d.url(h.absUrl(),!0);d.onUrlChange(function(a){h.absUrl()!=a&&(c.$evalAsync(function(){var b=h.absUrl();h.$$parse(a);c.$broadcast("$locationChangeStart",a,b).defaultPrevented?(h.$$parse(b),d.url(b)):g(b)}),c.$$phase||c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=h.$$replace;l&&a==h.absUrl()||(l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",h.absUrl(),a).defaultPrevented?
h.$$parse(a):(d.url(h.absUrl(),b),g(a))}));h.$$replace=!1;return l});return h}]}function Ud(){var b=!0,a=this;this.debugEnabled=function(a){return u(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||B;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=
[];r(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function da(b,a){if("constructor"===b)throw za("isecfld",a);return b}function Ya(b,a){if(b){if(b.constructor===b)throw za("isecfn",a);if(b.document&&b.location&&b.alert&&b.setInterval)throw za("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw za("isecdom",
a);}return b}function nb(b,a,c,d,e){e=e||{};a=a.split(".");for(var f,g=0;1<a.length;g++){f=da(a.shift(),d);var h=b[f];h||(h={},b[f]=h);b=h;b.then&&e.unwrapPromises&&(qa(d),"$$v"in b||function(a){a.then(function(b){a.$$v=b})}(b),b.$$v===s&&(b.$$v={}),b=b.$$v)}f=da(a.shift(),d);return b[f]=c}function Ac(b,a,c,d,e,f,g){da(b,f);da(a,f);da(c,f);da(d,f);da(e,f);return g.unwrapPromises?function(h,g){var k=g&&g.hasOwnProperty(b)?g:h,l;if(null==k)return k;(k=k[b])&&k.then&&(qa(f),"$$v"in k||(l=k,l.$$v=s,l.then(function(a){l.$$v=
a})),k=k.$$v);if(!a)return k;if(null==k)return s;(k=k[a])&&k.then&&(qa(f),"$$v"in k||(l=k,l.$$v=s,l.then(function(a){l.$$v=a})),k=k.$$v);if(!c)return k;if(null==k)return s;(k=k[c])&&k.then&&(qa(f),"$$v"in k||(l=k,l.$$v=s,l.then(function(a){l.$$v=a})),k=k.$$v);if(!d)return k;if(null==k)return s;(k=k[d])&&k.then&&(qa(f),"$$v"in k||(l=k,l.$$v=s,l.then(function(a){l.$$v=a})),k=k.$$v);if(!e)return k;if(null==k)return s;(k=k[e])&&k.then&&(qa(f),"$$v"in k||(l=k,l.$$v=s,l.then(function(a){l.$$v=a})),k=k.$$v);
return k}:function(f,g){var k=g&&g.hasOwnProperty(b)?g:f;if(null==k)return k;k=k[b];if(!a)return k;if(null==k)return s;k=k[a];if(!c)return k;if(null==k)return s;k=k[c];if(!d)return k;if(null==k)return s;k=k[d];return e?null==k?s:k=k[e]:k}}function te(b,a){da(b,a);return function(a,d){return null==a?s:(d&&d.hasOwnProperty(b)?d:a)[b]}}function ue(b,a,c){da(b,c);da(a,c);return function(c,e){if(null==c)return s;c=(e&&e.hasOwnProperty(b)?e:c)[b];return null==c?s:c[a]}}function Bc(b,a,c){if(Kb.hasOwnProperty(b))return Kb[b];
var d=b.split("."),e=d.length,f;if(a.unwrapPromises||1!==e)if(a.unwrapPromises||2!==e)if(a.csp)f=6>e?Ac(d[0],d[1],d[2],d[3],d[4],c,a):function(b,f){var h=0,g;do g=Ac(d[h++],d[h++],d[h++],d[h++],d[h++],c,a)(b,f),f=s,b=g;while(h<e);return g};else{var g="var p;\n";r(d,function(b,d){da(b,c);g+="if(s == null) return undefined;\ns="+(d?"s":'((k&&k.hasOwnProperty("'+b+'"))?k:s)')+'["'+b+'"];\n'+(a.unwrapPromises?'if (s && s.then) {\n pw("'+c.replace(/(["\r\n])/g,"\\$1")+'");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n':
"")});var g=g+"return s;",h=new Function("s","k","pw",g);h.toString=Y(g);f=a.unwrapPromises?function(a,b){return h(a,b,qa)}:h}else f=ue(d[0],d[1],c);else f=te(d[0],c);"hasOwnProperty"!==b&&(Kb[b]=f);return f}function Vd(){var b={},a={csp:!1,unwrapPromises:!1,logPromiseWarnings:!0};this.unwrapPromises=function(b){return u(b)?(a.unwrapPromises=!!b,this):a.unwrapPromises};this.logPromiseWarnings=function(b){return u(b)?(a.logPromiseWarnings=b,this):a.logPromiseWarnings};this.$get=["$filter","$sniffer",
"$log",function(c,d,e){a.csp=d.csp;qa=function(b){a.logPromiseWarnings&&!Cc.hasOwnProperty(b)&&(Cc[b]=!0,e.warn("[$parse] Promise found in the expression `"+b+"`. Automatic unwrapping of promises in Angular expressions is deprecated."))};return function(d){var e;switch(typeof d){case "string":if(b.hasOwnProperty(d))return b[d];e=new Lb(a);e=(new Za(e,c,a)).parse(d,!1);"hasOwnProperty"!==d&&(b[d]=e);return e;case "function":return d;default:return B}}}]}function Xd(){this.$get=["$rootScope","$exceptionHandler",
function(b,a){return ve(function(a){b.$evalAsync(a)},a)}]}function ve(b,a){function c(a){return a}function d(a){return g(a)}var e=function(){var g=[],k,l;return l={resolve:function(a){if(g){var c=g;g=s;k=f(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],k.then(a[0],a[1],a[2])})}},reject:function(a){l.resolve(h(a))},notify:function(a){if(g){var c=g;g.length&&b(function(){for(var b,d=0,e=c.length;d<e;d++)b=c[d],b[2](a)})}},promise:{then:function(b,f,h){var l=e(),H=function(d){try{l.resolve((D(b)?
b:c)(d))}catch(e){l.reject(e),a(e)}},C=function(b){try{l.resolve((D(f)?f:d)(b))}catch(c){l.reject(c),a(c)}},A=function(b){try{l.notify((D(h)?h:c)(b))}catch(d){a(d)}};g?g.push([H,C,A]):k.then(H,C,A);return l.promise},"catch":function(a){return this.then(null,a)},"finally":function(a){function b(a,c){var d=e();c?d.resolve(a):d.reject(a);return d.promise}function d(e,f){var h=null;try{h=(a||c)()}catch(g){return b(g,!1)}return h&&D(h.then)?h.then(function(){return b(e,f)},function(a){return b(a,!1)}):
b(e,f)}return this.then(function(a){return d(a,!0)},function(a){return d(a,!1)})}}}},f=function(a){return a&&D(a.then)?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},g=function(a){var b=e();b.reject(a);return b.promise},h=function(c){return{then:function(f,h){var g=e();b(function(){try{g.resolve((D(h)?h:d)(c))}catch(b){g.reject(b),a(b)}});return g.promise}}};return{defer:e,reject:g,when:function(h,k,l,n){var q=e(),p,t=function(b){try{return(D(k)?k:c)(b)}catch(d){return a(d),
g(d)}},H=function(b){try{return(D(l)?l:d)(b)}catch(c){return a(c),g(c)}},C=function(b){try{return(D(n)?n:c)(b)}catch(d){a(d)}};b(function(){f(h).then(function(a){p||(p=!0,q.resolve(f(a).then(t,H,C)))},function(a){p||(p=!0,q.resolve(H(a)))},function(a){p||q.notify(C(a))})});return q.promise},all:function(a){var b=e(),c=0,d=M(a)?[]:{};r(a,function(a,e){c++;f(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise}}}
function de(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function Wd(){var b=10,a=z("$rootScope"),c=null;this.digestTtl=function(a){arguments.length&&
(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(d,e,f,g){function h(){this.$id=ab();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$postDigestQueue=[];this.$$listeners={};this.$$listenerCount={};this.$$isolateBindings={}}function m(b){if(q.$$phase)throw a("inprog",q.$$phase);q.$$phase=b}function k(a,b){var c=f(a);
Qa(c,b);return c}function l(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function n(){}h.prototype={constructor:h,$new:function(a){a?(a=new h,a.$root=this.$root,a.$$asyncQueue=this.$$asyncQueue,a.$$postDigestQueue=this.$$postDigestQueue):(a=function(){},a.prototype=this,a=new a,a.$id=ab());a["this"]=a;a.$$listeners={};a.$$listenerCount={};a.$parent=this;a.$$watchers=a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;
this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,d){var e=k(a,"watch"),f=this.$$watchers,h={fn:b,last:n,get:e,exp:a,eq:!!d};c=null;if(!D(b)){var g=k(b||B,"listener");h.fn=function(a,b,c){g(c)}}if("string"==typeof a&&e.constant){var m=h.fn;h.fn=function(a,b,c){m.call(this,a,b,c);Na(f,h)}}f||(f=this.$$watchers=[]);f.unshift(h);return function(){Na(f,h);c=null}},$watchCollection:function(a,b){var c=this,d,e,h,g=1<b.length,
k=0,m=f(a),l=[],n={},q=!0,r=0;return this.$watch(function(){d=m(c);var a,b;if(W(d))if($a(d))for(e!==l&&(e=l,r=e.length=0,k++),a=d.length,r!==a&&(k++,e.length=r=a),b=0;b<a;b++)e[b]!==e[b]&&d[b]!==d[b]||e[b]===d[b]||(k++,e[b]=d[b]);else{e!==n&&(e=n={},r=0,k++);a=0;for(b in d)d.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?e[b]!==d[b]&&(k++,e[b]=d[b]):(r++,e[b]=d[b],k++));if(r>a)for(b in k++,e)e.hasOwnProperty(b)&&!d.hasOwnProperty(b)&&(r--,delete e[b])}else e!==d&&(e=d,k++);return k},function(){q?(q=
!1,b(d,d,c)):b(d,h,c);if(g)if(W(d))if($a(d)){h=Array(d.length);for(var a=0;a<d.length;a++)h[a]=d[a]}else for(a in h={},d)Dc.call(d,a)&&(h[a]=d[a]);else h=d})},$digest:function(){var d,f,h,g,k=this.$$asyncQueue,l=this.$$postDigestQueue,r,y,s=b,S,N=[],u,v,I;m("$digest");c=null;do{y=!1;for(S=this;k.length;){try{I=k.shift(),I.scope.$eval(I.expression)}catch(w){q.$$phase=null,e(w)}c=null}a:do{if(g=S.$$watchers)for(r=g.length;r--;)try{if(d=g[r])if((f=d.get(S))!==(h=d.last)&&!(d.eq?ua(f,h):"number"==typeof f&&
"number"==typeof h&&isNaN(f)&&isNaN(h)))y=!0,c=d,d.last=d.eq?$(f):f,d.fn(f,h===n?f:h,S),5>s&&(u=4-s,N[u]||(N[u]=[]),v=D(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,v+="; newVal: "+oa(f)+"; oldVal: "+oa(h),N[u].push(v));else if(d===c){y=!1;break a}}catch(x){q.$$phase=null,e(x)}if(!(g=S.$$childHead||S!==this&&S.$$nextSibling))for(;S!==this&&!(g=S.$$nextSibling);)S=S.$parent}while(S=g);if((y||k.length)&&!s--)throw q.$$phase=null,a("infdig",b,oa(N));}while(y||k.length);for(q.$$phase=null;l.length;)try{l.shift()()}catch(B){e(B)}},
$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this!==q&&(r(this.$$listenerCount,db(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=
null)}},$eval:function(a,b){return f(a)(this,b)},$evalAsync:function(a){q.$$phase||q.$$asyncQueue.length||g.defer(function(){q.$$asyncQueue.length&&q.$digest()});this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{q.$$phase=null;try{q.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||
(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){c[cb(c,b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,f=this,h=!1,g={name:a,targetScope:f,stopPropagation:function(){h=!0},preventDefault:function(){g.defaultPrevented=!0},defaultPrevented:!1},k=[g].concat(va.call(arguments,1)),l,m;do{d=f.$$listeners[a]||c;g.currentScope=f;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){e(n)}else d.splice(l,1),l--,m--;if(h)break;f=f.$parent}while(f);
return g},$broadcast:function(a,b){for(var c=this,d=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},h=[f].concat(va.call(arguments,1)),g,k;c=d;){f.currentScope=c;d=c.$$listeners[a]||[];g=0;for(k=d.length;g<k;g++)if(d[g])try{d[g].apply(null,h)}catch(l){e(l)}else d.splice(g,1),g--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}return f}};var q=new h;return q}]}function $c(){var b=
/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*(https?|ftp|file):|data:image\//;this.aHrefSanitizationWhitelist=function(a){return u(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return u(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;if(!P||8<=P)if(f=pa(c).href,""!==f&&!f.match(e))return"unsafe:"+f;return c}}}function we(b){if("self"===b)return b;if(x(b)){if(-1<b.indexOf("***"))throw ra("iwcard",b);b=b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,
"\\x08").replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return RegExp("^"+b+"$")}if(bb(b))return RegExp("^"+b.source+"$");throw ra("imatcher");}function Ec(b){var a=[];u(b)&&r(b,function(b){a.push(we(b))});return a}function Zd(){this.SCE_CONTEXTS=ea;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=Ec(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=Ec(b));return a};this.$get=["$injector",function(c){function d(a){var b=function(a){this.$$unwrapTrustedValue=
function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var e=function(a){throw ra("unsafe");};c.has("$sanitize")&&(e=c.get("$sanitize"));var f=d(),g={};g[ea.HTML]=d(f);g[ea.CSS]=d(f);g[ea.URL]=d(f);g[ea.JS]=d(f);g[ea.RESOURCE_URL]=d(g[ea.URL]);return{trustAs:function(a,b){var c=g.hasOwnProperty(a)?g[a]:null;if(!c)throw ra("icontext",a,b);if(null===b||b===
s||""===b)return b;if("string"!==typeof b)throw ra("itype",a);return new c(b)},getTrusted:function(c,d){if(null===d||d===s||""===d)return d;var f=g.hasOwnProperty(c)?g[c]:null;if(f&&d instanceof f)return d.$$unwrapTrustedValue();if(c===ea.RESOURCE_URL){var f=pa(d.toString()),l,n,q=!1;l=0;for(n=b.length;l<n;l++)if("self"===b[l]?Gb(f):b[l].exec(f.href)){q=!0;break}if(q)for(l=0,n=a.length;l<n;l++)if("self"===a[l]?Gb(f):a[l].exec(f.href)){q=!1;break}if(q)return d;throw ra("insecurl",d.toString());}if(c===
ea.HTML)return e(d);throw ra("unsafe");},valueOf:function(a){return a instanceof f?a.$$unwrapTrustedValue():a}}}]}function Yd(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sniffer","$sceDelegate",function(a,c,d){if(b&&c.msie&&8>c.msieDocumentMode)throw ra("iequirks");var e=$(ea);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},e.valueOf=Ba);e.parseAs=
function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,d(a,c))}};var f=e.parseAs,g=e.getTrusted,h=e.trustAs;r(ea,function(a,b){var c=O(b);e[Sa("parse_as_"+c)]=function(b){return f(a,b)};e[Sa("get_trusted_"+c)]=function(b){return g(a,b)};e[Sa("trust_as_"+c)]=function(b){return h(a,b)}});return e}]}function $d(){this.$get=["$window","$document",function(b,a){var c={},d=R((/android (\d+)/.exec(O((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||
{}).userAgent),f=a[0]||{},g=f.documentMode,h,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,n=!1;if(k){for(var q in k)if(l=m.exec(q)){h=l[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in k&&"webkit");l=!!("transition"in k||h+"Transition"in k);n=!!("animation"in k||h+"Animation"in k);!d||l&&n||(l=x(f.body.style.webkitTransition),n=x(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!g||7<
g),hasEvent:function(a){if("input"==a&&9==P)return!1;if(E(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Tb(),vendorPrefix:h,transitions:l,animations:n,android:d,msie:P,msieDocumentMode:g}}]}function be(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,h,m){var k=c.defer(),l=k.promise,n=u(m)&&!m;h=a.defer(function(){try{k.resolve(e())}catch(a){k.reject(a),d(a)}finally{delete f[l.$$timeoutId]}n||b.$apply()},h);l.$$timeoutId=h;f[h]=k;
return l}var f={};e.cancel=function(b){return b&&b.$$timeoutId in f?(f[b.$$timeoutId].reject("canceled"),delete f[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return e}]}function pa(b,a){var c=b;P&&(V.setAttribute("href",c),c=V.href);V.setAttribute("href",c);return{href:V.href,protocol:V.protocol?V.protocol.replace(/:$/,""):"",host:V.host,search:V.search?V.search.replace(/^\?/,""):"",hash:V.hash?V.hash.replace(/^#/,""):"",hostname:V.hostname,port:V.port,pathname:"/"===V.pathname.charAt(0)?V.pathname:
"/"+V.pathname}}function Gb(b){b=x(b)?pa(b):b;return b.protocol===Fc.protocol&&b.host===Fc.host}function ce(){this.$get=Y(Q)}function ec(b){function a(d,e){if(W(d)){var f={};r(d,function(b,c){f[c]=a(c,b)});return f}return b.factory(d+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Gc);a("date",Hc);a("filter",xe);a("json",ye);a("limitTo",ze);a("lowercase",Ae);a("number",Ic);a("orderBy",Jc);a("uppercase",Be)}function xe(){return function(b,
a,c){if(!M(b))return b;var d=typeof c,e=[];e.check=function(a){for(var b=0;b<e.length;b++)if(!e[b](a))return!1;return!0};"function"!==d&&(c="boolean"===d&&c?function(a,b){return Ca.equals(a,b)}:function(a,b){if(a&&b&&"object"===typeof a&&"object"===typeof b){for(var d in a)if("$"!==d.charAt(0)&&Dc.call(a,d)&&c(a[d],b[d]))return!0;return!1}b=(""+b).toLowerCase();return-1<(""+a).toLowerCase().indexOf(b)});var f=function(a,b){if("string"==typeof b&&"!"===b.charAt(0))return!f(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,
b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if("$"!==d.charAt(0)&&f(a[d],b))return!0}return!1;case "array":for(d=0;d<a.length;d++)if(f(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var g in a)(function(b){"undefined"!=typeof a[b]&&e.push(function(c){return f("$"==b?c:c&&c[b],a[b])})})(g);break;case "function":e.push(a);break;default:return b}d=[];for(g=0;g<b.length;g++){var h=
b[g];e.check(h)&&d.push(h)}return d}}function Gc(b){var a=b.NUMBER_FORMATS;return function(b,d){E(d)&&(d=a.CURRENCY_SYM);return Kc(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Ic(b){var a=b.NUMBER_FORMATS;return function(b,d){return Kc(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Kc(b,a,c,d,e){if(null==b||!isFinite(b)||W(b))return"";var f=0>b;b=Math.abs(b);var g=b+"",h="",m=[],k=!1;if(-1!==g.indexOf("e")){var l=g.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&
l[3]>e+1?g="0":(h=g,k=!0)}if(k)0<e&&(-1<b&&1>b)&&(h=b.toFixed(e));else{g=(g.split(Lc)[1]||"").length;E(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));g=Math.pow(10,e);b=Math.round(b*g)/g;b=(""+b).split(Lc);g=b[0];b=b[1]||"";var l=0,n=a.lgSize,q=a.gSize;if(g.length>=n+q)for(l=g.length-n,k=0;k<l;k++)0===(l-k)%q&&0!==k&&(h+=c),h+=g.charAt(k);for(k=l;k<g.length;k++)0===(g.length-k)%n&&0!==k&&(h+=c),h+=g.charAt(k);for(;b.length<e;)b+="0";e&&"0"!==e&&(h+=d+b.substr(0,e))}m.push(f?a.negPre:a.posPre);
m.push(h);m.push(f?a.negSuf:a.posSuf);return m.join("")}function Mb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function X(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Mb(e,a,d)}}function ob(b,a){return function(c,d){var e=c["get"+b](),f=Da(a?"SHORT"+b:b);return d[f][e]}}function Hc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,m=
b[8]?a.setUTCHours:a.setHours;b[9]&&(f=R(b[9]+b[10]),g=R(b[9]+b[11]));h.call(a,R(b[1]),R(b[2])-1,R(b[3]));f=R(b[4]||0)-f;g=R(b[5]||0)-g;h=R(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var f="",g=[],h,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;x(c)&&(c=Ce.test(c)?R(c):a(c));ub(c)&&(c=new Date(c));if(!Ma(c))return c;for(;e;)(m=De.exec(e))?
(g=g.concat(va.call(m,1)),e=g.pop()):(g.push(e),e=null);r(g,function(a){h=Ee[a];f+=h?h(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function ye(){return function(b){return oa(b,!0)}}function ze(){return function(b,a){if(!M(b)&&!x(b))return b;a=R(a);if(x(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0<a?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Jc(b){return function(a,
c,d){function e(a,b){return Pa(b)?function(b,c){return a(c,b)}:a}function f(a,b){var c=typeof a,d=typeof b;return c==d?("string"==c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!M(a)||!c)return a;c=M(c)?c:[c];c=Sc(c,function(a){var c=!1,d=a||Ba;if(x(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);d=b(a);if(d.constant){var h=d();return e(function(a,b){return f(a[h],b[h])},c)}}return e(function(a,b){return f(d(a),d(b))},c)});for(var g=[],h=0;h<a.length;h++)g.push(a[h]);
return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function sa(b){D(b)&&(b={link:b});b.restrict=b.restrict||"AC";return Y(b)}function Mc(b,a,c,d){function e(a,c){c=c?"-"+eb(c,"-"):"";d.removeClass(b,(a?pb:qb)+c);d.addClass(b,(a?qb:pb)+c)}var f=this,g=b.parent().controller("form")||rb,h=0,m=f.$error={},k=[];f.$name=a.name||a.ngForm;f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;g.$addControl(f);b.addClass(Ka);e(!0);f.$addControl=function(a){xa(a.$name,
"input");k.push(a);a.$name&&(f[a.$name]=a)};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];r(m,function(b,c){f.$setValidity(c,!0,a)});Na(k,a)};f.$setValidity=function(a,b,c){var d=m[a];if(b)d&&(Na(d,c),d.length||(h--,h||(e(b),f.$valid=!0,f.$invalid=!1),m[a]=!1,e(!0,a),g.$setValidity(a,!0,f)));else{h||e(b);if(d){if(-1!=cb(d,c))return}else m[a]=d=[],h++,e(!1,a),g.$setValidity(a,!1,f);d.push(c);f.$valid=!1;f.$invalid=!0}};f.$setDirty=function(){d.removeClass(b,Ka);d.addClass(b,
sb);f.$dirty=!0;f.$pristine=!1;g.$setDirty()};f.$setPristine=function(){d.removeClass(b,sb);d.addClass(b,Ka);f.$dirty=!1;f.$pristine=!0;r(k,function(a){a.$setPristine()})}}function na(b,a,c,d){b.$setValidity(a,c);return c?d:s}function Fe(b,a,c){var d=c.prop("validity");W(d)&&(c=function(c){if(b.$error[a]||!(d.badInput||d.customError||d.typeMismatch)||d.valueMissing)return c;b.$setValidity(a,!1)},b.$parsers.push(c),b.$formatters.push(c))}function tb(b,a,c,d,e,f){var g=a.prop("validity");if(!e.android){var h=
!1;a.on("compositionstart",function(a){h=!0});a.on("compositionend",function(){h=!1;m()})}var m=function(){if(!h){var e=a.val();Pa(c.ngTrim||"T")&&(e=aa(e));if(d.$viewValue!==e||g&&""===e&&!g.valueMissing)b.$$phase?d.$setViewValue(e):b.$apply(function(){d.$setViewValue(e)})}};if(e.hasEvent("input"))a.on("input",m);else{var k,l=function(){k||(k=f.defer(function(){m();k=null}))};a.on("keydown",function(a){a=a.keyCode;91===a||(15<a&&19>a||37<=a&&40>=a)||l()});if(e.hasEvent("paste"))a.on("paste cut",
l)}a.on("change",m);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var n=c.ngPattern;n&&((e=n.match(/^\/(.*)\/([gim]*)$/))?(n=RegExp(e[1],e[2]),e=function(a){return na(d,"pattern",d.$isEmpty(a)||n.test(a),a)}):e=function(c){var e=b.$eval(n);if(!e||!e.test)throw z("ngPattern")("noregexp",n,e,fa(a));return na(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var q=R(c.ngMinlength);e=function(a){return na(d,"minlength",d.$isEmpty(a)||
a.length>=q,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var p=R(c.ngMaxlength);e=function(a){return na(d,"maxlength",d.$isEmpty(a)||a.length<=p,a)};d.$parsers.push(e);d.$formatters.push(e)}}function Nb(b,a){b="ngClass"+b;return function(){return{restrict:"AC",link:function(c,d,e){function f(b){if(!0===a||c.$index%2===a){var d=g(b||"");h?ua(b,h)||e.$updateClass(d,g(h)):e.$addClass(d)}h=$(b)}function g(a){if(M(a))return a.join(" ");if(W(a)){var b=[];r(a,function(a,c){a&&b.push(c)});
return b.join(" ")}return a}var h;c.$watch(e[b],f,!0);e.$observe("class",function(a){f(c.$eval(e[b]))});"ngClass"!==b&&c.$watch("$index",function(d,f){var h=d&1;if(h!==f&1){var n=g(c.$eval(e[b]));h===a?e.$addClass(n):e.$removeClass(n)}})}}}}var O=function(b){return x(b)?b.toLowerCase():b},Dc=Object.prototype.hasOwnProperty,Da=function(b){return x(b)?b.toUpperCase():b},P,w,Ea,va=[].slice,Ge=[].push,ta=Object.prototype.toString,Oa=z("ng"),Ca=Q.angular||(Q.angular={}),Ra,Ia,ia=["0","0","0"];P=R((/msie (\d+)/.exec(O(navigator.userAgent))||
[])[1]);isNaN(P)&&(P=R((/trident\/.*; rv:(\d+)/.exec(O(navigator.userAgent))||[])[1]));B.$inject=[];Ba.$inject=[];var aa=function(){return String.prototype.trim?function(b){return x(b)?b.trim():b}:function(b){return x(b)?b.replace(/^\s\s*/,"").replace(/\s\s*$/,""):b}}();Ia=9>P?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Da(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var Vc=/[A-Z]/g,Yc={full:"1.2.15",major:1,minor:2,dot:15,
codeName:"beer-underestimating"},Ta=L.cache={},fb=L.expando="ng-"+(new Date).getTime(),he=1,Nc=Q.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Db=Q.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};L._data=function(b){return this.cache[b[this.expando]]||{}};var fe=/([\:\-\_]+(.))/g,ge=/^moz([A-Z])/,Ab=z("jqLite"),Ha=L.prototype={ready:function(b){function a(){c||(c=!0,
b())}var c=!1;"complete"===T.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),L(Q).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?w(this[b]):w(this[this.length+b])},length:0,push:Ge,sort:[].sort,splice:[].splice},jb={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){jb[O(b)]=b});var lc={};r("input select option textarea button form details".split(" "),function(b){lc[Da(b)]=
!0});r({data:hc,inheritedData:ib,scope:function(b){return w(b).data("$scope")||ib(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return w(b).data("$isolateScope")||w(b).data("$isolateScopeNoTemplate")},controller:ic,injector:function(b){return ib(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Eb,css:function(b,a,c){a=Sa(a);if(u(c))b.style[a]=c;else{var d;8>=P&&(d=b.currentStyle&&b.currentStyle[a],""===d&&(d="auto"));d=d||b.style[a];8>=P&&(d=""===d?s:
d);return d}},attr:function(b,a,c){var d=O(a);if(jb[d])if(u(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||B).specified?d:s;else if(u(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?s:b},prop:function(b,a,c){if(u(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(E(d))return e?b[e]:"";b[e]=d}var a=[];9>P?(a[1]="innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";
b.$dv="";return b}(),val:function(b,a){if(E(a)){if("SELECT"===Ia(b)&&b.multiple){var c=[];r(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(E(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)Fa(d[c]);b.innerHTML=a},empty:jc},function(b,a){L.prototype[a]=function(a,d){var e,f;if(b!==jc&&(2==b.length&&b!==Eb&&b!==ic?a:d)===s){if(W(a)){for(e=0;e<this.length;e++)if(b===hc)b(this[e],a);else for(f in a)b(this[e],
f,a[f]);return this}e=b.$dv;f=e===s?Math.min(this.length,1):this.length;for(var g=0;g<f;g++){var h=b(this[g],a,d);e=e?e+h:h}return e}for(e=0;e<this.length;e++)b(this[e],a,d);return this}});r({removeData:fc,dealoc:Fa,on:function a(c,d,e,f){if(u(f))throw Ab("onargs");var g=ja(c,"events"),h=ja(c,"handle");g||ja(c,"events",g={});h||ja(c,"handle",h=ie(c,g));r(d.split(" "),function(d){var f=g[d];if(!f){if("mouseenter"==d||"mouseleave"==d){var l=T.body.contains||T.body.compareDocumentPosition?function(a,
c){var d=9===a.nodeType?a.documentElement:a,e=c&&c.parentNode;return a===e||!!(e&&1===e.nodeType&&(d.contains?d.contains(e):a.compareDocumentPosition&&a.compareDocumentPosition(e)&16))}:function(a,c){if(c)for(;c=c.parentNode;)if(c===a)return!0;return!1};g[d]=[];a(c,{mouseleave:"mouseout",mouseenter:"mouseover"}[d],function(a){var c=a.relatedTarget;c&&(c===this||l(this,c))||h(a,d)})}else Nc(c,d,h),g[d]=[];f=g[d]}f.push(e)})},off:gc,one:function(a,c,d){a=w(a);a.on(c,function f(){a.off(c,d);a.off(c,
f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;Fa(a);r(new L(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];r(a.childNodes,function(a){1===a.nodeType&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){r(new L(c),function(c){1!==a.nodeType&&11!==a.nodeType||a.appendChild(c)})},prepend:function(a,c){if(1===a.nodeType){var d=a.firstChild;r(new L(c),function(c){a.insertBefore(c,
d)})}},wrap:function(a,c){c=w(c)[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){Fa(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;r(new L(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:hb,removeClass:gb,toggleClass:function(a,c,d){c&&r(c.split(" "),function(c){var f=d;E(f)&&(f=!Eb(a,c));(f?hb:gb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;
for(a=a.nextSibling;null!=a&&1!==a.nodeType;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Cb,triggerHandler:function(a,c,d){c=(ja(a,"events")||{})[c];d=d||[];var e=[{preventDefault:B,stopPropagation:B}];r(c,function(c){c.apply(a,e.concat(d))})}},function(a,c){L.prototype[c]=function(c,e,f){for(var g,h=0;h<this.length;h++)E(g)?(g=a(this[h],c,e,f),u(g)&&(g=w(g))):Bb(g,a(this[h],c,e,f));return u(g)?g:this};L.prototype.bind=L.prototype.on;
L.prototype.unbind=L.prototype.off});Ua.prototype={put:function(a,c){this[Ga(a)]=c},get:function(a){return this[Ga(a)]},remove:function(a){var c=this[a=Ga(a)];delete this[a];return c}};var ke=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,le=/,/,me=/^\s*(_?)(\S+?)\1\s*$/,je=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Va=z("$injector"),He=z("$animate"),Jd=["$provide",function(a){this.$$selectors={};this.register=function(c,d){var e=c+"-animation";if(c&&"."!=c.charAt(0))throw He("notcsel",c);this.$$selectors[c.substr(1)]=
e;a.factory(e,d)};this.classNameFilter=function(a){1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null);return this.$$classNameFilter};this.$get=["$timeout","$$asyncCallback",function(a,d){return{enter:function(a,c,g,h){g?g.after(a):(c&&c[0]||(c=g.parent()),c.append(a));h&&d(h)},leave:function(a,c){a.remove();c&&d(c)},move:function(a,c,d,h){this.enter(a,c,d,h)},addClass:function(a,c,g){c=x(c)?c:M(c)?c.join(" "):"";r(a,function(a){hb(a,c)});g&&d(g)},removeClass:function(a,c,g){c=
x(c)?c:M(c)?c.join(" "):"";r(a,function(a){gb(a,c)});g&&d(g)},setClass:function(a,c,g,h){r(a,function(a){hb(a,c);gb(a,g)});h&&d(h)},enabled:B}}]}],ha=z("$compile");ac.$inject=["$provide","$$sanitizeUriProvider"];var pe=/^(x[\:\-_]|data[\:\-_])/i,tc=z("$interpolate"),Ie=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,se={http:80,https:443,ftp:21},Ib=z("$location");yc.prototype=Jb.prototype=xc.prototype={$$html5:!1,$$replace:!1,absUrl:mb("$$absUrl"),url:function(a,c){if(E(a))return this.$$url;var d=Ie.exec(a);d[1]&&
this.path(decodeURIComponent(d[1]));(d[2]||d[1])&&this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:mb("$$protocol"),host:mb("$$host"),port:mb("$$port"),path:zc("$$path",function(a){return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;case 1:if(x(a))this.$$search=Wb(a);else if(W(a))this.$$search=a;else throw Ib("isrcharg");break;default:E(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:zc("$$hash",
Ba),replace:function(){this.$$replace=!0;return this}};var za=z("$parse"),Cc={},qa,La={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:B,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return u(d)?u(e)?d+e:d:u(e)?e:s},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(u(d)?d:0)-(u(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,
c)},"=":B,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,
c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Je={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Lb=function(a){this.options=a};Lb.prototype={constructor:Lb,lex:function(a){this.text=a;this.index=0;this.ch=s;this.lastCh=":";this.tokens=[];var c;for(a=[];this.index<this.text.length;){this.ch=this.text.charAt(this.index);if(this.is("\"'"))this.readString(this.ch);else if(this.isNumber(this.ch)||this.is(".")&&this.isNumber(this.peek()))this.readNumber();
else if(this.isIdent(this.ch))this.readIdent(),this.was("{,")&&("{"===a[0]&&(c=this.tokens[this.tokens.length-1]))&&(c.json=-1===c.text.indexOf("."));else if(this.is("(){}[].,;:?"))this.tokens.push({index:this.index,text:this.ch,json:this.was(":[,")&&this.is("{[")||this.is("}]:,")}),this.is("{[")&&a.unshift(this.ch),this.is("}]")&&a.shift(),this.index++;else if(this.isWhitespace(this.ch)){this.index++;continue}else{var d=this.ch+this.peek(),e=d+this.peek(2),f=La[this.ch],g=La[d],h=La[e];h?(this.tokens.push({index:this.index,
text:e,fn:h}),this.index+=3):g?(this.tokens.push({index:this.index,text:d,fn:g}),this.index+=2):f?(this.tokens.push({index:this.index,text:this.ch,fn:f,json:this.was("[,:")&&this.is("+-")}),this.index+=1):this.throwError("Unexpected next character ",this.index,this.index+1)}this.lastCh=this.ch}return this.tokens},is:function(a){return-1!==a.indexOf(this.ch)},was:function(a){return-1!==a.indexOf(this.lastCh)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+
a):!1},isNumber:function(a){return"0"<=a&&"9">=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=u(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw za("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=
O(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}a*=1;this.tokens.push({index:c,text:a,json:!0,fn:function(){return a}})},readIdent:function(){for(var a=this,c="",d=this.index,e,f,g,h;this.index<this.text.length;){h=
this.text.charAt(this.index);if("."===h||this.isIdent(h)||this.isNumber(h))"."===h&&(e=this.index),c+=h;else break;this.index++}if(e)for(f=this.index;f<this.text.length;){h=this.text.charAt(f);if("("===h){g=c.substr(e-d+1);c=c.substr(0,e-d);this.index=f;break}if(this.isWhitespace(h))f++;else break}d={index:d,text:c};if(La.hasOwnProperty(c))d.fn=La[c],d.json=La[c];else{var m=Bc(c,this.options,this.text);d.fn=v(function(a,c){return m(a,c)},{assign:function(d,e){return nb(d,c,e,a.text,a.options)}})}this.tokens.push(d);
g&&(this.tokens.push({index:e,text:".",json:!1}),this.tokens.push({index:e+1,text:g,json:!1}))},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(g=this.text.substring(this.index+1,this.index+5),g.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+g+"]"),this.index+=4,d+=String.fromCharCode(parseInt(g,16))):d=(f=Je[g])?d+f:d+g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;
this.tokens.push({index:c,text:e,string:d,json:!0,fn:function(){return d}});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var Za=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d};Za.ZERO=function(){return 0};Za.prototype={constructor:Za,parse:function(a,c){this.text=a;this.json=c;this.tokens=this.lexer.lex(a);c&&(this.assignment=this.logicalOR,this.functionCall=this.fieldAccess=this.objectIndex=this.filterChain=function(){this.throwError("is not valid json",{text:a,
index:0})});var d=c?this.primary():this.statements();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);d.literal=!!d.literal;d.constant=!!d.constant;return d},primary:function(){var a;if(this.expect("("))a=this.filterChain(),this.consume(")");else if(this.expect("["))a=this.arrayDeclaration();else if(this.expect("{"))a=this.object();else{var c=this.expect();(a=c.fn)||this.throwError("not a primary expression",c);c.json&&(a.constant=!0,a.literal=!0)}for(var d;c=this.expect("(",
"[",".");)"("===c.text?(a=this.functionCall(a,d),d=null):"["===c.text?(d=a,a=this.objectIndex(a)):"."===c.text?(d=a,a=this.fieldAccess(a)):this.throwError("IMPOSSIBLE");return a},throwError:function(a,c){throw za("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},peekToken:function(){if(0===this.tokens.length)throw za("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){if(0<this.tokens.length){var f=this.tokens[0],g=f.text;if(g===a||g===c||g===d||g===e||!(a||c||d||e))return f}return!1},
expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.json&&!a.json&&this.throwError("is not valid json",a),this.tokens.shift(),a):!1},consume:function(a){this.expect(a)||this.throwError("is unexpected, expecting ["+a+"]",this.peek())},unaryFn:function(a,c){return v(function(d,e){return a(d,e,c)},{constant:c.constant})},ternaryFn:function(a,c,d){return v(function(e,f){return a(e,f)?c(e,f):d(e,f)},{constant:a.constant&&c.constant&&d.constant})},binaryFn:function(a,c,d){return v(function(e,f){return c(e,
f,a,d)},{constant:a.constant&&d.constant})},statements:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(c,d){for(var e,f=0;f<a.length;f++){var g=a[f];g&&(e=g(c,d))}return e}},filterChain:function(){for(var a=this.expression(),c;;)if(c=this.expect("|"))a=this.binaryFn(a,c.fn,this.filter());else return a},filter:function(){for(var a=this.expect(),c=this.$filter(a.text),d=[];;)if(a=this.expect(":"))d.push(this.expression());
else{var e=function(a,e,h){h=[h];for(var m=0;m<d.length;m++)h.push(d[m](a,e));return c.apply(a,h)};return function(){return e}}},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary(),c,d;return(d=this.expect("="))?(a.assign||this.throwError("implies assignment but ["+this.text.substring(0,d.index)+"] can not be assigned to",d),c=this.ternary(),function(d,f){return a.assign(d,c(d,f),f)}):a},ternary:function(){var a=this.logicalOR(),c,d;if(this.expect("?")){c=this.ternary();
if(d=this.expect(":"))return this.ternaryFn(a,c,this.ternary());this.throwError("expected :",d)}else return a},logicalOR:function(){for(var a=this.logicalAND(),c;;)if(c=this.expect("||"))a=this.binaryFn(a,c.fn,this.logicalAND());else return a},logicalAND:function(){var a=this.equality(),c;if(c=this.expect("&&"))a=this.binaryFn(a,c.fn,this.logicalAND());return a},equality:function(){var a=this.relational(),c;if(c=this.expect("==","!=","===","!=="))a=this.binaryFn(a,c.fn,this.equality());return a},
relational:function(){var a=this.additive(),c;if(c=this.expect("<",">","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(Za.ZERO,a.fn,
this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=Bc(d,this.options,this.text);return v(function(c,d,h){return e(h||a(c,d))},{assign:function(e,g,h){return nb(a(e,h),d,g,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression();this.consume("]");return v(function(e,f){var g=a(e,f),h=d(e,f),m;if(!g)return s;(g=Ya(g[h],c.text))&&(g.then&&c.options.unwrapPromises)&&(m=g,"$$v"in g||(m.$$v=s,m.then(function(a){m.$$v=
a})),g=g.$$v);return g},{assign:function(e,f,g){var h=d(e,g);return Ya(a(e,g),c.text)[h]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this;return function(f,g){for(var h=[],m=c?c(f,g):f,k=0;k<d.length;k++)h.push(d[k](f,g));k=a(f,g,m)||B;Ya(m,e.text);Ya(k,e.text);h=k.apply?k.apply(m,h):k(h[0],h[1],h[2],h[3],h[4]);return Ya(h,e.text)}},arrayDeclaration:function(){var a=[],c=!0;if("]"!==this.peekToken().text){do{if(this.peek("]"))break;
var d=this.expression();a.push(d);d.constant||(c=!1)}while(this.expect(","))}this.consume("]");return v(function(c,d){for(var g=[],h=0;h<a.length;h++)g.push(a[h](c,d));return g},{literal:!0,constant:c})},object:function(){var a=[],c=!0;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;var d=this.expect(),d=d.string||d.text;this.consume(":");var e=this.expression();a.push({key:d,value:e});e.constant||(c=!1)}while(this.expect(","))}this.consume("}");return v(function(c,d){for(var e={},m=0;m<
a.length;m++){var k=a[m];e[k.key]=k.value(c,d)}return e},{literal:!0,constant:c})}};var Kb={},ra=z("$sce"),ea={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},V=T.createElement("a"),Fc=pa(Q.location.href,!0);ec.$inject=["$provide"];Gc.$inject=["$locale"];Ic.$inject=["$locale"];var Lc=".",Ee={yyyy:X("FullYear",4),yy:X("FullYear",2,0,!0),y:X("FullYear",1),MMMM:ob("Month"),MMM:ob("Month",!0),MM:X("Month",2,1),M:X("Month",1,1),dd:X("Date",2),d:X("Date",1),HH:X("Hours",2),H:X("Hours",
1),hh:X("Hours",2,-12),h:X("Hours",1,-12),mm:X("Minutes",2),m:X("Minutes",1),ss:X("Seconds",2),s:X("Seconds",1),sss:X("Milliseconds",3),EEEE:ob("Day"),EEE:ob("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Mb(Math[0<a?"floor":"ceil"](a/60),2)+Mb(Math.abs(a%60),2))}},De=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,Ce=/^\-?\d+$/;Hc.$inject=["$locale"];var Ae=Y(O),Be=Y(Da);Jc.$inject=
["$parse"];var ad=Y({restrict:"E",compile:function(a,c){8>=P&&(c.href||c.name||c.$set("href",""),a.append(T.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===ta.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}),yb={};r(jb,function(a,c){if("multiple"!=a){var d=ka("ng-"+c);yb[d]=function(){return{priority:100,link:function(a,f,g){a.$watch(g[d],function(a){g.$set(c,!!a)})}}}}});r(["src",
"srcset","href"],function(a){var c=ka("ng-"+a);yb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===ta.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(a){a&&(f.$set(h,a),P&&g&&e.prop(g,f[h]))})}}}});var rb={$addControl:B,$removeControl:B,$setValidity:B,$setDirty:B,$setPristine:B};Mc.$inject=["$element","$attrs","$scope","$animate"];var Oc=function(a){return["$timeout",function(c){return{name:"form",
restrict:a?"EAC":"E",controller:Mc,compile:function(){return{pre:function(a,e,f,g){if(!f.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};Nc(e[0],"submit",h);e.on("$destroy",function(){c(function(){Db(e[0],"submit",h)},0,!1)})}var m=e.parent().controller("form"),k=f.name||f.ngForm;k&&nb(a,k,g,k);if(m)e.on("$destroy",function(){m.$removeControl(g);k&&nb(a,k,s,k);v(g,rb)})}}}}}]},bd=Oc(),od=Oc(!0),Ke=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
Le=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,Me=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Pc={text:tb,number:function(a,c,d,e,f,g){tb(a,c,d,e,f,g);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||Me.test(a))return e.$setValidity("number",!0),""===a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return s});Fe(e,"number",c);e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c=parseFloat(d.min);return na(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),
e.$formatters.push(a));d.max&&(a=function(a){var c=parseFloat(d.max);return na(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return na(e,"number",e.$isEmpty(a)||ub(a),a)})},url:function(a,c,d,e,f,g){tb(a,c,d,e,f,g);a=function(a){return na(e,"url",e.$isEmpty(a)||Ke.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,f,g){tb(a,c,d,e,f,g);a=function(a){return na(e,"email",e.$isEmpty(a)||Le.test(a),a)};e.$formatters.push(a);
e.$parsers.push(a)},radio:function(a,c,d,e){E(d.name)&&c.attr("name",ab());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var f=d.ngTrueValue,g=d.ngFalseValue;x(f)||(f=!0);x(g)||(g=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==f};
e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:g})},hidden:B,button:B,submit:B,reset:B,file:B},bc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,f,g){g&&(Pc[O(f.type)]||Pc.text)(d,e,f,g,c,a)}}}],qb="ng-valid",pb="ng-invalid",Ka="ng-pristine",sb="ng-dirty",Ne=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,c,d,e,f,g){function h(a,c){c=c?"-"+eb(c,"-"):"";g.removeClass(e,(a?pb:qb)+c);
g.addClass(e,(a?qb:pb)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var m=f(d.ngModel),k=m.assign;if(!k)throw z("ngModel")("nonassign",d.ngModel,fa(e));this.$render=B;this.$isEmpty=function(a){return E(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||rb,n=0,q=this.$error={};e.addClass(Ka);h(!0);this.$setValidity=function(a,c){q[a]!==
!c&&(c?(q[a]&&n--,n||(h(!0),this.$valid=!0,this.$invalid=!1)):(h(!1),this.$invalid=!0,this.$valid=!1,n++),q[a]=!c,h(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;g.removeClass(e,sb);g.addClass(e,Ka)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,g.removeClass(e,Ka),g.addClass(e,sb),l.$setDirty());r(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,k(a,d),r(this.$viewChangeListeners,
function(a){try{a()}catch(d){c(d)}}))};var p=this;a.$watch(function(){var c=m(a);if(p.$modelValue!==c){var d=p.$formatters,e=d.length;for(p.$modelValue=c;e--;)c=d[e](c);p.$viewValue!==c&&(p.$viewValue=c,p.$render())}return c})}],Dd=function(){return{require:["ngModel","^?form"],controller:Ne,link:function(a,c,d,e){var f=e[0],g=e[1]||rb;g.$addControl(f);a.$on("$destroy",function(){g.$removeControl(f)})}}},Fd=Y({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),
cc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(f);e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},Ed=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!E(a)){var c=[];a&&r(a.split(f),function(a){a&&
c.push(aa(a))});return c}});e.$formatters.push(function(a){return M(a)?a.join(", "):s});e.$isEmpty=function(a){return!a||!a.length}}}},Oe=/^(true|false|\d+)$/,Gd=function(){return{priority:100,compile:function(a,c){return Oe.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},gd=sa(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),id=["$interpolate",
function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],hd=["$sce","$parse",function(a,c){return function(d,e,f){e.addClass("ng-binding").data("$binding",f.ngBindHtml);var g=c(f.ngBindHtml);d.$watch(function(){return(g(d)||"").toString()},function(c){e.html(a.getTrustedHtml(g(d))||"")})}}],jd=Nb("",!0),ld=Nb("Odd",0),kd=Nb("Even",1),md=sa({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),
nd=[function(){return{scope:!0,controller:"@",priority:500}}],dc={};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=ka("ng-"+a);dc[c]=["$parse",function(d){return{compile:function(e,f){var g=d(f[c]);return function(c,d,e){d.on(O(a),function(a){c.$apply(function(){g(c,{$event:a})})})}}}}]});var qd=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",
$$tlb:!0,link:function(c,d,e,f,g){var h,m,k;c.$watch(e.ngIf,function(f){Pa(f)?m||(m=c.$new(),g(m,function(c){c[c.length++]=T.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)})):(k&&(k.remove(),k=null),m&&(m.$destroy(),m=null),h&&(k=xb(h.clone),a.leave(k,function(){k=null}),h=null))})}}}],rd=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,f){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ca.noop,compile:function(g,
h){var m=h.ngInclude||h.src,k=h.onload||"",l=h.autoscroll;return function(g,h,p,r,s){var v=0,A,w,F,y=function(){w&&(w.remove(),w=null);A&&(A.$destroy(),A=null);F&&(e.leave(F,function(){w=null}),w=F,F=null)};g.$watch(f.parseAsResourceUrl(m),function(f){var m=function(){!u(l)||l&&!g.$eval(l)||d()},p=++v;f?(a.get(f,{cache:c}).success(function(a){if(p===v){var c=g.$new();r.template=a;a=s(c,function(a){y();e.enter(a,null,h,m)});A=c;F=a;A.$emit("$includeContentLoaded");g.$eval(k)}}).error(function(){p===
v&&y()}),g.$emit("$includeContentRequested")):(y(),r.template=null)})}}}}],Hd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){d.html(f.template);a(d.contents())(c)}}}],sd=sa({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),td=sa({terminal:!0,priority:1E3}),ud=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,g){var h=g.count,m=g.$attr.when&&f.attr(g.$attr.when),k=g.offset||
0,l=e.$eval(m)||{},n={},q=c.startSymbol(),p=c.endSymbol(),t=/^when(Minus)?(.+)$/;r(g,function(a,c){t.test(c)&&(l[O(c.replace("when","").replace("Minus","-"))]=f.attr(g.$attr[c]))});r(l,function(a,e){n[e]=c(a.replace(d,q+h+"-"+k+p))});e.$watch(function(){var c=parseFloat(e.$eval(h));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-k));return n[c](e,f,!0)},function(a){f.text(a)})}}}],vd=["$parse","$animate",function(a,c){var d=z("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,
link:function(e,f,g,h,m){var k=g.ngRepeat,l=k.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,q,p,t,s,v,u={$id:Ga};if(!l)throw d("iexp",k);g=l[1];h=l[2];(l=l[3])?(n=a(l),q=function(a,c,d){v&&(u[v]=a);u[s]=c;u.$index=d;return n(e,u)}):(p=function(a,c){return Ga(c)},t=function(a){return a});l=g.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",g);s=l[3]||l[1];v=l[2];var J={};e.$watchCollection(h,function(a){var g,h,l=f[0],n,u={},A,I,x,B,E,K,
z=[];if($a(a))E=a,n=q||p;else{n=q||t;E=[];for(x in a)a.hasOwnProperty(x)&&"$"!=x.charAt(0)&&E.push(x);E.sort()}A=E.length;h=z.length=E.length;for(g=0;g<h;g++)if(x=a===E?g:E[g],B=a[x],B=n(x,B,g),xa(B,"`track by` id"),J.hasOwnProperty(B))K=J[B],delete J[B],u[B]=K,z[g]=K;else{if(u.hasOwnProperty(B))throw r(z,function(a){a&&a.scope&&(J[a.id]=a)}),d("dupes",k,B);z[g]={id:B};u[B]=!1}for(x in J)J.hasOwnProperty(x)&&(K=J[x],g=xb(K.clone),c.leave(g),r(g,function(a){a.$$NG_REMOVED=!0}),K.scope.$destroy());
g=0;for(h=E.length;g<h;g++){x=a===E?g:E[g];B=a[x];K=z[g];z[g-1]&&(l=z[g-1].clone[z[g-1].clone.length-1]);if(K.scope){I=K.scope;n=l;do n=n.nextSibling;while(n&&n.$$NG_REMOVED);K.clone[0]!=n&&c.move(xb(K.clone),null,w(l));l=K.clone[K.clone.length-1]}else I=e.$new();I[s]=B;v&&(I[v]=x);I.$index=g;I.$first=0===g;I.$last=g===A-1;I.$middle=!(I.$first||I.$last);I.$odd=!(I.$even=0===(g&1));K.scope||m(I,function(a){a[a.length++]=T.createComment(" end ngRepeat: "+k+" ");c.enter(a,null,w(l));l=a;K.scope=I;K.clone=
a;u[K.id]=K})}J=u})}}}],wd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngShow,function(c){a[Pa(c)?"removeClass":"addClass"](d,"ng-hide")})}}],pd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngHide,function(c){a[Pa(c)?"addClass":"removeClass"](d,"ng-hide")})}}],xd=sa(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),yd=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases=
{}}],link:function(c,d,e,f){var g,h,m,k=[];c.$watch(e.ngSwitch||e.on,function(d){var n,q=k.length;if(0<q){if(m){for(n=0;n<q;n++)m[n].remove();m=null}m=[];for(n=0;n<q;n++){var p=h[n];k[n].$destroy();m[n]=p;a.leave(p,function(){m.splice(n,1);0===m.length&&(m=null)})}}h=[];k=[];if(g=f.cases["!"+d]||f.cases["?"])c.$eval(e.change),r(g,function(d){var e=c.$new();k.push(e);d.transclude(e,function(c){var e=d.element;h.push(c);a.enter(c,e.parent(),e)})})})}}}],zd=sa({transclude:"element",priority:800,require:"^ngSwitch",
link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),Ad=sa({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Cd=sa({link:function(a,c,d,e,f){if(!f)throw z("ngTransclude")("orphan",fa(c));f(function(a){c.empty();c.append(a)})}}),cd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,
d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],Pe=z("ngOptions"),Bd=Y({terminal:!0}),dd=["$compile","$parse",function(a,c){var d=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,e={$setViewValue:B};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var m=this,k={},l=e,n;m.databound=
d.ngModel;m.init=function(a,c,d){l=a;n=d};m.addOption=function(c){xa(c,'"option value"');k[c]=!0;l.$viewValue==c&&(a.val(c),n.parent()&&n.remove())};m.removeOption=function(a){this.hasOption(a)&&(delete k[a],l.$viewValue==a&&this.renderUnknownOption(a))};m.renderUnknownOption=function(c){c="? "+Ga(c)+" ?";n.val(c);a.prepend(n);a.val(c);n.prop("selected",!0)};m.hasOption=function(a){return k.hasOwnProperty(a)};c.$on("$destroy",function(){m.renderUnknownOption=B})}],link:function(e,g,h,m){function k(a,
c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(z.parent()&&z.remove(),c.val(a),""===a&&x.prop("selected",!0)):E(a)&&x?c.val(""):e.renderUnknownOption(a)};c.on("change",function(){a.$apply(function(){z.parent()&&z.remove();d.$setViewValue(c.val())})})}function l(a,c,d){var e;d.$render=function(){var a=new Ua(d.$viewValue);r(c.find("option"),function(c){c.selected=u(a.get(c.value))})};a.$watch(function(){ua(e,d.$viewValue)||(e=$(d.$viewValue),d.$render())});c.on("change",function(){a.$apply(function(){var a=
[];r(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function n(e,f,g){function h(){var a={"":[]},c=[""],d,k,s,t,z;t=g.$modelValue;z=y(e)||[];var E=n?Ob(z):z,I,C,D;C={};s=!1;var F,L;if(p)if(w&&M(t))for(s=new Ua([]),D=0;D<t.length;D++)C[m]=t[D],s.put(w(e,C),t[D]);else s=new Ua(t);for(D=0;I=E.length,D<I;D++){k=D;if(n){k=E[D];if("$"===k.charAt(0))continue;C[n]=k}C[m]=z[k];d=q(e,C)||"";(k=a[d])||(k=a[d]=[],c.push(d));p?d=u(s.remove(w?w(e,C):r(e,C))):(w?(d={},d[m]=t,d=
w(e,d)===w(e,C)):d=t===r(e,C),s=s||d);F=l(e,C);F=u(F)?F:"";k.push({id:w?w(e,C):n?E[D]:D,label:F,selected:d})}p||(v||null===t?a[""].unshift({id:"",label:"",selected:!s}):s||a[""].unshift({id:"?",label:"",selected:!0}));C=0;for(E=c.length;C<E;C++){d=c[C];k=a[d];x.length<=C?(t={element:B.clone().attr("label",d),label:k.label},z=[t],x.push(z),f.append(t.element)):(z=x[C],t=z[0],t.label!=d&&t.element.attr("label",t.label=d));F=null;D=0;for(I=k.length;D<I;D++)s=k[D],(d=z[D+1])?(F=d.element,d.label!==s.label&&
F.text(d.label=s.label),d.id!==s.id&&F.val(d.id=s.id),d.selected!==s.selected&&F.prop("selected",d.selected=s.selected)):(""===s.id&&v?L=v:(L=A.clone()).val(s.id).attr("selected",s.selected).text(s.label),z.push({element:L,label:s.label,id:s.id,selected:s.selected}),F?F.after(L):t.element.append(L),F=L);for(D++;z.length>D;)z.pop().element.remove()}for(;x.length>C;)x.pop()[0].element.remove()}var k;if(!(k=t.match(d)))throw Pe("iexp",t,fa(f));var l=c(k[2]||k[1]),m=k[4]||k[6],n=k[5],q=c(k[3]||""),r=
c(k[2]?k[1]:m),y=c(k[7]),w=k[8]?c(k[8]):null,x=[[{element:f,label:""}]];v&&(a(v)(e),v.removeClass("ng-scope"),v.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=y(e)||[],d={},h,k,l,q,t,v,u;if(p)for(k=[],q=0,v=x.length;q<v;q++)for(a=x[q],l=1,t=a.length;l<t;l++){if((h=a[l].element)[0].selected){h=h.val();n&&(d[n]=h);if(w)for(u=0;u<c.length&&(d[m]=c[u],w(e,d)!=h);u++);else d[m]=c[h];k.push(r(e,d))}}else{h=f.val();if("?"==h)k=s;else if(""===h)k=null;else if(w)for(u=0;u<c.length;u++){if(d[m]=
c[u],w(e,d)==h){k=r(e,d);break}}else d[m]=c[h],n&&(d[n]=h),k=r(e,d);1<x[0].length&&x[0][1].id!==h&&(x[0][1].selected=!1)}g.$setViewValue(k)})});g.$render=h;e.$watch(h)}if(m[1]){var q=m[0];m=m[1];var p=h.multiple,t=h.ngOptions,v=!1,x,A=w(T.createElement("option")),B=w(T.createElement("optgroup")),z=A.clone();h=0;for(var y=g.children(),D=y.length;h<D;h++)if(""===y[h].value){x=v=y.eq(h);break}q.init(m,v,z);p&&(m.$isEmpty=function(a){return!a||0===a.length});t?n(e,g,m):p?l(e,g,m):k(e,g,m,q)}}}}],fd=["$interpolate",
function(a){var c={addOption:B,removeOption:B};return{restrict:"E",priority:100,compile:function(d,e){if(E(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),l=k.data("$selectController")||k.parent().data("$selectController");l&&l.databound?d.prop("selected",!1):l=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],ed=Y({restrict:"E",terminal:!0});
Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Ea=Q.jQuery)?(w=Ea,v(Ea.fn,{scope:Ha.scope,isolateScope:Ha.isolateScope,controller:Ha.controller,injector:Ha.injector,inheritedData:Ha.inheritedData}),zb("remove",!0,!0,!1),zb("empty",!1,!1,!1),zb("html",!1,!1,!0)):w=L,Ca.element=w,Xc(Ca),w(T).ready(function(){Uc(T,Yb)}))})(window,document);!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}</style>');
//# sourceMappingURL=angular.min.js.map
| contentfree/cdnjs | ajax/libs/angular.js/1.2.15/angular.min.js | JavaScript | mit | 103,155 |
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
WebInspector.SummaryBar = function(categories)
{
this.categories = categories;
this.element = document.createElement("div");
this.element.className = "summary-bar";
this.graphElement = document.createElement("canvas");
this.graphElement.setAttribute("width", "450");
this.graphElement.setAttribute("height", "38");
this.graphElement.className = "summary-graph";
this.element.appendChild(this.graphElement);
this.legendElement = document.createElement("div");
this.legendElement.className = "summary-graph-legend";
this.element.appendChild(this.legendElement);
}
WebInspector.SummaryBar.prototype = {
get calculator() {
return this._calculator;
},
set calculator(x) {
this._calculator = x;
},
reset: function()
{
this.legendElement.removeChildren();
this._drawSummaryGraph();
},
update: function(data)
{
var graphInfo = this.calculator.computeSummaryValues(data);
var fillSegments = [];
this.legendElement.removeChildren();
for (var category in this.categories) {
var size = graphInfo.categoryValues[category];
if (!size)
continue;
var colorString = this.categories[category].color;
var fillSegment = {color: colorString, value: size};
fillSegments.push(fillSegment);
var legendLabel = this._makeLegendElement(this.categories[category].title, this.calculator.formatValue(size), colorString);
this.legendElement.appendChild(legendLabel);
}
if (graphInfo.total) {
var totalLegendLabel = this._makeLegendElement(WebInspector.UIString("Total"), this.calculator.formatValue(graphInfo.total));
totalLegendLabel.addStyleClass("total");
this.legendElement.appendChild(totalLegendLabel);
}
this._drawSummaryGraph(fillSegments);
},
_drawSwatch: function(canvas, color)
{
var ctx = canvas.getContext("2d");
function drawSwatchSquare() {
ctx.fillStyle = color;
ctx.fillRect(0, 0, 13, 13);
var gradient = ctx.createLinearGradient(0, 0, 13, 13);
gradient.addColorStop(0.0, "rgba(255, 255, 255, 0.2)");
gradient.addColorStop(1.0, "rgba(255, 255, 255, 0.0)");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, 13, 13);
gradient = ctx.createLinearGradient(13, 13, 0, 0);
gradient.addColorStop(0.0, "rgba(0, 0, 0, 0.2)");
gradient.addColorStop(1.0, "rgba(0, 0, 0, 0.0)");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, 13, 13);
ctx.strokeStyle = "rgba(0, 0, 0, 0.6)";
ctx.strokeRect(0.5, 0.5, 12, 12);
}
ctx.clearRect(0, 0, 13, 24);
drawSwatchSquare();
ctx.save();
ctx.translate(0, 25);
ctx.scale(1, -1);
drawSwatchSquare();
ctx.restore();
this._fadeOutRect(ctx, 0, 13, 13, 13, 0.5, 0.0);
},
_drawSummaryGraph: function(segments)
{
if (!segments || !segments.length) {
segments = [{color: "white", value: 1}];
this._showingEmptySummaryGraph = true;
} else
delete this._showingEmptySummaryGraph;
// Calculate the total of all segments.
var total = 0;
for (var i = 0; i < segments.length; ++i)
total += segments[i].value;
// Calculate the percentage of each segment, rounded to the nearest percent.
var percents = segments.map(function(s) { return Math.max(Math.round(100 * s.value / total), 1) });
// Calculate the total percentage.
var percentTotal = 0;
for (var i = 0; i < percents.length; ++i)
percentTotal += percents[i];
// Make sure our percentage total is not greater-than 100, it can be greater
// if we rounded up for a few segments.
while (percentTotal > 100) {
for (var i = 0; i < percents.length && percentTotal > 100; ++i) {
if (percents[i] > 1) {
--percents[i];
--percentTotal;
}
}
}
// Make sure our percentage total is not less-than 100, it can be less
// if we rounded down for a few segments.
while (percentTotal < 100) {
for (var i = 0; i < percents.length && percentTotal < 100; ++i) {
++percents[i];
++percentTotal;
}
}
var ctx = this.graphElement.getContext("2d");
var x = 0;
var y = 0;
var w = 450;
var h = 19;
var r = (h / 2);
function drawPillShadow()
{
// This draws a line with a shadow that is offset away from the line. The line is stroked
// twice with different X shadow offsets to give more feathered edges. Later we erase the
// line with destination-out 100% transparent black, leaving only the shadow. This only
// works if nothing has been drawn into the canvas yet.
ctx.beginPath();
ctx.moveTo(x + 4, y + h - 3 - 0.5);
ctx.lineTo(x + w - 4, y + h - 3 - 0.5);
ctx.closePath();
ctx.save();
ctx.shadowBlur = 2;
ctx.shadowColor = "rgba(0, 0, 0, 0.5)";
ctx.shadowOffsetX = 3;
ctx.shadowOffsetY = 5;
ctx.strokeStyle = "white";
ctx.lineWidth = 1;
ctx.stroke();
ctx.shadowOffsetX = -3;
ctx.stroke();
ctx.restore();
ctx.save();
ctx.globalCompositeOperation = "destination-out";
ctx.strokeStyle = "rgba(0, 0, 0, 1)";
ctx.lineWidth = 1;
ctx.stroke();
ctx.restore();
}
function drawPill()
{
// Make a rounded rect path.
ctx.beginPath();
ctx.moveTo(x, y + r);
ctx.lineTo(x, y + h - r);
ctx.arc(x + r, y + h - r, r, Math.PI, Math.PI / 2, true);
ctx.lineTo(x + w - r, y + h);
ctx.arc(x + w - r, y + h - r, r, Math.PI / 2, 0, true);
ctx.lineTo(x + w, y + r);
ctx.arc(x + w - r, y + r, r, 0, 3 * Math.PI / 2, true);
ctx.lineTo(x + r, y);
ctx.arc(x + r, y + r, r, Math.PI / 2, Math.PI, true);
ctx.closePath();
// Clip to the rounded rect path.
ctx.save();
ctx.clip();
// Fill the segments with the associated color.
var previousSegmentsWidth = 0;
for (var i = 0; i < segments.length; ++i) {
var segmentWidth = Math.round(w * percents[i] / 100);
ctx.fillStyle = segments[i].color;
ctx.fillRect(x + previousSegmentsWidth, y, segmentWidth, h);
previousSegmentsWidth += segmentWidth;
}
// Draw the segment divider lines.
ctx.lineWidth = 1;
for (var i = 1; i < 20; ++i) {
ctx.beginPath();
ctx.moveTo(x + (i * Math.round(w / 20)) + 0.5, y);
ctx.lineTo(x + (i * Math.round(w / 20)) + 0.5, y + h);
ctx.closePath();
ctx.strokeStyle = "rgba(0, 0, 0, 0.2)";
ctx.stroke();
ctx.beginPath();
ctx.moveTo(x + (i * Math.round(w / 20)) + 1.5, y);
ctx.lineTo(x + (i * Math.round(w / 20)) + 1.5, y + h);
ctx.closePath();
ctx.strokeStyle = "rgba(255, 255, 255, 0.2)";
ctx.stroke();
}
// Draw the pill shading.
var lightGradient = ctx.createLinearGradient(x, y, x, y + (h / 1.5));
lightGradient.addColorStop(0.0, "rgba(220, 220, 220, 0.6)");
lightGradient.addColorStop(0.4, "rgba(220, 220, 220, 0.2)");
lightGradient.addColorStop(1.0, "rgba(255, 255, 255, 0.0)");
var darkGradient = ctx.createLinearGradient(x, y + (h / 3), x, y + h);
darkGradient.addColorStop(0.0, "rgba(0, 0, 0, 0.0)");
darkGradient.addColorStop(0.8, "rgba(0, 0, 0, 0.2)");
darkGradient.addColorStop(1.0, "rgba(0, 0, 0, 0.5)");
ctx.fillStyle = darkGradient;
ctx.fillRect(x, y, w, h);
ctx.fillStyle = lightGradient;
ctx.fillRect(x, y, w, h);
ctx.restore();
}
ctx.clearRect(x, y, w, (h * 2));
drawPillShadow();
drawPill();
ctx.save();
ctx.translate(0, (h * 2) + 1);
ctx.scale(1, -1);
drawPill();
ctx.restore();
this._fadeOutRect(ctx, x, y + h + 1, w, h, 0.5, 0.0);
},
_fadeOutRect: function(ctx, x, y, w, h, a1, a2)
{
ctx.save();
var gradient = ctx.createLinearGradient(x, y, x, y + h);
gradient.addColorStop(0.0, "rgba(0, 0, 0, " + (1.0 - a1) + ")");
gradient.addColorStop(0.8, "rgba(0, 0, 0, " + (1.0 - a2) + ")");
gradient.addColorStop(1.0, "rgba(0, 0, 0, 1.0)");
ctx.globalCompositeOperation = "destination-out";
ctx.fillStyle = gradient;
ctx.fillRect(x, y, w, h);
ctx.restore();
},
_makeLegendElement: function(label, value, color)
{
var legendElement = document.createElement("label");
legendElement.className = "summary-graph-legend-item";
if (color) {
var swatch = document.createElement("canvas");
swatch.className = "summary-graph-legend-swatch";
swatch.setAttribute("width", "13");
swatch.setAttribute("height", "24");
legendElement.appendChild(swatch);
this._drawSwatch(swatch, color);
}
var labelElement = document.createElement("div");
labelElement.className = "summary-graph-legend-label";
legendElement.appendChild(labelElement);
var headerElement = document.createElement("div");
headerElement.className = "summary-graph-legend-header";
headerElement.textContent = label;
labelElement.appendChild(headerElement);
var valueElement = document.createElement("div");
valueElement.className = "summary-graph-legend-value";
valueElement.textContent = value;
labelElement.appendChild(valueElement);
return legendElement;
}
}
WebInspector.SummaryBar.prototype.__proto__ = WebInspector.Object.prototype;
| bash7012/angular-tour-of-heros | node_modules/weinre/web/client/SummaryBar.js | JavaScript | mit | 12,287 |
({"dateFormat-medium":"dd/MM/yyyy","dateFormatItem-MMMEd":"E, d בMMM","dateFormatItem-yMEd":"EEE, d.M.yyyy","eraNarrow":["לבה״ע"],"dateFormatItem-Md":"d/M","months-standAlone-wide":["תשרי","חשון","כסלו","טבת","שבט","אדר א׳","אדר","ניסן","אייר","סיון","תמוז","אב","אלול"],"months-format-wide-leap":"אדר ב׳","dateFormatItem-EEEd":"EEE ה-d","eraNames":["לבה״ע"],"days-standAlone-narrow":["א","ב","ג","ד","ה","ו","ש"],"dateFormatItem-MMMMEd":"E, d בMMMM","dayPeriods-format-wide-pm":"אחה״צ","months-standAlone-abbr":["תשרי","חשון","כסלו","טבת","שבט","אדר א׳","אדר","ניסן","אייר","סיון","תמוז","אב","אלול"],"dayPeriods-format-wide-am":"לפנה״צ","dateFormat-long":"d בMMMM y","dateFormat-short":"dd/MM/yy","dateFormatItem-yMMMEd":"EEE, d בMMM y","months-format-wide":["תשרי","חשון","כסלו","טבת","שבט","אדר א׳","אדר","ניסן","אייר","סיון","תמוז","אב","אלול"],"dateFormatItem-yM":"M.yyyy","months-format-abbr":["תשרי","חשון","כסלו","טבת","שבט","אדר א׳","אדר","ניסן","אייר","סיון","תמוז","אב","אלול"],"eraAbbr":["לבה״ע"],"days-format-wide":["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","יום שבת"],"dateFormatItem-yQ":"yyyy Q","dateFormatItem-yMMM":"MMM y","quarters-format-wide":["רבעון 1","רבעון 2","רבעון 3","רבעון 4"],"dateFormat-full":"EEEE, d בMMMM y","dateFormatItem-MMMd":"d בMMM","days-format-abbr":["יום א׳","יום ב׳","יום ג׳","יום ד׳","יום ה׳","יום ו׳","שבת"],"months-format-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"quarters-standAlone-narrow":["1","2","3","4"],"dateFormatItem-yQQQ":"y QQQ","months-standAlone-narrow-leap":"Adar II","dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormat-medium":"{1} {0}","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z","dateTimeFormats-appendItem-Era":"{0} {1}","months-format-abbr-leap":"Adar II","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","dateFormatItem-H":"HH","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L","days-standAlone-wide":["1","2","3","4","5","6","7"],"months-standAlone-wide-leap":"Adar II","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],"months-format-narrow-leap":"Adar II","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","months-standAlone-abbr-leap":"Adar II","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"}) | kirbyfan64/cdnjs | ajax/libs/dojo/1.5.1/cldr/nls/he/hebrew.js | JavaScript | mit | 3,867 |
({"months-format-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"quarters-standAlone-narrow":["1","2","3","4"],"dateFormatItem-yQQQ":"y QQQ","months-standAlone-narrow-leap":"Adar II","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d","eraNarrow":["AM"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"dateTimeFormat-medium":"{1} {0}","dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateFormatItem-yM":"y-M","months-standAlone-wide":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q","dateTimeFormats-appendItem-Era":"{0} {1}","months-format-abbr-leap":"Adar II","months-format-abbr":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","dateFormatItem-H":"HH","months-standAlone-abbr":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L","days-standAlone-wide":["1","2","3","4","5","6","7"],"months-standAlone-wide-leap":"Adar II","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],"months-format-narrow-leap":"Adar II","eraAbbr":["AM"],"days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","days-format-wide":["1","2","3","4","5","6","7"],"months-standAlone-abbr-leap":"Adar II","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1","2","3","4","5","6","7"],"eraNames":["AM"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","months-format-wide-leap":"Adar II"}) | iamJoeTaylor/cdnjs | ajax/libs/dojo/1.6.3/cldr/nls/hebrew.js | JavaScript | mit | 3,418 |
({"months-format-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"quarters-standAlone-narrow":["1","2","3","4"],"dateFormatItem-yQQQ":"y QQQ","months-standAlone-narrow-leap":"Adar II","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d","eraNarrow":["AM"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"dateTimeFormat-medium":"{1} {0}","dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateFormatItem-yM":"y-M","months-standAlone-wide":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q","dateTimeFormats-appendItem-Era":"{0} {1}","months-format-abbr-leap":"Adar II","months-format-abbr":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","dateFormatItem-H":"HH","months-standAlone-abbr":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L","days-standAlone-wide":["1","2","3","4","5","6","7"],"months-standAlone-wide-leap":"Adar II","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],"months-format-narrow-leap":"Adar II","eraAbbr":["AM"],"days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","days-format-wide":["1","2","3","4","5","6","7"],"months-standAlone-abbr-leap":"Adar II","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1","2","3","4","5","6","7"],"eraNames":["AM"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","months-format-wide-leap":"Adar II"}) | cloudrifles/cdnjs | ajax/libs/dojo/1.5.4/cldr/nls/hebrew.js | JavaScript | mit | 3,418 |
({"months-format-narrow":["O","Ş","M","N","M","H","T","A","E","E","K","A"],"field-weekday":"Haftanın Günü","dateFormatItem-yyQQQQ":"QQQQ yy","dateFormatItem-yQQQ":"QQQ y","dateFormatItem-yMEd":"dd.MM.yyyy EEE","dateFormatItem-MMMEd":"dd MMM E","eraNarrow":["MÖ","MS"],"dateFormat-long":"dd MMMM y","months-format-wide":["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"dd MMMM y EEEE","dateFormatItem-Md":"dd/MM","field-era":"Miladi Dönem","dateFormatItem-yM":"M/yyyy","months-standAlone-wide":["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],"timeFormat-short":"HH:mm","quarters-format-wide":["1. çeyrek","2. çeyrek","3. çeyrek","4. çeyrek"],"timeFormat-long":"HH:mm:ss z","field-year":"Yıl","dateFormatItem-yMMM":"MMM y","dateFormatItem-yQ":"Q yyyy","field-hour":"Saat","months-format-abbr":["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],"dateFormatItem-yyQ":"Q yy","timeFormat-full":"HH:mm:ss zzzz","field-day-relative+0":"Bugün","field-day-relative+1":"Yarın","field-day-relative+2":"Yarından sonraki gün","dateFormatItem-H":"HH","field-day-relative+3":"Üç gün sonra","months-standAlone-abbr":["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],"quarters-format-abbr":["Ç1","Ç2","Ç3","Ç4"],"quarters-standAlone-wide":["1. çeyrek","2. çeyrek","3. çeyrek","4. çeyrek"],"dateFormatItem-M":"L","days-standAlone-wide":["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],"dateFormatItem-MMMMd":"dd MMMM","dateFormatItem-yyMMM":"MMM yy","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Ç1","Ç2","Ç3","Ç4"],"eraAbbr":["MÖ","MS"],"field-minute":"Dakika","field-dayperiod":"AM/PM","days-standAlone-abbr":["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","field-day-relative+-1":"Dün","field-day-relative+-2":"Evvelsi gün","field-day-relative+-3":"Üç gün önce","dateFormatItem-MMMd":"dd MMM","dateFormatItem-MEd":"dd/MM E","dateFormatItem-yMMMM":"MMMM y","field-day":"Gün","days-format-wide":["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],"field-zone":"Saat Dilimi","dateFormatItem-y":"y","months-standAlone-narrow":["O","Ş","M","N","M","H","T","A","E","E","K","A"],"dateFormatItem-yyMM":"MM/yy","dateFormatItem-hm":"h:mm a","days-format-abbr":["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],"eraNames":["Milattan Önce","Milattan Sonra"],"days-format-narrow":["P","P","S","Ç","P","C","C"],"field-month":"Ay","days-standAlone-narrow":["P","P","S","Ç","P","C","C"],"dateFormatItem-MMM":"LLL","dayPeriods-format-wide-am":"AM","dateFormatItem-MMMMEd":"dd MMMM E","dateFormat-short":"dd.MM.yyyy","field-second":"Saniye","dateFormatItem-yMMMEd":"dd MMM y EEE","dateFormatItem-Ed":"d E","field-week":"Hafta","dateFormat-medium":"dd MMM y","dateFormatItem-mmss":"mm:ss","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yyyy":"y","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormat-medium":"{1} {0}","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateTimeFormats-appendItem-Era":"{0} {1}","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","quarters-format-narrow":["1","2","3","4"],"dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateTimeFormat-full":"{1} {0}","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}"}) | voronianski/cdnjs | ajax/libs/dojo/1.5.1/cldr/nls/tr/gregorian.js | JavaScript | mit | 4,102 |
({"field-dayperiod":"Časť dňa","dateFormatItem-yQ":"Q yyyy","dayPeriods-format-wide-pm":"popoludní","field-minute":"Minúta","eraNames":["pred n.l.","n.l."],"dateFormatItem-MMMEd":"E, d. MMM","field-day-relative+-1":"Včera","field-weekday":"Deň v týždni","dateFormatItem-yQQQ":"QQQ y","field-day-relative+-2":"Predvčerom","field-day-relative+-3":"Pred tromi dňami","days-standAlone-wide":["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],"months-standAlone-narrow":["j","f","m","a","m","j","j","a","s","o","n","d"],"field-era":"Éra","field-hour":"Hodina","dayPeriods-format-wide-am":"dopoludnia","timeFormat-full":"H:mm:ss zzzz","months-standAlone-abbr":["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],"dateFormatItem-yMMM":"LLL y","field-day-relative+0":"Dnes","field-day-relative+1":"Zajtra","days-standAlone-narrow":["N","P","U","S","Š","P","S"],"eraAbbr":["pred n.l.","n.l."],"field-day-relative+2":"Pozajtra","field-day-relative+3":"O tri dni","dateFormatItem-yyyyMMMM":"LLLL y","dateFormat-long":"d. MMMM y","timeFormat-medium":"H:mm:ss","dateFormatItem-EEEd":"EEE, d.","field-zone":"Pásmo","dateFormatItem-Hm":"H:mm","dateFormat-medium":"d.M.yyyy","dateFormatItem-Hms":"H:mm:ss","dateFormatItem-yyQQQQ":"QQQQ yy","quarters-standAlone-wide":["1. štvrťrok","2. štvrťrok","3. štvrťrok","4. štvrťrok"],"dateFormatItem-yMMMM":"LLLL y","dateFormatItem-ms":"mm:ss","field-year":"Rok","months-standAlone-wide":["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],"field-week":"Týždeň","dateFormatItem-MMMMEd":"E, d. MMMM","dateFormatItem-MMMd":"d. MMM","dateFormatItem-yyQ":"Q yy","timeFormat-long":"H:mm:ss z","months-format-abbr":["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],"timeFormat-short":"H:mm","dateFormatItem-H":"H","field-month":"Mesiac","dateFormatItem-MMMMd":"d. MMMM","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["ne","po","ut","st","št","pi","so"],"dateFormatItem-mmss":"mm:ss","days-format-narrow":["N","P","U","S","Š","P","S"],"field-second":"Sekunda","field-day":"Deň","dateFormatItem-MEd":"E, d.M.","months-format-narrow":["j","f","m","a","m","j","j","a","s","o","n","d"],"days-standAlone-abbr":["ne","po","ut","st","št","pi","so"],"dateFormat-short":"d.M.yyyy","dateFormatItem-yyyyM":"M.yyyy","dateFormatItem-yMMMEd":"EEE, d. MMM y","dateFormat-full":"EEEE, d. MMMM y","dateFormatItem-Md":"d.M.","dateFormatItem-yMEd":"EEE, d.M.yyyy","months-format-wide":["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],"dateFormatItem-d":"d.","quarters-format-wide":["1. štvrťrok","2. štvrťrok","3. štvrťrok","4. štvrťrok"],"days-format-wide":["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],"eraNarrow":["pred n.l.","n.l."],"quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormat-medium":"{1} {0}","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateFormatItem-yM":"y-M","dateTimeFormats-appendItem-Era":"{0} {1}","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","dateFormatItem-M":"L","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],"quarters-format-narrow":["1","2","3","4"],"dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateTimeFormat-full":"{1} {0}","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","dateFormatItem-MMM":"LLL","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-hms":"h:mm:ss a"}) | WebReflection/cdnjs | ajax/libs/dojo/1.6.3/cldr/nls/sk/gregorian.js | JavaScript | mit | 4,065 |
YUI.add("cookie",function(c){var k=c.Lang,i=c.Object,g=null,d=k.isString,n=k.isObject,f=k.isUndefined,e=k.isFunction,h=encodeURIComponent,b=decodeURIComponent,m=c.config.doc;function j(o){throw new TypeError(o);}function l(o){if(!d(o)||o===""){j("Cookie name must be a non-empty string.");}}function a(o){if(!d(o)||o===""){j("Subcookie name must be a non-empty string.");}}c.Cookie={_createCookieString:function(q,t,r,p){p=p||{};var v=h(q)+"="+(r?h(t):t),o=p.expires,u=p.path,s=p.domain;if(n(p)){if(o instanceof Date){v+="; expires="+o.toUTCString();}if(d(u)&&u!==""){v+="; path="+u;}if(d(s)&&s!==""){v+="; domain="+s;}if(p.secure===true){v+="; secure";}}return v;},_createCookieHashString:function(o){if(!n(o)){j("Cookie._createCookieHashString(): Argument must be an object.");}var p=[];i.each(o,function(r,q){if(!e(r)&&!f(r)){p.push(h(q)+"="+h(String(r)));}});return p.join("&");},_parseCookieHash:function(s){var r=s.split("&"),t=g,q={};if(s.length){for(var p=0,o=r.length;p<o;p++){t=r[p].split("=");q[b(t[0])]=b(t[1]);}}return q;},_parseCookieString:function(w,y){var x={};if(d(w)&&w.length>0){var o=(y===false?function(z){return z;}:b),u=w.split(/;\s/g),v=g,p=g,r=g;for(var q=0,s=u.length;q<s;q++){r=u[q].match(/([^=]+)=/i);if(r instanceof Array){try{v=b(r[1]);p=o(u[q].substring(r[1].length+1));}catch(t){}}else{v=b(u[q]);p="";}x[v]=p;}}return x;},_setDoc:function(o){m=o;},exists:function(o){l(o);var p=this._parseCookieString(m.cookie,true);return p.hasOwnProperty(o);},get:function(p,o){l(p);var s,q,r;if(e(o)){r=o;o={};}else{if(n(o)){r=o.converter;}else{o={};}}s=this._parseCookieString(m.cookie,!o.raw);q=s[p];if(f(q)){return g;}if(!e(r)){return q;}else{return r(q);}},getSub:function(o,q,p){var r=this.getSubs(o);if(r!==g){a(q);if(f(r[q])){return g;}if(!e(p)){return r[q];}else{return p(r[q]);}}else{return g;}},getSubs:function(o){l(o);var p=this._parseCookieString(m.cookie,false);if(d(p[o])){return this._parseCookieHash(p[o]);}return g;},remove:function(p,o){l(p);o=c.merge(o||{},{expires:new Date(0)});return this.set(p,"",o);},removeSub:function(p,s,o){l(p);a(s);o=o||{};var r=this.getSubs(p);if(n(r)&&r.hasOwnProperty(s)){delete r[s];if(!o.removeIfEmpty){return this.setSubs(p,r,o);}else{for(var q in r){if(r.hasOwnProperty(q)&&!e(r[q])&&!f(r[q])){return this.setSubs(p,r,o);}}return this.remove(p,o);}}else{return"";}},set:function(p,q,o){l(p);if(f(q)){j("Cookie.set(): Value cannot be undefined.");}o=o||{};var r=this._createCookieString(p,q,!o.raw,o);m.cookie=r;return r;},setSub:function(p,r,q,o){l(p);a(r);if(f(q)){j("Cookie.setSub(): Subcookie value cannot be undefined.");}var s=this.getSubs(p);if(!n(s)){s={};}s[r]=q;return this.setSubs(p,s,o);},setSubs:function(p,q,o){l(p);if(!n(q)){j("Cookie.setSubs(): Cookie value must be an object.");}var r=this._createCookieString(p,this._createCookieHashString(q),false,o);m.cookie=r;return r;}};},"@VERSION@",{requires:["yui-base"]}); | GaryChamberlain/cdnjs | ajax/libs/yui/3.6.0pr1/cookie/cookie-min.js | JavaScript | mit | 2,905 |
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){!function(t){function e(e){return"boolean"==typeof e&&(e={add:e,update:e}),"object"!=typeof e&&(e={}),e=t.extend(!0,{},t[o].defaults[s],e)}function n(t){return t}function a(){c=!0,d=t[o]._c,r=t[o]._d,u=t[o]._e,d.add("counter search noresultsmsg"),r.add("updatecounter"),i=t[o].glbl}var o="mmenu",s="counters";t[o].prototype["_init_"+s]=function(o){c||a();var u=this.vars[s+"_added"];this.vars[s+"_added"]=!0,u||(this.opts[s]=e(this.opts[s]),this.conf[s]=n(this.conf[s]));var i=this,f=this.opts[s];this.conf[s],this.__refactorClass(t("em",o),this.conf.classNames[s].counter,"counter"),f.add&&o.each(function(){var e=t(this).data(r.parent);e&&(e.find("> em."+d.counter).length||e.prepend(t('<em class="'+d.counter+'" />')))}),f.update&&o.each(function(){var e=t(this),n=e.data(r.parent);if(n){var a=n.find("> em."+d.counter);a.length&&(e.is("."+d.list)||(e=e.find("> ."+d.list)),e.length&&!e.data(r.updatecounter)&&(e.data(r.updatecounter,!0),i._update(function(){var t=e.children().not("."+d.label).not("."+d.subtitle).not("."+d.hidden).not("."+d.search).not("."+d.noresultsmsg);a.html(t.length)})))}})},t[o].addons.push(s),t[o].defaults[s]={add:!1,update:!1},t[o].configuration.classNames[s]={counter:"Counter"};var d,r,u,i,c=!1}(t)}); | andersem/cdnjs | ajax/libs/jQuery.mmenu/4.6.0/js/umd/addons/jquery.mmenu.counters.umd.min.js | JavaScript | mit | 1,373 |
/*
* Metadata - jQuery plugin for parsing metadata from elements
*
* Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
* in the JSON will become a property of the element itself.
*
* There are three supported types of metadata storage:
*
* attr: Inside an attribute. The name parameter indicates *which* attribute.
*
* class: Inside the class attribute, wrapped in curly braces: { }
*
* elem: Inside a child element (e.g. a script tag). The
* name parameter indicates *which* element.
*
* The metadata for an element is loaded the first time the element is accessed via jQuery.
*
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
*
* @name $.metadata.setType
*
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("class")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from the class attribute
*
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("attr", "data")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a "data" attribute
*
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
* @before $.metadata.setType("elem", "script")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a nested script element
*
* @param String type The encoding type
* @param String name The name of the attribute to be used to get metadata (optional)
* @cat Plugins/Metadata
* @descr Sets the type of encoding to be used when loading metadata for the first time
* @type undefined
* @see metadata()
*/
(function($) {
$.extend({
metadata : {
defaults : {
type: 'class',
name: 'metadata',
cre: /(\{.*\})/,
single: 'metadata'
},
setType: function( type, name ){
this.defaults.type = type;
this.defaults.name = name;
},
get: function( elem, opts ){
var data, m, e, attr,
settings = $.extend({},this.defaults,opts);
// check for empty string in single property
if ( !settings.single.length ) { settings.single = 'metadata'; }
data = $.data(elem, settings.single);
// returned cached data if it already exists
if ( data ) { return data; }
data = "{}";
if ( settings.type === "class" ) {
m = settings.cre.exec( elem.className );
if ( m ) { data = m[1]; }
} else if ( settings.type === "elem" ) {
if( !elem.getElementsByTagName ) { return undefined; }
e = elem.getElementsByTagName(settings.name);
if ( e.length ) { data = $.trim(e[0].innerHTML); }
} else if ( elem.getAttribute !== undefined ) {
attr = elem.getAttribute( settings.name );
if ( attr ) { data = attr; }
}
if ( data.indexOf( '{' ) <0 ) { data = "{" + data + "}"; }
data = eval("(" + data + ")");
$.data( elem, settings.single, data );
return data;
}
}
});
/**
* Returns the metadata object for the first member of the jQuery object.
*
* @name metadata
* @descr Returns element's metadata object
* @param Object opts An object contianing settings to override the defaults
* @type jQuery
* @cat Plugins/Metadata
*/
$.fn.metadata = function( opts ){
return $.metadata.get( this[0], opts );
};
})(jQuery); | brix/cdnjs | ajax/libs/jquery.tablesorter/2.16.0/jquery.metadata.js | JavaScript | mit | 3,839 |
#!/usr/bin/perl
# ********************************************************************
# * COPYRIGHT:
# * Copyright (c) 2008-2013, International Business Machines Corporation and
# * others. All Rights Reserved.
# ********************************************************************
#use strict;
use lib '../perldriver';
require "../perldriver/Common.pl";
use PerfFramework;
my $options = {
"title"=>"Collation performanceregression: ICU (".$ICUPreviousVersion." and ".$ICULatestVersion.")",
"headers"=>"ICU".$ICUPreviousVersion." ICU".$ICULatestVersion,
"operationIs"=>"unicode String",
"passes"=>"1",
"time"=>"2",
#"outputType"=>"HTML",
"dataDir"=>$CollationDataPath,
"outputDir"=>"../results"
};
# programs
# tests will be done for all the programs. Results will be stored and connected
my $p1, $p2;
if ($OnWindows) {
$p1 = "cd ".$ICUPrevious."/bin && ".$ICUPathPrevious."/collperf/$WindowsPlatform/Release/collperf.exe";
$p2 = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/collperf/$WindowsPlatform/Release/collperf.exe";
} else {
$p1 = "LD_LIBRARY_PATH=".$ICUPrevious."/source/lib:".$ICUPrevious."/source/tools/ctestfw ".$ICUPathPrevious."/collperf/collperf";
$p2 = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/collperf/collperf";
}
my $tests = {
"Key Gen ICU null", ["$p1,TestIcu_KeyGen_null", "$p2,TestIcu_KeyGen_null"],
"Key Gen ICU len", ["$p1,TestIcu_KeyGen_len", "$p2,TestIcu_KeyGen_len"],
"Iteration icu forward null", ["$p1,TestIcu_ForwardIter_null", "$p2,TestIcu_ForwardIter_null"],
"Iteration icu forward len", ["$p1,TestIcu_ForwardIter_len", "$p2,TestIcu_ForwardIter_len"],
"Iteration icu backward null", ["$p1,TestIcu_BackwardIter_null", "$p2,TestIcu_BackwardIter_null"],
"Iteration icu backward len", ["$p1,TestIcu_BackwardIter_len", "$p2,TestIcu_BackwardIter_len"],
"Iteration/all icu forward null", ["$p1,TestIcu_ForwardIter_all_null", "$p2,TestIcu_ForwardIter_all_null"],
"Iteration/all icu forward len", ["$p1,TestIcu_ForwardIter_all_len", "$p2,TestIcu_ForwardIter_all_len"],
"Iteration/all icu backward null", ["$p1,TestIcu_BackwardIter_all_null", "$p2,TestIcu_BackwardIter_all_null"],
"Iteration/all icu backward len", ["$p1,TestIcu_BackwardIter_all_len", "$p2,TestIcu_BackwardIter_all_len"],
"qsort icu strcoll null", ["$p1,TestIcu_qsort_strcoll_null", "$p2,TestIcu_qsort_strcoll_null"],
"qsort icu strcoll len", ["$p1,TestIcu_qsort_strcoll_len", "$p2,TestIcu_qsort_strcoll_len"],
"qsort icu use key", ["$p1,TestIcu_qsort_usekey", "$p2,TestIcu_qsort_usekey"],
"Binary Search icu strcoll null", ["$p1,TestIcu_BinarySearch_strcoll_null", "$p2,TestIcu_BinarySearch_strcoll_null"],
"Binary Search icu strcoll len", ["$p1,TestIcu_BinarySearch_strcoll_len", "$p2,TestIcu_BinarySearch_strcoll_len"],
"Binary Search icu use key", ["$p1,TestIcu_BinarySearch_usekey", "$p2,TestIcu_BinarySearch_usekey"],
"Binary Search icu u_strcmp", ["$p1,TestIcu_BinarySearch_strcmp", "$p2,TestIcu_BinarySearch_strcmp"],
"Binary Search icu cmpCPO", ["$p1,TestIcu_BinarySearch_cmpCPO", "$p2,TestIcu_BinarySearch_cmpCPO"],
};
my $dataFiles = {
"",
[
"TestNames_Asian.txt",
"TestNames_Chinese.txt",
"TestNames_Japanese.txt",
"TestNames_Japanese_h.txt",
"TestNames_Japanese_k.txt",
"TestNames_Korean.txt",
"TestNames_Latin.txt",
"TestNames_Russian.txt",
"TestNames_SerbianSH.txt",
"TestNames_SerbianSR.txt",
"TestNames_Simplified_Chinese.txt",
"TestNames_Thai.txt"
]
};
runTests($options, $tests, $dataFiles);
| MavenRain/WinObjC | deps/3rdparty/icu/icu/source/test/perf/collperf/CollPerf_r.pl | Perl | mit | 3,720 |
var expect = require('chai').expect,
objectPath = require('./index.js');
function getTestObj() {
return {
a: 'b',
b: {
c: [],
d: ['a', 'b'],
e: [{},{f: 'g'}],
f: 'i'
}
};
}
describe('get', function() {
it('should return the value under shallow object', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'a')).to.be.equal('b');
expect(objectPath.get(obj, ['a'])).to.be.equal('b');
});
it('should work with number path', function() {
var obj = getTestObj();
expect(objectPath.get(obj.b.d, 0)).to.be.equal('a');
expect(objectPath.get(obj.b, 0)).to.be.equal(void 0);
});
it('should return the value under deep object', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'b.f')).to.be.equal('i');
expect(objectPath.get(obj, ['b','f'])).to.be.equal('i');
});
it('should return the value under array', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'b.d.0')).to.be.equal('a');
expect(objectPath.get(obj, ['b','d',0])).to.be.equal('a');
});
it('should return the value under array deep', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'b.e.1.f')).to.be.equal('g');
expect(objectPath.get(obj, ['b','e',1,'f'])).to.be.equal('g');
});
it('should return undefined for missing values under object', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'a.b')).to.not.exist;
expect(objectPath.get(obj, ['a','b'])).to.not.exist;
});
it('should return undefined for missing values under array', function() {
var obj = getTestObj();
expect(objectPath.get(obj, 'b.d.5')).to.not.exist;
expect(objectPath.get(obj, ['b','d','5'])).to.not.exist;
});
it('should return the value under integer-like key', function() {
var obj = { '1a': 'foo' };
expect(objectPath.get(obj, '1a')).to.be.equal('foo');
expect(objectPath.get(obj, ['1a'])).to.be.equal('foo');
});
it('should return the default value when the key doesnt exist', function() {
var obj = { '1a': 'foo' };
expect(objectPath.get(obj, '1b', null)).to.be.equal(null);
expect(objectPath.get(obj, ['1b'], null)).to.be.equal(null);
});
it('should return the default value when path is empty', function() {
var obj = { '1a': 'foo' };
expect(objectPath.get(obj, '', null)).to.be.deep.equal({ '1a': 'foo' });
expect(objectPath.get(obj, [])).to.be.deep.equal({ '1a': 'foo' });
expect(objectPath.get({ }, ['1'])).to.be.equal(undefined);
});
it('should skip non own properties with isEmpty', function(){
var Base = function(enabled){ };
Base.prototype = {
one: {
two: true
}
};
var Extended = function(){
Base.call(this, true);
};
Extended.prototype = Object.create(Base.prototype);
var extended = new Extended();
expect(objectPath.get(extended, ['one','two'])).to.be.equal(undefined);
extended.enabled = true;
expect(objectPath.get(extended, 'enabled')).to.be.equal(true);
});
});
describe('set', function() {
it('should set value under shallow object', function() {
var obj = getTestObj();
objectPath.set(obj, 'c', {m: 'o'});
expect(obj).to.have.deep.property('c.m', 'o');
obj = getTestObj();
objectPath.set(obj, ['c'], {m: 'o'});
expect(obj).to.have.deep.property('c.m', 'o');
});
it('should set value using number path', function() {
var obj = getTestObj();
objectPath.set(obj.b.d, 0, 'o');
expect(obj).to.have.deep.property('b.d.0', 'o');
});
it('should set value under deep object', function() {
var obj = getTestObj();
objectPath.set(obj, 'b.c', 'o');
expect(obj).to.have.deep.property('b.c', 'o');
obj = getTestObj();
objectPath.set(obj, ['b','c'], 'o');
expect(obj).to.have.deep.property('b.c', 'o');
});
it('should set value under array', function() {
var obj = getTestObj();
objectPath.set(obj, 'b.e.1.g', 'f');
expect(obj).to.have.deep.property('b.e.1.g', 'f');
obj = getTestObj();
objectPath.set(obj, ['b','e',1,'g'], 'f');
expect(obj).to.have.deep.property('b.e.1.g', 'f');
});
it('should create intermediate objects', function() {
var obj = getTestObj();
objectPath.set(obj, 'c.d.e.f', 'l');
expect(obj).to.have.deep.property('c.d.e.f', 'l');
obj = getTestObj();
objectPath.set(obj, ['c','d','e','f'], 'l');
expect(obj).to.have.deep.property('c.d.e.f', 'l');
});
it('should create intermediate arrays', function() {
var obj = getTestObj();
objectPath.set(obj, 'c.0.1.m', 'l');
expect(obj.c).to.be.an('array');
expect(obj.c[0]).to.be.an('array');
expect(obj).to.have.deep.property('c.0.1.m', 'l');
obj = getTestObj();
objectPath.set(obj, ['c','0', 1,'m'], 'l');
expect(obj.c).to.be.an('object');
expect(obj.c[0]).to.be.an('array');
expect(obj).to.have.deep.property('c.0.1.m', 'l');
});
it('should set value under integer-like key', function() {
var obj = getTestObj();
objectPath.set(obj, '1a', 'foo');
expect(obj).to.have.deep.property('1a', 'foo');
obj = getTestObj();
objectPath.set(obj, ['1a'], 'foo');
expect(obj).to.have.deep.property('1a', 'foo');
});
it('should set value under empty array', function() {
var obj = [];
objectPath.set(obj, [0], 'foo');
expect(obj[0]).to.be.equal('foo');
obj = [];
objectPath.set(obj, '0', 'foo');
expect(obj[0]).to.be.equal('foo');
});
});
describe('push', function() {
it('should push value to existing array', function() {
var obj = getTestObj();
objectPath.push(obj, 'b.c', 'l');
expect(obj).to.have.deep.property('b.c.0', 'l');
obj = getTestObj();
objectPath.push(obj, ['b','c'], 'l');
expect(obj).to.have.deep.property('b.c.0', 'l');
});
it('should push value to new array', function() {
var obj = getTestObj();
objectPath.push(obj, 'b.h', 'l');
expect(obj).to.have.deep.property('b.h.0', 'l');
obj = getTestObj();
objectPath.push(obj, ['b','h'], 'l');
expect(obj).to.have.deep.property('b.h.0', 'l');
});
it('should push value to existing array using number path', function() {
var obj = getTestObj();
objectPath.push(obj.b.e, 0, 'l');
expect(obj).to.have.deep.property('b.e.0.0', 'l');
});
});
describe('ensureExists', function() {
it('should create the path if it does not exists', function() {
var obj = getTestObj();
var oldVal = objectPath.ensureExists(obj, 'b.g.1.l', 'test');
expect(oldVal).to.not.exist;
expect(obj).to.have.deep.property('b.g.1.l', 'test');
oldVal = objectPath.ensureExists(obj, 'b.g.1.l', 'test1');
expect(oldVal).to.be.equal('test');
expect(obj).to.have.deep.property('b.g.1.l', 'test');
});
it('should return the object if path is empty', function() {
var obj = getTestObj();
expect(objectPath.ensureExists(obj, [], 'test')).to.have.property('a', 'b');
});
it('Issue #26', function() {
var any = {};
objectPath.ensureExists(any, ['1','1'], {});
expect(any).to.be.an('object');
expect(any[1]).to.be.an('object');
expect(any[1][1]).to.be.an('object');
});
});
describe('coalesce', function(){
it('should return the first non-undefined value', function(){
var obj = {
should: {have: 'prop'}
};
expect(objectPath.coalesce(obj, [
'doesnt.exist',
['might','not','exist'],
'should.have'
])).to.equal('prop');
});
it('should work with falsy values (null, 0, \'\', false)', function(){
var obj = {
is: {
false: false,
null: null,
empty: '',
zero: 0
}
};
expect(objectPath.coalesce(obj, [
'doesnt.exist',
'is.zero'
])).to.equal(0);
expect(objectPath.coalesce(obj, [
'doesnt.exist',
'is.false'
])).to.equal(false);
expect(objectPath.coalesce(obj, [
'doesnt.exist',
'is.null'
])).to.equal(null);
expect(objectPath.coalesce(obj, [
'doesnt.exist',
'is.empty'
])).to.equal('');
});
it('returns defaultValue if no paths found', function(){
var obj = {
doesnt: 'matter'
};
expect(objectPath.coalesce(obj, ['some.inexistant','path',['on','object']], 'false')).to.equal('false');
});
});
describe('empty', function(){
it('should ignore invalid arguments safely', function(){
var obj = {};
expect(objectPath.empty()).to.equal(void 0);
expect(objectPath.empty(obj, 'path')).to.equal(void 0);
expect(objectPath.empty(obj, '')).to.equal(obj);
obj.path = true;
expect(objectPath.empty(obj, 'inexistant')).to.equal(obj);
});
it('should empty each path according to their types', function(){
function Instance(){
this.notOwn = true;
}
/*istanbul ignore next: not part of code */
Instance.prototype.test = function(){};
/*istanbul ignore next: not part of code */
Instance.prototype.arr = [];
var
obj = {
string: 'some string',
array: ['some','array',[1,2,3]],
number: 21,
boolean: true,
object: {
some:'property',
sub: {
'property': true
}
},
instance: new Instance()
};
/*istanbul ignore next: not part of code */
obj['function'] = function(){};
objectPath.empty(obj, ['array','2']);
expect(obj.array[2]).to.deep.equal([]);
objectPath.empty(obj, 'object.sub');
expect(obj.object.sub).to.deep.equal({});
objectPath.empty(obj, 'instance.test');
expect(obj.instance.test).to.equal(null);
expect(Instance.prototype.test).to.be.a('function');
objectPath.empty(obj, 'string');
objectPath.empty(obj, 'number');
objectPath.empty(obj, 'boolean');
objectPath.empty(obj, 'function');
objectPath.empty(obj, 'array');
objectPath.empty(obj, 'object');
objectPath.empty(obj, 'instance');
expect(obj.string).to.equal('');
expect(obj.array).to.deep.equal([]);
expect(obj.number).to.equal(0);
expect(obj.boolean).to.equal(false);
expect(obj.object).to.deep.equal({});
expect(obj.instance.notOwn).to.be.an('undefined');
expect(obj.instance.arr).to.be.an('array');
expect(obj['function']).to.equal(null);
});
});
describe('del', function(){
it('should return undefined on empty object', function(){
expect(objectPath.del({}, 'a')).to.equal(void 0);
});
it('should work with number path', function(){
var obj = getTestObj();
objectPath.del(obj.b.d, 1);
expect(obj.b.d).to.deep.equal(['a']);
});
it('should delete deep paths', function(){
var obj = getTestObj();
expect(objectPath.del(obj)).to.be.equal(obj);
objectPath.set(obj, 'b.g.1.0', 'test');
objectPath.set(obj, 'b.g.1.1', 'test');
objectPath.set(obj, 'b.h.az', 'test');
expect(obj).to.have.deep.property('b.g.1.0','test');
expect(obj).to.have.deep.property('b.g.1.1','test');
expect(obj).to.have.deep.property('b.h.az','test');
objectPath.del(obj, 'b.h.az');
expect(obj).to.not.have.deep.property('b.h.az');
expect(obj).to.have.deep.property('b.h');
objectPath.del(obj, 'b.g.1.1');
expect(obj).to.not.have.deep.property('b.g.1.1');
expect(obj).to.have.deep.property('b.g.1.0','test');
objectPath.del(obj, ['b','g','1','0']);
expect(obj).to.not.have.deep.property('b.g.1.0');
expect(obj).to.have.deep.property('b.g.1');
expect(objectPath.del(obj, ['b'])).to.not.have.deep.property('b.g');
expect(obj).to.be.deep.equal({'a':'b'});
});
it('should remove items from existing array', function(){
var obj = getTestObj();
objectPath.del(obj, 'b.d.0');
expect(obj.b.d).to.have.length(1);
expect(obj.b.d).to.be.deep.equal(['b']);
objectPath.del(obj, 'b.d.0');
expect(obj.b.d).to.have.length(0);
expect(obj.b.d).to.be.deep.equal([]);
});
it('should skip undefined paths', function(){
var obj = getTestObj();
expect(objectPath.del(obj, 'do.not.exist')).to.be.equal(obj);
expect(objectPath.del(obj, 'a.c')).to.be.equal('b');
});
});
describe('insert', function(){
it('should insert value into existing array', function(){
var obj = getTestObj();
objectPath.insert(obj, 'b.c', 'asdf');
expect(obj).to.have.deep.property('b.c.0', 'asdf');
expect(obj).to.not.have.deep.property('b.c.1');
});
it('should create intermediary array', function(){
var obj = getTestObj();
objectPath.insert(obj, 'b.c.0', 'asdf');
expect(obj).to.have.deep.property('b.c.0.0', 'asdf');
});
it('should insert in another index', function(){
var obj = getTestObj();
objectPath.insert(obj, 'b.d', 'asdf', 1);
expect(obj).to.have.deep.property('b.d.1', 'asdf');
expect(obj).to.have.deep.property('b.d.0', 'a');
expect(obj).to.have.deep.property('b.d.2', 'b');
});
it('should handle sparse array', function(){
var obj = getTestObj();
obj.b.d = new Array(4);
obj.b.d[0] = 'a';
obj.b.d[1] = 'b';
objectPath.insert(obj, 'b.d', 'asdf', 3);
expect(obj.b.d).to.have.members([
'a',
'b',
,
,
'asdf'
]);
});
});
describe('has', function () {
it('should return false for empty object', function () {
expect(objectPath.has({}, 'a')).to.be.false;
});
it('should return false for empty path', function () {
var obj = getTestObj();
expect(objectPath.has(obj, '')).to.be.false;
expect(objectPath.has(obj, [])).to.be.false;
expect(objectPath.has(obj, [''])).to.be.false;
});
it('should test under shallow object', function() {
var obj = getTestObj();
expect(objectPath.has(obj, 'a')).to.be.true;
expect(objectPath.has(obj, ['a'])).to.be.true;
expect(objectPath.has(obj, 'z')).to.be.false;
expect(objectPath.has(obj, ['z'])).to.be.false;
});
it('should work with number path', function() {
var obj = getTestObj();
expect(objectPath.has(obj.b.d, 0)).to.be.true;
expect(objectPath.has(obj.b, 0)).to.be.false;
expect(objectPath.has(obj.b.d, 10)).to.be.false;
expect(objectPath.has(obj.b, 10)).to.be.false;
});
it('should test under deep object', function() {
var obj = getTestObj();
expect(objectPath.has(obj, 'b.f')).to.be.true;
expect(objectPath.has(obj, ['b','f'])).to.be.true;
expect(objectPath.has(obj, 'b.g')).to.be.false;
expect(objectPath.has(obj, ['b','g'])).to.be.false;
});
it('should test value under array', function() {
var obj = getTestObj();
expect(objectPath.has(obj, 'b.d.0')).to.be.true;
expect(objectPath.has(obj, ['b','d',0])).to.be.true;
});
it('should test the value under array deep', function() {
var obj = getTestObj();
expect(objectPath.has(obj, 'b.e.1.f')).to.be.true;
expect(objectPath.has(obj, ['b','e',1,'f'])).to.be.true;
expect(objectPath.has(obj, 'b.e.1.f.g.h.i')).to.be.false;
expect(objectPath.has(obj, ['b','e',1,'f','g','h','i'])).to.be.false;
});
it('should test the value under integer-like key', function() {
var obj = { '1a': 'foo' };
expect(objectPath.has(obj, '1a')).to.be.true;
expect(objectPath.has(obj, ['1a'])).to.be.true;
});
it('should distinct nonexistent key and key = undefined', function() {
var obj = {};
expect(objectPath.has(obj, 'key')).to.be.false;
obj.key = undefined;
expect(objectPath.has(obj, 'key')).to.be.true;
});
});
describe('bind object', function () {
// just get one scenario from each feature, so whole functionality is proxied well
it('should return the value under shallow object', function() {
var obj = getTestObj();
var model = objectPath(obj);
expect(model.get('a')).to.be.equal('b');
expect(model.get(['a'])).to.be.equal('b');
});
it('should set value under shallow object', function() {
var obj = getTestObj();
var model = objectPath(obj);
model.set('c', {m: 'o'});
expect(obj).to.have.deep.property('c.m', 'o');
obj = getTestObj();
model = objectPath(obj);
model.set(['c'], {m: 'o'});
expect(obj).to.have.deep.property('c.m', 'o');
});
it('should push value to existing array', function() {
var obj = getTestObj();
var model = objectPath(obj);
model.push('b.c', 'l');
expect(obj).to.have.deep.property('b.c.0', 'l');
obj = getTestObj();
model = objectPath(obj);
model.push(['b','c'], 'l');
expect(obj).to.have.deep.property('b.c.0', 'l');
});
it('should create the path if it does not exists', function() {
var obj = getTestObj();
var model = objectPath(obj);
var oldVal = model.ensureExists('b.g.1.l', 'test');
expect(oldVal).to.not.exist;
expect(obj).to.have.deep.property('b.g.1.l', 'test');
oldVal = model.ensureExists('b.g.1.l', 'test1');
expect(oldVal).to.be.equal('test');
expect(obj).to.have.deep.property('b.g.1.l', 'test');
});
it('should return the first non-undefined value', function(){
var obj = {
should: {have: 'prop'}
};
var model = objectPath(obj);
expect(model.coalesce([
'doesnt.exist',
['might','not','exist'],
'should.have'
])).to.equal('prop');
});
it('should empty each path according to their types', function(){
function Instance(){
this.notOwn = true;
}
/*istanbul ignore next: not part of code */
Instance.prototype.test = function(){};
/*istanbul ignore next: not part of code */
Instance.prototype.arr = [];
var
obj = {
string: 'some string',
array: ['some','array',[1,2,3]],
number: 21,
boolean: true,
object: {
some:'property',
sub: {
'property': true
}
},
instance: new Instance()
};
/*istanbul ignore next: not part of code */
obj['function'] = function(){};
var model = objectPath(obj);
model.empty(['array','2']);
expect(obj.array[2]).to.deep.equal([]);
model.empty('object.sub');
expect(obj.object.sub).to.deep.equal({});
model.empty('instance.test');
expect(obj.instance.test).to.equal(null);
expect(Instance.prototype.test).to.be.a('function');
model.empty('string');
model.empty('number');
model.empty('boolean');
model.empty('function');
model.empty('array');
model.empty('object');
model.empty('instance');
expect(obj.string).to.equal('');
expect(obj.array).to.deep.equal([]);
expect(obj.number).to.equal(0);
expect(obj.boolean).to.equal(false);
expect(obj.object).to.deep.equal({});
expect(obj.instance.notOwn).to.be.an('undefined');
expect(obj.instance.arr).to.be.an('array');
expect(obj['function']).to.equal(null);
});
it('should delete deep paths', function(){
var obj = getTestObj();
var model = objectPath(obj);
expect(model.del()).to.be.equal(obj);
model.set('b.g.1.0', 'test');
model.set('b.g.1.1', 'test');
model.set('b.h.az', 'test');
expect(obj).to.have.deep.property('b.g.1.0','test');
expect(obj).to.have.deep.property('b.g.1.1','test');
expect(obj).to.have.deep.property('b.h.az','test');
model.del('b.h.az');
expect(obj).to.not.have.deep.property('b.h.az');
expect(obj).to.have.deep.property('b.h');
model.del('b.g.1.1');
expect(obj).to.not.have.deep.property('b.g.1.1');
expect(obj).to.have.deep.property('b.g.1.0','test');
model.del(['b','g','1','0']);
expect(obj).to.not.have.deep.property('b.g.1.0');
expect(obj).to.have.deep.property('b.g.1');
expect(model.del(['b'])).to.not.have.deep.property('b.g');
expect(obj).to.be.deep.equal({'a':'b'});
});
it('should insert value into existing array', function(){
var obj = getTestObj();
var model = objectPath(obj);
model.insert('b.c', 'asdf');
expect(obj).to.have.deep.property('b.c.0', 'asdf');
expect(obj).to.not.have.deep.property('b.c.1');
});
it('should test under shallow object', function() {
var obj = getTestObj();
var model = objectPath(obj);
expect(model.has('a')).to.be.true;
expect(model.has(['a'])).to.be.true;
expect(model.has('z')).to.be.false;
expect(model.has(['z'])).to.be.false;
});
});
| sharp-ant/sharp-ant.github.io | node_modules/tfunk/node_modules/object-path/test.js | JavaScript | mit | 20,276 |
/*
* # Semantic - Sidebar
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributor
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
"use strict";
$.fn.sidebar = function(parameters) {
var
$allModules = $(this),
$window = $(window),
$document = $(document),
$html = $('html'),
$head = $('head'),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); },
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
: $.extend({}, $.fn.sidebar.settings),
selector = settings.selector,
className = settings.className,
namespace = settings.namespace,
regExp = settings.regExp,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$context = $(settings.context),
$sidebars = $module.children(selector.sidebar),
$pusher = $context.children(selector.pusher),
$style,
element = this,
instance = $module.data(moduleNamespace),
elementNamespace,
id,
currentScroll,
transitionEvent,
module
;
module = {
initialize: function() {
module.debug('Initializing sidebar', parameters);
module.create.id();
transitionEvent = module.get.transitionEvent();
// cache on initialize
if( ( settings.useLegacy == 'auto' && module.is.legacy() ) || settings.useLegacy === true) {
settings.transition = 'overlay';
settings.useLegacy = true;
}
if(module.is.ios()) {
module.set.ios();
}
// avoids locking rendering if initialized in onReady
requestAnimationFrame(module.setup.layout);
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
create: {
id: function() {
module.verbose('Creating unique id for element');
id = module.get.uniqueID();
elementNamespace = '.' + id;
}
},
destroy: function() {
module.verbose('Destroying previous module for', $module);
module.remove.direction();
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
// bound by uuid
$context.off(elementNamespace);
$window.off(elementNamespace);
$document.off(elementNamespace);
},
event: {
clickaway: function(event) {
if( $(event.target).closest(selector.sidebar).size() === 0 ) {
module.verbose('User clicked on dimmed page');
module.hide();
}
},
touch: function(event) {
//event.stopPropagation();
},
containScroll: function(event) {
if(element.scrollTop <= 0) {
element.scrollTop = 1;
}
if((element.scrollTop + element.offsetHeight) >= element.scrollHeight) {
element.scrollTop = element.scrollHeight - element.offsetHeight - 1;
}
},
scroll: function(event) {
if( $(event.target).closest(selector.sidebar).size() === 0 ) {
event.preventDefault();
}
}
},
bind: {
clickaway: function() {
module.verbose('Adding clickaway events to context', $context);
if(settings.closable) {
$context
.on('click' + elementNamespace, module.event.clickaway)
.on('touchend' + elementNamespace, module.event.clickaway)
;
}
},
scrollLock: function() {
if(settings.scrollLock) {
module.debug('Disabling page scroll');
$window
.on('DOMMouseScroll' + elementNamespace, module.event.scroll)
;
}
module.verbose('Adding events to contain sidebar scroll');
$document
.on('touchmove' + elementNamespace, module.event.touch)
;
$module
.on('scroll' + eventNamespace, module.event.containScroll)
;
}
},
unbind: {
clickaway: function() {
module.verbose('Removing clickaway events from context', $context);
$context.off(elementNamespace);
},
scrollLock: function() {
module.verbose('Removing scroll lock from page');
$document.off(elementNamespace);
$window.off(elementNamespace);
$module.off('scroll' + eventNamespace);
}
},
add: {
bodyCSS: function(direction, distance) {
var
width = $module.outerWidth(),
height = $module.outerHeight(),
style
;
style = ''
+ '<style title="' + namespace + '">'
+ ' .ui.visible.left.sidebar ~ .fixed,'
+ ' .ui.visible.left.sidebar ~ .pusher {'
+ ' -webkit-transform: translate3d('+ width + 'px, 0, 0);'
+ ' transform: translate3d('+ width + 'px, 0, 0);'
+ ' }'
+ ' .ui.visible.right.sidebar ~ .fixed,'
+ ' .ui.visible.right.sidebar ~ .pusher {'
+ ' -webkit-transform: translate3d(-'+ width + 'px, 0, 0);'
+ ' transform: translate3d(-'+ width + 'px, 0, 0);'
+ ' }'
+ ' .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .fixed,'
+ ' .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher,'
+ ' .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .fixed,'
+ ' .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher {'
+ ' -webkit-transform: translate3d(0px, 0, 0);'
+ ' transform: translate3d(0px, 0, 0);'
+ ' }'
+ ' .ui.visible.top.sidebar ~ .fixed,'
+ ' .ui.visible.top.sidebar ~ .pusher {'
+ ' -webkit-transform: translate3d(0, ' + height + 'px, 0);'
+ ' transform: translate3d(0, ' + height + 'px, 0);'
+ ' }'
+ ' .ui.visible.bottom.sidebar ~ .fixed,'
+ ' .ui.visible.bottom.sidebar ~ .pusher {'
+ ' -webkit-transform: translate3d(0, -' + height + 'px, 0);'
+ ' transform: translate3d(0, -' + height + 'px, 0);'
+ ' }'
;
/* IE is only browser not to create context with transforms */
/* https://www.w3.org/Bugs/Public/show_bug.cgi?id=16328 */
if( module.is.ie() ) {
style += ''
+ ' .ui.visible.left.sidebar ~ .pusher:after {'
+ ' -webkit-transform: translate3d('+ width + 'px, 0, 0);'
+ ' transform: translate3d('+ width + 'px, 0, 0);'
+ ' }'
+ ' .ui.visible.right.sidebar ~ .pusher:after {'
+ ' -webkit-transform: translate3d(-'+ width + 'px, 0, 0);'
+ ' transform: translate3d(-'+ width + 'px, 0, 0);'
+ ' }'
+ ' .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after,'
+ ' .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {'
+ ' -webkit-transform: translate3d(0px, 0, 0);'
+ ' transform: translate3d(0px, 0, 0);'
+ ' }'
+ ' .ui.visible.top.sidebar ~ .pusher:after {'
+ ' -webkit-transform: translate3d(0, ' + height + 'px, 0);'
+ ' transform: translate3d(0, ' + height + 'px, 0);'
+ ' }'
+ ' .ui.visible.bottom.sidebar ~ .pusher:after {'
+ ' -webkit-transform: translate3d(0, -' + height + 'px, 0);'
+ ' transform: translate3d(0, -' + height + 'px, 0);'
+ ' }'
;
}
style += '</style>';
$head.append(style);
$style = $('style[title=' + namespace + ']');
module.debug('Adding sizing css to head', $style);
}
},
refresh: function() {
module.verbose('Refreshing selector cache');
$context = $(settings.context);
$sidebars = $context.children(selector.sidebar);
$pusher = $context.children(selector.pusher);
},
refreshSidebars: function() {
module.verbose('Refreshing other sidebars');
$sidebars = $context.children(selector.sidebar);
},
repaint: function() {
module.verbose('Forcing repaint event');
element.style.display='none';
element.offsetHeight;
element.scrollTop = element.scrollTop;
element.style.display='';
},
setup: {
layout: function() {
if( $context.children(selector.pusher).size() === 0 ) {
module.debug('Adding wrapper element for sidebar');
module.error(error.pusher);
$pusher = $('<div class="pusher" />');
$context
.children()
.not(selector.omitted)
.not($sidebars)
.wrapAll($pusher)
;
module.refresh();
}
if($module.nextAll(selector.pusher).size() === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
module.debug('Moved sidebar to correct parent element');
module.error(error.movedSidebar, element);
$module.detach().prependTo($context);
module.refresh();
}
module.set.pushable();
module.set.direction();
}
},
attachEvents: function(selector, event) {
var
$toggle = $(selector)
;
event = $.isFunction(module[event])
? module[event]
: module.toggle
;
if($toggle.size() > 0) {
module.debug('Attaching sidebar events to element', selector, event);
$toggle
.on('click' + eventNamespace, event)
;
}
else {
module.error(error.notFound, selector);
}
},
show: function(callback) {
var
animateMethod = (settings.useLegacy === true)
? module.legacyPushPage
: module.pushPage
;
callback = $.isFunction(callback)
? callback
: function(){}
;
if(module.is.hidden()) {
module.refreshSidebars();
if(settings.overlay) {
module.error(error.overlay);
settings.transition = 'overlay';
}
module.refresh();
if(module.othersVisible() && module.get.transition() != 'overlay') {
module.debug('Other sidebars currently open');
if(settings.exclusive) {
module.hideOthers();
}
}
animateMethod(function() {
$.proxy(callback, element)();
$.proxy(settings.onShow, element)();
});
$.proxy(settings.onChange, element)();
$.proxy(settings.onVisible, element)();
}
else {
module.debug('Sidebar is already visible');
}
},
hide: function(callback) {
var
animateMethod = (settings.useLegacy === true)
? module.legacyPullPage
: module.pullPage
;
callback = $.isFunction(callback)
? callback
: function(){}
;
if(module.is.visible() || module.is.animating()) {
module.debug('Hiding sidebar', callback);
module.refreshSidebars();
animateMethod(function() {
$.proxy(callback, element)();
$.proxy(settings.onHidden, element)();
});
$.proxy(settings.onChange, element)();
$.proxy(settings.onHide, element)();
}
},
othersVisible: function() {
return ($sidebars.not($module).filter('.' + className.visible).size() > 0);
},
hideOthers: function(callback) {
var
$otherSidebars = $sidebars.not($module).filter('.' + className.visible),
callback = callback || function(){},
sidebarCount = $otherSidebars.size(),
callbackCount = 0
;
$otherSidebars
.sidebar('hide', function() {
callbackCount++;
if(callbackCount == sidebarCount) {
callback();
}
})
;
},
toggle: function() {
module.verbose('Determining toggled direction');
if(module.is.hidden()) {
module.show();
}
else {
module.hide();
}
},
pushPage: function(callback) {
var
transition = module.get.transition(),
$transition = (transition == 'safe')
? $context
: (transition == 'overlay' || module.othersVisible())
? $module
: $pusher,
animate,
transitionEnd
;
callback = $.isFunction(callback)
? callback
: function(){}
;
if(settings.transition == 'scale down') {
module.scrollToTop();
}
module.set.transition();
module.repaint();
animate = function() {
module.bind.clickaway();
module.add.bodyCSS();
module.set.animating();
module.set.visible();
if(!module.othersVisible()) {
if(settings.dimPage) {
$pusher.addClass(className.dimmed);
}
}
};
transitionEnd = function(event) {
if( event.target == $transition[0] ) {
$transition.off(transitionEvent + elementNamespace, transitionEnd);
module.remove.animating();
module.bind.scrollLock();
$.proxy(callback, element)();
}
};
$transition.off(transitionEvent + elementNamespace);
$transition.on(transitionEvent + elementNamespace, transitionEnd);
requestAnimationFrame(animate);
},
pullPage: function(callback) {
var
transition = module.get.transition(),
$transition = (transition == 'safe')
? $context
: (transition == 'overlay' || module.othersVisible())
? $module
: $pusher,
animate,
transitionEnd
;
callback = $.isFunction(callback)
? callback
: function(){}
;
module.verbose('Removing context push state', module.get.direction());
module.unbind.clickaway();
module.unbind.scrollLock();
animate = function() {
module.set.animating();
module.remove.visible();
if(settings.dimPage && !module.othersVisible()) {
$pusher.removeClass(className.dimmed);
}
};
transitionEnd = function(event) {
if( event.target == $transition[0] ) {
$transition.off(transitionEvent + elementNamespace, transitionEnd);
module.remove.animating();
module.remove.transition();
module.remove.bodyCSS();
if(transition == 'scale down' || (settings.returnScroll && module.is.mobile()) ) {
module.scrollBack();
}
$.proxy(callback, element)();
}
};
$transition.off(transitionEvent + elementNamespace);
$transition.on(transitionEvent + elementNamespace, transitionEnd);
requestAnimationFrame(animate);
},
legacyPushPage: function(callback) {
var
distance = $module.width(),
direction = module.get.direction(),
properties = {}
;
distance = distance || $module.width();
callback = $.isFunction(callback)
? callback
: function(){}
;
properties[direction] = distance;
module.debug('Using javascript to push context', properties);
module.set.visible();
module.set.transition();
module.set.animating();
if(settings.dimPage) {
$pusher.addClass(className.dimmed);
}
$context
.css('position', 'relative')
.animate(properties, settings.duration, settings.easing, function() {
module.remove.animating();
module.bind.clickaway();
$.proxy(callback, module)();
})
;
},
legacyPullPage: function(callback) {
var
distance = 0,
direction = module.get.direction(),
properties = {}
;
distance = distance || $module.width();
callback = $.isFunction(callback)
? callback
: function(){}
;
properties[direction] = '0px';
module.debug('Using javascript to pull context', properties);
module.unbind.clickaway();
module.set.animating();
module.remove.visible();
if(settings.dimPage && !module.othersVisible()) {
$pusher.removeClass(className.dimmed);
}
$context
.css('position', 'relative')
.animate(properties, settings.duration, settings.easing, function() {
module.remove.animating();
$.proxy(callback, module)();
})
;
},
scrollToTop: function() {
module.verbose('Scrolling to top of page to avoid animation issues');
currentScroll = $(window).scrollTop();
$module.scrollTop(0);
window.scrollTo(0, 0);
},
scrollBack: function() {
module.verbose('Scrolling back to original page position');
window.scrollTo(0, currentScroll);
},
set: {
// html
ios: function() {
$html.addClass(className.ios);
},
// container
pushed: function() {
$context.addClass(className.pushed);
},
pushable: function() {
$context.addClass(className.pushable);
},
// sidebar
active: function() {
$module.addClass(className.active);
},
animating: function() {
$module.addClass(className.animating);
},
transition: function(transition) {
transition = transition || module.get.transition();
$module.addClass(transition);
},
direction: function(direction) {
direction = direction || module.get.direction();
$module.addClass(className[direction]);
},
visible: function() {
$module.addClass(className.visible);
},
overlay: function() {
$module.addClass(className.overlay);
}
},
remove: {
bodyCSS: function() {
module.debug('Removing body css styles', $style);
if($style.size() > 0) {
$style.remove();
}
},
// context
pushed: function() {
$context.removeClass(className.pushed);
},
pushable: function() {
$context.removeClass(className.pushable);
},
// sidebar
active: function() {
$module.removeClass(className.active);
},
animating: function() {
$module.removeClass(className.animating);
},
transition: function(transition) {
transition = transition || module.get.transition();
$module.removeClass(transition);
},
direction: function(direction) {
direction = direction || module.get.direction();
$module.removeClass(className[direction]);
},
visible: function() {
$module.removeClass(className.visible);
},
overlay: function() {
$module.removeClass(className.overlay);
}
},
get: {
direction: function() {
if($module.hasClass(className.top)) {
return className.top;
}
else if($module.hasClass(className.right)) {
return className.right;
}
else if($module.hasClass(className.bottom)) {
return className.bottom;
}
return className.left;
},
transition: function() {
var
direction = module.get.direction(),
transition
;
return ( module.is.mobile() )
? (settings.mobileTransition == 'auto')
? settings.defaultTransition.mobile[direction]
: settings.mobileTransition
: (settings.transition == 'auto')
? settings.defaultTransition.computer[direction]
: settings.transition
;
},
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
uniqueID: function() {
return (Math.random().toString(16) + '000000000').substr(2,8);
}
},
is: {
ie: function() {
var
isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
isIE = ('ActiveXObject' in window)
;
return (isIE11 || isIE);
},
legacy: function() {
var
element = document.createElement('div'),
transforms = {
'webkitTransform' :'-webkit-transform',
'OTransform' :'-o-transform',
'msTransform' :'-ms-transform',
'MozTransform' :'-moz-transform',
'transform' :'transform'
},
has3D
;
// Add it to the body to get the computed style.
document.body.insertBefore(element, null);
for (var transform in transforms) {
if (element.style[transform] !== undefined) {
element.style[transform] = "translate3d(1px,1px,1px)";
has3D = window.getComputedStyle(element).getPropertyValue(transforms[transform]);
}
}
document.body.removeChild(element);
return !(has3D !== undefined && has3D.length > 0 && has3D !== 'none');
},
ios: function() {
var
userAgent = navigator.userAgent,
isIOS = regExp.ios.test(userAgent)
;
if(isIOS) {
module.verbose('Browser was found to be iOS', userAgent);
return true;
}
else {
return false;
}
},
mobile: function() {
var
userAgent = navigator.userAgent,
isMobile = regExp.mobile.test(userAgent)
;
if(isMobile) {
module.verbose('Browser was found to be mobile', userAgent);
return true;
}
else {
module.verbose('Browser is not mobile, using regular transition', userAgent);
return false;
}
},
hidden: function() {
return !module.is.visible();
},
visible: function() {
return $module.hasClass(className.visible);
},
// alias
open: function() {
return module.is.visible();
},
closed: function() {
return module.is.hidden();
},
vertical: function() {
return $module.hasClass(className.top);
},
animating: function() {
return $context.hasClass(className.animating);
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
}
;
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.invoke('destroy');
}
module.initialize();
}
});
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.sidebar.settings = {
name : 'Sidebar',
namespace : 'sidebar',
debug : false,
verbose : true,
performance : true,
transition : 'auto',
mobileTransition : 'auto',
defaultTransition : {
computer: {
left : 'uncover',
right : 'uncover',
top : 'overlay',
bottom : 'overlay'
},
mobile: {
left : 'uncover',
right : 'uncover',
top : 'overlay',
bottom : 'overlay'
}
},
context : 'body',
exclusive : false,
closable : true,
dimPage : true,
scrollLock : false,
returnScroll : false,
useLegacy : 'auto',
duration : 500,
easing : 'easeInOutQuint',
onChange : function(){},
onShow : function(){},
onHide : function(){},
onHidden : function(){},
onVisible : function(){},
className : {
active : 'active',
animating : 'animating',
dimmed : 'dimmed',
ios : 'ios',
pushable : 'pushable',
pushed : 'pushed',
right : 'right',
top : 'top',
left : 'left',
bottom : 'bottom',
visible : 'visible'
},
selector: {
fixed : '.fixed',
omitted : 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed',
pusher : '.pusher',
sidebar : '.ui.sidebar'
},
regExp: {
ios : /(iPad|iPhone|iPod)/g,
mobile : /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g
},
error : {
method : 'The method you called is not defined.',
pusher : 'Had to add pusher element. For optimal performance make sure body content is inside a pusher element',
movedSidebar : 'Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag',
overlay : 'The overlay setting is no longer supported, use animation: overlay',
notFound : 'There were no elements that matched the specified selector'
}
};
// Adds easing
$.extend( $.easing, {
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
}
});
})( jQuery, window , document );
| brix/cdnjs | ajax/libs/semantic-ui/1.6.3/components/sidebar.js | JavaScript | mit | 34,504 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang['de']={"editor":"WYSIWYG-Editor","editorPanel":"WYSIWYG-Editor-Leiste","common":{"editorHelp":"Drücken Sie ALT 0 für Hilfe","browseServer":"Server durchsuchen","url":"URL","protocol":"Protokoll","upload":"Hochladen","uploadSubmit":"Zum Server senden","image":"Bild","flash":"Flash","form":"Formular","checkbox":"Checkbox","radio":"Radiobutton","textField":"Textfeld einzeilig","textarea":"Textfeld mehrzeilig","hiddenField":"Verstecktes Feld","button":"Klickbutton","select":"Auswahlfeld","imageButton":"Bildbutton","notSet":"<nichts>","id":"ID","name":"Name","langDir":"Schreibrichtung","langDirLtr":"Links nach Rechts (LTR)","langDirRtl":"Rechts nach Links (RTL)","langCode":"Sprachenkürzel","longDescr":"Langform URL","cssClass":"Stylesheet Klasse","advisoryTitle":"Titel Beschreibung","cssStyle":"Style","ok":"OK","cancel":"Abbrechen","close":"Schließen","preview":"Vorschau","resize":"Zum Vergrößern ziehen","generalTab":"Allgemein","advancedTab":"Erweitert","validateNumberFailed":"Dieser Wert ist keine Nummer.","confirmNewPage":"Alle nicht gespeicherten Änderungen gehen verlohren. Sind Sie sicher die neue Seite zu laden?","confirmCancel":"Einige Optionen wurden geändert. Wollen Sie den Dialog dennoch schließen?","options":"Optionen","target":"Zielseite","targetNew":"Neues Fenster (_blank)","targetTop":"Oberstes Fenster (_top)","targetSelf":"Gleiches Fenster (_self)","targetParent":"Oberes Fenster (_parent)","langDirLTR":"Links nach Rechts (LNR)","langDirRTL":"Rechts nach Links (RNL)","styles":"Style","cssClasses":"Stylesheet Klasse","width":"Breite","height":"Höhe","align":"Ausrichtung","alignLeft":"Links","alignRight":"Rechts","alignCenter":"Zentriert","alignTop":"Oben","alignMiddle":"Mitte","alignBottom":"Unten","invalidValue":"Ungültiger Wert.","invalidHeight":"Höhe muss eine Zahl sein.","invalidWidth":"Breite muss eine Zahl sein.","invalidCssLength":"Wert spezifiziert für \"%1\" Feld muss ein positiver numerischer Wert sein mit oder ohne korrekte CSS Messeinheit (px, %, in, cm, mm, em, ex, pt oder pc).","invalidHtmlLength":"Wert spezifiziert für \"%1\" Feld muss ein positiver numerischer Wert sein mit oder ohne korrekte HTML Messeinheit (px oder %).","invalidInlineStyle":"Wert spezifiziert für inline Stilart muss enthalten ein oder mehr Tupels mit dem Format \"Name : Wert\" getrennt mit Semikolons.","cssLengthTooltip":"Gebe eine Zahl ein für ein Wert in pixels oder eine Zahl mit einer korrekten CSS Messeinheit (px, %, in, cm, mm, em, ex, pt oder pc).","unavailable":"%1<span class=\"cke_accessibility\">, nicht verfügbar</span>"},"about":{"copy":"Copyright © $1. Alle Rechte vorbehalten.","dlgTitle":"Über CKEditor","help":"Prüfe $1 für Hilfe.","moreInfo":"Für Informationen über unsere Lizenzbestimmungen besuchen sie bitte unsere Webseite:","title":"Über CKEditor","userGuide":"CKEditor Benutzerhandbuch"},"basicstyles":{"bold":"Fett","italic":"Kursiv","strike":"Durchgestrichen","subscript":"Tiefgestellt","superscript":"Hochgestellt","underline":"Unterstrichen"},"blockquote":{"toolbar":"Zitatblock"},"clipboard":{"copy":"Kopieren","copyError":"Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch kopieren. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren).","cut":"Ausschneiden","cutError":"Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch auszuschneiden. Bitte benutzen Sie die System-Zwischenablage über STRG-X (ausschneiden) und STRG-V (einfügen).","paste":"Einfügen","pasteArea":"Einfügebereich","pasteMsg":"Bitte fügen Sie den Text in der folgenden Box über die Tastatur (mit <STRONG>Strg+V</STRONG>) ein und bestätigen Sie mit <STRONG>OK</STRONG>.","securityMsg":"Aufgrund von Sicherheitsbeschränkungen Ihres Browsers kann der Editor nicht direkt auf die Zwischenablage zugreifen. Bitte fügen Sie den Inhalt erneut in diesem Fenster ein.","title":"Einfügen"},"contextmenu":{"options":"Kontextmenü Optionen"},"toolbar":{"toolbarCollapse":"Symbolleiste einklappen","toolbarExpand":"Symbolleiste ausklappen","toolbarGroups":{"document":"Dokument","clipboard":"Zwischenablage/Rückgängig","editing":"Editieren","forms":"Formularen","basicstyles":"Grundstile","paragraph":"Absatz","links":"Links","insert":"Einfügen","styles":"Stile","colors":"Farben","tools":"Werkzeuge"},"toolbars":"Editor Symbolleisten"},"elementspath":{"eleLabel":"Elements Pfad","eleTitle":"%1 Element"},"format":{"label":"Format","panelTitle":"Format","tag_address":"Addresse","tag_div":"Normal (DIV)","tag_h1":"Überschrift 1","tag_h2":"Überschrift 2","tag_h3":"Überschrift 3","tag_h4":"Überschrift 4","tag_h5":"Überschrift 5","tag_h6":"Überschrift 6","tag_p":"Normal","tag_pre":"Formatiert"},"horizontalrule":{"toolbar":"Horizontale Linie einfügen"},"image":{"alertUrl":"Bitte geben Sie die Bild-URL an","alt":"Alternativer Text","border":"Rahmen","btnUpload":"Zum Server senden","button2Img":"Möchten Sie den gewählten Bild-Button in ein einfaches Bild umwandeln?","hSpace":"Horizontal-Abstand","img2Button":"Möchten Sie das gewählten Bild in einen Bild-Button umwandeln?","infoTab":"Bild-Info","linkTab":"Link","lockRatio":"Größenverhältnis beibehalten","menu":"Bild-Eigenschaften","resetSize":"Größe zurücksetzen","title":"Bild-Eigenschaften","titleButton":"Bildbutton-Eigenschaften","upload":"Hochladen","urlMissing":"Imagequelle URL fehlt.","vSpace":"Vertikal-Abstand","validateBorder":"Rahmen muß eine ganze Zahl sein.","validateHSpace":"Horizontal-Abstand muß eine ganze Zahl sein.","validateVSpace":"Vertikal-Abstand muß eine ganze Zahl sein."},"indent":{"indent":"Einzug erhöhen","outdent":"Einzug verringern"},"fakeobjects":{"anchor":"Anker","flash":"Flash Animation","hiddenfield":"Verstecktes Feld","iframe":"IFrame","unknown":"Unbekanntes Objekt"},"link":{"acccessKey":"Zugriffstaste","advanced":"Erweitert","advisoryContentType":"Inhaltstyp","advisoryTitle":"Titel Beschreibung","anchor":{"toolbar":"Anker einfügen/editieren","menu":"Anker-Eigenschaften","title":"Anker-Eigenschaften","name":"Anker Name","errorName":"Bitte geben Sie den Namen des Ankers ein","remove":"Anker entfernen"},"anchorId":"nach Element Id","anchorName":"nach Anker Name","charset":"Ziel-Zeichensatz","cssClasses":"Stylesheet Klasse","emailAddress":"E-Mail Adresse","emailBody":"Nachrichtentext","emailSubject":"Betreffzeile","id":"Id","info":"Link-Info","langCode":"Sprachenkürzel","langDir":"Schreibrichtung","langDirLTR":"Links nach Rechts (LTR)","langDirRTL":"Rechts nach Links (RTL)","menu":"Link editieren","name":"Name","noAnchors":"(keine Anker im Dokument vorhanden)","noEmail":"Bitte geben Sie e-Mail Adresse an","noUrl":"Bitte geben Sie die Link-URL an","other":"<andere>","popupDependent":"Abhängig (Netscape)","popupFeatures":"Pop-up Fenster-Eigenschaften","popupFullScreen":"Vollbild (IE)","popupLeft":"Linke Position","popupLocationBar":"Adress-Leiste","popupMenuBar":"Menü-Leiste","popupResizable":"Größe änderbar","popupScrollBars":"Rollbalken","popupStatusBar":"Statusleiste","popupToolbar":"Symbolleiste","popupTop":"Obere Position","rel":"Beziehung","selectAnchor":"Anker auswählen","styles":"Style","tabIndex":"Tab-Index","target":"Zielseite","targetFrame":"<Frame>","targetFrameName":"Ziel-Fenster-Name","targetPopup":"<Pop-up Fenster>","targetPopupName":"Pop-up Fenster-Name","title":"Link","toAnchor":"Anker in dieser Seite","toEmail":"E-Mail","toUrl":"URL","toolbar":"Link einfügen/editieren","type":"Link-Typ","unlink":"Link entfernen","upload":"Hochladen"},"list":{"bulletedlist":"Liste","numberedlist":"Nummerierte Liste"},"magicline":{"title":"Absatz hier einfügen"},"maximize":{"maximize":"Maximieren","minimize":"Minimieren"},"pastetext":{"button":"Als Text einfügen","title":"Als Text einfügen"},"pastefromword":{"confirmCleanup":"Der Text, den Sie einfügen möchten, scheint aus MS-Word kopiert zu sein. Möchten Sie ihn zuvor bereinigen lassen?","error":"Aufgrund eines internen Fehlers war es nicht möglich die eingefügten Daten zu bereinigen","title":"Aus MS-Word einfügen","toolbar":"Aus MS-Word einfügen"},"removeformat":{"toolbar":"Formatierungen entfernen"},"sourcearea":{"toolbar":"Quellcode"},"specialchar":{"options":"Sonderzeichen Optionen","title":"Sonderzeichen auswählen","toolbar":"Sonderzeichen einfügen/editieren"},"scayt":{"about":"Über SCAYT","aboutTab":"Über","addWord":"Wort hinzufügen","allCaps":"Groß geschriebenen Wörter ignorieren","dic_create":"Erzeugen","dic_delete":"Löschen","dic_field_name":"Wörterbuchname","dic_info":"Anfangs wird das Benutzerwörterbuch in einem Cookie gespeichert. Allerdings sind Cookies in der Größe begrenzt. Wenn das Benutzerwörterbuch bis zu einem Punkt wächst, wo es nicht mehr in einem Cookie gespeichert werden kann, wird das Benutzerwörterbuch auf dem Server gespeichert. Um Ihr persönliches Wörterbuch auf dem Server zu speichern, müssen Sie einen Namen für das Wörterbuch angeben. Falls Sie schon ein gespeicherte Wörterbuch haben, geben Sie bitte dessen Namen ein und klicken Sie auf die Schaltfläche Wiederherstellen.","dic_rename":"Umbenennen","dic_restore":"Wiederherstellen","dictionariesTab":"Wörterbücher","disable":"SCAYT ausschalten","emptyDic":"Wörterbuchname sollte leer sein.","enable":"SCAYT einschalten","ignore":"Ignorieren","ignoreAll":"Alle ignorieren","ignoreDomainNames":"Domain-Namen ignorieren","langs":"Sprachen","languagesTab":"Sprachen","mixedCase":"Wörter mit gemischte Setzkasten ignorieren","mixedWithDigits":"Wörter mit Zahlen ignorieren","moreSuggestions":"Mehr Vorschläge","opera_title":"Nicht von Opera unterstützt","options":"Optionen","optionsTab":"Optionen","title":"Rechtschreibprüfung während der Texteingabe (SCAYT)","toggle":"SCAYT umschalten","noSuggestions":"No suggestion"},"stylescombo":{"label":"Stil","panelTitle":"Formatierungenstil","panelTitle1":"Block Stilart","panelTitle2":"Inline Stilart","panelTitle3":"Objekt Stilart"},"table":{"border":"Rahmen","caption":"Überschrift","cell":{"menu":"Zelle","insertBefore":"Zelle davor einfügen","insertAfter":"Zelle danach einfügen","deleteCell":"Zelle löschen","merge":"Zellen verbinden","mergeRight":"Nach rechts verbinden","mergeDown":"Nach unten verbinden","splitHorizontal":"Zelle horizontal teilen","splitVertical":"Zelle vertikal teilen","title":"Zellen-Eigenschaften","cellType":"Zellart","rowSpan":"Anzahl Zeilen verbinden","colSpan":"Anzahl Spalten verbinden","wordWrap":"Zeilenumbruch","hAlign":"Horizontale Ausrichtung","vAlign":"Vertikale Ausrichtung","alignBaseline":"Grundlinie","bgColor":"Hintergrundfarbe","borderColor":"Rahmenfarbe","data":"Daten","header":"Überschrift","yes":"Ja","no":"Nein","invalidWidth":"Zellenbreite muß eine Zahl sein.","invalidHeight":"Zellenhöhe muß eine Zahl sein.","invalidRowSpan":"\"Anzahl Zeilen verbinden\" muss eine Ganzzahl sein.","invalidColSpan":"\"Anzahl Spalten verbinden\" muss eine Ganzzahl sein.","chooseColor":"Wählen"},"cellPad":"Zellenabstand innen","cellSpace":"Zellenabstand außen","column":{"menu":"Spalte","insertBefore":"Spalte links davor einfügen","insertAfter":"Spalte rechts danach einfügen","deleteColumn":"Spalte löschen"},"columns":"Spalte","deleteTable":"Tabelle löschen","headers":"Kopfzeile","headersBoth":"Beide","headersColumn":"Erste Spalte","headersNone":"Keine","headersRow":"Erste Zeile","invalidBorder":"Die Rahmenbreite muß eine Zahl sein.","invalidCellPadding":"Der Zellenabstand innen muß eine positive Zahl sein.","invalidCellSpacing":"Der Zellenabstand außen muß eine positive Zahl sein.","invalidCols":"Die Anzahl der Spalten muß größer als 0 sein..","invalidHeight":"Die Tabellenbreite muß eine Zahl sein.","invalidRows":"Die Anzahl der Zeilen muß größer als 0 sein.","invalidWidth":"Die Tabellenbreite muss eine Zahl sein.","menu":"Tabellen-Eigenschaften","row":{"menu":"Zeile","insertBefore":"Zeile oberhalb einfügen","insertAfter":"Zeile unterhalb einfügen","deleteRow":"Zeile entfernen"},"rows":"Zeile","summary":"Inhaltsübersicht","title":"Tabellen-Eigenschaften","toolbar":"Tabelle","widthPc":"%","widthPx":"Pixel","widthUnit":"Breite Einheit"},"undo":{"redo":"Wiederherstellen","undo":"Rückgängig"},"wsc":{"btnIgnore":"Ignorieren","btnIgnoreAll":"Alle Ignorieren","btnReplace":"Ersetzen","btnReplaceAll":"Alle Ersetzen","btnUndo":"Rückgängig","changeTo":"Ändern in","errorLoading":"Fehler beim laden des Dienstanbieters: %s.","ieSpellDownload":"Rechtschreibprüfung nicht installiert. Möchten Sie sie jetzt herunterladen?","manyChanges":"Rechtschreibprüfung abgeschlossen - %1 Wörter geändert","noChanges":"Rechtschreibprüfung abgeschlossen - keine Worte geändert","noMispell":"Rechtschreibprüfung abgeschlossen - keine Fehler gefunden","noSuggestions":" - keine Vorschläge - ","notAvailable":"Entschuldigung, aber dieser Dienst steht im Moment nicht zur Verfügung.","notInDic":"Nicht im Wörterbuch","oneChange":"Rechtschreibprüfung abgeschlossen - ein Wort geändert","progress":"Rechtschreibprüfung läuft...","title":"Rechtschreibprüfung","toolbar":"Rechtschreibprüfung"}}; | sfbayman/metricsApp | staticweb/plugins/ckeditor/lang/de.js | JavaScript | mit | 13,275 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation\Tests;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class StreamedResponseTest extends \PHPUnit_Framework_TestCase
{
public function testConstructor()
{
$response = new StreamedResponse(function () { echo 'foo'; }, 404, array('Content-Type' => 'text/plain'));
$this->assertEquals(404, $response->getStatusCode());
$this->assertEquals('text/plain', $response->headers->get('Content-Type'));
}
public function testPrepareWith11Protocol()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$request = Request::create('/');
$request->server->set('SERVER_PROTOCOL', 'HTTP/1.1');
$response->prepare($request);
$this->assertEquals('1.1', $response->getProtocolVersion());
$this->assertNotEquals('chunked', $response->headers->get('Transfer-Encoding'), 'Apache assumes responses with a Transfer-Encoding header set to chunked to already be encoded.');
$this->assertEquals('no-cache, private', $response->headers->get('Cache-Control'));
}
public function testPrepareWith10Protocol()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$request = Request::create('/');
$request->server->set('SERVER_PROTOCOL', 'HTTP/1.0');
$response->prepare($request);
$this->assertEquals('1.0', $response->getProtocolVersion());
$this->assertNull($response->headers->get('Transfer-Encoding'));
$this->assertEquals('no-cache, private', $response->headers->get('Cache-Control'));
}
public function testPrepareWithHeadRequest()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$request = Request::create('/', 'HEAD');
$response->prepare($request);
}
public function testSendContent()
{
$called = 0;
$response = new StreamedResponse(function () use (&$called) { ++$called; });
$response->sendContent();
$this->assertEquals(1, $called);
$response->sendContent();
$this->assertEquals(1, $called);
}
/**
* @expectedException \LogicException
*/
public function testSendContentWithNonCallable()
{
$response = new StreamedResponse(null);
$response->sendContent();
}
/**
* @expectedException \LogicException
*/
public function testSetCallbackNonCallable()
{
$response = new StreamedResponse(null);
$response->setCallback(null);
}
/**
* @expectedException \LogicException
*/
public function testSetContent()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$response->setContent('foo');
}
public function testGetContent()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$this->assertFalse($response->getContent());
}
public function testCreate()
{
$response = StreamedResponse::create(function () {}, 204);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response);
$this->assertEquals(204, $response->getStatusCode());
}
}
| andresJaimes/TOLIMAKIDS | vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php | PHP | mit | 3,509 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* SQLite3 Forge Class
*
* @category Database
* @author Andrey Andreev
* @link https://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlite3_forge extends CI_DB_forge {
/**
* UNSIGNED support
*
* @var bool|array
*/
protected $_unsigned = FALSE;
/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';
// --------------------------------------------------------------------
/**
* Class constructor
*
* @param object &$db Database object
* @return void
*/
public function __construct(&$db)
{
parent::__construct($db);
if (version_compare($this->db->version(), '3.3', '<'))
{
$this->_create_table_if = FALSE;
$this->_drop_table_if = FALSE;
}
}
// --------------------------------------------------------------------
/**
* Create database
*
* @param string $db_name
* @return bool
*/
public function create_database($db_name)
{
// In SQLite, a database is created when you connect to the database.
// We'll return TRUE so that an error isn't generated
return TRUE;
}
// --------------------------------------------------------------------
/**
* Drop database
*
* @param string $db_name (ignored)
* @return bool
*/
public function drop_database($db_name)
{
// In SQLite, a database is dropped when we delete a file
if (file_exists($this->db->database))
{
// We need to close the pseudo-connection first
$this->db->close();
if ( ! @unlink($this->db->database))
{
return $this->db->db_debug ? $this->db->display_error('db_unable_to_drop') : FALSE;
}
elseif ( ! empty($this->db->data_cache['db_names']))
{
$key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE);
if ($key !== FALSE)
{
unset($this->db->data_cache['db_names'][$key]);
}
}
return TRUE;
}
return $this->db->db_debug ? $this->db->display_error('db_unable_to_drop') : FALSE;
}
// --------------------------------------------------------------------
/**
* ALTER TABLE
*
* @todo implement drop_column(), modify_column()
* @param string $alter_type ALTER type
* @param string $table Table name
* @param mixed $field Column definition
* @return string|string[]
*/
protected function _alter_table($alter_type, $table, $field)
{
if ($alter_type === 'DROP' OR $alter_type === 'CHANGE')
{
// drop_column():
// BEGIN TRANSACTION;
// CREATE TEMPORARY TABLE t1_backup(a,b);
// INSERT INTO t1_backup SELECT a,b FROM t1;
// DROP TABLE t1;
// CREATE TABLE t1(a,b);
// INSERT INTO t1 SELECT a,b FROM t1_backup;
// DROP TABLE t1_backup;
// COMMIT;
return FALSE;
}
return parent::_alter_table($alter_type, $table, $field);
}
// --------------------------------------------------------------------
/**
* Process column
*
* @param array $field
* @return string
*/
protected function _process_column($field)
{
return $this->db->escape_identifiers($field['name'])
.' '.$field['type']
.$field['auto_increment']
.$field['null']
.$field['unique']
.$field['default'];
}
// --------------------------------------------------------------------
/**
* Field attribute TYPE
*
* Performs a data type mapping between different databases.
*
* @param array &$attributes
* @return void
*/
protected function _attr_type(&$attributes)
{
switch (strtoupper($attributes['TYPE']))
{
case 'ENUM':
case 'SET':
$attributes['TYPE'] = 'TEXT';
return;
default: return;
}
}
// --------------------------------------------------------------------
/**
* Field attribute AUTO_INCREMENT
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'int') !== FALSE)
{
$field['type'] = 'INTEGER PRIMARY KEY';
$field['default'] = '';
$field['null'] = '';
$field['unique'] = '';
$field['auto_increment'] = ' AUTOINCREMENT';
$this->primary_keys = array();
}
}
}
| sharktek-nathan/CISC-662-Term-Project | system/database/drivers/sqlite3/sqlite3_forge.php | PHP | mit | 5,963 |
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/behavior",["./_base/kernel","./_base/lang","./_base/array","./_base/connect","./query","./ready"],function(_1,_2,_3,_4,_5,_6){
_1.behavior=new function(){
function _7(_8,_9){
if(!_8[_9]){
_8[_9]=[];
}
return _8[_9];
};
var _a=0;
function _b(_c,_d,_e){
var _f={};
for(var x in _c){
if(typeof _f[x]=="undefined"){
if(!_e){
_d(_c[x],x);
}else{
_e.call(_d,_c[x],x);
}
}
}
};
this._behaviors={};
this.add=function(_10){
_b(_10,this,function(_11,_12){
var _13=_7(this._behaviors,_12);
if(typeof _13["id"]!="number"){
_13.id=_a++;
}
var _14=[];
_13.push(_14);
if((_2.isString(_11))||(_2.isFunction(_11))){
_11={found:_11};
}
_b(_11,function(_15,_16){
_7(_14,_16).push(_15);
});
});
};
var _17=function(_18,_19,_1a){
if(_2.isString(_19)){
if(_1a=="found"){
_4.publish(_19,[_18]);
}else{
_4.connect(_18,_1a,function(){
_4.publish(_19,arguments);
});
}
}else{
if(_2.isFunction(_19)){
if(_1a=="found"){
_19(_18);
}else{
_4.connect(_18,_1a,_19);
}
}
}
};
this.apply=function(){
_b(this._behaviors,function(_1b,id){
_5(id).forEach(function(_1c){
var _1d=0;
var bid="_dj_behavior_"+_1b.id;
if(typeof _1c[bid]=="number"){
_1d=_1c[bid];
if(_1d==(_1b.length)){
return;
}
}
for(var x=_1d,_1e;_1e=_1b[x];x++){
_b(_1e,function(_1f,_20){
if(_2.isArray(_1f)){
_3.forEach(_1f,function(_21){
_17(_1c,_21,_20);
});
}
});
}
_1c[bid]=_1b.length;
});
});
};
};
_6(_1.behavior,"apply");
return _1.behavior;
});
| hasantayyar/cdnjs | ajax/libs/dojo/1.7.6/behavior.js | JavaScript | mit | 1,601 |
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gfm",function(o,n){function r(e){return e.code=!1,null}var t=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,o){if(o.combineTokens=null,o.codeBlock)return e.match(/^```/)?(o.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(o.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),o.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var r=1+e.pos-n;return o.code?r===t&&(o.code=!1):(t=r,o.code=!0),null}if(o.code)return e.next(),null;if(e.eatSpace())return o.ateSpace=!0,null;if(e.sol()||o.ateSpace){if(o.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return o.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return o.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(o.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},c={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var d in n)c[d]=n[d];return c.name="markdown",e.defineMIME("gfmBase",c),e.overlayMode(e.getMode(o,"gfmBase"),a)},"markdown")}); | BenjaminVanRyseghem/cdnjs | ajax/libs/codemirror/4.10.0/mode/gfm/gfm.min.js | JavaScript | mit | 1,719 |
// sample on how to use the parser and walker API to instrument some code
var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify;
function instrument(code) {
var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want
// to have start/end tokens embedded in the
// statements
var w = pro.ast_walker();
function trace (line, comment) {
var code = pro.gen_code(line, { beautify: true });
var data = line[0]
var args = []
if (!comment) comment = ""
if (typeof data === "object") {
code = code.split(/\n/).shift()
args = [ [ "string", data.toString() ],
[ "string", code ],
[ "num", data.start.line ],
[ "num", data.start.col ],
[ "num", data.end.line ],
[ "num", data.end.col ]]
} else {
args = [ [ "string", data ],
[ "string", code ]]
}
return [ "call", [ "name", "trace" ], args ];
}
// we're gonna need this to push elements that we're currently looking at, to avoid
// endless recursion.
var analyzing = [];
function do_stat() {
var ret;
if (this[0].start && analyzing.indexOf(this) < 0) {
// without the `analyzing' hack, w.walk(this) would re-enter here leading
// to infinite recursion
analyzing.push(this);
ret = [ "splice",
[ [ "stat", trace(this) ],
w.walk(this) ]];
analyzing.pop(this);
}
return ret;
}
function do_cond(c, t, f) {
return [ this[0], w.walk(c),
["seq", trace(t), w.walk(t) ],
["seq", trace(f), w.walk(f) ]];
}
function do_binary(c, l, r) {
if (c !== "&&" && c !== "||") {
return [this[0], c, w.walk(l), w.walk(r)];
}
return [ this[0], c,
["seq", trace(l), w.walk(l) ],
["seq", trace(r), w.walk(r) ]];
}
var new_ast = w.with_walkers({
"stat" : do_stat,
"label" : do_stat,
"break" : do_stat,
"continue" : do_stat,
"debugger" : do_stat,
"var" : do_stat,
"const" : do_stat,
"return" : do_stat,
"throw" : do_stat,
"try" : do_stat,
"defun" : do_stat,
"if" : do_stat,
"while" : do_stat,
"do" : do_stat,
"for" : do_stat,
"for-in" : do_stat,
"switch" : do_stat,
"with" : do_stat,
"conditional" : do_cond,
"binary" : do_binary
}, function(){
return w.walk(ast);
});
return pro.gen_code(new_ast, { beautify: true });
}
////// test code follows.
var code = instrument(test.toString());
console.log(code);
function test() {
// simple stats
a = 5;
c += a + b;
"foo";
// var
var foo = 5;
const bar = 6, baz = 7;
// switch block. note we can't track case lines the same way.
switch ("foo") {
case "foo":
return 1;
case "bar":
return 2;
}
// for/for in
for (var i = 0; i < 5; ++i) {
console.log("Hello " + i);
}
for (var i in [ 1, 2, 3]) {
console.log(i);
}
for (var i = 0; i < 5; ++i)
console.log("foo");
for (var i = 0; i < 5; ++i) {
console.log("foo");
}
var k = plurp() ? 1 : 0;
var x = a ? doX(y) && goZoo("zoo")
: b ? blerg({ x: y })
: null;
var x = X || Y;
}
| franksama/AngularJS | node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument2.js | JavaScript | mit | 4,583 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Extension;
use Symfony\Component\Yaml\Dumper as YamlDumper;
/**
* Provides integration of the Yaml component with Twig.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class YamlExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getFilters()
{
return array(
'yaml_encode' => new \Twig_Filter_Method($this, 'encode'),
'yaml_dump' => new \Twig_Filter_Method($this, 'dump'),
);
}
public function encode($input, $inline = 0)
{
static $dumper;
if (null === $dumper) {
$dumper = new YamlDumper();
}
return $dumper->dump($input, $inline);
}
public function dump($value)
{
if (is_resource($value)) {
return '%Resource%';
}
if (is_array($value) || is_object($value)) {
return '%'.gettype($value).'% '.$this->encode($value);
}
return $value;
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'yaml';
}
}
| JKord/CreditUnionSoftwareDb | vendor/symfony/src/Symfony/Bridge/Twig/Extension/YamlExtension.php | PHP | mit | 1,417 |
$.extend($.validity.messages, {
require:"#{field} est requis.",
// Format validators:
match:"#{field} est dans un mauvais format.",
integer:"#{field} doit être un nombre entier positif.",
date:"#{field} doit être une date.",
email:"#{field} doit être une adresse email.",
usd:"#{field} doit être un montant en US Dollars.",
url:"#{field} doit être une adresse URL.",
number:"#{field} doit être un nombre.",
zip:"#{field} doit être un code postal ##### ou #####-####.",
phone:"#{field} doit être un numéro de téléphone ###-###-####.",
guid:"#{field} doit être un guid du type {3F2504E0-4F89-11D3-9A0C-0305E82C3301}.",
time24:"#{field} doit être une heure au format 24 heures (ex: 23:00).",
time12:"#{field} doit être une heure au format 12 heures (ex:12:00 AM/PM)",
// Value range messages:
lessThan:"#{field} doit être inférieur à #{max}.",
lessThanOrEqualTo:"#{field} doit être inférieur ou égal à #{max}.",
greaterThan:"#{field} doit être supérieur à #{min}.",
greaterThanOrEqualTo:"#{field} doit être supérieur ou égal à #{min}.",
range:"#{field} doit être compris entre #{min} et #{max}.",
// Value length messages:
tooLong:"#{field} ne doit pas dépasser #{max} caractères.",
tooShort:"#{field} doit contenir au minimum #{min} caractères.",
// Composition validators:
nonHtml:"#{field} ne doit pas contenir de caractères HTML.",
alphabet:"#{field} contient des caratères interdits.",
minCharClass:"#{field} ne doit pas contenir plus de #{min} #{charClass} caractères.",
maxCharClass:"#{field} ne doit pas contenir moins de #{min} #{charClass} caractères.",
// Aggregate validator messages:
equal:"Les valeurs ne correspondent pas.",
distinct:"Une valeur est répétée.",
sum:"La somme des valeurs diffère de #{sum}.",
sumMax:"La somme des valeurs doit être inférieure à #{max}.",
sumMin:"La somme des valeurs doit être supérieure à #{min}.",
// Radio validator messages:
radioChecked:"La valeur sélectionnée est invalide.",
generic:"Invalide."
});
$.validity.setup({ defaultFieldName:"Ce champ", }); | jonataswalker/jsdelivr | files/jquery.validity/1.3.0/jquery.validity.lang.fr.js | JavaScript | mit | 2,212 |
/*!
* # Semantic UI 2.0.4 - Feed
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/.ui.feed{margin:1em 0}.ui.feed:first-child{margin-top:0}.ui.feed:last-child{margin-bottom:0}.ui.feed>.event{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:100%;padding:.21428571rem 0;margin:0;background:0 0;border-top:none}.ui.feed>.event:first-child{border-top:0;padding-top:0}.ui.feed>.event:last-child{padding-bottom:0}.ui.feed>.event>.label{display:block;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:2.5em;height:auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;text-align:left}.ui.feed>.event>.label .icon{opacity:1;font-size:1.5em;width:100%;padding:.25em;background:0 0;border:none;border-radius:none;color:rgba(0,0,0,.6)}.ui.feed>.event>.label img{width:100%;height:auto;border-radius:500rem}.ui.feed>.event>.label+.content{margin:.5em 0 .35714286em 1.14285714em}.ui.feed>.event>.content{display:block;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;text-align:left;word-wrap:break-word}.ui.feed>.event:last-child>.content{padding-bottom:0}.ui.feed>.event>.content a{cursor:pointer}.ui.feed>.event>.content .date{margin:-.5rem 0 0;padding:0;font-weight:400;font-size:1em;font-style:normal;color:rgba(0,0,0,.4)}.ui.feed>.event>.content .summary{margin:0;font-size:1em;font-weight:700;color:rgba(0,0,0,.87)}.ui.feed>.event>.content .summary img{display:inline-block;width:auto;height:10em;margin:-.25em .25em 0 0;border-radius:.25em;vertical-align:middle}.ui.feed>.event>.content .user{display:inline-block;font-weight:700;margin-right:0;vertical-align:baseline}.ui.feed>.event>.content .user img{margin:-.25em .25em 0 0;width:auto;height:10em;vertical-align:middle}.ui.feed>.event>.content .summary>.date{display:inline-block;float:none;font-weight:400;font-size:.85714286em;font-style:normal;margin:0 0 0 .5em;padding:0;color:rgba(0,0,0,.4)}.ui.feed>.event>.content .extra{margin:.5em 0 0;background:0 0;padding:0;color:rgba(0,0,0,.87)}.ui.feed>.event>.content .extra.images img{display:inline-block;margin:0 .25em 0 0;width:6em}.ui.feed>.event>.content .extra.text{padding:0;border-left:none;font-size:1em;max-width:500px;line-height:1.4285em}.ui.feed>.event>.content .meta{display:inline-block;font-size:.85714286em;margin:.5em 0 0;background:0 0;border:none;border-radius:0;box-shadow:none;padding:0;color:rgba(0,0,0,.6)}.ui.feed>.event>.content .meta>*{position:relative;margin-left:.75em}.ui.feed>.event>.content .meta>:after{content:'';color:rgba(0,0,0,.2);top:0;left:-1em;opacity:1;position:absolute;vertical-align:top}.ui.feed>.event>.content .meta .like{color:'';-webkit-transition:.2s color ease;transition:.2s color ease}.ui.feed>.event>.content .meta .like:hover .icon{color:#ff2733}.ui.feed>.event>.content .meta .active.like .icon{color:#ef404a}.ui.feed>.event>.content .meta>:first-child{margin-left:0}.ui.feed>.event>.content .meta>:first-child::after{display:none}.ui.feed>.event>.content .meta a,.ui.feed>.event>.content .meta>.icon{cursor:pointer;opacity:1;color:rgba(0,0,0,.5);-webkit-transition:color .1s ease;transition:color .1s ease}.ui.feed>.event>.content .meta a:hover,.ui.feed>.event>.content .meta a:hover .icon,.ui.feed>.event>.content .meta>.icon:hover{color:rgba(0,0,0,.95)}.ui.small.feed{font-size:.92857143rem}.ui.feed{font-size:1rem}.ui.large.feed{font-size:1.14285714rem} | Olical/cdnjs | ajax/libs/semantic-ui/2.0.4/components/feed.min.css | CSS | mit | 3,735 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
/**
* @api
*/
class TypeValidator extends ConstraintValidator
{
/**
* Checks if the passed value is valid.
*
* @param mixed $value The value that should be validated
* @param Constraint $constraint The constraint for the validation
*
* @return Boolean Whether or not the value is valid
*
* @api
*/
public function isValid($value, Constraint $constraint)
{
if (null === $value) {
return true;
}
$type = $constraint->type == 'boolean' ? 'bool' : $constraint->type;
$function = 'is_'.$type;
if (function_exists($function) && call_user_func($function, $value)) {
return true;
} elseif ($value instanceof $constraint->type) {
return true;
}
$this->setMessage($constraint->message, array(
'{{ value }}' => is_object($value) ? get_class($value) : is_array($value) ? 'Array' : (string) $value,
'{{ type }}' => $constraint->type,
));
return false;
}
}
| fivestar/php-rentacar | vendor/symfony/src/Symfony/Component/Validator/Constraints/TypeValidator.php | PHP | mit | 1,449 |
/* LANGUAGE
================================================== */typeof VMM!="undefined"&&(VMM.Language={lang:"en",api:{wikipedia:"en"},date:{month:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],month_abbr:["Ιαν.","Φεβ.","Μαρ.","Απρ.","Μαη","Ιουν.","Ιουλ.","Αύγ.","Σεπτ.","Οκτ.","Νοεμ.","Δεκ."],day:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],day_abbr:["Κυρ.","Δευ.","Τρίτη.","Τετ.","Πεμπ.","Παρ.","Σαβ."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"mmm d",full:"mmmm d',' yyyy",time_no_seconds_short:"h:MM TT",time_no_seconds_small_date:"h:MM TT'<br/><small>'mmmm d',' yyyy'</small>'",full_long:"mmm d',' yyyy 'at' h:MM TT",full_long_small_date:"h:MM TT'<br/><small>mmm d',' yyyy'</small>'"},messages:{loading_timeline:"Φόρτωση Timeline... ",return_to_title:"Επιστροφή στον Τίτλο",expand_timeline:"Μεγέθυνση",contract_timeline:"Contract Timeline",wikipedia:"From Wikipedia, the free encyclopedia",loading_content:"Φόρτωση Περιεχομένου",loading:"Γίνεται Φόρτωση"}}); | towerz/jsdelivr | files/timelinejs/2.17/js/locale/el.js | JavaScript | mit | 1,401 |
.vco-storyjs{font-family:'PT Serif',serif;}.vco-storyjs .twitter,.vco-storyjs .vcard,.vco-storyjs .messege,.vco-storyjs .credit,.vco-storyjs .caption,.vco-storyjs .zoom-in,.vco-storyjs .zoom-out,.vco-storyjs .back-home,.vco-storyjs .time-interval div,.vco-storyjs .time-interval-major div,.vco-storyjs .nav-container{font-family:'PT Sans',sans-serif !important;}
.vco-storyjs .vco-feature h1.date,.vco-storyjs .vco-feature h2.date,.vco-storyjs .vco-feature h3.date,.vco-storyjs .vco-feature h4.date,.vco-storyjs .vco-feature h5.date,.vco-storyjs .vco-feature h6.date{font-family:'PT Sans',sans-serif !important;}
.vco-storyjs .timenav h1,.vco-storyjs .flag-content h1,.vco-storyjs .era h1,.vco-storyjs .timenav h2,.vco-storyjs .flag-content h2,.vco-storyjs .era h2,.vco-storyjs .timenav h3,.vco-storyjs .flag-content h3,.vco-storyjs .era h3,.vco-storyjs .timenav h4,.vco-storyjs .flag-content h4,.vco-storyjs .era h4,.vco-storyjs .timenav h5,.vco-storyjs .flag-content h5,.vco-storyjs .era h5,.vco-storyjs .timenav h6,.vco-storyjs .flag-content h6,.vco-storyjs .era h6{font-family:'PT Sans',sans-serif !important;}
.vco-storyjs p,.vco-storyjs blockquote,.vco-storyjs blockquote p,.vco-storyjs .twitter blockquote p{font-family:'PT Serif',serif !important;}
.vco-storyjs blockquote,.vco-storyjs blockquote p,.vco-storyjs .twitter blockquote p{font-style:italic;}
.vco-storyjs .vco-feature h1,.vco-storyjs .vco-feature h2,.vco-storyjs .vco-feature h3,.vco-storyjs .vco-feature h4,.vco-storyjs .vco-feature h5,.vco-storyjs .vco-feature h6{font-family:'PT Sans Narrow',sans-serif;font-weight:700;}
.tooltip{font-family:'PT Sans',sans-serif;}
| zhuwenxuan/qyerCDN | files/timelinejs/2.17/css/themes/font/PT.css | CSS | mit | 1,645 |
// Type definitions for AppFramework 2.0
// Project: http://app-framework-software.intel.com/
// Definitions by: kyo_ago <https://github.com/kyo-ago>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface appFrameworkStatic {
/**
* This is the internal appframework object that gets extended and added on to it
* This is also the start of our query selector engine
* @param {String|Element|Object|Array} selector
* @param {String|Element|Object} [context]
*/
(selector: string, context?: any): appFrameworkCollection;
(collection: appFrameworkCollection): appFrameworkCollection;
(element: HTMLElement): appFrameworkCollection;
(htmlString: string): appFrameworkCollection;
(object: any): appFrameworkCollection;
/**
* Checks to see if the parameter is a $afm object
```
var foo=$('#header');
$.is$(foo);
```
* @param {Object} element
* @return {Boolean}
* @title $.is$(param)
*/
is$(obj: any): boolean;
/**
* Map takes in elements and executes a callback function on each and returns a collection
```
$.map([1,2],function(ind){return ind+1});
```
* @param {Array|Object} elements
* @param {Function} callback
* @return {Object} appframework object with elements in it
* @title $.map(elements,callback)
*/
map(collection: any[], fn: (item: any, index: number) => any): any[];
/**
* Iterates through elements and executes a callback. Returns if false
```
$.each([1,2],function(ind){console.log(ind);});
```
* @param {Array|Object} elements
* @param {Function} callback
* @return {Array} elements
* @title $.each(elements,callback)
*/
each(collection: any[], fn: (index: number, item: any) => any): void;
each(collection: any, fn: (key: string, value: any) => any): void;
/**
* Extends an object with additional arguments
```
$.extend({foo:'bar'});
$.extend(element,{foo:'bar'});
```
* @param {Object} [target] element
* @param any number of additional arguments
* @return {Object} [target]
* @title $.extend(target,{params})
*/
extend(target: any, ...sources: any[]): any;
/**
* Checks to see if the parameter is an array
```
var arr=[];
$.isArray(arr);
```
* @param {Object} element
* @return {Boolean}
* @example $.isArray([1]);
* @title $.isArray(param)
*/
isArray(object: any): boolean;
/**
* Checks to see if the parameter is a function
```
var func=function(){};
$.isFunction(func);
```
* @param {Object} element
* @return {Boolean}
* @title $.isFunction(param)
*/
isFunction(object: any): boolean;
/**
* Checks to see if the parameter is a object
```
var foo={bar:'bar'};
$.isObject(foo);
```
* @param {Object} element
* @return {Boolean}
* @title $.isObject(param)
*/
isObject(object: any): boolean;
/**
* Prototype for afm object. Also extens $.fn
*/
fn: Object;
/* AJAX settings */
ajaxSettings: appFrameworkAjaxSettings;
/**
* Execute a jsonP call, allowing cross domain scripting
* options.url - URL to call
* options.success - Success function to call
* options.error - Error function to call
```
$.jsonP({url:'mysite.php?callback=?&foo=bar',success:function(){},error:function(){}});
```
* @param {Object} options
* @title $.jsonP(options)
*/
jsonP(options: appFrameworkAjaxSettings): {};
/**
* Execute an Ajax call with the given options
* options.type - Type of request
* options.beforeSend - function to execute before sending the request
* options.success - success callback
* options.error - error callback
* options.complete - complete callback - callled with a success or error
* options.timeout - timeout to wait for the request
* options.url - URL to make request against
* options.contentType - HTTP Request Content Type
* options.headers - Object of headers to set
* options.dataType - Data type of request
* options.data - data to pass into request. $.param is called on objects
```
var opts={
type:"GET",
success:function(data){},
url:"mypage.php",
data:{bar:'bar'},
}
$.ajax(opts);
```
* @param {Object} options
* @title $.ajax(options)
*/
ajax(options: appFrameworkAjaxSettings): XMLHttpRequest;
/**
* Shorthand call to an Ajax GET request
```
$.get("mypage.php?foo=bar",function(data){});
```
* @param {String} url to hit
* @param {Function} success
* @title $.get(url,success)
*/
get(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest;
/**
* Shorthand call to an Ajax POST request
```
$.post("mypage.php",{bar:'bar'},function(data){});
```
* @param {String} url to hit
* @param {Object} [data] to pass in
* @param {Function} success
* @param {String} [dataType]
* @title $.post(url,[data],success,[dataType])
*/
post(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest;
post(url: string, data: any, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest;
/**
* Shorthand call to an Ajax request that expects a JSON response
```
$.getJSON("mypage.php",{bar:'bar'},function(data){});
```
* @param {String} url to hit
* @param {Object} [data]
* @param {Function} [success]
* @title $.getJSON(url,data,success)
*/
getJSON(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest;
getJSON(url: string, data: any, fn: (data: any, status: string, xhr: XMLHttpRequest) => void ): XMLHttpRequest;
/**
* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string
```
var obj={
foo:'foo',
bar:'bar'
}
var kvp=$.param(obj,'data');
```
* @param {Object} object
* @param {String} [prefix]
* @return {String} Key/value pair representation
* @title $.param(object,[prefix];
*/
param(object: any, prefix?: string): string;
/**
* Used for backwards compatibility. Uses native JSON.parse function
```
var obj=$.parseJSON("{\"bar\":\"bar\"}");
```
* @params {String} string
* @return {Object}
* @title $.parseJSON(string)
*/
parseJSON(str: string): any;
/**
* Helper function to convert XML into the DOM node representation
```
var xmlDoc=$.parseXML("<xml><foo>bar</foo></xml>");
```
* @param {String} string
* @return {Object} DOM nodes
* @title $.parseXML(string)
*/
parseXML(str: string): any;
/**
* Utility function to create a psuedo GUID
```
var id= $.uuid();
```
* @title $.uuid
*/
uuid(): string;
/**
* Gets the css matrix, or creates a fake one
```
$.getCssMatrix(domElement)
```
@returns matrix with postion
*/
getCssMatrix(node: HTMLElement): appFrameworkCssMatrix;
getCssMatrix(elem: appFrameworkCollection): appFrameworkCssMatrix;
/**
* $.create - a faster alertnative to $("<div id='main'>this is some text</div>");
```
$.create("div",{id:'main',innerHTML:'this is some text'});
$.create("<div id='main'>this is some text</div>");
```
* @param {String} DOM Element type or html
* @param [{Object}] properties to apply to the element
* @return {Object} Returns an appframework object
* @title $.create(type,[params])
*/
create(type: string, params?: any): appFrameworkCollection;
/**
* $.query - a faster alertnative to $("div");
```
$.query(".panel");
```
* @param {String} selector
* @param {Object} [context]
* @return {Object} Returns an appframework object
* @title $.query(selector,[context])
*/
query(selector: string, context?: any): appFrameworkCollection;
/**
* Creates a custom event to be used internally.
* @param {String} type
* @param {Object} [properties]
* @return {event} a custom event that can then be dispatched
* @title $.Event(type,props);
*/
Event(type: string, props: any): any;
/* The following are for events on objects */
/**
* Bind an event to an object instead of a DOM Node
```
$.bind(this,'event',function(){});
```
* @param {Object} object
* @param {String} event name
* @param {Function} function to execute
* @title $.bind(object,event,function);
*/
bind(object: any, event: string, fn: Function): void;
/**
* Trigger an event to an object instead of a DOM Node
```
$.trigger(this,'event',arguments);
```
* @param {Object} object
* @param {String} event name
* @param {Array} arguments
* @title $.trigger(object,event,argments);
*/
trigger(object: any, event: string, args?: any[]): void;
/**
* Unbind an event to an object instead of a DOM Node
```
$.unbind(this,'event',function(){});
```
* @param {Object} object
* @param {String} event name
* @param {Function} function to execute
* @title $.unbind(object,event,function);
*/
unbind(object: any, event: string, fn: Function): void;
/**
* Creates a proxy function so you can change the 'this' context in the function
* Update: now also allows multiple argument call or for you to pass your own arguments
```
var newObj={foo:bar}
$("#main").bind("click",$.proxy(function(evt){console.log(this)},newObj);
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj) )('foo', 'bar');
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj, ['foo', 'bar']) )();
```
* @param {Function} Callback
* @param {Object} Context
* @title $.proxy(callback,context);
*/
proxy(callback: Function, context: any): void;
/**
* Function to clean up node content to prevent memory leaks
```
$.cleanUpContent(node,itself,kill)
```
* @param {HTMLNode} node
* @param {Bool} kill itself
* @param {bool} Kill nodes
* @title $.cleanUpContent(node,itself,kill)
*/
cleanUpContent(node: HTMLElement, itself?: boolean, kill?: boolean): void;
/**
* This adds a command to execute in the JS stack, but is faster then setTimeout
```
$.asap(function,context,args)
```
* @param {Function} function
* @param {Object} context
* @param {Array} arguments
*/
asap(callback: Function, context?: any, args?: any[]): void;
/**
* this function executes javascript in HTML.
```
$.parseJS(content)
```
* @param {String|DOM} content
* @title $.parseJS(content);
*/
parseJS(content: string): void;
parseJS(content: HTMLElement): void;
/**
* Helper function to parse the user agent. Sets the following
* .os.webkit
* .os.android
* .os.ipad
* .os.iphone
* .os.webos
* .os.touchpad
* .os.blackberry
* .os.opera
* .os.fennec
* .os.ie
* .os.ieTouch
* .os.supportsTouch
* .os.playbook
* .feat.nativetouchScroll
* @api private
*/
os: {
webkit: boolean;
android: boolean;
androidICS: boolean;
ipad: boolean;
iphone: boolean;
ios7: boolean;
webos: boolean;
touchpad: boolean;
ios: boolean;
playbook: boolean;
blackberry: boolean;
blackberry10: boolean;
chrome: boolean;
opera: boolean;
fennec: boolean;
ie: boolean;
ieTouch: boolean;
supportsTouch: boolean;
};
feat: {
nativeTouchScroll: boolean;
cssPrefix: string;
cssTransformStart: string;
cssTransformEnd: string;
}
}
interface appFrameworkCollection {
reduce(callbackfn: (previousValue: appFrameworkCollection, currentValue: appFrameworkCollection, currentIndex: number, array: appFrameworkCollection[]) => appFrameworkCollection, initialValue?: appFrameworkCollection): appFrameworkCollection;
push(...items: appFrameworkCollection[]): number;
indexOf(searchElement: appFrameworkCollection, fromIndex?: number): number;
concat(...items: appFrameworkCollection[]): appFrameworkCollection[];
slice(start: number, end?: number): appFrameworkCollection[];
length: number;
/**
* This is a wrapper to $.map on the selected elements
```
$().map(function(){this.value+=ind});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().map(function)
*/
map(fn: (index: number, item: any) => any): appFrameworkCollection;
/**
* Iterates through all elements and applys a callback function
```
$().each(function(){console.log(this.value)});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().each(function)
*/
each(fn: (index: number, item: any) => any): appFrameworkCollection;
forEach(fn: (item: any, index: number) => any): void;
/**
* This is executed when DOMContentLoaded happens, or after if you've registered for it.
```
$(document).ready(function(){console.log('I'm ready');});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().ready(function)
*/
ready(fn: Function): appFrameworkStatic;
/**
* Searches through the collection and reduces them to elements that match the selector
```
$("#foo").find('.bar');
$("#foo").find($('.bar'));
$("#foo").find($('.bar').get(0));
```
* @param {String|Object|Array} selector
* @return {Object} an appframework object filtered
* @title $().find(selector)
*/
find(selector: string): appFrameworkCollection;
/**
* Gets or sets the innerHTML for the collection.
* If used as a get, the first elements innerHTML is returned
```
$("#foo").html(); //gets the first elements html
$("#foo").html('new html');//sets the html
$("#foo").html('new html',false); //Do not do memory management cleanup
```
* @param {String} html to set
* @param {Bool} [cleanup] - set to false for performance tests and if you do not want to execute memory management cleanup
* @return {Object} an appframework object
* @title $().html([html])
*/
html(): string;
html(html: string): appFrameworkCollection;
html(html: string, cleanup: boolean): appFrameworkCollection;
/**
* Gets or sets the innerText for the collection.
* If used as a get, the first elements innerText is returned
```
$("#foo").text(); //gets the first elements text;
$("#foo").text('new text'); //sets the text
```
* @param {String} text to set
* @return {Object} an appframework object
* @title $().text([text])
*/
text(): string;
text(text: string): appFrameworkCollection;
/**
* Gets or sets a css property for the collection
* If used as a get, the first elements css property is returned
* This will add px to properties that need it.
```
$().css("background"); // Gets the first elements background
$().css("background","red") //Sets the elements background to red
```
* @param {String} attribute to get
* @param {String} value to set as
* @return {Object} an appframework object
* @title $().css(attribute,[value])
*/
css(property: string): any;
css(property: string, value: any): appFrameworkCollection;
css(properties: any): appFrameworkCollection;
/**
* Performs a css vendor specific transform:translate operation on the collection.
*
```
$("#main").cssTranslate('200px,0,0');
```
* @param {String} Transform values
* @return {Object} an appframework object
* @title $().vendorCss(value)
*/
vendorCss(transform: string): appFrameworkCollection;
/**
* Gets the computed style of CSS values
*
```
$("#main").computedStyle('display');
```
* @param {String} css property
* @return {Int|String|Float|} css vlaue
* @title $().computedStyle()
*/
computedStyle(css: string): appFrameworkCollection;
/**
* Sets the innerHTML of all elements to an empty string
```
$().empty();
```
* @return {Object} an appframework object
* @title $().empty()
*/
empty(): appFrameworkCollection;
/**
* Sets the elements display property to "none".
* This will also store the old property into an attribute for hide
```
$().hide();
```
* @return {Object} an appframework object
* @title $().hide()
*/
hide(): appFrameworkCollection;
/**
* Shows all the elements by setting the css display property
* We look to see if we were retaining an old style (like table-cell) and restore that, otherwise we set it to block
```
$().show();
```
* @return {Object} an appframework object
* @title $().show()
*/
show(): appFrameworkCollection;
/**
* Toggle the visibility of a div
```
$().toggle();
$().toggle(true); //force showing
```
* @param {Boolean} [show] -force the hiding or showing of the element
* @return {Object} an appframework object
* @title $().toggle([show])
*/
toggle(show?: boolean): appFrameworkCollection;
/**
* Gets or sets an elements value
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().value; //Gets the first elements value;
$().value="bar"; //Sets all elements value to bar
```
* @param {String} [value] to set
* @return {String|Object} A string as a getter, appframework object as a setter
* @title $().val([value])
*/
val(): string;
val(value: string): appFrameworkCollection;
/**
* Gets or sets an attribute on an element
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().attr("foo"); //Gets the first elements 'foo' attribute
$().attr("foo","bar");//Sets the elements 'foo' attribute to 'bar'
$().attr("foo",{bar:'bar'}) //Adds the object to an internal cache
```
* @param {String|Object} attribute to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
* @param {String|Array|Object|function} [value] to set
* @return {String|Object|Array|Function} If used as a getter, return the attribute value. If a setter, return an appframework object
* @title $().attr(attribute,[value])
*/
attr(attribute: string): any;
attr(attributeHash: Object): appFrameworkCollection;
attr(attribute: string, value: string): appFrameworkCollection;
attr(attribute: string, value: any): appFrameworkCollection;
/**
* Removes an attribute on the elements
```
$().removeAttr("foo");
```
* @param {String} attributes that can be space delimited
* @return {Object} appframework object
* @title $().removeAttr(attribute)
*/
removeAttr(attribute: string): appFrameworkCollection;
/**
* Gets or sets a property on an element
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().prop("foo"); //Gets the first elements 'foo' property
$().prop("foo","bar");//Sets the elements 'foo' property to 'bar'
$().prop("foo",{bar:'bar'}) //Adds the object to an internal cache
```
* @param {String|Object} property to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
* @param {String|Array|Object|function} [value] to set
* @return {String|Object|Array|Function} If used as a getter, return the property value. If a setter, return an appframework object
* @title $().prop(property,[value])
*/
prop(attribute: string): any;
prop(attributeHash: Object): appFrameworkCollection;
prop(attribute: string, value: string): appFrameworkCollection;
prop(attribute: string, value: any): appFrameworkCollection;
/**
* Removes a property on the elements
```
$().removeProp("foo");
```
* @param {String} properties that can be space delimited
* @return {Object} appframework object
* @title $().removeProp(attribute)
*/
removeProp(attribute: string): appFrameworkCollection;
/**
* Removes elements based off a selector
```
$().remove(); //Remove all
$().remove(".foo");//Remove off a string selector
var element=$("#foo").get(0);
$().remove(element); //Remove by an element
$().remove($(".foo")); //Remove by a collection
```
* @param {String|Object|Array} selector to filter against
* @return {Object} appframework object
* @title $().remove(selector)
*/
remove(): appFrameworkCollection;
remove(selector: string): appFrameworkCollection;
remove(element: HTMLElement): appFrameworkCollection;
remove(elements: any[]): appFrameworkCollection;
remove(elements: appFrameworkCollection): appFrameworkCollection;
/**
* Adds a css class to elements.
```
$().addClass("selected");
```
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().addClass(name)
*/
addClass(className: string): appFrameworkCollection;
/**
* Removes a css class from elements.
```
$().removeClass("foo"); //single class
$().removeClass("foo selected");//remove multiple classess
```
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().removeClass(name)
*/
removeClass(className: string): appFrameworkCollection;
/**
* Adds or removes a css class to elements.
```
$().toggleClass("selected");
```
* @param {String} classes that are space delimited
* @param {Boolean} [state] force toggle to add or remove classes
* @return {Object} appframework object
* @title $().toggleClass(name)
*/
toggleClass(name: string, state?: boolean): appFrameworkCollection;
/**
* Replaces a css class on elements.
```
$().replaceClass("on", "off");
```
* @param {String} classes that are space delimited
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().replaceClass(old, new)
*/
replaceClass(oldClassName: string, newClassName: string): appFrameworkCollection;
/**
* Checks to see if an element has a class.
```
$().hasClass('foo');
$().hasClass('foo',element);
```
* @param {String} class name to check against
* @param {Object} [element] to check against
* @return {Boolean}
* @title $().hasClass(name,[element])
*/
hasClass(className: string, element: HTMLElement): boolean;
/**
* Appends to the elements
* We boil everything down to an appframework object and then loop through that.
* If it's HTML, we create a dom element so we do not break event bindings.
* if it's a script tag, we evaluate it.
```
$().append("<div></div>"); //Creates the object from the string and appends it
$().append($("#foo")); //Append an object;
```
* @param {String|Object} Element/string to add
* @param {Boolean} [insert] insert or append
* @return {Object} appframework object
* @title $().append(element,[insert])
*/
append(content: any): appFrameworkCollection;
/**
* Appends the current collection to the selector
```
$().appendTo("#foo"); //Append an object;
```
* @param {String|Object} Selector to append to
* @param {Boolean} [insert] insert or append
* @title $().appendTo(element,[insert])
*/
appendTo(target: any): appFrameworkCollection;
/**
* Prepends the current collection to the selector
```
$().prependTo("#foo"); //Prepend an object;
```
* @param {String|Object} Selector to prepent to
* @title $().prependTo(element)
*/
prependTo(target: any): appFrameworkCollection;
/**
* Prepends to the elements
* This simply calls append and sets insert to true
```
$().prepend("<div></div>");//Creates the object from the string and appends it
$().prepend($("#foo")); //Prepends an object
```
* @param {String|Object} Element/string to add
* @return {Object} appframework object
* @title $().prepend(element)
*/
prepend(content: any): appFrameworkCollection;
/**
* Inserts collection before the target (adjacent)
```
$().insertBefore(af("#target"));
```
* @param {String|Object} Target
* @title $().insertBefore(target);
*/
insertBefore(target: any): appFrameworkCollection;
/**
* Inserts collection after the target (adjacent)
```
$().insertAfter(af("#target"));
```
* @param {String|Object} target
* @title $().insertAfter(target);
*/
insertAfter(target: any): void;
/**
* Returns the raw DOM element.
```
$().get(0); //returns the first element
$().get(2);// returns the third element
```
* @param {Int} [index]
* @return {Object} raw DOM element
* @title $().get([index])
*/
get(): HTMLElement[];
get(index: number): HTMLElement;
/**
* Returns the offset of the element, including traversing up the tree
```
$().offset();
```
* @return {Object} with left, top, width and height properties
* @title $().offset()
*/
offset(): {
left: number;
top: number;
right: number;
bottom: number;
width: number;
height: number;
};
/**
* returns the height of the element, including padding on IE
```
$().height();
```
* @return {string} height
* @title $().height()
*/
height(): string;
/**
* returns the width of the element, including padding on IE
```
$().width();
```
* @return {string} width
* @title $().width()
*/
width(): string;
/**
* Returns the parent nodes of the elements based off the selector
```
$("#foo").parent('.bar');
$("#foo").parent($('.bar'));
$("#foo").parent($('.bar').get(0));
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique parents
* @title $().parent(selector)
*/
parent(selector?: any): appFrameworkCollection;
/**
* Returns the parents of the elements based off the selector (traversing up until html document)
```
$("#foo").parents('.bar');
$("#foo").parents($('.bar'));
$("#foo").parents($('.bar').get(0));
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique parents
* @title $().parents(selector)
*/
parents(selector?: any): appFrameworkCollection;
/**
* Returns the child nodes of the elements based off the selector
```
$("#foo").children('.bar'); //Selector
$("#foo").children($('.bar')); //Objects
$("#foo").children($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique children
* @title $().children(selector)
*/
children(selector?: any): appFrameworkCollection;
/**
* Returns the siblings of the element based off the selector
```
$("#foo").siblings('.bar'); //Selector
$("#foo").siblings($('.bar')); //Objects
$("#foo").siblings($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique siblings
* @title $().siblings(selector)
*/
siblings(selector?: any): appFrameworkCollection;
/**
* Returns the closest element based off the selector and optional context
```
$("#foo").closest('.bar'); //Selector
$("#foo").closest($('.bar')); //Objects
$("#foo").closest($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} selector
* @param {Object} [context]
* @return {Object} Returns an appframework object with the closest element based off the selector
* @title $().closest(selector,[context]);
*/
closest(selector?: any): appFrameworkCollection;
/**
* Filters elements based off the selector
```
$("#foo").filter('.bar'); //Selector
$("#foo").filter($('.bar')); //Objects
$("#foo").filter($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} selector
* @return {Object} Returns an appframework object after the filter was run
* @title $().filter(selector);
*/
filter(selector?: any): appFrameworkCollection;
/**
* Basically the reverse of filter. Return all elements that do NOT match the selector
```
$("#foo").not('.bar'); //Selector
$("#foo").not($('.bar')); //Objects
$("#foo").not($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} selector
* @return {Object} Returns an appframework object after the filter was run
* @title $().not(selector);
*/
not(selector?: any): appFrameworkCollection;
/**
* Gets or set data-* attribute parameters on elements (when a string)
* When used as a getter, it's only the first element
```
$().data("foo"); //Gets the data-foo attribute for the first element
$().data("foo","bar"); //Sets the data-foo attribute for all elements
$().data("foo",{bar:'bar'});//object as the data
```
* @param {String} key
* @param {String|Array|Object} value
* @return {String|Object} returns the value or appframework object
* @title $().data(key,[value]);
*/
data(attribute: string): any;
data(attribute: string, value: string): appFrameworkCollection;
data(attribute: string, value: any): appFrameworkCollection;
/**
* Rolls back the appframework elements when filters were applied
* This can be used after .not(), .filter(), .children(), .parent()
```
$().filter(".panel").end(); //This will return the collection BEFORE filter is applied
```
* @return {Object} returns the previous appframework object before filter was applied
* @title $().end();
*/
end(): appFrameworkCollection;
/**
* Clones the nodes in the collection.
```
$().clone();// Deep clone of all elements
$().clone(false); //Shallow clone
```
* @param {Boolean} [deep] - do a deep copy or not
* @return {Object} appframework object of cloned nodes
* @title $().clone();
*/
clone(deep?: boolean): appFrameworkCollection;
/**
* Returns the number of elements in the collection
```
$().size();
```
* @return {Int}
* @title $().size();
*/
size(): number;
/**
* Serailizes a form into a query string
```
$().serialize();
```
* @return {String}
* @title $().serialize()
*/
serialize(): string;
/* added in 1.2 */
/**
* Reduce the set of elements based off index
```
$().eq(index)
```
* @param {Int} index - Index to filter by. If negative, it will go back from the end
* @return {Object} appframework object
* @title $().eq(index)
*/
eq(index: number): appFrameworkCollection;
/**
* Returns the index of the selected element in the collection
```
$().index(elem)
```
* @param {String|Object} element to look for. Can be a selector or object
* @return integer - index of selected element
* @title $().index(elem)
*/
index(): number;
index(selector: any): number;
/**
* Returns boolean if the object is a type of the selector
```
$().is(selector)
```
* param {String|Object} selector to act upon
* @return boolean
* @title $().is(selector)
*/
is(selector: any): number;
/**
* Binds an event to each element in the collection and executes the callback
```
$().bind('click',function(){console.log('I clicked '+this.id);});
```
* @param {String|Object} event
* @param {Function} callback
* @return {Object} appframework object
* @title $().bind(event,callback)
*/
bind(eventHash: Object): appFrameworkCollection;
bind(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
/**
* Unbinds an event to each element in the collection. If a callback is passed in, we remove just that one, otherwise we remove all callbacks for those events
```
$().unbind('click'); //Unbinds all click events
$().unbind('click',myFunc); //Unbinds myFunc
```
* @param {String|Object} event
* @param {Function} [callback]
* @return {Object} appframework object
* @title $().unbind(event,[callback]);
*/
unbind(eventHash: {}): appFrameworkCollection;
unbind(eventName?: string): appFrameworkCollection;
unbind(eventName: string, fn?: (e: Event) => any): appFrameworkCollection;
/**
* Binds an event to each element in the collection that will only execute once. When it executes, we remove the event listener then right away so it no longer happens
```
$().one('click',function(){console.log('I was clicked once');});
```
* @param {String|Object} event
* @param {Function} [callback]
* @return appframework object
* @title $().one(event,callback);
*/
one(eventHash: {}): appFrameworkCollection;
one(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
/**
* Delegate an event based off the selector. The event will be registered at the parent level, but executes on the selector.
```
$("#div").delegate("p",'click',callback);
```
* @param {String|Array|Object} selector
* @param {String|Object} event
* @param {Function} callback
* @return {Object} appframework object
* @title $().delegate(selector,event,callback)
*/
delegate(selector: any, eventHash: {}): appFrameworkCollection;
delegate(selector: any, eventName: string, fn: (e: Event) => any): appFrameworkCollection;
/**
* Unbinds events that were registered through delegate. It acts upon the selector and event. If a callback is specified, it will remove that one, otherwise it removes all of them.
```
$("#div").undelegate("p",'click',callback);//Undelegates callback for the click event
$("#div").undelegate("p",'click');//Undelegates all click events
```
* @param {String|Array|Object} selector
* @param {String|Object} event
* @param {Function} callback
* @return {Object} appframework object
* @title $().undelegate(selector,event,[callback]);
*/
undelegate(selector: any, eventHash: {}): appFrameworkCollection;
undelegate(selector: any, eventName: string, fn: (e: Event) => any): appFrameworkCollection;
/**
* Similar to delegate, but the function parameter order is easier to understand.
* If selector is undefined or a function, we just call .bind, otherwise we use .delegate
```
$("#div").on("click","p",callback);
```
* @param {String|Array|Object} selector
* @param {String|Object} event
* @param {Function} callback
* @return {Object} appframework object
* @title $().on(event,selector,callback);
*/
on(eventHash: {}, selector?: any): appFrameworkCollection;
on(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
on(eventName: string, selector: string, fn: (e: Event) => any): appFrameworkCollection;
/**
* Removes event listeners for .on()
* If selector is undefined or a function, we call unbind, otherwise it's undelegate
```
$().off("click","p",callback); //Remove callback function for click events
$().off("click","p") //Remove all click events
```
* @param {String|Object} event
* @param {String|Array|Object} selector
* @param {Sunction} callback
* @return {Object} appframework object
* @title $().off(event,selector,[callback])
*/
off(eventHash: {}, selector?: any): appFrameworkCollection;
off(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
off(eventName: string, selector: string, fn: (e: Event) => any): appFrameworkCollection;
/**
This triggers an event to be dispatched. Usefull for emulating events, etc.
```
$().trigger("click",{foo:'bar'});//Trigger the click event and pass in data
```
* @param {String|Object} event
* @param {Object} [data]
* @return {Object} appframework object
* @title $().trigger(event,data);
*/
trigger(eventName: string, data?: any): appFrameworkCollection;
trigger(eventHash: {}, data?: any): appFrameworkCollection;
/**
custom events since people want to do $().click instead of $().bind("click")
*/
click(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().keydown instead of $().bind("keydown")
*/
keydown(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().keyup instead of $().bind("keyup")
*/
keyup(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().keypress instead of $().bind("keypress")
*/
keypress(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().submit instead of $().bind("submit")
*/
submit(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().load instead of $().bind("load")
*/
load(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().resize instead of $().bind("resize")
*/
resize(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().change instead of $().bind("change")
*/
change(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().select instead of $().bind("select")
*/
select(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().error instead of $().bind("error")
*/
error(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().focus instead of $().bind("focus")
*/
focus(fn?: (e: Event) => any): appFrameworkCollection;
/**
custom events since people want to do $().blur instead of $().bind("blur")
*/
blur(fn?: (e: Event) => any): appFrameworkCollection;
}
interface appFrameworkAjaxSettings {
type?: string;
beforeSend?: (xhr: XMLHttpRequest, settings: appFrameworkAjaxSettings) => boolean;
success?: (data: any, status: string, xhr: XMLHttpRequest) => void;
error?: (xhr: XMLHttpRequest, errorType: string, error: Error) => void;
complete?: (xhr: XMLHttpRequest, status: string) => void;
timeout?: number;
url?: string;
contentType?: string;
headers?: any;
dataType?: string;
data?: any;
context?: any;
crossDomain?: boolean;
}
interface appFrameworkCssMatrix {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
}
declare var af: (fn: ($: appFrameworkStatic) => void) => void;
declare var $: appFrameworkStatic;
| algorithme/DefinitelyTyped | appframework/appframework.d.ts | TypeScript | mit | 40,752 |
//! moment.js locale configuration
//! locale : Uzbek [uz]
//! author : Sardor Muminov : https://github.com/muminoff
import moment from '../moment';
export default moment.defineLocale('uz', {
months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'D MMMM YYYY, dddd HH:mm'
},
calendar : {
sameDay : '[Бугун соат] LT [да]',
nextDay : '[Эртага] LT [да]',
nextWeek : 'dddd [куни соат] LT [да]',
lastDay : '[Кеча соат] LT [да]',
lastWeek : '[Утган] dddd [куни соат] LT [да]',
sameElse : 'L'
},
relativeTime : {
future : 'Якин %s ичида',
past : 'Бир неча %s олдин',
s : 'фурсат',
m : 'бир дакика',
mm : '%d дакика',
h : 'бир соат',
hh : '%d соат',
d : 'бир кун',
dd : '%d кун',
M : 'бир ой',
MM : '%d ой',
y : 'бир йил',
yy : '%d йил'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 4th is the first week of the year.
}
});
| ballzy/prove-my-identity | node_modules/moment/src/locale/uz.js | JavaScript | mit | 1,873 |
exports.setUp = function(callback) {
callback();
}
exports.tearDown = function(callback) {
callback();
}
exports['Initialize a set of security credentials'] = function(test) {
var SecurityCredentials = require('../../lib/sspi.js').SecurityCredentials;
// Aquire some credentials
try {
var credentials = SecurityCredentials.aquire('Kerberos', 'dev1@10GEN.ME', 'a');
} catch(err) {
console.dir(err)
test.ok(false);
}
// console.dir(SecurityCredentials);
// var SecurityBufferDescriptor = require('../../lib/sspi.js').SecurityBufferDescriptor
// SecurityBuffer = require('../../lib/sspi.js').SecurityBuffer;
// // Create descriptor with single Buffer
// var securityDescriptor = new SecurityBufferDescriptor(100);
// try {
// // Fail to work due to no valid Security Buffer
// securityDescriptor = new SecurityBufferDescriptor(["hello"]);
// test.ok(false);
// } catch(err){}
// // Should Correctly construct SecurityBuffer
// var buffer = new SecurityBuffer(SecurityBuffer.DATA, 100);
// securityDescriptor = new SecurityBufferDescriptor([buffer]);
// // Should correctly return a buffer
// var result = securityDescriptor.toBuffer();
// test.equal(100, result.length);
// // Should Correctly construct SecurityBuffer
// var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world"));
// securityDescriptor = new SecurityBufferDescriptor([buffer]);
// var result = securityDescriptor.toBuffer();
// test.equal("hello world", result.toString());
// // Test passing in more than one Buffer
// var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world"));
// var buffer2 = new SecurityBuffer(SecurityBuffer.STREAM, new Buffer("adam and eve"));
// securityDescriptor = new SecurityBufferDescriptor([buffer, buffer2]);
// var result = securityDescriptor.toBuffer();
// test.equal("hello worldadam and eve", result.toString());
test.done();
} | thm76/thm76.de | node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/test/win32/security_credentials_tests.js | JavaScript | mit | 1,979 |
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/nls/nl/colors",({aliceblue:"lichtblauw",antiquewhite:"antiekwit",aqua:"aqua",aquamarine:"aquamarijn",azure:"azuur",beige:"beige",bisque:"oranjegeel",black:"zwart",blanchedalmond:"amandel",blue:"blauw",blueviolet:"violet",brown:"bruin",burlywood:"lichtbruin",cadetblue:"donkerstaalblauw",chartreuse:"groengeel",chocolate:"chocoladebruin",coral:"koraalrood",cornflowerblue:"korenbloemblauw",cornsilk:"maïsgeel",crimson:"karmozijnrood",cyan:"cyaan",darkblue:"donkerblauw",darkcyan:"donkercyaan",darkgoldenrod:"donkergoud",darkgray:"donkergrijs",darkgreen:"donkergroen",darkgrey:"donkergrijs",darkkhaki:"donkerkaki",darkmagenta:"donkermagenta",darkolivegreen:"donkerolijfgroen",darkorange:"donkeroranje",darkorchid:"donkerorchidee",darkred:"donkerrood",darksalmon:"donkerzalm",darkseagreen:"donkerzeegroen",darkslateblue:"donkergrijsblauw",darkslategray:"donkerblauwgrijs",darkslategrey:"donkerblauwgrijs",darkturquoise:"donkerturquoise",darkviolet:"donkerviolet",deeppink:"donkerroze",deepskyblue:"diephemelblauw",dimgray:"dofgrijs",dimgrey:"dofgrijs",dodgerblue:"helderblauw",firebrick:"vuursteenrood",floralwhite:"rozewit",forestgreen:"bosgroen",fuchsia:"fuchsia",gainsboro:"lichtblauwgrijs",ghostwhite:"spierwit",gold:"goud",goldenrod:"goudbruin",gray:"grijs",green:"groen",greenyellow:"groengeel",grey:"grijs",honeydew:"meloen",hotpink:"acaciaroze",indianred:"indisch rood",indigo:"indigo",ivory:"ivoorwit",khaki:"kaki",lavender:"lavendelblauw",lavenderblush:"lavendelblos",lawngreen:"grasgroen",lemonchiffon:"citroengeel",lightblue:"lichtblauw",lightcoral:"lichtkoraal",lightcyan:"lichtcyaan",lightgoldenrodyellow:"lichtgoudgeel",lightgray:"lichtgrijs",lightgreen:"lichtgroen",lightgrey:"lichtgrijs",lightpink:"lichtroze",lightsalmon:"lichtzalm",lightseagreen:"lichtzeegroen",lightskyblue:"lichthemelsblauw",lightslategray:"lichtblauwgrijs",lightslategrey:"lichtblauwgrijs",lightsteelblue:"lichtstaalblauw",lightyellow:"lichtgeel",lime:"limoen",limegreen:"limoengroen",linen:"linnen",magenta:"magenta",maroon:"kastanjebruin",mediumaquamarine:"midaquamarijn",mediumblue:"midblauw",mediumorchid:"midorchidee",mediumpurple:"midpurper",mediumseagreen:"midzeegroen",mediumslateblue:"midgrijsblauw",mediumspringgreen:"midlentegroen",mediumturquoise:"midturquoise",mediumvioletred:"midvioletrood",midnightblue:"nachtblauw",mintcream:"mintroomgeel",mistyrose:"matroze",moccasin:"moccasin",navajowhite:"navajowit",navy:"marineblauw",oldlace:"kant",olive:"olijfgroen",olivedrab:"grijsbruin",orange:"oranje",orangered:"oranjerood",orchid:"orchidee",palegoldenrod:"bleekgeel",palegreen:"bleekgroen",paleturquoise:"bleekturquoise",palevioletred:"bleekvioletrood",papayawhip:"papajaroze",peachpuff:"perzikroze",peru:"bruin",pink:"roze",plum:"pruim",powderblue:"lichtblauw-wit",purple:"purper",red:"rood",rosybrown:"roodbruin",royalblue:"koningsblauw",saddlebrown:"leerbruin",salmon:"zalm",sandybrown:"zandbruin",seagreen:"zeegroen",seashell:"schelp",sienna:"sienna",silver:"zilvergrijs",skyblue:"hemelsblauw",slateblue:"leiblauw",slategray:"leigrijs",slategrey:"leigrijs",snow:"sneeuwwit",springgreen:"lentegroen",steelblue:"staalblauw",tan:"geelbruin",teal:"grijsblauw",thistle:"distel",tomato:"tomaat",transparent:"transparant",turquoise:"turquoise",violet:"violet",wheat:"tarwebruin",white:"wit",whitesmoke:"rookwit",yellow:"geel",yellowgreen:"geelgroen"}));
| steadiest/cdnjs | ajax/libs/dojo/1.9.6/nls/nl/colors.js | JavaScript | mit | 3,570 |
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/nls/ru/colors",({aliceblue:"серо-голубой",antiquewhite:"белый антик",aqua:"зеленовато-голубой",aquamarine:"аквамарин",azure:"лазурный",beige:"бежевый",bisque:"бисквитный",black:"черный",blanchedalmond:"светло-миндальный",blue:"синий",blueviolet:"сине-фиолетовый",brown:"коричневый",burlywood:"светло-коричневый",cadetblue:"серо-синий",chartreuse:"желто-салатный",chocolate:"шоколадный",coral:"коралловый",cornflowerblue:"фиолетово-синий",cornsilk:"шелковый оттенок",crimson:"малиновый",cyan:"циан",darkblue:"темно-синий",darkcyan:"темный циан",darkgoldenrod:"темно-золотистый",darkgray:"темно-серый",darkgreen:"темно-зеленый",darkgrey:"темно-серый",darkkhaki:"темный хаки",darkmagenta:"темно-пурпурный",darkolivegreen:"темно-оливковый",darkorange:"темно-оранжевый",darkorchid:"темный орсель",darkred:"темно-красный",darksalmon:"темно-лососевый",darkseagreen:"темный морской волны",darkslateblue:"темный грифельно-синий",darkslategray:"темный грифельно-серый",darkslategrey:"темный грифельно-серый",darkturquoise:"темный бирюзовый",darkviolet:"темно-фиолетовый",deeppink:"темно-розовый",deepskyblue:"темный небесно-голубой",dimgray:"тускло-серый",dimgrey:"тускло-серый",dodgerblue:"бледно-синий",firebrick:"кирпичный",floralwhite:"цветочно-белый",forestgreen:"зеленый лесной",fuchsia:"фуксин",gainsboro:"бледно-серый",ghostwhite:"призрачно-белый",gold:"золотой",goldenrod:"золотистый",gray:"серый",green:"зеленый",greenyellow:"зелено-желтый",grey:"серый",honeydew:"медовый",hotpink:"красно-розовый",indianred:"индийский красный",indigo:"индиго",ivory:"слоновой кости",khaki:"хаки",lavender:"бледно-лиловый",lavenderblush:"розовато-лиловый",lawngreen:"зеленая лужайка",lemonchiffon:"бледно-лимонный",lightblue:"светло-синий",lightcoral:"светло-коралловый",lightcyan:"светлый циан",lightgoldenrodyellow:"светло-золотистый",lightgray:"светло-серый",lightgreen:"светло-зеленый",lightgrey:"светло-серый",lightpink:"светло-розовый",lightsalmon:"светло-лососевый",lightseagreen:"светлый морской волны",lightskyblue:"светлый небесно-голубой",lightslategray:"светлый грифельно-серый",lightslategrey:"светлый грифельно-серый",lightsteelblue:"светлый стальной",lightyellow:"светло-желтый",lime:"лайм",limegreen:"зеленый лайм",linen:"хлопковый",magenta:"пурпурный",maroon:"темно-бордовый",mediumaquamarine:"нейтральный аквамарин",mediumblue:"нейтральный синий",mediumorchid:"нейтральный орсель",mediumpurple:"нейтральный фиолетовый",mediumseagreen:"нейтральный морской волны",mediumslateblue:"нейтральный грифельно-синий",mediumspringgreen:"нейтральный весенне-зеленый",mediumturquoise:"нейтральный бирюзовый",mediumvioletred:"нейтральный фиолетово-красный",midnightblue:"полуночно-синий",mintcream:"мятно-кремовый",mistyrose:"блекло-розовый",moccasin:"мокасин",navajowhite:"белый навахо",navy:"темно-синий",oldlace:"матово-белый",olive:"оливковый",olivedrab:"желтовато-серый",orange:"оранжевый",orangered:"оранжево-красный",orchid:"орсель",palegoldenrod:"бледно-золотистый",palegreen:"бледно-зеленый",paleturquoise:"бледно-бирюзовый",palevioletred:"бледный фиолетово-красный",papayawhip:"черенок папайи",peachpuff:"персиковый",peru:"перу",pink:"розовый",plum:"сливовый",powderblue:"пороховой",purple:"фиолетовый",red:"красный",rosybrown:"розово-коричневый",royalblue:"королевский голубой",saddlebrown:"кожано-коричневый",salmon:"лососевый",sandybrown:"коричнево-песчаный",seagreen:"морской волны",seashell:"морская раковина",sienna:"охра",silver:"серебристый",skyblue:"небесно-голубой",slateblue:"грифельно-синий",slategray:"грифельно-серый",slategrey:"грифельно-серый",snow:"белоснежный",springgreen:"весенний зеленый",steelblue:"стальной",tan:"рыжевато-коричневый",teal:"чирок",thistle:"чертополох",tomato:"помидор",transparent:"прозрачный",turquoise:"бирюзовый",violet:"фиолетовый",wheat:"пшеница",white:"белый",whitesmoke:"дымчато-белый",yellow:"желтый",yellowgreen:"желто-зеленый"}));
| lucasls/cdnjs | ajax/libs/dojo/1.10.1/nls/ru/colors.js | JavaScript | mit | 5,929 |
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/nls/ar/colors",({aliceblue:"أزرق فاتح",antiquewhite:"أبيض عتيق",aqua:"أزرق مائي",aquamarine:"أزرق مائل للأخضر (زبرجد)",azure:"أزرق سماوي",beige:"بيج",bisque:"أصفر برتقالي الى رمادي مصفر",black:"أسود",blanchedalmond:"أخضر مائل للبياض",blue:"أزرق",blueviolet:"أزرق-بنفسجي",brown:"بني",burlywood:"خشبي",cadetblue:"أزرق ملون بالرمادي",chartreuse:"أخضر مائل للصفرة",chocolate:"بني غامق",coral:"مرجاني",cornflowerblue:"أزرق عنبري",cornsilk:"حريري",crimson:"قرمزي",cyan:"أزرق سماوي",darkblue:"أزرق داكن",darkcyan:"أزرق سماوي داكن",darkgoldenrod:"أصفر ذهبي داكن",darkgray:"رمادي داكن",darkgreen:"أخضر داكن",darkgrey:"رمادي داكن",darkkhaki:"كاكي داكن",darkmagenta:"قرمزي داكن",darkolivegreen:"أخضر زيتوني داكن",darkorange:"برتقالي داكن",darkorchid:"أرجواني داكن",darkred:"أحمر داكن",darksalmon:"فضي داكن",darkseagreen:"أخضر مائل للأزرق داكن",darkslateblue:"أزرق اردوازي داكن",darkslategray:"رمادي اردوازي داكن",darkslategrey:"رمادي اردوازي داكن",darkturquoise:"تركواز داكن",darkviolet:"بنفسجي داكن",deeppink:"أحمر وردي غامق",deepskyblue:"أزرق سماوي غامق",dimgray:"رمادي شاحب",dimgrey:"رمادي شاحب",dodgerblue:"أزرق عنبري",firebrick:"أصفر زاهي",floralwhite:"أبيض زهري",forestgreen:"أخضر بلون أشجار الغابات",fuchsia:"فوشيا",gainsboro:"رمادي مائل للأزرق فاتح",ghostwhite:"أبيض شفاف",gold:"ذهبي",goldenrod:"أصفر ذهبي",gray:"رمادي",green:"أخضر",greenyellow:"أخضر مائل للأصفر",grey:"رمادي",honeydew:"أبيض مائل للأخضر",hotpink:"أحمر وردي زاهي",indianred:"أحمر هندي",indigo:"نيلي",ivory:"عاجي",khaki:"كاكي",lavender:"أرجواني شاحب",lavenderblush:"أحمر أرجواني",lawngreen:"أخضر بلون العشب",lemonchiffon:"أصفر شفاف",lightblue:"أزرق فاتح",lightcoral:"مرجاني فاتح",lightcyan:"سماوي فاتح",lightgoldenrodyellow:"أصفر ذهبي فاتح",lightgray:"رمادي فاتح",lightgreen:"أخضر فاتح",lightgrey:"رمادي فاتح",lightpink:"وردي فاتح",lightsalmon:"فضي فاتح",lightseagreen:"أخضر مائل للأزرق فاتح",lightskyblue:"أزرق سماوي فاتح",lightslategray:"رمادي اردوازي فاتح",lightslategrey:"رمادي اردوازي فاتح",lightsteelblue:"أزرق معدني فاتح",lightyellow:"أصفر فاتح",lime:"ليموني",limegreen:"أخضر ليموني",linen:"كتاني",magenta:"أحمر قرمزي",maroon:"أحمر داكن",mediumaquamarine:"أزرق مائل للأخضر (زبرجد) متوسط",mediumblue:"أزرق متوسط",mediumorchid:"أرجواني متوسط",mediumpurple:"قرمزي متوسط",mediumseagreen:"أخضر مائل للأزرق متوسط",mediumslateblue:"أزرق اردوازي متوسط",mediumspringgreen:"أخضر ربيعي متوسط",mediumturquoise:"تركواز متوسط",mediumvioletred:"أحمر-بنفسجي متوسط",midnightblue:"أزرق بحري",mintcream:"أصفر شاحب مائل للأخضر الزرعي",mistyrose:"وردي",moccasin:"نحاسي أحمر",navajowhite:"أبيض ملاحي",navy:"أزرق داكن",oldlace:"برتقالي مائل للأصفر شاحب",olive:"أخضر زيتوني داكن",olivedrab:"أسود فاتح",orange:"برتقالي",orangered:"أحمر مائل للبرتقالي",orchid:"أرجواني فاتح",palegoldenrod:"أصفر ذهبي شاحب",palegreen:"أخضر شاحب",paleturquoise:"تركواز شاحب",palevioletred:"أحمر-بنفسجي شاحب",papayawhip:"خوخي فاتح",peachpuff:"خوخي مائل للأصفر",peru:"بني جملي",pink:"وردي",plum:"أرجواني داكن",powderblue:"أزرق مائل للأصفر",purple:"ارجواني",red:"أحمر",rosybrown:"بني وردي",royalblue:"أزرق ملكي",saddlebrown:"بني فاتح",salmon:"برتقالي وردي شاحب",sandybrown:"بني مائل للصفرة",seagreen:"أخضر مائل للأزرق",seashell:"أبيض مائل للأصفر فاتح",sienna:"بني محروق",silver:"فضي",skyblue:"أزرق سماوي",slateblue:"أزرق اردوازي",slategray:"رمادي اردوازي",slategrey:"رمادي اردوازي",snow:"أبيض ثلجي",springgreen:"أخضر ربيعي",steelblue:"أزرق معدني",tan:"خمري",teal:"بترولي",thistle:"ارجواني شاحب",tomato:"أحمر مائل للأصفر",transparent:"شفاف",turquoise:"تركواز",violet:"بنفسجي",wheat:"أخضر قمحي",white:"أبيض",whitesmoke:"دخان أبيض",yellow:"أصفر",yellowgreen:"أخضر مائل للأصفر"}));
| MisatoTremor/cdnjs | ajax/libs/dojo/1.9.4/nls/ar/colors.js | JavaScript | mit | 5,304 |
#!/usr/bin/env node
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var util = require('./source-map/util');
function run(tests) {
var total = 0;
var passed = 0;
for (var i = 0; i < tests.length; i++) {
for (var k in tests[i].testCase) {
if (/^test/.test(k)) {
total++;
try {
tests[i].testCase[k](assert, util);
passed++;
}
catch (e) {
console.log('FAILED ' + tests[i].name + ': ' + k + '!');
console.log(e.stack);
}
}
}
}
console.log('');
console.log(passed + ' / ' + total + ' tests passed.');
console.log('');
return total - passed;
}
function isTestFile(f) {
var testToRun = process.argv[2];
return testToRun
? path.basename(testToRun) === f
: /^test\-.*?\.js/.test(f);
}
function toModule(f) {
return './source-map/' + f.replace(/\.js$/, '');
}
var requires = fs.readdirSync(path.join(__dirname, 'source-map'))
.filter(isTestFile)
.map(toModule);
var code = run(requires.map(require).map(function (mod, i) {
return {
name: requires[i],
testCase: mod
};
}));
process.exit(code);
| danascheider/barista | node_modules/reactify/node_modules/react-tools/node_modules/commoner/node_modules/recast/node_modules/source-map/test/run-tests.js | JavaScript | mit | 1,381 |
#!/usr/bin/env node
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var util = require('./source-map/util');
function run(tests) {
var total = 0;
var passed = 0;
for (var i = 0; i < tests.length; i++) {
for (var k in tests[i].testCase) {
if (/^test/.test(k)) {
total++;
try {
tests[i].testCase[k](assert, util);
passed++;
}
catch (e) {
console.log('FAILED ' + tests[i].name + ': ' + k + '!');
console.log(e.stack);
}
}
}
}
console.log('');
console.log(passed + ' / ' + total + ' tests passed.');
console.log('');
return total - passed;
}
function isTestFile(f) {
var testToRun = process.argv[2];
return testToRun
? path.basename(testToRun) === f
: /^test\-.*?\.js/.test(f);
}
function toModule(f) {
return './source-map/' + f.replace(/\.js$/, '');
}
var requires = fs.readdirSync(path.join(__dirname, 'source-map'))
.filter(isTestFile)
.map(toModule);
var code = run(requires.map(require).map(function (mod, i) {
return {
name: requires[i],
testCase: mod
};
}));
process.exit(code);
| CrouseMatthew/selfibingo | node_modules/karma/node_modules/source-map/test/run-tests.js | JavaScript | mit | 1,381 |
/*! UIkit 2.20.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Component: Base
========================================================================== */
/*
* 1. Normalizes default `font-family` and sets `font-size` here to support `rem` units
* 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
* 3. Style
*/
html {
/* 1 */
font: normal 14px / 20px "Helvetica Neue", Helvetica, Arial, sans-serif;
/* 2 */
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
/* 3 */
background: #ffffff;
color: #444444;
}
/*
* Removes default margin.
*/
body {
margin: 0;
}
/* Links
========================================================================== */
/*
* Remove the gray background color from active links in IE 10.
*/
a {
background: transparent;
}
/*
* Improves readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/*
* Style
*/
a,
.uk-link {
color: #0077dd;
text-decoration: none;
cursor: pointer;
}
a:hover,
.uk-link:hover {
color: #005599;
text-decoration: underline;
}
/* Text-level semantics
========================================================================== */
/*
* Addresses styling not present in Chrome, Safari, Opera and IE 8/9/10.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/*
* Addresses style set to `bolder` in Firefox
*/
b,
strong {
font-weight: bold;
}
/*
* 1. Address odd `em`-unit font size rendering in all browsers.
* 2. Consolas has a better baseline in running text compared to `Courier`
*/
:not(pre) > code,
:not(pre) > kbd,
:not(pre) > samp {
/* 1 */
font-size: 12px;
/* 2 */
font-family: Consolas, monospace, serif;
/* 3 */
color: #dd0055;
white-space: nowrap;
}
/*
* Emphasize
*/
em {
color: #dd0055;
}
/*
* Insert
*/
ins {
background: #ffffaa;
color: #444444;
text-decoration: none;
}
/*
* Mark
* Note: Addresses styling not present in IE 8/9.
*/
mark {
background: #ffffaa;
color: #444444;
}
/*
* Quote
*/
q {
font-style: italic;
}
/*
* Addresses inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/*
* Prevents `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Images
========================================================================== */
/*
* 1. Responsiveness: Sets a maximum width relative to the parent and auto scales the height
* 2. Corrects `max-width` behavior if padding and border are used
* 3. Remove border when inside `a` element in IE 8/9/10.
* 4. Remove the gap between images and the bottom of their containers
*/
img {
/* 1 */
max-width: 100%;
height: auto;
/* 2 */
-moz-box-sizing: border-box;
box-sizing: border-box;
/* 3 */
border: 0;
/* 4 */
vertical-align: middle;
}
/*
* Preserve original image dimensions
*/
.uk-img-preserve,
.uk-img-preserve img {
max-width: none;
}
/*
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Block elements
========================================================================== */
/*
* Reset margin
*/
blockquote,
figure {
margin: 0;
}
/*
* Margins
*/
p,
ul,
ol,
dl,
blockquote,
pre,
address,
fieldset,
figure {
margin: 0 0 15px 0;
}
* + p,
* + ul,
* + ol,
* + dl,
* + blockquote,
* + pre,
* + address,
* + fieldset,
* + figure {
margin-top: 15px;
}
/* Headings
========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 15px 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: normal;
color: #444444;
text-transform: none;
}
/*
* Margins
*/
* + h1,
* + h2,
* + h3,
* + h4,
* + h5,
* + h6 {
margin-top: 25px;
}
/*
* Sizes
*/
h1,
.uk-h1 {
font-size: 36px;
line-height: 42px;
}
h2,
.uk-h2 {
font-size: 24px;
line-height: 30px;
}
h3,
.uk-h3 {
font-size: 18px;
line-height: 24px;
}
h4,
.uk-h4 {
font-size: 16px;
line-height: 22px;
}
h5,
.uk-h5 {
font-size: 14px;
line-height: 20px;
}
h6,
.uk-h6 {
font-size: 12px;
line-height: 18px;
}
/* Lists
========================================================================== */
ul,
ol {
padding-left: 30px;
}
/*
* Reset margin for nested lists
*/
ul > li > ul,
ul > li > ol,
ol > li > ol,
ol > li > ul {
margin: 0;
}
/* Description lists
========================================================================== */
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
/* Horizontal rules
========================================================================== */
/*
* 1. Address differences between Firefox and other browsers.
* 2. Style
*/
hr {
/* 1 */
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
/* 2 */
margin: 15px 0;
border: 0;
border-top: 1px solid #dddddd;
}
/* Address
========================================================================== */
address {
font-style: normal;
}
/* Blockquotes
========================================================================== */
blockquote {
padding-left: 15px;
border-left: 5px solid #dddddd;
font-size: 16px;
line-height: 22px;
font-style: italic;
}
/* Preformatted text
========================================================================== */
/*
* 1. Contain overflow in all browsers.
*/
pre {
padding: 10px;
background: #f5f5f5;
font: 12px / 18px Consolas, monospace, serif;
color: #444444;
-moz-tab-size: 4;
tab-size: 4;
/* 1 */
overflow: auto;
}
/* Selection pseudo-element
========================================================================== */
::-moz-selection {
background: #3399ff;
color: #ffffff;
text-shadow: none;
}
::selection {
background: #3399ff;
color: #ffffff;
text-shadow: none;
}
/* HTML5 elements
========================================================================== */
/*
* Corrects `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
nav,
section,
summary {
display: block;
}
/*
* Addresses inconsistent vertical alignment of `progress` in Chrome, Firefox and Opera.
*/
progress {
vertical-align: baseline;
}
/*
* Prevent displaying `audio` without controls in Chrome, Safari and Opera
*/
audio:not([controls]) {
display: none;
}
/*
* Address `[hidden]` styling not present in IE 8/9.
* Hide the `template` element in IE and Safari
*/
[hidden],
template {
display: none;
}
/* Iframe
========================================================================== */
iframe {
border: 0;
}
/* Fix viewport for IE10 snap mode
========================================================================== */
@media screen and (max-width: 400px) {
@-ms-viewport {
width: device-width;
}
}
/* ========================================================================
Component: Grid
========================================================================== */
/*
* 1. Makes grid more robust so that it can be used with other block elements like lists
*/
.uk-grid {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
/* 1 */
margin: 0;
padding: 0;
list-style: none;
}
/*
* DEPRECATED
* Micro clearfix
* Can't use `table` because it creates a 1px gap when it becomes a flex item, only in Webkit
*/
.uk-grid:before,
.uk-grid:after {
content: "";
display: block;
overflow: hidden;
}
.uk-grid:after {
clear: both;
}
/*
* Grid cell
* 1. Space is allocated solely based on content dimensions
* 2. Makes grid more robust so that it can be used with other block elements
* 3. DEPRECATED Using `float` to support IE9
*/
.uk-grid > * {
/* 1 */
-ms-flex: none;
-webkit-flex: none;
flex: none;
/* 2 */
margin: 0;
/* 3 */
float: left;
}
/*
* Remove margin from the last-child
*/
.uk-grid > * > :last-child {
margin-bottom: 0;
}
/* Grid gutter
========================================================================== */
/*
* Default gutter
*/
/* Horizontal */
.uk-grid {
margin-left: -25px;
}
.uk-grid > * {
padding-left: 25px;
}
/* Vertical */
.uk-grid + .uk-grid,
.uk-grid-margin,
.uk-grid > * > .uk-panel + .uk-panel {
margin-top: 25px;
}
/* Large screen and bigger */
@media (min-width: 1220px) {
/* Horizontal */
.uk-grid {
margin-left: -35px;
}
.uk-grid > * {
padding-left: 35px;
}
/* Vertical */
.uk-grid + .uk-grid,
.uk-grid-margin,
.uk-grid > * > .uk-panel + .uk-panel {
margin-top: 35px;
}
}
/*
* Collapse gutter
*/
/* Horizontal */
.uk-grid-collapse {
margin-left: 0;
}
.uk-grid-collapse > * {
padding-left: 0;
}
/* Vertical */
.uk-grid-collapse + .uk-grid-collapse,
.uk-grid-collapse > .uk-grid-margin,
.uk-grid-collapse > * > .uk-panel + .uk-panel {
margin-top: 0;
}
/*
* Small gutter
*/
/* Horizontal */
.uk-grid-small {
margin-left: -10px;
}
.uk-grid-small > * {
padding-left: 10px;
}
/* Vertical */
.uk-grid-small + .uk-grid-small,
.uk-grid-small > .uk-grid-margin,
.uk-grid-small > * > .uk-panel + .uk-panel {
margin-top: 10px;
}
/*
* Medium gutter
*/
/* Horizontal */
.uk-grid-medium {
margin-left: -25px;
}
.uk-grid-medium > * {
padding-left: 25px;
}
/* Vertical */
.uk-grid-medium + .uk-grid-medium,
.uk-grid-medium > .uk-grid-margin,
.uk-grid-medium > * > .uk-panel + .uk-panel {
margin-top: 25px;
}
/* Modifier: `uk-grid-divider`
========================================================================== */
/*
* Horizontal divider
* Only works with the default gutter. Does not work with gutter collapse, small or large.
* Does not work with `uk-push-*`, `uk-pull-*` and not if the columns float into the next row.
*/
.uk-grid-divider:not(:empty) {
margin-left: -25px;
margin-right: -25px;
}
.uk-grid-divider > * {
padding-left: 25px;
padding-right: 25px;
}
.uk-grid-divider > [class*='uk-width-1-']:not(.uk-width-1-1):nth-child(n+2),
.uk-grid-divider > [class*='uk-width-2-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-3-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-4-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-5-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-6-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-7-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-8-']:nth-child(n+2),
.uk-grid-divider > [class*='uk-width-9-']:nth-child(n+2) {
border-left: 1px solid #dddddd;
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-grid-divider > [class*='uk-width-medium-']:not(.uk-width-medium-1-1):nth-child(n+2) {
border-left: 1px solid #dddddd;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-grid-divider > [class*='uk-width-large-']:not(.uk-width-large-1-1):nth-child(n+2) {
border-left: 1px solid #dddddd;
}
}
/* Large screen and bigger */
@media (min-width: 1220px) {
/*
* Large gutter
*/
.uk-grid-divider:not(:empty) {
margin-left: -35px;
margin-right: -35px;
}
.uk-grid-divider > * {
padding-left: 35px;
padding-right: 35px;
}
.uk-grid-divider:empty {
margin-top: 35px;
margin-bottom: 35px;
}
}
/*
* Vertical divider
*/
.uk-grid-divider:empty {
margin-top: 25px;
margin-bottom: 25px;
border-top: 1px solid #dddddd;
}
/* Match panels in grids
========================================================================== */
.uk-grid-match > * {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
/*
* 1. Behave like a block element
*/
.uk-grid-match > * > * {
-ms-flex: none;
-webkit-flex: none;
flex: none;
/* 1 */
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
}
/* Even grid cell widths
========================================================================== */
[class*='uk-grid-width'] > * {
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
}
.uk-grid-width-1-2 > * {
width: 50%;
}
.uk-grid-width-1-3 > * {
width: 33.333%;
}
.uk-grid-width-1-4 > * {
width: 25%;
}
.uk-grid-width-1-5 > * {
width: 20%;
}
.uk-grid-width-1-6 > * {
width: 16.666%;
}
.uk-grid-width-1-10 > * {
width: 10%;
}
/* Phone landscape and bigger */
@media (min-width: 480px) {
.uk-grid-width-small-1-2 > * {
width: 50%;
}
.uk-grid-width-small-1-3 > * {
width: 33.333%;
}
.uk-grid-width-small-1-4 > * {
width: 25%;
}
.uk-grid-width-small-1-5 > * {
width: 20%;
}
.uk-grid-width-small-1-6 > * {
width: 16.666%;
}
.uk-grid-width-small-1-10 > * {
width: 10%;
}
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-grid-width-medium-1-2 > * {
width: 50%;
}
.uk-grid-width-medium-1-3 > * {
width: 33.333%;
}
.uk-grid-width-medium-1-4 > * {
width: 25%;
}
.uk-grid-width-medium-1-5 > * {
width: 20%;
}
.uk-grid-width-medium-1-6 > * {
width: 16.666%;
}
.uk-grid-width-medium-1-10 > * {
width: 10%;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-grid-width-large-1-2 > * {
width: 50%;
}
.uk-grid-width-large-1-3 > * {
width: 33.333%;
}
.uk-grid-width-large-1-4 > * {
width: 25%;
}
.uk-grid-width-large-1-5 > * {
width: 20%;
}
.uk-grid-width-large-1-6 > * {
width: 16.666%;
}
.uk-grid-width-large-1-10 > * {
width: 10%;
}
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-grid-width-xlarge-1-2 > * {
width: 50%;
}
.uk-grid-width-xlarge-1-3 > * {
width: 33.333%;
}
.uk-grid-width-xlarge-1-4 > * {
width: 25%;
}
.uk-grid-width-xlarge-1-5 > * {
width: 20%;
}
.uk-grid-width-xlarge-1-6 > * {
width: 16.666%;
}
.uk-grid-width-xlarge-1-10 > * {
width: 10%;
}
}
/* Sub-objects: `uk-width-*`
========================================================================== */
[class*='uk-width'] {
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
}
/*
* Widths
*/
/* Whole */
.uk-width-1-1 {
width: 100%;
}
/* Halves */
.uk-width-1-2,
.uk-width-2-4,
.uk-width-3-6,
.uk-width-5-10 {
width: 50%;
}
/* Thirds */
.uk-width-1-3,
.uk-width-2-6 {
width: 33.333%;
}
.uk-width-2-3,
.uk-width-4-6 {
width: 66.666%;
}
/* Quarters */
.uk-width-1-4 {
width: 25%;
}
.uk-width-3-4 {
width: 75%;
}
/* Fifths */
.uk-width-1-5,
.uk-width-2-10 {
width: 20%;
}
.uk-width-2-5,
.uk-width-4-10 {
width: 40%;
}
.uk-width-3-5,
.uk-width-6-10 {
width: 60%;
}
.uk-width-4-5,
.uk-width-8-10 {
width: 80%;
}
/* Sixths */
.uk-width-1-6 {
width: 16.666%;
}
.uk-width-5-6 {
width: 83.333%;
}
/* Tenths */
.uk-width-1-10 {
width: 10%;
}
.uk-width-3-10 {
width: 30%;
}
.uk-width-7-10 {
width: 70%;
}
.uk-width-9-10 {
width: 90%;
}
/* Phone landscape and bigger */
@media (min-width: 480px) {
/* Whole */
.uk-width-small-1-1 {
width: 100%;
}
/* Halves */
.uk-width-small-1-2,
.uk-width-small-2-4,
.uk-width-small-3-6,
.uk-width-small-5-10 {
width: 50%;
}
/* Thirds */
.uk-width-small-1-3,
.uk-width-small-2-6 {
width: 33.333%;
}
.uk-width-small-2-3,
.uk-width-small-4-6 {
width: 66.666%;
}
/* Quarters */
.uk-width-small-1-4 {
width: 25%;
}
.uk-width-small-3-4 {
width: 75%;
}
/* Fifths */
.uk-width-small-1-5,
.uk-width-small-2-10 {
width: 20%;
}
.uk-width-small-2-5,
.uk-width-small-4-10 {
width: 40%;
}
.uk-width-small-3-5,
.uk-width-small-6-10 {
width: 60%;
}
.uk-width-small-4-5,
.uk-width-small-8-10 {
width: 80%;
}
/* Sixths */
.uk-width-small-1-6 {
width: 16.666%;
}
.uk-width-small-5-6 {
width: 83.333%;
}
/* Tenths */
.uk-width-small-1-10 {
width: 10%;
}
.uk-width-small-3-10 {
width: 30%;
}
.uk-width-small-7-10 {
width: 70%;
}
.uk-width-small-9-10 {
width: 90%;
}
}
/* Tablet and bigger */
@media (min-width: 768px) {
/* Whole */
.uk-width-medium-1-1 {
width: 100%;
}
/* Halves */
.uk-width-medium-1-2,
.uk-width-medium-2-4,
.uk-width-medium-3-6,
.uk-width-medium-5-10 {
width: 50%;
}
/* Thirds */
.uk-width-medium-1-3,
.uk-width-medium-2-6 {
width: 33.333%;
}
.uk-width-medium-2-3,
.uk-width-medium-4-6 {
width: 66.666%;
}
/* Quarters */
.uk-width-medium-1-4 {
width: 25%;
}
.uk-width-medium-3-4 {
width: 75%;
}
/* Fifths */
.uk-width-medium-1-5,
.uk-width-medium-2-10 {
width: 20%;
}
.uk-width-medium-2-5,
.uk-width-medium-4-10 {
width: 40%;
}
.uk-width-medium-3-5,
.uk-width-medium-6-10 {
width: 60%;
}
.uk-width-medium-4-5,
.uk-width-medium-8-10 {
width: 80%;
}
/* Sixths */
.uk-width-medium-1-6 {
width: 16.666%;
}
.uk-width-medium-5-6 {
width: 83.333%;
}
/* Tenths */
.uk-width-medium-1-10 {
width: 10%;
}
.uk-width-medium-3-10 {
width: 30%;
}
.uk-width-medium-7-10 {
width: 70%;
}
.uk-width-medium-9-10 {
width: 90%;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
/* Whole */
.uk-width-large-1-1 {
width: 100%;
}
/* Halves */
.uk-width-large-1-2,
.uk-width-large-2-4,
.uk-width-large-3-6,
.uk-width-large-5-10 {
width: 50%;
}
/* Thirds */
.uk-width-large-1-3,
.uk-width-large-2-6 {
width: 33.333%;
}
.uk-width-large-2-3,
.uk-width-large-4-6 {
width: 66.666%;
}
/* Quarters */
.uk-width-large-1-4 {
width: 25%;
}
.uk-width-large-3-4 {
width: 75%;
}
/* Fifths */
.uk-width-large-1-5,
.uk-width-large-2-10 {
width: 20%;
}
.uk-width-large-2-5,
.uk-width-large-4-10 {
width: 40%;
}
.uk-width-large-3-5,
.uk-width-large-6-10 {
width: 60%;
}
.uk-width-large-4-5,
.uk-width-large-8-10 {
width: 80%;
}
/* Sixths */
.uk-width-large-1-6 {
width: 16.666%;
}
.uk-width-large-5-6 {
width: 83.333%;
}
/* Tenths */
.uk-width-large-1-10 {
width: 10%;
}
.uk-width-large-3-10 {
width: 30%;
}
.uk-width-large-7-10 {
width: 70%;
}
.uk-width-large-9-10 {
width: 90%;
}
}
/* Sub-object: `uk-push-*` and `uk-pull-*`
========================================================================== */
/*
* Source ordering
* Works only with `uk-width-medium-*`
*/
/* Tablet and bigger */
@media (min-width: 768px) {
[class*='uk-push-'],
[class*='uk-pull-'] {
position: relative;
}
/*
* Push
*/
/* Halves */
.uk-push-1-2,
.uk-push-2-4,
.uk-push-3-6,
.uk-push-5-10 {
left: 50%;
}
/* Thirds */
.uk-push-1-3,
.uk-push-2-6 {
left: 33.333%;
}
.uk-push-2-3,
.uk-push-4-6 {
left: 66.666%;
}
/* Quarters */
.uk-push-1-4 {
left: 25%;
}
.uk-push-3-4 {
left: 75%;
}
/* Fifths */
.uk-push-1-5,
.uk-push-2-10 {
left: 20%;
}
.uk-push-2-5,
.uk-push-4-10 {
left: 40%;
}
.uk-push-3-5,
.uk-push-6-10 {
left: 60%;
}
.uk-push-4-5,
.uk-push-8-10 {
left: 80%;
}
/* Sixths */
.uk-push-1-6 {
left: 16.666%;
}
.uk-push-5-6 {
left: 83.333%;
}
/* Tenths */
.uk-push-1-10 {
left: 10%;
}
.uk-push-3-10 {
left: 30%;
}
.uk-push-7-10 {
left: 70%;
}
.uk-push-9-10 {
left: 90%;
}
/*
* Pull
*/
/* Halves */
.uk-pull-1-2,
.uk-pull-2-4,
.uk-pull-3-6,
.uk-pull-5-10 {
left: -50%;
}
/* Thirds */
.uk-pull-1-3,
.uk-pull-2-6 {
left: -33.333%;
}
.uk-pull-2-3,
.uk-pull-4-6 {
left: -66.666%;
}
/* Quarters */
.uk-pull-1-4 {
left: -25%;
}
.uk-pull-3-4 {
left: -75%;
}
/* Fifths */
.uk-pull-1-5,
.uk-pull-2-10 {
left: -20%;
}
.uk-pull-2-5,
.uk-pull-4-10 {
left: -40%;
}
.uk-pull-3-5,
.uk-pull-6-10 {
left: -60%;
}
.uk-pull-4-5,
.uk-pull-8-10 {
left: -80%;
}
/* Sixths */
.uk-pull-1-6 {
left: -16.666%;
}
.uk-pull-5-6 {
left: -83.333%;
}
/* Tenths */
.uk-pull-1-10 {
left: -10%;
}
.uk-pull-3-10 {
left: -30%;
}
.uk-pull-7-10 {
left: -70%;
}
.uk-pull-9-10 {
left: -90%;
}
}
/* ========================================================================
Component: Panel
========================================================================== */
/*
* 1. Needed for `a` elements
* 2. Create position context for badges
*/
.uk-panel {
/* 1 */
display: block;
/* 2 */
position: relative;
}
/*
* Allow panels to be anchors
*/
.uk-panel,
.uk-panel:hover {
text-decoration: none;
}
/*
* Micro clearfix to make panels more robust
*/
.uk-panel:before,
.uk-panel:after {
content: "";
display: table;
}
.uk-panel:after {
clear: both;
}
/*
* Remove margin from the last-child if not `uk-widget-title`
*/
.uk-panel > :not(.uk-panel-title):last-child {
margin-bottom: 0;
}
/* Sub-object: `uk-panel-title`
========================================================================== */
.uk-panel-title {
margin-top: 0;
margin-bottom: 15px;
font-size: 18px;
line-height: 24px;
font-weight: normal;
text-transform: none;
color: #444444;
}
/* Sub-object: `uk-panel-badge`
========================================================================== */
.uk-panel-badge {
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
/* Sub-object: `uk-panel-teaser`
========================================================================== */
.uk-panel-teaser {
margin-bottom: 15px;
}
/* Modifier: `uk-panel-box`
========================================================================== */
.uk-panel-box {
padding: 15px;
background: #f5f5f5;
color: #444444;
}
.uk-panel-box-hover:hover {
color: #444444;
}
.uk-panel-box .uk-panel-title {
color: #444444;
}
.uk-panel-box .uk-panel-badge {
top: 10px;
right: 10px;
}
.uk-panel-box .uk-panel-teaser {
margin-top: -15px;
margin-left: -15px;
margin-right: -15px;
}
/*
* Nav in panel
*/
.uk-panel-box > .uk-nav-side {
margin: 0 -15px;
}
/*
* Sub-modifier: `uk-panel-box-primary`
*/
.uk-panel-box-primary {
background-color: #ebf7fd;
color: #2d7091;
}
.uk-panel-box-primary-hover:hover {
color: #2d7091;
}
.uk-panel-box-primary .uk-panel-title {
color: #2d7091;
}
/*
* Sub-modifier: `uk-panel-box-secondary`
*/
.uk-panel-box-secondary {
background-color: #eeeeee;
color: #444444;
}
.uk-panel-box-secondary-hover:hover {
color: #444444;
}
.uk-panel-box-secondary .uk-panel-title {
color: #444444;
}
/* Modifier: `uk-panel-hover`
========================================================================== */
.uk-panel-hover {
padding: 15px;
color: #444444;
}
.uk-panel-hover:hover {
background: #f5f5f5;
color: #444444;
}
.uk-panel-hover .uk-panel-badge {
top: 10px;
right: 10px;
}
.uk-panel-hover .uk-panel-teaser {
margin-top: -15px;
margin-left: -15px;
margin-right: -15px;
}
/* Modifier: `uk-panel-header`
========================================================================== */
.uk-panel-header .uk-panel-title {
padding-bottom: 10px;
border-bottom: 1px solid #dddddd;
color: #444444;
}
/* Modifier: `uk-panel-space`
========================================================================== */
.uk-panel-space {
padding: 30px;
}
.uk-panel-space .uk-panel-badge {
top: 30px;
right: 30px;
}
/* Modifier: `uk-panel-divider`
========================================================================== */
.uk-panel + .uk-panel-divider {
margin-top: 50px !important;
}
.uk-panel + .uk-panel-divider:before {
content: "";
display: block;
position: absolute;
top: -25px;
left: 0;
right: 0;
border-top: 1px solid #dddddd;
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-panel + .uk-panel-divider {
margin-top: 70px !important;
}
.uk-panel + .uk-panel-divider:before {
top: -35px;
}
}
/* ========================================================================
Component: Block
========================================================================== */
.uk-block {
position: relative;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-top: 20px;
padding-bottom: 20px;
}
/* Phone landscape and bigger */
@media (min-width: 768px) {
.uk-block {
padding-top: 50px;
padding-bottom: 50px;
}
}
/*
* Micro clearfix to make blocks more robust
*/
.uk-block:before,
.uk-block:after {
content: "";
display: table;
}
.uk-block:after {
clear: both;
}
/*
* Remove margin from the last-child
*/
.uk-block > :last-child {
margin-bottom: 0;
}
/* Padding Modifier
========================================================================== */
/*
* Large padding
*/
.uk-block-large {
padding-top: 20px;
padding-bottom: 20px;
}
/* Tablets and bigger */
@media (min-width: 768px) {
.uk-block-large {
padding-top: 50px;
padding-bottom: 50px;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-block-large {
padding-top: 100px;
padding-bottom: 100px;
}
}
/* Color Modifier
========================================================================== */
/*
* Default
*/
.uk-block-default {
background: #ffffff;
}
/*
* Muted
*/
.uk-block-muted {
background: #f9f9f9;
}
/*
* Primary
*/
.uk-block-primary {
background: #00a8e6;
}
/*
* Secondary
*/
.uk-block-secondary {
background: #222222;
}
/*
* Adjust padding between equal colored blocks
*/
.uk-block-default + .uk-block-default,
.uk-block-muted + .uk-block-muted,
.uk-block-primary + .uk-block-primary,
.uk-block-secondary + .uk-block-secondary {
padding-top: 0;
}
/* ========================================================================
Component: Article
========================================================================== */
/*
* Micro clearfix to make articles more robust
*/
.uk-article:before,
.uk-article:after {
content: "";
display: table;
}
.uk-article:after {
clear: both;
}
/*
* Remove margin from the last-child
*/
.uk-article > :last-child {
margin-bottom: 0;
}
/*
* Vertical gutter for articles
*/
.uk-article + .uk-article {
margin-top: 25px;
}
/* Sub-object `uk-article-title`
========================================================================== */
.uk-article-title {
font-size: 36px;
line-height: 42px;
font-weight: normal;
text-transform: none;
}
.uk-article-title a {
color: inherit;
text-decoration: none;
}
/* Sub-object `uk-article-meta`
========================================================================== */
.uk-article-meta {
font-size: 12px;
line-height: 18px;
color: #999999;
}
/* Sub-object `uk-article-lead`
========================================================================== */
.uk-article-lead {
color: #444444;
font-size: 18px;
line-height: 24px;
font-weight: normal;
}
/* Sub-object `uk-article-divider`
========================================================================== */
.uk-article-divider {
margin-bottom: 25px;
border-color: #dddddd;
}
* + .uk-article-divider {
margin-top: 25px;
}
/* ========================================================================
Component: Comment
========================================================================== */
/* Sub-object `uk-comment-header`
========================================================================== */
.uk-comment-header {
margin-bottom: 15px;
}
/*
* Micro clearfix
*/
.uk-comment-header:before,
.uk-comment-header:after {
content: "";
display: table;
}
.uk-comment-header:after {
clear: both;
}
/* Sub-object `uk-comment-avatar`
========================================================================== */
.uk-comment-avatar {
margin-right: 15px;
float: left;
}
/* Sub-object `uk-comment-title`
========================================================================== */
.uk-comment-title {
margin: 5px 0 0 0;
font-size: 16px;
line-height: 22px;
}
/* Sub-object `uk-comment-meta`
========================================================================== */
.uk-comment-meta {
margin: 2px 0 0 0;
font-size: 11px;
line-height: 16px;
color: #999999;
}
/* Sub-object `uk-comment-body`
========================================================================== */
/*
* Remove margin from the last-child
*/
.uk-comment-body > :last-child {
margin-bottom: 0;
}
/* Sub-object `uk-comment-list`
========================================================================== */
.uk-comment-list {
padding: 0;
list-style: none;
}
.uk-comment-list .uk-comment + ul {
margin: 15px 0 0 0;
list-style: none;
}
.uk-comment-list > li:nth-child(n+2),
.uk-comment-list .uk-comment + ul > li:nth-child(n+2) {
margin-top: 15px;
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-comment-list .uk-comment + ul {
padding-left: 100px;
}
}
/* Modifier `uk-comment-primary`
========================================================================== */
/* ========================================================================
Component: Cover
========================================================================== */
/*
* Background image always covers and centers its element
*/
.uk-cover-background {
background-position: 50% 50%;
background-size: cover;
background-repeat: no-repeat;
}
/*
* Emulates image cover, works with video and image elements
* 1. Parent container which clips resized object
* 2. Resizes the object to always covers its container
* 3. Reset the responsive image CSS
* 4. Center object
*/
/* 1 */
.uk-cover {
overflow: hidden;
}
.uk-cover-object {
/* 2 */
width: auto;
height: auto;
min-width: 100%;
min-height: 100%;
/* 3 */
max-width: none;
/* 4 */
position: relative;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
/*
* To center iframes use `data-uk-cover` JavaScript
*/
[data-uk-cover] {
position: relative;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
/* ========================================================================
Component: Nav
========================================================================== */
.uk-nav,
.uk-nav ul {
margin: 0;
padding: 0;
list-style: none;
}
/*
* Items
*/
.uk-nav li > a {
display: block;
text-decoration: none;
}
.uk-nav > li > a {
padding: 5px 15px;
}
/*
* Nested items
*/
.uk-nav ul {
padding-left: 15px;
}
.uk-nav ul a {
padding: 2px 0;
}
/*
* Item subtitle
*/
.uk-nav li > a > div {
font-size: 12px;
line-height: 18px;
}
/* Sub-object: `uk-nav-header`
========================================================================== */
.uk-nav-header {
padding: 5px 15px;
text-transform: uppercase;
font-weight: bold;
font-size: 12px;
}
.uk-nav-header:not(:first-child) {
margin-top: 15px;
}
/* Sub-object: `uk-nav-divider`
========================================================================== */
.uk-nav-divider {
margin: 9px 15px;
}
/* Sub-object: `uk-nav-sub`
========================================================================== */
/*
* `ul` needed for higher specificity to override padding
*/
ul.uk-nav-sub {
padding: 5px 0 5px 15px;
}
/* Modifier: `uk-nav-parent-icon`
========================================================================== */
.uk-nav-parent-icon > .uk-parent > a:after {
content: "\f104";
width: 20px;
margin-right: -10px;
float: right;
font-family: FontAwesome;
text-align: center;
}
.uk-nav-parent-icon > .uk-parent.uk-open > a:after {
content: "\f107";
}
/* Modifier `uk-nav-side`
========================================================================== */
/*
* Items
*/
.uk-nav-side > li > a {
color: #444444;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-nav-side > li > a:hover,
.uk-nav-side > li > a:focus {
background: rgba(0, 0, 0, 0.05);
color: #444444;
/* 2 */
outline: none;
}
/* Active */
.uk-nav-side > li.uk-active > a {
background: #00a8e6;
color: #ffffff;
}
/*
* Sub-object: `uk-nav-header`
*/
.uk-nav-side .uk-nav-header {
color: #444444;
}
/*
* Sub-object: `uk-nav-divider`
*/
.uk-nav-side .uk-nav-divider {
border-top: 1px solid #dddddd;
}
/*
* Nested items
*/
.uk-nav-side ul a {
color: #0077dd;
}
.uk-nav-side ul a:hover {
color: #005599;
}
/* Modifier `uk-nav-dropdown`
========================================================================== */
/*
* Items
*/
.uk-nav-dropdown > li > a {
color: #444444;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-nav-dropdown > li > a:hover,
.uk-nav-dropdown > li > a:focus {
background: #00a8e6;
color: #ffffff;
/* 2 */
outline: none;
}
/*
* Sub-object: `uk-nav-header`
*/
.uk-nav-dropdown .uk-nav-header {
color: #999999;
}
/*
* Sub-object: `uk-nav-divider`
*/
.uk-nav-dropdown .uk-nav-divider {
border-top: 1px solid #dddddd;
}
/*
* Nested items
*/
.uk-nav-dropdown ul a {
color: #0077dd;
}
.uk-nav-dropdown ul a:hover {
color: #005599;
}
/* Modifier `uk-nav-navbar`
========================================================================== */
/*
* Items
*/
.uk-nav-navbar > li > a {
color: #444444;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-nav-navbar > li > a:hover,
.uk-nav-navbar > li > a:focus {
background: #00a8e6;
color: #ffffff;
/* 2 */
outline: none;
}
/*
* Sub-object: `uk-nav-header`
*/
.uk-nav-navbar .uk-nav-header {
color: #999999;
}
/*
* Sub-object: `uk-nav-divider`
*/
.uk-nav-navbar .uk-nav-divider {
border-top: 1px solid #dddddd;
}
/*
* Nested items
*/
.uk-nav-navbar ul a {
color: #0077dd;
}
.uk-nav-navbar ul a:hover {
color: #005599;
}
/* Modifier `uk-nav-offcanvas`
========================================================================== */
/*
* Items
*/
.uk-nav-offcanvas > li > a {
color: #cccccc;
padding: 10px 15px;
}
/*
* Hover
* No hover on touch devices because it behaves buggy in fixed offcanvas
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-nav-offcanvas > .uk-open > a,
html:not(.uk-touch) .uk-nav-offcanvas > li > a:hover,
html:not(.uk-touch) .uk-nav-offcanvas > li > a:focus {
background: #404040;
color: #ffffff;
/* 2 */
outline: none;
}
/*
* Active
* `html .uk-nav` needed for higher specificity to override hover
*/
html .uk-nav.uk-nav-offcanvas > li.uk-active > a {
background: #1a1a1a;
color: #ffffff;
}
/*
* Sub-object: `uk-nav-header`
*/
.uk-nav-offcanvas .uk-nav-header {
color: #777777;
}
/*
* Sub-object: `uk-nav-divider`
*/
.uk-nav-offcanvas .uk-nav-divider {
border-top: 1px solid #1a1a1a;
}
/*
* Nested items
* No hover on touch devices because it behaves buggy in fixed offcanvas
*/
.uk-nav-offcanvas ul a {
color: #cccccc;
}
html:not(.uk-touch) .uk-nav-offcanvas ul a:hover {
color: #ffffff;
}
/* ========================================================================
Component: Navbar
========================================================================== */
.uk-navbar {
background: #eeeeee;
color: #444444;
}
/*
* Micro clearfix
*/
.uk-navbar:before,
.uk-navbar:after {
content: "";
display: table;
}
.uk-navbar:after {
clear: both;
}
/* Sub-object: `uk-navbar-nav`
========================================================================== */
.uk-navbar-nav {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
/*
* 1. Create position context for dropdowns
*/
.uk-navbar-nav > li {
float: left;
/* 1 */
position: relative;
}
/*
* 1. Dimensions
* 2. Style
*/
.uk-navbar-nav > li > a {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-decoration: none;
/* 1 */
height: 40px;
padding: 0 15px;
line-height: 40px;
/* 2 */
color: #444444;
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: normal;
}
/* Appear not as link */
.uk-navbar-nav > li > a[href='#'] {
cursor: text;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Also apply if dropdown is opened
* 3. Remove default focus style
*/
.uk-navbar-nav > li:hover > a,
.uk-navbar-nav > li > a:focus,
.uk-navbar-nav > li.uk-open > a {
background-color: #f5f5f5;
color: #444444;
/* 3 */
outline: none;
}
/* OnClick */
.uk-navbar-nav > li > a:active {
background-color: #dddddd;
color: #444444;
}
/* Active */
.uk-navbar-nav > li.uk-active > a {
background-color: #f5f5f5;
color: #444444;
}
/* Sub-objects: `uk-navbar-nav-subtitle`
========================================================================== */
.uk-navbar-nav .uk-navbar-nav-subtitle {
line-height: 28px;
}
.uk-navbar-nav-subtitle > div {
margin-top: -6px;
font-size: 10px;
line-height: 12px;
}
/* Sub-objects: `uk-navbar-content`, `uk-navbar-brand`, `uk-navbar-toggle`
========================================================================== */
/*
* Imitate navbar items
*/
.uk-navbar-content,
.uk-navbar-brand,
.uk-navbar-toggle {
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
height: 40px;
padding: 0 15px;
float: left;
}
/*
* Helper to center all child elements vertically
*/
.uk-navbar-content:before,
.uk-navbar-brand:before,
.uk-navbar-toggle:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
/* Sub-objects: `uk-navbar-content`
========================================================================== */
/*
* Better sibling spacing
*/
.uk-navbar-content + .uk-navbar-content:not(.uk-navbar-center) {
padding-left: 0;
}
/*
* Link colors
*/
.uk-navbar-content > a:not([class]) {
color: #0077dd;
}
.uk-navbar-content > a:not([class]):hover {
color: #005599;
}
/* Sub-objects: `uk-navbar-brand`
========================================================================== */
.uk-navbar-brand {
font-size: 18px;
color: #444444;
text-decoration: none;
}
/*
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-navbar-brand:hover,
.uk-navbar-brand:focus {
color: #444444;
text-decoration: none;
/* 2 */
outline: none;
}
/* Sub-object: `uk-navbar-toggle`
========================================================================== */
.uk-navbar-toggle {
font-size: 18px;
color: #444444;
text-decoration: none;
}
/*
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-navbar-toggle:hover,
.uk-navbar-toggle:focus {
color: #444444;
text-decoration: none;
/* 2 */
outline: none;
}
/*
* 1. Center icon vertically
*/
.uk-navbar-toggle:after {
content: "\f0c9";
font-family: FontAwesome;
/* 1 */
vertical-align: middle;
}
.uk-navbar-toggle-alt:after {
content: "\f002";
}
/* Sub-object: `uk-navbar-center`
========================================================================== */
/*
* The element with this class needs to be last child in the navbar
* 1. This hack is needed because other float elements shift centered text
*/
.uk-navbar-center {
float: none;
text-align: center;
/* 1 */
max-width: 50%;
margin-left: auto;
margin-right: auto;
}
/* Sub-object: `uk-navbar-flip`
========================================================================== */
.uk-navbar-flip {
float: right;
}
/* ========================================================================
Component: Subnav
========================================================================== */
/*
* 1. Gutter
* 2. Remove default list style
*/
.uk-subnav {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
/* 1 */
margin-left: -10px;
margin-top: -10px;
/* 2 */
padding: 0;
list-style: none;
}
/*
* 1. Space is allocated solely based on content dimensions
* 2. Horizontal gutter is using `padding` so `uk-width-*` classes can be applied
* 3. Create position context for dropdowns
*/
.uk-subnav > * {
/* 1 */
-ms-flex: none;
-webkit-flex: none;
flex: none;
/* 2 */
padding-left: 10px;
margin-top: 10px;
/* 3 */
position: relative;
}
/*
* DEPRECATED IE9 Support
*/
.uk-subnav:before,
.uk-subnav:after {
content: "";
display: block;
overflow: hidden;
}
.uk-subnav:after {
clear: both;
}
.uk-subnav > * {
float: left;
}
/* Items
========================================================================== */
.uk-subnav > * > * {
display: inline-block;
color: #444444;
}
/*
* Hover
* 1. Apply hover style also to focus state
*/
.uk-subnav > * > :hover,
.uk-subnav > * > :focus {
color: #0077dd;
text-decoration: none;
}
/*
* Active
*/
.uk-subnav > .uk-active > * {
color: #0077dd;
}
/* Modifier: 'subnav-line'
========================================================================== */
.uk-subnav-line > :before {
content: "";
display: inline-block;
height: 10px;
vertical-align: middle;
}
.uk-subnav-line > :nth-child(n+2):before {
margin-right: 10px;
border-left: 1px solid #dddddd;
}
/* Modifier: 'subnav-pill'
========================================================================== */
.uk-subnav-pill > * > * {
padding: 3px 9px;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-subnav-pill > * > :hover,
.uk-subnav-pill > * > :focus {
background: #eeeeee;
color: #444444;
text-decoration: none;
/* 2 */
outline: none;
}
/*
* Active
* `li` needed for higher specificity to override hover
*/
.uk-subnav-pill > .uk-active > * {
background: #00a8e6;
color: #ffffff;
}
/* Disabled state
========================================================================== */
.uk-subnav > .uk-disabled > * {
background: none;
color: #999999;
text-decoration: none;
cursor: text;
}
/* ========================================================================
Component: Breadcrumb
========================================================================== */
/*
* 1. Remove default list style
* 2. Remove whitespace between child elements when using `inline-block`
*/
.uk-breadcrumb {
/* 1 */
padding: 0;
list-style: none;
/* 2 */
font-size: 0.001px;
}
/* Items
========================================================================== */
/*
* Reset whitespace hack
*/
.uk-breadcrumb > li {
font-size: 1rem;
vertical-align: top;
}
.uk-breadcrumb > li,
.uk-breadcrumb > li > a,
.uk-breadcrumb > li > span {
display: inline-block;
}
.uk-breadcrumb > li:nth-child(n+2):before {
content: "/";
display: inline-block;
margin: 0 8px;
}
/*
* Disabled
*/
.uk-breadcrumb > li:not(.uk-active) > span {
color: #999999;
}
/* ========================================================================
Component: Pagination
========================================================================== */
/*
* 1. Remove default list style
* 2. Center pagination by default
* 3. Remove whitespace between child elements when using `inline-block`
*/
.uk-pagination {
/* 1 */
padding: 0;
list-style: none;
/* 2 */
text-align: center;
/* 3 */
font-size: 0.001px;
}
/*
* Micro clearfix
* Needed if `uk-pagination-previous` or `uk-pagination-next` sub-objects are used
*/
.uk-pagination:before,
.uk-pagination:after {
content: "";
display: table;
}
.uk-pagination:after {
clear: both;
}
/* Items
========================================================================== */
/*
* 1. Reset whitespace hack
* 2. Remove the gap at the bottom of it container
*/
.uk-pagination > li {
display: inline-block;
/* 1 */
font-size: 1rem;
/* 2 */
vertical-align: top;
}
.uk-pagination > li:nth-child(n+2) {
margin-left: 5px;
}
/*
* 1. Makes pagination more robust against different box-sizing use
* 2. Reset text-align to center if alignment modifier is used
*/
.uk-pagination > li > a,
.uk-pagination > li > span {
display: inline-block;
min-width: 16px;
padding: 3px 5px;
line-height: 20px;
text-decoration: none;
/* 1 */
-moz-box-sizing: content-box;
box-sizing: content-box;
/* 2 */
text-align: center;
}
/*
* Links
*/
.uk-pagination > li > a {
background: #eeeeee;
color: #444444;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-pagination > li > a:hover,
.uk-pagination > li > a:focus {
background-color: #f5f5f5;
color: #444444;
/* 2 */
outline: none;
}
/* OnClick */
.uk-pagination > li > a:active {
background-color: #dddddd;
color: #444444;
}
/*
* Active
*/
.uk-pagination > .uk-active > span {
background: #00a8e6;
color: #ffffff;
}
/*
* Disabled
*/
.uk-pagination > .uk-disabled > span {
background-color: #f5f5f5;
color: #999999;
}
/* Previous and next navigation
========================================================================== */
.uk-pagination-previous {
float: left;
}
.uk-pagination-next {
float: right;
}
/* Alignment modifiers
========================================================================== */
.uk-pagination-left {
text-align: left;
}
.uk-pagination-right {
text-align: right;
}
/* ========================================================================
Component: Tab
========================================================================== */
.uk-tab {
margin: 0;
padding: 0;
list-style: none;
border-bottom: 1px solid #dddddd;
}
/*
* Micro clearfix on the deepest container
*/
.uk-tab:before,
.uk-tab:after {
content: "";
display: table;
}
.uk-tab:after {
clear: both;
}
/*
* Items
* 1. Create position context for dropdowns
*/
.uk-tab > li {
margin-bottom: -1px;
float: left;
/* 1 */
position: relative;
}
.uk-tab > li > a {
display: block;
padding: 8px 12px 8px 12px;
border: 1px solid transparent;
border-bottom-width: 0;
color: #0077dd;
text-decoration: none;
}
.uk-tab > li:nth-child(n+2) > a {
margin-left: 5px;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Also apply if dropdown is opened
* 3. Remove default focus style
*/
.uk-tab > li > a:hover,
.uk-tab > li > a:focus,
.uk-tab > li.uk-open > a {
border-color: #f5f5f5;
background: #f5f5f5;
color: #005599;
/* 2 */
outline: none;
}
.uk-tab > li:not(.uk-active) > a:hover,
.uk-tab > li:not(.uk-active) > a:focus,
.uk-tab > li.uk-open:not(.uk-active) > a {
margin-bottom: 1px;
padding-bottom: 7px;
}
/* Active */
.uk-tab > li.uk-active > a {
border-color: #dddddd;
border-bottom-color: transparent;
background: #ffffff;
color: #444444;
}
/* Disabled */
.uk-tab > li.uk-disabled > a {
color: #999999;
cursor: text;
}
.uk-tab > li.uk-disabled > a:hover,
.uk-tab > li.uk-disabled > a:focus,
.uk-tab > li.uk-disabled.uk-active > a {
background: none;
border-color: transparent;
}
/* Modifier: 'tab-flip'
========================================================================== */
.uk-tab-flip > li {
float: right;
}
.uk-tab-flip > li:nth-child(n+2) > a {
margin-left: 0;
margin-right: 5px;
}
/* Modifier: 'tab-responsive'
========================================================================== */
.uk-tab > li.uk-tab-responsive > a {
margin-left: 0;
margin-right: 0;
}
/*
* Icon
*/
.uk-tab-responsive > a:before {
content: "\f0c9\00a0";
font-family: FontAwesome;
}
/* Modifier: 'tab-center'
========================================================================== */
.uk-tab-center {
border-bottom: 1px solid #dddddd;
}
.uk-tab-center-bottom {
border-bottom: none;
border-top: 1px solid #dddddd;
}
.uk-tab-center:before,
.uk-tab-center:after {
content: "";
display: table;
}
.uk-tab-center:after {
clear: both;
}
/*
* 1. Using `right` to prevent vertical scrollbar caused by centering if to many tabs
*/
.uk-tab-center .uk-tab {
position: relative;
right: 50%;
border: none;
float: right;
}
.uk-tab-center .uk-tab > li {
position: relative;
right: -50%;
}
.uk-tab-center .uk-tab > li > a {
text-align: center;
}
/* Modifier: 'tab-bottom'
========================================================================== */
.uk-tab-bottom {
border-top: 1px solid #dddddd;
border-bottom: none;
}
.uk-tab-bottom > li {
margin-top: -1px;
margin-bottom: 0;
}
.uk-tab-bottom > li > a {
padding-top: 8px;
padding-bottom: 8px;
border-bottom-width: 1px;
border-top-width: 0;
}
.uk-tab-bottom > li:not(.uk-active) > a:hover,
.uk-tab-bottom > li:not(.uk-active) > a:focus,
.uk-tab-bottom > li.uk-open:not(.uk-active) > a {
margin-bottom: 0;
margin-top: 1px;
padding-bottom: 8px;
padding-top: 7px;
}
.uk-tab-bottom > li.uk-active > a {
border-top-color: transparent;
border-bottom-color: #dddddd;
}
/* Modifier: 'tab-grid'
========================================================================== */
/*
* 1. Create position context to prevent hidden border because of negative `z-index`
*/
.uk-tab-grid {
margin-left: -5px;
border-bottom: none;
/* 1 */
position: relative;
z-index: 0;
}
.uk-tab-grid:before {
display: block;
position: absolute;
left: 5px;
right: 0;
bottom: -1px;
border-top: 1px solid #dddddd;
/* 1 */
z-index: -1;
}
.uk-tab-grid > li:first-child > a {
margin-left: 5px;
}
.uk-tab-grid > li > a {
text-align: center;
}
/*
* If `uk-tab-bottom`
*/
.uk-tab-grid.uk-tab-bottom {
border-top: none;
}
.uk-tab-grid.uk-tab-bottom:before {
top: -1px;
bottom: auto;
}
/* Modifier: 'tab-left', 'tab-right'
========================================================================== */
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-tab-left,
.uk-tab-right {
border-bottom: none;
}
.uk-tab-left > li,
.uk-tab-right > li {
margin-bottom: 0;
float: none;
}
.uk-tab-left > li > a,
.uk-tab-right > li > a {
padding-top: 8px;
padding-bottom: 8px;
}
.uk-tab-left > li:nth-child(n+2) > a,
.uk-tab-right > li:nth-child(n+2) > a {
margin-left: 0;
margin-top: 5px;
}
.uk-tab-left > li.uk-active > a,
.uk-tab-right > li.uk-active > a {
border-color: #dddddd;
}
/*
* Modifier: 'tab-left'
*/
.uk-tab-left {
border-right: 1px solid #dddddd;
}
.uk-tab-left > li {
margin-right: -1px;
}
.uk-tab-left > li > a {
border-bottom-width: 1px;
border-right-width: 0;
}
.uk-tab-left > li:not(.uk-active) > a:hover,
.uk-tab-left > li:not(.uk-active) > a:focus {
margin-bottom: 0;
margin-right: 1px;
padding-bottom: 8px;
padding-right: 11px;
}
.uk-tab-left > li.uk-active > a {
border-right-color: transparent;
}
/*
* Modifier: 'tab-right'
*/
.uk-tab-right {
border-left: 1px solid #dddddd;
}
.uk-tab-right > li {
margin-left: -1px;
}
.uk-tab-right > li > a {
border-bottom-width: 1px;
border-left-width: 0;
}
.uk-tab-right > li:not(.uk-active) > a:hover,
.uk-tab-right > li:not(.uk-active) > a:focus {
margin-bottom: 0;
margin-left: 1px;
padding-bottom: 8px;
padding-left: 11px;
}
.uk-tab-right > li.uk-active > a {
border-left-color: transparent;
}
}
/* ========================================================================
Component: Thumbnav
========================================================================== */
/*
* 1. Gutter
* 2. Remove default list style
*/
.uk-thumbnav {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
/* 1 */
margin-left: -10px;
margin-top: -10px;
/* 2 */
padding: 0;
list-style: none;
}
/*
* 1. Space is allocated solely based on content dimensions
* 2. Horizontal gutter is using `padding` so `uk-width-*` classes can be applied
*/
.uk-thumbnav > * {
/* 1 */
-ms-flex: none;
-webkit-flex: none;
flex: none;
/* 2 */
padding-left: 10px;
margin-top: 10px;
}
/*
* DEPRECATED IE9 Support
*/
.uk-thumbnav:before,
.uk-thumbnav:after {
content: "";
display: block;
overflow: hidden;
}
.uk-thumbnav:after {
clear: both;
}
.uk-thumbnav > * {
float: left;
}
/* Items
========================================================================== */
.uk-thumbnav > * > * {
display: block;
background: #ffffff;
}
.uk-thumbnav > * > * > img {
opacity: 0.7;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
/*
* Hover
*/
.uk-thumbnav > * > :hover > img,
.uk-thumbnav > * > :focus > img {
opacity: 1;
}
/*
* Active
*/
.uk-thumbnav > .uk-active > * > img {
opacity: 1;
}
/* ========================================================================
Component: List
========================================================================== */
.uk-list {
padding: 0;
list-style: none;
}
/*
* Micro clearfix to make list more robust
*/
.uk-list > li:before,
.uk-list > li:after {
content: "";
display: table;
}
.uk-list > li:after {
clear: both;
}
/*
* Remove margin from the last-child
*/
.uk-list > li > :last-child {
margin-bottom: 0;
}
/*
* Nested lists
*/
.uk-list ul {
margin: 0;
padding-left: 20px;
list-style: none;
}
/* Modifier: `uk-list-line`
========================================================================== */
.uk-list-line > li:nth-child(n+2) {
margin-top: 5px;
padding-top: 5px;
border-top: 1px solid #dddddd;
}
/* Modifier: `uk-list-striped`
========================================================================== */
.uk-list-striped > li {
padding: 5px 5px;
}
.uk-list-striped > li:nth-of-type(odd) {
background: #f5f5f5;
}
/* Modifier: `uk-list-space`
========================================================================== */
.uk-list-space > li:nth-child(n+2) {
margin-top: 10px;
}
/* ========================================================================
Component: Description list
========================================================================== */
/* Modifier: `uk-description-list-horizontal`
========================================================================== */
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-description-list-horizontal {
overflow: hidden;
}
.uk-description-list-horizontal > dt {
width: 160px;
float: left;
clear: both;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.uk-description-list-horizontal > dd {
margin-left: 180px;
}
}
/* Modifier: `uk-description-list-line`
========================================================================== */
.uk-description-list-line > dt {
font-weight: normal;
}
.uk-description-list-line > dt:nth-child(n+2) {
margin-top: 5px;
padding-top: 5px;
border-top: 1px solid #dddddd;
}
.uk-description-list-line > dd {
color: #999999;
}
/* ========================================================================
Component: Table
========================================================================== */
/*
* 1. Remove most spacing between table cells.
* 2. Block element behavior
* 3. Style
*/
.uk-table {
/* 1 */
border-collapse: collapse;
border-spacing: 0;
/* 2 */
width: 100%;
/* 3 */
margin-bottom: 15px;
}
/*
* Add margin if adjacent element
*/
* + .uk-table {
margin-top: 15px;
}
.uk-table th,
.uk-table td {
padding: 8px 8px;
}
/*
* Set alignment
*/
.uk-table th {
text-align: left;
}
.uk-table td {
vertical-align: top;
}
.uk-table thead th {
vertical-align: bottom;
}
/*
* Caption and footer
*/
.uk-table caption,
.uk-table tfoot {
font-size: 12px;
font-style: italic;
}
.uk-table caption {
text-align: left;
color: #999999;
}
/*
* Active State
*/
.uk-table tbody tr.uk-active {
background: #eeeeee;
}
/* Sub-modifier: `uk-table-middle`
========================================================================== */
.uk-table-middle,
.uk-table-middle td {
vertical-align: middle !important;
}
/* Modifier: `uk-table-striped`
========================================================================== */
.uk-table-striped tbody tr:nth-of-type(odd) {
background: #f5f5f5;
}
/* Modifier: `uk-table-condensed`
========================================================================== */
.uk-table-condensed td {
padding: 4px 8px;
}
/* Modifier: `uk-table-hover`
========================================================================== */
.uk-table-hover tbody tr:hover {
background: #eeeeee;
}
/* ========================================================================
Component: Form
========================================================================== */
/*
* 1. Define consistent box sizing.
* Default is `content-box` with following exceptions set to `border-box`
* `button`, `select`, `input[type="checkbox"]` and `input[type="radio"]`
* `input[type="search"]` in Chrome, Safari and Opera
* `input[type="color"]` in Firefox
* 2. Address margins set differently in Firefox/IE and Chrome/Safari/Opera.
* 3. Remove `border-radius` in iOS.
* 4. Correct `font` properties and `color` not being inherited.
*/
.uk-form input,
.uk-form select,
.uk-form textarea {
/* 1 */
-moz-box-sizing: border-box;
box-sizing: border-box;
/* 2 */
margin: 0;
/* 3 */
border-radius: 0;
/* 4 */
font: inherit;
color: inherit;
}
/*
* Address inconsistent `text-transform` inheritance which is only inherit in Firefox
*/
.uk-form select {
text-transform: none;
}
/*
* 1. Correct `font` properties not being inherited.
* 2. Don't inherit the `font-weight` and use `bold` instead.
* NOTE: Both declarations don't work in Chrome, Safari and Opera.
*/
.uk-form optgroup {
/* 1 */
font: inherit;
/* 2 */
font-weight: bold;
}
/*
* Removes inner padding and border in Firefox 4+.
*/
.uk-form input::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* Removes excess padding in IE 8/9/10.
*/
.uk-form input[type="checkbox"],
.uk-form input[type="radio"] {
padding: 0;
}
/*
* Improves consistency of cursor style for clickable elements
*/
.uk-form input[type="checkbox"]:not(:disabled),
.uk-form input[type="radio"]:not(:disabled) {
cursor: pointer;
}
/*
* Remove default style in iOS.
*/
.uk-form textarea,
.uk-form input:not([type]),
.uk-form input[type="text"],
.uk-form input[type="password"],
.uk-form input[type="email"],
.uk-form input[type="url"],
.uk-form input[type="search"],
.uk-form input[type="tel"],
.uk-form input[type="number"],
.uk-form input[type="datetime"] {
-webkit-appearance: none;
}
/*
* Remove inner padding and search cancel button in Chrome, Safari and Opera on OS X.
*/
.uk-form input[type="search"]::-webkit-search-cancel-button,
.uk-form input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
.uk-form input[type="number"]::-webkit-inner-spin-button,
.uk-form input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/*
* Define consistent border, margin, and padding.
*/
.uk-form fieldset {
border: none;
margin: 0;
padding: 0;
}
/*
* 1. Remove default vertical scrollbar in IE 8/9/10/11.
* 2. Improve readability and alignment in all browsers.
*/
.uk-form textarea {
/* 1 */
overflow: auto;
/* 2 */
vertical-align: top;
}
/*
* Removes placeholder transparency in Firefox.
*/
.uk-form ::-moz-placeholder {
opacity: 1;
}
/*
* Removes `box-shadow` for invalid controls in Firefox.
*/
.uk-form :invalid {
box-shadow: none;
}
/*
* Vertical alignment
*/
.uk-form input:not([type="radio"]):not([type="checkbox"]),
.uk-form select {
vertical-align: middle;
}
/* Style
========================================================================== */
/*
* Remove margin from the last-child
*/
.uk-form > :last-child {
margin-bottom: 0;
}
/*
* Controls
* Except for `range`, `radio`, `checkbox`, `file`, `submit`, `reset`, `button` and `image`
* 1. Must be `height` because `min-height` is not working in OSX
* 2. Responsiveness: Sets a maximum width relative to the parent to scale on narrower viewports
* 3. Vertical `padding` needed for `select` elements in Firefox
* 4. Style
*/
.uk-form select,
.uk-form textarea,
.uk-form input:not([type]),
.uk-form input[type="text"],
.uk-form input[type="password"],
.uk-form input[type="datetime"],
.uk-form input[type="datetime-local"],
.uk-form input[type="date"],
.uk-form input[type="month"],
.uk-form input[type="time"],
.uk-form input[type="week"],
.uk-form input[type="number"],
.uk-form input[type="email"],
.uk-form input[type="url"],
.uk-form input[type="search"],
.uk-form input[type="tel"],
.uk-form input[type="color"] {
/* 1 */
height: 30px;
/* 2 */
max-width: 100%;
/* 3 */
padding: 4px 6px;
/* 4 */
border: 1px solid #dddddd;
background: #ffffff;
color: #444444;
-webkit-transition: all linear 0.2s;
transition: all linear 0.2s;
}
.uk-form select:focus,
.uk-form textarea:focus,
.uk-form input:not([type]):focus,
.uk-form input[type="text"]:focus,
.uk-form input[type="password"]:focus,
.uk-form input[type="datetime"]:focus,
.uk-form input[type="datetime-local"]:focus,
.uk-form input[type="date"]:focus,
.uk-form input[type="month"]:focus,
.uk-form input[type="time"]:focus,
.uk-form input[type="week"]:focus,
.uk-form input[type="number"]:focus,
.uk-form input[type="email"]:focus,
.uk-form input[type="url"]:focus,
.uk-form input[type="search"]:focus,
.uk-form input[type="tel"]:focus,
.uk-form input[type="color"]:focus {
border-color: #99baca;
outline: 0;
background: #f5fbfe;
color: #444444;
}
.uk-form select:disabled,
.uk-form textarea:disabled,
.uk-form input:not([type]):disabled,
.uk-form input[type="text"]:disabled,
.uk-form input[type="password"]:disabled,
.uk-form input[type="datetime"]:disabled,
.uk-form input[type="datetime-local"]:disabled,
.uk-form input[type="date"]:disabled,
.uk-form input[type="month"]:disabled,
.uk-form input[type="time"]:disabled,
.uk-form input[type="week"]:disabled,
.uk-form input[type="number"]:disabled,
.uk-form input[type="email"]:disabled,
.uk-form input[type="url"]:disabled,
.uk-form input[type="search"]:disabled,
.uk-form input[type="tel"]:disabled,
.uk-form input[type="color"]:disabled {
border-color: #dddddd;
background-color: #f5f5f5;
color: #999999;
}
/*
* Placeholder
*/
.uk-form :-ms-input-placeholder {
color: #999999 !important;
}
.uk-form ::-moz-placeholder {
color: #999999;
}
.uk-form ::-webkit-input-placeholder {
color: #999999;
}
.uk-form :disabled:-ms-input-placeholder {
color: #999999 !important;
}
.uk-form :disabled::-moz-placeholder {
color: #999999;
}
.uk-form :disabled::-webkit-input-placeholder {
color: #999999;
}
/*
* Legend
* 1. Behave like block element
* 2. Correct `color` not being inherited in IE 8/9/10/11.
* 3. Remove padding
* 4. `margin-bottom` is not working in Safari and Opera.
* Using `padding` and :after instead to create the border
* 5. Style
*/
.uk-form legend {
/* 1 */
width: 100%;
/* 2 */
border: 0;
/* 3 */
padding: 0;
/* 4 */
padding-bottom: 15px;
/* 5 */
font-size: 18px;
line-height: 30px;
}
/*
* 1. Fixes IE9
*/
.uk-form legend:after {
content: "";
display: block;
border-bottom: 1px solid #dddddd;
/* 1 */
width: 100%;
}
/* Size modifiers
* Higher specificity needed to override defaults
========================================================================== */
select.uk-form-small,
textarea.uk-form-small,
input[type].uk-form-small,
input:not([type]).uk-form-small {
height: 25px;
padding: 3px 3px;
font-size: 12px;
}
select.uk-form-large,
textarea.uk-form-large,
input[type].uk-form-large,
input:not([type]).uk-form-large {
height: 40px;
padding: 8px 6px;
font-size: 16px;
}
/* Reset height
* Must be after size modifiers
========================================================================== */
.uk-form textarea,
.uk-form select[multiple],
.uk-form select[size] {
height: auto;
}
/* Validation states
* Using !important to keep the selector simple
========================================================================== */
/*
* Error state
*/
.uk-form-danger {
border-color: #dc8d99 !important;
background: #fff7f8 !important;
color: #d85030 !important;
}
/*
* Success state
*/
.uk-form-success {
border-color: #8ec73b !important;
background: #fafff2 !important;
color: #659f13 !important;
}
/* Style modifiers
* Using !important to keep the selector simple
========================================================================== */
/*
* Blank form
*/
.uk-form-blank {
border-color: transparent !important;
border-style: dashed !important;
background: none !important;
}
.uk-form-blank:focus {
border-color: #dddddd !important;
}
/* Size sub-modifiers
========================================================================== */
/*
* Fixed widths
* Different widths for mini sized `input` and `select` elements
*/
input.uk-form-width-mini {
width: 40px;
}
select.uk-form-width-mini {
width: 65px;
}
.uk-form-width-small {
width: 130px;
}
.uk-form-width-medium {
width: 200px;
}
.uk-form-width-large {
width: 500px;
}
/* Sub-objects: `uk-form-row`
* Groups labels and controls in rows
========================================================================== */
/*
* Micro clearfix
* Needed for `uk-form-horizontal` modifier
*/
.uk-form-row:before,
.uk-form-row:after {
content: "";
display: table;
}
.uk-form-row:after {
clear: both;
}
/*
* Vertical gutter
*/
.uk-form-row + .uk-form-row {
margin-top: 15px;
}
/* Help text
* Sub-object: `uk-form-help-inline`, `uk-form-help-block`
========================================================================== */
.uk-form-help-inline {
display: inline-block;
margin: 0 0 0 10px;
}
.uk-form-help-block {
margin: 5px 0 0 0;
}
/* Controls content
* Sub-object: `uk-form-controls`, `uk-form-controls-condensed`
========================================================================== */
/*
* Remove margins
*/
.uk-form-controls > :first-child {
margin-top: 0;
}
.uk-form-controls > :last-child {
margin-bottom: 0;
}
/*
* Group controls and text into blocks with a small spacing between blocks
*/
.uk-form-controls-condensed {
margin: 5px 0;
}
/* Modifier: `uk-form-stacked`
* Requires sub-object: `uk-form-label`
========================================================================== */
.uk-form-stacked .uk-form-label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
/* Modifier: `uk-form-horizontal`
* Requires sub-objects: `uk-form-label`, `uk-form-controls`
========================================================================== */
/* Tablet portrait and smaller */
@media (max-width: 959px) {
/* Behave like `uk-form-stacked` */
.uk-form-horizontal .uk-form-label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-form-horizontal .uk-form-label {
width: 200px;
margin-top: 5px;
float: left;
}
.uk-form-horizontal .uk-form-controls {
margin-left: 215px;
}
/* Better vertical alignment if controls are checkboxes and radio buttons with text */
.uk-form-horizontal .uk-form-controls-text {
padding-top: 5px;
}
}
/* Sub-object: `uk-form-icon`
========================================================================== */
/*
* 1. Container width fits its content
* 2. Create position context
* 3. Prevent `inline-block` consequences
*/
.uk-form-icon {
/* 1 */
display: inline-block;
/* 2 */
position: relative;
/* 3 */
max-width: 100%;
}
/*
* 1. Make form element clickable through icon
*/
.uk-form-icon > [class*='uk-icon-'] {
position: absolute;
top: 50%;
width: 30px;
margin-top: -7px;
font-size: 14px;
color: #999999;
text-align: center;
/* 1 */
pointer-events: none;
}
.uk-form-icon:not(.uk-form-icon-flip) > input {
padding-left: 30px !important;
}
/*
* Sub-modifier: `uk-form-icon-flip`
*/
.uk-form-icon-flip > [class*='uk-icon-'] {
right: 0;
}
.uk-form-icon-flip > input {
padding-right: 30px !important;
}
/* ========================================================================
Component: Button
========================================================================== */
/*
* Removes inner padding and border in Firefox 4+.
*/
.uk-button::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* 1. Correct inability to style clickable `input` types in iOS.
* 2. Remove margins in Chrome, Safari and Opera.
* 3. Remove borders for `button`.
* 4. Address `overflow` set to `hidden` in IE 8/9/10/11.
* 5. Correct `font` properties and `color` not being inherited for `button`.
* 6. Address inconsistent `text-transform` inheritance which is only inherit in Firefox and IE
* 7. Style
* 8. `line-height` is used to create a height
* 9. `min-height` is necessary for `input` elements in Firefox and Opera because `line-height` is not working.
* 10. Reset button group whitespace hack
* 11. Required for `a`.
*/
.uk-button {
/* 1 */
-webkit-appearance: none;
/* 2 */
margin: 0;
/* 3 */
border: none;
/* 4 */
overflow: visible;
/* 5 */
font: inherit;
color: #444444;
/* 6 */
text-transform: none;
/* 7 */
display: inline-block;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0 12px;
background: #eeeeee;
vertical-align: middle;
/* 8 */
line-height: 30px;
/* 9 */
min-height: 30px;
/* 10 */
font-size: 1rem;
/* 11 */
text-decoration: none;
text-align: center;
}
.uk-button:not(:disabled) {
cursor: pointer;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
* 3. Required for `a` elements
*/
.uk-button:hover,
.uk-button:focus {
background-color: #f5f5f5;
color: #444444;
/* 2 */
outline: none;
/* 3 */
text-decoration: none;
}
/* Active */
.uk-button:active,
.uk-button.uk-active {
background-color: #dddddd;
color: #444444;
}
/* Color modifiers
========================================================================== */
/*
* Modifier: `uk-button-primary`
*/
.uk-button-primary {
background-color: #00a8e6;
color: #ffffff;
}
/* Hover */
.uk-button-primary:hover,
.uk-button-primary:focus {
background-color: #35b3ee;
color: #ffffff;
}
/* Active */
.uk-button-primary:active,
.uk-button-primary.uk-active {
background-color: #0091ca;
color: #ffffff;
}
/*
* Modifier: `uk-button-success`
*/
.uk-button-success {
background-color: #8cc14c;
color: #ffffff;
}
/* Hover */
.uk-button-success:hover,
.uk-button-success:focus {
background-color: #8ec73b;
color: #ffffff;
}
/* Active */
.uk-button-success:active,
.uk-button-success.uk-active {
background-color: #72ae41;
color: #ffffff;
}
/*
* Modifier: `uk-button-danger`
*/
.uk-button-danger {
background-color: #da314b;
color: #ffffff;
}
/* Hover */
.uk-button-danger:hover,
.uk-button-danger:focus {
background-color: #e4354f;
color: #ffffff;
}
/* Active */
.uk-button-danger:active,
.uk-button-danger.uk-active {
background-color: #c91032;
color: #ffffff;
}
/* Disabled state
* Overrides also the color modifiers
========================================================================== */
/* Equal for all button types */
.uk-button:disabled {
background-color: #f5f5f5;
color: #999999;
}
/* Modifier: `uk-button-link`
========================================================================== */
/* Reset */
.uk-button-link,
.uk-button-link:hover,
.uk-button-link:focus,
.uk-button-link:active,
.uk-button-link.uk-active,
.uk-button-link:disabled {
border-color: transparent;
background: none;
}
/* Color */
.uk-button-link {
color: #0077dd;
}
.uk-button-link:hover,
.uk-button-link:focus,
.uk-button-link:active,
.uk-button-link.uk-active {
color: #005599;
text-decoration: underline;
}
.uk-button-link:disabled {
color: #999999;
}
/* Focus */
.uk-button-link:focus {
outline: 1px dotted;
}
/* Size modifiers
========================================================================== */
.uk-button-mini {
min-height: 20px;
padding: 0 6px;
line-height: 20px;
font-size: 11px;
}
.uk-button-small {
min-height: 25px;
padding: 0 10px;
line-height: 25px;
font-size: 12px;
}
.uk-button-large {
min-height: 40px;
padding: 0 15px;
line-height: 40px;
font-size: 16px;
}
/* Sub-object `uk-button-group`
========================================================================== */
/*
* 1. Behave like buttons
* 2. Create position context for dropdowns
* 3. Remove whitespace between child elements when using `inline-block`
* 4. Prevent buttons from wrapping
* 5. Remove whitespace between child elements when using `inline-block`
*/
.uk-button-group {
/* 1 */
display: inline-block;
vertical-align: middle;
/* 2 */
position: relative;
/* 3 */
font-size: 0.001px;
/* 4 */
white-space: nowrap;
}
.uk-button-group > * {
display: inline-block;
}
/* 5 */
.uk-button-group .uk-button {
vertical-align: top;
}
/* Sub-object: `uk-button-dropdown`
========================================================================== */
/*
* 1. Behave like buttons
* 2. Create position context for dropdowns
*/
.uk-button-dropdown {
/* 1 */
display: inline-block;
vertical-align: middle;
/* 2 */
position: relative;
}
/* ========================================================================
Component: Icon
========================================================================== */
@font-face {
font-family: 'FontAwesome';
src: url("../fonts/fontawesome-webfont.eot");
src: url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/fontawesome-webfont.woff2") format('woff2'), url("../fonts/fontawesome-webfont.woff") format("woff"), url("../fonts/fontawesome-webfont.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
/*
* 1. Allow margin
* 2. Prevent inherit font style
* 4. Correct line-height
* 5. Better font rendering
* 6. Remove `text-decoration` for anchors
*/
[class*='uk-icon-'] {
font-family: FontAwesome;
/* 1 */
display: inline-block;
/* 2 */
font-weight: normal;
font-style: normal;
/* 4 */
line-height: 1;
/* 5 */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* 6 */
[class*='uk-icon-'],
[class*='uk-icon-']:hover,
[class*='uk-icon-']:focus {
text-decoration: none;
}
/* Size modifiers
========================================================================== */
.uk-icon-small:before {
font-size: 150%;
vertical-align: -10%;
}
.uk-icon-medium:before {
font-size: 200%;
vertical-align: -16%;
}
.uk-icon-large:before {
font-size: 250%;
vertical-align: -22%;
}
/* Modifier: `uk-icon-spin`
========================================================================== */
.uk-icon-spin {
display: inline-block;
-webkit-animation: uk-rotate 2s infinite linear;
animation: uk-rotate 2s infinite linear;
}
/* Modifier: `uk-icon-hover`
========================================================================== */
.uk-icon-hover {
color: #999999;
}
/*
* Hover
*/
.uk-icon-hover:hover {
color: #444444;
}
/* Modifier: `uk-icon-button`
========================================================================== */
.uk-icon-button {
-moz-box-sizing: border-box;
box-sizing: border-box;
display: inline-block;
width: 35px;
height: 35px;
border-radius: 100%;
background: #eeeeee;
line-height: 35px;
color: #444444;
font-size: 18px;
text-align: center;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-icon-button:hover,
.uk-icon-button:focus {
background-color: #f5f5f5;
color: #444444;
/* 2 */
outline: none;
}
/* Active */
.uk-icon-button:active {
background-color: #dddddd;
color: #444444;
}
/* Icon mapping
========================================================================== */
.uk-icon-glass:before {
content: "\f000";
}
.uk-icon-music:before {
content: "\f001";
}
.uk-icon-search:before {
content: "\f002";
}
.uk-icon-envelope-o:before {
content: "\f003";
}
.uk-icon-heart:before {
content: "\f004";
}
.uk-icon-star:before {
content: "\f005";
}
.uk-icon-star-o:before {
content: "\f006";
}
.uk-icon-user:before {
content: "\f007";
}
.uk-icon-film:before {
content: "\f008";
}
.uk-icon-th-large:before {
content: "\f009";
}
.uk-icon-th:before {
content: "\f00a";
}
.uk-icon-th-list:before {
content: "\f00b";
}
.uk-icon-check:before {
content: "\f00c";
}
.uk-icon-remove:before,
.uk-icon-close:before,
.uk-icon-times:before {
content: "\f00d";
}
.uk-icon-search-plus:before {
content: "\f00e";
}
.uk-icon-search-minus:before {
content: "\f010";
}
.uk-icon-power-off:before {
content: "\f011";
}
.uk-icon-signal:before {
content: "\f012";
}
.uk-icon-gear:before,
.uk-icon-cog:before {
content: "\f013";
}
.uk-icon-trash-o:before {
content: "\f014";
}
.uk-icon-home:before {
content: "\f015";
}
.uk-icon-file-o:before {
content: "\f016";
}
.uk-icon-clock-o:before {
content: "\f017";
}
.uk-icon-road:before {
content: "\f018";
}
.uk-icon-download:before {
content: "\f019";
}
.uk-icon-arrow-circle-o-down:before {
content: "\f01a";
}
.uk-icon-arrow-circle-o-up:before {
content: "\f01b";
}
.uk-icon-inbox:before {
content: "\f01c";
}
.uk-icon-play-circle-o:before {
content: "\f01d";
}
.uk-icon-rotate-right:before,
.uk-icon-repeat:before {
content: "\f01e";
}
.uk-icon-refresh:before {
content: "\f021";
}
.uk-icon-list-alt:before {
content: "\f022";
}
.uk-icon-lock:before {
content: "\f023";
}
.uk-icon-flag:before {
content: "\f024";
}
.uk-icon-headphones:before {
content: "\f025";
}
.uk-icon-volume-off:before {
content: "\f026";
}
.uk-icon-volume-down:before {
content: "\f027";
}
.uk-icon-volume-up:before {
content: "\f028";
}
.uk-icon-qrcode:before {
content: "\f029";
}
.uk-icon-barcode:before {
content: "\f02a";
}
.uk-icon-tag:before {
content: "\f02b";
}
.uk-icon-tags:before {
content: "\f02c";
}
.uk-icon-book:before {
content: "\f02d";
}
.uk-icon-bookmark:before {
content: "\f02e";
}
.uk-icon-print:before {
content: "\f02f";
}
.uk-icon-camera:before {
content: "\f030";
}
.uk-icon-font:before {
content: "\f031";
}
.uk-icon-bold:before {
content: "\f032";
}
.uk-icon-italic:before {
content: "\f033";
}
.uk-icon-text-height:before {
content: "\f034";
}
.uk-icon-text-width:before {
content: "\f035";
}
.uk-icon-align-left:before {
content: "\f036";
}
.uk-icon-align-center:before {
content: "\f037";
}
.uk-icon-align-right:before {
content: "\f038";
}
.uk-icon-align-justify:before {
content: "\f039";
}
.uk-icon-list:before {
content: "\f03a";
}
.uk-icon-dedent:before,
.uk-icon-outdent:before {
content: "\f03b";
}
.uk-icon-indent:before {
content: "\f03c";
}
.uk-icon-video-camera:before {
content: "\f03d";
}
.uk-icon-photo:before,
.uk-icon-image:before,
.uk-icon-picture-o:before {
content: "\f03e";
}
.uk-icon-pencil:before {
content: "\f040";
}
.uk-icon-map-marker:before {
content: "\f041";
}
.uk-icon-adjust:before {
content: "\f042";
}
.uk-icon-tint:before {
content: "\f043";
}
.uk-icon-edit:before,
.uk-icon-pencil-square-o:before {
content: "\f044";
}
.uk-icon-share-square-o:before {
content: "\f045";
}
.uk-icon-check-square-o:before {
content: "\f046";
}
.uk-icon-arrows:before {
content: "\f047";
}
.uk-icon-step-backward:before {
content: "\f048";
}
.uk-icon-fast-backward:before {
content: "\f049";
}
.uk-icon-backward:before {
content: "\f04a";
}
.uk-icon-play:before {
content: "\f04b";
}
.uk-icon-pause:before {
content: "\f04c";
}
.uk-icon-stop:before {
content: "\f04d";
}
.uk-icon-forward:before {
content: "\f04e";
}
.uk-icon-fast-forward:before {
content: "\f050";
}
.uk-icon-step-forward:before {
content: "\f051";
}
.uk-icon-eject:before {
content: "\f052";
}
.uk-icon-chevron-left:before {
content: "\f053";
}
.uk-icon-chevron-right:before {
content: "\f054";
}
.uk-icon-plus-circle:before {
content: "\f055";
}
.uk-icon-minus-circle:before {
content: "\f056";
}
.uk-icon-times-circle:before {
content: "\f057";
}
.uk-icon-check-circle:before {
content: "\f058";
}
.uk-icon-question-circle:before {
content: "\f059";
}
.uk-icon-info-circle:before {
content: "\f05a";
}
.uk-icon-crosshairs:before {
content: "\f05b";
}
.uk-icon-times-circle-o:before {
content: "\f05c";
}
.uk-icon-check-circle-o:before {
content: "\f05d";
}
.uk-icon-ban:before {
content: "\f05e";
}
.uk-icon-arrow-left:before {
content: "\f060";
}
.uk-icon-arrow-right:before {
content: "\f061";
}
.uk-icon-arrow-up:before {
content: "\f062";
}
.uk-icon-arrow-down:before {
content: "\f063";
}
.uk-icon-mail-forward:before,
.uk-icon-share:before {
content: "\f064";
}
.uk-icon-expand:before {
content: "\f065";
}
.uk-icon-compress:before {
content: "\f066";
}
.uk-icon-plus:before {
content: "\f067";
}
.uk-icon-minus:before {
content: "\f068";
}
.uk-icon-asterisk:before {
content: "\f069";
}
.uk-icon-exclamation-circle:before {
content: "\f06a";
}
.uk-icon-gift:before {
content: "\f06b";
}
.uk-icon-leaf:before {
content: "\f06c";
}
.uk-icon-fire:before {
content: "\f06d";
}
.uk-icon-eye:before {
content: "\f06e";
}
.uk-icon-eye-slash:before {
content: "\f070";
}
.uk-icon-warning:before,
.uk-icon-exclamation-triangle:before {
content: "\f071";
}
.uk-icon-plane:before {
content: "\f072";
}
.uk-icon-calendar:before {
content: "\f073";
}
.uk-icon-random:before {
content: "\f074";
}
.uk-icon-comment:before {
content: "\f075";
}
.uk-icon-magnet:before {
content: "\f076";
}
.uk-icon-chevron-up:before {
content: "\f077";
}
.uk-icon-chevron-down:before {
content: "\f078";
}
.uk-icon-retweet:before {
content: "\f079";
}
.uk-icon-shopping-cart:before {
content: "\f07a";
}
.uk-icon-folder:before {
content: "\f07b";
}
.uk-icon-folder-open:before {
content: "\f07c";
}
.uk-icon-arrows-v:before {
content: "\f07d";
}
.uk-icon-arrows-h:before {
content: "\f07e";
}
.uk-icon-bar-chart-o:before,
.uk-icon-bar-chart:before {
content: "\f080";
}
.uk-icon-twitter-square:before {
content: "\f081";
}
.uk-icon-facebook-square:before {
content: "\f082";
}
.uk-icon-camera-retro:before {
content: "\f083";
}
.uk-icon-key:before {
content: "\f084";
}
.uk-icon-gears:before,
.uk-icon-cogs:before {
content: "\f085";
}
.uk-icon-comments:before {
content: "\f086";
}
.uk-icon-thumbs-o-up:before {
content: "\f087";
}
.uk-icon-thumbs-o-down:before {
content: "\f088";
}
.uk-icon-star-half:before {
content: "\f089";
}
.uk-icon-heart-o:before {
content: "\f08a";
}
.uk-icon-sign-out:before {
content: "\f08b";
}
.uk-icon-linkedin-square:before {
content: "\f08c";
}
.uk-icon-thumb-tack:before {
content: "\f08d";
}
.uk-icon-external-link:before {
content: "\f08e";
}
.uk-icon-sign-in:before {
content: "\f090";
}
.uk-icon-trophy:before {
content: "\f091";
}
.uk-icon-github-square:before {
content: "\f092";
}
.uk-icon-upload:before {
content: "\f093";
}
.uk-icon-lemon-o:before {
content: "\f094";
}
.uk-icon-phone:before {
content: "\f095";
}
.uk-icon-square-o:before {
content: "\f096";
}
.uk-icon-bookmark-o:before {
content: "\f097";
}
.uk-icon-phone-square:before {
content: "\f098";
}
.uk-icon-twitter:before {
content: "\f099";
}
.uk-icon-facebook-f:before,
.uk-icon-facebook:before {
content: "\f09a";
}
.uk-icon-github:before {
content: "\f09b";
}
.uk-icon-unlock:before {
content: "\f09c";
}
.uk-icon-credit-card:before {
content: "\f09d";
}
.uk-icon-rss:before {
content: "\f09e";
}
.uk-icon-hdd-o:before {
content: "\f0a0";
}
.uk-icon-bullhorn:before {
content: "\f0a1";
}
.uk-icon-bell:before {
content: "\f0f3";
}
.uk-icon-certificate:before {
content: "\f0a3";
}
.uk-icon-hand-o-right:before {
content: "\f0a4";
}
.uk-icon-hand-o-left:before {
content: "\f0a5";
}
.uk-icon-hand-o-up:before {
content: "\f0a6";
}
.uk-icon-hand-o-down:before {
content: "\f0a7";
}
.uk-icon-arrow-circle-left:before {
content: "\f0a8";
}
.uk-icon-arrow-circle-right:before {
content: "\f0a9";
}
.uk-icon-arrow-circle-up:before {
content: "\f0aa";
}
.uk-icon-arrow-circle-down:before {
content: "\f0ab";
}
.uk-icon-globe:before {
content: "\f0ac";
}
.uk-icon-wrench:before {
content: "\f0ad";
}
.uk-icon-tasks:before {
content: "\f0ae";
}
.uk-icon-filter:before {
content: "\f0b0";
}
.uk-icon-briefcase:before {
content: "\f0b1";
}
.uk-icon-arrows-alt:before {
content: "\f0b2";
}
.uk-icon-group:before,
.uk-icon-users:before {
content: "\f0c0";
}
.uk-icon-chain:before,
.uk-icon-link:before {
content: "\f0c1";
}
.uk-icon-cloud:before {
content: "\f0c2";
}
.uk-icon-flask:before {
content: "\f0c3";
}
.uk-icon-cut:before,
.uk-icon-scissors:before {
content: "\f0c4";
}
.uk-icon-copy:before,
.uk-icon-files-o:before {
content: "\f0c5";
}
.uk-icon-paperclip:before {
content: "\f0c6";
}
.uk-icon-save:before,
.uk-icon-floppy-o:before {
content: "\f0c7";
}
.uk-icon-square:before {
content: "\f0c8";
}
.uk-icon-navicon:before,
.uk-icon-reorder:before,
.uk-icon-bars:before {
content: "\f0c9";
}
.uk-icon-list-ul:before {
content: "\f0ca";
}
.uk-icon-list-ol:before {
content: "\f0cb";
}
.uk-icon-strikethrough:before {
content: "\f0cc";
}
.uk-icon-underline:before {
content: "\f0cd";
}
.uk-icon-table:before {
content: "\f0ce";
}
.uk-icon-magic:before {
content: "\f0d0";
}
.uk-icon-truck:before {
content: "\f0d1";
}
.uk-icon-pinterest:before {
content: "\f0d2";
}
.uk-icon-pinterest-square:before {
content: "\f0d3";
}
.uk-icon-google-plus-square:before {
content: "\f0d4";
}
.uk-icon-google-plus:before {
content: "\f0d5";
}
.uk-icon-money:before {
content: "\f0d6";
}
.uk-icon-caret-down:before {
content: "\f0d7";
}
.uk-icon-caret-up:before {
content: "\f0d8";
}
.uk-icon-caret-left:before {
content: "\f0d9";
}
.uk-icon-caret-right:before {
content: "\f0da";
}
.uk-icon-columns:before {
content: "\f0db";
}
.uk-icon-unsorted:before,
.uk-icon-sort:before {
content: "\f0dc";
}
.uk-icon-sort-down:before,
.uk-icon-sort-desc:before {
content: "\f0dd";
}
.uk-icon-sort-up:before,
.uk-icon-sort-asc:before {
content: "\f0de";
}
.uk-icon-envelope:before {
content: "\f0e0";
}
.uk-icon-linkedin:before {
content: "\f0e1";
}
.uk-icon-rotate-left:before,
.uk-icon-undo:before {
content: "\f0e2";
}
.uk-icon-legal:before,
.uk-icon-gavel:before {
content: "\f0e3";
}
.uk-icon-dashboard:before,
.uk-icon-tachometer:before {
content: "\f0e4";
}
.uk-icon-comment-o:before {
content: "\f0e5";
}
.uk-icon-comments-o:before {
content: "\f0e6";
}
.uk-icon-flash:before,
.uk-icon-bolt:before {
content: "\f0e7";
}
.uk-icon-sitemap:before {
content: "\f0e8";
}
.uk-icon-umbrella:before {
content: "\f0e9";
}
.uk-icon-paste:before,
.uk-icon-clipboard:before {
content: "\f0ea";
}
.uk-icon-lightbulb-o:before {
content: "\f0eb";
}
.uk-icon-exchange:before {
content: "\f0ec";
}
.uk-icon-cloud-download:before {
content: "\f0ed";
}
.uk-icon-cloud-upload:before {
content: "\f0ee";
}
.uk-icon-user-md:before {
content: "\f0f0";
}
.uk-icon-stethoscope:before {
content: "\f0f1";
}
.uk-icon-suitcase:before {
content: "\f0f2";
}
.uk-icon-bell-o:before {
content: "\f0a2";
}
.uk-icon-coffee:before {
content: "\f0f4";
}
.uk-icon-cutlery:before {
content: "\f0f5";
}
.uk-icon-file-text-o:before {
content: "\f0f6";
}
.uk-icon-building-o:before {
content: "\f0f7";
}
.uk-icon-hospital-o:before {
content: "\f0f8";
}
.uk-icon-ambulance:before {
content: "\f0f9";
}
.uk-icon-medkit:before {
content: "\f0fa";
}
.uk-icon-fighter-jet:before {
content: "\f0fb";
}
.uk-icon-beer:before {
content: "\f0fc";
}
.uk-icon-h-square:before {
content: "\f0fd";
}
.uk-icon-plus-square:before {
content: "\f0fe";
}
.uk-icon-angle-double-left:before {
content: "\f100";
}
.uk-icon-angle-double-right:before {
content: "\f101";
}
.uk-icon-angle-double-up:before {
content: "\f102";
}
.uk-icon-angle-double-down:before {
content: "\f103";
}
.uk-icon-angle-left:before {
content: "\f104";
}
.uk-icon-angle-right:before {
content: "\f105";
}
.uk-icon-angle-up:before {
content: "\f106";
}
.uk-icon-angle-down:before {
content: "\f107";
}
.uk-icon-desktop:before {
content: "\f108";
}
.uk-icon-laptop:before {
content: "\f109";
}
.uk-icon-tablet:before {
content: "\f10a";
}
.uk-icon-mobile-phone:before,
.uk-icon-mobile:before {
content: "\f10b";
}
.uk-icon-circle-o:before {
content: "\f10c";
}
.uk-icon-quote-left:before {
content: "\f10d";
}
.uk-icon-quote-right:before {
content: "\f10e";
}
.uk-icon-spinner:before {
content: "\f110";
}
.uk-icon-circle:before {
content: "\f111";
}
.uk-icon-mail-reply:before,
.uk-icon-reply:before {
content: "\f112";
}
.uk-icon-github-alt:before {
content: "\f113";
}
.uk-icon-folder-o:before {
content: "\f114";
}
.uk-icon-folder-open-o:before {
content: "\f115";
}
.uk-icon-smile-o:before {
content: "\f118";
}
.uk-icon-frown-o:before {
content: "\f119";
}
.uk-icon-meh-o:before {
content: "\f11a";
}
.uk-icon-gamepad:before {
content: "\f11b";
}
.uk-icon-keyboard-o:before {
content: "\f11c";
}
.uk-icon-flag-o:before {
content: "\f11d";
}
.uk-icon-flag-checkered:before {
content: "\f11e";
}
.uk-icon-terminal:before {
content: "\f120";
}
.uk-icon-code:before {
content: "\f121";
}
.uk-icon-mail-reply-all:before,
.uk-icon-reply-all:before {
content: "\f122";
}
.uk-icon-star-half-empty:before,
.uk-icon-star-half-full:before,
.uk-icon-star-half-o:before {
content: "\f123";
}
.uk-icon-location-arrow:before {
content: "\f124";
}
.uk-icon-crop:before {
content: "\f125";
}
.uk-icon-code-fork:before {
content: "\f126";
}
.uk-icon-unlink:before,
.uk-icon-chain-broken:before {
content: "\f127";
}
.uk-icon-question:before {
content: "\f128";
}
.uk-icon-info:before {
content: "\f129";
}
.uk-icon-exclamation:before {
content: "\f12a";
}
.uk-icon-superscript:before {
content: "\f12b";
}
.uk-icon-subscript:before {
content: "\f12c";
}
.uk-icon-eraser:before {
content: "\f12d";
}
.uk-icon-puzzle-piece:before {
content: "\f12e";
}
.uk-icon-microphone:before {
content: "\f130";
}
.uk-icon-microphone-slash:before {
content: "\f131";
}
.uk-icon-shield:before {
content: "\f132";
}
.uk-icon-calendar-o:before {
content: "\f133";
}
.uk-icon-fire-extinguisher:before {
content: "\f134";
}
.uk-icon-rocket:before {
content: "\f135";
}
.uk-icon-maxcdn:before {
content: "\f136";
}
.uk-icon-chevron-circle-left:before {
content: "\f137";
}
.uk-icon-chevron-circle-right:before {
content: "\f138";
}
.uk-icon-chevron-circle-up:before {
content: "\f139";
}
.uk-icon-chevron-circle-down:before {
content: "\f13a";
}
.uk-icon-html5:before {
content: "\f13b";
}
.uk-icon-css3:before {
content: "\f13c";
}
.uk-icon-anchor:before {
content: "\f13d";
}
.uk-icon-unlock-alt:before {
content: "\f13e";
}
.uk-icon-bullseye:before {
content: "\f140";
}
.uk-icon-ellipsis-h:before {
content: "\f141";
}
.uk-icon-ellipsis-v:before {
content: "\f142";
}
.uk-icon-rss-square:before {
content: "\f143";
}
.uk-icon-play-circle:before {
content: "\f144";
}
.uk-icon-ticket:before {
content: "\f145";
}
.uk-icon-minus-square:before {
content: "\f146";
}
.uk-icon-minus-square-o:before {
content: "\f147";
}
.uk-icon-level-up:before {
content: "\f148";
}
.uk-icon-level-down:before {
content: "\f149";
}
.uk-icon-check-square:before {
content: "\f14a";
}
.uk-icon-pencil-square:before {
content: "\f14b";
}
.uk-icon-external-link-square:before {
content: "\f14c";
}
.uk-icon-share-square:before {
content: "\f14d";
}
.uk-icon-compass:before {
content: "\f14e";
}
.uk-icon-toggle-down:before,
.uk-icon-caret-square-o-down:before {
content: "\f150";
}
.uk-icon-toggle-up:before,
.uk-icon-caret-square-o-up:before {
content: "\f151";
}
.uk-icon-toggle-right:before,
.uk-icon-caret-square-o-right:before {
content: "\f152";
}
.uk-icon-euro:before,
.uk-icon-eur:before {
content: "\f153";
}
.uk-icon-gbp:before {
content: "\f154";
}
.uk-icon-dollar:before,
.uk-icon-usd:before {
content: "\f155";
}
.uk-icon-rupee:before,
.uk-icon-inr:before {
content: "\f156";
}
.uk-icon-cny:before,
.uk-icon-rmb:before,
.uk-icon-yen:before,
.uk-icon-jpy:before {
content: "\f157";
}
.uk-icon-ruble:before,
.uk-icon-rouble:before,
.uk-icon-rub:before {
content: "\f158";
}
.uk-icon-won:before,
.uk-icon-krw:before {
content: "\f159";
}
.uk-icon-bitcoin:before,
.uk-icon-btc:before {
content: "\f15a";
}
.uk-icon-file:before {
content: "\f15b";
}
.uk-icon-file-text:before {
content: "\f15c";
}
.uk-icon-sort-alpha-asc:before {
content: "\f15d";
}
.uk-icon-sort-alpha-desc:before {
content: "\f15e";
}
.uk-icon-sort-amount-asc:before {
content: "\f160";
}
.uk-icon-sort-amount-desc:before {
content: "\f161";
}
.uk-icon-sort-numeric-asc:before {
content: "\f162";
}
.uk-icon-sort-numeric-desc:before {
content: "\f163";
}
.uk-icon-thumbs-up:before {
content: "\f164";
}
.uk-icon-thumbs-down:before {
content: "\f165";
}
.uk-icon-youtube-square:before {
content: "\f166";
}
.uk-icon-youtube:before {
content: "\f167";
}
.uk-icon-xing:before {
content: "\f168";
}
.uk-icon-xing-square:before {
content: "\f169";
}
.uk-icon-youtube-play:before {
content: "\f16a";
}
.uk-icon-dropbox:before {
content: "\f16b";
}
.uk-icon-stack-overflow:before {
content: "\f16c";
}
.uk-icon-instagram:before {
content: "\f16d";
}
.uk-icon-flickr:before {
content: "\f16e";
}
.uk-icon-adn:before {
content: "\f170";
}
.uk-icon-bitbucket:before {
content: "\f171";
}
.uk-icon-bitbucket-square:before {
content: "\f172";
}
.uk-icon-tumblr:before {
content: "\f173";
}
.uk-icon-tumblr-square:before {
content: "\f174";
}
.uk-icon-long-arrow-down:before {
content: "\f175";
}
.uk-icon-long-arrow-up:before {
content: "\f176";
}
.uk-icon-long-arrow-left:before {
content: "\f177";
}
.uk-icon-long-arrow-right:before {
content: "\f178";
}
.uk-icon-apple:before {
content: "\f179";
}
.uk-icon-windows:before {
content: "\f17a";
}
.uk-icon-android:before {
content: "\f17b";
}
.uk-icon-linux:before {
content: "\f17c";
}
.uk-icon-dribbble:before {
content: "\f17d";
}
.uk-icon-skype:before {
content: "\f17e";
}
.uk-icon-foursquare:before {
content: "\f180";
}
.uk-icon-trello:before {
content: "\f181";
}
.uk-icon-female:before {
content: "\f182";
}
.uk-icon-male:before {
content: "\f183";
}
.uk-icon-gittip:before,
.uk-icon-gratipay:before {
content: "\f184";
}
.uk-icon-sun-o:before {
content: "\f185";
}
.uk-icon-moon-o:before {
content: "\f186";
}
.uk-icon-archive:before {
content: "\f187";
}
.uk-icon-bug:before {
content: "\f188";
}
.uk-icon-vk:before {
content: "\f189";
}
.uk-icon-weibo:before {
content: "\f18a";
}
.uk-icon-renren:before {
content: "\f18b";
}
.uk-icon-pagelines:before {
content: "\f18c";
}
.uk-icon-stack-exchange:before {
content: "\f18d";
}
.uk-icon-arrow-circle-o-right:before {
content: "\f18e";
}
.uk-icon-arrow-circle-o-left:before {
content: "\f190";
}
.uk-icon-toggle-left:before,
.uk-icon-caret-square-o-left:before {
content: "\f191";
}
.uk-icon-dot-circle-o:before {
content: "\f192";
}
.uk-icon-wheelchair:before {
content: "\f193";
}
.uk-icon-vimeo-square:before {
content: "\f194";
}
.uk-icon-turkish-lira:before,
.uk-icon-try:before {
content: "\f195";
}
.uk-icon-plus-square-o:before {
content: "\f196";
}
.uk-icon-space-shuttle:before {
content: "\f197";
}
.uk-icon-slack:before {
content: "\f198";
}
.uk-icon-envelope-square:before {
content: "\f199";
}
.uk-icon-wordpress:before {
content: "\f19a";
}
.uk-icon-openid:before {
content: "\f19b";
}
.uk-icon-institution:before,
.uk-icon-bank:before,
.uk-icon-university:before {
content: "\f19c";
}
.uk-icon-mortar-board:before,
.uk-icon-graduation-cap:before {
content: "\f19d";
}
.uk-icon-yahoo:before {
content: "\f19e";
}
.uk-icon-google:before {
content: "\f1a0";
}
.uk-icon-reddit:before {
content: "\f1a1";
}
.uk-icon-reddit-square:before {
content: "\f1a2";
}
.uk-icon-stumbleupon-circle:before {
content: "\f1a3";
}
.uk-icon-stumbleupon:before {
content: "\f1a4";
}
.uk-icon-delicious:before {
content: "\f1a5";
}
.uk-icon-digg:before {
content: "\f1a6";
}
.uk-icon-pied-piper:before {
content: "\f1a7";
}
.uk-icon-pied-piper-alt:before {
content: "\f1a8";
}
.uk-icon-drupal:before {
content: "\f1a9";
}
.uk-icon-joomla:before {
content: "\f1aa";
}
.uk-icon-language:before {
content: "\f1ab";
}
.uk-icon-fax:before {
content: "\f1ac";
}
.uk-icon-building:before {
content: "\f1ad";
}
.uk-icon-child:before {
content: "\f1ae";
}
.uk-icon-paw:before {
content: "\f1b0";
}
.uk-icon-spoon:before {
content: "\f1b1";
}
.uk-icon-cube:before {
content: "\f1b2";
}
.uk-icon-cubes:before {
content: "\f1b3";
}
.uk-icon-behance:before {
content: "\f1b4";
}
.uk-icon-behance-square:before {
content: "\f1b5";
}
.uk-icon-steam:before {
content: "\f1b6";
}
.uk-icon-steam-square:before {
content: "\f1b7";
}
.uk-icon-recycle:before {
content: "\f1b8";
}
.uk-icon-automobile:before,
.uk-icon-car:before {
content: "\f1b9";
}
.uk-icon-cab:before,
.uk-icon-taxi:before {
content: "\f1ba";
}
.uk-icon-tree:before {
content: "\f1bb";
}
.uk-icon-spotify:before {
content: "\f1bc";
}
.uk-icon-deviantart:before {
content: "\f1bd";
}
.uk-icon-soundcloud:before {
content: "\f1be";
}
.uk-icon-database:before {
content: "\f1c0";
}
.uk-icon-file-pdf-o:before {
content: "\f1c1";
}
.uk-icon-file-word-o:before {
content: "\f1c2";
}
.uk-icon-file-excel-o:before {
content: "\f1c3";
}
.uk-icon-file-powerpoint-o:before {
content: "\f1c4";
}
.uk-icon-file-photo-o:before,
.uk-icon-file-picture-o:before,
.uk-icon-file-image-o:before {
content: "\f1c5";
}
.uk-icon-file-zip-o:before,
.uk-icon-file-archive-o:before {
content: "\f1c6";
}
.uk-icon-file-sound-o:before,
.uk-icon-file-audio-o:before {
content: "\f1c7";
}
.uk-icon-file-movie-o:before,
.uk-icon-file-video-o:before {
content: "\f1c8";
}
.uk-icon-file-code-o:before {
content: "\f1c9";
}
.uk-icon-vine:before {
content: "\f1ca";
}
.uk-icon-codepen:before {
content: "\f1cb";
}
.uk-icon-jsfiddle:before {
content: "\f1cc";
}
.uk-icon-life-bouy:before,
.uk-icon-life-buoy:before,
.uk-icon-life-saver:before,
.uk-icon-support:before,
.uk-icon-life-ring:before {
content: "\f1cd";
}
.uk-icon-circle-o-notch:before {
content: "\f1ce";
}
.uk-icon-ra:before,
.uk-icon-rebel:before {
content: "\f1d0";
}
.uk-icon-ge:before,
.uk-icon-empire:before {
content: "\f1d1";
}
.uk-icon-git-square:before {
content: "\f1d2";
}
.uk-icon-git:before {
content: "\f1d3";
}
.uk-icon-hacker-news:before {
content: "\f1d4";
}
.uk-icon-tencent-weibo:before {
content: "\f1d5";
}
.uk-icon-qq:before {
content: "\f1d6";
}
.uk-icon-wechat:before,
.uk-icon-weixin:before {
content: "\f1d7";
}
.uk-icon-send:before,
.uk-icon-paper-plane:before {
content: "\f1d8";
}
.uk-icon-send-o:before,
.uk-icon-paper-plane-o:before {
content: "\f1d9";
}
.uk-icon-history:before {
content: "\f1da";
}
.uk-icon-genderless:before,
.uk-icon-circle-thin:before {
content: "\f1db";
}
.uk-icon-header:before {
content: "\f1dc";
}
.uk-icon-paragraph:before {
content: "\f1dd";
}
.uk-icon-sliders:before {
content: "\f1de";
}
.uk-icon-share-alt:before {
content: "\f1e0";
}
.uk-icon-share-alt-square:before {
content: "\f1e1";
}
.uk-icon-bomb:before {
content: "\f1e2";
}
.uk-icon-soccer-ball-o:before,
.uk-icon-futbol-o:before {
content: "\f1e3";
}
.uk-icon-tty:before {
content: "\f1e4";
}
.uk-icon-binoculars:before {
content: "\f1e5";
}
.uk-icon-plug:before {
content: "\f1e6";
}
.uk-icon-slideshare:before {
content: "\f1e7";
}
.uk-icon-twitch:before {
content: "\f1e8";
}
.uk-icon-yelp:before {
content: "\f1e9";
}
.uk-icon-newspaper-o:before {
content: "\f1ea";
}
.uk-icon-wifi:before {
content: "\f1eb";
}
.uk-icon-calculator:before {
content: "\f1ec";
}
.uk-icon-paypal:before {
content: "\f1ed";
}
.uk-icon-google-wallet:before {
content: "\f1ee";
}
.uk-icon-cc-visa:before {
content: "\f1f0";
}
.uk-icon-cc-mastercard:before {
content: "\f1f1";
}
.uk-icon-cc-discover:before {
content: "\f1f2";
}
.uk-icon-cc-amex:before {
content: "\f1f3";
}
.uk-icon-cc-paypal:before {
content: "\f1f4";
}
.uk-icon-cc-stripe:before {
content: "\f1f5";
}
.uk-icon-bell-slash:before {
content: "\f1f6";
}
.uk-icon-bell-slash-o:before {
content: "\f1f7";
}
.uk-icon-trash:before {
content: "\f1f8";
}
.uk-icon-copyright:before {
content: "\f1f9";
}
.uk-icon-at:before {
content: "\f1fa";
}
.uk-icon-eyedropper:before {
content: "\f1fb";
}
.uk-icon-paint-brush:before {
content: "\f1fc";
}
.uk-icon-birthday-cake:before {
content: "\f1fd";
}
.uk-icon-area-chart:before {
content: "\f1fe";
}
.uk-icon-pie-chart:before {
content: "\f200";
}
.uk-icon-line-chart:before {
content: "\f201";
}
.uk-icon-lastfm:before {
content: "\f202";
}
.uk-icon-lastfm-square:before {
content: "\f203";
}
.uk-icon-toggle-off:before {
content: "\f204";
}
.uk-icon-toggle-on:before {
content: "\f205";
}
.uk-icon-bicycle:before {
content: "\f206";
}
.uk-icon-bus:before {
content: "\f207";
}
.uk-icon-ioxhost:before {
content: "\f208";
}
.uk-icon-angellist:before {
content: "\f209";
}
.uk-icon-cc:before {
content: "\f20a";
}
.uk-icon-shekel:before,
.uk-icon-sheqel:before,
.uk-icon-ils:before {
content: "\f20b";
}
.uk-icon-meanpath:before {
content: "\f20c";
}
.uk-icon-buysellads:before {
content: "\f20d";
}
.uk-icon-connectdevelop:before {
content: "\f20e";
}
.uk-icon-dashcube:before {
content: "\f210";
}
.uk-icon-forumbee:before {
content: "\f211";
}
.uk-icon-leanpub:before {
content: "\f212";
}
.uk-icon-sellsy:before {
content: "\f213";
}
.uk-icon-shirtsinbulk:before {
content: "\f214";
}
.uk-icon-simplybuilt:before {
content: "\f215";
}
.uk-icon-skyatlas:before {
content: "\f216";
}
.uk-icon-cart-plus:before {
content: "\f217";
}
.uk-icon-cart-arrow-down:before {
content: "\f218";
}
.uk-icon-diamond:before {
content: "\f219";
}
.uk-icon-ship:before {
content: "\f21a";
}
.uk-icon-user-secret:before {
content: "\f21b";
}
.uk-icon-motorcycle:before {
content: "\f21c";
}
.uk-icon-street-view:before {
content: "\f21d";
}
.uk-icon-heartbeat:before {
content: "\f21e";
}
.uk-icon-venus:before {
content: "\f221";
}
.uk-icon-mars:before {
content: "\f222";
}
.uk-icon-mercury:before {
content: "\f223";
}
.uk-icon-transgender:before {
content: "\f224";
}
.uk-icon-transgender-alt:before {
content: "\f225";
}
.uk-icon-venus-double:before {
content: "\f226";
}
.uk-icon-mars-double:before {
content: "\f227";
}
.uk-icon-venus-mars:before {
content: "\f228";
}
.uk-icon-mars-stroke:before {
content: "\f229";
}
.uk-icon-mars-stroke-v:before {
content: "\f22a";
}
.uk-icon-mars-stroke-h:before {
content: "\f22b";
}
.uk-icon-neuter:before {
content: "\f22c";
}
.uk-icon-facebook-official:before {
content: "\f230";
}
.uk-icon-pinterest-p:before {
content: "\f231";
}
.uk-icon-whatsapp:before {
content: "\f232";
}
.uk-icon-server:before {
content: "\f233";
}
.uk-icon-user-plus:before {
content: "\f234";
}
.uk-icon-user-times:before {
content: "\f235";
}
.uk-icon-hotel:before,
.uk-icon-bed:before {
content: "\f236";
}
.uk-icon-viacoin:before {
content: "\f237";
}
.uk-icon-train:before {
content: "\f238";
}
.uk-icon-subway:before {
content: "\f239";
}
.uk-icon-medium-logo:before {
content: "\f23a";
}
/* ========================================================================
Component: Close
========================================================================== */
/*
* Removes inner padding and border in Firefox 4+.
*/
.uk-close::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* 1. Correct inability to style clickable `input` types in iOS.
* 2. Remove margins in Chrome, Safari and Opera.
* 3. Remove borders for `button`.
* 4. Address `overflow` set to `hidden` in IE 8/9/10/11.
* 5. Correct `font` properties and `color` not being inherited for `button`.
* 6. Address inconsistent `text-transform` inheritance which is only inherit in Firefox and IE
* 7. Remove default `button` padding and background color
* 8. Style
*/
.uk-close {
/* 1 */
-webkit-appearance: none;
/* 2 */
margin: 0;
/* 3 */
border: none;
/* 4 */
overflow: visible;
/* 5 */
font: inherit;
color: inherit;
/* 6 */
text-transform: none;
/* 7. */
padding: 0;
background: transparent;
/* 8 */
display: inline-block;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 20px;
line-height: 20px;
text-align: center;
vertical-align: middle;
opacity: 0.3;
}
/* Icon */
.uk-close:after {
display: block;
content: "\f00d";
font-family: FontAwesome;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
* 3. Required for `a` elements
*/
.uk-close:hover,
.uk-close:focus {
opacity: 0.5;
/* 2 */
outline: none;
/* 3 */
color: inherit;
text-decoration: none;
cursor: pointer;
}
/* Modifier
========================================================================== */
.uk-close-alt {
padding: 2px;
border-radius: 50%;
background: #eeeeee;
opacity: 1;
}
/* Hover */
.uk-close-alt:hover,
.uk-close-alt:focus {
opacity: 1;
}
/* Icon */
.uk-close-alt:after {
opacity: 0.5;
}
.uk-close-alt:hover:after,
.uk-close-alt:focus:after {
opacity: 0.8;
}
/* ========================================================================
Component: Badge
========================================================================== */
.uk-badge {
display: inline-block;
padding: 0 5px;
background: #00a8e6;
font-size: 10px;
font-weight: bold;
line-height: 14px;
color: #ffffff;
text-align: center;
vertical-align: middle;
text-transform: none;
}
/*
* Keep color when badge is a link
*/
a.uk-badge:hover {
color: #ffffff;
}
/* Modifier: `uk-badge-notification`;
========================================================================== */
.uk-badge-notification {
-moz-box-sizing: border-box;
box-sizing: border-box;
min-width: 18px;
border-radius: 500px;
font-size: 12px;
line-height: 18px;
}
/* Color modifier
========================================================================== */
/*
* Modifier: `uk-badge-success`
*/
.uk-badge-success {
background-color: #8cc14c;
}
/*
* Modifier: `uk-badge-warning`
*/
.uk-badge-warning {
background-color: #faa732;
}
/*
* Modifier: `uk-badge-danger`
*/
.uk-badge-danger {
background-color: #da314b;
}
/* ========================================================================
Component: Alert
========================================================================== */
.uk-alert {
margin-bottom: 15px;
padding: 10px;
background: #ebf7fd;
color: #2d7091;
}
/*
* Add margin if adjacent element
*/
* + .uk-alert {
margin-top: 15px;
}
/*
* Remove margin from the last-child
*/
.uk-alert > :last-child {
margin-bottom: 0;
}
/*
* Keep color for headings if the default heading color is changed
*/
.uk-alert h1,
.uk-alert h2,
.uk-alert h3,
.uk-alert h4,
.uk-alert h5,
.uk-alert h6 {
color: inherit;
}
/* Close in alert
========================================================================== */
.uk-alert > .uk-close:first-child {
float: right;
}
/*
* Remove margin from adjacent element
*/
.uk-alert > .uk-close:first-child + * {
margin-top: 0;
}
/* Modifier: `uk-alert-success`
========================================================================== */
.uk-alert-success {
background: #f2fae3;
color: #659f13;
}
/* Modifier: `uk-alert-warning`
========================================================================== */
.uk-alert-warning {
background: #fffceb;
color: #e28327;
}
/* Modifier: `uk-alert-danger`
========================================================================== */
.uk-alert-danger {
background: #fff1f0;
color: #d85030;
}
/* Modifier: `uk-alert-large`
========================================================================== */
.uk-alert-large {
padding: 20px;
}
.uk-alert-large > .uk-close:first-child {
margin: -10px -10px 0 0;
}
/* ========================================================================
Component: Thumbnail
========================================================================== */
/*
* 1. Container width fits its content
* 2. Responsive behavior
* 3. Corrects `max-width` behavior sed
* 4. Required for `figure` element
* 5. Style
*/
.uk-thumbnail {
/* 1 */
display: inline-block;
/* 2 */
max-width: 100%;
/* 3 */
-moz-box-sizing: border-box;
box-sizing: border-box;
/* 3 */
margin: 0;
/* 4 */
padding: 4px;
border: 1px solid #dddddd;
background: #ffffff;
}
/*
* Hover state for `a` elements
* 1. Apply hover style also to focus state
* 2. Needed for caption
* 3. Remove default focus style
*/
a.uk-thumbnail:hover,
a.uk-thumbnail:focus {
border-color: #aaaaaa;
background-color: #ffffff;
/* 2 */
text-decoration: none;
/* 3 */
outline: none;
}
/* Caption
========================================================================== */
.uk-thumbnail-caption {
padding-top: 4px;
text-align: center;
color: #444444;
}
/* Sizes
========================================================================== */
.uk-thumbnail-mini {
width: 150px;
}
.uk-thumbnail-small {
width: 200px;
}
.uk-thumbnail-medium {
width: 300px;
}
.uk-thumbnail-large {
width: 400px;
}
.uk-thumbnail-expand,
.uk-thumbnail-expand > img {
width: 100%;
}
/* ========================================================================
Component: Overlay
========================================================================== */
/*
* 1. Container width fits its content
* 2. Create position context
* 3. Set max-width for responsive images to prevent `inline-block` consequences
* 4. Remove the gap between the container and its child element
* 5. Needed for transitions and to fixed wrong scaling calculation for images in Chrome
* 6. Fixed `overflow: hidden` to be ignored with border-radius and CSS transforms in Webkit
* 7. Reset margin
*/
.uk-overlay {
/* 1 */
display: inline-block;
/* 2 */
position: relative;
/* 3 */
max-width: 100%;
/* 4 */
vertical-align: middle;
/* 5 */
overflow: hidden;
/* 6 */
-webkit-transform: translateZ(0);
/* 7 */
margin: 0;
}
/* 6 for Safari */
.uk-overlay.uk-border-circle {
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
/*
* Remove margin from content
*/
.uk-overlay > :first-child {
margin-bottom: 0;
}
/* Sub-object `uk-overlay-panel`
========================================================================== */
/*
* 1. Position cover
* 2. Style
*/
.uk-overlay-panel {
/* 1 */
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
/* 2 */
padding: 20px;
color: #ffffff;
}
/*
* Remove margin from the last-child
*/
.uk-overlay-panel > :last-child,
.uk-overlay-panel.uk-flex > * > :last-child {
margin-bottom: 0;
}
/*
* Keep color for headings if the default heading color is changed
*/
.uk-overlay-panel h1,
.uk-overlay-panel h2,
.uk-overlay-panel h3,
.uk-overlay-panel h4,
.uk-overlay-panel h5,
.uk-overlay-panel h6 {
color: inherit;
}
.uk-overlay-panel a:not([class]) {
color: inherit;
text-decoration: underline;
}
.uk-overlay-panel a[class*='uk-icon-']:not(.uk-icon-button) {
color: inherit;
}
/* Sub-object `uk-overlay-hover` and `uk-overlay-active`
========================================================================== */
.uk-overlay-hover:not(:hover):not(.uk-hover) .uk-overlay-panel:not(.uk-ignore) {
opacity: 0;
}
.uk-overlay-active :not(.uk-active) > .uk-overlay-panel:not(.uk-ignore) {
opacity: 0;
}
/* Modifier `uk-overlay-background`
========================================================================== */
.uk-overlay-background {
background: rgba(0, 0, 0, 0.5);
}
/* Modifier `uk-overlay-image`
========================================================================== */
/*
* Reset panel
*/
.uk-overlay-image {
padding: 0;
}
/* Position modifiers
========================================================================== */
.uk-overlay-top {
bottom: auto;
}
.uk-overlay-bottom {
top: auto;
}
.uk-overlay-left {
right: auto;
}
.uk-overlay-right {
left: auto;
}
/* Sub-object `uk-overlay-icon`
========================================================================== */
.uk-overlay-icon:before {
content: "\f002";
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
margin-top: -25px;
margin-left: -25px;
font-size: 50px;
line-height: 1;
font-family: FontAwesome;
text-align: center;
color: #ffffff;
}
/* Transitions
========================================================================== */
.uk-overlay-fade,
.uk-overlay-scale,
.uk-overlay-spin,
.uk-overlay-grayscale,
.uk-overlay-blur,
[class*='uk-overlay-slide'] {
transition-duration: 0.3s;
transition-timing-function: ease-out;
transition-property: opacity transform filter;
}
.uk-overlay-active .uk-overlay-fade,
.uk-overlay-active .uk-overlay-scale,
.uk-overlay-active .uk-overlay-spin,
.uk-overlay-active [class*='uk-overlay-slide'] {
transition-duration: 0.8s;
}
/*
* Fade
*/
.uk-overlay-fade {
opacity: 0.7;
}
.uk-overlay-hover:hover .uk-overlay-fade,
.uk-overlay-active .uk-active > .uk-overlay-fade {
opacity: 1;
}
/*
* Scale
*/
.uk-overlay-scale {
-webkit-transform: scale(1);
transform: scale(1);
}
.uk-overlay-hover:hover .uk-overlay-scale,
.uk-overlay-active .uk-active > .uk-overlay-scale {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
/*
* Spin
*/
.uk-overlay-spin {
-webkit-transform: scale(1) rotate(0deg);
transform: scale(1) rotate(0deg);
}
.uk-overlay-hover:hover .uk-overlay-spin,
.uk-overlay-active .uk-active > .uk-overlay-spin {
-webkit-transform: scale(1.1) rotate(3deg);
transform: scale(1.1) rotate(3deg);
}
/*
* Grayscale
*/
.uk-overlay-grayscale {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.uk-overlay-hover:hover .uk-overlay-grayscale,
.uk-overlay-active .uk-active > .uk-overlay-grayscale {
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
}
/*
* Slide
*/
[class*='uk-overlay-slide'] {
opacity: 0;
}
/* Top */
.uk-overlay-slide-top {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
/* Bottom */
.uk-overlay-slide-bottom {
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
/* Left */
.uk-overlay-slide-left {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}
/* Right */
.uk-overlay-slide-right {
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
/* Hover */
.uk-overlay-hover:hover [class*='uk-overlay-slide'],
.uk-overlay-active .uk-active > [class*='uk-overlay-slide'] {
opacity: 1;
-webkit-transform: translateX(0) translateY(0);
transform: translateX(0) translateY(0);
}
/* DEPRECATED
* Sub-object `uk-overlay-area`
========================================================================== */
/*
* 1. Set position
* 2. Set style
* 3. Fade-in transition
*/
.uk-overlay-area {
/* 1 */
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
/* 2 */
background: rgba(0, 0, 0, 0.3);
/* 3 */
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
-webkit-transform: translate3d(0, 0, 0);
}
/*
* Hover
* 1. `uk-hover` to support touch devices
* 2. Use optional `uk-overlay-toggle` to trigger the overlay earlier
*/
.uk-overlay:hover .uk-overlay-area,
.uk-overlay.uk-hover .uk-overlay-area,
.uk-overlay-toggle:hover .uk-overlay-area,
.uk-overlay-toggle.uk-hover .uk-overlay-area {
opacity: 1;
}
/*
* Icon
*/
.uk-overlay-area:empty:before {
content: "\f002";
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
margin-top: -25px;
margin-left: -25px;
font-size: 50px;
line-height: 1;
font-family: FontAwesome;
text-align: center;
color: #ffffff;
}
/* DEPRECATED
* Sub-object `uk-overlay-area-content`
========================================================================== */
/*
* Remove whitespace between child elements when using `inline-block`
* Needed for Firefox
*/
.uk-overlay-area:not(:empty) {
font-size: 0.001px;
}
/*
* 1. Needed for vertical alignment
*/
.uk-overlay-area:not(:empty):before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
/*
* 1. Set vertical alignment
* 2. Reset whitespace hack
* 3. Set horizontal alignment
* 4. Set style
*/
.uk-overlay-area-content {
/* 1 */
display: inline-block;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
vertical-align: middle;
/* 2 */
font-size: 1rem;
/* 3 */
text-align: center;
/* 4 */
padding: 0 15px;
color: #ffffff;
}
/*
* Remove margin from the last-child
*/
.uk-overlay-area-content > :last-child {
margin-bottom: 0;
}
/*
* Links in overlay area
*/
.uk-overlay-area-content a:not([class]),
.uk-overlay-area-content a:not([class]):hover {
color: inherit;
}
/* DEPRECATED
* Sub-object `uk-overlay-caption`
========================================================================== */
/*
* 1. Set position
* 2. Set style
* 3. Fade-in transition
*/
.uk-overlay-caption {
/* 1 */
position: absolute;
bottom: 0;
left: 0;
right: 0;
/* 2 */
padding: 15px;
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
/* 3 */
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
-webkit-transform: translate3d(0, 0, 0);
}
/*
* Hover
* 1. `uk-hover` to support touch devices
* 2. Use optional `uk-overlay-toggle` to trigger the overlay earlier
*/
.uk-overlay:hover .uk-overlay-caption,
.uk-overlay.uk-hover .uk-overlay-caption,
.uk-overlay-toggle:hover .uk-overlay-caption,
.uk-overlay-toggle.uk-hover .uk-overlay-caption {
opacity: 1;
}
/* ========================================================================
Component: Animation
========================================================================== */
[class*='uk-animation-'] {
-webkit-animation-duration: 0.5s;
animation-duration: 0.5s;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
/* Hide animated element if scrollspy is used */
@media screen {
[data-uk-scrollspy*='uk-animation-']:not([data-uk-scrollspy*='target']) {
opacity: 0;
}
}
/*
* Fade
* Higher specificity (!important) needed because of reverse modifier
*/
.uk-animation-fade {
-webkit-animation-name: uk-fade;
animation-name: uk-fade;
-webkit-animation-duration: 0.8s;
animation-duration: 0.8s;
-webkit-animation-timing-function: linear !important;
animation-timing-function: linear !important;
}
/*
* Fade with scale
*/
.uk-animation-scale-up {
-webkit-animation-name: uk-fade-scale-02;
animation-name: uk-fade-scale-02;
}
.uk-animation-scale-down {
-webkit-animation-name: uk-fade-scale-18;
animation-name: uk-fade-scale-18;
}
/*
* Fade with slide
*/
.uk-animation-slide-top {
-webkit-animation-name: uk-fade-top;
animation-name: uk-fade-top;
}
.uk-animation-slide-bottom {
-webkit-animation-name: uk-fade-bottom;
animation-name: uk-fade-bottom;
}
.uk-animation-slide-left {
-webkit-animation-name: uk-fade-left;
animation-name: uk-fade-left;
}
.uk-animation-slide-right {
-webkit-animation-name: uk-fade-right;
animation-name: uk-fade-right;
}
/*
* Scale
*/
.uk-animation-scale {
-webkit-animation-name: uk-scale-12;
animation-name: uk-scale-12;
}
/*
* Shake
*/
.uk-animation-shake {
-webkit-animation-name: uk-shake;
animation-name: uk-shake;
}
/* Direction modifiers
========================================================================== */
.uk-animation-reverse {
-webkit-animation-direction: reverse;
animation-direction: reverse;
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
/* Duration modifiers
========================================================================== */
.uk-animation-15 {
-webkit-animation-duration: 15s;
animation-duration: 15s;
}
/* Origin modifiers
========================================================================== */
.uk-animation-top-left {
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.uk-animation-top-center {
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
}
.uk-animation-top-right {
-webkit-transform-origin: 100% 0;
transform-origin: 100% 0;
}
.uk-animation-middle-left {
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
}
.uk-animation-middle-right {
-webkit-transform-origin: 100% 50%;
transform-origin: 100% 50%;
}
.uk-animation-bottom-left {
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.uk-animation-bottom-center {
-webkit-transform-origin: 50% 100%;
transform-origin: 50% 100%;
}
.uk-animation-bottom-right {
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
/* Sub-object: `uk-animation-hover`
========================================================================== */
/*
* Enable animation only on hover
* Note: Firefox also needs this because animations are not triggered when switching between display `hidden` and `block`
*/
.uk-animation-hover:not(:hover),
.uk-animation-hover:not(:hover) [class*='uk-animation-'],
.uk-touch .uk-animation-hover:not(.uk-hover),
.uk-touch .uk-animation-hover:not(.uk-hover) [class*='uk-animation-'] {
-webkit-animation-name: none;
animation-name: none;
}
/* Keyframes: Fade
* Used by dropdown, datepicker and slideshow component
========================================================================== */
@-webkit-keyframes uk-fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes uk-fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/* Keyframes: Fade with slide
========================================================================== */
/*
* Top
*/
@-webkit-keyframes uk-fade-top {
0% {
opacity: 0;
-webkit-transform: translateY(-100%);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@keyframes uk-fade-top {
0% {
opacity: 0;
transform: translateY(-100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*
* Bottom
*/
@-webkit-keyframes uk-fade-bottom {
0% {
opacity: 0;
-webkit-transform: translateY(100%);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@keyframes uk-fade-bottom {
0% {
opacity: 0;
transform: translateY(100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*
* Left
*/
@-webkit-keyframes uk-fade-left {
0% {
opacity: 0;
-webkit-transform: translateX(-100%);
}
100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}
@keyframes uk-fade-left {
0% {
opacity: 0;
transform: translateX(-100%);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
/*
* Right
*/
@-webkit-keyframes uk-fade-right {
0% {
opacity: 0;
-webkit-transform: translateX(100%);
}
100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}
@keyframes uk-fade-right {
0% {
opacity: 0;
transform: translateX(100%);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
/* Keyframes: Fade with scale
========================================================================== */
/*
* Scale by 0.2
*/
@-webkit-keyframes uk-fade-scale-02 {
0% {
opacity: 0;
-webkit-transform: scale(0.2);
}
100% {
opacity: 1;
-webkit-transform: scale(1);
}
}
@keyframes uk-fade-scale-02 {
0% {
opacity: 0;
transform: scale(0.2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/*
* Scale by 1.5
* Used by slideshow component
*/
@-webkit-keyframes uk-fade-scale-15 {
0% {
opacity: 0;
-webkit-transform: scale(1.5);
}
100% {
opacity: 1;
-webkit-transform: scale(1);
}
}
@keyframes uk-fade-scale-15 {
0% {
opacity: 0;
transform: scale(1.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/*
* Scale by 1.8
*/
@-webkit-keyframes uk-fade-scale-18 {
0% {
opacity: 0;
-webkit-transform: scale(1.8);
}
100% {
opacity: 1;
-webkit-transform: scale(1);
}
}
@keyframes uk-fade-scale-18 {
0% {
opacity: 0;
transform: scale(1.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/* Keyframes: Slide
* Used by slideshow component
========================================================================== */
/*
* Left
*/
@-webkit-keyframes uk-slide-left {
0% {
-webkit-transform: translateX(-100%);
}
100% {
-webkit-transform: translateX(0);
}
}
@keyframes uk-slide-left {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
/*
* Right
*/
@-webkit-keyframes uk-slide-right {
0% {
-webkit-transform: translateX(100%);
}
100% {
-webkit-transform: translateX(0);
}
}
@keyframes uk-slide-right {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(0);
}
}
/*
* Left third
*/
@-webkit-keyframes uk-slide-left-33 {
0% {
-webkit-transform: translateX(33%);
}
100% {
-webkit-transform: translateX(0);
}
}
@keyframes uk-slide-left-33 {
0% {
transform: translateX(33%);
}
100% {
transform: translateX(0);
}
}
/*
* Right third
*/
@-webkit-keyframes uk-slide-right-33 {
0% {
-webkit-transform: translateX(-33%);
}
100% {
-webkit-transform: translateX(0);
}
}
@keyframes uk-slide-right-33 {
0% {
transform: translateX(-33%);
}
100% {
transform: translateX(0);
}
}
/* Keyframes: Scale
========================================================================== */
@-webkit-keyframes uk-scale-12 {
0% {
-webkit-transform: scale(1.2);
}
100% {
-webkit-transform: scale(1);
}
}
@keyframes uk-scale-12 {
0% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
/* Keyframes: Rotate
* Used by icon component
========================================================================== */
@-webkit-keyframes uk-rotate {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@keyframes uk-rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
/* Keyframes: Shake
========================================================================== */
@-webkit-keyframes uk-shake {
0%,
100% {
-webkit-transform: translateX(0);
}
10% {
-webkit-transform: translateX(-9px);
}
20% {
-webkit-transform: translateX(8px);
}
30% {
-webkit-transform: translateX(-7px);
}
40% {
-webkit-transform: translateX(6px);
}
50% {
-webkit-transform: translateX(-5px);
}
60% {
-webkit-transform: translateX(4px);
}
70% {
-webkit-transform: translateX(-3px);
}
80% {
-webkit-transform: translateX(2px);
}
90% {
-webkit-transform: translateX(-1px);
}
}
@keyframes uk-shake {
0%,
100% {
transform: translateX(0);
}
10% {
transform: translateX(-9px);
}
20% {
transform: translateX(8px);
}
30% {
transform: translateX(-7px);
}
40% {
transform: translateX(6px);
}
50% {
transform: translateX(-5px);
}
60% {
transform: translateX(4px);
}
70% {
transform: translateX(-3px);
}
80% {
transform: translateX(2px);
}
90% {
transform: translateX(-1px);
}
}
/* Keyframes: Fade with slide fixed
* Used by dropdown and search component
========================================================================== */
/*
* Top fixed
*/
@-webkit-keyframes uk-slide-top-fixed {
0% {
opacity: 0;
-webkit-transform: translateY(-10px);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@keyframes uk-slide-top-fixed {
0% {
opacity: 0;
transform: translateY(-10px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*
* Bottom fixed
*/
@-webkit-keyframes uk-slide-bottom-fixed {
0% {
opacity: 0;
-webkit-transform: translateY(10px);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@keyframes uk-slide-bottom-fixed {
0% {
opacity: 0;
transform: translateY(10px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/* ========================================================================
Component: Dropdown
========================================================================== */
/*
* 1. Hide by default
* 2. Set position
* 3. Box-sizing is needed for `uk-dropdown-justify`
* 4. Set style
* 5. Reset button group whitespace hack
*/
.uk-dropdown {
/* 1 */
display: none;
/* 2 */
position: absolute;
top: 100%;
left: 0;
z-index: 1020;
/* 3 */
-moz-box-sizing: border-box;
box-sizing: border-box;
/* 4 */
width: 200px;
margin-top: 5px;
padding: 15px;
background: #f5f5f5;
color: #444444;
/* 5 */
font-size: 1rem;
vertical-align: top;
}
/*
* 1. Show dropdown
* 2. Set animation
* 3. Needed for scale animation
*/
.uk-open > .uk-dropdown {
/* 1 */
display: block;
/* 2 */
-webkit-animation: uk-fade 0.2s ease-in-out;
animation: uk-fade 0.2s ease-in-out;
/* 3 */
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
/* Alignment modifiers
========================================================================== */
/*
* Modifier `uk-dropdown-flip`
*/
.uk-dropdown-flip {
left: auto;
right: 0;
}
/*
* Modifier `uk-dropdown-up`
*/
.uk-dropdown-up {
top: auto;
bottom: 100%;
margin-top: auto;
margin-bottom: 5px;
}
/* Nav in dropdown
========================================================================== */
.uk-dropdown .uk-nav {
margin: 0 -15px;
}
/* Grid and panel in dropdown
========================================================================== */
/*
* Vertical gutter
*/
/*
* Grid
* Higher specificity to override large gutter
*/
.uk-grid .uk-dropdown-grid + .uk-dropdown-grid {
margin-top: 15px;
}
/* Panels */
.uk-dropdown-grid > [class*='uk-width-'] > .uk-panel + .uk-panel {
margin-top: 15px;
}
/* Tablet and bigger */
@media (min-width: 768px) {
/*
* Horizontal gutter
*/
.uk-dropdown:not(.uk-dropdown-stack) > .uk-dropdown-grid {
margin-left: -15px;
margin-right: -15px;
}
.uk-dropdown:not(.uk-dropdown-stack) > .uk-dropdown-grid > [class*='uk-width-'] {
padding-left: 15px;
padding-right: 15px;
}
/*
* Column divider
*/
.uk-dropdown:not(.uk-dropdown-stack) > .uk-dropdown-grid > [class*='uk-width-']:nth-child(n+2) {
border-left: 1px solid #dddddd;
}
/*
* Width multiplier for dropdown columns
*/
.uk-dropdown-width-2:not(.uk-dropdown-stack) {
width: 400px;
}
.uk-dropdown-width-3:not(.uk-dropdown-stack) {
width: 600px;
}
.uk-dropdown-width-4:not(.uk-dropdown-stack) {
width: 800px;
}
.uk-dropdown-width-5:not(.uk-dropdown-stack) {
width: 1000px;
}
}
/* Phone landscape and smaller */
@media (max-width: 767px) {
/*
* Stack columns and take full width
*/
.uk-dropdown-grid > [class*='uk-width-'] {
width: 100%;
}
/*
* Vertical gutter
*/
.uk-dropdown-grid > [class*='uk-width-']:nth-child(n+2) {
margin-top: 15px;
}
}
/*
* Stack grid columns
*/
.uk-dropdown-stack > .uk-dropdown-grid > [class*='uk-width-'] {
width: 100%;
}
.uk-dropdown-stack > .uk-dropdown-grid > [class*='uk-width-']:nth-child(n+2) {
margin-top: 15px;
}
/* Modifier `uk-dropdown-small`
========================================================================== */
/*
* Set min-width and text expands dropdown if needed
*/
.uk-dropdown-small {
min-width: 150px;
width: auto;
padding: 5px;
white-space: nowrap;
}
/*
* Nav in dropdown
*/
.uk-dropdown-small .uk-nav {
margin: 0 -5px;
}
/* Modifier: `uk-dropdown-navbar`
========================================================================== */
.uk-dropdown-navbar {
margin-top: 0;
background: #f5f5f5;
color: #444444;
}
.uk-open > .uk-dropdown-navbar {
-webkit-animation: uk-slide-top-fixed 0.2s ease-in-out;
animation: uk-slide-top-fixed 0.2s ease-in-out;
}
/* Modifier `uk-dropdown-scrollable`
========================================================================== */
/*
* Usefull for long lists
*/
.uk-dropdown-scrollable {
overflow-y: auto;
max-height: 200px;
}
/* ========================================================================
Component: Modal
========================================================================== */
/*
* This is the modal overlay and modal dialog container
* 1. Hide by default
* 2. Set fixed position
* 3. Allow scrolling for the modal dialog
* 4. Mask the background page
* 5. Fade-in transition
* 6. Deactivate browser history navigation in IE11
* 7. force hardware acceleration to prevent browser rendering hiccups
*/
.uk-modal {
/* 1 */
display: none;
/* 2 */
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1010;
/* 3 */
overflow-y: auto;
-webkit-overflow-scrolling: touch;
/* 4 */
background: rgba(0, 0, 0, 0.6);
/* 5 */
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
/* 6 */
touch-action: cross-slide-y pinch-zoom double-tap-zoom;
/* 7 */
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
/*
* Open state
*/
.uk-modal.uk-open {
opacity: 1;
}
/*
* Prevents duplicated scrollbar caused by 4.
*/
.uk-modal-page,
.uk-modal-page body {
overflow: hidden;
}
/* Sub-object: `uk-modal-dialog`
========================================================================== */
/*
* 1. Create position context for caption, spinner and close button
* 2. Set box sizing
* 3. Set style
* 4. Slide-in transition
*/
.uk-modal-dialog {
/* 1 */
position: relative;
/* 2 */
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 50px auto;
padding: 20px;
width: 600px;
max-width: 100%;
max-width: calc(100% - 20px);
/* 3 */
background: #ffffff;
/* 4 */
opacity: 0;
-webkit-transform: translateY(-100px);
transform: translateY(-100px);
-webkit-transition: opacity 0.3s linear, -webkit-transform 0.3s ease-out;
transition: opacity 0.3s linear, transform 0.3s ease-out;
}
/* Phone landscape and smaller */
@media (max-width: 767px) {
/*
* Fit in small screen
*/
.uk-modal-dialog {
width: auto;
margin: 10px auto;
}
}
/*
* Open state
*/
.uk-open .uk-modal-dialog {
/* 4 */
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
/*
* Remove margin from the last-child
*/
.uk-modal-dialog > :not([class*='uk-modal-']):last-child {
margin-bottom: 0;
}
/* Close in modal
========================================================================== */
.uk-modal-dialog > .uk-close:first-child {
margin: -10px -10px 0 0;
float: right;
}
/*
* Remove margin from adjacent element
*/
.uk-modal-dialog > .uk-close:first-child + :not([class*='uk-modal-']) {
margin-top: 0;
}
/* Modifier: `uk-modal-dialog-lightbox`
========================================================================== */
.uk-modal-dialog-lightbox {
margin: 15px auto;
padding: 0;
max-width: 95%;
max-width: calc(100% - 30px);
}
/*
* Close button
*/
.uk-modal-dialog-lightbox > .uk-close:first-child {
position: absolute;
top: -12px;
right: -12px;
margin: 0;
float: none;
}
/* Phone landscape and smaller */
@media (max-width: 767px) {
.uk-modal-dialog-lightbox > .uk-close:first-child {
top: -7px;
right: -7px;
}
}
/* Modifier: `uk-modal-dialog-large`
========================================================================== */
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-modal-dialog-large {
width: 930px;
}
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-modal-dialog-large {
width: 1130px;
}
}
/* Sub-Object: `uk-modal-header` and `uk-modal-footer`
========================================================================== */
.uk-modal-header {
margin-bottom: 15px;
}
.uk-modal-footer {
margin-top: 15px;
}
/*
* Remove margin from the last-child
*/
.uk-modal-header > :last-child,
.uk-modal-footer > :last-child {
margin-bottom: 0;
}
/* Sub-Object: `uk-modal-caption`
========================================================================== */
.uk-modal-caption {
position: absolute;
left: 0;
right: 0;
bottom: -20px;
margin-bottom: -10px;
color: #ffffff;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Sub-Object: `uk-modal-spinner`
========================================================================== */
.uk-modal-spinner {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 25px;
color: #ddd;
}
.uk-modal-spinner:after {
content: "\f110";
font-family: FontAwesome;
-webkit-animation: uk-rotate 2s infinite linear;
animation: uk-rotate 2s infinite linear;
}
/* ========================================================================
Component: Off-canvas
========================================================================== */
/*
* This is the offcanvas overlay and bar container
* 1. Hide by default
* 2. Set fixed position
* 3. Deactivate browser touch actions in IE11
* 4. Mask the background page
*/
.uk-offcanvas {
/* 1 */
display: none;
/* 2 */
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1000;
/* 3 */
touch-action: none;
/* 4 */
background: rgba(0, 0, 0, 0.1);
}
.uk-offcanvas.uk-active {
display: block;
}
/* Sub-object `uk-offcanvas-page`
========================================================================== */
/*
* Prepares the whole HTML page to slide-out
* 1. Fix the main page and disallow scrolling
* 2. Side-out transition
*/
.uk-offcanvas-page {
/* 1 */
position: fixed;
/* 2 */
-webkit-transition: margin-left 0.3s ease-in-out;
transition: margin-left 0.3s ease-in-out;
}
/* Sub-object `uk-offcanvas-bar`
========================================================================== */
/*
* This is the offcanvas bar
* 1. Set fixed position
* 2. Size and style
* 3. Allow scrolling
* 4. Side-out transition
* 5. Deavtivate scroll chaining in IE11
*/
.uk-offcanvas-bar {
/* 1 */
position: fixed;
top: 0;
bottom: 0;
left: 0;
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
z-index: 1001;
/* 2 */
width: 270px;
max-width: 100%;
background: #333333;
/* 3 */
overflow-y: auto;
-webkit-overflow-scrolling: touch;
/* 4 */
-webkit-transition: -webkit-transform 0.3s ease-in-out;
transition: transform 0.3s ease-in-out;
/* 5 */
-ms-scroll-chaining: none;
}
.uk-offcanvas.uk-active .uk-offcanvas-bar.uk-offcanvas-bar-show {
-webkit-transform: translateX(0%);
transform: translateX(0%);
}
/* Modifier `uk-offcanvas-bar-flip`
========================================================================== */
.uk-offcanvas-bar-flip {
left: auto;
right: 0;
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
/* Panel in offcanvas
========================================================================== */
.uk-offcanvas .uk-panel {
margin: 20px 15px;
color: #777777;
}
.uk-offcanvas .uk-panel-title {
color: #cccccc;
}
.uk-offcanvas .uk-panel a:not([class]) {
color: #cccccc;
}
.uk-offcanvas .uk-panel a:not([class]):hover {
color: #ffffff;
}
/* ========================================================================
Component: Switcher
========================================================================== */
/*
* 1. Deactivate browser history navigation in IE11
*/
.uk-switcher {
margin: 0;
padding: 0;
list-style: none;
/* 1 */
touch-action: cross-slide-y pinch-zoom double-tap-zoom;
}
/*
* Items
*/
.uk-switcher > :not(.uk-active) {
display: none;
}
/* ========================================================================
Component: Text
========================================================================== */
/* Size modifiers
========================================================================== */
.uk-text-small {
font-size: 11px;
line-height: 16px;
}
.uk-text-large {
font-size: 18px;
line-height: 24px;
font-weight: normal;
}
/* Weight modifiers
========================================================================== */
.uk-text-bold {
font-weight: bold;
}
/* Color modifiers
========================================================================== */
.uk-text-muted {
color: #999999 !important;
}
.uk-text-primary {
color: #2d7091 !important;
}
.uk-text-success {
color: #659f13 !important;
}
.uk-text-warning {
color: #e28327 !important;
}
.uk-text-danger {
color: #d85030 !important;
}
.uk-text-contrast {
color: #ffffff !important;
}
/* Alignment modifiers
========================================================================== */
.uk-text-left {
text-align: left !important;
}
.uk-text-right {
text-align: right !important;
}
.uk-text-center {
text-align: center !important;
}
.uk-text-justify {
text-align: justify !important;
}
.uk-text-top {
vertical-align: top !important;
}
.uk-text-middle {
vertical-align: middle !important;
}
.uk-text-bottom {
vertical-align: bottom !important;
}
/* Only tablets portrait and smaller */
@media (max-width: 959px) {
.uk-text-center-medium {
text-align: center !important;
}
.uk-text-left-medium {
text-align: left !important;
}
}
/* Phone landscape and smaller */
@media (max-width: 767px) {
.uk-text-center-small {
text-align: center !important;
}
.uk-text-left-small {
text-align: left !important;
}
}
/* Wrap modifiers
========================================================================== */
/*
* Prevent text from wrapping onto multiple lines
*/
.uk-text-nowrap {
white-space: nowrap;
}
/*
* Prevent text from wrapping onto multiple lines, and truncate with an ellipsis
*/
.uk-text-truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/*
* Break strings if their length exceeds the width of their container
*/
.uk-text-break {
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
/* ========================================================================
Component: Utility
========================================================================== */
/* Container
========================================================================== */
.uk-container {
-moz-box-sizing: border-box;
box-sizing: border-box;
max-width: 980px;
padding: 0 25px;
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-container {
max-width: 1200px;
padding: 0 35px;
}
}
/*
* Micro clearfix
*/
.uk-container:before,
.uk-container:after {
content: "";
display: table;
}
.uk-container:after {
clear: both;
}
/*
* Center container
*/
.uk-container-center {
margin-left: auto;
margin-right: auto;
}
/* Clearing
========================================================================== */
/*
* Micro clearfix
* `table-cell` is used with `:before` because `table` creates a 1px gap when it becomes a flex item, only in Webkit
* `table` is used again with `:after` because `clear` only works with block elements.
* Note: `display: block` with `overflow: hidden` is currently not working in the latest Safari
*/
.uk-clearfix:before {
content: "";
display: table-cell;
}
.uk-clearfix:after {
content: "";
display: table;
clear: both;
}
/*
* Create a new block formatting context
*/
.uk-nbfc {
overflow: hidden;
}
.uk-nbfc-alt {
display: table-cell;
width: 10000px;
}
/* Alignment of block elements
========================================================================== */
/*
* Float blocks
* 1. Prevent content overflow on small devices
*/
.uk-float-left {
float: left;
}
.uk-float-right {
float: right;
}
/* 1 */
[class*='uk-float-'] {
max-width: 100%;
}
/* Alignment of images and objects
========================================================================== */
/*
* Alignment
*/
[class*='uk-align-'] {
display: block;
margin-bottom: 15px;
}
.uk-align-left {
margin-right: 15px;
float: left;
}
.uk-align-right {
margin-left: 15px;
float: right;
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-align-medium-left {
margin-right: 15px;
margin-bottom: 15px;
float: left;
}
.uk-align-medium-right {
margin-left: 15px;
margin-bottom: 15px;
float: right;
}
}
.uk-align-center {
margin-left: auto;
margin-right: auto;
}
/* Vertical alignment
========================================================================== */
/*
* Remove whitespace between child elements when using `inline-block`
*/
.uk-vertical-align {
font-size: 0.001px;
}
/*
* The `uk-vertical-align` container needs a specific height
*/
.uk-vertical-align:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
/*
* Sub-object which can have any height
* 1. Reset whitespace hack
*/
.uk-vertical-align-middle,
.uk-vertical-align-bottom {
display: inline-block;
max-width: 100%;
/* 1 */
font-size: 1rem;
}
.uk-vertical-align-middle {
vertical-align: middle;
}
.uk-vertical-align-bottom {
vertical-align: bottom;
}
/* Height
========================================================================== */
/*
* More robust if padding and border are used
*/
[class*='uk-height'] {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*
* Useful to extend the `html` and `body` element to the full height of the page.
*/
.uk-height-1-1 {
height: 100%;
}
/*
* Useful to create image teasers
*/
.uk-height-viewport {
height: 100vh;
min-height: 600px;
}
/* Responsive objects
* Note: Images are already responsive by default, see Base component
========================================================================== */
/*
* 1. Corrects `max-width` and `max-height` behavior if padding and border are used
*/
.uk-responsive-width,
.uk-responsive-height {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*
* Responsiveness: Sets a maximum width relative to the parent and auto scales the height
* `important` needed to override `uk-img-preserve img`
*/
.uk-responsive-width {
max-width: 100% !important;
height: auto;
}
/*
* Responsiveness: Sets a maximum height relative to the parent and auto scales the width
* Only works if the parent element has a fixed height.
*/
.uk-responsive-height {
max-height: 100%;
width: auto;
}
/* Margin
========================================================================== */
/*
* Create a block with the same margin of a paragraph
* Add margin if adjacent element
*/
.uk-margin {
margin-bottom: 15px;
}
* + .uk-margin {
margin-top: 15px;
}
.uk-margin-top {
margin-top: 15px !important;
}
.uk-margin-bottom {
margin-bottom: 15px !important;
}
.uk-margin-left {
margin-left: 15px !important;
}
.uk-margin-right {
margin-right: 15px !important;
}
/*
* Larger margins
*/
.uk-margin-large {
margin-bottom: 50px;
}
* + .uk-margin-large {
margin-top: 50px;
}
.uk-margin-large-top {
margin-top: 50px !important;
}
.uk-margin-large-bottom {
margin-bottom: 50px !important;
}
.uk-margin-large-left {
margin-left: 50px !important;
}
.uk-margin-large-right {
margin-right: 50px !important;
}
/*
* Smaller margins
*/
.uk-margin-small {
margin-bottom: 5px;
}
* + .uk-margin-small {
margin-top: 5px;
}
.uk-margin-small-top {
margin-top: 5px !important;
}
.uk-margin-small-bottom {
margin-bottom: 5px !important;
}
.uk-margin-small-left {
margin-left: 5px !important;
}
.uk-margin-small-right {
margin-right: 5px !important;
}
/*
* Remove margins
*/
.uk-margin-remove {
margin: 0 !important;
}
.uk-margin-top-remove {
margin-top: 0 !important;
}
.uk-margin-bottom-remove {
margin-bottom: 0 !important;
}
/* Padding
========================================================================== */
.uk-padding-remove {
padding: 0 !important;
}
.uk-padding-top-remove {
padding-top: 0 !important;
}
.uk-padding-bottom-remove {
padding-bottom: 0 !important;
}
.uk-padding-vertical-remove {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
/* Border
========================================================================== */
.uk-border-circle {
border-radius: 50%;
}
.uk-border-rounded {
border-radius: 5px;
}
/* Headings
========================================================================== */
.uk-heading-large {
font-size: 36px;
line-height: 42px;
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-heading-large {
font-size: 52px;
line-height: 64px;
}
}
/* Link
========================================================================== */
/*
* Let links appear in default text color
*/
.uk-link-muted,
.uk-link-muted a {
color: #444444;
}
.uk-link-muted:hover,
.uk-link-muted a:hover {
color: #444444;
}
/*
* Reset link style
*/
.uk-link-reset,
.uk-link-reset a,
.uk-link-reset:hover,
.uk-link-reset a:hover,
.uk-link-reset:focus,
.uk-link-reset a:focus {
color: inherit;
text-decoration: none;
}
/* Scrollable
========================================================================== */
/*
* Enable scrolling for preformatted text
*/
.uk-scrollable-text {
height: 300px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
resize: both;
}
/*
* Box with scrolling enabled
*/
.uk-scrollable-box {
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 170px;
padding: 10px;
border: 1px solid #dddddd;
overflow: auto;
-webkit-overflow-scrolling: touch;
resize: both;
}
.uk-scrollable-box > :last-child {
margin-bottom: 0;
}
/* Overflow
========================================================================== */
.uk-overflow-hidden {
overflow: hidden;
}
/*
* Enable scrollbars if content is clipped
*/
.uk-overflow-container {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.uk-overflow-container > :last-child {
margin-bottom: 0;
}
/* Position
========================================================================== */
.uk-position-absolute,
[class*='uk-position-top'],
[class*='uk-position-bottom'] {
position: absolute !important;
}
.uk-position-top {
top: 0;
width: 100%;
}
.uk-position-bottom {
bottom: 0;
width: 100%;
}
.uk-position-top-left {
top: 0;
left: 0;
}
.uk-position-top-right {
top: 0;
right: 0;
}
.uk-position-bottom-left {
bottom: 0;
left: 0;
}
.uk-position-bottom-right {
bottom: 0;
right: 0;
}
/*
* Cover
*/
.uk-position-cover {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
/*
* Relative
*/
.uk-position-relative {
position: relative !important;
}
/*
* Z-index
*/
.uk-position-z-index {
z-index: 1;
}
/* Display
========================================================================== */
/*
* Display
*/
.uk-display-block {
display: block !important;
}
.uk-display-inline {
display: inline !important;
}
.uk-display-inline-block {
display: inline-block !important;
}
/*
* Visibility
* Avoids setting display to `block` so it works also with `inline-block` and `table`
*/
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-visible-small {
display: none !important;
}
.uk-visible-medium {
display: none !important;
}
.uk-hidden-large {
display: none !important;
}
}
/* Tablets portrait */
@media (min-width: 768px) and (max-width: 959px) {
.uk-visible-small {
display: none !important;
}
.uk-visible-large {
display: none !important ;
}
.uk-hidden-medium {
display: none !important;
}
}
/* Phone landscape and smaller*/
@media (max-width: 767px) {
.uk-visible-medium {
display: none !important;
}
.uk-visible-large {
display: none !important;
}
.uk-hidden-small {
display: none !important;
}
}
/* Remove from the flow and screen readers on any device */
.uk-hidden {
display: none !important;
visibility: hidden !important;
}
/* It's hidden, but still affects layout */
.uk-invisible {
visibility: hidden !important;
}
/* Show on hover */
.uk-visible-hover:hover .uk-hidden,
.uk-visible-hover:hover .uk-invisible {
display: block !important;
visibility: visible !important;
}
.uk-visible-hover-inline:hover .uk-hidden,
.uk-visible-hover-inline:hover .uk-invisible {
display: inline-block !important;
visibility: visible !important;
}
/* Hide on touch */
.uk-touch .uk-hidden-touch,
.uk-notouch .uk-hidden-notouch {
display: none !important;
}
/* ========================================================================
Component: Flex
========================================================================== */
.uk-flex {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.uk-flex-inline {
display: -ms-inline-flexbox;
display: -webkit-inline-flex;
display: inline-flex;
}
/*
* Fixes initial flex-shrink value in IE10
*/
.uk-flex > *,
.uk-flex-inline > * {
-ms-flex-negative: 1;
}
/* Alignment
========================================================================== */
/*
* Vertical alignment
* Default value is `stretch`
*/
.uk-flex-top {
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.uk-flex-middle {
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.uk-flex-bottom {
-ms-flex-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
/*
* Horizontal alignment
* Default value is `flex-start`
*/
.uk-flex-center {
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.uk-flex-right {
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.uk-flex-space-between {
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.uk-flex-space-around {
-ms-flex-pack: distribute;
-webkit-justify-content: space-around;
justify-content: space-around;
}
/* Direction
========================================================================== */
.uk-flex-row-reverse {
-ms-flex-direction: row-reverse;
-webkit-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.uk-flex-column {
-ms-flex-direction: column;
-webkit-flex-direction: column;
flex-direction: column;
}
.uk-flex-column-reverse {
-ms-flex-direction: column-reverse;
-webkit-flex-direction: column-reverse;
flex-direction: column-reverse;
}
/* Wrap
========================================================================== */
.uk-flex-wrap {
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.uk-flex-wrap-reverse {
-ms-flex-wrap: wrap-reverse;
-webkit-flex-wrap: wrap-reverse;
flex-wrap: wrap-reverse;
}
/*
* Horizontal alignment
* Default value is `stretch`
*/
.uk-flex-wrap-top {
-ms-flex-line-pack: start;
-webkit-align-content: flex-start;
align-content: flex-start;
}
.uk-flex-wrap-middle {
-ms-flex-line-pack: center;
-webkit-align-content: center;
align-content: center;
}
.uk-flex-wrap-bottom {
-ms-flex-line-pack: end;
-webkit-align-content: flex-end;
align-content: flex-end;
}
.uk-flex-wrap-space-between {
-ms-flex-line-pack: justify;
-webkit-align-content: space-between;
align-content: space-between;
}
.uk-flex-wrap-space-around {
-ms-flex-line-pack: distribute;
-webkit-align-content: space-around;
align-content: space-around;
}
/* Item ordering
========================================================================== */
/*
* Default is 0
*/
.uk-flex-order-first {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
/* Phone landscape and bigger */
@media (min-width: 480px) {
.uk-flex-order-first-small {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-small {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-flex-order-first-medium {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-medium {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-flex-order-first-large {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-large {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-flex-order-first-xlarge {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-xlarge {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Item dimensions
========================================================================== */
/*
* Initial: 0 1 auto
* Content dimensions, but shrinks
*/
/*
* No Flex: 0 0 auto
* Content dimensions
*/
.uk-flex-item-none {
-ms-flex: none;
-webkit-flex: none;
flex: none;
}
/*
* Relative Flex: 1 1 auto
* Space is allocated considering content
* 1. Fixes flex-shrink value in IE10
*/
.uk-flex-item-auto {
-ms-flex: auto;
-webkit-flex: auto;
flex: auto;
/* 1 */
-ms-flex-negative: 1;
}
/*
* Absolute Flex: 1 1 0%
* Space is allocated solely based on flex
*/
.uk-flex-item-1 {
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
/* ========================================================================
Component: Contrast
========================================================================== */
.uk-contrast {
color: #ffffff;
}
.uk-contrast a:not([class]),
.uk-contrast .uk-link {
color: rgba(255, 255, 255, 0.7);
text-decoration: none;
}
.uk-contrast a:not([class]):hover,
.uk-contrast .uk-link:hover {
color: #ffffff;
text-decoration: underline;
}
.uk-contrast :not(pre) > code,
.uk-contrast :not(pre) > kbd,
.uk-contrast :not(pre) > samp {
color: #ffffff;
}
.uk-contrast em {
color: #ffffff;
}
.uk-contrast h1,
.uk-contrast h2,
.uk-contrast h3,
.uk-contrast h4,
.uk-contrast h5,
.uk-contrast h6 {
color: #ffffff;
}
.uk-contrast hr {
border-top-color: rgba(255, 255, 255, 0.2);
}
.uk-contrast .uk-nav li > a,
.uk-contrast .uk-nav li > a:hover {
text-decoration: none;
}
.uk-contrast .uk-nav-side > li > a {
color: #ffffff;
}
.uk-contrast .uk-nav-side > li > a:hover,
.uk-contrast .uk-nav-side > li > a:focus {
background: rgba(255, 255, 255, 0.1);
color: #ffffff;
}
.uk-contrast .uk-nav-side > li.uk-active > a {
background: #ffffff;
color: #444444;
}
.uk-contrast .uk-nav-side .uk-nav-header {
color: #ffffff;
}
.uk-contrast .uk-nav-side .uk-nav-divider {
border-top-color: rgba(255, 255, 255, 0.2);
}
.uk-contrast .uk-nav-side ul a {
color: rgba(255, 255, 255, 0.7);
}
.uk-contrast .uk-nav-side ul a:hover {
color: #ffffff;
}
.uk-contrast .uk-subnav > * > a {
color: rgba(255, 255, 255, 0.7);
text-decoration: none;
}
.uk-contrast .uk-subnav > * > a:hover,
.uk-contrast .uk-subnav > * > a:focus {
color: #ffffff;
text-decoration: none;
}
.uk-contrast .uk-subnav > .uk-active > a {
color: #ffffff;
}
.uk-contrast .uk-subnav-line > :nth-child(n+2):before {
border-left-color: rgba(255, 255, 255, 0.2);
}
.uk-contrast .uk-subnav-pill > * > a:hover,
.uk-contrast .uk-subnav-pill > * > a:focus {
background: rgba(255, 255, 255, 0.7);
color: #444444;
text-decoration: none;
}
.uk-contrast .uk-subnav-pill > .uk-active > a {
background: #ffffff;
color: #444444;
}
.uk-contrast .uk-list-line > li:nth-child(n+2) {
border-top-color: rgba(255, 255, 255, 0.2);
}
.uk-contrast .uk-form select,
.uk-contrast .uk-form textarea,
.uk-contrast .uk-form input:not([type]),
.uk-contrast .uk-form input[type="text"],
.uk-contrast .uk-form input[type="password"],
.uk-contrast .uk-form input[type="datetime"],
.uk-contrast .uk-form input[type="datetime-local"],
.uk-contrast .uk-form input[type="date"],
.uk-contrast .uk-form input[type="month"],
.uk-contrast .uk-form input[type="time"],
.uk-contrast .uk-form input[type="week"],
.uk-contrast .uk-form input[type="number"],
.uk-contrast .uk-form input[type="email"],
.uk-contrast .uk-form input[type="url"],
.uk-contrast .uk-form input[type="search"],
.uk-contrast .uk-form input[type="tel"],
.uk-contrast .uk-form input[type="color"] {
border-color: rgba(255, 255, 255, 0.8);
background: rgba(255, 255, 255, 0.8);
color: #444444;
background-clip: padding-box;
}
.uk-contrast .uk-form select:focus,
.uk-contrast .uk-form textarea:focus,
.uk-contrast .uk-form input:not([type]):focus,
.uk-contrast .uk-form input[type="text"]:focus,
.uk-contrast .uk-form input[type="password"]:focus,
.uk-contrast .uk-form input[type="datetime"]:focus,
.uk-contrast .uk-form input[type="datetime-local"]:focus,
.uk-contrast .uk-form input[type="date"]:focus,
.uk-contrast .uk-form input[type="month"]:focus,
.uk-contrast .uk-form input[type="time"]:focus,
.uk-contrast .uk-form input[type="week"]:focus,
.uk-contrast .uk-form input[type="number"]:focus,
.uk-contrast .uk-form input[type="email"]:focus,
.uk-contrast .uk-form input[type="url"]:focus,
.uk-contrast .uk-form input[type="search"]:focus,
.uk-contrast .uk-form input[type="tel"]:focus,
.uk-contrast .uk-form input[type="color"]:focus {
border-color: #ffffff;
background: #ffffff;
color: #444444;
}
.uk-contrast .uk-form :-ms-input-placeholder {
color: rgba(68, 68, 68, 0.7) !important;
}
.uk-contrast .uk-form ::-moz-placeholder {
color: rgba(68, 68, 68, 0.7);
}
.uk-contrast .uk-form ::-webkit-input-placeholder {
color: rgba(68, 68, 68, 0.7);
}
.uk-contrast .uk-button {
color: #444444;
background: #ffffff;
}
.uk-contrast .uk-button:hover,
.uk-contrast .uk-button:focus {
background-color: rgba(255, 255, 255, 0.8);
color: #444444;
}
.uk-contrast .uk-button:active,
.uk-contrast .uk-button.uk-active {
background-color: rgba(255, 255, 255, 0.7);
color: #444444;
}
.uk-contrast .uk-button-primary {
background-color: #00a8e6;
color: #ffffff;
}
.uk-contrast .uk-button-primary:hover,
.uk-contrast .uk-button-primary:focus {
background-color: #35b3ee;
color: #ffffff;
}
.uk-contrast .uk-button-primary:active,
.uk-contrast .uk-button-primary.uk-active {
background-color: #0091ca;
color: #ffffff;
}
.uk-contrast .uk-icon-hover {
color: rgba(255, 255, 255, 0.7);
}
.uk-contrast .uk-icon-hover:hover {
color: #ffffff;
}
.uk-contrast .uk-icon-button {
background: #ffffff;
color: #444444;
}
.uk-contrast .uk-icon-button:hover,
.uk-contrast .uk-icon-button:focus {
background-color: rgba(255, 255, 255, 0.8);
color: #444444;
}
.uk-contrast .uk-icon-button:active {
background-color: rgba(255, 255, 255, 0.7);
color: #444444;
}
.uk-contrast .uk-text-muted {
color: rgba(255, 255, 255, 0.6) !important;
}
.uk-contrast .uk-text-primary {
color: #2d7091 !important;
}
/* ========================================================================
Component: Print
========================================================================== */
@media print {
* {
background: transparent !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page {
margin: 0.5cm;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}
| sitic/cdnjs | ajax/libs/uikit/2.20.2/css/uikit.css | CSS | mit | 164,284 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* System Initialization File
*
* Loads the base classes and executes the request.
*
* @package CodeIgniter
* @subpackage CodeIgniter
* @category Front-controller
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/
*/
/**
* CodeIgniter Version
*
* @var string
*
*/
define('CI_VERSION', '3.0.6');
/*
* ------------------------------------------------------
* Load the framework constants
* ------------------------------------------------------
*/
if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
{
require_once(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
}
require_once(APPPATH.'config/constants.php');
/*
* ------------------------------------------------------
* Load the global functions
* ------------------------------------------------------
*/
require_once(BASEPATH.'core/Common.php');
/*
* ------------------------------------------------------
* Security procedures
* ------------------------------------------------------
*/
if ( ! is_php('5.4'))
{
ini_set('magic_quotes_runtime', 0);
if ((bool) ini_get('register_globals'))
{
$_protected = array(
'_SERVER',
'_GET',
'_POST',
'_FILES',
'_REQUEST',
'_SESSION',
'_ENV',
'_COOKIE',
'GLOBALS',
'HTTP_RAW_POST_DATA',
'system_path',
'application_folder',
'view_folder',
'_protected',
'_registered'
);
$_registered = ini_get('variables_order');
foreach (array('E' => '_ENV', 'G' => '_GET', 'P' => '_POST', 'C' => '_COOKIE', 'S' => '_SERVER') as $key => $superglobal)
{
if (strpos($_registered, $key) === FALSE)
{
continue;
}
foreach (array_keys($$superglobal) as $var)
{
if (isset($GLOBALS[$var]) && ! in_array($var, $_protected, TRUE))
{
$GLOBALS[$var] = NULL;
}
}
}
}
}
/*
* ------------------------------------------------------
* Define a custom error handler so we can log PHP errors
* ------------------------------------------------------
*/
set_error_handler('_error_handler');
set_exception_handler('_exception_handler');
register_shutdown_function('_shutdown_handler');
/*
* ------------------------------------------------------
* Set the subclass_prefix
* ------------------------------------------------------
*
* Normally the "subclass_prefix" is set in the config file.
* The subclass prefix allows CI to know if a core class is
* being extended via a library in the local application
* "libraries" folder. Since CI allows config items to be
* overridden via data set in the main index.php file,
* before proceeding we need to know if a subclass_prefix
* override exists. If so, we will set this value now,
* before any classes are loaded
* Note: Since the config file data is cached it doesn't
* hurt to load it here.
*/
if ( ! empty($assign_to_config['subclass_prefix']))
{
get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix']));
}
/*
* ------------------------------------------------------
* Should we use a Composer autoloader?
* ------------------------------------------------------
*/
if ($composer_autoload = config_item('composer_autoload'))
{
if ($composer_autoload === TRUE)
{
file_exists(APPPATH.'vendor/autoload.php')
? require_once(APPPATH.'vendor/autoload.php')
: log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.');
}
elseif (file_exists($composer_autoload))
{
require_once($composer_autoload);
}
else
{
log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload);
}
}
/*
* ------------------------------------------------------
* Start the timer... tick tock tick tock...
* ------------------------------------------------------
*/
$BM =& load_class('Benchmark', 'core');
$BM->mark('total_execution_time_start');
$BM->mark('loading_time:_base_classes_start');
/*
* ------------------------------------------------------
* Instantiate the hooks class
* ------------------------------------------------------
*/
$EXT =& load_class('Hooks', 'core');
/*
* ------------------------------------------------------
* Is there a "pre_system" hook?
* ------------------------------------------------------
*/
$EXT->call_hook('pre_system');
/*
* ------------------------------------------------------
* Instantiate the config class
* ------------------------------------------------------
*
* Note: It is important that Config is loaded first as
* most other classes depend on it either directly or by
* depending on another class that uses it.
*
*/
$CFG =& load_class('Config', 'core');
// Do we have any manually set config items in the index.php file?
if (isset($assign_to_config) && is_array($assign_to_config))
{
foreach ($assign_to_config as $key => $value)
{
$CFG->set_item($key, $value);
}
}
/*
* ------------------------------------------------------
* Important charset-related stuff
* ------------------------------------------------------
*
* Configure mbstring and/or iconv if they are enabled
* and set MB_ENABLED and ICONV_ENABLED constants, so
* that we don't repeatedly do extension_loaded() or
* function_exists() calls.
*
* Note: UTF-8 class depends on this. It used to be done
* in it's constructor, but it's _not_ class-specific.
*
*/
$charset = strtoupper(config_item('charset'));
ini_set('default_charset', $charset);
if (extension_loaded('mbstring'))
{
define('MB_ENABLED', TRUE);
// mbstring.internal_encoding is deprecated starting with PHP 5.6
// and it's usage triggers E_DEPRECATED messages.
@ini_set('mbstring.internal_encoding', $charset);
// This is required for mb_convert_encoding() to strip invalid characters.
// That's utilized by CI_Utf8, but it's also done for consistency with iconv.
mb_substitute_character('none');
}
else
{
define('MB_ENABLED', FALSE);
}
// There's an ICONV_IMPL constant, but the PHP manual says that using
// iconv's predefined constants is "strongly discouraged".
if (extension_loaded('iconv'))
{
define('ICONV_ENABLED', TRUE);
// iconv.internal_encoding is deprecated starting with PHP 5.6
// and it's usage triggers E_DEPRECATED messages.
@ini_set('iconv.internal_encoding', $charset);
}
else
{
define('ICONV_ENABLED', FALSE);
}
if (is_php('5.6'))
{
ini_set('php.internal_encoding', $charset);
}
/*
* ------------------------------------------------------
* Load compatibility features
* ------------------------------------------------------
*/
require_once(BASEPATH.'core/compat/mbstring.php');
require_once(BASEPATH.'core/compat/hash.php');
require_once(BASEPATH.'core/compat/password.php');
require_once(BASEPATH.'core/compat/standard.php');
/*
* ------------------------------------------------------
* Instantiate the UTF-8 class
* ------------------------------------------------------
*/
$UNI =& load_class('Utf8', 'core');
/*
* ------------------------------------------------------
* Instantiate the URI class
* ------------------------------------------------------
*/
$URI =& load_class('URI', 'core');
/*
* ------------------------------------------------------
* Instantiate the routing class and set the routing
* ------------------------------------------------------
*/
$RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL);
/*
* ------------------------------------------------------
* Instantiate the output class
* ------------------------------------------------------
*/
$OUT =& load_class('Output', 'core');
/*
* ------------------------------------------------------
* Is there a valid cache file? If so, we're done...
* ------------------------------------------------------
*/
if ($EXT->call_hook('cache_override') === FALSE && $OUT->_display_cache($CFG, $URI) === TRUE)
{
exit;
}
/*
* -----------------------------------------------------
* Load the security class for xss and csrf support
* -----------------------------------------------------
*/
$SEC =& load_class('Security', 'core');
/*
* ------------------------------------------------------
* Load the Input class and sanitize globals
* ------------------------------------------------------
*/
$IN =& load_class('Input', 'core');
/*
* ------------------------------------------------------
* Load the Language class
* ------------------------------------------------------
*/
$LANG =& load_class('Lang', 'core');
/*
* ------------------------------------------------------
* Load the app controller and local controller
* ------------------------------------------------------
*
*/
// Load the base controller class
require_once BASEPATH.'core/Controller.php';
/**
* Reference to the CI_Controller method.
*
* Returns current CI instance object
*
* @return CI_Controller
*/
function &get_instance()
{
return CI_Controller::get_instance();
}
if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'))
{
require_once APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php';
}
// Set a mark point for benchmarking
$BM->mark('loading_time:_base_classes_end');
/*
* ------------------------------------------------------
* Sanity checks
* ------------------------------------------------------
*
* The Router class has already validated the request,
* leaving us with 3 options here:
*
* 1) an empty class name, if we reached the default
* controller, but it didn't exist;
* 2) a query string which doesn't go through a
* file_exists() check
* 3) a regular request for a non-existing page
*
* We handle all of these as a 404 error.
*
* Furthermore, none of the methods in the app controller
* or the loader class can be called via the URI, nor can
* controller methods that begin with an underscore.
*/
$e404 = FALSE;
$class = ucfirst($RTR->class);
$method = $RTR->method;
if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
{
$e404 = TRUE;
}
else
{
require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
{
$e404 = TRUE;
}
elseif (method_exists($class, '_remap'))
{
$params = array($method, array_slice($URI->rsegments, 2));
$method = '_remap';
}
// WARNING: It appears that there are issues with is_callable() even in PHP 5.2!
// Furthermore, there are bug reports and feature/change requests related to it
// that make it unreliable to use in this context. Please, DO NOT change this
// work-around until a better alternative is available.
elseif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE))
{
$e404 = TRUE;
}
}
if ($e404)
{
if ( ! empty($RTR->routes['404_override']))
{
if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $error_class, $error_method) !== 2)
{
$error_method = 'index';
}
$error_class = ucfirst($error_class);
if ( ! class_exists($error_class, FALSE))
{
if (file_exists(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php'))
{
require_once(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php');
$e404 = ! class_exists($error_class, FALSE);
}
// Were we in a directory? If so, check for a global override
elseif ( ! empty($RTR->directory) && file_exists(APPPATH.'controllers/'.$error_class.'.php'))
{
require_once(APPPATH.'controllers/'.$error_class.'.php');
if (($e404 = ! class_exists($error_class, FALSE)) === FALSE)
{
$RTR->directory = '';
}
}
}
else
{
$e404 = FALSE;
}
}
// Did we reset the $e404 flag? If so, set the rsegments, starting from index 1
if ( ! $e404)
{
$class = $error_class;
$method = $error_method;
$URI->rsegments = array(
1 => $class,
2 => $method
);
}
else
{
show_404($RTR->directory.$class.'/'.$method);
}
}
if ($method !== '_remap')
{
$params = array_slice($URI->rsegments, 2);
}
/*
* ------------------------------------------------------
* Is there a "pre_controller" hook?
* ------------------------------------------------------
*/
$EXT->call_hook('pre_controller');
/*
* ------------------------------------------------------
* Instantiate the requested controller
* ------------------------------------------------------
*/
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class();
/*
* ------------------------------------------------------
* Is there a "post_controller_constructor" hook?
* ------------------------------------------------------
*/
$EXT->call_hook('post_controller_constructor');
/*
* ------------------------------------------------------
* Call the requested method
* ------------------------------------------------------
*/
call_user_func_array(array(&$CI, $method), $params);
// Mark a benchmark end point
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
/*
* ------------------------------------------------------
* Is there a "post_controller" hook?
* ------------------------------------------------------
*/
$EXT->call_hook('post_controller');
/*
* ------------------------------------------------------
* Send the final rendered output to the browser
* ------------------------------------------------------
*/
if ($EXT->call_hook('display_override') === FALSE)
{
$OUT->_display();
}
/*
* ------------------------------------------------------
* Is there a "post_system" hook?
* ------------------------------------------------------
*/
$EXT->call_hook('post_system');
| diccionariolsm/diccionario | system/core/CodeIgniter.php | PHP | mit | 15,615 |
YUI.add('clickable-rail', function(Y) {
/**
* Adds support for mouse interaction with the Slider rail triggering thumb
* movement.
*
* @module slider
* @submodule clickable-rail
*/
/**
* Slider extension that allows clicking on the Slider's rail element,
* triggering the thumb to align with the location of the click.
*
* @class ClickableRail
*/
function ClickableRail() {
this._initClickableRail();
}
Y.ClickableRail = Y.mix(ClickableRail, {
// Prototype methods added to host class
prototype: {
/**
* Initializes the internal state and sets up events.
*
* @method _initClickableRail
* @protected
*/
_initClickableRail: function () {
this._evtGuid = this._evtGuid || (Y.guid() + '|');
/**
* Broadcasts when the rail has received a mousedown event and
* triggers the thumb positioning. Use
* <code>e.preventDefault()</code> or
* <code>set("clickableRail", false)</code> to prevent
* the thumb positioning.
*
* @event railMouseDown
* @preventable _defRailMouseDownFn
*/
this.publish('railMouseDown', {
defaultFn: this._defRailMouseDownFn
});
this.after('render', this._bindClickableRail);
this.on('destroy', this._unbindClickableRail);
},
/**
* Attaches DOM event subscribers to support rail interaction.
*
* @method _bindClickableRail
* @protected
*/
_bindClickableRail: function () {
this._dd.addHandle(this.rail);
this.rail.on(this._evtGuid + Y.DD.Drag.START_EVENT,
Y.bind(this._onRailMouseDown, this));
},
/**
* Detaches DOM event subscribers for cleanup/destruction cycle.
*
* @method _unbindClickableRail
* @protected
*/
_unbindClickableRail: function () {
if (this.get('rendered')) {
var contentBox = this.get('contentBox'),
rail = contentBox.one('.' + this.getClassName('rail'));
rail.detach(this.evtGuid + '*');
}
},
/**
* Dispatches the railMouseDown event.
*
* @method _onRailMouseDown
* @param e {DOMEvent} the mousedown event object
* @protected
*/
_onRailMouseDown: function (e) {
if (this.get('clickableRail') && !this.get('disabled')) {
this.fire('railMouseDown', { ev: e });
}
},
/**
* Default behavior for the railMouseDown event. Centers the thumb at
* the click location and passes control to the DDM to behave as though
* the thumb itself were clicked in preparation for a drag operation.
*
* @method _defRailMouseDownFn
* @param e {Event} the EventFacade for the railMouseDown custom event
* @protected
*/
_defRailMouseDownFn: function (e) {
e = e.ev;
// Logic that determines which thumb should be used is abstracted
// to someday support multi-thumb sliders
var dd = this._resolveThumb(e),
i = this._key.xyIndex,
length = parseFloat(this.get('length'), 10),
thumb,
thumbSize,
xy;
if (dd) {
thumb = dd.get('dragNode');
thumbSize = parseFloat(thumb.getStyle(this._key.dim), 10);
// Step 1. Allow for aligning to thumb center or edge, etc
xy = this._getThumbDestination(e, thumb);
// Step 2. Remove page offsets to give just top/left style val
xy = xy[ i ] - this.rail.getXY()[i];
// Step 3. Constrain within the rail in case of attempt to
// center the thumb when clicking on the end of the rail
xy = Math.min(
Math.max(xy, 0),
(length - thumbSize));
this._uiMoveThumb(xy);
// Set e.target for DD's IE9 patch which calls
// e.target._node.setCapture() to allow imgs to be dragged.
// Without this, setCapture is called from the rail and rail
// clicks on other Sliders may have their thumb movements
// overridden by a different Slider (the thumb on the wrong
// Slider moves).
e.target = this.thumb.one('img') || this.thumb;
// Delegate to DD's natural behavior
dd._handleMouseDownEvent(e);
// TODO: this won't trigger a slideEnd if the rail is clicked
// check if dd._move(e); dd._dragThreshMet = true; dd.start();
// will do the trick. Is that even a good idea?
}
},
/**
* Resolves which thumb to actuate if any. Override this if you want to
* support multiple thumbs. By default, returns the Drag instance for
* the thumb stored by the Slider.
*
* @method _resolveThumb
* @param e {DOMEvent} the mousedown event object
* @return {DD.Drag} the Drag instance that should be moved
* @protected
*/
_resolveThumb: function (e) {
/* Temporary workaround
var primaryOnly = this._dd.get('primaryButtonOnly'),
validClick = !primaryOnly || e.button <= 1;
return (validClick) ? this._dd : null;
*/
return this._dd;
},
/**
* Calculates the top left position the thumb should be moved to to
* align the click XY with the center of the specified node.
*
* @method _getThumbDestination
* @param e {DOMEvent} The mousedown event object
* @param node {Node} The node to position
* @return {Array} the [top, left] pixel position of the destination
* @protected
*/
_getThumbDestination: function (e, node) {
var offsetWidth = node.get('offsetWidth'),
offsetHeight = node.get('offsetHeight');
// center
return [
(e.pageX - Math.round((offsetWidth / 2))),
(e.pageY - Math.round((offsetHeight / 2)))
];
}
},
// Static properties added onto host class
ATTRS: {
/**
* Enable or disable clickable rail support.
*
* @attribute clickableRail
* @type {Boolean}
* @default true
*/
clickableRail: {
value: true,
validator: Y.Lang.isBoolean
}
}
}, true);
}, '@VERSION@' ,{requires:['slider-base']});
| gaearon/cdnjs | ajax/libs/yui/3.4.1pr1/clickable-rail/clickable-rail.js | JavaScript | mit | 6,988 |
YUI.add('handlebars-base', function (Y, NAME) {
/*!
Handlebars.js - Copyright (C) 2011 Yehuda Katz
https://raw.github.com/wycats/handlebars.js/master/LICENSE
*/
/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */
// BEGIN(BROWSER)
/*jshint eqnull:true*/
var Handlebars = {};
Handlebars.VERSION = "1.0.beta.5";
Handlebars.helpers = {};
Handlebars.partials = {};
Handlebars.registerHelper = function(name, fn, inverse) {
if(inverse) { fn.not = inverse; }
this.helpers[name] = fn;
};
Handlebars.registerPartial = function(name, str) {
this.partials[name] = str;
};
Handlebars.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
throw new Error("Could not find property '" + arg + "'");
}
});
var toString = Object.prototype.toString, functionType = "[object Function]";
Handlebars.registerHelper('blockHelperMissing', function(context, options) {
var inverse = options.inverse || function() {}, fn = options.fn;
var ret = "";
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
if(context === true) {
return fn(this);
} else if(context === false || context == null) {
return inverse(this);
} else if(type === "[object Array]") {
if(context.length > 0) {
for(var i=0, j=context.length; i<j; i++) {
ret = ret + fn(context[i]);
}
} else {
ret = inverse(this);
}
return ret;
} else {
return fn(context);
}
});
Handlebars.registerHelper('each', function(context, options) {
var fn = options.fn, inverse = options.inverse;
var ret = "";
if(context && context.length > 0) {
for(var i=0, j=context.length; i<j; i++) {
ret = ret + fn(context[i]);
}
} else {
ret = inverse(this);
}
return ret;
});
Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
if(!context || Handlebars.Utils.isEmpty(context)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
Handlebars.registerHelper('unless', function(context, options) {
var fn = options.fn, inverse = options.inverse;
options.fn = inverse;
options.inverse = fn;
return Handlebars.helpers['if'].call(this, context, options);
});
Handlebars.registerHelper('with', function(context, options) {
return options.fn(context);
});
Handlebars.registerHelper('log', function(context) {
Handlebars.log(context);
});
// END(BROWSER)
// This file provides a YUI-specific implementation of Handlebars' lib/utils.js
// file. Handlebars unfortunately creates enclosed references to its utils, so
// we have to maintain a complete fork of this file rather than just overriding
// specific parts.
var Lang = Y.Lang;
Handlebars.Exception = function (message) {
var error = Error.prototype.constructor.apply(this, arguments),
key;
for (key in error) {
if (error.hasOwnProperty(key)) {
this[key] = error[key];
}
}
this.message = error.message;
};
Handlebars.Exception.prototype = new Error();
Handlebars.SafeString = function (string) {
this.string = string;
};
Handlebars.SafeString.prototype.toString = function () {
return this.string.toString();
};
Handlebars.Utils = {
escapeExpression: function (string) {
// Skip escaping for empty strings.
if (string === '') {
return string;
}
// Don't escape SafeStrings, since they're already (presumed to be)
// safe.
if (string instanceof Handlebars.SafeString) {
return string.toString();
} else if (string === false || !Lang.isValue(string)) {
return '';
}
// Unlike Handlebars' escaping implementation, Y.Escape.html() will
// double-escape existing & entities. This seems much less
// surprising than avoiding double-escaping, especially since
// a lack of double-escaping would make it impossible to use Handlebars
// for things like displaying escaped code snippets.
return Y.Escape.html(string);
},
isEmpty: function (value) {
if (value === false
|| !Lang.isValue(value)
|| (Lang.isArray(value) && !value.length)) {
return true;
}
return false;
}
};
/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */
// BEGIN(BROWSER)
Handlebars.VM = {
template: function(templateSpec) {
// Just add water
var container = {
escapeExpression: Handlebars.Utils.escapeExpression,
invokePartial: Handlebars.VM.invokePartial,
programs: [],
program: function(i, fn, data) {
var programWrapper = this.programs[i];
if(data) {
return Handlebars.VM.program(fn, data);
} else if(programWrapper) {
return programWrapper;
} else {
programWrapper = this.programs[i] = Handlebars.VM.program(fn);
return programWrapper;
}
},
programWithDepth: Handlebars.VM.programWithDepth,
noop: Handlebars.VM.noop
};
return function(context, options) {
options = options || {};
return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
};
},
programWithDepth: function(fn, data, $depth) {
var args = Array.prototype.slice.call(arguments, 2);
return function(context, options) {
options = options || {};
return fn.apply(this, [context, options.data || data].concat(args));
};
},
program: function(fn, data) {
return function(context, options) {
options = options || {};
return fn(context, options.data || data);
};
},
noop: function() { return ""; },
invokePartial: function(partial, name, context, helpers, partials, data) {
var options = { helpers: helpers, partials: partials, data: data };
if(partial === undefined) {
throw new Handlebars.Exception("The partial " + name + " could not be found");
} else if(partial instanceof Function) {
return partial(context, options);
} else if (!Handlebars.compile) {
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
} else {
partials[name] = Handlebars.compile(partial);
return partials[name](context, options);
}
}
};
Handlebars.template = Handlebars.VM.template;
// END(BROWSER)
// This file contains YUI-specific wrapper code and overrides for the
// handlebars-base module.
/**
Handlebars is a simple template language inspired by Mustache.
This is a YUI port of the original Handlebars project, which can be found at
<https://github.com/wycats/handlebars.js>.
@module handlebars
@main handlebars
@since 3.5.0
*/
/**
Provides basic Handlebars template rendering functionality. Use this module when
you only need to render pre-compiled templates.
@module handlebars
@submodule handlebars-base
*/
/**
Handlebars is a simple template language inspired by Mustache.
This is a YUI port of the original Handlebars project, which can be found at
<https://github.com/wycats/handlebars.js>.
@class Handlebars
@since 3.5.0
*/
Y.Handlebars = Handlebars;
Handlebars.VERSION += '-yui';
/**
Registers a helper function that will be made available to all templates.
Helper functions receive the current template context as the `this` object, and
can also receive arguments passed by the template.
@example
Y.Handlebars.registerHelper('linkify', function () {
return '<a href="' + Y.Escape.html(this.url) + '">' +
Y.Escape.html(this.text) + '</a>';
});
var source = '<ul>{{#links}}<li>{{{linkify}}}</li>{{/links}}</ul>';
Y.Handlebars.render(source, {
links: [
{url: '/foo', text: 'Foo'},
{url: '/bar', text: 'Bar'},
{url: '/baz', text: 'Baz'}
]
});
@method registerHelper
@param {String} name Name of this helper.
@param {Function} fn Helper function.
@param {Boolean} [inverse=false] If `true`, this helper will be considered an
"inverse" helper, like "unless". This means it will only be called if the
expression given in the template evaluates to a false or empty value.
*/
/**
Registers a partial that will be made available to all templates.
A partial is another template that can be used to render part of a larger
template. For example, a website with a common header and footer across all its
pages might use a template for each page, which would call shared partials to
render the headers and footers.
Partials may be specified as uncompiled template strings or as compiled template
functions.
@example
Y.Handlebars.registerPartial('header', '<h1>{{title}}</h1>');
Y.Handlebars.registerPartial('footer', 'Copyright (c) 2011 by Me.');
var source = '{{> header}} <p>Mustaches are awesome!</p> {{> footer}}';
Y.Handlebars.render(source, {title: 'My Page About Mustaches'});
@method registerPartial
@param {String} name Name of this partial.
@param {Function|String} partial Template string or compiled template function.
*/
/**
Converts a precompiled template into a renderable template function.
@example
<script src="precompiled-template.js"></script>
<script>
YUI().use('handlebars-base', function (Y) {
// Convert the precompiled template function into a renderable template
// function.
var template = Y.Handlebars.template(precompiledTemplate);
// Render it.
template({pie: 'Pumpkin'});
});
</script>
@method template
@param {Function} template Precompiled Handlebars template function.
@return {Function} Compiled template function.
*/
// Alias for Y.Handlebars.template(), used by Y.Template.
Handlebars.revive = Handlebars.template;
// Make Y.Template.Handlebars an alias for Y.Handlebars.
Y.namespace('Template').Handlebars = Handlebars;
}, '@VERSION@', {"requires": ["escape"]});
| KOLANICH/cdnjs | ajax/libs/yui/3.8.0/handlebars-base/handlebars-base-debug.js | JavaScript | mit | 10,076 |
/*
AngularJS v1.2.10
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(v,k,t){'use strict';k.module("ngAnimate",["ng"]).factory("$$animateReflow",["$window","$timeout",function(k,B){var d=k.requestAnimationFrame||k.webkitRequestAnimationFrame||function(d){return B(d,10,!1)},q=k.cancelAnimationFrame||k.webkitCancelAnimationFrame||function(d){return B.cancel(d)};return function(p){var k=d(p);return function(){q(k)}}}]).config(["$provide","$animateProvider",function(R,B){function d(d){for(var k=0;k<d.length;k++){var p=d[k];if(p.nodeType==X)return p}}var q=k.noop,
p=k.forEach,$=B.$$selectors,X=1,l="$$ngAnimateState",K="ng-animate",m={running:!0};R.decorator("$animate",["$delegate","$injector","$sniffer","$rootElement","$timeout","$rootScope","$document",function(C,v,t,H,y,w,N){function I(a){if(a){var g=[],e={};a=a.substr(1).split(".");(t.transitions||t.animations)&&a.push("");for(var c=0;c<a.length;c++){var f=a[c],d=$[f];d&&!e[f]&&(g.push(v.get(d)),e[f]=!0)}return g}}function r(a,g,e,c,f,k,m){function t(a){n();if(!0===a)z();else{if(a=e.data(l))a.done=z,e.data(l,
a);C(D,"after",z)}}function C(c,d,f){"after"==d?r():E();var k=d+"End";p(c,function(b,aa){var h=function(){a:{var b=d+"Complete",a=c[aa];a[b]=!0;(a[k]||q)();for(a=0;a<c.length;a++)if(!c[a][b])break a;f()}};"before"!=d||"enter"!=a&&"move"!=a?b[d]?b[k]=u?b[d](e,g,h):b[d](e,h):h():h()})}function w(c){e.triggerHandler("$animate:"+c,{event:a,className:g})}function E(){y(function(){w("before")},0,!1)}function r(){y(function(){w("after")},0,!1)}function v(){y(function(){w("close");m&&m()},0,!1)}function n(){n.hasBeenRun||
(n.hasBeenRun=!0,k())}function z(){if(!z.hasBeenRun){z.hasBeenRun=!0;var a=e.data(l);a&&(u?A(e):(a.closeAnimationTimeout=y(function(){A(e)},0,!1),e.data(l,a)));v()}}var s,x,G=d(e);G&&(s=G.className,x=s+" "+g);if(G&&L(x)){x=(" "+x).replace(/\s+/g,".");c||(c=f?f.parent():e.parent());x=I(x);var u="addClass"==a||"removeClass"==a;f=e.data(l)||{};if(ba(e,c)||0===x.length)n(),E(),r(),z();else{var D=[];u&&(f.disabled||f.running&&f.structural)||p(x,function(c){if(!c.allowCancel||c.allowCancel(e,a,g)){var d=
c[a];"leave"==a?(c=d,d=null):c=c["before"+a.charAt(0).toUpperCase()+a.substr(1)];D.push({before:c,after:d})}});0===D.length?(n(),E(),r(),v()):(c=" "+s+" ",f.running&&(y.cancel(f.closeAnimationTimeout),A(e),J(f.animations),x=(s=u&&!f.structural)&&f.className==g&&a!=f.event,f.beforeComplete||x?(f.done||q)(!0):s&&(c="removeClass"==f.event?c.replace(" "+f.className+" "," "):c+f.className+" ")),s=" "+g+" ","addClass"==a&&0<=c.indexOf(s)||"removeClass"==a&&-1==c.indexOf(s)?(n(),E(),r(),v()):(e.addClass(K),
e.data(l,{running:!0,event:a,className:g,structural:!u,animations:D,done:t}),C(D,"before",t)))}}else n(),E(),r(),z()}function Q(a){a=d(a);p(a.querySelectorAll("."+K),function(a){a=k.element(a);var e=a.data(l);e&&(J(e.animations),A(a))})}function J(a){p(a,function(a){a.beforeComplete||(a.beforeEnd||q)(!0);a.afterComplete||(a.afterEnd||q)(!0)})}function A(a){d(a)==d(H)?m.disabled||(m.running=!1,m.structural=!1):(a.removeClass(K),a.removeData(l))}function ba(a,g){if(m.disabled)return!0;if(d(a)==d(H))return m.disabled||
m.running;do{if(0===g.length)break;var e=d(g)==d(H),c=e?m:g.data(l),c=c&&(!!c.disabled||!!c.running);if(e||c)return c;if(e)break}while(g=g.parent());return!0}H.data(l,m);w.$$postDigest(function(){w.$$postDigest(function(){m.running=!1})});var M=B.classNameFilter(),L=M?function(a){return M.test(a)}:function(){return!0};return{enter:function(a,d,e,c){this.enabled(!1,a);C.enter(a,d,e);w.$$postDigest(function(){r("enter","ng-enter",a,d,e,q,c)})},leave:function(a,d){Q(a);this.enabled(!1,a);w.$$postDigest(function(){r("leave",
"ng-leave",a,null,null,function(){C.leave(a)},d)})},move:function(a,d,e,c){Q(a);this.enabled(!1,a);C.move(a,d,e);w.$$postDigest(function(){r("move","ng-move",a,d,e,q,c)})},addClass:function(a,d,e){r("addClass",d,a,null,null,function(){C.addClass(a,d)},e)},removeClass:function(a,d,e){r("removeClass",d,a,null,null,function(){C.removeClass(a,d)},e)},enabled:function(a,d){switch(arguments.length){case 2:if(a)A(d);else{var e=d.data(l)||{};e.disabled=!0;d.data(l,e)}break;case 1:m.disabled=!a;break;default:a=
!m.disabled}return!!a}}}]);B.register("",["$window","$sniffer","$timeout","$$animateReflow",function(m,l,B,H){function y(b,a){O&&O();U.push(a);var h=d(b);b=k.element(h);V.push(b);var h=b.data(n),c=h.stagger,c=h.itemIndex*(Math.max(c.animationDelay,c.transitionDelay)||0);P=Math.max(P,(c+(h.maxDelay+h.maxDuration)*s)*x);h.animationCount=G;O=H(function(){p(U,function(b){b()});var b=[],a=G;p(V,function(a){b.push(a)});B(function(){w(b,a);b=null},P,!1);U=[];V=[];O=null;u={};P=0;G++})}function w(b,a){p(b,
function(b){(b=b.data(n))&&b.animationCount==a&&(b.closeAnimationFn||q)()})}function N(b,a){var h=a?u[a]:null;if(!h){var d=0,c=0,e=0,k=0,g,n,l,r;p(b,function(b){if(b.nodeType==X){b=m.getComputedStyle(b)||{};l=b[f+Y];d=Math.max(I(l),d);r=b[f+W];g=b[f+E];c=Math.max(I(g),c);n=b[F+E];k=Math.max(I(n),k);var a=I(b[F+Y]);0<a&&(a*=parseInt(b[F+R],10)||1);e=Math.max(a,e)}});h={total:0,transitionPropertyStyle:r,transitionDurationStyle:l,transitionDelayStyle:g,transitionDelay:c,transitionDuration:d,animationDelayStyle:n,
animationDelay:k,animationDuration:e};a&&(u[a]=h)}return h}function I(b){var a=0;b=k.isString(b)?b.split(/\s*,\s*/):[];p(b,function(b){a=Math.max(parseFloat(b)||0,a)});return a}function r(b){var a=b.parent(),h=a.data(Z);h||(a.data(Z,++D),h=D);return h+"-"+d(b).className}function Q(b,a,h){var c=r(b),e=c+" "+a,k={},g=u[e]?++u[e].total:0;if(0<g){var l=a+"-stagger",k=c+" "+l;(c=!u[k])&&b.addClass(l);k=N(b,k);c&&b.removeClass(l)}h=h||function(b){return b()};b.addClass(a);h=h(function(){return N(b,e)});
l=Math.max(h.transitionDelay,h.animationDelay);c=Math.max(h.transitionDuration,h.animationDuration);if(0===c)return b.removeClass(a),!1;var m="";0<h.transitionDuration?d(b).style[f+W]="none":d(b).style[F]="none 0s";p(a.split(" "),function(b,a){m+=(0<a?" ":"")+b+"-active"});b.data(n,{className:a,activeClassName:m,maxDuration:c,maxDelay:l,classes:a+" "+m,timings:h,stagger:k,itemIndex:g});return!0}function J(b){var a=f+W;b=d(b);b.style[a]&&0<b.style[a].length&&(b.style[a]="")}function A(b){var a=F;b=
d(b);b.style[a]&&0<b.style[a].length&&(b.style[a]="")}function K(b,a,h){function e(c){b.off(v,k);b.removeClass(r);c=b;c.removeClass(a);c.removeData(n);c=d(b);for(var h in s)c.style.removeProperty(s[h])}function k(b){b.stopPropagation();var a=b.originalEvent||b;b=a.$manualTimeStamp||a.timeStamp||Date.now();a=parseFloat(a.elapsedTime.toFixed(z));Math.max(b-w,0)>=u&&a>=p&&h()}var f=b.data(n),g=d(b);if(-1!=g.className.indexOf(a)&&f){var l=f.timings,m=f.stagger,p=f.maxDuration,r=f.activeClassName,u=Math.max(l.transitionDelay,
l.animationDelay)*x,w=Date.now(),v=T+" "+S,t=f.itemIndex,q="",s=[];if(0<l.transitionDuration){var y=l.transitionPropertyStyle;-1==y.indexOf("all")&&(q+=c+"transition-property: "+y+";",q+=c+"transition-duration: "+l.transitionDurationStyle+";",s.push(c+"transition-property"),s.push(c+"transition-duration"))}0<t&&(0<m.transitionDelay&&0===m.transitionDuration&&(q+=c+"transition-delay: "+M(l.transitionDelayStyle,m.transitionDelay,t)+"; ",s.push(c+"transition-delay")),0<m.animationDelay&&0===m.animationDuration&&
(q+=c+"animation-delay: "+M(l.animationDelayStyle,m.animationDelay,t)+"; ",s.push(c+"animation-delay")));0<s.length&&(l=g.getAttribute("style")||"",g.setAttribute("style",l+" "+q));b.on(v,k);b.addClass(r);f.closeAnimationFn=function(){e();h()};return e}h()}function M(b,a,c){var d="";p(b.split(","),function(b,e){d+=(0<e?",":"")+(c*a+parseInt(b,10))+"s"});return d}function L(b,a,c){if(Q(b,a,c))return function(c){c&&(b.removeClass(a),b.removeData(n))}}function a(a,c,d){if(a.data(n))return K(a,c,d);a.removeClass(c);
a.removeData(n);d()}function g(b,c,d){var e=L(b,c);if(e){var f=e;y(b,function(){J(b);A(b);f=a(b,c,d)});return function(a){(f||q)(a)}}d()}function e(a,c){var d="";a=k.isArray(a)?a:a.split(/\s+/);p(a,function(a,b){a&&0<a.length&&(d+=(0<b?" ":"")+a+c)});return d}var c="",f,S,F,T;v.ontransitionend===t&&v.onwebkittransitionend!==t?(c="-webkit-",f="WebkitTransition",S="webkitTransitionEnd transitionend"):(f="transition",S="transitionend");v.onanimationend===t&&v.onwebkitanimationend!==t?(c="-webkit-",F=
"WebkitAnimation",T="webkitAnimationEnd animationend"):(F="animation",T="animationend");var Y="Duration",W="Property",E="Delay",R="IterationCount",Z="$$ngAnimateKey",n="$$ngAnimateCSS3Data",z=3,s=1.5,x=1E3,G=0,u={},D=0,U=[],V=[],O,P=0;return{allowCancel:function(a,c,h){var f=(a.data(n)||{}).classes;if(!f||0<=["enter","leave","move"].indexOf(c))return!0;var l=a.parent(),g=k.element(d(a).cloneNode());g.attr("style","position:absolute; top:-9999px; left:-9999px");g.removeAttr("id");g.empty();p(f.split(" "),
function(a){g.removeClass(a)});g.addClass(e(h,"addClass"==c?"-add":"-remove"));l.append(g);a=N(g);g.remove();return 0<Math.max(a.transitionDuration,a.animationDuration)},enter:function(a,c){return g(a,"ng-enter",c)},leave:function(a,c){return g(a,"ng-leave",c)},move:function(a,c){return g(a,"ng-move",c)},beforeAddClass:function(a,c,d){var f=L(a,e(c,"-add"),function(d){a.addClass(c);d=d();a.removeClass(c);return d});if(f)return y(a,function(){J(a);A(a);d()}),f;d()},addClass:function(b,c,d){return a(b,
e(c,"-add"),d)},beforeRemoveClass:function(a,c,d){var f=L(a,e(c,"-remove"),function(d){var e=a.attr("class");a.removeClass(c);d=d();a.attr("class",e);return d});if(f)return y(a,function(){J(a);A(a);d()}),f;d()},removeClass:function(b,c,d){return a(b,e(c,"-remove"),d)}}}])}])})(window,window.angular);
//# sourceMappingURL=angular-animate.min.js.map
| leebyron/jsdelivr | files/angularjs/1.2.10/angular-animate.min.js | JavaScript | mit | 9,644 |
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/plugin/plugin.js']) {
__coverage__['build/plugin/plugin.js'] = {"path":"build/plugin/plugin.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}},"2":{"name":"Plugin","line":16,"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":28}}},"3":{"name":"(anonymous_3)","line":85,"loc":{"start":{"line":85,"column":22},"end":{"line":85,"column":39}}},"4":{"name":"(anonymous_4)","line":96,"loc":{"start":{"line":96,"column":20},"end":{"line":96,"column":31}}},"5":{"name":"(anonymous_5)","line":116,"loc":{"start":{"line":116,"column":18},"end":{"line":116,"column":51}}},"6":{"name":"(anonymous_6)","line":139,"loc":{"start":{"line":139,"column":17},"end":{"line":139,"column":50}}},"7":{"name":"(anonymous_7)","line":162,"loc":{"start":{"line":162,"column":22},"end":{"line":162,"column":50}}},"8":{"name":"(anonymous_8)","line":179,"loc":{"start":{"line":179,"column":25},"end":{"line":179,"column":53}}},"9":{"name":"(anonymous_9)","line":196,"loc":{"start":{"line":196,"column":27},"end":{"line":196,"column":60}}},"10":{"name":"(anonymous_10)","line":213,"loc":{"start":{"line":213,"column":26},"end":{"line":213,"column":59}}},"11":{"name":"(anonymous_11)","line":219,"loc":{"start":{"line":219,"column":18},"end":{"line":219,"column":29}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":227,"column":45}},"2":{"start":{"line":16,"column":4},"end":{"line":22,"column":5}},"3":{"start":{"line":17,"column":8},"end":{"line":21,"column":9}},"4":{"start":{"line":18,"column":12},"end":{"line":18,"column":65}},"5":{"start":{"line":20,"column":12},"end":{"line":20,"column":64}},"6":{"start":{"line":31,"column":4},"end":{"line":43,"column":6}},"7":{"start":{"line":53,"column":4},"end":{"line":53,"column":27}},"8":{"start":{"line":64,"column":4},"end":{"line":64,"column":25}},"9":{"start":{"line":66,"column":4},"end":{"line":222,"column":7}},"10":{"start":{"line":86,"column":12},"end":{"line":86,"column":31}},"11":{"start":{"line":98,"column":12},"end":{"line":102,"column":13}},"12":{"start":{"line":99,"column":16},"end":{"line":101,"column":17}},"13":{"start":{"line":100,"column":19},"end":{"line":100,"column":45}},"14":{"start":{"line":117,"column":12},"end":{"line":117,"column":48}},"15":{"start":{"line":119,"column":12},"end":{"line":123,"column":13}},"16":{"start":{"line":120,"column":16},"end":{"line":120,"column":71}},"17":{"start":{"line":121,"column":19},"end":{"line":123,"column":13}},"18":{"start":{"line":122,"column":16},"end":{"line":122,"column":66}},"19":{"start":{"line":125,"column":12},"end":{"line":125,"column":26}},"20":{"start":{"line":140,"column":12},"end":{"line":140,"column":48}},"21":{"start":{"line":142,"column":12},"end":{"line":146,"column":13}},"22":{"start":{"line":143,"column":16},"end":{"line":143,"column":70}},"23":{"start":{"line":144,"column":19},"end":{"line":146,"column":13}},"24":{"start":{"line":145,"column":16},"end":{"line":145,"column":69}},"25":{"start":{"line":148,"column":12},"end":{"line":148,"column":26}},"26":{"start":{"line":163,"column":12},"end":{"line":163,"column":72}},"27":{"start":{"line":164,"column":12},"end":{"line":164,"column":39}},"28":{"start":{"line":165,"column":12},"end":{"line":165,"column":26}},"29":{"start":{"line":180,"column":12},"end":{"line":180,"column":75}},"30":{"start":{"line":181,"column":12},"end":{"line":181,"column":39}},"31":{"start":{"line":182,"column":12},"end":{"line":182,"column":26}},"32":{"start":{"line":197,"column":12},"end":{"line":197,"column":87}},"33":{"start":{"line":198,"column":12},"end":{"line":198,"column":39}},"34":{"start":{"line":199,"column":12},"end":{"line":199,"column":26}},"35":{"start":{"line":214,"column":12},"end":{"line":214,"column":86}},"36":{"start":{"line":215,"column":12},"end":{"line":215,"column":39}},"37":{"start":{"line":216,"column":12},"end":{"line":216,"column":26}},"38":{"start":{"line":220,"column":12},"end":{"line":220,"column":75}},"39":{"start":{"line":224,"column":4},"end":{"line":224,"column":40}}},"branchMap":{"1":{"line":17,"type":"if","locations":[{"start":{"line":17,"column":8},"end":{"line":17,"column":8}},{"start":{"line":17,"column":8},"end":{"line":17,"column":8}}]},"2":{"line":17,"type":"binary-expr","locations":[{"start":{"line":17,"column":15},"end":{"line":17,"column":27}},{"start":{"line":17,"column":31},"end":{"line":17,"column":58}}]},"3":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":12},"end":{"line":98,"column":12}},{"start":{"line":98,"column":12},"end":{"line":98,"column":12}}]},"4":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":12},"end":{"line":119,"column":12}},{"start":{"line":119,"column":12},"end":{"line":119,"column":12}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":19},"end":{"line":121,"column":19}},{"start":{"line":121,"column":19},"end":{"line":121,"column":19}}]},"6":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":12},"end":{"line":142,"column":12}},{"start":{"line":142,"column":12},"end":{"line":142,"column":12}}]},"7":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":19},"end":{"line":144,"column":19}},{"start":{"line":144,"column":19},"end":{"line":144,"column":19}}]},"8":{"line":163,"type":"binary-expr","locations":[{"start":{"line":163,"column":55},"end":{"line":163,"column":62}},{"start":{"line":163,"column":66},"end":{"line":163,"column":70}}]},"9":{"line":180,"type":"binary-expr","locations":[{"start":{"line":180,"column":58},"end":{"line":180,"column":65}},{"start":{"line":180,"column":69},"end":{"line":180,"column":73}}]},"10":{"line":197,"type":"binary-expr","locations":[{"start":{"line":197,"column":70},"end":{"line":197,"column":77}},{"start":{"line":197,"column":81},"end":{"line":197,"column":85}}]},"11":{"line":214,"type":"binary-expr","locations":[{"start":{"line":214,"column":69},"end":{"line":214,"column":76}},{"start":{"line":214,"column":80},"end":{"line":214,"column":84}}]}},"code":["(function () { YUI.add('plugin', function (Y, NAME) {",""," /**"," * Provides the base Plugin class, which plugin developers should extend, when creating custom plugins"," *"," * @module plugin"," */",""," /**"," * The base class for all Plugin instances."," *"," * @class Plugin.Base "," * @extends Base"," * @param {Object} config Configuration object with property name/value pairs."," */"," function Plugin(config) {"," if (! (this.hasImpl && this.hasImpl(Y.Plugin.Base)) ) {"," Plugin.superclass.constructor.apply(this, arguments);"," } else {"," Plugin.prototype.initializer.apply(this, arguments);"," }"," }",""," /**"," * Object defining the set of attributes supported by the Plugin.Base class"," * "," * @property ATTRS"," * @type Object"," * @static"," */"," Plugin.ATTRS = {",""," /**"," * The plugin's host object."," *"," * @attribute host"," * @writeonce"," * @type Plugin.Host"," */"," host : {"," writeOnce: true"," }"," };",""," /**"," * The string identifying the Plugin.Base class. Plugins extending"," * Plugin.Base should set their own NAME value."," *"," * @property NAME"," * @type String"," * @static"," */"," Plugin.NAME = 'plugin';",""," /**"," * The name of the property the the plugin will be attached to"," * when plugged into a Plugin Host. Plugins extending Plugin.Base,"," * should set their own NS value."," *"," * @property NS"," * @type String"," * @static"," */"," Plugin.NS = 'plugin';",""," Y.extend(Plugin, Y.Base, {",""," /**"," * The list of event handles for event listeners or AOP injected methods"," * applied by the plugin to the host object."," *"," * @property _handles"," * @private"," * @type Array"," * @value null"," */"," _handles: null,",""," /**"," * Initializer lifecycle implementation."," *"," * @method initializer"," * @param {Object} config Configuration object with property name/value pairs."," */"," initializer : function(config) {"," this._handles = [];"," },",""," /**"," * Destructor lifecycle implementation."," *"," * Removes any event listeners or injected methods applied by the Plugin"," *"," * @method destructor"," */"," destructor: function() {"," // remove all handles"," if (this._handles) {"," for (var i = 0, l = this._handles.length; i < l; i++) {"," this._handles[i].detach();"," }"," }"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host, "," * or injects code \"before\" a given method on the host."," *"," * @method doBefore"," *"," * @param strMethod {String} The event to listen for, or method to inject logic before."," * @param fn {Function} The handler function. For events, the \"on\" moment listener. For methods, the function to execute before the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the handler."," */"," doBefore: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.beforeHostMethod(strMethod, fn, context);"," } else if (host.on) { // event"," handle = this.onHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host, "," * or injects code \"after\" a given method on the host."," *"," * @method doAfter"," *"," * @param strMethod {String} The event to listen for, or method to inject logic after."," * @param fn {Function} The handler function. For events, the \"after\" moment listener. For methods, the function to execute after the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the listener."," */"," doAfter: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.afterHostMethod(strMethod, fn, context);"," } else if (host.after) { // event"," handle = this.afterHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method onHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," onHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").on(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method afterHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," afterHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").after(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed before a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method beforeHostMethod"," * @param {String} method The name of the method to inject the function before."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," beforeHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.before(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed after a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method afterHostMethod"," * @param {String} method The name of the method to inject the function after."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," afterHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.after(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," toString: function() {"," return this.constructor.NAME + '[' + this.constructor.NS + ']';"," }"," });",""," Y.namespace(\"Plugin\").Base = Plugin;","","","}, '@VERSION@', {\"requires\": [\"base-base\"]});","","}());"]};
}
var __cov_Ou8ktrMRnpDziAawGkzflw = __coverage__['build/plugin/plugin.js'];
__cov_Ou8ktrMRnpDziAawGkzflw.s['1']++;YUI.add('plugin',function(Y,NAME){__cov_Ou8ktrMRnpDziAawGkzflw.f['1']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['2']++;function Plugin(config){__cov_Ou8ktrMRnpDziAawGkzflw.f['2']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['3']++;if(!((__cov_Ou8ktrMRnpDziAawGkzflw.b['2'][0]++,this.hasImpl)&&(__cov_Ou8ktrMRnpDziAawGkzflw.b['2'][1]++,this.hasImpl(Y.Plugin.Base)))){__cov_Ou8ktrMRnpDziAawGkzflw.b['1'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['4']++;Plugin.superclass.constructor.apply(this,arguments);}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['1'][1]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['5']++;Plugin.prototype.initializer.apply(this,arguments);}}__cov_Ou8ktrMRnpDziAawGkzflw.s['6']++;Plugin.ATTRS={host:{writeOnce:true}};__cov_Ou8ktrMRnpDziAawGkzflw.s['7']++;Plugin.NAME='plugin';__cov_Ou8ktrMRnpDziAawGkzflw.s['8']++;Plugin.NS='plugin';__cov_Ou8ktrMRnpDziAawGkzflw.s['9']++;Y.extend(Plugin,Y.Base,{_handles:null,initializer:function(config){__cov_Ou8ktrMRnpDziAawGkzflw.f['3']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['10']++;this._handles=[];},destructor:function(){__cov_Ou8ktrMRnpDziAawGkzflw.f['4']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['11']++;if(this._handles){__cov_Ou8ktrMRnpDziAawGkzflw.b['3'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['12']++;for(var i=0,l=this._handles.length;i<l;i++){__cov_Ou8ktrMRnpDziAawGkzflw.s['13']++;this._handles[i].detach();}}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['3'][1]++;}},doBefore:function(strMethod,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['5']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['14']++;var host=this.get('host'),handle;__cov_Ou8ktrMRnpDziAawGkzflw.s['15']++;if(strMethod in host){__cov_Ou8ktrMRnpDziAawGkzflw.b['4'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['16']++;handle=this.beforeHostMethod(strMethod,fn,context);}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['4'][1]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['17']++;if(host.on){__cov_Ou8ktrMRnpDziAawGkzflw.b['5'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['18']++;handle=this.onHostEvent(strMethod,fn,context);}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['5'][1]++;}}__cov_Ou8ktrMRnpDziAawGkzflw.s['19']++;return handle;},doAfter:function(strMethod,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['6']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['20']++;var host=this.get('host'),handle;__cov_Ou8ktrMRnpDziAawGkzflw.s['21']++;if(strMethod in host){__cov_Ou8ktrMRnpDziAawGkzflw.b['6'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['22']++;handle=this.afterHostMethod(strMethod,fn,context);}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['6'][1]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['23']++;if(host.after){__cov_Ou8ktrMRnpDziAawGkzflw.b['7'][0]++;__cov_Ou8ktrMRnpDziAawGkzflw.s['24']++;handle=this.afterHostEvent(strMethod,fn,context);}else{__cov_Ou8ktrMRnpDziAawGkzflw.b['7'][1]++;}}__cov_Ou8ktrMRnpDziAawGkzflw.s['25']++;return handle;},onHostEvent:function(type,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['7']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['26']++;var handle=this.get('host').on(type,fn,(__cov_Ou8ktrMRnpDziAawGkzflw.b['8'][0]++,context)||(__cov_Ou8ktrMRnpDziAawGkzflw.b['8'][1]++,this));__cov_Ou8ktrMRnpDziAawGkzflw.s['27']++;this._handles.push(handle);__cov_Ou8ktrMRnpDziAawGkzflw.s['28']++;return handle;},afterHostEvent:function(type,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['8']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['29']++;var handle=this.get('host').after(type,fn,(__cov_Ou8ktrMRnpDziAawGkzflw.b['9'][0]++,context)||(__cov_Ou8ktrMRnpDziAawGkzflw.b['9'][1]++,this));__cov_Ou8ktrMRnpDziAawGkzflw.s['30']++;this._handles.push(handle);__cov_Ou8ktrMRnpDziAawGkzflw.s['31']++;return handle;},beforeHostMethod:function(strMethod,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['9']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['32']++;var handle=Y.Do.before(fn,this.get('host'),strMethod,(__cov_Ou8ktrMRnpDziAawGkzflw.b['10'][0]++,context)||(__cov_Ou8ktrMRnpDziAawGkzflw.b['10'][1]++,this));__cov_Ou8ktrMRnpDziAawGkzflw.s['33']++;this._handles.push(handle);__cov_Ou8ktrMRnpDziAawGkzflw.s['34']++;return handle;},afterHostMethod:function(strMethod,fn,context){__cov_Ou8ktrMRnpDziAawGkzflw.f['10']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['35']++;var handle=Y.Do.after(fn,this.get('host'),strMethod,(__cov_Ou8ktrMRnpDziAawGkzflw.b['11'][0]++,context)||(__cov_Ou8ktrMRnpDziAawGkzflw.b['11'][1]++,this));__cov_Ou8ktrMRnpDziAawGkzflw.s['36']++;this._handles.push(handle);__cov_Ou8ktrMRnpDziAawGkzflw.s['37']++;return handle;},toString:function(){__cov_Ou8ktrMRnpDziAawGkzflw.f['11']++;__cov_Ou8ktrMRnpDziAawGkzflw.s['38']++;return this.constructor.NAME+'['+this.constructor.NS+']';}});__cov_Ou8ktrMRnpDziAawGkzflw.s['39']++;Y.namespace('Plugin').Base=Plugin;},'@VERSION@',{'requires':['base-base']});
| CarlosOhh/cdnjs | ajax/libs/yui/3.10.3/plugin/plugin-coverage.js | JavaScript | mit | 19,768 |
"use strict";
module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) {
var util = require("./util.js");
var isPrimitive = util.isPrimitive;
var thrower = util.thrower;
function returnThis() {
return this;
}
function throwThis() {
throw this;
}
function return$(r) {
return function() {
return r;
};
}
function throw$(r) {
return function() {
throw r;
};
}
function promisedFinally(ret, reasonOrValue, isFulfilled) {
var then;
if (isPrimitive(reasonOrValue)) {
then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue);
} else {
then = isFulfilled ? returnThis : throwThis;
}
return ret._then(then, thrower, undefined, reasonOrValue, undefined);
}
function finallyHandler(reasonOrValue) {
var promise = this.promise;
var handler = this.handler;
var ret = promise._isBound()
? handler.call(promise._boundValue())
: handler();
if (ret !== undefined) {
var maybePromise = tryConvertToPromise(ret, promise);
if (maybePromise instanceof Promise) {
maybePromise = maybePromise._target();
return promisedFinally(maybePromise, reasonOrValue,
promise.isFulfilled());
}
}
if (promise.isRejected()) {
NEXT_FILTER.e = reasonOrValue;
return NEXT_FILTER;
} else {
return reasonOrValue;
}
}
function tapHandler(value) {
var promise = this.promise;
var handler = this.handler;
var ret = promise._isBound()
? handler.call(promise._boundValue(), value)
: handler(value);
if (ret !== undefined) {
var maybePromise = tryConvertToPromise(ret, promise);
if (maybePromise instanceof Promise) {
maybePromise = maybePromise._target();
return promisedFinally(maybePromise, value, true);
}
}
return value;
}
Promise.prototype._passThroughHandler = function (handler, isFinally) {
if (typeof handler !== "function") return this.then();
var promiseAndHandler = {
promise: this,
handler: handler
};
return this._then(
isFinally ? finallyHandler : tapHandler,
isFinally ? finallyHandler : undefined, undefined,
promiseAndHandler, undefined);
};
Promise.prototype.lastly =
Promise.prototype["finally"] = function (handler) {
return this._passThroughHandler(handler, true);
};
Promise.prototype.tap = function (handler) {
return this._passThroughHandler(handler, false);
};
};
| joepler/centerparallax | node_modules/gulp-watch/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/finally.js | JavaScript | mit | 2,624 |
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
* */
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this); | mb16/geocoderNet | mvc/geocoderNet/Scripts/respond.matchmedia.addListener.min.js | JavaScript | mit | 5,019 |
.pdfViewer .canvasWrapper,.textLayer{overflow:hidden}.textLayer{position:absolute;left:0;top:0;right:0;bottom:0;opacity:.2;line-height:1}.textLayer>div{color:transparent;position:absolute;white-space:pre;cursor:text;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-o-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.textLayer .highlight{margin:-1px;padding:1px;background-color:#b400aa;border-radius:4px}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:#006400}.textLayer ::selection{background:#00f}.textLayer ::-moz-selection{background:#00f}.textLayer .endOfContent{display:block;position:absolute;left:0;top:100%;right:0;bottom:0;z-index:-1;cursor:default;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none}.textLayer .endOfContent.active{top:0}.annotationLayer section{position:absolute}.annotationLayer .linkAnnotation>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer .linkAnnotation>a {background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.annotationLayer .linkAnnotation>a:hover{opacity:.2;background:#ff0;box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer}.annotationLayer .popupWrapper{position:absolute;width:20em}.annotationLayer .popup{position:absolute;z-index:200;max-width:20em;background-color:#FF9;box-shadow:0 2px 5px #333;border-radius:2px;padding:.6em;margin-left:5px;cursor:pointer;word-wrap:break-word}.annotationLayer .popup h1{font-size:1em;border-bottom:1px solid #000;padding-bottom:.2em}.annotationLayer .popup p{padding-top:.2em}.annotationLayer .fileAttachmentAnnotation,.annotationLayer .highlightAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .underlineAnnotation{cursor:pointer}.pdfViewer .page{direction:ltr;width:816px;height:1056px;margin:1px auto -8px;position:relative;overflow:visible;border:9px solid transparent;background-clip:content-box;border-image:url(images/shadow.png) 9 9 repeat;background-color:#fff}.pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}.pdfViewer .page canvas{margin:0;display:block}.pdfViewer .page .loadingIcon{position:absolute;display:block;left:0;top:0;right:0;bottom:0;background:url(images/loading-icon.gif) center no-repeat}.pdfPresentationMode:-webkit-full-screen .pdfViewer .page{margin-bottom:100%;border:0}.pdfPresentationMode:-moz-full-screen .pdfViewer .page{margin-bottom:100%;border:0}.pdfPresentationMode:-ms-fullscreen .pdfViewer .page{margin-bottom:100%!important;border:0}.pdfPresentationMode:fullscreen .pdfViewer .page{margin-bottom:100%;border:0}/*# sourceMappingURL=pdf_viewer.min.css.map */ | seogi1004/cdnjs | ajax/libs/pdf.js/1.4.164/pdf_viewer.min.css | CSS | mit | 2,870 |
YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,o=e.stamp(n),(r=s[o])?r:(r=n.getElementsByTagName("base")[0])?s[o]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[o]=r.lastChild):s[o]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}
}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"@VERSION@",{requires:["yui-base"]});
| cnbin/cdnjs | ajax/libs/yui/3.10.1/get/get-min.js | JavaScript | mit | 6,584 |
YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,o=e.stamp(n),(r=s[o])?r:(r=n.getElementsByTagName("base")[0])?s[o]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[o]=r.lastChild):s[o]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}
}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"@VERSION@",{requires:["yui-base"]});
| hare1039/cdnjs | ajax/libs/yui/3.10.1/get/get-min.js | JavaScript | mit | 6,584 |
YUI.add('querystring-stringify-simple', function(Y) {
/*global Y */
/**
* <p>Provides Y.QueryString.stringify method for converting objects to Query Strings.
* This is a subset implementation of the full querystring-stringify.</p>
* <p>This module provides the bare minimum functionality (encoding a hash of simple values),
* without the additional support for nested data structures. Every key-value pair is
* encoded by encodeURIComponent.</p>
* <p>This module provides a minimalistic way for io to handle single-level objects
* as transaction data.</p>
*
* @module querystring
* @submodule querystring-stringify-simple
* @for QueryString
* @static
*/
var QueryString = Y.namespace("QueryString"),
EUC = encodeURIComponent;
/**
* <p>Converts a simple object to a Query String representation.</p>
* <p>Nested objects, Arrays, and so on, are not supported.</p>
*
* @method stringify
* @for QueryString
* @public
* @submodule querystring-stringify-simple
* @param obj {Object} A single-level object to convert to a querystring.
* @param cfg {Object} (optional) Configuration object. In the simple
* module, only the arrayKey setting is
* supported. When set to true, the key of an
* array will have the '[]' notation appended
* to the key;.
* @static
*/
QueryString.stringify = function (obj, c) {
var qs = [],
// Default behavior is false; standard key notation.
s = c && c.arrayKey ? true : false,
key, i, l;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
if (Y.Lang.isArray(obj[key])) {
for (i = 0, l = obj[key].length; i < l; i++) {
qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i]));
}
}
else {
qs.push(EUC(key) + '=' + EUC(obj[key]));
}
}
}
return qs.join('&');
};
}, '@VERSION@' ,{requires:['yui-base']});
| sinkcup/cdnjs | ajax/libs/yui/3.5.1/querystring-stringify-simple/querystring-stringify-simple.js | JavaScript | mit | 2,063 |
// Copyright (c) 2015 Dave Collins <dave@davec.name>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
// NOTE: Due to the following build constraints, this file will only be compiled
// when the code is running on Google App Engine, compiled by GopherJS, or
// "-tags safe" is added to the go build command line. The "disableunsafe"
// tag is deprecated and thus should not be used.
// +build js appengine safe disableunsafe
package spew
import "reflect"
const (
// UnsafeDisabled is a build-time constant which specifies whether or
// not access to the unsafe package is available.
UnsafeDisabled = true
)
// unsafeReflectValue typically converts the passed reflect.Value into a one
// that bypasses the typical safety restrictions preventing access to
// unaddressable and unexported data. However, doing this relies on access to
// the unsafe package. This is a stub version which simply returns the passed
// reflect.Value when the unsafe package is not available.
func unsafeReflectValue(v reflect.Value) reflect.Value {
return v
}
| metalmatze/gopass | vendor/github.com/davecgh/go-spew/spew/bypasssafe.go | GO | mit | 1,729 |
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("diff_match_patch")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror,diff_match_patch)}(function(e,t){"use strict";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"},"align"==e.options.connect&&(this.aligners=[])}function i(t){t.diffOutOfDate&&(t.diff=k(t.orig.getValue(),t.edit.getValue()),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}function o(e){function t(t){"full"==t&&(e.svg&&F(e.svg),e.copyButtons&&F(e.copyButtons),s(e.edit,l.marked,e.classes),s(e.orig,a.marked,e.classes),l.from=l.to=a.from=a.to=0),i(e),e.showDifferences&&(f(e.edit,e.diff,l,DIFF_INSERT,e.classes),f(e.orig,e.diff,a,DIFF_DELETE,e.classes)),h(e)}function r(e){clearTimeout(n),n=setTimeout(t,1==e?250:100)}function o(){e.diffOutOfDate||(e.diffOutOfDate=!0,l.from=l.to=a.from=a.to=0),r(!0)}var n,l={from:0,to:0,marked:[]},a={from:0,to:0,marked:[]};return e.edit.on("change",o),e.orig.on("change",o),e.edit.on("markerAdded",r),e.edit.on("markerCleared",r),e.orig.on("markerAdded",r),e.orig.on("markerCleared",r),e.edit.on("viewportChange",r),e.orig.on("viewportChange",r),t(),t}function n(e){e.edit.on("scroll",function(){l(e,DIFF_INSERT)&&h(e)}),e.orig.on("scroll",function(){l(e,DIFF_DELETE)&&h(e)})}function l(e,t){if(e.diffOutOfDate)return!1;if(!e.lockScroll)return!0;var r,i,o=+new Date;if(t==DIFF_INSERT?(r=e.edit,i=e.orig):(r=e.orig,i=e.edit),r.state.scrollSetBy==e&&(r.state.scrollSetAt||0)+50>o)return!1;var n=r.getScrollInfo();if("align"==e.mv.options.connect)v=n.top;else{var l,c,s=.5*n.clientHeight,f=n.top+s,d=r.lineAtHeight(f,"local"),h=D(e.diff,d,t==DIFF_INSERT),u=a(r,t==DIFF_INSERT?h.edit:h.orig),g=a(i,t==DIFF_INSERT?h.orig:h.edit),p=(f-u.top)/(u.bot-u.top),v=g.top-s+p*(g.bot-g.top);if(v>n.top&&(c=n.top/s)<1)v=v*c+n.top*(1-c);else if((l=n.height-n.clientHeight-n.top)<s){var m=i.getScrollInfo(),C=m.height-m.clientHeight-v;C>l&&(c=l/s)<1&&(v=v*c+(m.height-m.clientHeight-l)*(1-c))}}return i.scrollTo(n.left,v),i.state.scrollSetAt=o,i.state.scrollSetBy=e,!0}function a(e,t){var r=t.after;return null==r&&(r=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(r,"local")}}function c(e,t,r){e.lockScroll=t,t&&0!=r&&l(e,DIFF_INSERT)&&h(e),e.lockButton.innerHTML=t?"⇛⇚":"⇛ ⇚"}function s(t,r,i){for(var o=0;o<r.length;++o){var n=r[o];n instanceof e.TextMarker?n.clear():n.parent&&(t.removeLineClass(n,"background",i.chunk),t.removeLineClass(n,"background",i.start),t.removeLineClass(n,"background",i.end))}r.length=0}function f(e,t,r,i,o){var n=e.getViewport();e.operation(function(){r.from==r.to||n.from-r.to>20||r.from-n.to>20?(s(e,r.marked,o),d(e,t,i,r.marked,n.from,n.to,o),r.from=n.from,r.to=n.to):(n.from<r.from&&(d(e,t,i,r.marked,n.from,r.from,o),r.from=n.from),n.to>r.to&&(d(e,t,i,r.marked,r.to,n.to,o),r.to=n.to))})}function d(e,t,r,i,o,n,l){function a(t,r){for(var a=Math.max(o,t),c=Math.min(n,r),s=a;c>s;++s){var f=e.addLineClass(s,"background",l.chunk);s==t&&e.addLineClass(f,"background",l.start),s==r-1&&e.addLineClass(f,"background",l.end),i.push(f)}t==r&&a==r&&c==r&&i.push(a?e.addLineClass(a-1,"background",l.end):e.addLineClass(a,"background",l.start))}for(var c=B(0,0),s=B(o,0),f=e.clipPos(B(n-1)),d=r==DIFF_DELETE?l.del:l.insert,h=0,u=0;u<t.length;++u){var g=t[u],p=g[0],v=g[1];if(p==DIFF_EQUAL){var m=c.line+(L(t,u)?0:1);T(c,v);var C=c.line+(E(t,u)?1:0);C>m&&(u&&a(h,m),h=C)}else if(p==r){var k=T(c,v,!0),w=N(s,c),y=_(f,k);x(w,y)||i.push(e.markText(w,y,{className:d})),c=k}}h<=c.line&&a(h,c.line+1)}function h(e){if(e.showDifferences){var t="align"==e.mv.options.connect;if(t){if(!e.orig.curOp)return e.orig.operation(function(){h(e)});for(var r=0;r<e.aligners.length;r++)e.aligners[r].clear();e.aligners.length=0;var i={edit:0,orig:0}}if(e.svg){F(e.svg);var o=e.gap.offsetWidth;S(e.svg,"width",o,"height",e.gap.offsetHeight)}e.copyButtons&&F(e.copyButtons);var n=e.edit.getViewport(),l=e.orig.getViewport(),a=e.edit.getScrollInfo().top,c=e.orig.getScrollInfo().top;w(e.diff,function(r,s,f,d){if(f<=n.to&&d>=n.from&&r<=l.to&&s>=l.from&&u(e,r,s,f,d,c,a,o),t&&(f<=n.to||r<=l.to)){var h=d<n.from&&s<l.from;g(e,r,s,f,d,h&&i)}}),t&&(i.edit&&e.aligners.push(p(e.edit,0,i.edit)),i.orig&&e.aligners.push(p(e.orig,0,i.orig)))}}function u(e,t,r,i,o,n,l,a){var c="left"==e.type,s=e.orig.heightAtLine(t,"local")-n;if(e.svg){var f=s,d=e.edit.heightAtLine(i,"local")-l;if(c){var h=f;f=d,d=h}var u=e.orig.heightAtLine(r,"local")-n,g=e.edit.heightAtLine(o,"local")-l;if(c){var h=u;u=g,g=h}var p=" C "+a/2+" "+d+" "+a/2+" "+f+" "+(a+2)+" "+f,v=" C "+a/2+" "+u+" "+a/2+" "+g+" -1 "+g;S(e.svg.appendChild(document.createElementNS(R,"path")),"d","M -1 "+d+p+" L "+(a+2)+" "+u+v+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(O("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),C=e.mv.options.allowEditingOriginals;if(m.title=C?"Push to left":"Revert chunk",m.chunk={topEdit:i,botEdit:o,topOrig:t,botOrig:r},m.style.top=s+"px",C){var k=e.orig.heightAtLine(i,"local")-l,w=e.copyButtons.appendChild(O("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));w.title="Push to right",w.chunk={topEdit:t,botEdit:r,topOrig:i,botOrig:o},w.style.top=k+"px","right"==e.type?w.style.left="2px":w.style.right="2px"}}}function g(e,t,r,i,o,n){var l=e.orig.heightAtLine(t,"local"),a=e.orig.heightAtLine(r,"local"),c=e.edit.heightAtLine(i,"local"),s=e.edit.heightAtLine(o,"local"),f=a-l,d=s-c,h=d-f;return h>1?n?n.orig+=h:e.aligners.push(p(e.orig,r-1,h)):-1>h&&(n?n.edit-=h:e.aligners.push(p(e.edit,o-1,-h))),0}function p(e,t,r){var i=document.createElement("div");return i.style.height=r+"px",i.style.minWidth="1px",e.addLineWidget(t,i,{height:r})}function v(e,t,r,i){e.diffOutOfDate||t.replaceRange(r.getRange(B(i.topOrig,0),B(i.botOrig,0)),B(i.topEdit,0),B(i.botEdit,0))}function m(t){var r=t.lockButton=O("div",null,"CodeMirror-merge-scrolllock");r.title="Toggle locked scrolling";var i=O("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",function(){c(t,!t.lockScroll)});var o=[i];if(t.mv.options.revertButtons!==!1&&(t.copyButtons=O("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",function(e){var r=e.target||e.srcElement;if(r.chunk)return"CodeMirror-merge-copy-reverse"==r.className?void v(t,t.orig,t.edit,r.chunk):void v(t,t.edit,t.orig,r.chunk)}),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var n=document.createElementNS&&document.createElementNS(R,"svg");n&&!n.createSVGRect&&(n=null),t.svg=n,n&&o.push(n)}return t.gap=O("div",o,"CodeMirror-merge-gap")}function C(e){return"string"==typeof e?e:e.getValue()}function k(e,t){var r=H.diff_main(e,t);H.diff_cleanupSemantic(r);for(var i=0;i<r.length;++i){var o=r[i];o[1]?i&&r[i-1][0]==o[0]&&(r.splice(i--,1),r[i][1]+=o[1]):r.splice(i--,1)}return r}function w(e,t){for(var r=0,i=0,o=B(0,0),n=B(0,0),l=0;l<e.length;++l){var a=e[l],c=a[0];if(c==DIFF_EQUAL){var s=L(e,l)?0:1,f=o.line+s,d=n.line+s;T(o,a[1],null,n);var h=E(e,l)?1:0,u=o.line+h,g=n.line+h;u>f&&(l&&t(i,d,r,f),r=u,i=g)}else T(c==DIFF_INSERT?o:n,a[1])}(r<=o.line||i<=n.line)&&t(i,n.line+1,r,o.line+1)}function y(e){i(e);var t=[];return w(e.diff,function(e,r,i,o){t.push({origFrom:e,origTo:r,editFrom:i,editTo:o})}),t}function E(e,t){if(t==e.length-1)return!0;var r=e[t+1][1];return 1==r.length||10!=r.charCodeAt(0)?!1:t==e.length-2?!0:(r=e[t+2][1],r.length>1&&10==r.charCodeAt(0))}function L(e,t){if(0==t)return!0;var r=e[t-1][1];return 10!=r.charCodeAt(r.length-1)?!1:1==t?!0:(r=e[t-2][1],10==r.charCodeAt(r.length-1))}function D(e,t,r){var i,o,n,l;return w(e,function(e,a,c,s){var f=r?c:e,d=r?s:a;null==o&&(f>t?(o=c,l=e):d>t&&(o=s,l=a)),t>=d?(i=s,n=a):t>=f&&(i=c,n=e)}),{edit:{before:i,after:o},orig:{before:n,after:l}}}function M(e,t,r){function i(){n.clear(),e.removeLineClass(t,"wrap","CodeMirror-merge-collapsed-line")}e.addLineClass(t,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title="Identical text collapsed. Click to expand.";var n=e.markText(B(t,0),B(r-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});return o.addEventListener("click",i),{mark:n,clear:i}}function b(e,t,r,i){var o=M(e.orig,t,t+i),n=M(e.edit,r,r+i);o.mark.on("clear",function(){n.clear()}),n.mark.on("clear",function(){o.clear()})}function I(e,t){"number"!=typeof t&&(t=2);var r=e.orig.firstLine(),i=e.edit.firstLine();w(e.diff,function(o,n,l,a){var c=o-t-r;c>t&&b(e,r,i,c),r=n+t,i=a+t});var o=e.orig.lastLine()+1-r;o>t&&b(e,r,i,o)}function O(e,t,r,i){var o=document.createElement(e);if(r&&(o.className=r),i&&(o.style.cssText=i),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var n=0;n<t.length;++n)o.appendChild(t[n]);return o}function F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild)}function S(e){for(var t=1;t<arguments.length;t+=2)e.setAttribute(arguments[t],arguments[t+1])}function A(e,t){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function T(e,t,r,i){for(var o=r?B(e.line,e.ch):e,n=0;;){var l=t.indexOf("\n",n);if(-1==l)break;++o.line,i&&++i.line,n=l+1}return o.ch=(n?0:o.ch)+(t.length-n),i&&(i.ch=(n?0:i.ch)+(t.length-n)),o}function _(e,t){return(e.line-t.line||e.ch-t.ch)<0?e:t}function N(e,t){return(e.line-t.line||e.ch-t.ch)>0?e:t}function x(e,t){return e.line==t.line&&e.ch==t.ch}var B=e.Pos,R="http://www.w3.org/2000/svg";r.prototype={constructor:r,init:function(t,r,i){this.edit=this.mv.edit,this.orig=e(t,A({value:r,readOnly:!this.mv.options.allowEditingOriginals},A(i))),this.diff=k(C(r),C(i.value)),this.diffOutOfDate=!1,this.showDifferences=i.showDifferences!==!1,this.forceUpdate=o(this),c(this,!0,!1),n(this)},setShowDifferences:function(e){e=e!==!1,e!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var V=e.MergeView=function(t,i){if(!(this instanceof V))return new V(t,i);this.options=i;var o=i.origLeft,n=null==i.origRight?i.orig:i.origRight;if(o&&n){if("align"==i.connect)throw new Error('connect: "align" is not supported for three-way merge views');if(i.collapseIdentical)throw new Error("collapseIdentical option is not supported for three-way merge views")}var l=null!=o,a=null!=n,c=1+(l?1:0)+(a?1:0),s=[],f=this.left=null,d=this.right=null;if(l){f=this.left=new r(this,"left");var u=O("div",null,"CodeMirror-merge-pane");s.push(u),s.push(m(f))}var g=O("div",null,"CodeMirror-merge-pane");if(s.push(g),a){d=this.right=new r(this,"right"),s.push(m(d));var p=O("div",null,"CodeMirror-merge-pane");s.push(p)}(a?p:g).className+=" CodeMirror-merge-pane-rightmost",s.push(O("div",null,null,"height: 0; clear: both;"));var v=this.wrap=t.appendChild(O("div",s,"CodeMirror-merge CodeMirror-merge-"+c+"pane"));this.edit=e(g,A(i)),f&&f.init(u,o,i),d&&d.init(p,n,i),i.collapseIdentical&&I(f||d,i.collapseIdentical);var C=function(){f&&h(f),d&&h(d)};e.on(window,"resize",C);var k=setInterval(function(){for(var t=v.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(k),e.off(window,"resize",C))},5e3)};V.prototype={constuctor:V,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){return this.right&&y(this.right)},leftChunks:function(){return this.left&&y(this.left)}};var H=new t}); | barkinet/cdnjs | ajax/libs/codemirror/4.9.0/addon/merge/merge.min.js | JavaScript | mit | 12,000 |
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2013 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Assetic\Factory\Loader;
use Assetic\Cache\ConfigCache;
use Assetic\Factory\Resource\IteratorResourceInterface;
use Assetic\Factory\Resource\ResourceInterface;
/**
* Adds a caching layer to a loader.
*
* A cached formula loader is a composition of a formula loader and a cache.
*
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
*/
class CachedFormulaLoader implements FormulaLoaderInterface
{
private $loader;
private $configCache;
private $debug;
/**
* Constructor.
*
* When the loader is in debug mode it will ensure the cached formulae
* are fresh before returning them.
*
* @param FormulaLoaderInterface $loader A formula loader
* @param ConfigCache $configCache A config cache
* @param Boolean $debug The debug mode
*/
public function __construct(FormulaLoaderInterface $loader, ConfigCache $configCache, $debug = false)
{
$this->loader = $loader;
$this->configCache = $configCache;
$this->debug = $debug;
}
public function load(ResourceInterface $resources)
{
if (!$resources instanceof IteratorResourceInterface) {
$resources = array($resources);
}
$formulae = array();
foreach ($resources as $resource) {
$id = (string) $resource;
if (!$this->configCache->has($id) || ($this->debug && !$resource->isFresh($this->configCache->getTimestamp($id)))) {
$formulae += $this->loader->load($resource);
$this->configCache->set($id, $formulae);
} else {
$formulae += $this->configCache->get($id);
}
}
return $formulae;
}
}
| mu4ddi3/gajdaw-zad-11-03 | vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php | PHP | mit | 1,998 |
/**
* @license AngularJS v1.2.17
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
var $sanitizeMinErr = angular.$$minErr('$sanitize');
/**
* @ngdoc module
* @name ngSanitize
* @description
*
* # ngSanitize
*
* The `ngSanitize` module provides functionality to sanitize HTML.
*
*
* <div doc-module-components="ngSanitize"></div>
*
* See {@link ngSanitize.$sanitize `$sanitize`} for usage.
*/
/*
* HTML Parser By Misko Hevery (misko@hevery.com)
* based on: HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
*/
/**
* @ngdoc service
* @name $sanitize
* @kind function
*
* @description
* The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
* then serialized back to properly escaped html string. This means that no unsafe input can make
* it into the returned string, however, since our parser is more strict than a typical browser
* parser, it's possible that some obscure input, which would be recognized as valid HTML by a
* browser, won't make it through the sanitizer.
* The whitelist is configured using the functions `aHrefSanitizationWhitelist` and
* `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.
*
* @param {string} html Html input.
* @returns {string} Sanitized html.
*
* @example
<example module="ngSanitize" deps="angular-sanitize.js">
<file name="index.html">
<script>
function Ctrl($scope, $sce) {
$scope.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
'snippet</p>';
$scope.deliberatelyTrustDangerousSnippet = function() {
return $sce.trustAsHtml($scope.snippet);
};
}
</script>
<div ng-controller="Ctrl">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Directive</td>
<td>How</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="bind-html-with-sanitize">
<td>ng-bind-html</td>
<td>Automatically uses $sanitize</td>
<td><pre><div ng-bind-html="snippet"><br/></div></pre></td>
<td><div ng-bind-html="snippet"></div></td>
</tr>
<tr id="bind-html-with-trust">
<td>ng-bind-html</td>
<td>Bypass $sanitize by explicitly trusting the dangerous value</td>
<td>
<pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()">
</div></pre>
</td>
<td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
</tr>
<tr id="bind-default">
<td>ng-bind</td>
<td>Automatically escapes</td>
<td><pre><div ng-bind="snippet"><br/></div></pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</div>
</file>
<file name="protractor.js" type="protractor">
it('should sanitize the html snippet by default', function() {
expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
it('should inline raw snippet if bound to a trusted value', function() {
expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should escape snippet without any filter', function() {
expect(element(by.css('#bind-default div')).getInnerHtml()).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should update', function() {
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
toBe('new <b>text</b>');
expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(
'new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(
"new <b onclick=\"alert(1)\">text</b>");
});
</file>
</example>
*/
function $SanitizeProvider() {
this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
return function(html) {
var buf = [];
htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
return !/^unsafe/.test($$sanitizeUri(uri, isImage));
}));
return buf.join('');
};
}];
}
function sanitizeText(chars) {
var buf = [];
var writer = htmlSanitizeWriter(buf, angular.noop);
writer.chars(chars);
return buf.join('');
}
// Regular Expressions for parsing tags and attributes
var START_TAG_REGEXP =
/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,
END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
BEGIN_TAG_REGEXP = /^</,
BEGING_END_TAGE_REGEXP = /^<\s*\//,
COMMENT_REGEXP = /<!--(.*?)-->/g,
DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,
CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = makeMap("area,br,col,hr,img,wbr");
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
optionalEndTagInlineElements = makeMap("rp,rt"),
optionalEndTagElements = angular.extend({},
optionalEndTagInlineElements,
optionalEndTagBlockElements);
// Safe Block Elements - HTML5
var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article," +
"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));
// Inline Elements - HTML5
var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," +
"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
"samp,small,span,strike,strong,sub,sup,time,tt,u,var"));
// Special Elements (can contain anything)
var specialElements = makeMap("script,style");
var validElements = angular.extend({},
voidElements,
blockElements,
inlineElements,
optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
var validAttrs = angular.extend({}, uriAttrs, makeMap(
'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
'scope,scrolling,shape,size,span,start,summary,target,title,type,'+
'valign,value,vspace,width'));
function makeMap(str) {
var obj = {}, items = str.split(','), i;
for (i = 0; i < items.length; i++) obj[items[i]] = true;
return obj;
}
/**
* @example
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
* @param {string} html string
* @param {object} handler
*/
function htmlParser( html, handler ) {
var index, chars, match, stack = [], last = html;
stack.last = function() { return stack[ stack.length - 1 ]; };
while ( html ) {
chars = true;
// Make sure we're not in a script or style element
if ( !stack.last() || !specialElements[ stack.last() ] ) {
// Comment
if ( html.indexOf("<!--") === 0 ) {
// comments containing -- are not allowed unless they terminate the comment
index = html.indexOf("--", 4);
if ( index >= 0 && html.lastIndexOf("-->", index) === index) {
if (handler.comment) handler.comment( html.substring( 4, index ) );
html = html.substring( index + 3 );
chars = false;
}
// DOCTYPE
} else if ( DOCTYPE_REGEXP.test(html) ) {
match = html.match( DOCTYPE_REGEXP );
if ( match ) {
html = html.replace( match[0], '');
chars = false;
}
// end tag
} else if ( BEGING_END_TAGE_REGEXP.test(html) ) {
match = html.match( END_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( END_TAG_REGEXP, parseEndTag );
chars = false;
}
// start tag
} else if ( BEGIN_TAG_REGEXP.test(html) ) {
match = html.match( START_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( START_TAG_REGEXP, parseStartTag );
chars = false;
}
}
if ( chars ) {
index = html.indexOf("<");
var text = index < 0 ? html : html.substring( 0, index );
html = index < 0 ? "" : html.substring( index );
if (handler.chars) handler.chars( decodeEntities(text) );
}
} else {
html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'),
function(all, text){
text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1");
if (handler.chars) handler.chars( decodeEntities(text) );
return "";
});
parseEndTag( "", stack.last() );
}
if ( html == last ) {
throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " +
"of html: {0}", html);
}
last = html;
}
// Clean up any remaining tags
parseEndTag();
function parseStartTag( tag, tagName, rest, unary ) {
tagName = angular.lowercase(tagName);
if ( blockElements[ tagName ] ) {
while ( stack.last() && inlineElements[ stack.last() ] ) {
parseEndTag( "", stack.last() );
}
}
if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) {
parseEndTag( "", tagName );
}
unary = voidElements[ tagName ] || !!unary;
if ( !unary )
stack.push( tagName );
var attrs = {};
rest.replace(ATTR_REGEXP,
function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {
var value = doubleQuotedValue
|| singleQuotedValue
|| unquotedValue
|| '';
attrs[name] = decodeEntities(value);
});
if (handler.start) handler.start( tagName, attrs, unary );
}
function parseEndTag( tag, tagName ) {
var pos = 0, i;
tagName = angular.lowercase(tagName);
if ( tagName )
// Find the closest opened tag of the same type
for ( pos = stack.length - 1; pos >= 0; pos-- )
if ( stack[ pos ] == tagName )
break;
if ( pos >= 0 ) {
// Close all the open elements, up the stack
for ( i = stack.length - 1; i >= pos; i-- )
if (handler.end) handler.end( stack[ i ] );
// Remove the open elements from the stack
stack.length = pos;
}
}
}
var hiddenPre=document.createElement("pre");
var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
/**
* decodes all entities into regular string
* @param value
* @returns {string} A string with decoded entities.
*/
function decodeEntities(value) {
if (!value) { return ''; }
// Note: IE8 does not preserve spaces at the start/end of innerHTML
// so we must capture them and reattach them afterward
var parts = spaceRe.exec(value);
var spaceBefore = parts[1];
var spaceAfter = parts[3];
var content = parts[2];
if (content) {
hiddenPre.innerHTML=content.replace(/</g,"<");
// innerText depends on styling as it doesn't display hidden elements.
// Therefore, it's better to use textContent not to cause unnecessary
// reflows. However, IE<9 don't support textContent so the innerText
// fallback is necessary.
content = 'textContent' in hiddenPre ?
hiddenPre.textContent : hiddenPre.innerText;
}
return spaceBefore + content + spaceAfter;
}
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns {string} escaped text
*/
function encodeEntities(value) {
return value.
replace(/&/g, '&').
replace(SURROGATE_PAIR_REGEXP, function (value) {
var hi = value.charCodeAt(0);
var low = value.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
}).
replace(NON_ALPHANUMERIC_REGEXP, function(value){
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '<').
replace(/>/g, '>');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.jain('') to get out sanitized html string
* @returns {object} in the form of {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* }
*/
function htmlSanitizeWriter(buf, uriValidator){
var ignore = false;
var out = angular.bind(buf, buf.push);
return {
start: function(tag, attrs, unary){
tag = angular.lowercase(tag);
if (!ignore && specialElements[tag]) {
ignore = tag;
}
if (!ignore && validElements[tag] === true) {
out('<');
out(tag);
angular.forEach(attrs, function(value, key){
var lkey=angular.lowercase(key);
var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
if (validAttrs[lkey] === true &&
(uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}
});
out(unary ? '/>' : '>');
}
},
end: function(tag){
tag = angular.lowercase(tag);
if (!ignore && validElements[tag] === true) {
out('</');
out(tag);
out('>');
}
if (tag == ignore) {
ignore = false;
}
},
chars: function(chars){
if (!ignore) {
out(encodeEntities(chars));
}
}
};
}
// define ngSanitize module and register $sanitize service
angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
/* global sanitizeText: false */
/**
* @ngdoc filter
* @name linky
* @kind function
*
* @description
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
* plain email address links.
*
* Requires the {@link ngSanitize `ngSanitize`} module to be installed.
*
* @param {string} text Input text.
* @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
* @returns {string} Html-linkified text.
*
* @usage
<span ng-bind-html="linky_expression | linky"></span>
*
* @example
<example module="ngSanitize" deps="angular-sanitize.js">
<file name="index.html">
<script>
function Ctrl($scope) {
$scope.snippet =
'Pretty text with some links:\n'+
'http://angularjs.org/,\n'+
'mailto:us@somewhere.org,\n'+
'another@somewhere.org,\n'+
'and one more: ftp://127.0.0.1/.';
$scope.snippetWithTarget = 'http://angularjs.org/';
}
</script>
<div ng-controller="Ctrl">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Filter</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="linky-filter">
<td>linky filter</td>
<td>
<pre><div ng-bind-html="snippet | linky"><br></div></pre>
</td>
<td>
<div ng-bind-html="snippet | linky"></div>
</td>
</tr>
<tr id="linky-target">
<td>linky target</td>
<td>
<pre><div ng-bind-html="snippetWithTarget | linky:'_blank'"><br></div></pre>
</td>
<td>
<div ng-bind-html="snippetWithTarget | linky:'_blank'"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng-bind="snippet"><br></div></pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</file>
<file name="protractor.js" type="protractor">
it('should linkify the snippet with urls', function() {
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
});
it('should not linkify snippet without the linky filter', function() {
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
});
it('should update', function() {
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new http://link.');
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('new http://link.');
expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
.toBe('new http://link.');
});
it('should work with the target property', function() {
expect(element(by.id('linky-target')).
element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
toBe('http://angularjs.org/');
expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
});
</file>
</example>
*/
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
var LINKY_URL_REGEXP =
/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,
MAILTO_REGEXP = /^mailto:/;
return function(text, target) {
if (!text) return text;
var match;
var raw = text;
var html = [];
var url;
var i;
while ((match = raw.match(LINKY_URL_REGEXP))) {
// We can not end in these as they are sometimes found at the end of the sentence
url = match[0];
// if we did not match ftp/http/mailto then assume mailto
if (match[2] == match[3]) url = 'mailto:' + url;
i = match.index;
addText(raw.substr(0, i));
addLink(url, match[0].replace(MAILTO_REGEXP, ''));
raw = raw.substring(i + match[0].length);
}
addText(raw);
return $sanitize(html.join(''));
function addText(text) {
if (!text) {
return;
}
html.push(sanitizeText(text));
}
function addLink(url, text) {
html.push('<a ');
if (angular.isDefined(target)) {
html.push('target="');
html.push(target);
html.push('" ');
}
html.push('href="');
html.push(url);
html.push('">');
addText(text);
html.push('</a>');
}
};
}]);
})(window, window.angular);
| JacquesMarais/cdnjs | ajax/libs/ionic/1.0.0-beta.12/js/angular/angular-sanitize.js | JavaScript | mit | 21,058 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.