path
stringlengths
5
300
repo_name
stringlengths
6
76
content
stringlengths
26
1.05M
scripts/App.js
machnicki/healthunlocked
import React, { PropTypes } from 'react'; import Explore from './components/Explore'; import DocumentTitle from 'react-document-title'; import { RouteHandler } from 'react-router'; export default class App { static propTypes = { params: PropTypes.object.isRequired, query: PropTypes.object.isRequired }; render() { return ( <DocumentTitle title='Sample App'> <div className='App'> <Explore {...this.props} /> <hr /> <RouteHandler {...this.props} /> </div> </DocumentTitle> ); } }
src/collections/Table/TableCell.js
aabustamante/Semantic-UI-React
import _ from 'lodash' import cx from 'classnames' import PropTypes from 'prop-types' import React from 'react' import { createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, META, SUI, useKeyOnly, useTextAlignProp, useVerticalAlignProp, useWidthProp, } from '../../lib' import Icon from '../../elements/Icon' /** * A table row can have cells. */ function TableCell(props) { const { active, children, className, collapsing, content, disabled, error, icon, negative, positive, selectable, singleLine, textAlign, verticalAlign, warning, width, } = props const classes = cx( useKeyOnly(active, 'active'), useKeyOnly(collapsing, 'collapsing'), useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(selectable, 'selectable'), useKeyOnly(singleLine, 'single line'), useKeyOnly(warning, 'warning'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), useWidthProp(width, 'wide'), className, ) const rest = getUnhandledProps(TableCell, props) const ElementType = getElementType(TableCell, props) if (!_.isNil(children)) { return <ElementType {...rest} className={classes}>{children}</ElementType> } return ( <ElementType {...rest} className={classes}> {Icon.create(icon)} {content} </ElementType> ) } TableCell._meta = { name: 'TableCell', type: META.TYPES.COLLECTION, parent: 'Table', } TableCell.defaultProps = { as: 'td', } TableCell.propTypes = { /** An element type to render as (string or function). */ as: customPropTypes.as, /** A cell can be active or selected by a user. */ active: PropTypes.bool, /** Primary content. */ children: PropTypes.node, /** Additional classes. */ className: PropTypes.string, /** A cell can be collapsing so that it only uses as much space as required. */ collapsing: PropTypes.bool, /** Shorthand for primary content. */ content: customPropTypes.contentShorthand, /** A cell can be disabled. */ disabled: PropTypes.bool, /** A cell may call attention to an error or a negative value. */ error: PropTypes.bool, /** Add an Icon by name, props object, or pass an <Icon /> */ icon: customPropTypes.itemShorthand, /** A cell may let a user know whether a value is bad. */ negative: PropTypes.bool, /** A cell may let a user know whether a value is good. */ positive: PropTypes.bool, /** A cell can be selectable. */ selectable: PropTypes.bool, /** A cell can specify that its contents should remain on a single line and not wrap. */ singleLine: PropTypes.bool, /** A table cell can adjust its text alignment. */ textAlign: PropTypes.oneOf(_.without(SUI.TEXT_ALIGNMENTS, 'justified')), /** A table cell can adjust its text alignment. */ verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS), /** A cell may warn a user. */ warning: PropTypes.bool, /** A table can specify the width of individual columns independently. */ width: PropTypes.oneOf(SUI.WIDTHS), } TableCell.create = createShorthandFactory(TableCell, content => ({ content })) export default TableCell
ajax/libs/mediaelement/1.1/jquery.js
Piicksarn/cdnjs
/*! * jQuery JavaScript Library v1.4.4 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu Nov 11 19:04:53 2010 -0500 */ (function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, "`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, "margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| [];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== 1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, "__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== "object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, [y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, "")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, "<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== "object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", [b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", 3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| 1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
actor-apps/app-web/src/app/components/sidebar/RecentSectionItem.react.js
hmoraes/actor-platform
import React from 'react'; import classNames from 'classnames'; import DialogActionCreators from 'actions/DialogActionCreators'; import DialogStore from 'stores/DialogStore'; import AvatarItem from 'components/common/AvatarItem.react'; class RecentSectionItem extends React.Component { static propTypes = { dialog: React.PropTypes.object.isRequired }; constructor(props) { super(props); } onClick = () => { DialogActionCreators.selectDialogPeer(this.props.dialog.peer.peer); } render() { const dialog = this.props.dialog, selectedDialogPeer = DialogStore.getSelectedDialogPeer(); let isActive = false, title; if (selectedDialogPeer) { isActive = (dialog.peer.peer.id === selectedDialogPeer.id); } if (dialog.counter > 0) { const counter = <span className="counter">{dialog.counter}</span>; const name = <span className="col-xs title">{dialog.peer.title}</span>; title = [name, counter]; } else { title = <span className="col-xs title">{dialog.peer.title}</span>; } let recentClassName = classNames('sidebar__list__item', 'row', { 'sidebar__list__item--active': isActive, 'sidebar__list__item--unread': dialog.counter > 0 }); return ( <li className={recentClassName} onClick={this.onClick}> <AvatarItem image={dialog.peer.avatar} placeholder={dialog.peer.placeholder} size="tiny" title={dialog.peer.title}/> {title} </li> ); } } export default RecentSectionItem;
react-client/src/components/Dashboard.js
francoabaroa/escape-reality
import React from 'react'; import { Link, withRouter } from 'react-router'; import $ from 'jquery'; import getMuiTheme from 'material-ui/styles/getMuiTheme'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import CircularProgress from 'material-ui/CircularProgress'; import LinearProgress from 'material-ui/LinearProgress'; import FlatButton from 'material-ui/FlatButton'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton'; import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; import MenuItem from 'material-ui/MenuItem'; import RaisedButton from 'material-ui/RaisedButton'; import {Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarTitle} from 'material-ui/Toolbar'; import Avatar from 'material-ui/Avatar'; import { blue300, indigo900, orange200, deepOrange300, pink400, purple500, } from 'material-ui/styles/colors'; const injectTapEventPlugin = require("react-tap-event-plugin"); injectTapEventPlugin(); const fecha = require('fecha'); const vex = require('vex-js'); vex.registerPlugin(require('vex-dialog')); vex.defaultOptions.className = 'vex-theme-os'; let fileName = ''; let filePath = ''; let picDescrip = ''; let currentImgs = []; const getAllPhotos = () => { // console.log('Trying to get topPics ...'); $.get({ url: '/topPics', success: (data) => { // console.log(data, data.length); }, error: (error) => { console.error('error in get upload', error); $('.error').show(); }, }); }; const uploadFile = (props) => { $(function () { const imageIsLoaded = e => { $('#myImg').attr('src', e.target.result); filePath = e.target.result; if (!currentImgs.includes(fileName)) { currentImgs.push(fileName); props.uploadBar(); $.post({ url: '/upload', data: JSON.stringify({ fileName: fileName, filePath: filePath, description: picDescrip }), contentType: 'application/json', success: data => { props.uploadBar(); // console.log('Found user\'s uploaded photo from DB', data); $('#profilePicUp').val(''); vex.dialog.alert('Uploaded!'); $('button.vex-dialog-button-primary.vex-dialog-button.vex-first').click(() => window.location.reload()); }, error: error => { console.error('error in get upload', error); $('.error').show(); }, }); } }; $('#fileUp').change(function () { // console.log('file ATTEMPT'); if (this.files && this.files[0]) { const reader = new FileReader(); picDescrip = $('#description').val(); fileName = this.files[0].name; // console.log(fileName); reader.onload = imageIsLoaded; reader.readAsDataURL(this.files[0]); } }); $('#profilePicUp').change(function () { if (this.files && this.files[0]) { const reader = new FileReader(); // picDescrip = $('#description').val(); fileName = this.files[0].name; // console.log(fileName); reader.onload = imageIsLoaded; reader.readAsDataURL(this.files[0]); } }); }); }; const signOut = () => { // console.log('in sign out function'); $.get({ url: '/signOut', success: (data) => { // console.log(data); window.location.reload(); }, error: (error) => { console.error('error in get bookmarks', error); $('.error').show(); }, }); }; const styles = { button: { margin: 12, fontFamily: 'Orbitron !important', backgroundColor: '#e8e8e8', color: 'black !important' }, exampleImageInput: { cursor: 'pointer', position: 'absolute', top: 0, bottom: 0, right: 0, left: 0, width: '100%', opacity: 0, }, exploreButton: { fontFamily: 'Orbitron', color: 'white', top: '25%', left: '15%', // position: 'absolute' }, }; const style = { margin: 12, }; const backgroundStyle = { // backgroundImage: 'url("http://i.imgur.com/uTYax11.jpg")', // backgroundSize: 'cover', // backgroundRepeat: 'no-repeat', // backgroundPosition: '50% 50%', backgroundSize: 'cover', position: 'fixed', flex: 1, height: '100%', width: '100%', } const overlayStyle = { // position: 'fixed', top: '50%', left: '25%', } // <div style={backgroundStyle}> export default props => { uploadFile(props); return ( <div> <img style={backgroundStyle} src={'http://i.imgur.com/1ZEHnrH.jpg'} /> <div> <MuiThemeProvider muiTheme={getMuiTheme()}> <Toolbar > <ToolbarGroup> <Avatar src={props.profilePic} style={{right: '15%'}} /> </ToolbarGroup> <ToolbarGroup> <ToolbarTitle className="fancyText" text={"Welcome, " + props.currentUser} style={{ top: '-10px', color: 'white'}}/> </ToolbarGroup> </Toolbar> </MuiThemeProvider> <MuiThemeProvider muiTheme={getMuiTheme()}> <LinearProgress color='#FF3D00' className={props.shouldHide ? 'hidden' : ''} mode="indeterminate" /> </MuiThemeProvider> <h1 className="centerText" style={{color: 'white', top: '15px', position: 'absolute', width:'100%', textAlign: 'center', fontSize: '100px'}}> Immerse</h1> <div className="centerButtons"> <Link to="/lobby"> <MuiThemeProvider muiTheme={getMuiTheme()}> <RaisedButton buttonStyle={styles.exploreButton} label="Explore" primary={true} /> </MuiThemeProvider> </Link> <MuiThemeProvider muiTheme={getMuiTheme()}> <RaisedButton label="Upload" labelPosition="before" style={styles.button} containerElement="label" buttonStyle={styles.exploreButton}> <input id="fileUp" type="file" style={styles.exampleImageInput} /> </RaisedButton> </MuiThemeProvider> </div> <br/> <br/> <br/> <div className="centerButtons"> <MuiThemeProvider muiTheme={getMuiTheme()}> <FlatButton label="Sign Out" labelStyle={styles.exploreButton} onClick={() => { signOut(); }} /> </MuiThemeProvider> </div> </div> </div> ); }; /* <input type='file' id='profilePicUp' /> */
app/index.js
willy-claes/django-react
import React from 'react' import ReactDOM from 'react-dom' import createStore from 'App/store' import createRoutes from 'App/routes' import AppContainer from 'App/containers/AppContainer' const initialState = typeof window.__INITIAL_STATE__ === 'string' ? JSON.parse(window.__INITIAL_STATE__) : window.__INITIAL_STATE__ const store = createStore(initialState) const routes = createRoutes(store) const MOUNT_NODE = document.getElementById('root') const render = () => { ReactDOM.render( <AppContainer store={store} routes={routes} />, MOUNT_NODE // eslint-disable-line comma-dangle ) } render()
src/svg-icons/image/grid-on.js
kasra-co/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageGridOn = (props) => ( <SvgIcon {...props}> <path d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"/> </SvgIcon> ); ImageGridOn = pure(ImageGridOn); ImageGridOn.displayName = 'ImageGridOn'; ImageGridOn.muiName = 'SvgIcon'; export default ImageGridOn;
ajax/libs/rxjs/2.3.18/rx.all.compat.js
steadiest/cdnjs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise // Detect if promise exists }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()), defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; var isIterable = Rx.helpers.isIterable = function (o) { return o[$iterator$] !== undefined; } var isArrayLike = Rx.helpers.isArrayLike = function (o) { return o && o.length !== undefined; } Rx.helpers.iterator = $iterator$; var deprecate = Rx.helpers.deprecate = function (name, alternative) { /*if (typeof console !== "undefined" && typeof console.warn === "function") { console.warn(name + ' is deprecated, use ' + alternative + ' instead.', new Error('').stack); }*/ } /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch (e) { suportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b : // but treat `-0` vs. `+0` as not equal (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; var result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Utilities if (!Function.prototype.bind) { Function.prototype.bind = function (that) { var target = this, args = slice.call(arguments, 1); var bound = function () { if (this instanceof bound) { function F() { } F.prototype = target.prototype; var self = new F(); var result = target.apply(self, args.concat(slice.call(arguments))); if (Object(result) === result) { return result; } return self; } else { return target.apply(that, args.concat(slice.call(arguments))); } }; return bound; }; } if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; if (this == null) { throw new TypeError(" this is null or not defined"); } var O = Object(this); var len = O.length >>> 0; if (typeof callback !== "function") { throw new TypeError(callback + " is not a function"); } if (arguments.length > 1) { T = thisArg; } k = 0; while (k < len) { var kValue; if (k in O) { kValue = O[k]; callback.call(T, kValue, k, O); } k++; } }; } var boxedString = Object("a"), splitString = boxedString[0] != "a" || !(0 in boxedString); if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = Object(this), self = splitString && {}.toString.call(this) == stringClass ? this.split("") : object, length = self.length >>> 0, thisp = arguments[1]; if ({}.toString.call(fun) != funcClass) { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = Object(this), self = splitString && {}.toString.call(this) == stringClass ? this.split("") : object, length = self.length >>> 0, result = Array(length), thisp = arguments[1]; if ({}.toString.call(fun) != funcClass) { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self) { result[i] = fun.call(thisp, self[i], i, object); } } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function (predicate) { var results = [], item, t = new Object(this); for (var i = 0, len = t.length >>> 0; i < len; i++) { item = t[i]; if (i in t && predicate.call(arguments[1], item, i, t)) { results.push(item); } } return results; }; } if (!Array.isArray) { Array.isArray = function (arg) { return {}.toString.call(arg) == arrayClass; }; } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(searchElement) { var t = Object(this); var len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n !== n) { n = 0; } else if (n !== 0 && n != Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } // Collections function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () { function BooleanDisposable () { this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); } var s = state; var id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchError = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; }(Scheduler.prototype)); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); /** * Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dt); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var scheduleMethod, clearMethod = noop; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if ('WScript' in this) { localSetTimeout = function (fn, time) { WScript.Sleep(time); fn(); }; } else if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else { throw new Error('No concurrency detected!'); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('', '*'); root.onmessage = oldHandler; return isAsync; } // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return localSetTimeout(action, 0); }; clearMethod = localClearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = localSetTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { localClearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); var CatchScheduler = (function (__super__) { function scheduleNow(state, action) { return this._scheduler.scheduleWithState(state, this._wrap(action)); } function scheduleRelative(state, dueTime, action) { return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action)); } function scheduleAbsolute(state, dueTime, action) { return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action)); } inherits(CatchScheduler, __super__); function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute); } CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { try { return action(parent._getRecursiveWrapper(self), state); } catch (e) { if (!parent._handler(e)) { throw e; } return disposableEmpty; } }; }; CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) { if (failed) { return null; } try { return action(state1); } catch (e) { failed = true; if (!self._handler(e)) { throw e; } d.dispose(); return null; } })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (e) { var notification = new Notification('E'); notification.exception = e; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch (err) { observer.onError(); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchError = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch (err) { observer.onError(); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableOf = Enumerable.of = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { return new AnonymousObserver(function (x) { return handler.call(thisArg, notificationCreateOnNext(x)); }, function (e) { return handler.call(thisArg, notificationCreateOnError(e)); }, function () { return handler.call(thisArg, notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; __super__.call(this); } /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (_super) { inherits(CheckedObserver, _super); function CheckedObserver(observer) { _super.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; ScheduledObserver.prototype.error = function (err) { var self = this; this.queue.push(function () { self.observer.onError(err); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver() { __super__.apply(this, arguments); } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { return this._subscribe(typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(arguments.length === 2 ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, arguments.length === 2 ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, arguments.length === 2 ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(new ObserveOnObserver(scheduler, observer)); }); }; /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(scheduler.schedule(function () { d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer))); })); return d; }); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return observableDefer(function () { var subject = new Rx.AsyncSubject(); promise.then( function (value) { if (!subject.isDisposed) { subject.onNext(value); subject.onCompleted(); } }, subject.onError.bind(subject)); return subject; }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, reject, function () { hasValue && resolve(value); }); }); }; /** * Creates an array from an observable sequence. * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var self = this; return new AnonymousObservable(function(observer) { var arr = []; return self.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function StringIterable(str) { this._s = s; } StringIterable.prototype[$iterator$] = function () { return new StringIterator(this._s); }; function StringIterator(str) { this._s = s; this._l = s.length; this._i = 0; } StringIterator.prototype[$iterator$] = function () { return this; }; StringIterator.prototype.next = function () { if (this._i < this._l) { var val = this._s.charAt(this._i++); return { done: false, value: val }; } else { return doneEnumerator; } }; function ArrayIterable(a) { this._a = a; } ArrayIterable.prototype[$iterator$] = function () { return new ArrayIterator(this._a); }; function ArrayIterator(a) { this._a = a; this._l = toLength(a); this._i = 0; } ArrayIterator.prototype[$iterator$] = function () { return this; }; ArrayIterator.prototype.next = function () { if (this._i < this._l) { var val = this._a[this._i++]; return { done: false, value: val }; } else { return doneEnumerator; } }; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function getIterable(o) { var i = o[$iterator$], it; if (!i && typeof o === 'string') { it = new StringIterable(o); return it[$iterator$](); } if (!i && o.length !== undefined) { it = new ArrayIterable(o); return it[$iterator$](); } if (!i) { throw new TypeError('Object is not iterable'); } return o[$iterator$](); } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isFunction(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); var list = Object(iterable), it = getIterable(list); return new AnonymousObservable(function (observer) { var i = 0; return scheduler.scheduleRecursive(function (self) { var next; try { next = it.next(); } catch (e) { observer.onError(e); return; } if (next.done) { observer.onCompleted(); return; } var result = next.value; if (mapFn && isFunction(mapFn)) { try { result = mapFn.call(thisArg, result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * @deprecated use Observable.from or Observable.of * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { deprecate('fromArray', 'from'); isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; function observableOf (scheduler, array) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); } /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { return observableOf(null, arguments); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.ofWithScheduler = function (scheduler) { return observableOf(scheduler, slice.call(arguments, 1)); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** @deprecated use return or just */ Observable.returnValue = function () { deprecate('returnValue', 'return or just'); return observableReturn.apply(null, arguments); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwError' for browsers <IE9. * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = Observable.throwError = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new AnonymousObservable(function (observer) { var disposable = disposableEmpty, resource, source; try { resource = resourceFactory(); resource && (disposable = resource); source = observableFactory(resource); } catch (exception) { return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); } return new CompositeDisposable(source.subscribe(observer), disposable); }); }; /** * Propagates the observable sequence or Promise that reacts first. * @param {Observable} rightSource Second observable sequence or Promise. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(rightSource) && (rightSource = observableFromPromise(rightSource)); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } leftSubscription.setDisposable(leftSource.subscribe(function (left) { choiceL(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (choice === rightChoice) { observer.onCompleted(); } })); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Propagates the observable sequence or Promise that reacts first. * * @example * var = Rx.Observable.amb(xs, ys, zs); * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items = argsOrArray(arguments, 0); function func(previous, current) { return previous.amb(current); } for (var i = 0, len = items.length; i < len; i++) { acc = func(acc, items[i]); } return acc; }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchError = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * @deprecated use #catch or #catchError instead. */ observableProto.catchException = function (handlerOrSecond) { deprecate('catchException', 'catch or catchError'); return this.catchError(handlerOrSecond); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchError = Observable['catch'] = function () { return enumerableOf(argsOrArray(arguments, 0)).catchError(); }; /** * @deprecated use #catch or #catchError instead. */ Observable.catchException = function () { deprecate('catchException', 'catch or catchError'); return observableCatch.apply(null, arguments); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { return enumerableOf(argsOrArray(arguments, 0)).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatAll = function () { return this.merge(1); }; /** @deprecated Use `concatAll` instead. */ observableProto.concatObservable = function () { deprecate('concatObservable', 'concatAll'); return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = []; function subscribe(xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support isPromise(xs) && (xs = observableFromPromise(xs)); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(subscription); if (q.length > 0) { subscribe(q.shift()); } else { activeCount--; isStopped && activeCount === 0 && observer.onCompleted(); } })); } group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; activeCount === 0 && observer.onCompleted(); })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableOf(scheduler, sources).mergeAll(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeAll = function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check for promises support isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(innerSubscription); isStopped && group.length === 1 && observer.onCompleted(); })); }, observer.onError.bind(observer), function () { isStopped = true; group.length === 1 && observer.onCompleted(); })); return group; }); }; /** * @deprecated use #mergeAll instead. */ observableProto.mergeObservable = function () { deprecate('mergeObservable', 'mergeAll'); return this.mergeAll.apply(this, arguments); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs); * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]); * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var pos = 0, subscription = new SerialDisposable(), cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, d; if (pos < sources.length) { current = sources[pos++]; isPromise(current) && (current = observableFromPromise(current)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self)); } else { observer.onCompleted(); } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe( function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe( function (x) { latest === id && observer.onNext(x); }, function (e) { latest === id && observer.onError(e); }, function () { if (latest === id) { hasLatest = false; isStopped && observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; !hasLatest && observer.onCompleted(); }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(this.subscribe.bind(this)); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * * @example * var res = xs.bufferWithCount(10); * var res = xs.bufferWithCount(10, 1); * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { if (typeof skip !== 'number') { skip = count; } return this.windowWithCount(count, skip).selectMany(function (x) { return x.toArray(); }).where(function (x) { return x.length > 0; }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (onError) { try { onError(err); } catch (e) { observer.onError(e); } } observer.onError(err); }, function () { if (onCompleted) { try { onCompleted(); } catch (e) { observer.onError(e); } } observer.onCompleted(); }); }); }; /** @deprecated use #do or #tap instead. */ observableProto.doAction = function () { deprecate('doAction', 'do or tap'); return this.tap.apply(this, arguments); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(arguments.length === 2 ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, arguments.length === 2 ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, arguments.length === 2 ? function () { onCompleted.call(thisArg); } : onCompleted); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.ensure = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * @deprecated use #finally or #ensure instead. */ observableProto.finallyAction = function (action) { deprecate('finallyAction', 'finally or ensure'); return this.ensure(action); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchError(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { !hasValue && (hasValue = true); try { if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { !hasValue && hasSeed && observer.onNext(seed); observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && observer.onNext(q.shift()); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableOf([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * * var res = xs.windowWithCount(10); * var res = xs.windowWithCount(10, 1); * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new Error(argumentOutOfRange); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >= 0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (isFunction(selector) && isFunction(resultSelector)) { return this.concatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }); } return isFunction(selector) ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }).concatAll(); }; /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; if (defaultValue === undefined) { defaultValue = null; } return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { if (!found) { observer.onNext(defaultValue); } observer.onCompleted(); }); }); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { var source = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hashSet = new HashSet(comparer); return source.subscribe(function (x) { var key = x; if (keySelector) { try { key = keySelector(x); } catch (e) { observer.onError(e); return; } } hashSet.push(key) && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. * * @example * var res = observable.groupBy(function (x) { return x.id; }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. * @param {Function} [comparer] Used to determine whether the objects are equal. * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. */ observableProto.groupBy = function (keySelector, elementSelector, comparer) { return this.groupByUntil(keySelector, elementSelector, observableNever, comparer); }; /** * Groups the elements of an observable sequence according to a specified key selector function. * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. * * @example * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} durationSelector A function to signal the expiration of a group. * @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used. * @returns {Observable} * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. * */ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) { var source = this; elementSelector || (elementSelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { function handleError(e) { return function (item) { item.onError(e); }; } var map = new Dictionary(0, comparer), groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable); groupDisposable.add(source.subscribe(function (x) { var key; try { key = keySelector(x); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } var fireNewMapEntry = false, writer = map.tryGetValue(key); if (!writer) { writer = new Subject(); map.set(key, writer); fireNewMapEntry = true; } if (fireNewMapEntry) { var group = new GroupedObservable(key, writer, refCountDisposable), durationGroup = new GroupedObservable(key, writer); try { duration = durationSelector(durationGroup); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } observer.onNext(group); var md = new SingleAssignmentDisposable(); groupDisposable.add(md); var expire = function () { map.remove(key) && writer.onCompleted(); groupDisposable.remove(md); }; md.setDisposable(duration.take(1).subscribe( noop, function (exn) { map.getValues().forEach(handleError(exn)); observer.onError(exn); }, expire) ); } var element; try { element = elementSelector(x); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } writer.onNext(element); }, function (ex) { map.getValues().forEach(handleError(ex)); observer.onError(ex); }, function () { map.getValues().forEach(function (item) { item.onCompleted(); }); observer.onCompleted(); })); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var selectorFn = isFunction(selector) ? selector : function () { return selector; }, source = this; return new AnonymousObservable(function (observer) { var count = 0; return source.subscribe(function (value) { var result; try { result = selectorFn.call(thisArg, value, count++, source); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} prop The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (prop) { return this.map(function (x) { return x[prop]; }); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).mergeAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (isFunction(selector) && isFunction(resultSelector)) { return this.flatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }, thisArg); } return isFunction(selector) ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }).mergeAll(); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var source = this; return new AnonymousObservable(function (observer) { var remaining = count; return source.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } running && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new RangeError(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining-- > 0) { observer.onNext(x); remaining === 0 && observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (e) { observer.onError(e); return; } shouldRun && observer.onNext(value); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); }; function extremaBy(source, keySelector, comparer) { return new AnonymousObservable(function (observer) { var hasValue = false, lastKey = null, list = []; return source.subscribe(function (x) { var comparison, key; try { key = keySelector(x); } catch (ex) { observer.onError(ex); return; } comparison = 0; if (!hasValue) { hasValue = true; lastKey = key; } else { try { comparison = comparer(key, lastKey); } catch (ex1) { observer.onError(ex1); return; } } if (comparison > 0) { lastKey = key; list = []; } if (comparison >= 0) { list.push(x); } }, observer.onError.bind(observer), function () { observer.onNext(list); observer.onCompleted(); }); }); } function firstOnly(x) { if (x.length === 0) { throw new Error(sequenceContainsNoElements); } return x[0]; } /** * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, see Observable.scan. * @deprecated Use #reduce instead * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.aggregate = function () { deprecate('aggregate', 'reduce'); var seed, hasSeed, accumulator; if (arguments.length === 2) { seed = arguments[0]; hasSeed = true; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, see Observable.scan. * @param {Function} accumulator An accumulator function to be invoked on each element. * @param {Any} [seed] The initial accumulator value. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.reduce = function (accumulator) { var seed, hasSeed; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence. * @param {Function} [predicate] A function to test each element for a condition. * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence. */ observableProto.some = function (predicate, thisArg) { var source = this; return predicate ? source.filter(predicate, thisArg).some() : new AnonymousObservable(function (observer) { return source.subscribe(function () { observer.onNext(true); observer.onCompleted(); }, observer.onError.bind(observer), function () { observer.onNext(false); observer.onCompleted(); }); }); }; /** @deprecated use #some instead */ observableProto.any = function () { deprecate('any', 'some'); return this.some.apply(this, arguments); }; /** * Determines whether an observable sequence is empty. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty. */ observableProto.isEmpty = function () { return this.any().map(not); }; /** * Determines whether all elements of an observable sequence satisfy a condition. * @param {Function} [predicate] A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. */ observableProto.every = function (predicate, thisArg) { return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not); }; /** @deprecated use #every instead */ observableProto.all = function () { deprecate('all', 'every'); return this.every.apply(this, arguments); }; /** * Determines whether an observable sequence contains a specified element with an optional equality comparer. * @param searchElement The value to locate in the source sequence. * @param {Number} [fromIndex] An equality comparer to compare elements. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value from the given index. */ observableProto.contains = function (searchElement, fromIndex) { var source = this; function comparer(a, b) { return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b))); } return new AnonymousObservable(function (observer) { var i = 0, n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); if (n < 0) { observer.onNext(false); observer.onCompleted(); return disposableEmpty; } return source.subscribe( function (x) { if (i++ >= n && comparer(x, searchElement)) { observer.onNext(true); observer.onCompleted(); } }, observer.onError.bind(observer), function () { observer.onNext(false); observer.onCompleted(); }); }); }; /** * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items. * @example * res = source.count(); * res = source.count(function (x) { return x > 3; }); * @param {Function} [predicate]A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence. */ observableProto.count = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).count() : this.aggregate(0, function (count) { return count + 1; }); }; /** * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present. * @param {Any} searchElement Element to locate in the array. * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present. */ observableProto.indexOf = function(searchElement, fromIndex) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); if (n < 0) { observer.onNext(-1); observer.onCompleted(); return disposableEmpty; } return source.subscribe( function (x) { if (i >= n && x === searchElement) { observer.onNext(i); observer.onCompleted(); } i++; }, observer.onError.bind(observer), function () { observer.onNext(-1); observer.onCompleted(); }); }); }; /** * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence. * @example * var res = source.sum(); * var res = source.sum(function (x) { return x.value; }); * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence. */ observableProto.sum = function (keySelector, thisArg) { return keySelector && isFunction(keySelector) ? this.map(keySelector, thisArg).sum() : this.reduce(function (prev, curr) { return prev + curr; }, 0); }; /** * Returns the elements in an observable sequence with the minimum key value according to the specified comparer. * @example * var res = source.minBy(function (x) { return x.value; }); * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value. */ observableProto.minBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; }); }; /** * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check. * @example * var res = source.min(); * var res = source.min(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence. */ observableProto.min = function (comparer) { return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); }); }; /** * Returns the elements in an observable sequence with the maximum key value according to the specified comparer. * @example * var res = source.maxBy(function (x) { return x.value; }); * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value. */ observableProto.maxBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return extremaBy(this, keySelector, comparer); }; /** * Returns the maximum value in an observable sequence according to the specified comparer. * @example * var res = source.max(); * var res = source.max(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence. */ observableProto.max = function (comparer) { return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); }); }; /** * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values. */ observableProto.average = function (keySelector, thisArg) { return keySelector && isFunction(keySelector) ? this.select(keySelector, thisArg).average() : this.scan({sum: 0, count: 0 }, function (prev, cur) { return { sum: prev.sum + cur, count: prev.count + 1 }; }).finalValue().map(function (s) { if (s.count === 0) { throw new Error('The input sequence was empty'); } return s.sum / s.count; }); }; /** * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. * * @example * var res = res = source.sequenceEqual([1,2,3]); * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; }); * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42)); * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; }); * @param {Observable} second Second observable sequence or array to compare. * @param {Function} [comparer] Comparer used to compare elements of both sequences. * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. */ observableProto.sequenceEqual = function (second, comparer) { var first = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var donel = false, doner = false, ql = [], qr = []; var subscription1 = first.subscribe(function (x) { var equal, v; if (qr.length > 0) { v = qr.shift(); try { equal = comparer(v, x); } catch (e) { observer.onError(e); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (doner) { observer.onNext(false); observer.onCompleted(); } else { ql.push(x); } }, observer.onError.bind(observer), function () { donel = true; if (ql.length === 0) { if (qr.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (doner) { observer.onNext(true); observer.onCompleted(); } } }); (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second)); isPromise(second) && (second = observableFromPromise(second)); var subscription2 = second.subscribe(function (x) { var equal; if (ql.length > 0) { var v = ql.shift(); try { equal = comparer(v, x); } catch (exception) { observer.onError(exception); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (donel) { observer.onNext(false); observer.onCompleted(); } else { qr.push(x); } }, observer.onError.bind(observer), function () { doner = true; if (qr.length === 0) { if (ql.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (donel) { observer.onNext(true); observer.onCompleted(); } } }); return new CompositeDisposable(subscription1, subscription2); }); }; function elementAtOrDefault(source, index, hasDefault, defaultValue) { if (index < 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var i = index; return source.subscribe(function (x) { if (i === 0) { observer.onNext(x); observer.onCompleted(); } i--; }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(argumentOutOfRange)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }); } /** * Returns the element at a specified index in a sequence. * @example * var res = source.elementAt(5); * @param {Number} index The zero-based index of the element to retrieve. * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence. */ observableProto.elementAt = function (index) { return elementAtOrDefault(this, index, false); }; /** * Returns the element at a specified index in a sequence or a default value if the index is out of range. * @example * var res = source.elementAtOrDefault(5); * var res = source.elementAtOrDefault(5, 0); * @param {Number} index The zero-based index of the element to retrieve. * @param [defaultValue] The default value if the index is outside the bounds of the source sequence. * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence. */ observableProto.elementAtOrDefault = function (index, defaultValue) { return elementAtOrDefault(this, index, true, defaultValue); }; function singleOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { if (seenValue) { observer.onError(new Error('Sequence contains more than one element')); } else { value = x; seenValue = true; } }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); } /** * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence. * @example * var res = res = source.single(); * var res = res = source.single(function (x) { return x === 42; }); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. */ observableProto.single = function (predicate, thisArg) { return predicate && isFunction(predicate) ? this.where(predicate, thisArg).single() : singleOrDefaultAsync(this, false); }; /** * Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence. * @example * var res = res = source.singleOrDefault(); * var res = res = source.singleOrDefault(function (x) { return x === 42; }); * res = source.singleOrDefault(function (x) { return x === 42; }, 0); * res = source.singleOrDefault(null, 0); * @memberOf Observable# * @param {Function} predicate A predicate function to evaluate for elements in the source sequence. * @param [defaultValue] The default value if the index is outside the bounds of the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) { return predicate && isFunction(predicate) ? this.where(predicate, thisArg).singleOrDefault(null, defaultValue) : singleOrDefaultAsync(this, true, defaultValue); }; function firstOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { observer.onNext(x); observer.onCompleted(); }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }); } /** * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence. * @example * var res = res = source.first(); * var res = res = source.first(function (x) { return x > 3; }); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence. */ observableProto.first = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).first() : firstOrDefaultAsync(this, false); }; /** * Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. * @example * var res = res = source.firstOrDefault(); * var res = res = source.firstOrDefault(function (x) { return x > 3; }); * var res = source.firstOrDefault(function (x) { return x > 3; }, 0); * var res = source.firstOrDefault(null, 0); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) { return predicate ? this.where(predicate).firstOrDefault(null, defaultValue) : firstOrDefaultAsync(this, true, defaultValue); }; function lastOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { value = x; seenValue = true; }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); } /** * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element. * @example * var res = source.last(); * var res = source.last(function (x) { return x > 3; }); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. */ observableProto.last = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).last() : lastOrDefaultAsync(this, false); }; /** * Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. * @example * var res = source.lastOrDefault(); * var res = source.lastOrDefault(function (x) { return x > 3; }); * var res = source.lastOrDefault(function (x) { return x > 3; }, 0); * var res = source.lastOrDefault(null, 0); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param [defaultValue] The default value if no such element exists. If not specified, defaults to null. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) { return predicate ? this.where(predicate, thisArg).lastOrDefault(null, defaultValue) : lastOrDefaultAsync(this, true, defaultValue); }; function findValue (source, predicate, thisArg, yieldIndex) { return new AnonymousObservable(function (observer) { var i = 0; return source.subscribe(function (x) { var shouldRun; try { shouldRun = predicate.call(thisArg, x, i, source); } catch (e) { observer.onError(e); return; } if (shouldRun) { observer.onNext(yieldIndex ? i : x); observer.onCompleted(); } else { i++; } }, observer.onError.bind(observer), function () { observer.onNext(yieldIndex ? -1 : undefined); observer.onCompleted(); }); }); } /** * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined. */ observableProto.find = function (predicate, thisArg) { return findValue(this, predicate, thisArg, false); }; /** * Searches for an element that matches the conditions defined by the specified predicate, and returns * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. */ observableProto.findIndex = function (predicate, thisArg) { return findValue(this, predicate, thisArg, true); }; if (!!root.Set) { /** * Converts the observable sequence to a Set if it exists. * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence. */ observableProto.toSet = function () { var source = this; return new AnonymousObservable(function (observer) { var s = new root.Set(); return source.subscribe( s.add.bind(s), observer.onError.bind(observer), function () { observer.onNext(s); observer.onCompleted(); }); }); }; } if (!!root.Map) { /** * Converts the observable sequence to a Map if it exists. * @param {Function} keySelector A function which produces the key for the Map. * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence. * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence. */ observableProto.toMap = function (keySelector, elementSelector) { var source = this; return new AnonymousObservable(function (observer) { var m = new root.Map(); return source.subscribe( function (x) { var key; try { key = keySelector(x); } catch (e) { observer.onError(e); return; } var element = x; if (elementSelector) { try { element = elementSelector(x); } catch (e) { observer.onError(e); return; } } m.set(key, element); }, observer.onError.bind(observer), function () { observer.onNext(m); observer.onCompleted(); }); }); }; } var fnString = 'function', throwString = 'throw'; function toThunk(obj, ctx) { if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); } if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); } if (isGenerator(obj)) { return observableSpawn(obj); } if (isObservable(obj)) { return observableToThunk(obj); } if (isPromise(obj)) { return promiseToThunk(obj); } if (typeof obj === fnString) { return obj; } if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); } return obj; } function objectToThunk(obj) { var ctx = this; return function (done) { var keys = Object.keys(obj), pending = keys.length, results = new obj.constructor(), finished; if (!pending) { timeoutScheduler.schedule(function () { done(null, results); }); return; } for (var i = 0, len = keys.length; i < len; i++) { run(obj[keys[i]], keys[i]); } function run(fn, key) { if (finished) { return; } try { fn = toThunk(fn, ctx); if (typeof fn !== fnString) { results[key] = fn; return --pending || done(null, results); } fn.call(ctx, function(err, res) { if (finished) { return; } if (err) { finished = true; return done(err); } results[key] = res; --pending || done(null, results); }); } catch (e) { finished = true; done(e); } } } } function observableToThunk(observable) { return function (fn) { var value, hasValue = false; observable.subscribe( function (v) { value = v; hasValue = true; }, fn, function () { hasValue && fn(null, value); }); } } function promiseToThunk(promise) { return function(fn) { promise.then(function(res) { fn(null, res); }, fn); } } function isObservable(obj) { return obj && typeof obj.subscribe === fnString; } function isGeneratorFunction(obj) { return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction'; } function isGenerator(obj) { return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString; } function isObject(val) { return val && val.constructor === Object; } /* * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions. * @param {Function} The spawning function. * @returns {Function} a function which has a done continuation. */ var observableSpawn = Rx.spawn = function (fn) { var isGenFun = isGeneratorFunction(fn); return function (done) { var ctx = this, gen = fn; if (isGenFun) { var args = slice.call(arguments), len = args.length, hasCallback = len && typeof args[len - 1] === fnString; done = hasCallback ? args.pop() : error; gen = fn.apply(this, args); } else { done = done || error; } next(); function exit(err, res) { timeoutScheduler.schedule(done.bind(ctx, err, res)); } function next(err, res) { var ret; // multiple args if (arguments.length > 2) { res = slice.call(arguments, 1); } if (err) { try { ret = gen[throwString](err); } catch (e) { return exit(e); } } if (!err) { try { ret = gen.next(res); } catch (e) { return exit(e); } } if (ret.done) { return exit(null, ret.value); } ret.value = toThunk(ret.value, ctx); if (typeof ret.value === fnString) { var called = false; try { ret.value.call(ctx, function() { if (called) { return; } called = true; next.apply(ctx, arguments); }); } catch (e) { timeoutScheduler.schedule(function () { if (called) { return; } called = true; next.call(ctx, e); }); } return; } // Not supported next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.')); } } }; /** * Takes a function with a callback and turns it into a thunk. * @param {Function} A function with a callback such as fs.readFile * @returns {Function} A function, when executed will continue the state machine. */ Rx.denodify = function (fn) { return function () { var args = slice.call(arguments), results, called, callback; args.push(function() { results = arguments; if (callback && !called) { called = true; cb.apply(this, results); } }); fn.apply(this, args); return function (fn) { callback = fn; if (results && !called) { called = true; fn.apply(this, results); } } } }; function error(err) { if (!err) { return; } timeoutScheduler.schedule(function() { throw err; }); } /** * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence. * * @example * var res = Rx.Observable.start(function () { console.log('hello'); }); * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout); * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console); * * @param {Function} func Function to run asynchronously. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. * * Remarks * * The function is called immediately, not during the subscription of the resulting sequence. * * Multiple subscriptions to the resulting sequence can observe the function's result. */ Observable.start = function (func, context, scheduler) { return observableToAsync(func, context, scheduler)(); }; /** * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. * * @example * var res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3); * var res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3); * var res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello'); * * @param {Function} function Function to convert to an asynchronous function. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Function} Asynchronous function. */ var observableToAsync = Observable.toAsync = function (func, context, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return function () { var args = arguments, subject = new AsyncSubject(); scheduler.schedule(function () { var result; try { result = func.apply(context, args); } catch (e) { subject.onError(e); return; } subject.onNext(result); subject.onCompleted(); }); return subject.asObservable(); }; }; /** * Converts a callback function to an observable sequence. * * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. */ Observable.fromCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(err) { if (err) { observer.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { observer.onError(e); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; function fixEvent(event) { var stopPropagation = function () { this.cancelBubble = true; }; var preventDefault = function () { this.bubbledKeyCode = this.keyCode; if (this.ctrlKey) { try { this.keyCode = 0; } catch (e) { } } this.defaultPrevented = true; this.returnValue = false; this.modified = true; }; event || (event = root.event); if (!event.target) { event.target = event.target || event.srcElement; if (event.type == 'mouseover') { event.relatedTarget = event.fromElement; } if (event.type == 'mouseout') { event.relatedTarget = event.toElement; } // Adding stopPropogation and preventDefault to IE if (!event.stopPropagation) { event.stopPropagation = stopPropagation; event.preventDefault = preventDefault; } // Normalize key events switch (event.type) { case 'keypress': var c = ('charCode' in event ? event.charCode : event.keyCode); if (c == 10) { c = 0; event.keyCode = 13; } else if (c == 13 || c == 27) { c = 0; } else if (c == 3) { c = 99; } event.charCode = c; event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : ''; break; } } return event; } function createListener (element, name, handler) { // Standards compliant if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } if (element.attachEvent) { // IE Specific var innerHandler = function (event) { handler(fixEvent(event)); }; element.attachEvent('on' + name, innerHandler); return disposableCreate(function () { element.detachEvent('on' + name, innerHandler); }); } // Level 1 DOM Events element['on' + name] = handler; return disposableCreate(function () { element['on' + name] = null; }); } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (Object.prototype.toString.call(el) === '[object NodeList]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Configuration option to determine whether to use native events only */ Rx.config.useNativeEvents = false; // Check for Angular/jQuery/Zepto support var jq = !!root.angular && !!angular.element ? angular.element : (!!root.jQuery ? root.jQuery : ( !!root.Zepto ? root.Zepto : null)); // Check for ember var ember = !!root.Ember && typeof root.Ember.addListener === 'function'; // Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs // for proper loading order! var marionette = !!root.Backbone && !!root.Backbone.Marionette; /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { // Node.js specific if (element.addListener) { return fromEventPattern( function (h) { element.addListener(eventName, h); }, function (h) { element.removeListener(eventName, h); }, selector); } // Use only if non-native events are allowed if (!Rx.config.useNativeEvents) { if (marionette) { return fromEventPattern( function (h) { element.on(eventName, h); }, function (h) { element.off(eventName, h); }, selector); } if (ember) { return fromEventPattern( function (h) { Ember.addListener(element, eventName, h); }, function (h) { Ember.removeListener(element, eventName, h); }, selector); } if (jq) { var $elem = jq(element); return fromEventPattern( function (h) { $elem.on(eventName, h); }, function (h) { $elem.off(eventName, h); }, selector); } } return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * Invokes the asynchronous function, surfacing the result through an observable sequence. * @param {Function} functionAsync Asynchronous function which returns a Promise to run. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. */ Observable.startAsync = function (functionAsync) { var promise; try { promise = functionAsync(); } catch (e) { return observableThrow(e); } return observableFromPromise(promise); } var PausableObservable = (function (_super) { inherits(PausableObservable, _super); function subscribe(observer) { var conn = this.source.publish(), subscription = conn.subscribe(observer), connection = disposableEmpty; var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) { if (b) { connection = conn.connect(); } else { connection.dispose(); connection = disposableEmpty; } }); return new CompositeDisposable(subscription, connection, pausable); } function PausableObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } _super.call(this, subscribe); } PausableObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausable(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausable = function (pauser) { return new PausableObservable(this, pauser); }; function combineLatestSource(source, subject, resultSelector) { return new AnonymousObservable(function (observer) { var hasValue = [false, false], hasValueAll = false, isDone = false, values = new Array(2), err; function next(x, i) { values[i] = x var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { if (err) { observer.onError(err); return; } try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } if (isDone && values[1]) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe( function (x) { next(x, 0); }, function (e) { if (values[1]) { observer.onError(e); } else { err = e; } }, function () { isDone = true; values[1] && observer.onCompleted(); }), subject.subscribe( function (x) { next(x, 1); }, observer.onError.bind(observer), function () { isDone = true; next(true, 1); }) ); }); } var PausableBufferedObservable = (function (__super__) { inherits(PausableBufferedObservable, __super__); function subscribe(observer) { var q = [], previousShouldFire; var subscription = combineLatestSource( this.source, this.pauser.distinctUntilChanged().startWith(false), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) .subscribe( function (results) { if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { previousShouldFire = results.shouldFire; // change in shouldFire if (results.shouldFire) { while (q.length > 0) { observer.onNext(q.shift()); } } } else { previousShouldFire = results.shouldFire; // new data if (results.shouldFire) { observer.onNext(results.data); } else { q.push(results.data); } } }, function (err) { // Empty buffer before sending error while (q.length > 0) { observer.onNext(q.shift()); } observer.onError(err); }, function () { // Empty buffer before sending completion while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); } ); return subscription; } function PausableBufferedObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } __super__.call(this, subscribe); } PausableBufferedObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableBufferedObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableBufferedObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, * and yields the values that were buffered while paused. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausableBuffered(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausableBuffered = function (subject) { return new PausableBufferedObservable(this, subject); }; /** * Attaches a controller to the observable sequence with the ability to queue. * @example * var source = Rx.Observable.interval(100).controlled(); * source.request(3); // Reads 3 values * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.controlled = function (enableQueue) { if (enableQueue == null) { enableQueue = true; } return new ControlledObservable(this, enableQueue); }; var ControlledObservable = (function (_super) { inherits(ControlledObservable, _super); function subscribe (observer) { return this.source.subscribe(observer); } function ControlledObservable (source, enableQueue) { _super.call(this, subscribe); this.subject = new ControlledSubject(enableQueue); this.source = source.multicast(this.subject).refCount(); } ControlledObservable.prototype.request = function (numberOfItems) { if (numberOfItems == null) { numberOfItems = -1; } return this.subject.request(numberOfItems); }; return ControlledObservable; }(Observable)); var ControlledSubject = Rx.ControlledSubject = (function (_super) { function subscribe (observer) { return this.subject.subscribe(observer); } inherits(ControlledSubject, _super); function ControlledSubject(enableQueue) { if (enableQueue == null) { enableQueue = true; } _super.call(this, subscribe); this.subject = new Subject(); this.enableQueue = enableQueue; this.queue = enableQueue ? [] : null; this.requestedCount = 0; this.requestedDisposable = disposableEmpty; this.error = null; this.hasFailed = false; this.hasCompleted = false; this.controlledDisposable = disposableEmpty; } addProperties(ControlledSubject.prototype, Observer, { onCompleted: function () { checkDisposed.call(this); this.hasCompleted = true; if (!this.enableQueue || this.queue.length === 0) { this.subject.onCompleted(); } }, onError: function (error) { checkDisposed.call(this); this.hasFailed = true; this.error = error; if (!this.enableQueue || this.queue.length === 0) { this.subject.onError(error); } }, onNext: function (value) { checkDisposed.call(this); var hasRequested = false; if (this.requestedCount === 0) { if (this.enableQueue) { this.queue.push(value); } } else { if (this.requestedCount !== -1) { if (this.requestedCount-- === 0) { this.disposeCurrentRequest(); } } hasRequested = true; } if (hasRequested) { this.subject.onNext(value); } }, _processRequest: function (numberOfItems) { if (this.enableQueue) { //console.log('queue length', this.queue.length); while (this.queue.length >= numberOfItems && numberOfItems > 0) { //console.log('number of items', numberOfItems); this.subject.onNext(this.queue.shift()); numberOfItems--; } if (this.queue.length !== 0) { return { numberOfItems: numberOfItems, returnValue: true }; } else { return { numberOfItems: numberOfItems, returnValue: false }; } } if (this.hasFailed) { this.subject.onError(this.error); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } else if (this.hasCompleted) { this.subject.onCompleted(); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } return { numberOfItems: numberOfItems, returnValue: false }; }, request: function (number) { checkDisposed.call(this); this.disposeCurrentRequest(); var self = this, r = this._processRequest(number); number = r.numberOfItems; if (!r.returnValue) { this.requestedCount = number; this.requestedDisposable = disposableCreate(function () { self.requestedCount = 0; }); return this.requestedDisposable } else { return disposableEmpty; } }, disposeCurrentRequest: function () { this.requestedDisposable.dispose(); this.requestedDisposable = disposableEmpty; }, dispose: function () { this.isDisposed = true; this.error = null; this.subject.dispose(); this.requestedDisposable.dispose(); } }); return ControlledSubject; }(Observable)); /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new Subject(); }, selector) : this.multicast(new Subject()); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.share(); * * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.share = function () { return this.publish().refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new AsyncSubject(); }, selector) : this.multicast(new AsyncSubject()); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareValue(42); * * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareValue = function (initialValue) { return this.publishValue(initialValue).refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return selector && isFunction(selector) ? this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector) : this.multicast(new ReplaySubject(bufferSize, window, scheduler)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareReplay(3); * var res = source.shareReplay(3, 500); * var res = source.shareReplay(3, 500, scheduler); * * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareReplay = function (bufferSize, window, scheduler) { return this.replay(null, bufferSize, window, scheduler).refCount(); }; /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, __super__); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { __super__.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.exception = error; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onNext(value); } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (__super__) { function createRemovableDisposable(subject, observer) { return disposableCreate(function () { observer.dispose(); !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); }); } function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = createRemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); var n = this.q.length; for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { n++; so.onError(this.error); } else if (this.isStopped) { n++; so.onCompleted(); } so.ensureActive(n); return subscription; } inherits(ReplaySubject, __super__); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; __super__.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onNext(value); observer.ensureActive(); } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { var hasSubscription = false, subscription, sourceObservable = source.asObservable(); this.connect = function () { if (!hasSubscription) { hasSubscription = true; subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () { hasSubscription = false; })); } return subscription; }; __super__.call(this, subject.subscribe.bind(subject)); } ConnectableObservable.prototype.refCount = function () { var connectableSubscription, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect = ++count === 1, subscription = source.subscribe(observer); shouldConnect && (connectableSubscription = source.connect()); return function () { subscription.dispose(); --count === 0 && connectableSubscription.dispose(); }; }); }; return ConnectableObservable; }(Observable)); var Dictionary = (function () { var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647], noSuchkey = "no such key", duplicatekey = "duplicate key"; function isPrime(candidate) { if (candidate & 1 === 0) { return candidate === 2; } var num1 = Math.sqrt(candidate), num2 = 3; while (num2 <= num1) { if (candidate % num2 === 0) { return false; } num2 += 2; } return true; } function getPrime(min) { var index, num, candidate; for (index = 0; index < primes.length; ++index) { num = primes[index]; if (num >= min) { return num; } } candidate = min | 1; while (candidate < primes[primes.length - 1]) { if (isPrime(candidate)) { return candidate; } candidate += 2; } return min; } function stringHashFn(str) { var hash = 757602046; if (!str.length) { return hash; } for (var i = 0, len = str.length; i < len; i++) { var character = str.charCodeAt(i); hash = ((hash << 5) - hash) + character; hash = hash & hash; } return hash; } function numberHashFn(key) { var c2 = 0x27d4eb2d; key = (key ^ 61) ^ (key >>> 16); key = key + (key << 3); key = key ^ (key >>> 4); key = key * c2; key = key ^ (key >>> 15); return key; } var getHashCode = (function () { var uniqueIdCounter = 0; return function (obj) { if (obj == null) { throw new Error(noSuchkey); } // Check for built-ins before tacking on our own for any object if (typeof obj === 'string') { return stringHashFn(obj); } if (typeof obj === 'number') { return numberHashFn(obj); } if (typeof obj === 'boolean') { return obj === true ? 1 : 0; } if (obj instanceof Date) { return numberHashFn(obj.valueOf()); } if (obj instanceof RegExp) { return stringHashFn(obj.toString()); } if (typeof obj.valueOf === 'function') { // Hack check for valueOf var valueOf = obj.valueOf(); if (typeof valueOf === 'number') { return numberHashFn(valueOf); } if (typeof obj === 'string') { return stringHashFn(valueOf); } } if (obj.getHashCode) { return obj.getHashCode(); } var id = 17 * uniqueIdCounter++; obj.getHashCode = function () { return id; }; return id; }; }()); function newEntry() { return { key: null, value: null, next: 0, hashCode: 0 }; } function Dictionary(capacity, comparer) { if (capacity < 0) { throw new Error('out of range'); } if (capacity > 0) { this._initialize(capacity); } this.comparer = comparer || defaultComparer; this.freeCount = 0; this.size = 0; this.freeList = -1; } var dictionaryProto = Dictionary.prototype; dictionaryProto._initialize = function (capacity) { var prime = getPrime(capacity), i; this.buckets = new Array(prime); this.entries = new Array(prime); for (i = 0; i < prime; i++) { this.buckets[i] = -1; this.entries[i] = newEntry(); } this.freeList = -1; }; dictionaryProto.add = function (key, value) { return this._insert(key, value, true); }; dictionaryProto._insert = function (key, value, add) { if (!this.buckets) { this._initialize(0); } var index3, num = getHashCode(key) & 2147483647, index1 = num % this.buckets.length; for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) { if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) { if (add) { throw new Error(duplicatekey); } this.entries[index2].value = value; return; } } if (this.freeCount > 0) { index3 = this.freeList; this.freeList = this.entries[index3].next; --this.freeCount; } else { if (this.size === this.entries.length) { this._resize(); index1 = num % this.buckets.length; } index3 = this.size; ++this.size; } this.entries[index3].hashCode = num; this.entries[index3].next = this.buckets[index1]; this.entries[index3].key = key; this.entries[index3].value = value; this.buckets[index1] = index3; }; dictionaryProto._resize = function () { var prime = getPrime(this.size * 2), numArray = new Array(prime); for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; } var entryArray = new Array(prime); for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; } for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); } for (var index1 = 0; index1 < this.size; ++index1) { var index2 = entryArray[index1].hashCode % prime; entryArray[index1].next = numArray[index2]; numArray[index2] = index1; } this.buckets = numArray; this.entries = entryArray; }; dictionaryProto.remove = function (key) { if (this.buckets) { var num = getHashCode(key) & 2147483647, index1 = num % this.buckets.length, index2 = -1; for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) { if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) { if (index2 < 0) { this.buckets[index1] = this.entries[index3].next; } else { this.entries[index2].next = this.entries[index3].next; } this.entries[index3].hashCode = -1; this.entries[index3].next = this.freeList; this.entries[index3].key = null; this.entries[index3].value = null; this.freeList = index3; ++this.freeCount; return true; } else { index2 = index3; } } } return false; }; dictionaryProto.clear = function () { var index, len; if (this.size <= 0) { return; } for (index = 0, len = this.buckets.length; index < len; ++index) { this.buckets[index] = -1; } for (index = 0; index < this.size; ++index) { this.entries[index] = newEntry(); } this.freeList = -1; this.size = 0; }; dictionaryProto._findEntry = function (key) { if (this.buckets) { var num = getHashCode(key) & 2147483647; for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) { if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) { return index; } } } return -1; }; dictionaryProto.count = function () { return this.size - this.freeCount; }; dictionaryProto.tryGetValue = function (key) { var entry = this._findEntry(key); return entry >= 0 ? this.entries[entry].value : undefined; }; dictionaryProto.getValues = function () { var index = 0, results = []; if (this.entries) { for (var index1 = 0; index1 < this.size; index1++) { if (this.entries[index1].hashCode >= 0) { results[index++] = this.entries[index1].value; } } } return results; }; dictionaryProto.get = function (key) { var entry = this._findEntry(key); if (entry >= 0) { return this.entries[entry].value; } throw new Error(noSuchkey); }; dictionaryProto.set = function (key, value) { this._insert(key, value, false); }; dictionaryProto.containskey = function (key) { return this._findEntry(key) >= 0; }; return Dictionary; }()); /** * Correlates the elements of two sequences based on overlapping durations. * * @param {Observable} right The right observable sequence to join elements for. * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs. * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. */ observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { var left = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(); var leftDone = false, rightDone = false; var leftId = 0, rightId = 0; var leftMap = new Dictionary(), rightMap = new Dictionary(); group.add(left.subscribe( function (value) { var id = leftId++; var md = new SingleAssignmentDisposable(); leftMap.add(id, value); group.add(md); var expire = function () { leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted(); group.remove(md); }; var duration; try { duration = leftDurationSelector(value); } catch (e) { observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire)); rightMap.getValues().forEach(function (v) { var result; try { result = resultSelector(value, v); } catch (exn) { observer.onError(exn); return; } observer.onNext(result); }); }, observer.onError.bind(observer), function () { leftDone = true; (rightDone || leftMap.count() === 0) && observer.onCompleted(); }) ); group.add(right.subscribe( function (value) { var id = rightId++; var md = new SingleAssignmentDisposable(); rightMap.add(id, value); group.add(md); var expire = function () { rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted(); group.remove(md); }; var duration; try { duration = rightDurationSelector(value); } catch (e) { observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire)); leftMap.getValues().forEach(function (v) { var result; try { result = resultSelector(v, value); } catch (exn) { observer.onError(exn); return; } observer.onNext(result); }); }, observer.onError.bind(observer), function () { rightDone = true; (leftDone || rightMap.count() === 0) && observer.onCompleted(); }) ); return group; }); }; /** * Correlates the elements of two sequences based on overlapping durations, and groups the results. * * @param {Observable} right The right observable sequence to join elements for. * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element. * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. */ observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { var left = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(); var r = new RefCountDisposable(group); var leftMap = new Dictionary(), rightMap = new Dictionary(); var leftId = 0, rightId = 0; function handleError(e) { return function (v) { v.onError(e); }; }; group.add(left.subscribe( function (value) { var s = new Subject(); var id = leftId++; leftMap.add(id, s); var result; try { result = resultSelector(value, addRef(s, r)); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } observer.onNext(result); rightMap.getValues().forEach(function (v) { s.onNext(v); }); var md = new SingleAssignmentDisposable(); group.add(md); var expire = function () { leftMap.remove(id) && s.onCompleted(); group.remove(md); }; var duration; try { duration = leftDurationSelector(value); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe( noop, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, expire) ); }, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, observer.onCompleted.bind(observer)) ); group.add(right.subscribe( function (value) { var id = rightId++; rightMap.add(id, value); var md = new SingleAssignmentDisposable(); group.add(md); var expire = function () { rightMap.remove(id); group.remove(md); }; var duration; try { duration = rightDurationSelector(value); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe( noop, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, expire) ); leftMap.getValues().forEach(function (v) { v.onNext(value); }); }, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }) ); return r; }); }; /** * Projects each element of an observable sequence into zero or more buffers. * * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. * @returns {Observable} An observable sequence of windows. */ observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) { return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); }); }; /** * Projects each element of an observable sequence into zero or more windows. * * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. * @returns {Observable} An observable sequence of windows. */ observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) { if (arguments.length === 1 && typeof arguments[0] !== 'function') { return observableWindowWithBounaries.call(this, windowOpeningsOrClosingSelector); } return typeof windowOpeningsOrClosingSelector === 'function' ? observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) : observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector); }; function observableWindowWithOpenings(windowOpenings, windowClosingSelector) { return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) { return win; }); } function observableWindowWithBounaries(windowBoundaries) { var source = this; return new AnonymousObservable(function (observer) { var win = new Subject(), d = new CompositeDisposable(), r = new RefCountDisposable(d); observer.onNext(addRef(win, r)); d.add(source.subscribe(function (x) { win.onNext(x); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries)); d.add(windowBoundaries.subscribe(function (w) { win.onCompleted(); win = new Subject(); observer.onNext(addRef(win, r)); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); return r; }); } function observableWindowWithClosingSelector(windowClosingSelector) { var source = this; return new AnonymousObservable(function (observer) { var m = new SerialDisposable(), d = new CompositeDisposable(m), r = new RefCountDisposable(d), win = new Subject(); observer.onNext(addRef(win, r)); d.add(source.subscribe(function (x) { win.onNext(x); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); function createWindowClose () { var windowClose; try { windowClose = windowClosingSelector(); } catch (e) { observer.onError(e); return; } isPromise(windowClose) && (windowClose = observableFromPromise(windowClose)); var m1 = new SingleAssignmentDisposable(); m.setDisposable(m1); m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); win = new Subject(); observer.onNext(addRef(win, r)); createWindowClose(); })); } createWindowClose(); return r; }); } /** * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array. */ observableProto.pairwise = function () { var source = this; return new AnonymousObservable(function (observer) { var previous, hasPrevious = false; return source.subscribe( function (x) { if (hasPrevious) { observer.onNext([previous, x]); } else { hasPrevious = true; } previous = x; }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns two observables which partition the observations of the source by the given function. * The first will trigger observations for those values for which the predicate returns true. * The second will trigger observations for those values where the predicate returns false. * The predicate is executed once for each subscribed observer. * Both also propagate all error observations arising from the source and each completes * when the source completes. * @param {Function} predicate * The function to determine which output Observable will trigger a particular observation. * @returns {Array} * An array of observables. The first triggers when the predicate returns true, * and the second triggers when the predicate returns false. */ observableProto.partition = function(predicate, thisArg) { var published = this.publish().refCount(); return [ published.filter(predicate, thisArg), published.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); }) ]; }; function enumerableWhile(condition, source) { return new Enumerable(function () { return new Enumerator(function () { return condition() ? { done: false, value: source } : { done: true, value: undefined }; }); }); } /** * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. * This operator allows for a fluent style of writing queries that use the same sequence multiple times. * * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.letBind = observableProto['let'] = function (func) { return func(this); }; /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9 * * @example * 1 - res = Rx.Observable.if(condition, obs1); * 2 - res = Rx.Observable.if(condition, obs1, obs2); * 3 - res = Rx.Observable.if(condition, obs1, scheduler); * @param {Function} condition The condition which determines if the thenSource or elseSource will be run. * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true. * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler. * @returns {Observable} An observable sequence which is either the thenSource or elseSource. */ Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) { return observableDefer(function () { elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty()); isPromise(thenSource) && (thenSource = observableFromPromise(thenSource)); isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler)); // Assume a scheduler for empty only typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler)); return condition() ? thenSource : elseSourceOrScheduler; }); }; /** * Concatenates the observable sequences obtained by running the specified result selector for each element in source. * There is an alias for this method called 'forIn' for browsers <IE9 * @param {Array} sources An array of values to turn into an observable sequence. * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence. * @returns {Observable} An observable sequence from the concatenated observable sequences. */ Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) { return enumerableOf(sources, resultSelector, thisArg).concat(); }; /** * Repeats source as long as condition holds emulating a while loop. * There is an alias for this method called 'whileDo' for browsers <IE9 * * @param {Function} condition The condition which determines if the source will be repeated. * @param {Observable} source The observable sequence that will be run if the condition function returns true. * @returns {Observable} An observable sequence which is repeated as long as the condition holds. */ var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) { isPromise(source) && (source = observableFromPromise(source)); return enumerableWhile(condition, source).concat(); }; /** * Repeats source as long as condition holds emulating a do while loop. * * @param {Function} condition The condition which determines if the source will be repeated. * @param {Observable} source The observable sequence that will be run if the condition function returns true. * @returns {Observable} An observable sequence which is repeated as long as the condition holds. */ observableProto.doWhile = function (condition) { return observableConcat([this, observableWhileDo(condition, this)]); }; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers <IE9. * * @example * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }); * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0); * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler); * * @param {Function} selector The function which extracts the value for to test in a case statement. * @param {Array} sources A object which has keys which correspond to the case statement labels. * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler. * * @returns {Observable} An observable sequence which is determined by a case statement. */ Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) { return observableDefer(function () { isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler)); defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty()); typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler)); var result = sources[selector()]; isPromise(result) && (result = observableFromPromise(result)); return result || defaultSourceOrScheduler; }); }; /** * Expands an observable sequence by recursively invoking selector. * * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion. */ observableProto.expand = function (selector, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = [], m = new SerialDisposable(), d = new CompositeDisposable(m), activeCount = 0, isAcquired = false; var ensureActive = function () { var isOwner = false; if (q.length > 0) { isOwner = !isAcquired; isAcquired = true; } if (isOwner) { m.setDisposable(scheduler.scheduleRecursive(function (self) { var work; if (q.length > 0) { work = q.shift(); } else { isAcquired = false; return; } var m1 = new SingleAssignmentDisposable(); d.add(m1); m1.setDisposable(work.subscribe(function (x) { observer.onNext(x); var result = null; try { result = selector(x); } catch (e) { observer.onError(e); } q.push(result); activeCount++; ensureActive(); }, observer.onError.bind(observer), function () { d.remove(m1); activeCount--; if (activeCount === 0) { observer.onCompleted(); } })); self(); })); } }; q.push(source); activeCount++; ensureActive(); return d; }); }; /** * Runs all observable sequences in parallel and collect their last elements. * * @example * 1 - res = Rx.Observable.forkJoin([obs1, obs2]); * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...); * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences. */ Observable.forkJoin = function () { var allSources = argsOrArray(arguments, 0); return new AnonymousObservable(function (subscriber) { var count = allSources.length; if (count === 0) { subscriber.onCompleted(); return disposableEmpty; } var group = new CompositeDisposable(), finished = false, hasResults = new Array(count), hasCompleted = new Array(count), results = new Array(count); for (var idx = 0; idx < count; idx++) { (function (i) { var source = allSources[i]; isPromise(source) && (source = observableFromPromise(source)); group.add( source.subscribe( function (value) { if (!finished) { hasResults[i] = true; results[i] = value; } }, function (e) { finished = true; subscriber.onError(e); group.dispose(); }, function () { if (!finished) { if (!hasResults[i]) { subscriber.onCompleted(); return; } hasCompleted[i] = true; for (var ix = 0; ix < count; ix++) { if (!hasCompleted[ix]) { return; } } finished = true; subscriber.onNext(results); subscriber.onCompleted(); } })); })(idx); } return group; }); }; /** * Runs two observable sequences in parallel and combines their last elemenets. * * @param {Observable} second Second observable sequence. * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences. * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences. */ observableProto.forkJoin = function (second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var leftStopped = false, rightStopped = false, hasLeft = false, hasRight = false, lastLeft, lastRight, leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(second) && (second = observableFromPromise(second)); leftSubscription.setDisposable( first.subscribe(function (left) { hasLeft = true; lastLeft = left; }, function (err) { rightSubscription.dispose(); observer.onError(err); }, function () { leftStopped = true; if (rightStopped) { if (!hasLeft) { observer.onCompleted(); } else if (!hasRight) { observer.onCompleted(); } else { var result; try { result = resultSelector(lastLeft, lastRight); } catch (e) { observer.onError(e); return; } observer.onNext(result); observer.onCompleted(); } } }) ); rightSubscription.setDisposable( second.subscribe(function (right) { hasRight = true; lastRight = right; }, function (err) { leftSubscription.dispose(); observer.onError(err); }, function () { rightStopped = true; if (leftStopped) { if (!hasLeft) { observer.onCompleted(); } else if (!hasRight) { observer.onCompleted(); } else { var result; try { result = resultSelector(lastLeft, lastRight); } catch (e) { observer.onError(e); return; } observer.onNext(result); observer.onCompleted(); } } }) ); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Comonadic bind operator. * @param {Function} selector A transform function to apply to each element. * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. * @returns {Observable} An observable sequence which results from the comonadic bind operation. */ observableProto.manySelect = function (selector, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); var source = this; return observableDefer(function () { var chain; return source .map(function (x) { var curr = new ChainObservable(x); chain && chain.onNext(x); chain = curr; return curr; }) .tap( noop, function (e) { chain && chain.onError(e); }, function () { chain && chain.onCompleted(); } ) .observeOn(scheduler) .map(selector); }); }; var ChainObservable = (function (__super__) { function subscribe (observer) { var self = this, g = new CompositeDisposable(); g.add(currentThreadScheduler.schedule(function () { observer.onNext(self.head); g.add(self.tail.mergeAll().subscribe(observer)); })); return g; } inherits(ChainObservable, __super__); function ChainObservable(head) { __super__.call(this, subscribe); this.head = head; this.tail = new AsyncSubject(); } addProperties(ChainObservable.prototype, Observer, { onCompleted: function () { this.onNext(Observable.empty()); }, onError: function (e) { this.onNext(Observable.throwException(e)); }, onNext: function (v) { this.tail.onNext(v); this.tail.onCompleted(); } }); return ChainObservable; }(Observable)); /** @private */ var Map = root.Map || (function () { function Map() { this._keys = []; this._values = []; } Map.prototype.get = function (key) { var i = this._keys.indexOf(key); return i !== -1 ? this._values[i] : undefined; }; Map.prototype.set = function (key, value) { var i = this._keys.indexOf(key); i !== -1 && (this._values[i] = value); this._values[this._keys.push(key) - 1] = value; }; Map.prototype.forEach = function (callback, thisArg) { for (var i = 0, len = this._keys.length; i < len; i++) { callback.call(thisArg, this._values[i], this._keys[i]); } }; return Map; }()); /** * @constructor * Represents a join pattern over observable sequences. */ function Pattern(patterns) { this.patterns = patterns; } /** * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value. * @param other Observable sequence to match in addition to the current pattern. * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value. */ Pattern.prototype.and = function (other) { return new Pattern(this.patterns.concat(other)); }; /** * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values. * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern. * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. */ Pattern.prototype.thenDo = function (selector) { return new Plan(this, selector); }; function Plan(expression, selector) { this.expression = expression; this.selector = selector; } Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) { var self = this; var joinObservers = []; for (var i = 0, len = this.expression.patterns.length; i < len; i++) { joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer))); } var activePlan = new ActivePlan(joinObservers, function () { var result; try { result = self.selector.apply(self, arguments); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, function () { for (var j = 0, jlen = joinObservers.length; j < jlen; j++) { joinObservers[j].removeActivePlan(activePlan); } deactivate(activePlan); }); for (i = 0, len = joinObservers.length; i < len; i++) { joinObservers[i].addActivePlan(activePlan); } return activePlan; }; function planCreateObserver(externalSubscriptions, observable, onError) { var entry = externalSubscriptions.get(observable); if (!entry) { var observer = new JoinObserver(observable, onError); externalSubscriptions.set(observable, observer); return observer; } return entry; } function ActivePlan(joinObserverArray, onNext, onCompleted) { this.joinObserverArray = joinObserverArray; this.onNext = onNext; this.onCompleted = onCompleted; this.joinObservers = new Map(); for (var i = 0, len = this.joinObserverArray.length; i < len; i++) { var joinObserver = this.joinObserverArray[i]; this.joinObservers.set(joinObserver, joinObserver); } } ActivePlan.prototype.dequeue = function () { this.joinObservers.forEach(function (v) { v.queue.shift(); }); }; ActivePlan.prototype.match = function () { var i, len, hasValues = true; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { if (this.joinObserverArray[i].queue.length === 0) { hasValues = false; break; } } if (hasValues) { var firstValues = [], isCompleted = false; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { firstValues.push(this.joinObserverArray[i].queue[0]); this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true); } if (isCompleted) { this.onCompleted(); } else { this.dequeue(); var values = []; for (i = 0, len = firstValues.length; i < firstValues.length; i++) { values.push(firstValues[i].value); } this.onNext.apply(this, values); } } }; var JoinObserver = (function (__super__) { inherits(JoinObserver, __super__); function JoinObserver(source, onError) { __super__.call(this); this.source = source; this.onError = onError; this.queue = []; this.activePlans = []; this.subscription = new SingleAssignmentDisposable(); this.isDisposed = false; } var JoinObserverPrototype = JoinObserver.prototype; JoinObserverPrototype.next = function (notification) { if (!this.isDisposed) { if (notification.kind === 'E') { this.onError(notification.exception); return; } this.queue.push(notification); var activePlans = this.activePlans.slice(0); for (var i = 0, len = activePlans.length; i < len; i++) { activePlans[i].match(); } } }; JoinObserverPrototype.error = noop; JoinObserverPrototype.completed = noop; JoinObserverPrototype.addActivePlan = function (activePlan) { this.activePlans.push(activePlan); }; JoinObserverPrototype.subscribe = function () { this.subscription.setDisposable(this.source.materialize().subscribe(this)); }; JoinObserverPrototype.removeActivePlan = function (activePlan) { this.activePlans.splice(this.activePlans.indexOf(activePlan), 1); this.activePlans.length === 0 && this.dispose(); }; JoinObserverPrototype.dispose = function () { __super__.prototype.dispose.call(this); if (!this.isDisposed) { this.isDisposed = true; this.subscription.dispose(); } }; return JoinObserver; } (AbstractObserver)); /** * Creates a pattern that matches when both observable sequences have an available value. * * @param right Observable sequence to match with the current sequence. * @return {Pattern} Pattern object that matches when both observable sequences have an available value. */ observableProto.and = function (right) { return new Pattern([this, right]); }; /** * Matches when the observable sequence has an available value and projects the value. * * @param selector Selector that will be invoked for values in the source sequence. * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. */ observableProto.thenDo = function (selector) { return new Pattern([this]).thenDo(selector); }; /** * Joins together the results from several patterns. * * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns. * @returns {Observable} Observable sequence with the results form matching several patterns. */ Observable.when = function () { var plans = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var activePlans = [], externalSubscriptions = new Map(); var outObserver = observerCreate( observer.onNext.bind(observer), function (err) { externalSubscriptions.forEach(function (v) { v.onError(err); }); observer.onError(err); }, observer.onCompleted.bind(observer) ); try { for (var i = 0, len = plans.length; i < len; i++) { activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) { var idx = activePlans.indexOf(activePlan); activePlans.splice(idx, 1); activePlans.length === 0 && observer.onCompleted(); })); } } catch (e) { observableThrow(e).subscribe(observer); } var group = new CompositeDisposable(); externalSubscriptions.forEach(function (joinObserver) { joinObserver.subscribe(); group.add(joinObserver); }); return group; }); }; function observableTimerDate(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithAbsolute(dueTime, function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerDateAndPeriod(dueTime, period, scheduler) { return new AnonymousObservable(function (observer) { var count = 0, d = dueTime, p = normalizeTime(period); return scheduler.scheduleRecursiveWithAbsolute(d, function (self) { if (p > 0) { var now = scheduler.now(); d = d + p; d <= now && (d = now + p); } observer.onNext(count++); self(d); }); }); } function observableTimerTimeSpan(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { return dueTime === period ? new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }) : observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (isScheduler(periodOrScheduler)) { scheduler = periodOrScheduler; } if (dueTime instanceof Date && period === undefined) { return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { period = periodOrScheduler; return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; function observableDelayTimeSpan(source, dueTime, scheduler) { return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }); } function observableDelayDate(source, dueTime, scheduler) { return observableDefer(function () { return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); }); } /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * 1 - res = Rx.Observable.delay(new Date()); * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); * * 3 - res = Rx.Observable.delay(5000); * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return dueTime instanceof Date ? observableDelayDate(this, dueTime.getTime(), scheduler) : observableDelayTimeSpan(this, dueTime, scheduler); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The debounced sequence. */ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0; var subscription = source.subscribe( function (x) { hasvalue = true; value = x; id++; var currentId = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () { hasvalue && id === currentId && observer.onNext(value); hasvalue = false; })); }, function (e) { cancelable.dispose(); observer.onError(e); hasvalue = false; id++; }, function () { cancelable.dispose(); hasvalue && observer.onNext(value); observer.onCompleted(); hasvalue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; /** * @deprecated use #debounce or #throttleWithTimeout instead. */ observableProto.throttle = function(dueTime, scheduler) { deprecate('throttle', 'debounce or throttleWithTimeout'); return this.debounce(dueTime, scheduler); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on timing information. * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds). * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows. * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) { var source = this, timeShift; timeShiftOrScheduler == null && (timeShift = timeSpan); isScheduler(scheduler) || (scheduler = timeoutScheduler); if (typeof timeShiftOrScheduler === 'number') { timeShift = timeShiftOrScheduler; } else if (isScheduler(timeShiftOrScheduler)) { timeShift = timeSpan; scheduler = timeShiftOrScheduler; } return new AnonymousObservable(function (observer) { var groupDisposable, nextShift = timeShift, nextSpan = timeSpan, q = [], refCountDisposable, timerD = new SerialDisposable(), totalTime = 0; groupDisposable = new CompositeDisposable(timerD), refCountDisposable = new RefCountDisposable(groupDisposable); function createTimer () { var m = new SingleAssignmentDisposable(), isSpan = false, isShift = false; timerD.setDisposable(m); if (nextSpan === nextShift) { isSpan = true; isShift = true; } else if (nextSpan < nextShift) { isSpan = true; } else { isShift = true; } var newTotalTime = isSpan ? nextSpan : nextShift, ts = newTotalTime - totalTime; totalTime = newTotalTime; if (isSpan) { nextSpan += timeShift; } if (isShift) { nextShift += timeShift; } m.setDisposable(scheduler.scheduleWithRelative(ts, function () { if (isShift) { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } isSpan && q.shift().onCompleted(); createTimer(); })); }; q.push(new Subject()); observer.onNext(addRef(q[0], refCountDisposable)); createTimer(); groupDisposable.add(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } }, function (e) { for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); } observer.onError(e); }, function () { for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed. * @param {Number} timeSpan Maximum time length of a window. * @param {Number} count Maximum element count of a window. * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var timerD = new SerialDisposable(), groupDisposable = new CompositeDisposable(timerD), refCountDisposable = new RefCountDisposable(groupDisposable), n = 0, windowId = 0, s = new Subject(); function createTimer(id) { var m = new SingleAssignmentDisposable(); timerD.setDisposable(m); m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () { if (id !== windowId) { return; } n = 0; var newId = ++windowId; s.onCompleted(); s = new Subject(); observer.onNext(addRef(s, refCountDisposable)); createTimer(newId); })); } observer.onNext(addRef(s, refCountDisposable)); createTimer(0); groupDisposable.add(source.subscribe( function (x) { var newId = 0, newWindow = false; s.onNext(x); if (++n === count) { newWindow = true; n = 0; newId = ++windowId; s.onCompleted(); s = new Subject(); observer.onNext(addRef(s, refCountDisposable)); } newWindow && createTimer(newId); }, function (e) { s.onError(e); observer.onError(e); }, function () { s.onCompleted(); observer.onCompleted(); } )); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information. * * @example * 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second * 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds * * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds). * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers. * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) { return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); }); }; /** * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed. * * @example * 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array * 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array * * @param {Number} timeSpan Maximum time length of a buffer. * @param {Number} count Maximum element count of a buffer. * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) { return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) { return x.toArray(); }); }; /** * Records the time interval between consecutive values in an observable sequence. * * @example * 1 - res = source.timeInterval(); * 2 - res = source.timeInterval(Rx.Scheduler.timeout); * * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with time interval information on values. */ observableProto.timeInterval = function (scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return observableDefer(function () { var last = scheduler.now(); return source.map(function (x) { var now = scheduler.now(), span = now - last; last = now; return { value: x, interval: span }; }); }); }; /** * Records the timestamp for each value in an observable sequence. * * @example * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } * 2 - res = source.timestamp(Rx.Scheduler.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.map(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } atEnd && observer.onCompleted(); } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return typeof intervalOrSampler === 'number' ? sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout'))); isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); function createTimer() { var myId = id; timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); subscription.setDisposable(other.subscribe(observer)); } })); } createTimer(); original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; observer.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; observer.onError(e); } }, function () { if (!switched) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Generates an observable sequence by iterating a state from an initial state until the condition fails. * * @example * res = source.generateWithAbsoluteTime(0, * function (x) { return return true; }, * function (x) { return x + 1; }, * function (x) { return x; }, * function (x) { return new Date(); } * }); * * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. * @returns {Observable} The generated sequence. */ Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var first = true, hasResult = false, result, state = initialState, time; return scheduler.scheduleRecursiveWithAbsolute(scheduler.now(), function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by iterating a state from an initial state until the condition fails. * * @example * res = source.generateWithRelativeTime(0, * function (x) { return return true; }, * function (x) { return x + 1; }, * function (x) { return x; }, * function (x) { return 500; } * ); * * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. * @returns {Observable} The generated sequence. */ Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var first = true, hasResult = false, result, state = initialState, time; return scheduler.scheduleRecursiveWithRelative(0, function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Time shifts the observable sequence by delaying the subscription. * * @example * 1 - res = source.delaySubscription(5000); // 5s * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Number} dueTime Absolute or relative time to perform the subscription at. * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delaySubscription = function (dueTime, scheduler) { return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty); }; /** * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector * * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source. * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element. * @returns {Observable} Time-shifted sequence. */ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) { var source = this, subDelay, selector; if (typeof subscriptionDelay === 'function') { selector = subscriptionDelay; } else { subDelay = subscriptionDelay; selector = delayDurationSelector; } return new AnonymousObservable(function (observer) { var delays = new CompositeDisposable(), atEnd = false, done = function () { if (atEnd && delays.length === 0) { observer.onCompleted(); } }, subscription = new SerialDisposable(), start = function () { subscription.setDisposable(source.subscribe(function (x) { var delay; try { delay = selector(x); } catch (error) { observer.onError(error); return; } var d = new SingleAssignmentDisposable(); delays.add(d); d.setDisposable(delay.subscribe(function () { observer.onNext(x); delays.remove(d); done(); }, observer.onError.bind(observer), function () { observer.onNext(x); delays.remove(d); done(); })); }, observer.onError.bind(observer), function () { atEnd = true; subscription.dispose(); done(); })); }; if (!subDelay) { start(); } else { subscription.setDisposable(subDelay.subscribe(function () { start(); }, observer.onError.bind(observer), function () { start(); })); } return new CompositeDisposable(subscription, delays); }); }; /** * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled. * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never(). * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException(). * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) { if (arguments.length === 1) { timeoutdurationSelector = firstTimeout; firstTimeout = observableNever(); } other || (other = observableThrow(new Error('Timeout'))); var source = this; return new AnonymousObservable(function (observer) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); subscription.setDisposable(original); var id = 0, switched = false; function setTimer(timeout) { var myId = id; function timerWins () { return id === myId; } var d = new SingleAssignmentDisposable(); timer.setDisposable(d); d.setDisposable(timeout.subscribe(function () { timerWins() && subscription.setDisposable(other.subscribe(observer)); d.dispose(); }, function (e) { timerWins() && observer.onError(e); }, function () { timerWins() && subscription.setDisposable(other.subscribe(observer)); })); }; setTimer(firstTimeout); function observerWins() { var res = !switched; if (res) { id++; } return res; } original.setDisposable(source.subscribe(function (x) { if (observerWins()) { observer.onNext(x); var timeout; try { timeout = timeoutdurationSelector(x); } catch (e) { observer.onError(e); return; } setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout); } }, function (e) { observerWins() && observer.onError(e); }, function () { observerWins() && observer.onCompleted(); })); return new CompositeDisposable(subscription, timer); }); }; /** * Ignores values from an observable sequence which are followed by another value within a computed throttle duration. * @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element. * @returns {Observable} The debounced sequence. */ observableProto.debounceWithSelector = function (durationSelector) { var source = this; return new AnonymousObservable(function (observer) { var value, hasValue = false, cancelable = new SerialDisposable(), id = 0; var subscription = source.subscribe(function (x) { var throttle; try { throttle = durationSelector(x); } catch (e) { observer.onError(e); return; } isPromise(throttle) && (throttle = observableFromPromise(throttle)); hasValue = true; value = x; id++; var currentid = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(throttle.subscribe(function () { hasValue && id === currentid && observer.onNext(value); hasValue = false; d.dispose(); }, observer.onError.bind(observer), function () { hasValue && id === currentid && observer.onNext(value); hasValue = false; d.dispose(); })); }, function (e) { cancelable.dispose(); observer.onError(e); hasValue = false; id++; }, function () { cancelable.dispose(); hasValue && observer.onNext(value); observer.onCompleted(); hasValue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; observableProto.throttleWithSelector = function () { deprecate('throttleWithSelector', 'debounceWithSelector'); return this.debounceWithSelector.apply(this, arguments); }; /** * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * 1 - res = source.skipLastWithTime(5000); * 2 - res = source.skipLastWithTime(5000, scheduler); * * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for skipping elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. */ observableProto.skipLastWithTime = function (duration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } observer.onCompleted(); }); }); }; /** * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { observer.onNext(next.value); } } observer.onCompleted(); }); }); }; /** * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastBufferWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(), res = []; while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { res.push(next.value); } } observer.onNext(res); observer.onCompleted(); }); }); }; /** * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. */ observableProto.takeWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer)); }); }; /** * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.skipWithTime(5000, [optional scheduler]); * * @description * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded * may not execute immediately, despite the zero due time. * * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. * @param {Number} duration Duration for skipping elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. */ observableProto.skipWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler.scheduleWithRelative(duration, function () { open = true; }), source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }); }; /** * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers. * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time. * * @examples * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]); * 2 - res = source.skipUntilWithTime(5000, [scheduler]); * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped until the specified start time. */ observableProto.skipUntilWithTime = function (startTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = startTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler[schedulerMethod](startTime, function () { open = true; }), source.subscribe( function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }); }; /** * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately. * @param {Scheduler} [scheduler] Scheduler to run the timer on. * @returns {Observable} An observable sequence with the elements taken until the specified end time. */ observableProto.takeUntilWithTime = function (endTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = endTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { return new CompositeDisposable( scheduler[schedulerMethod](endTime, observer.onCompleted.bind(observer)), source.subscribe(observer)); }); }; /** * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration. * @param {Number} windowDuration time to wait before emitting another item after emitting the last item * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout. * @returns {Observable} An Observable that performs the throttle operation. */ observableProto.throttleFirst = function (windowDuration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var duration = +windowDuration || 0; if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); } var source = this; return new AnonymousObservable(function (observer) { var lastOnNext = 0; return source.subscribe( function (x) { var now = scheduler.now(); if (lastOnNext === 0 || now - lastOnNext >= duration) { lastOnNext = now; observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer) ); }); }; /* * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @returns {Observable} A exclusive observable with only the results that happen when subscribed. */ observableProto.exclusive = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasCurrent = false, isStopped = false, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); var innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (!hasCurrent && g.length === 1) { observer.onCompleted(); } })); return g; }); }; /* * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @param {Function} selector Selector to invoke for every item in the current subscription. * @param {Any} [thisArg] An optional context to invoke with the selector parameter. * @returns {Observable} An exclusive observable with only the results that happen when subscribed. */ observableProto.exclusiveMap = function (selector, thisArg) { var sources = this; return new AnonymousObservable(function (observer) { var index = 0, hasCurrent = false, isStopped = true, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe( function (x) { var result; try { result = selector.call(thisArg, x, index++, innerSource); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (g.length === 1 && !hasCurrent) { observer.onCompleted(); } })); return g; }); }; /** * Executes a transducer to transform the observable sequence * @param {Transducer} transducer A transducer to execute * @returns {Observable} An Observable sequence containing the results from the transducer. */ observableProto.transduce = function(transducer) { var source = this; function transformForObserver(observer) { return { init: function() { return observer; }, step: function(obs, input) { return obs.onNext(input); }, result: function(obs) { return obs.onCompleted(); } }; } return new AnonymousObservable(function(observer) { var xform = transducer(transformForObserver(observer)); return source.subscribe( function(v) { try { xform.step(observer, v); } catch (e) { observer.onError(e); } }, observer.onError.bind(observer), function() { xform.result(observer); } ); }); }; /** Provides a set of extension methods for virtual time scheduling. */ Rx.VirtualTimeScheduler = (function (__super__) { function notImplemented() { throw new Error('Not implemented'); } function localNow() { return this.toDateTimeOffset(this.clock); } function scheduleNow(state, action) { return this.scheduleAbsoluteWithState(state, this.clock, action); } function scheduleRelative(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action); } function invokeAction(scheduler, action) { action(); return disposableEmpty; } inherits(VirtualTimeScheduler, __super__); /** * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer. * * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function VirtualTimeScheduler(initialClock, comparer) { this.clock = initialClock; this.comparer = comparer; this.isEnabled = false; this.queue = new PriorityQueue(1024); __super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype; /** * Adds a relative time value to an absolute time value. * @param {Number} absolute Absolute virtual time value. * @param {Number} relative Relative virtual time value to add. * @return {Number} Resulting absolute virtual time sum value. */ VirtualTimeSchedulerPrototype.add = notImplemented; /** * Converts an absolute time to a number * @param {Any} The absolute time. * @returns {Number} The absolute time in ms */ VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented; /** * Converts the TimeSpan value to a relative virtual time value. * @param {Number} timeSpan TimeSpan value to convert. * @return {Number} Corresponding relative virtual time value. */ VirtualTimeSchedulerPrototype.toRelative = notImplemented; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) { var s = new SchedulePeriodicRecursive(this, state, period, action); return s.start(); }; /** * Schedules an action to be executed after dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) { var runAt = this.add(this.clock, dueTime); return this.scheduleAbsoluteWithState(state, runAt, action); }; /** * Schedules an action to be executed at dueTime. * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) { return this.scheduleRelativeWithState(action, dueTime, invokeAction); }; /** * Starts the virtual time scheduler. */ VirtualTimeSchedulerPrototype.start = function () { if (!this.isEnabled) { this.isEnabled = true; do { var next = this.getNext(); if (next !== null) { this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled); } }; /** * Stops the virtual time scheduler. */ VirtualTimeSchedulerPrototype.stop = function () { this.isEnabled = false; }; /** * Advances the scheduler's clock to the specified time, running all work till that point. * @param {Number} time Absolute time to advance the scheduler's clock to. */ VirtualTimeSchedulerPrototype.advanceTo = function (time) { var dueToClock = this.comparer(this.clock, time); if (this.comparer(this.clock, time) > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } if (!this.isEnabled) { this.isEnabled = true; do { var next = this.getNext(); if (next !== null && this.comparer(next.dueTime, time) <= 0) { this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled); this.clock = time; } }; /** * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan. * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.advanceBy = function (time) { var dt = this.add(this.clock, time), dueToClock = this.comparer(this.clock, dt); if (dueToClock > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } this.advanceTo(dt); }; /** * Advances the scheduler's clock by the specified relative time. * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.sleep = function (time) { var dt = this.add(this.clock, time); if (this.comparer(this.clock, dt) >= 0) { throw new Error(argumentOutOfRange); } this.clock = dt; }; /** * Gets the next scheduled item to be executed. * @returns {ScheduledItem} The next scheduled item. */ VirtualTimeSchedulerPrototype.getNext = function () { while (this.queue.length > 0) { var next = this.queue.peek(); if (next.isCancelled()) { this.queue.dequeue(); } else { return next; } } return null; }; /** * Schedules an action to be executed at dueTime. * @param {Scheduler} scheduler Scheduler to execute the action on. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) { return this.scheduleAbsoluteWithState(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) { var self = this; function run(scheduler, state1) { self.queue.remove(si); return action(scheduler, state1); } var si = new ScheduledItem(this, state, run, dueTime, this.comparer); this.queue.enqueue(si); return si.disposable; }; return VirtualTimeScheduler; }(Scheduler)); /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */ Rx.HistoricalScheduler = (function (__super__) { inherits(HistoricalScheduler, __super__); /** * Creates a new historical scheduler with the specified initial clock value. * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function HistoricalScheduler(initialClock, comparer) { var clock = initialClock == null ? 0 : initialClock; var cmp = comparer || defaultSubComparer; __super__.call(this, clock, cmp); } var HistoricalSchedulerProto = HistoricalScheduler.prototype; /** * Adds a relative time value to an absolute time value. * @param {Number} absolute Absolute virtual time value. * @param {Number} relative Relative virtual time value to add. * @return {Number} Resulting absolute virtual time sum value. */ HistoricalSchedulerProto.add = function (absolute, relative) { return absolute + relative; }; HistoricalSchedulerProto.toDateTimeOffset = function (absolute) { return new Date(absolute).getTime(); }; /** * Converts the TimeSpan value to a relative virtual time value. * @memberOf HistoricalScheduler * @param {Number} timeSpan TimeSpan value to convert. * @return {Number} Corresponding relative virtual time value. */ HistoricalSchedulerProto.toRelative = function (timeSpan) { return timeSpan; }; return HistoricalScheduler; }(Rx.VirtualTimeScheduler)); var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); var GroupedObservable = (function (__super__) { inherits(GroupedObservable, __super__); function subscribe(observer) { return this.underlyingObservable.subscribe(observer); } function GroupedObservable(key, underlyingObservable, mergedDisposable) { __super__.call(this, subscribe); this.key = key; this.underlyingObservable = !mergedDisposable ? underlyingObservable : new AnonymousObservable(function (observer) { return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer)); }); } return GroupedObservable; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, __super__); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { __super__.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the error. * @param {Mixed} error The Error to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; this.hasValue = true; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } }.call(this));
ajax/libs/ScrollMagic/2.0.3/ScrollMagic.js
wormful/cdnjs
/*! * ScrollMagic v2.0.3 (2015-04-07) * The javascript library for magical scroll interactions. * (c) 2015 Jan Paepke (@janpaepke) * Project Website: http://janpaepke.github.io/ScrollMagic * * @version 2.0.3 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - [email protected] * * @file ScrollMagic main library. */ /** * @namespace ScrollMagic */ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(factory); } else if (typeof exports === 'object') { // CommonJS module.exports = factory(); } else { // Browser global root.ScrollMagic = factory(); } }(this, function () { "use strict"; var ScrollMagic = function () { _util.log(2, '(COMPATIBILITY NOTICE) -> As of ScrollMagic 2.0.0 you need to use \'new ScrollMagic.Controller()\' to create a new controller instance. Use \'new ScrollMagic.Scene()\' to instance a scene.'); }; ScrollMagic.version = "2.0.3"; // TODO: temporary workaround for chrome's scroll jitter bug window.addEventListener("mousewheel", function () {}); // global const var PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer"; /** * The main class that is needed once per scroll container. * * @class * * @example * // basic initialization * var controller = new ScrollMagic.Controller(); * * // passing options * var controller = new ScrollMagic.Controller({container: "#myContainer", loglevel: 3}); * * @param {object} [options] - An object containing one or more options for the controller. * @param {(string|object)} [options.container=window] - A selector, DOM object that references the main container for scrolling. * @param {boolean} [options.vertical=true] - Sets the scroll mode to vertical (`true`) or horizontal (`false`) scrolling. * @param {object} [options.globalSceneOptions={}] - These options will be passed to every Scene that is added to the controller using the addScene method. For more information on Scene options see {@link ScrollMagic.Scene}. * @param {number} [options.loglevel=2] Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. ** `0` => silent ** `1` => errors ** `2` => errors, warnings ** `3` => errors, warnings, debuginfo * @param {boolean} [options.refreshInterval=100] - Some changes don't call events by default, like changing the container size or moving a scene trigger element. This interval polls these parameters to fire the necessary events. If you don't use custom containers, trigger elements or have static layouts, where the positions of the trigger elements don't change, you can set this to 0 disable interval checking and improve performance. * */ ScrollMagic.Controller = function (options) { /* * ---------------------------------------------------------------- * settings * ---------------------------------------------------------------- */ var NAMESPACE = "ScrollMagic.Controller", SCROLL_DIRECTIONS = { f: "FORWARD", r: "REVERSE", p: "PAUSED" }, DEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults; /* * ---------------------------------------------------------------- * private vars * ---------------------------------------------------------------- */ var Controller = this, _options = _util.extend({}, DEFAULT_OPTIONS, options), _sceneObjects = [], _updateScenesOnNextCycle = false, // can be boolean (true => all scenes) or an array of scenes to be updated _scrollPos = 0, _scrollDirection = SCROLL_DIRECTIONS.p, _isDocument = true, _viewPortSize = 0, _enabled = true, _updateTimeout, _refreshTimeout; /* * ---------------------------------------------------------------- * private functions * ---------------------------------------------------------------- */ /** * Internal constructor function of the ScrollMagic Controller * @private */ var construct = function () { for (var key in _options) { if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { log(2, "WARNING: Unknown option \"" + key + "\""); delete _options[key]; } } _options.container = _util.get.elements(_options.container)[0]; // check ScrollContainer if (!_options.container) { log(1, "ERROR creating object " + NAMESPACE + ": No valid scroll container supplied"); throw NAMESPACE + " init failed."; // cancel } _isDocument = _options.container === window || _options.container === document.body || !document.body.contains(_options.container); // normalize to window if (_isDocument) { _options.container = window; } // update container size immediately _viewPortSize = getViewportSize(); // set event handlers _options.container.addEventListener("resize", onChange); _options.container.addEventListener("scroll", onChange); _options.refreshInterval = parseInt(_options.refreshInterval) || DEFAULT_OPTIONS.refreshInterval; scheduleRefresh(); log(3, "added new " + NAMESPACE + " controller (v" + ScrollMagic.version + ")"); }; /** * Schedule the next execution of the refresh function * @private */ var scheduleRefresh = function () { if (_options.refreshInterval > 0) { _refreshTimeout = window.setTimeout(refresh, _options.refreshInterval); } }; /** * Default function to get scroll pos - overwriteable using `Controller.scrollPos(newFunction)` * @private */ var getScrollPos = function () { return _options.vertical ? _util.get.scrollTop(_options.container) : _util.get.scrollLeft(_options.container); }; /** * Returns the current viewport Size (width vor horizontal, height for vertical) * @private */ var getViewportSize = function () { return _options.vertical ? _util.get.height(_options.container) : _util.get.width(_options.container); }; /** * Default function to set scroll pos - overwriteable using `Controller.scrollTo(newFunction)` * Make available publicly for pinned mousewheel workaround. * @private */ var setScrollPos = this._setScrollPos = function (pos) { if (_options.vertical) { if (_isDocument) { window.scrollTo(_util.get.scrollLeft(), pos); } else { _options.container.scrollTop = pos; } } else { if (_isDocument) { window.scrollTo(pos, _util.get.scrollTop()); } else { _options.container.scrollLeft = pos; } } }; /** * Handle updates in cycles instead of on scroll (performance) * @private */ var updateScenes = function () { if (_enabled && _updateScenesOnNextCycle) { // determine scenes to update var scenesToUpdate = _util.type.Array(_updateScenesOnNextCycle) ? _updateScenesOnNextCycle : _sceneObjects.slice(0); // reset scenes _updateScenesOnNextCycle = false; var oldScrollPos = _scrollPos; // update scroll pos now instead of onChange, as it might have changed since scheduling (i.e. in-browser smooth scroll) _scrollPos = Controller.scrollPos(); var deltaScroll = _scrollPos - oldScrollPos; if (deltaScroll !== 0) { // scroll position changed? _scrollDirection = (deltaScroll > 0) ? SCROLL_DIRECTIONS.f : SCROLL_DIRECTIONS.r; } // reverse order of scenes if scrolling reverse if (_scrollDirection === SCROLL_DIRECTIONS.r) { scenesToUpdate.reverse(); } // update scenes scenesToUpdate.forEach(function (scene, index) { log(3, "updating Scene " + (index + 1) + "/" + scenesToUpdate.length + " (" + _sceneObjects.length + " total)"); scene.update(true); }); if (scenesToUpdate.length === 0 && _options.loglevel >= 3) { log(3, "updating 0 Scenes (nothing added to controller)"); } } }; /** * Initializes rAF callback * @private */ var debounceUpdate = function () { _updateTimeout = _util.rAF(updateScenes); }; /** * Handles Container changes * @private */ var onChange = function (e) { log(3, "event fired causing an update:", e.type); if (e.type == "resize") { // resize _viewPortSize = getViewportSize(); _scrollDirection = SCROLL_DIRECTIONS.p; } // schedule update if (_updateScenesOnNextCycle !== true) { _updateScenesOnNextCycle = true; debounceUpdate(); } }; var refresh = function () { if (!_isDocument) { // simulate resize event. Only works for viewport relevant param (performance) if (_viewPortSize != getViewportSize()) { var resizeEvent; try { resizeEvent = new Event('resize', { bubbles: false, cancelable: false }); } catch (e) { // stupid IE resizeEvent = document.createEvent("Event"); resizeEvent.initEvent("resize", false, false); } _options.container.dispatchEvent(resizeEvent); } } _sceneObjects.forEach(function (scene, index) { // refresh all scenes scene.refresh(); }); scheduleRefresh(); }; /** * Send a debug message to the console. * provided publicly with _log for plugins * @private * * @param {number} loglevel - The loglevel required to initiate output for the message. * @param {...mixed} output - One or more variables that should be passed to the console. */ var log = this._log = function (loglevel, output) { if (_options.loglevel >= loglevel) { Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); _util.log.apply(window, arguments); } }; // for scenes we have getters for each option, but for the controller we don't, so we need to make it available externally for plugins this._options = _options; /** * Sort scenes in ascending order of their start offset. * @private * * @param {array} ScenesArray - an array of ScrollMagic Scenes that should be sorted * @return {array} The sorted array of Scenes. */ var sortScenes = function (ScenesArray) { if (ScenesArray.length <= 1) { return ScenesArray; } else { var scenes = ScenesArray.slice(0); scenes.sort(function (a, b) { return a.scrollOffset() > b.scrollOffset() ? 1 : -1; }); return scenes; } }; /** * ---------------------------------------------------------------- * public functions * ---------------------------------------------------------------- */ /** * Add one ore more scene(s) to the controller. * This is the equivalent to `Scene.addTo(controller)`. * @public * @example * // with a previously defined scene * controller.addScene(scene); * * // with a newly created scene. * controller.addScene(new ScrollMagic.Scene({duration : 0})); * * // adding multiple scenes * controller.addScene([scene, scene2, new ScrollMagic.Scene({duration : 0})]); * * @param {(ScrollMagic.Scene|array)} newScene - ScrollMagic Scene or Array of Scenes to be added to the controller. * @return {Controller} Parent object for chaining. */ this.addScene = function (newScene) { if (_util.type.Array(newScene)) { newScene.forEach(function (scene, index) { Controller.addScene(scene); }); } else if (newScene instanceof ScrollMagic.Scene) { if (newScene.controller() !== Controller) { newScene.addTo(Controller); } else if (_sceneObjects.indexOf(newScene) < 0) { // new scene _sceneObjects.push(newScene); // add to array _sceneObjects = sortScenes(_sceneObjects); // sort newScene.on("shift.controller_sort", function () { // resort whenever scene moves _sceneObjects = sortScenes(_sceneObjects); }); // insert Global defaults. for (var key in _options.globalSceneOptions) { if (newScene[key]) { newScene[key].call(newScene, _options.globalSceneOptions[key]); } } log(3, "adding Scene (now " + _sceneObjects.length + " total)"); } } else { log(1, "ERROR: invalid argument supplied for '.addScene()'"); } return Controller; }; /** * Remove one ore more scene(s) from the controller. * This is the equivalent to `Scene.remove()`. * @public * @example * // remove a scene from the controller * controller.removeScene(scene); * * // remove multiple scenes from the controller * controller.removeScene([scene, scene2, scene3]); * * @param {(ScrollMagic.Scene|array)} Scene - ScrollMagic Scene or Array of Scenes to be removed from the controller. * @returns {Controller} Parent object for chaining. */ this.removeScene = function (Scene) { if (_util.type.Array(Scene)) { Scene.forEach(function (scene, index) { Controller.removeScene(scene); }); } else { var index = _sceneObjects.indexOf(Scene); if (index > -1) { Scene.off("shift.controller_sort"); _sceneObjects.splice(index, 1); log(3, "removing Scene (now " + _sceneObjects.length + " left)"); Scene.remove(); } } return Controller; }; /** * Update one ore more scene(s) according to the scroll position of the container. * This is the equivalent to `Scene.update()`. * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. * _**Note:** This method gets called constantly whenever Controller detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ * @public * @example * // update a specific scene on next cycle * controller.updateScene(scene); * * // update a specific scene immediately * controller.updateScene(scene, true); * * // update multiple scenes scene on next cycle * controller.updateScene([scene1, scene2, scene3]); * * @param {ScrollMagic.Scene} Scene - ScrollMagic Scene or Array of Scenes that is/are supposed to be updated. * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle. This is useful when changing multiple properties of the scene - this way it will only be updated once all new properties are set (updateScenes). * @return {Controller} Parent object for chaining. */ this.updateScene = function (Scene, immediately) { if (_util.type.Array(Scene)) { Scene.forEach(function (scene, index) { Controller.updateScene(scene, immediately); }); } else { if (immediately) { Scene.update(true); } else if (_updateScenesOnNextCycle !== true && Scene instanceof ScrollMagic.Scene) { // if _updateScenesOnNextCycle is true, all connected scenes are already scheduled for update // prep array for next update cycle _updateScenesOnNextCycle = _updateScenesOnNextCycle || []; if (_updateScenesOnNextCycle.indexOf(Scene) == -1) { _updateScenesOnNextCycle.push(Scene); } _updateScenesOnNextCycle = sortScenes(_updateScenesOnNextCycle); // sort debounceUpdate(); } } return Controller; }; /** * Updates the controller params and calls updateScene on every scene, that is attached to the controller. * See `Controller.updateScene()` for more information about what this means. * In most cases you will not need this function, as it is called constantly, whenever ScrollMagic detects a state change event, like resize or scroll. * The only application for this method is when ScrollMagic fails to detect these events. * One application is with some external scroll libraries (like iScroll) that move an internal container to a negative offset instead of actually scrolling. In this case the update on the controller needs to be called whenever the child container's position changes. * For this case there will also be the need to provide a custom function to calculate the correct scroll position. See `Controller.scrollPos()` for details. * @public * @example * // update the controller on next cycle (saves performance due to elimination of redundant updates) * controller.update(); * * // update the controller immediately * controller.update(true); * * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance) * @return {Controller} Parent object for chaining. */ this.update = function (immediately) { onChange({ type: "resize" }); // will update size and set _updateScenesOnNextCycle to true if (immediately) { updateScenes(); } return Controller; }; /** * Scroll to a numeric scroll offset, a DOM element, the start of a scene or provide an alternate method for scrolling. * For vertical controllers it will change the top scroll offset and for horizontal applications it will change the left offset. * @public * * @since 1.1.0 * @example * // scroll to an offset of 100 * controller.scrollTo(100); * * // scroll to a DOM element * controller.scrollTo("#anchor"); * * // scroll to the beginning of a scene * var scene = new ScrollMagic.Scene({offset: 200}); * controller.scrollTo(scene); * * // define a new scroll position modification function (jQuery animate instead of jump) * controller.scrollTo(function (newScrollPos) { * $("body").animate({scrollTop: newScrollPos}); * }); * controller.scrollTo(100); // call as usual, but the new function will be used instead * * // define a new scroll function with an additional parameter * controller.scrollTo(function (newScrollPos, message) { * console.log(message); * $(this).animate({scrollTop: newScrollPos}); * }); * // call as usual, but supply an extra parameter to the defined custom function * controller.scrollTo(100, "my message"); * * // define a new scroll function with an additional parameter containing multiple variables * controller.scrollTo(function (newScrollPos, options) { * someGlobalVar = options.a + options.b; * $(this).animate({scrollTop: newScrollPos}); * }); * // call as usual, but supply an extra parameter containing multiple options * controller.scrollTo(100, {a: 1, b: 2}); * * // define a new scroll function with a callback supplied as an additional parameter * controller.scrollTo(function (newScrollPos, callback) { * $(this).animate({scrollTop: newScrollPos}, 400, "swing", callback); * }); * // call as usual, but supply an extra parameter, which is used as a callback in the previously defined custom scroll function * controller.scrollTo(100, function() { * console.log("scroll has finished."); * }); * * @param {mixed} scrollTarget - The supplied argument can be one of these types: * 1. `number` -> The container will scroll to this new scroll offset. * 2. `string` or `object` -> Can be a selector or a DOM object. * The container will scroll to the position of this element. * 3. `ScrollMagic Scene` -> The container will scroll to the start of this scene. * 4. `function` -> This function will be used for future scroll position modifications. * This provides a way for you to change the behaviour of scrolling and adding new behaviour like animation. The function receives the new scroll position as a parameter and a reference to the container element using `this`. * It may also optionally receive an optional additional parameter (see below) * _**NOTE:** * All other options will still work as expected, using the new function to scroll._ * @param {mixed} [additionalParameter] - If a custom scroll function was defined (see above 4.), you may want to supply additional parameters to it, when calling it. You can do this using this parameter – see examples for details. Please note, that this parameter will have no effect, if you use the default scrolling function. * @returns {Controller} Parent object for chaining. */ this.scrollTo = function (scrollTarget, additionalParameter) { if (_util.type.Number(scrollTarget)) { // excecute setScrollPos.call(_options.container, scrollTarget, additionalParameter); } else if (scrollTarget instanceof ScrollMagic.Scene) { // scroll to scene if (scrollTarget.controller() === Controller) { // check if the controller is associated with this scene Controller.scrollTo(scrollTarget.scrollOffset(), additionalParameter); } else { log(2, "scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.", scrollTarget); } } else if (_util.type.Function(scrollTarget)) { // assign new scroll function setScrollPos = scrollTarget; } else { // scroll to element var elem = _util.get.elements(scrollTarget)[0]; if (elem) { // if parent is pin spacer, use spacer position instead so correct start position is returned for pinned elements. while (elem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { elem = elem.parentNode; } var param = _options.vertical ? "top" : "left", // which param is of interest ? containerOffset = _util.get.offset(_options.container), // container position is needed because element offset is returned in relation to document, not in relation to container. elementOffset = _util.get.offset(elem); if (!_isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent containerOffset[param] -= Controller.scrollPos(); } Controller.scrollTo(elementOffset[param] - containerOffset[param], additionalParameter); } else { log(2, "scrollTo(): The supplied argument is invalid. Scroll cancelled.", scrollTarget); } } return Controller; }; /** * **Get** the current scrollPosition or **Set** a new method to calculate it. * -> **GET**: * When used as a getter this function will return the current scroll position. * To get a cached value use Controller.info("scrollPos"), which will be updated in the update cycle. * For vertical controllers it will return the top scroll offset and for horizontal applications it will return the left offset. * * -> **SET**: * When used as a setter this method prodes a way to permanently overwrite the controller's scroll position calculation. * A typical usecase is when the scroll position is not reflected by the containers scrollTop or scrollLeft values, but for example by the inner offset of a child container. * Moving a child container inside a parent is a commonly used method for several scrolling frameworks, including iScroll. * By providing an alternate calculation function you can make sure ScrollMagic receives the correct scroll position. * Please also bear in mind that your function should return y values for vertical scrolls an x for horizontals. * * To change the current scroll position please use `Controller.scrollTo()`. * @public * * @example * // get the current scroll Position * var scrollPos = controller.scrollPos(); * * // set a new scroll position calculation method * controller.scrollPos(function () { * return this.info("vertical") ? -mychildcontainer.y : -mychildcontainer.x * }); * * @param {function} [scrollPosMethod] - The function to be used for the scroll position calculation of the container. * @returns {(number|Controller)} Current scroll position or parent object for chaining. */ this.scrollPos = function (scrollPosMethod) { if (!arguments.length) { // get return getScrollPos.call(Controller); } else { // set if (_util.type.Function(scrollPosMethod)) { getScrollPos = scrollPosMethod; } else { log(2, "Provided value for method 'scrollPos' is not a function. To change the current scroll position use 'scrollTo()'."); } } return Controller; }; /** * **Get** all infos or one in particular about the controller. * @public * @example * // returns the current scroll position (number) * var scrollPos = controller.info("scrollPos"); * * // returns all infos as an object * var infos = controller.info(); * * @param {string} [about] - If passed only this info will be returned instead of an object containing all. Valid options are: ** `"size"` => the current viewport size of the container ** `"vertical"` => true if vertical scrolling, otherwise false ** `"scrollPos"` => the current scroll position ** `"scrollDirection"` => the last known direction of the scroll ** `"container"` => the container element ** `"isDocument"` => true if container element is the document. * @returns {(mixed|object)} The requested info(s). */ this.info = function (about) { var values = { size: _viewPortSize, // contains height or width (in regard to orientation); vertical: _options.vertical, scrollPos: _scrollPos, scrollDirection: _scrollDirection, container: _options.container, isDocument: _isDocument }; if (!arguments.length) { // get all as an object return values; } else if (values[about] !== undefined) { return values[about]; } else { log(1, "ERROR: option \"" + about + "\" is not available"); return; } }; /** * **Get** or **Set** the current loglevel option value. * @public * * @example * // get the current value * var loglevel = controller.loglevel(); * * // set a new value * controller.loglevel(3); * * @param {number} [newLoglevel] - The new loglevel setting of the Controller. `[0-3]` * @returns {(number|Controller)} Current loglevel or parent object for chaining. */ this.loglevel = function (newLoglevel) { if (!arguments.length) { // get return _options.loglevel; } else if (_options.loglevel != newLoglevel) { // set _options.loglevel = newLoglevel; } return Controller; }; /** * **Get** or **Set** the current enabled state of the controller. * This can be used to disable all Scenes connected to the controller without destroying or removing them. * @public * * @example * // get the current value * var enabled = controller.enabled(); * * // disable the controller * controller.enabled(false); * * @param {boolean} [newState] - The new enabled state of the controller `true` or `false`. * @returns {(boolean|Controller)} Current enabled state or parent object for chaining. */ this.enabled = function (newState) { if (!arguments.length) { // get return _enabled; } else if (_enabled != newState) { // set _enabled = !! newState; Controller.updateScene(_sceneObjects, true); } return Controller; }; /** * Destroy the Controller, all Scenes and everything. * @public * * @example * // without resetting the scenes * controller = controller.destroy(); * * // with scene reset * controller = controller.destroy(true); * * @param {boolean} [resetScenes=false] - If `true` the pins and tweens (if existent) of all scenes will be reset. * @returns {null} Null to unset handler variables. */ this.destroy = function (resetScenes) { window.clearTimeout(_refreshTimeout); var i = _sceneObjects.length; while (i--) { _sceneObjects[i].destroy(resetScenes); } _options.container.removeEventListener("resize", onChange); _options.container.removeEventListener("scroll", onChange); _util.cAF(_updateTimeout); log(3, "destroyed " + NAMESPACE + " (reset: " + (resetScenes ? "true" : "false") + ")"); return null; }; // INIT construct(); return Controller; }; // store pagewide controller options var CONTROLLER_OPTIONS = { defaults: { container: window, vertical: true, globalSceneOptions: {}, loglevel: 2, refreshInterval: 100 } }; /* * method used to add an option to ScrollMagic Scenes. */ ScrollMagic.Controller.addOption = function (name, defaultValue) { CONTROLLER_OPTIONS.defaults[name] = defaultValue; }; // instance extension function for plugins ScrollMagic.Controller.extend = function (extension) { var oldClass = this; ScrollMagic.Controller = function () { oldClass.apply(this, arguments); this.$super = _util.extend({}, this); // copy parent state return extension.apply(this, arguments) || this; }; _util.extend(ScrollMagic.Controller, oldClass); // copy properties ScrollMagic.Controller.prototype = oldClass.prototype; // copy prototype ScrollMagic.Controller.prototype.constructor = ScrollMagic.Controller; // restore constructor }; /** * A Scene defines where the controller should react and how. * * @class * * @example * // create a standard scene and add it to a controller * new ScrollMagic.Scene() * .addTo(controller); * * // create a scene with custom options and assign a handler to it. * var scene = new ScrollMagic.Scene({ * duration: 100, * offset: 200, * triggerHook: "onEnter", * reverse: false * }); * * @param {object} [options] - Options for the Scene. The options can be updated at any time. Instead of setting the options for each scene individually you can also set them globally in the controller as the controllers `globalSceneOptions` option. The object accepts the same properties as the ones below. When a scene is added to the controller the options defined using the Scene constructor will be overwritten by those set in `globalSceneOptions`. * @param {(number|function)} [options.duration=0] - The duration of the scene. If `0` tweens will auto-play when reaching the scene start point, pins will be pinned indefinetly starting at the start position. A function retuning the duration value is also supported. Please see `Scene.duration()` for details. * @param {number} [options.offset=0] - Offset Value for the Trigger Position. If no triggerElement is defined this will be the scroll distance from the start of the page, after which the scene will start. * @param {(string|object)} [options.triggerElement=null] - Selector or DOM object that defines the start of the scene. If undefined the scene will start right at the start of the page (unless an offset is set). * @param {(number|string)} [options.triggerHook="onCenter"] - Can be a number between 0 and 1 defining the position of the trigger Hook in relation to the viewport. Can also be defined using a string: ** `"onEnter"` => `1` ** `"onCenter"` => `0.5` ** `"onLeave"` => `0` * @param {boolean} [options.reverse=true] - Should the scene reverse, when scrolling up? * @param {number} [options.loglevel=2] - Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. ** `0` => silent ** `1` => errors ** `2` => errors, warnings ** `3` => errors, warnings, debuginfo * */ ScrollMagic.Scene = function (options) { /* * ---------------------------------------------------------------- * settings * ---------------------------------------------------------------- */ var NAMESPACE = "ScrollMagic.Scene", DEFAULT_OPTIONS = SCENE_OPTIONS.defaults; /* * ---------------------------------------------------------------- * private vars * ---------------------------------------------------------------- */ var Scene = this, _options = _util.extend({}, DEFAULT_OPTIONS, options), _state = 'BEFORE', _progress = 0, _scrollOffset = { start: 0, end: 0 }, // reflects the controllers's scroll position for the start and end of the scene respectively _triggerPos = 0, _enabled = true, _durationUpdateMethod, _controller; /** * Internal constructor function of the ScrollMagic Scene * @private */ var construct = function () { for (var key in _options) { // check supplied options if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { log(2, "WARNING: Unknown option \"" + key + "\""); delete _options[key]; } } // add getters/setters for all possible options for (var optionName in DEFAULT_OPTIONS) { addSceneOption(optionName); } // validate all options validateOption(); // set event listeners Scene.on("change.internal", function (e) { if (e.what !== "loglevel" && e.what !== "tweenChanges") { // no need for a scene update scene with these options... if (e.what === "triggerElement") { updateTriggerElementPosition(); } else if (e.what === "reverse") { // the only property left that may have an impact on the current scene state. Everything else is handled by the shift event. Scene.update(); } } }).on("shift.internal", function (e) { updateScrollOffset(); Scene.update(); // update scene to reflect new position }); }; /** * Send a debug message to the console. * @private * but provided publicly with _log for plugins * * @param {number} loglevel - The loglevel required to initiate output for the message. * @param {...mixed} output - One or more variables that should be passed to the console. */ var log = this._log = function (loglevel, output) { if (_options.loglevel >= loglevel) { Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); _util.log.apply(window, arguments); } }; /** * Add the scene to a controller. * This is the equivalent to `Controller.addScene(scene)`. * @method ScrollMagic.Scene#addTo * * @example * // add a scene to a ScrollMagic Controller * scene.addTo(controller); * * @param {ScrollMagic.Controller} controller - The controller to which the scene should be added. * @returns {Scene} Parent object for chaining. */ this.addTo = function (controller) { if (!(controller instanceof ScrollMagic.Controller)) { log(1, "ERROR: supplied argument of 'addTo()' is not a valid ScrollMagic Controller"); } else if (_controller != controller) { // new controller if (_controller) { // was associated to a different controller before, so remove it... _controller.removeScene(Scene); } _controller = controller; validateOption(); updateDuration(true); updateTriggerElementPosition(true); updateScrollOffset(); _controller.info("container").addEventListener('resize', onContainerResize); controller.addScene(Scene); Scene.trigger("add", { controller: _controller }); log(3, "added " + NAMESPACE + " to controller"); Scene.update(); } return Scene; }; /** * **Get** or **Set** the current enabled state of the scene. * This can be used to disable this scene without removing or destroying it. * @method ScrollMagic.Scene#enabled * * @example * // get the current value * var enabled = scene.enabled(); * * // disable the scene * scene.enabled(false); * * @param {boolean} [newState] - The new enabled state of the scene `true` or `false`. * @returns {(boolean|Scene)} Current enabled state or parent object for chaining. */ this.enabled = function (newState) { if (!arguments.length) { // get return _enabled; } else if (_enabled != newState) { // set _enabled = !! newState; Scene.update(true); } return Scene; }; /** * Remove the scene from the controller. * This is the equivalent to `Controller.removeScene(scene)`. * The scene will not be updated anymore until you readd it to a controller. * To remove the pin or the tween you need to call removeTween() or removePin() respectively. * @method ScrollMagic.Scene#remove * @example * // remove the scene from its controller * scene.remove(); * * @returns {Scene} Parent object for chaining. */ this.remove = function () { if (_controller) { _controller.info("container").removeEventListener('resize', onContainerResize); var tmpParent = _controller; _controller = undefined; tmpParent.removeScene(Scene); Scene.trigger("remove"); log(3, "removed " + NAMESPACE + " from controller"); } return Scene; }; /** * Destroy the scene and everything. * @method ScrollMagic.Scene#destroy * @example * // destroy the scene without resetting the pin and tween to their initial positions * scene = scene.destroy(); * * // destroy the scene and reset the pin and tween * scene = scene.destroy(true); * * @param {boolean} [reset=false] - If `true` the pin and tween (if existent) will be reset. * @returns {null} Null to unset handler variables. */ this.destroy = function (reset) { Scene.trigger("destroy", { reset: reset }); Scene.remove(); Scene.off("*.*"); log(3, "destroyed " + NAMESPACE + " (reset: " + (reset ? "true" : "false") + ")"); return null; }; /** * Updates the Scene to reflect the current state. * This is the equivalent to `Controller.updateScene(scene, immediately)`. * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. * This means an update doesn't necessarily result in a progress change. The `progress` event will be fired if the progress has indeed changed between this update and the last. * _**NOTE:** This method gets called constantly whenever ScrollMagic detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ * @method ScrollMagic.Scene#update * @example * // update the scene on next tick * scene.update(); * * // update the scene immediately * scene.update(true); * * @fires Scene.update * * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance). * @returns {Scene} Parent object for chaining. */ this.update = function (immediately) { if (_controller) { if (immediately) { if (_controller.enabled() && _enabled) { var scrollPos = _controller.info("scrollPos"), newProgress; if (_options.duration > 0) { newProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start); } else { newProgress = scrollPos >= _scrollOffset.start ? 1 : 0; } Scene.trigger("update", { startPos: _scrollOffset.start, endPos: _scrollOffset.end, scrollPos: scrollPos }); Scene.progress(newProgress); } else if (_pin && _state === "DURING") { updatePinState(true); // unpin in position } } else { _controller.updateScene(Scene, false); } } return Scene; }; /** * Updates dynamic scene variables like the trigger element position or the duration. * This method is automatically called in regular intervals from the controller. See {@link ScrollMagic.Controller} option `refreshInterval`. * * You can call it to minimize lag, for example when you intentionally change the position of the triggerElement. * If you don't it will simply be updated in the next refresh interval of the container, which is usually sufficient. * * @method ScrollMagic.Scene#refresh * @since 1.1.0 * @example * scene = new ScrollMagic.Scene({triggerElement: "#trigger"}); * * // change the position of the trigger * $("#trigger").css("top", 500); * // immediately let the scene know of this change * scene.refresh(); * * @fires {@link Scene.shift}, if the trigger element position or the duration changed * @fires {@link Scene.change}, if the duration changed * * @returns {Scene} Parent object for chaining. */ this.refresh = function () { updateDuration(); updateTriggerElementPosition(); // update trigger element position return Scene; }; /** * **Get** or **Set** the scene's progress. * Usually it shouldn't be necessary to use this as a setter, as it is set automatically by scene.update(). * The order in which the events are fired depends on the duration of the scene: * 1. Scenes with `duration == 0`: * Scenes that have no duration by definition have no ending. Thus the `end` event will never be fired. * When the trigger position of the scene is passed the events are always fired in this order: * `enter`, `start`, `progress` when scrolling forward * and * `progress`, `start`, `leave` when scrolling in reverse * 2. Scenes with `duration > 0`: * Scenes with a set duration have a defined start and end point. * When scrolling past the start position of the scene it will fire these events in this order: * `enter`, `start`, `progress` * When continuing to scroll and passing the end point it will fire these events: * `progress`, `end`, `leave` * When reversing through the end point these events are fired: * `enter`, `end`, `progress` * And when continuing to scroll past the start position in reverse it will fire: * `progress`, `start`, `leave` * In between start and end the `progress` event will be called constantly, whenever the progress changes. * * In short: * `enter` events will always trigger **before** the progress update and `leave` envents will trigger **after** the progress update. * `start` and `end` will always trigger at their respective position. * * Please review the event descriptions for details on the events and the event object that is passed to the callback. * * @method ScrollMagic.Scene#progress * @example * // get the current scene progress * var progress = scene.progress(); * * // set new scene progress * scene.progress(0.3); * * @fires {@link Scene.enter}, when used as setter * @fires {@link Scene.start}, when used as setter * @fires {@link Scene.progress}, when used as setter * @fires {@link Scene.end}, when used as setter * @fires {@link Scene.leave}, when used as setter * * @param {number} [progress] - The new progress value of the scene `[0-1]`. * @returns {number} `get` - Current scene progress. * @returns {Scene} `set` - Parent object for chaining. */ this.progress = function (progress) { if (!arguments.length) { // get return _progress; } else { // set var doUpdate = false, oldState = _state, scrollDirection = _controller ? _controller.info("scrollDirection") : 'PAUSED', reverseOrForward = _options.reverse || progress >= _progress; if (_options.duration === 0) { // zero duration scenes doUpdate = _progress != progress; _progress = progress < 1 && reverseOrForward ? 0 : 1; _state = _progress === 0 ? 'BEFORE' : 'DURING'; } else { // scenes with start and end if (progress <= 0 && _state !== 'BEFORE' && reverseOrForward) { // go back to initial state _progress = 0; _state = 'BEFORE'; doUpdate = true; } else if (progress > 0 && progress < 1 && reverseOrForward) { _progress = progress; _state = 'DURING'; doUpdate = true; } else if (progress >= 1 && _state !== 'AFTER') { _progress = 1; _state = 'AFTER'; doUpdate = true; } else if (_state === 'DURING' && !reverseOrForward) { updatePinState(); // in case we scrolled backwards mid-scene and reverse is disabled => update the pin position, so it doesn't move back as well. } } if (doUpdate) { // fire events var eventVars = { progress: _progress, state: _state, scrollDirection: scrollDirection }, stateChanged = _state != oldState; var trigger = function (eventName) { // tmp helper to simplify code Scene.trigger(eventName, eventVars); }; if (stateChanged) { // enter events if (oldState !== 'DURING') { trigger("enter"); trigger(oldState === 'BEFORE' ? "start" : "end"); } } trigger("progress"); if (stateChanged) { // leave events if (_state !== 'DURING') { trigger(_state === 'BEFORE' ? "start" : "end"); trigger("leave"); } } } return Scene; } }; /** * Update the start and end scrollOffset of the container. * The positions reflect what the controller's scroll position will be at the start and end respectively. * Is called, when: * - Scene event "change" is called with: offset, triggerHook, duration * - scroll container event "resize" is called * - the position of the triggerElement changes * - the controller changes -> addTo() * @private */ var updateScrollOffset = function () { _scrollOffset = { start: _triggerPos + _options.offset }; if (_controller && _options.triggerElement) { // take away triggerHook portion to get relative to top _scrollOffset.start -= _controller.info("size") * _options.triggerHook; } _scrollOffset.end = _scrollOffset.start + _options.duration; }; /** * Updates the duration if set to a dynamic function. * This method is called when the scene is added to a controller and in regular intervals from the controller through scene.refresh(). * * @fires {@link Scene.change}, if the duration changed * @fires {@link Scene.shift}, if the duration changed * * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. * @private */ var updateDuration = function (suppressEvents) { // update duration if (_durationUpdateMethod) { var varname = "duration"; if (changeOption(varname, _durationUpdateMethod.call(Scene)) && !suppressEvents) { // set Scene.trigger("change", { what: varname, newval: _options[varname] }); Scene.trigger("shift", { reason: varname }); } } }; /** * Updates the position of the triggerElement, if present. * This method is called ... * - ... when the triggerElement is changed * - ... when the scene is added to a (new) controller * - ... in regular intervals from the controller through scene.refresh(). * * @fires {@link Scene.shift}, if the position changed * * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. * @private */ var updateTriggerElementPosition = function (suppressEvents) { var elementPos = 0, telem = _options.triggerElement; if (_controller && telem) { var controllerInfo = _controller.info(), containerOffset = _util.get.offset(controllerInfo.container), // container position is needed because element offset is returned in relation to document, not in relation to container. param = controllerInfo.vertical ? "top" : "left"; // which param is of interest ? // if parent is spacer, use spacer position instead so correct start position is returned for pinned elements. while (telem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { telem = telem.parentNode; } var elementOffset = _util.get.offset(telem); if (!controllerInfo.isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent containerOffset[param] -= _controller.scrollPos(); } elementPos = elementOffset[param] - containerOffset[param]; } var changed = elementPos != _triggerPos; _triggerPos = elementPos; if (changed && !suppressEvents) { Scene.trigger("shift", { reason: "triggerElementPosition" }); } }; /** * Trigger a shift event, when the container is resized and the triggerHook is > 1. * @private */ var onContainerResize = function (e) { if (_options.triggerHook > 0) { Scene.trigger("shift", { reason: "containerResize" }); } }; var _validate = _util.extend(SCENE_OPTIONS.validate, { // validation for duration handled internally for reference to private var _durationMethod duration: function (val) { if (_util.type.String(val) && val.match(/^(\.|\d)*\d+%$/)) { // percentage value var perc = parseFloat(val) / 100; val = function () { return _controller ? _controller.info("size") * perc : 0; }; } if (_util.type.Function(val)) { // function _durationUpdateMethod = val; try { val = parseFloat(_durationUpdateMethod()); } catch (e) { val = -1; // will cause error below } } // val has to be float val = parseFloat(val); if (!_util.type.Number(val) || val < 0) { if (_durationUpdateMethod) { _durationUpdateMethod = undefined; throw ["Invalid return value of supplied function for option \"duration\":", val]; } else { throw ["Invalid value for option \"duration\":", val]; } } return val; } }); /** * Checks the validity of a specific or all options and reset to default if neccessary. * @private */ var validateOption = function (check) { check = arguments.length ? [check] : Object.keys(_validate); check.forEach(function (optionName, key) { var value; if (_validate[optionName]) { // there is a validation method for this option try { // validate value value = _validate[optionName](_options[optionName]); } catch (e) { // validation failed -> reset to default value = DEFAULT_OPTIONS[optionName]; var logMSG = _util.type.String(e) ? [e] : e; if (_util.type.Array(logMSG)) { logMSG[0] = "ERROR: " + logMSG[0]; logMSG.unshift(1); // loglevel 1 for error msg log.apply(this, logMSG); } else { log(1, "ERROR: Problem executing validation callback for option '" + optionName + "':", e.message); } } finally { _options[optionName] = value; } } }); }; /** * Helper used by the setter/getters for scene options * @private */ var changeOption = function (varname, newval) { var changed = false, oldval = _options[varname]; if (_options[varname] != newval) { _options[varname] = newval; validateOption(varname); // resets to default if necessary changed = oldval != _options[varname]; } return changed; }; // generate getters/setters for all options var addSceneOption = function (optionName) { if (!Scene[optionName]) { Scene[optionName] = function (newVal) { if (!arguments.length) { // get return _options[optionName]; } else { if (optionName === "duration") { // new duration is set, so any previously set function must be unset _durationUpdateMethod = undefined; } if (changeOption(optionName, newVal)) { // set Scene.trigger("change", { what: optionName, newval: _options[optionName] }); if (SCENE_OPTIONS.shifts.indexOf(optionName) > -1) { Scene.trigger("shift", { reason: optionName }); } } } return Scene; }; } }; /** * **Get** or **Set** the duration option value. * As a setter it also accepts a function returning a numeric value. * This is particularly useful for responsive setups. * * The duration is updated using the supplied function every time `Scene.refresh()` is called, which happens periodically from the controller (see ScrollMagic.Controller option `refreshInterval`). * _**NOTE:** Be aware that it's an easy way to kill performance, if you supply a function that has high CPU demand. * Even for size and position calculations it is recommended to use a variable to cache the value. (see example) * This counts double if you use the same function for multiple scenes._ * * @method ScrollMagic.Scene#duration * @example * // get the current duration value * var duration = scene.duration(); * * // set a new duration * scene.duration(300); * * // use a function to automatically adjust the duration to the window height. * var durationValueCache; * function getDuration () { * return durationValueCache; * } * function updateDuration (e) { * durationValueCache = window.innerHeight; * } * $(window).on("resize", updateDuration); // update the duration when the window size changes * $(window).triggerHandler("resize"); // set to initial value * scene.duration(getDuration); // supply duration method * * @fires {@link Scene.change}, when used as setter * @fires {@link Scene.shift}, when used as setter * @param {(number|function)} [newDuration] - The new duration of the scene. * @returns {number} `get` - Current scene duration. * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** or **Set** the offset option value. * @method ScrollMagic.Scene#offset * @example * // get the current offset * var offset = scene.offset(); * * // set a new offset * scene.offset(100); * * @fires {@link Scene.change}, when used as setter * @fires {@link Scene.shift}, when used as setter * @param {number} [newOffset] - The new offset of the scene. * @returns {number} `get` - Current scene offset. * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** or **Set** the triggerElement option value. * Does **not** fire `Scene.shift`, because changing the trigger Element doesn't necessarily mean the start position changes. This will be determined in `Scene.refresh()`, which is automatically triggered. * @method ScrollMagic.Scene#triggerElement * @example * // get the current triggerElement * var triggerElement = scene.triggerElement(); * * // set a new triggerElement using a selector * scene.triggerElement("#trigger"); * // set a new triggerElement using a DOM object * scene.triggerElement(document.getElementById("trigger")); * * @fires {@link Scene.change}, when used as setter * @param {(string|object)} [newTriggerElement] - The new trigger element for the scene. * @returns {(string|object)} `get` - Current triggerElement. * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** or **Set** the triggerHook option value. * @method ScrollMagic.Scene#triggerHook * @example * // get the current triggerHook value * var triggerHook = scene.triggerHook(); * * // set a new triggerHook using a string * scene.triggerHook("onLeave"); * // set a new triggerHook using a number * scene.triggerHook(0.7); * * @fires {@link Scene.change}, when used as setter * @fires {@link Scene.shift}, when used as setter * @param {(number|string)} [newTriggerHook] - The new triggerHook of the scene. See {@link Scene} parameter description for value options. * @returns {number} `get` - Current triggerHook (ALWAYS numerical). * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** or **Set** the reverse option value. * @method ScrollMagic.Scene#reverse * @example * // get the current reverse option * var reverse = scene.reverse(); * * // set new reverse option * scene.reverse(false); * * @fires {@link Scene.change}, when used as setter * @param {boolean} [newReverse] - The new reverse setting of the scene. * @returns {boolean} `get` - Current reverse option value. * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** or **Set** the loglevel option value. * @method ScrollMagic.Scene#loglevel * @example * // get the current loglevel * var loglevel = scene.loglevel(); * * // set new loglevel * scene.loglevel(3); * * @fires {@link Scene.change}, when used as setter * @param {number} [newLoglevel] - The new loglevel setting of the scene. `[0-3]` * @returns {number} `get` - Current loglevel. * @returns {Scene} `set` - Parent object for chaining. */ /** * **Get** the associated controller. * @method ScrollMagic.Scene#controller * @example * // get the controller of a scene * var controller = scene.controller(); * * @returns {ScrollMagic.Controller} Parent controller or `undefined` */ this.controller = function () { return _controller; }; /** * **Get** the current state. * @method ScrollMagic.Scene#state * @example * // get the current state * var state = scene.state(); * * @returns {string} `"BEFORE"`, `"DURING"` or `"AFTER"` */ this.state = function () { return _state; }; /** * **Get** the current scroll offset for the start of the scene. * Mind, that the scrollOffset is related to the size of the container, if `triggerHook` is bigger than `0` (or `"onLeave"`). * This means, that resizing the container or changing the `triggerHook` will influence the scene's start offset. * @method ScrollMagic.Scene#scrollOffset * @example * // get the current scroll offset for the start and end of the scene. * var start = scene.scrollOffset(); * var end = scene.scrollOffset() + scene.duration(); * console.log("the scene starts at", start, "and ends at", end); * * @returns {number} The scroll offset (of the container) at which the scene will trigger. Y value for vertical and X value for horizontal scrolls. */ this.scrollOffset = function () { return _scrollOffset.start; }; /** * **Get** the trigger position of the scene (including the value of the `offset` option). * @method ScrollMagic.Scene#triggerPosition * @example * // get the scene's trigger position * var triggerPosition = scene.triggerPosition(); * * @returns {number} Start position of the scene. Top position value for vertical and left position value for horizontal scrolls. */ this.triggerPosition = function () { var pos = _options.offset; // the offset is the basis if (_controller) { // get the trigger position if (_options.triggerElement) { // Element as trigger pos += _triggerPos; } else { // return the height of the triggerHook to start at the beginning pos += _controller.info("size") * Scene.triggerHook(); } } return pos; }; /* * ---------------------------------------------------------------- * Event Management * ---------------------------------------------------------------- */ var _listeners = {}; /** * Scene start event. * Fires whenever the scroll position its the starting point of the scene. * It will also fire when scrolling back up going over the start position of the scene. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. * * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. * * @event ScrollMagic.Scene#start * * @example * scene.on("start", function (event) { * console.log("Hit start point of scene."); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.progress - Reflects the current progress of the scene * @property {string} event.state - The current state of the scene `"BEFORE"` or `"DURING"` * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` */ /** * Scene end event. * Fires whenever the scroll position its the ending point of the scene. * It will also fire when scrolling back up from after the scene and going over its end position. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. * * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. * * @event ScrollMagic.Scene#end * * @example * scene.on("end", function (event) { * console.log("Hit end point of scene."); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.progress - Reflects the current progress of the scene * @property {string} event.state - The current state of the scene `"DURING"` or `"AFTER"` * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` */ /** * Scene enter event. * Fires whenever the scene enters the "DURING" state. * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene enters its active scroll timeframe, regardless of the scroll-direction. * * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. * * @event ScrollMagic.Scene#enter * * @example * scene.on("enter", function (event) { * console.log("Scene entered."); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.progress - Reflects the current progress of the scene * @property {string} event.state - The current state of the scene - always `"DURING"` * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` */ /** * Scene leave event. * Fires whenever the scene's state goes from "DURING" to either "BEFORE" or "AFTER". * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene leaves its active scroll timeframe, regardless of the scroll-direction. * * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. * * @event ScrollMagic.Scene#leave * * @example * scene.on("leave", function (event) { * console.log("Scene left."); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.progress - Reflects the current progress of the scene * @property {string} event.state - The current state of the scene `"BEFORE"` or `"AFTER"` * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` */ /** * Scene update event. * Fires whenever the scene is updated (but not necessarily changes the progress). * * @event ScrollMagic.Scene#update * * @example * scene.on("update", function (event) { * console.log("Scene updated."); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.startPos - The starting position of the scene (in relation to the conainer) * @property {number} event.endPos - The ending position of the scene (in relation to the conainer) * @property {number} event.scrollPos - The current scroll position of the container */ /** * Scene progress event. * Fires whenever the progress of the scene changes. * * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. * * @event ScrollMagic.Scene#progress * * @example * scene.on("progress", function (event) { * console.log("Scene progress changed to " + event.progress); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {number} event.progress - Reflects the current progress of the scene * @property {string} event.state - The current state of the scene `"BEFORE"`, `"DURING"` or `"AFTER"` * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` */ /** * Scene change event. * Fires whenvever a property of the scene is changed. * * @event ScrollMagic.Scene#change * * @example * scene.on("change", function (event) { * console.log("Scene Property \"" + event.what + "\" changed to " + event.newval); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {string} event.what - Indicates what value has been changed * @property {mixed} event.newval - The new value of the changed property */ /** * Scene shift event. * Fires whenvever the start or end **scroll offset** of the scene change. * This happens explicitely, when one of these values change: `offset`, `duration` or `triggerHook`. * It will fire implicitly when the `triggerElement` changes, if the new element has a different position (most cases). * It will also fire implicitly when the size of the container changes and the triggerHook is anything other than `onLeave`. * * @event ScrollMagic.Scene#shift * @since 1.1.0 * * @example * scene.on("shift", function (event) { * console.log("Scene moved, because the " + event.reason + " has changed.)"); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {string} event.reason - Indicates why the scene has shifted */ /** * Scene destroy event. * Fires whenvever the scene is destroyed. * This can be used to tidy up custom behaviour used in events. * * @event ScrollMagic.Scene#destroy * @since 1.1.0 * * @example * scene.on("enter", function (event) { * // add custom action * $("#my-elem").left("200"); * }) * .on("destroy", function (event) { * // reset my element to start position * if (event.reset) { * $("#my-elem").left("0"); * } * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {boolean} event.reset - Indicates if the destroy method was called with reset `true` or `false`. */ /** * Scene add event. * Fires when the scene is added to a controller. * This is mostly used by plugins to know that change might be due. * * @event ScrollMagic.Scene#add * @since 2.0.0 * * @example * scene.on("add", function (event) { * console.log('Scene was added to a new controller.'); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event * @property {boolean} event.controller - The controller object the scene was added to. */ /** * Scene remove event. * Fires when the scene is removed from a controller. * This is mostly used by plugins to know that change might be due. * * @event ScrollMagic.Scene#remove * @since 2.0.0 * * @example * scene.on("remove", function (event) { * console.log('Scene was removed from its controller.'); * }); * * @property {object} event - The event Object passed to each callback * @property {string} event.type - The name of the event * @property {Scene} event.target - The Scene object that triggered this event */ /** * Add one ore more event listener. * The callback function will be fired at the respective event, and an object containing relevant data will be passed to the callback. * @method ScrollMagic.Scene#on * * @example * function callback (event) { * console.log("Event fired! (" + event.type + ")"); * } * // add listeners * scene.on("change update progress start end enter leave", callback); * * @param {string} names - The name or names of the event the callback should be attached to. * @param {function} callback - A function that should be executed, when the event is dispatched. An event object will be passed to the callback. * @returns {Scene} Parent object for chaining. */ this.on = function (names, callback) { if (_util.type.Function(callback)) { names = names.trim().split(' '); names.forEach(function (fullname) { var nameparts = fullname.split('.'), eventname = nameparts[0], namespace = nameparts[1]; if (eventname != "*") { // disallow wildcards if (!_listeners[eventname]) { _listeners[eventname] = []; } _listeners[eventname].push({ namespace: namespace || '', callback: callback }); } }); } else { log(1, "ERROR when calling '.on()': Supplied callback for '" + names + "' is not a valid function!"); } return Scene; }; /** * Remove one or more event listener. * @method ScrollMagic.Scene#off * * @example * function callback (event) { * console.log("Event fired! (" + event.type + ")"); * } * // add listeners * scene.on("change update", callback); * // remove listeners * scene.off("change update", callback); * * @param {string} names - The name or names of the event that should be removed. * @param {function} [callback] - A specific callback function that should be removed. If none is passed all callbacks to the event listener will be removed. * @returns {Scene} Parent object for chaining. */ this.off = function (names, callback) { if (!names) { log(1, "ERROR: Invalid event name supplied."); return Scene; } names = names.trim().split(' '); names.forEach(function (fullname, key) { var nameparts = fullname.split('.'), eventname = nameparts[0], namespace = nameparts[1] || '', removeList = eventname === '*' ? Object.keys(_listeners) : [eventname]; removeList.forEach(function (remove) { var list = _listeners[remove] || [], i = list.length; while (i--) { var listener = list[i]; if (listener && (namespace === listener.namespace || namespace === '*') && (!callback || callback == listener.callback)) { list.splice(i, 1); } } if (!list.length) { delete _listeners[remove]; } }); }); return Scene; }; /** * Trigger an event. * @method ScrollMagic.Scene#trigger * * @example * this.trigger("change"); * * @param {string} name - The name of the event that should be triggered. * @param {object} [vars] - An object containing info that should be passed to the callback. * @returns {Scene} Parent object for chaining. */ this.trigger = function (name, vars) { if (name) { var nameparts = name.trim().split('.'), eventname = nameparts[0], namespace = nameparts[1], listeners = _listeners[eventname]; log(3, 'event fired:', eventname, vars ? "->" : '', vars || ''); if (listeners) { listeners.forEach(function (listener, key) { if (!namespace || namespace === listener.namespace) { listener.callback.call(Scene, new ScrollMagic.Event(eventname, listener.namespace, Scene, vars)); } }); } } else { log(1, "ERROR: Invalid event name supplied."); } return Scene; }; var _pin, _pinOptions; Scene.on("shift.internal", function (e) { var durationChanged = e.reason === "duration"; if ((_state === "AFTER" && durationChanged) || (_state === 'DURING' && _options.duration === 0)) { // if [duration changed after a scene (inside scene progress updates pin position)] or [duration is 0, we are in pin phase and some other value changed]. updatePinState(); } if (durationChanged) { updatePinDimensions(); } }).on("progress.internal", function (e) { updatePinState(); }).on("add.internal", function (e) { updatePinDimensions(); }).on("destroy.internal", function (e) { Scene.removePin(e.reset); }); /** * Update the pin state. * @private */ var updatePinState = function (forceUnpin) { if (_pin && _controller) { var containerInfo = _controller.info(); if (!forceUnpin && _state === "DURING") { // during scene or if duration is 0 and we are past the trigger // pinned state if (_util.css(_pin, "position") != "fixed") { // change state before updating pin spacer (position changes due to fixed collapsing might occur.) _util.css(_pin, { "position": "fixed" }); // update pin spacer updatePinDimensions(); } var fixedPos = _util.get.offset(_pinOptions.spacer, true), // get viewport position of spacer scrollDistance = _options.reverse || _options.duration === 0 ? containerInfo.scrollPos - _scrollOffset.start // quicker : Math.round(_progress * _options.duration * 10) / 10; // if no reverse and during pin the position needs to be recalculated using the progress // add scrollDistance fixedPos[containerInfo.vertical ? "top" : "left"] += scrollDistance; // set new values _util.css(_pin, { top: fixedPos.top, left: fixedPos.left }); } else { // unpinned state var newCSS = { position: _pinOptions.inFlow ? "relative" : "absolute", top: 0, left: 0 }, change = _util.css(_pin, "position") != newCSS.position; if (!_pinOptions.pushFollowers) { newCSS[containerInfo.vertical ? "top" : "left"] = _options.duration * _progress; } else if (_options.duration > 0) { // only concerns scenes with duration if (_state === "AFTER" && parseFloat(_util.css(_pinOptions.spacer, "padding-top")) === 0) { change = true; // if in after state but havent updated spacer yet (jumped past pin) } else if (_state === "BEFORE" && parseFloat(_util.css(_pinOptions.spacer, "padding-bottom")) === 0) { // before change = true; // jumped past fixed state upward direction } } // set new values _util.css(_pin, newCSS); if (change) { // update pin spacer if state changed updatePinDimensions(); } } } }; /** * Update the pin spacer and/or element size. * The size of the spacer needs to be updated whenever the duration of the scene changes, if it is to push down following elements. * @private */ var updatePinDimensions = function () { if (_pin && _controller && _pinOptions.inFlow) { // no spacerresize, if original position is absolute var after = (_state === "AFTER"), before = (_state === "BEFORE"), during = (_state === "DURING"), vertical = _controller.info("vertical"), spacerChild = _pinOptions.spacer.children[0], // usually the pined element but can also be another spacer (cascaded pins) marginCollapse = _util.isMarginCollapseType(_util.css(_pinOptions.spacer, "display")), css = {}; // set new size // if relsize: spacer -> pin | else: pin -> spacer if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { if (during) { _util.css(_pin, { "width": _util.get.width(_pinOptions.spacer) }); } else { _util.css(_pin, { "width": "100%" }); } } else { // minwidth is needed for cascaded pins. css["min-width"] = _util.get.width(vertical ? _pin : spacerChild, true, true); css.width = during ? css["min-width"] : "auto"; } if (_pinOptions.relSize.height) { if (during) { // the only padding the spacer should ever include is the duration (if pushFollowers = true), so we need to substract that. _util.css(_pin, { "height": _util.get.height(_pinOptions.spacer) - (_pinOptions.pushFollowers ? _options.duration : 0) }); } else { _util.css(_pin, { "height": "100%" }); } } else { // margin is only included if it's a cascaded pin to resolve an IE9 bug css["min-height"] = _util.get.height(vertical ? spacerChild : _pin, true, !marginCollapse); // needed for cascading pins css.height = during ? css["min-height"] : "auto"; } // add space for duration if pushFollowers is true if (_pinOptions.pushFollowers) { css["padding" + (vertical ? "Top" : "Left")] = _options.duration * _progress; css["padding" + (vertical ? "Bottom" : "Right")] = _options.duration * (1 - _progress); } _util.css(_pinOptions.spacer, css); } }; /** * Updates the Pin state (in certain scenarios) * If the controller container is not the document and we are mid-pin-phase scrolling or resizing the main document can result to wrong pin positions. * So this function is called on resize and scroll of the document. * @private */ var updatePinInContainer = function () { if (_controller && _pin && _state === "DURING" && !_controller.info("isDocument")) { updatePinState(); } }; /** * Updates the Pin spacer size state (in certain scenarios) * If container is resized during pin and relatively sized the size of the pin might need to be updated... * So this function is called on resize of the container. * @private */ var updateRelativePinSpacer = function () { if (_controller && _pin && // well, duh _state === "DURING" && // element in pinned state? ( // is width or height relatively sized, but not in relation to body? then we need to recalc. ((_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) && _util.get.width(window) != _util.get.width(_pinOptions.spacer.parentNode)) || (_pinOptions.relSize.height && _util.get.height(window) != _util.get.height(_pinOptions.spacer.parentNode)))) { updatePinDimensions(); } }; /** * Is called, when the mousewhel is used while over a pinned element inside a div container. * If the scene is in fixed state scroll events would be counted towards the body. This forwards the event to the scroll container. * @private */ var onMousewheelOverPin = function (e) { if (_controller && _pin && _state === "DURING" && !_controller.info("isDocument")) { // in pin state e.preventDefault(); _controller._setScrollPos(_controller.info("scrollPos") - ((e.wheelDelta || e[_controller.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || -e.detail * 30)); } }; /** * Pin an element for the duration of the tween. * If the scene duration is 0 the element will only be unpinned, if the user scrolls back past the start position. * Make sure only one pin is applied to an element at the same time. * An element can be pinned multiple times, but only successively. * _**NOTE:** The option `pushFollowers` has no effect, when the scene duration is 0._ * @method ScrollMagic.Scene#setPin * @example * // pin element and push all following elements down by the amount of the pin duration. * scene.setPin("#pin"); * * // pin element and keeping all following elements in their place. The pinned element will move past them. * scene.setPin("#pin", {pushFollowers: false}); * * @param {(string|object)} element - A Selector targeting an element or a DOM object that is supposed to be pinned. * @param {object} [settings] - settings for the pin * @param {boolean} [settings.pushFollowers=true] - If `true` following elements will be "pushed" down for the duration of the pin, if `false` the pinned element will just scroll past them. Ignored, when duration is `0`. * @param {string} [settings.spacerClass="scrollmagic-pin-spacer"] - Classname of the pin spacer element, which is used to replace the element. * * @returns {Scene} Parent object for chaining. */ this.setPin = function (element, settings) { var defaultSettings = { pushFollowers: true, spacerClass: "scrollmagic-pin-spacer" }; settings = _util.extend({}, defaultSettings, settings); // validate Element element = _util.get.elements(element)[0]; if (!element) { log(1, "ERROR calling method 'setPin()': Invalid pin element supplied."); return Scene; // cancel } else if (_util.css(element, "position") === "fixed") { log(1, "ERROR calling method 'setPin()': Pin does not work with elements that are positioned 'fixed'."); return Scene; // cancel } if (_pin) { // preexisting pin? if (_pin === element) { // same pin we already have -> do nothing return Scene; // cancel } else { // kill old pin Scene.removePin(); } } _pin = element; var parentDisplay = _pin.parentNode.style.display, boundsParams = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"]; _pin.parentNode.style.display = 'none'; // hack start to force css to return stylesheet values instead of calculated px values. var inFlow = _util.css(_pin, "position") != "absolute", pinCSS = _util.css(_pin, boundsParams.concat(["display"])), sizeCSS = _util.css(_pin, ["width", "height"]); _pin.parentNode.style.display = parentDisplay; // hack end. if (!inFlow && settings.pushFollowers) { log(2, "WARNING: If the pinned element is positioned absolutely pushFollowers will be disabled."); settings.pushFollowers = false; } window.setTimeout(function () { // wait until all finished, because with responsive duration it will only be set after scene is added to controller if (_pin && _options.duration === 0 && settings.pushFollowers) { log(2, "WARNING: pushFollowers =", true, "has no effect, when scene duration is 0."); } }, 0); // create spacer and insert var spacer = _pin.parentNode.insertBefore(document.createElement('div'), _pin), spacerCSS = _util.extend(pinCSS, { position: inFlow ? "relative" : "absolute", boxSizing: "content-box", mozBoxSizing: "content-box", webkitBoxSizing: "content-box" }); if (!inFlow) { // copy size if positioned absolutely, to work for bottom/right positioned elements. _util.extend(spacerCSS, _util.css(_pin, ["width", "height"])); } _util.css(spacer, spacerCSS); spacer.setAttribute(PIN_SPACER_ATTRIBUTE, ""); _util.addClass(spacer, settings.spacerClass); // set the pin Options _pinOptions = { spacer: spacer, relSize: { // save if size is defined using % values. if so, handle spacer resize differently... width: sizeCSS.width.slice(-1) === "%", height: sizeCSS.height.slice(-1) === "%", autoFullWidth: sizeCSS.width === "auto" && inFlow && _util.isMarginCollapseType(pinCSS.display) }, pushFollowers: settings.pushFollowers, inFlow: inFlow, // stores if the element takes up space in the document flow }; if (!_pin.___origStyle) { _pin.___origStyle = {}; var pinInlineCSS = _pin.style, copyStyles = boundsParams.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]); copyStyles.forEach(function (val) { _pin.___origStyle[val] = pinInlineCSS[val] || ""; }); } // if relative size, transfer it to spacer and make pin calculate it... if (_pinOptions.relSize.width) { _util.css(spacer, { width: sizeCSS.width }); } if (_pinOptions.relSize.height) { _util.css(spacer, { height: sizeCSS.height }); } // now place the pin element inside the spacer spacer.appendChild(_pin); // and set new css _util.css(_pin, { position: inFlow ? "relative" : "absolute", margin: "auto", top: "auto", left: "auto", bottom: "auto", right: "auto" }); if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { _util.css(_pin, { boxSizing: "border-box", mozBoxSizing: "border-box", webkitBoxSizing: "border-box" }); } // add listener to document to update pin position in case controller is not the document. window.addEventListener('scroll', updatePinInContainer); window.addEventListener('resize', updatePinInContainer); window.addEventListener('resize', updateRelativePinSpacer); // add mousewheel listener to catch scrolls over fixed elements _pin.addEventListener("mousewheel", onMousewheelOverPin); _pin.addEventListener("DOMMouseScroll", onMousewheelOverPin); log(3, "added pin"); // finally update the pin to init updatePinState(); return Scene; }; /** * Remove the pin from the scene. * @method ScrollMagic.Scene#removePin * @example * // remove the pin from the scene without resetting it (the spacer is not removed) * scene.removePin(); * * // remove the pin from the scene and reset the pin element to its initial position (spacer is removed) * scene.removePin(true); * * @param {boolean} [reset=false] - If `false` the spacer will not be removed and the element's position will not be reset. * @returns {Scene} Parent object for chaining. */ this.removePin = function (reset) { if (_pin) { if (_state === "DURING") { updatePinState(true); // force unpin at position } if (reset || !_controller) { // if there's no controller no progress was made anyway... var spacerChild = _pinOptions.spacer.children[0]; // usually the pin element, but may be another spacer... if (spacerChild.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // copy margins to child spacer var style = _pinOptions.spacer.style, values = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"]; margins = {}; values.forEach(function (val) { margins[val] = style[val] || ""; }); _util.css(spacerChild, margins); } _pinOptions.spacer.parentNode.insertBefore(spacerChild, _pinOptions.spacer); _pinOptions.spacer.parentNode.removeChild(_pinOptions.spacer); if (!_pin.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // if it's the last pin for this element -> restore inline styles // TODO: only correctly set for first pin (when cascading) - how to fix? _util.css(_pin, _pin.___origStyle); delete _pin.___origStyle; } } window.removeEventListener('scroll', updatePinInContainer); window.removeEventListener('resize', updatePinInContainer); window.removeEventListener('resize', updateRelativePinSpacer); _pin.removeEventListener("mousewheel", onMousewheelOverPin); _pin.removeEventListener("DOMMouseScroll", onMousewheelOverPin); _pin = undefined; log(3, "removed pin (reset: " + (reset ? "true" : "false") + ")"); } return Scene; }; var _cssClasses, _cssClassElems = []; Scene.on("destroy.internal", function (e) { Scene.removeClassToggle(e.reset); }); /** * Define a css class modification while the scene is active. * When the scene triggers the classes will be added to the supplied element and removed, when the scene is over. * If the scene duration is 0 the classes will only be removed if the user scrolls back past the start position. * @method ScrollMagic.Scene#setClassToggle * @example * // add the class 'myclass' to the element with the id 'my-elem' for the duration of the scene * scene.setClassToggle("#my-elem", "myclass"); * * // add multiple classes to multiple elements defined by the selector '.classChange' * scene.setClassToggle(".classChange", "class1 class2 class3"); * * @param {(string|object)} element - A Selector targeting one or more elements or a DOM object that is supposed to be modified. * @param {string} classes - One or more Classnames (separated by space) that should be added to the element during the scene. * * @returns {Scene} Parent object for chaining. */ this.setClassToggle = function (element, classes) { var elems = _util.get.elements(element); if (elems.length === 0 || !_util.type.String(classes)) { log(1, "ERROR calling method 'setClassToggle()': Invalid " + (elems.length === 0 ? "element" : "classes") + " supplied."); return Scene; } if (_cssClassElems.length > 0) { // remove old ones Scene.removeClassToggle(); } _cssClasses = classes; _cssClassElems = elems; Scene.on("enter.internal_class leave.internal_class", function (e) { var toggle = e.type === "enter" ? _util.addClass : _util.removeClass; _cssClassElems.forEach(function (elem, key) { toggle(elem, _cssClasses); }); }); return Scene; }; /** * Remove the class binding from the scene. * @method ScrollMagic.Scene#removeClassToggle * @example * // remove class binding from the scene without reset * scene.removeClassToggle(); * * // remove class binding and remove the changes it caused * scene.removeClassToggle(true); * * @param {boolean} [reset=false] - If `false` and the classes are currently active, they will remain on the element. If `true` they will be removed. * @returns {Scene} Parent object for chaining. */ this.removeClassToggle = function (reset) { if (reset) { _cssClassElems.forEach(function (elem, key) { _util.removeClass(elem, _cssClasses); }); } Scene.off("start.internal_class end.internal_class"); _cssClasses = undefined; _cssClassElems = []; return Scene; }; // INIT construct(); return Scene; }; // store pagewide scene options var SCENE_OPTIONS = { defaults: { duration: 0, offset: 0, triggerElement: undefined, triggerHook: 0.5, reverse: true, loglevel: 2 }, validate: { offset: function (val) { val = parseFloat(val); if (!_util.type.Number(val)) { throw ["Invalid value for option \"offset\":", val]; } return val; }, triggerElement: function (val) { val = val || undefined; if (val) { var elem = _util.get.elements(val)[0]; if (elem) { val = elem; } else { throw ["Element defined in option \"triggerElement\" was not found:", val]; } } return val; }, triggerHook: function (val) { var translate = { "onCenter": 0.5, "onEnter": 1, "onLeave": 0 }; if (_util.type.Number(val)) { val = Math.max(0, Math.min(parseFloat(val), 1)); // make sure its betweeen 0 and 1 } else if (val in translate) { val = translate[val]; } else { throw ["Invalid value for option \"triggerHook\": ", val]; } return val; }, reverse: function (val) { return !!val; // force boolean }, loglevel: function (val) { val = parseInt(val); if (!_util.type.Number(val) || val < 0 || val > 3) { throw ["Invalid value for option \"loglevel\":", val]; } return val; } }, // holder for validation methods. duration validation is handled in 'getters-setters.js' shifts: ["duration", "offset", "triggerHook"], // list of options that trigger a `shift` event }; /* * method used to add an option to ScrollMagic Scenes. * TODO: DOC (private for dev) */ ScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) { if (!(name in SCENE_OPTIONS.defaults)) { SCENE_OPTIONS.defaults[name] = defaultValue; SCENE_OPTIONS.validate[name] = validationCallback; if (shifts) { SCENE_OPTIONS.shifts.push(name); } } else { ScrollMagic._util.log(1, "[static] ScrollMagic.Scene -> Cannot add Scene option '" + name + "', because it already exists."); } }; // instance extension function for plugins // TODO: DOC (private for dev) ScrollMagic.Scene.extend = function (extension) { var oldClass = this; ScrollMagic.Scene = function () { oldClass.apply(this, arguments); this.$super = _util.extend({}, this); // copy parent state return extension.apply(this, arguments) || this; }; _util.extend(ScrollMagic.Scene, oldClass); // copy properties ScrollMagic.Scene.prototype = oldClass.prototype; // copy prototype ScrollMagic.Scene.prototype.constructor = ScrollMagic.Scene; // restore constructor }; /** * TODO: DOCS (private for dev) * @class * @private */ ScrollMagic.Event = function (type, namespace, target, vars) { vars = vars || {}; for (var key in vars) { this[key] = vars[key]; } this.type = type; this.target = this.currentTarget = target; this.namespace = namespace || ''; this.timeStamp = this.timestamp = Date.now(); return this; }; /* * TODO: DOCS (private for dev) */ var _util = ScrollMagic._util = (function (window) { var U = {}, i; /** * ------------------------------ * internal helpers * ------------------------------ */ // parse float and fall back to 0. var floatval = function (number) { return parseFloat(number) || 0; }; // get current style IE safe (otherwise IE would return calculated values for 'auto') var _getComputedStyle = function (elem) { return elem.currentStyle ? elem.currentStyle : window.getComputedStyle(elem); }; // get element dimension (width or height) var _dimension = function (which, elem, outer, includeMargin) { elem = (elem === document) ? window : elem; if (elem === window) { includeMargin = false; } else if (!_type.DomElement(elem)) { return 0; } which = which.charAt(0).toUpperCase() + which.substr(1).toLowerCase(); var dimension = (outer ? elem['offset' + which] || elem['outer' + which] : elem['client' + which] || elem['inner' + which]) || 0; if (outer && includeMargin) { var style = _getComputedStyle(elem); dimension += which === 'Height' ? floatval(style.marginTop) + floatval(style.marginBottom) : floatval(style.marginLeft) + floatval(style.marginRight); } return dimension; }; // converts 'margin-top' into 'marginTop' var _camelCase = function (str) { return str.replace(/^[^a-z]+([a-z])/g, '$1').replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); }; /** * ------------------------------ * external helpers * ------------------------------ */ // extend obj – same as jQuery.extend({}, objA, objB) U.extend = function (obj) { obj = obj || {}; for (i = 1; i < arguments.length; i++) { if (!arguments[i]) { continue; } for (var key in arguments[i]) { if (arguments[i].hasOwnProperty(key)) { obj[key] = arguments[i][key]; } } } return obj; }; // check if a css display type results in margin-collapse or not U.isMarginCollapseType = function (str) { return ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(str) > -1; }; // implementation of requestAnimationFrame // based on https://gist.github.com/paulirish/1579671 var lastTime = 0, vendors = ['ms', 'moz', 'webkit', 'o']; var _requestAnimationFrame = window.requestAnimationFrame; var _cancelAnimationFrame = window.cancelAnimationFrame; // try vendor prefixes if the above doesn't work for (i = 0; !_requestAnimationFrame && i < vendors.length; ++i) { _requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame']; _cancelAnimationFrame = window[vendors[i] + 'CancelAnimationFrame'] || window[vendors[i] + 'CancelRequestAnimationFrame']; } // fallbacks if (!_requestAnimationFrame) { _requestAnimationFrame = function (callback) { var currTime = new Date().getTime(), timeToCall = Math.max(0, 16 - (currTime - lastTime)), id = window.setTimeout(function () { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; } if (!_cancelAnimationFrame) { _cancelAnimationFrame = function (id) { window.clearTimeout(id); }; } U.rAF = _requestAnimationFrame.bind(window); U.cAF = _cancelAnimationFrame.bind(window); var loglevels = ["error", "warn", "log"], console = window.console || {}; console.log = console.log || function () {}; // no console log, well - do nothing then... // make sure methods for all levels exist. for (i = 0; i < loglevels.length; i++) { var method = loglevels[i]; if (!console[method]) { console[method] = console.log; // prefer .log over nothing } } U.log = function (loglevel) { if (loglevel > loglevels.length || loglevel <= 0) loglevel = loglevels.length; var now = new Date(), time = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2) + ":" + ("0" + now.getSeconds()).slice(-2) + ":" + ("00" + now.getMilliseconds()).slice(-3), method = loglevels[loglevel - 1], args = Array.prototype.splice.call(arguments, 1), func = Function.prototype.bind.call(console[method], console); args.unshift(time); func.apply(console, args); }; /** * ------------------------------ * type testing * ------------------------------ */ var _type = U.type = function (v) { return Object.prototype.toString.call(v).replace(/^\[object (.+)\]$/, "$1").toLowerCase(); }; _type.String = function (v) { return _type(v) === 'string'; }; _type.Function = function (v) { return _type(v) === 'function'; }; _type.Array = function (v) { return Array.isArray(v); }; _type.Number = function (v) { return !_type.Array(v) && (v - parseFloat(v) + 1) >= 0; }; _type.DomElement = function (o) { return ( typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"); }; /** * ------------------------------ * DOM Element info * ------------------------------ */ // always returns a list of matching DOM elements, from a selector, a DOM element or an list of elements or even an array of selectors var _get = U.get = {}; _get.elements = function (selector) { var arr = []; if (_type.String(selector)) { try { selector = document.querySelectorAll(selector); } catch (e) { // invalid selector return arr; } } if (_type(selector) === 'nodelist' || _type.Array(selector)) { for (var i = 0, ref = arr.length = selector.length; i < ref; i++) { // list of elements var elem = selector[i]; arr[i] = _type.DomElement(elem) ? elem : _get.elements(elem); // if not an element, try to resolve recursively } } else if (_type.DomElement(selector) || selector === document || selector === window) { arr = [selector]; // only the element } return arr; }; // get scroll top value _get.scrollTop = function (elem) { return (elem && typeof elem.scrollTop === 'number') ? elem.scrollTop : window.pageYOffset || 0; }; // get scroll left value _get.scrollLeft = function (elem) { return (elem && typeof elem.scrollLeft === 'number') ? elem.scrollLeft : window.pageXOffset || 0; }; // get element height _get.width = function (elem, outer, includeMargin) { return _dimension('width', elem, outer, includeMargin); }; // get element width _get.height = function (elem, outer, includeMargin) { return _dimension('height', elem, outer, includeMargin); }; // get element position (optionally relative to viewport) _get.offset = function (elem, relativeToViewport) { var offset = { top: 0, left: 0 }; if (elem && elem.getBoundingClientRect) { // check if available var rect = elem.getBoundingClientRect(); offset.top = rect.top; offset.left = rect.left; if (!relativeToViewport) { // clientRect is by default relative to viewport... offset.top += _get.scrollTop(); offset.left += _get.scrollLeft(); } } return offset; }; /** * ------------------------------ * DOM Element manipulation * ------------------------------ */ U.addClass = function (elem, classname) { if (classname) { if (elem.classList) elem.classList.add(classname); else elem.className += ' ' + classname; } }; U.removeClass = function (elem, classname) { if (classname) { if (elem.classList) elem.classList.remove(classname); else elem.className = elem.className.replace(new RegExp('(^|\\b)' + classname.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); } }; // if options is string -> returns css value // if options is array -> returns object with css value pairs // if options is object -> set new css values U.css = function (elem, options) { if (_type.String(options)) { return _getComputedStyle(elem)[_camelCase(options)]; } else if (_type.Array(options)) { var obj = {}, style = _getComputedStyle(elem); options.forEach(function (option, key) { obj[option] = style[_camelCase(option)]; }); return obj; } else { for (var option in options) { var val = options[option]; if (val == parseFloat(val)) { // assume pixel for seemingly numerical values val += 'px'; } elem.style[_camelCase(option)] = val; } } }; return U; }(window || {})); ScrollMagic.Scene.prototype.addIndicators = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling addIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); return this; } ScrollMagic.Scene.prototype.removeIndicators = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); return this; } ScrollMagic.Scene.prototype.setTween = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); return this; } ScrollMagic.Scene.prototype.removeTween = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); return this; } ScrollMagic.Scene.prototype.setVelocity = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); return this; } ScrollMagic.Scene.prototype.removeVelocity = function () { ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); return this; } return ScrollMagic; }));
Example/ScrollableTabsExample.js
skv-headless/react-native-scrollable-tab-view
import React from 'react'; import { Text, View, } from 'react-native'; import ScrollableTabView, { ScrollableTabBar } from 'react-native-scrollable-tab-view'; export default () => { return <ScrollableTabView style={{ marginTop: 20 }} initialPage={0} renderTabBar={() => <ScrollableTabBar />} > <Text tabLabel='Tab #1'>My</Text> <Text tabLabel='Tab #2 word word'>favorite</Text> <Text tabLabel='Tab #3 word word word'>project</Text> <Text tabLabel='Tab #4 word word word word'>favorite</Text> <Text tabLabel='Tab #5'>project</Text> </ScrollableTabView>; }
views/blocks/SearchResult/SearchResult.js
dimastark/team5
import React from 'react'; import SearchPaginationControl from './../SearchPaginationControl/SearchPaginationControl'; import './SearchResult.css'; import b from 'b_'; export default class SearchResult extends React.Component { render() { const {onPageChange, currentPage, pageCount, children} = this.props; return ( <div className="container-r"> <div className={`quests-r ${b('search', 'result')}`} > {children} </div> <SearchPaginationControl onPageChange={onPageChange} currentPage={Number(currentPage)} pageCount={Number(pageCount)} /> </div> ); } }
src/scripts/containers/ItemPage.js
scyclow/fire-sale
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import _ from 'lodash'; import { newBid } from '../actions'; import pojo from '../utils/pojo'; import ItemSummary from '../components/ItemSummary'; const select = (state, props) => { const items = state.items.size && state.items; const itemId = Number(props.params.id); if (items) { const item = items.get(itemId); return item && { item: pojo(state).item(item) }; } }; class ItemPage extends Component { render() { const { dispatch, item } = this.props; const dispatchBid = (...args) => dispatch(newBid(...args)); return ( <ItemSummary item={item} dispatchBid={dispatchBid} Link={Link}/> ); } } export default connect(select)(ItemPage);
app/app.js
kristajg/react-sandbox
// Framework libraries import React from 'react'; import { render } from 'react-dom'; import { Router, Route, browserHistory } from 'react-router'; // Components for routing import Main from './components/main'; import Secondary from './components/secondary'; render( <Router history={browserHistory}> <Route path="/" component={Main} /> <Route path="/secondary" component={Secondary} /> </Router>, document.getElementById('app') );
src/client/src/Components/EditableTable/EditableTableRow/index.js
severnsc/brewing-app
import React from 'react' import PropTypes from 'prop-types' import Button from '../../Button' import RoundButton from '../../RoundButton' import styled from 'styled-components' const TableRow = styled.tr` display:flex; flex-direction:row; position:relative; border-bottom:1px solid rgb(224, 224, 224); margin-top:5px; &:hover button { opacity: 1 } button { opacity: 0 } ` const TableCell = styled.td` flex:1; padding:5px 0; ` const FlexForm = styled.form` display:flex; button { opacity: 1; } ` const FlexInput = styled.input` flex:1; &:first-child { margin:0 10px 0 0; }; margin-left: 15px; ` const EditButton = RoundButton.extend` color: black; font-size: 1em; ` const DeleteButton = RoundButton.extend` color: white; font-size: 1em; ` const EditableTableRow = ({id, editing, cells, setEditing, saveTableRow, deleteTableRow}) => { const saveRow = (e) => { e.preventDefault() const newCells = [] for(let i=0;i<e.target.length - 1;i++){ newCells.push({...cells[i], value: e.target[i].value}) } saveTableRow(id, newCells) } const deleteRow = () => { deleteTableRow(id) } const toggleEdit = () => { setEditing(id) } if(editing){ const tableCells = cells.map((cell) => { return( <FlexInput key={cell.id} id={cell.id} type={cell.type} defaultValue={cell.value} /> ) }) return( <TableRow> <TableCell> <FlexForm onSubmit={saveRow}> {tableCells} <Button style={{marginLeft: 5 + "px"}} onClick={() => {}} className="round" type="submit" background="#05a905" > &#10004; </Button> </FlexForm> </TableCell> </TableRow> ) }else{ const tableCells = cells.map((cell) => { return( <TableCell key={cell.id}> {cell.value} </TableCell> ) }) return( <TableRow> {tableCells} <TableCell style={{ position: "absolute", right: 0, padding:0 }}> <EditButton onClick={toggleEdit} background="#c1c1c1"> &#9998; </EditButton> <DeleteButton onClick={deleteRow} background="red"> X </DeleteButton> </TableCell> </TableRow> ) } } EditableTableRow.propTypes = { id: PropTypes.string.isRequired, editing: PropTypes.bool, setEditing: PropTypes.func.isRequired, deleteTableRow: PropTypes.func.isRequired, cells: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired, tableRowID: PropTypes.string.isRequired, value: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]).isRequired, type: PropTypes.string.isRequired })).isRequired, saveTableRow: PropTypes.func.isRequired, } EditableTableRow.defaultProps = { editing: false, } export default EditableTableRow
pootle/static/js/shared/components/Dialog.js
phlax/pootle
/* * Copyright (C) Pootle contributors. * * This file is a part of the Pootle project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ import React from 'react'; import Modal, { ModalFooter } from './Modal'; const Dialog = React.createClass({ propTypes: { okLabel: React.PropTypes.string, cancelLabel: React.PropTypes.string, onAccept: React.PropTypes.func.isRequired, onCancel: React.PropTypes.func.isRequired, header: React.PropTypes.func, footer: React.PropTypes.func, }, /* Lifecycle */ getDefaultProps() { return { okLabel: 'OK', cancelLabel: 'Cancel', }; }, /* Layout */ renderFooter() { return ( <ModalFooter> <button className="btn btn-primary" onClick={this.props.onAccept} > {this.props.okLabel} </button> <button className="btn" autoFocus onClick={this.props.onCancel} > {this.props.cancelLabel} </button> </ModalFooter> ); }, render() { return ( <Modal {...this.props} footer={this.renderFooter} /> ); }, }); export default Dialog;
vertex_ui/src/components/ScrollBarContainer/ScrollBarContainer.js
zapcoop/vertex
import React from 'react'; import { PropTypes } from 'prop-types'; import Ps from 'perfect-scrollbar'; import _ from 'underscore'; import 'perfect-scrollbar/dist/css/perfect-scrollbar.css'; class ScrollBarContainer extends React.Component { static propTypes = { children: PropTypes.node.isRequired, componentClass: PropTypes.string, notRelative: PropTypes.bool, noXScrollBar: PropTypes.bool, noYScrollBar: PropTypes.bool, dynamicChildren: PropTypes.bool, active: PropTypes.bool, }; static defaultProps = { notRelative: false, componentClass: 'div', noXScrollBar: false, noYScrollBar: false, dynamicChildren: false, active: true, }; constructor(props, context) { super(props, context); this.initialized = false; this.timeout = null; this.mutationObserver = new MutationObserver(mutations => { this.updatePerfectScrollbar(); }); } componentWillUnmount() { this.destroyPerfectScroll(); } componentDidMount() { window.addEventListener('resize', () => this.updatePerfectScrollbar()); } componentWillReceiveProps(nextProps) { if (this.props.active !== nextProps.active) { nextProps.active ? this.initPerfectScroll() : this.destroyPerfectScroll(); } } updatePerfectScrollbar() { if (this.scrollContainer && this.initialized) { // Make a 20ms debounce clearTimeout(this.timeout); this.timeout = setTimeout(() => { Ps.update(this.scrollContainer); }, 20); } } initPerfectScroll() { if (this.scrollContainer && !this.initialized) { if (!this.props.notRelative) { this.scrollContainer.style.position = 'relative'; } Ps.initialize(this.scrollContainer, { suppressScrollX: this.props.noXScrollBar, suppressScrollY: this.props.noYScrollBar, }); if (this.props.dynamicChildren) { this.mutationObserver.observe(this.scrollContainer, { attributes: true, subtree: true, attributeFilter: ['class'], }); } this.initialized = true; } } destroyPerfectScroll() { if (this.scrollContainer && this.initialized) { Ps.destroy(this.scrollContainer); this.mutationObserver.disconnect(); this.initialized = false; } } render() { const otherProps = _.omit(this.props, _.keys(ScrollBarContainer.propTypes)); this.updatePerfectScrollbar(); return ( <this.props.componentClass {...otherProps} ref={element => { if (!this.scrollContainer) { this.scrollContainer = element; } this.props.active && this.initPerfectScroll(element); }} > {this.props.children} </this.props.componentClass> ); } } export default ScrollBarContainer;
test/client/unit/containers/ConfirmationWithAside.spec.js
noms-digital-studio/csra-app
import React from 'react'; import { mount } from 'enzyme'; import ConfirmationWithAside from '../../../../client/javascript/containers/ConfirmationWithAside'; import Aside from '../../../../client/javascript/components/asides/Index'; describe('<ConfirmationWithAside />', () => { it('renders the title', () => { const wrapper = mount(<ConfirmationWithAside title="foo-title" />); expect(wrapper.text()).to.contain('foo-title'); }); it('renders the description', () => { const wrapper = mount(<ConfirmationWithAside description="foo-description" />); expect(wrapper.text()).to.contain('foo-description'); }); it('renders the an aside', () => { const props = { template: 'template', }; const wrapper = mount(<ConfirmationWithAside aside={props} />); expect(wrapper.find(Aside).length).be.equal(1); }); it('handles form submission', () => { const callback = sinon.spy(); const wrapper = mount(<ConfirmationWithAside onSubmit={callback} />); wrapper.find('form').simulate('submit'); expect(callback.calledOnce).to.equal(true); }); it('pre-populates the forms if data is available', () => { const wrapper = mount(<ConfirmationWithAside formDefaults={{ confirmation: 'accepted' }} />); expect(wrapper.find('input[type="checkbox"]').getDOMNode().checked).to.equal(true, 'Check box is checked'); }); context('when the isComplete prop is present', () => { it('display "Save" on the submission button', () => { const wrapper = mount(<ConfirmationWithAside isComplete />); expect(wrapper.find('input[type="submit"]').getDOMNode().value).to.equal('Save'); }); }); context('when the isComplete prop is not present', () => { it('display "Save and continue" on the submission button', () => { const wrapper = mount(<ConfirmationWithAside />); expect(wrapper.find('input[type="submit"]').getDOMNode().value).to.equal('Save and continue'); }); }); });
test/input-test.js
knledg/react-blur-admin
import React from 'react'; import sinon from 'sinon'; import {expect} from 'chai'; import {noop} from 'lodash'; import {shallow} from 'enzyme'; import { Input } from '../src'; describe('<Input/>', function() { it('Has default props', function() { const component = shallow(<Input onChange={noop}/>); expect(component.find('input').hasClass('form-control')).to.equal(true); expect(component.find('div.form-group').hasClass('has-feedback')).to.equal(true); expect(component.find('input').hasClass('autoFocus')).to.equal(false); expect(component.find('input').prop('disabled')).to.equal(false); }); describe('<Input/>', function() { it('Has default props'); it('Is a text type', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} type='text'/>); expect(component.find('input').hasClass('form-control')).to.equal(true); }); it('Has autofocus', function() { const component = shallow(<Input onChange={noop} autoFocus={true} onValidate={() => true} type='text'/>); expect(component.find('input').prop('autoFocus')).to.equal(true); }); it('Is disabled', function() { const component = shallow(<Input onChange={noop} disabled={true} type='text'/>); expect(component.find('input').prop('disabled')).to.equal(true); }); it('Renders name', function() { const component = shallow(<Input onChange={noop} name='testing name' type='radio'/>); expect(component.find('label > input').prop('name')).to.contain('testing name'); }); it('Has label', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} label='testing label' type='text'/>); expect(component.find('label.control-label').hasClass('control-label')).to.equal(true); expect(component.find('label.control-label').text()).to.equal('testing label'); }); it('ClassName is rendered', function() { const component = shallow(<Input onChange={noop} className='testing ClassName' type='text'/>); expect(component.find('div.form-group').hasClass('testing ClassName')).to.equal(true); }); it('is not rounded', function() { const component = shallow(<Input onChange={noop} isRounded={false} type='text'/>); expect(component.find('input.form-control-rounded').length).to.equal(0); }); it('is rounded', function() { const component = shallow(<Input onChange={noop} isRounded={true} type='text'/>); expect(component.find('input.form-control').hasClass('form-control-rounded')).to.equal(true); }); it('Helplabel is rendered', function() { const component = shallow(<Input onChange={noop} helpLabel='testing helpLabel' type='text'/>); expect(component.find('div.help-block').hasClass('help-block sub-little-text')).to.equal(true); expect(component.find('div.help-block').text()).to.equal('testing helpLabel'); expect(component.find('div.help-block').length).to.equal(1); }); it('Has placeholder', function() { const component = shallow(<Input onChange={noop} placeholder='testing placeholder' type='text'/>); expect(component.find('input').prop('placeholder')).to.contain('testing placeholder'); }); it('It has feedback icon', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={true} type='text'/>); expect(component.find('div.form-group').hasClass('has-feedback')).to.equal(true); }); it('It has a type of checkbox', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.checkbox').hasClass('checkbox')).to.equal(true); }); it('Checkbox renders green/success check', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.form-group').hasClass('has-success')).to.equal(true); }); it('Checkbox renders yellow/warning check', function() { const component = shallow(<Input onChange={noop} onValidate={() => 'warning'} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.form-group').hasClass('has-warning')).to.equal(true); }); it('Checkbox sends checked value onClick', function() { let isChecked = false; const onChange = function(newValue) { isChecked = newValue; }; let component = shallow(<Input onChange={onChange} value={isChecked} type='checkbox'/>); component.find('input').simulate('click'); expect(isChecked).to.equal(true); component = shallow(<Input onChange={onChange} value={isChecked} type='checkbox'/>); component.find('input').simulate('click'); expect(isChecked).to.equal(false); }); it('Checkbox renders red/error check', function() { const component = shallow(<Input onChange={noop} onValidate={() => false} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.form-group').hasClass('has-error')).to.equal(true); }); it('Checkbox renders grey/no validation check', function() { const component = shallow(<Input onChange={noop} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.checkbox').hasClass('checkbox')).to.equal(true); }); it('Checkbox is disabled', function() { const component = shallow(<Input onChange={noop} disabled={true} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('input').prop('type')).to.contain('checkbox'); expect(component.find('input').prop('disabled')).to.equal(true); }); it('It has a type of checkbox', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={true} type='checkbox'/>); expect(component.find('div.checkbox').hasClass('checkbox')).to.equal(true); }); it('It has a type of radio', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={true} type='radio'/>); expect(component.find('input').prop('type')).to.equal('radio'); }); it('It has a type of radio disabled', function() { const component = shallow(<Input onChange={noop} disabled={true} hasFeedbackIcon={true} type='radio'/>); expect(component.find('input').prop('type')).to.contain('radio'); expect(component.find('input').prop('disabled')).to.equal(true); }); it('Radio button sends value onClick', function() { let value; const onChange = function(newValue) { value = newValue; }; let component = shallow(<Input onChange={onChange} value='Hello world' type='radio'/>); component.find('input').simulate('click'); expect(value).to.equal('Hello world'); }); it('Radio button check if defaultChecked is set', function() { let component = shallow(<Input onChange={noop} value='value1' defaultChecked={true} type='radio'/>); let value = component.find('input'); expect(value.prop('defaultChecked')).to.be.true; }); it('Is addonLeft rendering text', function() { const component = shallow(<Input onChange={noop} addonLeft='testing left' onValidate={() => true} type='text'/>); expect(component.find('span').hasClass('input-group-addon input-group-addon-primary addon-left')).to.equal(true); expect(component.find('span.addon-left').text()).to.equal('testing left'); }); it('Is addonRight rendering text', function() { const component = shallow(<Input onChange={noop} addonRight='testing right' onValidate={() => true} type='text'/>); expect(component.find('span').hasClass('input-group-addon input-group-addon-primary addon-right')).to.equal(true); expect(component.find('span.addon-right').text()).to.equal('testing right'); }); it('Is addonLeft rendering an element', function() { const icon = <i className='fa fa-check' />; const component = shallow(<Input onChange={noop} addonLeft={icon} type='text'/>); expect(component.find('span').containsMatchingElement(icon)).to.equal(true); }); it('Is addonRight rendering an element', function() { const icon = <i className='fa fa-check' />; const component = shallow(<Input onChange={noop} addonRight={icon} type='text'/>); expect(component.find('span').containsMatchingElement(icon)).to.equal(true); }); it('Shows success state', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} />); expect(component.find('div.form-group').hasClass('has-success')).to.equal(true); expect(component.find('i.fa-check-circle').length).to.equal(1); }); it('Shows success state without icon', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedbackIcon={false} />); expect(component.find('div.form-group').hasClass('has-success')).to.equal(true); expect(component.find('i').length).to.equal(0); }); it('Shows fail state', function() { const component = shallow(<Input onChange={noop} onValidate={() => false} />); expect(component.find('div.form-group').hasClass('has-error')).to.equal(true); expect(component.find('i.fa-times-circle').length).to.equal(1); }); it('Shows warning state', function() { const component = shallow(<Input onChange={noop} onValidate={() => 'warning'} />); expect(component.find('div.form-group').hasClass('has-warning')).to.equal(true); expect(component.find('i.fa-exclamation-triangle').length).to.equal(1); }); it('Shows addon Right', function() { const component = shallow(<Input onChange={noop} addonRight='testing right' onValidate={() => true} />); expect(component.find('span').hasClass('input-group-addon input-group-addon-primary addon-right')).to.equal(true); expect(component.find('span.addon-right').text()).to.equal('testing right'); }); it('Shows addon Left', function() { const component = shallow(<Input onChange={noop} addonLeft='testing left' onValidate={() => true} />); expect(component.find('span').hasClass('input-group-addon input-group-addon-primary addon-left')).to.equal(true); expect(component.find('span.addon-left').text()).to.equal('testing left'); }); it('Has an id/key'); // Key is not a standard prop, cannot access for testing (https://fb.me/react-special-props) it('onValidate is called', function() { const onClick = sinon.spy(); const component = shallow(<Input onChange={noop} onValidate={onClick} />); component.find('input').simulate('click'); expect(onClick.calledOnce).to.equal(true); }); it('onKeyDown is called', function() { const onKeyDown = sinon.spy(); const component = shallow(<Input onChange={noop} onKeyDown={onKeyDown} />); component.find('input').simulate('keyDown'); expect(onKeyDown.calledOnce).to.equal(true); }); it('It has a value of number', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedback={true} value={2}/>); expect(component.find('input').prop('value')).to.equal(2); }); it('Has a value of string', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedback={true} value='testing value'/>); expect(component.find('input').prop('value')).to.equal('testing value'); }); it('Has a value of true', function() { const component = shallow(<Input onChange={noop} onValidate={() => true} hasFeedback={true} value={true}/>); expect(component.find('input').prop('value')).to.equal(true); }); it('onValidate is called when value is changed', function() { const onValidate = sinon.spy(); const component = shallow(<Input onChange={onValidate} />); component.find('input').simulate('change'); expect(onValidate.calledOnce).to.equal(true); }); }); });
src/icons/IosSnowy.js
fbfeix/react-icons
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class IosSnowy extends React.Component { render() { if(this.props.bare) { return <g> <style type="text/css"> .st0{fill:#010101;} </style> <path class="st0" d="M379.9,317l-28.7-16.3c6.1-5.8,13-9.7,20.7-12.3c4.3-1.4,6.5-5.9,5.1-10.1c-1.4-4.2-6-6.5-10.3-5.1 c-11.6,3.8-22.2,11-30.1,19.2L272.3,256l64.2-36.4c8.4,9.1,18.6,15.4,30.2,19.2c4.3,1.4,8.9-0.8,10.3-5c1.4-4.2-0.8-8.7-5.1-10.1 c-7.8-2.6-14.8-6.5-20.9-12.3l28.8-16.3c3.9-2.2,5.2-7.1,3-10.9s-7.2-5.1-11.1-2.9L343,197.3c-2-8.1-2.1-15.9-0.5-23.8 c0.9-4.3-2-8.5-6.4-9.4c-4.4-0.9-8.7,1.9-9.6,6.2c-2.4,11.8-1.4,24.4,1.8,35.2L264,242.2v-73c11-2.7,22.4-8.1,31.5-16.1 c3.3-2.9,3.6-8,0.7-11.3c-2.9-3.3-7.9-3.6-11.3-0.7c-6,5.3-12.9,9.2-20.9,11.5V120c0-4.4-3.6-8-8-8c-4.4,0-8,3.6-8,8v32.7 c-8-2.3-14.8-6.2-20.9-11.6c-3.3-2.9-8.4-2.6-11.3,0.7c-2.9,3.3-2.6,8.4,0.7,11.3c9.1,8,19.5,13.5,31.5,16.1v73l-64.5-36.6 c3.2-10.9,4.2-23.5,1.9-35.2c-0.9-4.3-5.2-7.1-9.6-6.2c-4.4,0.9-7.2,5-6.4,9.4c1.6,7.9,1.6,15.7-0.5,23.8L140.3,181 c-3.9-2.2-8.9-0.9-11.1,2.9c-2.2,3.8-0.9,8.7,3,10.9l28.8,16.3c-6.1,5.8-13,9.7-20.8,12.3c-4.3,1.4-6.5,6-5.1,10.1 c1.4,4.2,6.1,6.4,10.3,5c11.6-3.9,21.8-10.1,30.2-19.2l64.3,36.5l-64.4,36.5c-7.9-8.2-18.6-15.3-30.1-19.2 c-4.3-1.4-8.8,0.9-10.3,5.1c-1.4,4.2,0.8,8.7,5.1,10.1c7.7,2.6,14.6,6.5,20.7,12.3l-28.7,16.3c-3.9,2.2-5.2,7.1-3,10.9 s7.2,5.1,11.1,2.9l28.8-16.3c2.1,8.1,2.1,15.9,0.4,23.9c-0.9,4.3,2,8.5,6.4,9.4c4.4,0.9,8.7-1.9,9.6-6.3c2.4-11.8,1.9-23.6-1.9-35.3 l64.5-36.6v73.1c-12,2.6-22.4,8.1-31.5,16.1c-3.3,2.9-3.6,8-0.7,11.3c2.9,3.3,7.9,3.6,11.3,0.7c6.1-5.4,12.9-9.3,20.9-11.6V392 c0,4.4,3.6,8,8,8c4.4,0,8-3.6,8-8v-32.6c8,2.3,14.8,6.2,20.9,11.5c3.3,2.9,8.3,2.6,11.3-0.7c2.9-3.3,2.6-8.4-0.7-11.3 c-9-7.9-20.4-13.4-31.4-16.1v-73.1l64.4,36.5c-3.8,11.7-4.2,23.5-1.8,35.3c0.9,4.3,5.2,7.1,9.6,6.3c4.4-0.9,7.3-5.1,6.4-9.4 c-1.6-8-1.6-15.8,0.4-23.9l28.8,16.3c3.9,2.2,8.9,0.9,11.1-2.9C385.2,324.1,383.8,319.2,379.9,317z"></path> </g>; } return <IconBase> <style type="text/css"> .st0{fill:#010101;} </style> <path class="st0" d="M379.9,317l-28.7-16.3c6.1-5.8,13-9.7,20.7-12.3c4.3-1.4,6.5-5.9,5.1-10.1c-1.4-4.2-6-6.5-10.3-5.1 c-11.6,3.8-22.2,11-30.1,19.2L272.3,256l64.2-36.4c8.4,9.1,18.6,15.4,30.2,19.2c4.3,1.4,8.9-0.8,10.3-5c1.4-4.2-0.8-8.7-5.1-10.1 c-7.8-2.6-14.8-6.5-20.9-12.3l28.8-16.3c3.9-2.2,5.2-7.1,3-10.9s-7.2-5.1-11.1-2.9L343,197.3c-2-8.1-2.1-15.9-0.5-23.8 c0.9-4.3-2-8.5-6.4-9.4c-4.4-0.9-8.7,1.9-9.6,6.2c-2.4,11.8-1.4,24.4,1.8,35.2L264,242.2v-73c11-2.7,22.4-8.1,31.5-16.1 c3.3-2.9,3.6-8,0.7-11.3c-2.9-3.3-7.9-3.6-11.3-0.7c-6,5.3-12.9,9.2-20.9,11.5V120c0-4.4-3.6-8-8-8c-4.4,0-8,3.6-8,8v32.7 c-8-2.3-14.8-6.2-20.9-11.6c-3.3-2.9-8.4-2.6-11.3,0.7c-2.9,3.3-2.6,8.4,0.7,11.3c9.1,8,19.5,13.5,31.5,16.1v73l-64.5-36.6 c3.2-10.9,4.2-23.5,1.9-35.2c-0.9-4.3-5.2-7.1-9.6-6.2c-4.4,0.9-7.2,5-6.4,9.4c1.6,7.9,1.6,15.7-0.5,23.8L140.3,181 c-3.9-2.2-8.9-0.9-11.1,2.9c-2.2,3.8-0.9,8.7,3,10.9l28.8,16.3c-6.1,5.8-13,9.7-20.8,12.3c-4.3,1.4-6.5,6-5.1,10.1 c1.4,4.2,6.1,6.4,10.3,5c11.6-3.9,21.8-10.1,30.2-19.2l64.3,36.5l-64.4,36.5c-7.9-8.2-18.6-15.3-30.1-19.2 c-4.3-1.4-8.8,0.9-10.3,5.1c-1.4,4.2,0.8,8.7,5.1,10.1c7.7,2.6,14.6,6.5,20.7,12.3l-28.7,16.3c-3.9,2.2-5.2,7.1-3,10.9 s7.2,5.1,11.1,2.9l28.8-16.3c2.1,8.1,2.1,15.9,0.4,23.9c-0.9,4.3,2,8.5,6.4,9.4c4.4,0.9,8.7-1.9,9.6-6.3c2.4-11.8,1.9-23.6-1.9-35.3 l64.5-36.6v73.1c-12,2.6-22.4,8.1-31.5,16.1c-3.3,2.9-3.6,8-0.7,11.3c2.9,3.3,7.9,3.6,11.3,0.7c6.1-5.4,12.9-9.3,20.9-11.6V392 c0,4.4,3.6,8,8,8c4.4,0,8-3.6,8-8v-32.6c8,2.3,14.8,6.2,20.9,11.5c3.3,2.9,8.3,2.6,11.3-0.7c2.9-3.3,2.6-8.4-0.7-11.3 c-9-7.9-20.4-13.4-31.4-16.1v-73.1l64.4,36.5c-3.8,11.7-4.2,23.5-1.8,35.3c0.9,4.3,5.2,7.1,9.6,6.3c4.4-0.9,7.3-5.1,6.4-9.4 c-1.6-8-1.6-15.8,0.4-23.9l28.8,16.3c3.9,2.2,8.9,0.9,11.1-2.9C385.2,324.1,383.8,319.2,379.9,317z"></path> </IconBase>; } };IosSnowy.defaultProps = {bare: false}
app/scripts/main.js
wbkd/piwik-dashboard
import React from 'react'; import App from './pages/app.jsx'; React.render(<App />, document.body);
assets/js/store/model.js
tdfischer/organizer
import React from 'react' import { createSelector } from 'reselect' import { bindActionCreators } from 'redux' import { point } from '@turf/helpers' import { getCoord } from '@turf/invariant' import { connect } from 'react-redux' import { csrftoken } from '../Django' import Queue from 'promise-queue' import Immutable from 'immutable' export const REQUEST_MODELS = 'REQUEST_MODELS' export const RECEIVE_MODELS = 'RECEIVE_MODELS' export const UPDATE_MODEL = 'UPDATE_MODEL' export const SAVING_MODEL = 'SAVING_MODEL' export const SAVED_MODEL = 'SAVED_MODEL' const fetchQueue = new Queue(2) function queuedFetch() { const args = arguments return fetchQueue.add(() => { return fetch.apply(null, args) .then(response => { if (!response.ok) { return Promise.reject(response) } else { return response } }) }) } const getAllModels = state => state.getIn(['model', 'models']) const modelGetter = (name) => { return createSelector( [getAllModels], models => { return models.get(name, Immutable.Map()) } ) } export default class Model { constructor(name, options = {}) { this.name = name this.options = options } immutableSelect(state) { return modelGetter(this.name)(state).toKeyedSeq().map(m => ({...m, geo: this.deserializeGeo(m.geo)})) } bindActionCreators(dispatch) { const funcNames = ['saving', 'saved', 'save', 'fetchOne', 'fetchIfNeeded', 'fetchAll', 'update', 'create', 'updateAndSave', 'request', 'receive'] var bindable = {} funcNames.forEach(name => bindable[name] = this[name].bind(this)) return bindActionCreators(bindable, dispatch) } saving(id) { return { type: SAVING_MODEL, name: this.name, id: Number(id) } } saved(id) { return { type: SAVED_MODEL, name: this.name, id: Number(id) } } save(id) { return (dispatch, getState) => { const selector = new Model(this.name).immutableSelect(getState()) const model = selector.get(id) dispatch(this.saving(id)) const data = { method: 'PUT', credentials: 'include', headers: { 'X-CSRFToken': csrftoken, 'Content-Type': 'application/json; charset=utf-8' }, body: JSON.stringify(model) } console.groupCollapsed('PUT %s %s', this.name, id) console.log(data) console.groupEnd() return queuedFetch('/api/'+this.name+'/'+id+'/', data).then(() => { dispatch(this.saved(id)) return Promise.resolve() }) } } fetchIfNeeded(id) { return (dispatch, getState) => { if (!this.immutableSelect(getState()).has(id)) { return dispatch(this.fetchOne(id)) } else { return Promise.resolve() } } } fetchOne(id) { return dispatch => { dispatch(this.request()) console.log('GET %s %s', this.name, id) return queuedFetch('/api/'+this.name+'/'+id+'/', {credentials: 'include'}) .then(response => response.json()) .then(json => { if (Object.keys(json).length > 0) { dispatch(this.receive([json])) } return Promise.resolve() }) } } fetchAll(params = {}) { return dispatch => { dispatch(this.request()) const url = this.options.url || '/api/'+this.name+'/' const cleanParams = [] Object.entries(params).forEach(([k, v]) => {if (v != undefined) cleanParams.push([k, v])}) const urlParams = new URLSearchParams(cleanParams) console.groupCollapsed('GET %s page=%s', this.name, params.page || 1) console.log(params) console.groupEnd() return queuedFetch(url+'?'+urlParams, {credentials: 'include'}) .then(response => response.json()) .then(json => { if (json.next) { const nextPage = (params.page || 1) + 1 const ret = dispatch(this.fetchAll({...params, page: nextPage}, this.options)) dispatch(this.receive(json.results)) return ret } else { dispatch(this.receive(json.results)) return Promise.resolve() } }) } } update(id, dataOrCallback) { return (dispatch, getState) => { if (typeof dataOrCallback == 'function') { const foundItem = this.immutableSelect(getState()).get(id) return dispatch(this.update(id, dataOrCallback(foundItem))) } else { console.groupCollapsed('update %s %s', this.name, id) console.log(dataOrCallback) console.groupEnd() dispatch({ type: UPDATE_MODEL, id: id, data: this.serializeGeo(dataOrCallback), name: this.name }) return Promise.resolve() } } } serializeGeo(data) { if (data.geo) { const coords = getCoord(data.geo) return { ...data, geo: { lat: coords[0], lng: coords[1] } } } return data } deserializeGeo(geo) { return (geo && geo.lat != undefined && geo.lng != undefined) ? point([geo.lat, geo.lng], {city: geo.city}) : undefined } create(modelData) { return dispatch => { dispatch(this.saving(0)) const data = { method: 'POST', credentials: 'include', headers: { 'X-CSRFToken': csrftoken, 'Content-Type': 'application/json; charset=utf-8' }, body: JSON.stringify(modelData) } console.groupCollapsed('POST %s', this.name) console.log(data) console.groupEnd() return queuedFetch('/api/'+this.name+'/', data) .then(response => response.json()) .then(json => { if (Object.keys(json).length > 0) { dispatch(this.update(json.id, json)) dispatch(this.saved(json.id)) return Promise.resolve(json.id) } }) } } updateAndSave(id, dataOrCallback) { return dispatch => { return dispatch(this.update(id, dataOrCallback)) .then(() => dispatch(this.save(id))) } } request() { return { type: REQUEST_MODELS, name: this.name } } receive(results) { return { type: RECEIVE_MODELS, name: this.name, models: results || [] } } } export const withModelData = mapModelToFetch => WrappedComponent => { return connect()(class Fetcher extends React.Component { constructor(props) { super(props) this.cancelled = false this.state = { hasFetched: false, fetchErrors: {} } } componentDidMount() { this.fetch() } componentWillUnmount() { this.cancelled = true } componentDidUpdate(prevProps) { if (prevProps.model != this.props.model) { this.fetch() } } fetch() { return Promise.all(Object.entries(mapModelToFetch(this.props)).map(([modelName, params]) => { const model = new Model(modelName) const catcher = err => { if (this.cancelled) { return } this.setState(oldState => ({...oldState, [modelName]: err})) console.error('Failed to fetch %s %o', modelName, params, err) return err } if (typeof(params) == 'object') { this.props.dispatch(model.fetchAll(params)).catch(catcher).then(() => { if (this.cancelled) { return } this.setState({hasFetched: true}) }) } else { this.props.dispatch(model.fetchIfNeeded(params)).catch(catcher).then(() => { if (this.cancelled) { return } this.setState({hasFetched: true}) }) } })) } render() { return <WrappedComponent {...this.state} {...this.props} /> } }) }
src/component/Markdown.js
jdeniau/changelog-view
import React from 'react'; import marked from 'marked'; import TerminalRenderer from 'marked-terminal'; function Markdown({ children }) { return marked(children, { renderer: new TerminalRenderer(), }); } export default Markdown;
examples/huge-apps/routes/Course/routes/Assignments/components/Assignments.js
fiture/react-router
import React from 'react'; class Assignments extends React.Component { render () { return ( <div> <h3>Assignments</h3> {this.props.children || <p>Choose an assignment from the sidebar.</p>} </div> ); } } export default Assignments;
packages/material-ui-icons/src/LocalPhone.js
dsslimshaddy/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let LocalPhone = props => <SvgIcon {...props}> <path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z" /> </SvgIcon>; LocalPhone = pure(LocalPhone); LocalPhone.muiName = 'SvgIcon'; export default LocalPhone;
packages/material-ui-icons/src/FindReplaceSharp.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M11 6c1.38 0 2.63.56 3.54 1.46L12 10h6V4l-2.05 2.05C14.68 4.78 12.93 4 11 4c-3.53 0-6.43 2.61-6.92 6H6.1c.46-2.28 2.48-4 4.9-4zm5.64 9.14c.66-.9 1.12-1.97 1.28-3.14H15.9c-.46 2.28-2.48 4-4.9 4-1.38 0-2.63-.56-3.54-1.46L10 12H4v6l2.05-2.05C7.32 17.22 9.07 18 11 18c1.55 0 2.98-.51 4.14-1.36L20 21.49 21.49 20l-4.85-4.86z" /></g></React.Fragment> , 'FindReplaceSharp');
examples/todomvc/containers/Root.js
Zack-Tillotson/redux
import React, { Component } from 'react'; import TodoApp from './TodoApp'; import { createStore, combineReducers } from 'redux'; import { Provider } from 'react-redux'; import rootReducer from '../reducers'; const store = createStore(rootReducer); export default class Root extends Component { render() { return ( <Provider store={store}> {() => <TodoApp /> } </Provider> ); } }
examples/todoMVC/src/components/TodoItem.spec.js
Sly777/React-UI-Debugger
import React from 'react' import TestUtils from 'react-addons-test-utils' import TodoItem from './TodoItem' import TodoTextInput from './TodoTextInput' const setup = ( editing = false ) => { const props = { todo: { id: 0, text: 'Use Redux', completed: false }, editTodo: jest.fn(), deleteTodo: jest.fn(), completeTodo: jest.fn() } const renderer = TestUtils.createRenderer() renderer.render( <TodoItem {...props} /> ) let output = renderer.getRenderOutput() if (editing) { const label = output.props.children.props.children[1] label.props.onDoubleClick({}) output = renderer.getRenderOutput() } return { props: props, output: output, renderer: renderer } } describe('components', () => { describe('TodoItem', () => { it('initial render', () => { const { output } = setup() expect(output.type).toBe('li') expect(output.props.className).toBe('') const div = output.props.children expect(div.type).toBe('div') expect(div.props.className).toBe('view') const [ input, label, button ] = div.props.children expect(input.type).toBe('input') expect(input.props.checked).toBe(false) expect(label.type).toBe('label') expect(label.props.children).toBe('Use Redux') expect(button.type).toBe('button') expect(button.props.className).toBe('destroy') }) it('input onChange should call completeTodo', () => { const { output, props } = setup() const input = output.props.children.props.children[0] input.props.onChange({}) expect(props.completeTodo).toBeCalledWith(0) }) it('button onClick should call deleteTodo', () => { const { output, props } = setup() const button = output.props.children.props.children[2] button.props.onClick({}) expect(props.deleteTodo).toBeCalledWith(0) }) it('label onDoubleClick should put component in edit state', () => { const { output, renderer } = setup() const label = output.props.children.props.children[1] label.props.onDoubleClick({}) const updated = renderer.getRenderOutput() expect(updated.type).toBe('li') expect(updated.props.className).toBe('editing') }) it('edit state render', () => { const { output } = setup(true) expect(output.type).toBe('li') expect(output.props.className).toBe('editing') const input = output.props.children expect(input.type).toBe(TodoTextInput) expect(input.props.text).toBe('Use Redux') expect(input.props.editing).toBe(true) }) it('TodoTextInput onSave should call editTodo', () => { const { output, props } = setup(true) output.props.children.props.onSave('Use Redux') expect(props.editTodo).toBeCalledWith(0, 'Use Redux') }) it('TodoTextInput onSave should call deleteTodo if text is empty', () => { const { output, props } = setup(true) output.props.children.props.onSave('') expect(props.deleteTodo).toBeCalledWith(0) }) it('TodoTextInput onSave should exit component from edit state', () => { const { output, renderer } = setup(true) output.props.children.props.onSave('Use Redux') const updated = renderer.getRenderOutput() expect(updated.type).toBe('li') expect(updated.props.className).toBe('') }) }) })
ajax/libs/primereact/6.5.0/avatargroup/avatargroup.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames } from 'primereact/core'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } var AvatarGroup = /*#__PURE__*/function (_Component) { _inherits(AvatarGroup, _Component); var _super = _createSuper(AvatarGroup); function AvatarGroup() { _classCallCheck(this, AvatarGroup); return _super.apply(this, arguments); } _createClass(AvatarGroup, [{ key: "render", value: function render() { var containerClassName = classNames('p-avatar-group p-component', this.props.className); return /*#__PURE__*/React.createElement("div", { className: containerClassName, style: this.props.style }, this.props.children); } }]); return AvatarGroup; }(Component); _defineProperty(AvatarGroup, "defaultProps", { style: null, className: null }); export { AvatarGroup };
src/PhoneField.js
greenteamer/form
import React, { Component } from 'react'; import MaskedInput from 'react-maskedinput'; import _ from 'underscore'; export default class PhoneField extends Component { constructor(props) { super(props); this.state = { currentCountry: this.props.countries[0], dropdownCountry: false, isFocusPhone: false, phoneValue: "" }; } _onDropdownCountryClick(){ this.setState({ dropdownCountry: !this.state.dropdownCountry }) } _changeCountry(country){ this._onDropdownCountryClick(); var phone = this.changePhoneCode(this.state.phoneValue, country) this.setState({ currentCountry: country, phoneValue: phone }) // console.log("current country: ", country) } _onFocusPhone(){ this.setState({ isFocusPhone: !this.state.isFocusPhone, phoneValue: (this.state.phoneValue == "") ? this.state.currentCountry.number : this.state.phoneValue }) } _onBlurPhone(){ this.setState({ isFocusPhone: !this.state.isFocusPhone }) } _onChangePhone(e){ this.setState({ phoneValue: e.target.value }) } changePhoneCode(phone, country){ var searchCode = "+" + this.state.currentCountry.number; var newCode = "+" + country.number; var newPhone = phone.replace(searchCode, newCode); return newPhone; } render(){ console.log("phone value: ", this.state.phoneValue) var placeholder = (!this.state.phoneValue) ? <span className="placeholder"><span className="dark">+{ this.state.currentCountry.number } </span>495 123-66-55</span> : ""; return( <div className="form-group align-left"> <label for="formControlsText" class="control-label">Телефон</label> <div className="input-group"> <div className={this.state.dropdownCountry ? "input-group-btn open" : "input-group-btn"}> <button type="button" className="btn btn-default dropdown-toggle flag" data-toggle="dropdown" aria-haspopup="true" aria-expanded={this.state.dropdownCountry ? "true" : "false"} onClick={this._onDropdownCountryClick.bind(this)}> <img src={this.state.currentCountry.img} height="100"/> <span className="ion-ios-arrow-down"></span></button> <ul className="dropdown-menu dropdown-menu-left"> {_.map(this.props.countries, (country)=>{ return( <li key={ country.name }> <a name="" onClick={this._changeCountry.bind(this, country)}>{ country.name }</a> </li> ) })} </ul> </div> <div className="placeholder-wrap"> <MaskedInput className="form-control" mask="+1 111 111-11-11" placeholder=" " name="card" size="20" value={this.state.phoneValue} onChange={this._onChangePhone.bind(this)} onFocus={this._onFocusPhone.bind(this)} onBlur={this._onBlurPhone.bind(this)}/> {placeholder} </div> </div> </div> ) } }
ajax/libs/yui/3.5.0pr4/simpleyui/simpleyui.js
pc035860/cdnjs
/** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and * the core utilities for the library. * @module yui * @submodule yui-base */ if (typeof YUI != 'undefined') { YUI._YUI = YUI; } /** The YUI global namespace object. If YUI is already defined, the existing YUI object will not be overwritten so that defined namespaces are preserved. It is the constructor for the object the end user interacts with. As indicated below, each instance has full custom event support, but only if the event system is available. This is a self-instantiable factory function. You can invoke it directly like this: YUI().use('*', function(Y) { // ready }); But it also works like this: var Y = YUI(); Configuring the YUI object: YUI({ debug: true, combine: false }).use('node', function(Y) { //Node is ready to use }); See the API docs for the <a href="config.html">Config</a> class for the complete list of supported configuration properties accepted by the YUI constuctor. @class YUI @constructor @global @uses EventTarget @param [o]* {Object} 0..n optional configuration objects. these values are store in Y.config. See <a href="config.html">Config</a> for the list of supported properties. */ /*global YUI*/ /*global YUI_config*/ var YUI = function() { var i = 0, Y = this, args = arguments, l = args.length, instanceOf = function(o, type) { return (o && o.hasOwnProperty && (o instanceof type)); }, gconf = (typeof YUI_config !== 'undefined') && YUI_config; if (!(instanceOf(Y, YUI))) { Y = new YUI(); } else { // set up the core environment Y._init(); /** YUI.GlobalConfig is a master configuration that might span multiple contexts in a non-browser environment. It is applied first to all instances in all contexts. @property GlobalConfig @type {Object} @global @static @example YUI.GlobalConfig = { filter: 'debug' }; YUI().use('node', function(Y) { //debug files used here }); YUI({ filter: 'min' }).use('node', function(Y) { //min files used here }); */ if (YUI.GlobalConfig) { Y.applyConfig(YUI.GlobalConfig); } /** YUI_config is a page-level config. It is applied to all instances created on the page. This is applied after YUI.GlobalConfig, and before the instance level configuration objects. @global @property YUI_config @type {Object} @example //Single global var to include before YUI seed file YUI_config = { filter: 'debug' }; YUI().use('node', function(Y) { //debug files used here }); YUI({ filter: 'min' }).use('node', function(Y) { //min files used here }); */ if (gconf) { Y.applyConfig(gconf); } // bind the specified additional modules for this instance if (!l) { Y._setup(); } } if (l) { // Each instance can accept one or more configuration objects. // These are applied after YUI.GlobalConfig and YUI_Config, // overriding values set in those config files if there is a ' // matching property. for (; i < l; i++) { Y.applyConfig(args[i]); } Y._setup(); } Y.instanceOf = instanceOf; return Y; }; (function() { var proto, prop, VERSION = '@VERSION@', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', DOC_LABEL = 'yui3-js-enabled', CSS_STAMP_EL = 'yui3-css-stamp', NOOP = function() {}, SLICE = Array.prototype.slice, APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo 'io.xdrResponse': 1, // can call. this should 'SWF.eventHandler': 1 }, // be done at build time hasWin = (typeof window != 'undefined'), win = (hasWin) ? window : null, doc = (hasWin) ? win.document : null, docEl = doc && doc.documentElement, docClass = docEl && docEl.className, instances = {}, time = new Date().getTime(), add = function(el, type, fn, capture) { if (el && el.addEventListener) { el.addEventListener(type, fn, capture); } else if (el && el.attachEvent) { el.attachEvent('on' + type, fn); } }, remove = function(el, type, fn, capture) { if (el && el.removeEventListener) { // this can throw an uncaught exception in FF try { el.removeEventListener(type, fn, capture); } catch (ex) {} } else if (el && el.detachEvent) { el.detachEvent('on' + type, fn); } }, handleLoad = function() { YUI.Env.windowLoaded = true; YUI.Env.DOMReady = true; if (hasWin) { remove(window, 'load', handleLoad); } }, getLoader = function(Y, o) { var loader = Y.Env._loader; if (loader) { //loader._config(Y.config); loader.ignoreRegistered = false; loader.onEnd = null; loader.data = null; loader.required = []; loader.loadType = null; } else { loader = new Y.Loader(Y.config); Y.Env._loader = loader; } YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ])); return loader; }, clobber = function(r, s) { for (var i in s) { if (s.hasOwnProperty(i)) { r[i] = s[i]; } } }, ALREADY_DONE = { success: true }; // Stamp the documentElement (HTML) with a class of "yui-loaded" to // enable styles that need to key off of JS being enabled. if (docEl && docClass.indexOf(DOC_LABEL) == -1) { if (docClass) { docClass += ' '; } docClass += DOC_LABEL; docEl.className = docClass; } if (VERSION.indexOf('@') > -1) { VERSION = '3.3.0'; // dev time hack for cdn test } proto = { /** * Applies a new configuration object to the YUI instance config. * This will merge new group/module definitions, and will also * update the loader cache if necessary. Updating Y.config directly * will not update the cache. * @method applyConfig * @param {Object} o the configuration object. * @since 3.2.0 */ applyConfig: function(o) { o = o || NOOP; var attr, name, // detail, config = this.config, mods = config.modules, groups = config.groups, loader = this.Env._loader; for (name in o) { if (o.hasOwnProperty(name)) { attr = o[name]; if (mods && name == 'modules') { clobber(mods, attr); } else if (groups && name == 'groups') { clobber(groups, attr); } else if (name == 'win') { config[name] = (attr && attr.contentWindow) || attr; config.doc = config[name] ? config[name].document : null; } else if (name == '_yuid') { // preserve the guid } else { config[name] = attr; } } } if (loader) { loader._config(o); } }, /** * Old way to apply a config to the instance (calls `applyConfig` under the hood) * @private * @method _config * @param {Object} o The config to apply */ _config: function(o) { this.applyConfig(o); }, /** * Initialize this YUI instance * @private * @method _init */ _init: function() { var filter, el, Y = this, G_ENV = YUI.Env, Env = Y.Env, prop; /** * The version number of the YUI instance. * @property version * @type string */ Y.version = VERSION; if (!Env) { Y.Env = { core: ['get','features','intl-base','yui-log','yui-later'], mods: {}, // flat module map versions: {}, // version module map base: BASE, cdn: BASE + VERSION + '/build/', // bootstrapped: false, _idx: 0, _used: {}, _attached: {}, _missed: [], _yidx: 0, _uidx: 0, _guidp: 'y', _loaded: {}, // serviced: {}, // Regex in English: // I'll start at the \b(simpleyui). // 1. Look in the test string for "simpleyui" or "yui" or // "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break. That is, it // can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string. // 2. After #1 must come a forward slash followed by the string matched in #1, so // "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants". // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min", // so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt". // 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js" // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string, // then capture the junk between the LAST "&" and the string in 1-4. So // "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js" // will capture "3.3.0/build/" // // Regex Exploded: // (?:\? Find a ? // (?:[^&]*&) followed by 0..n characters followed by an & // * in fact, find as many sets of characters followed by a & as you can // ([^&]*) capture the stuff after the last & in \1 // )? but it's ok if all this ?junk&more_junk stuff isn't even there // \b(simpleyui| after a word break find either the string "simpleyui" or // yui(?:-\w+)? the string "yui" optionally followed by a -, then more characters // ) and store the simpleyui or yui-* string in \2 // \/\2 then comes a / followed by the simpleyui or yui-* string in \2 // (?:-(min|debug))? optionally followed by "-min" or "-debug" // .js and ending in ".js" _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/, parseBasePath: function(src, pattern) { var match = src.match(pattern), path, filter; if (match) { path = RegExp.leftContext || src.slice(0, src.indexOf(match[0])); // this is to set up the path to the loader. The file // filter for loader should match the yui include. filter = match[3]; // extract correct path for mixed combo urls // http://yuilibrary.com/projects/yui3/ticket/2528423 if (match[1]) { path += '?' + match[1]; } path = { filter: filter, path: path } } return path; }, getBase: G_ENV && G_ENV.getBase || function(pattern) { var nodes = (doc && doc.getElementsByTagName('script')) || [], path = Env.cdn, parsed, i, len, src; for (i = 0, len = nodes.length; i < len; ++i) { src = nodes[i].src; if (src) { parsed = Y.Env.parseBasePath(src, pattern); if (parsed) { filter = parsed.filter; path = parsed.path; break; } } } // use CDN default return path; } }; Env = Y.Env; Env._loaded[VERSION] = {}; if (G_ENV && Y !== YUI) { Env._yidx = ++G_ENV._yidx; Env._guidp = ('yui_' + VERSION + '_' + Env._yidx + '_' + time).replace(/\./g, '_'); } else if (YUI._YUI) { G_ENV = YUI._YUI.Env; Env._yidx += G_ENV._yidx; Env._uidx += G_ENV._uidx; for (prop in G_ENV) { if (!(prop in Env)) { Env[prop] = G_ENV[prop]; } } delete YUI._YUI; } Y.id = Y.stamp(Y); instances[Y.id] = Y; } Y.constructor = YUI; // configuration defaults Y.config = Y.config || { bootstrap: true, cacheUse: true, debug: true, doc: doc, fetchCSS: true, throwFail: true, useBrowserConsole: true, useNativeES5: true, win: win }; //Register the CSS stamp element if (doc && !doc.getElementById(CSS_STAMP_EL)) { el = doc.createElement('div'); el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>'; YUI.Env.cssStampEl = el.firstChild; docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild); } Y.config.lang = Y.config.lang || 'en-US'; Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE); if (!filter || (!('mindebug').indexOf(filter))) { filter = 'min'; } filter = (filter) ? '-' + filter : filter; Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js'; }, /** * Finishes the instance setup. Attaches whatever modules were defined * when the yui modules was registered. * @method _setup * @private */ _setup: function(o) { var i, Y = this, core = [], mods = YUI.Env.mods, //extras = Y.config.core || ['get','features','intl-base','yui-log','yui-later']; extras = Y.config.core || [].concat(YUI.Env.core); //Clone it.. for (i = 0; i < extras.length; i++) { if (mods[extras[i]]) { core.push(extras[i]); } } Y._attach(['yui-base']); Y._attach(core); if (Y.Loader) { getLoader(Y); } }, /** * Executes a method on a YUI instance with * the specified id if the specified method is whitelisted. * @method applyTo * @param id {String} the YUI instance id. * @param method {String} the name of the method to exectute. * Ex: 'Object.keys'. * @param args {Array} the arguments to apply to the method. * @return {Object} the return value from the applied method or null. */ applyTo: function(id, method, args) { if (!(method in APPLY_TO_AUTH)) { this.log(method + ': applyTo not allowed', 'warn', 'yui'); return null; } var instance = instances[id], nest, m, i; if (instance) { nest = method.split('.'); m = instance; for (i = 0; i < nest.length; i = i + 1) { m = m[nest[i]]; if (!m) { this.log('applyTo not found: ' + method, 'warn', 'yui'); } } return m && m.apply(instance, args); } return null; }, /** Registers a module with the YUI global. The easiest way to create a first-class YUI module is to use the YUI component build tool. http://yuilibrary.com/projects/builder The build system will produce the `YUI.add` wrapper for you module, along with any configuration info required for the module. @method add @param name {String} module name. @param fn {Function} entry point into the module that is used to bind module to the YUI instance. @param {YUI} fn.Y The YUI instance this module is executed in. @param {String} fn.name The name of the module @param version {String} version string. @param details {Object} optional config data: @param details.requires {Array} features that must be present before this module can be attached. @param details.optional {Array} optional features that should be present if loadOptional is defined. Note: modules are not often loaded this way in YUI 3, but this field is still useful to inform the user that certain features in the component will require additional dependencies. @param details.use {Array} features that are included within this module which need to be attached automatically when this module is attached. This supports the YUI 3 rollup system -- a module with submodules defined will need to have the submodules listed in the 'use' config. The YUI component build tool does this for you. @return {YUI} the YUI instance. @example YUI.add('davglass', function(Y, name) { Y.davglass = function() { alert('Dav was here!'); }; }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] }); */ add: function(name, fn, version, details) { details = details || {}; var env = YUI.Env, mod = { name: name, fn: fn, version: version, details: details }, loader, i, versions = env.versions; env.mods[name] = mod; versions[version] = versions[version] || {}; versions[version][name] = mod; for (i in instances) { if (instances.hasOwnProperty(i)) { loader = instances[i].Env._loader; if (loader) { if (!loader.moduleInfo[name]) { loader.addModule(details, name); } } } } return this; }, /** * Executes the function associated with each required * module, binding the module to the YUI instance. * @param {Array} r The array of modules to attach * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached * @method _attach * @private */ _attach: function(r, moot) { var i, name, mod, details, req, use, after, mods = YUI.Env.mods, aliases = YUI.Env.aliases, Y = this, j, loader = Y.Env._loader, done = Y.Env._attached, len = r.length, loader, c = []; //Check for conditional modules (in a second+ instance) and add their requirements //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass for (i = 0; i < len; i++) { name = r[i]; mod = mods[name]; c.push(name); if (loader && loader.conditions[name]) { Y.Object.each(loader.conditions[name], function(def) { var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y))); if (go) { c.push(def.name); } }); } } r = c; len = r.length; for (i = 0; i < len; i++) { if (!done[r[i]]) { name = r[i]; mod = mods[name]; if (aliases && aliases[name]) { Y._attach(aliases[name]); continue; } if (!mod) { if (loader && loader.moduleInfo[name]) { mod = loader.moduleInfo[name]; moot = true; } //if (!loader || !loader.moduleInfo[name]) { //if ((!loader || !loader.moduleInfo[name]) && !moot) { if (!moot && name) { if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) { Y.Env._missed.push(name); Y.Env._missed = Y.Array.dedupe(Y.Env._missed); Y.message('NOT loaded: ' + name, 'warn', 'yui'); } } } else { done[name] = true; //Don't like this, but in case a mod was asked for once, then we fetch it //We need to remove it from the missed list ^davglass for (j = 0; j < Y.Env._missed.length; j++) { if (Y.Env._missed[j] === name) { Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui'); Y.Env._missed.splice(j, 1); } } details = mod.details; req = details.requires; use = details.use; after = details.after; if (req) { for (j = 0; j < req.length; j++) { if (!done[req[j]]) { if (!Y._attach(req)) { return false; } break; } } } if (after) { for (j = 0; j < after.length; j++) { if (!done[after[j]]) { if (!Y._attach(after, true)) { return false; } break; } } } if (mod.fn) { try { mod.fn(Y, name); } catch (e) { Y.error('Attach error: ' + name, e, name); return false; } } if (use) { for (j = 0; j < use.length; j++) { if (!done[use[j]]) { if (!Y._attach(use)) { return false; } break; } } } } } } return true; }, /** * Attaches one or more modules to the YUI instance. When this * is executed, the requirements are analyzed, and one of * several things can happen: * * * All requirements are available on the page -- The modules * are attached to the instance. If supplied, the use callback * is executed synchronously. * * * Modules are missing, the Get utility is not available OR * the 'bootstrap' config is false -- A warning is issued about * the missing modules and all available modules are attached. * * * Modules are missing, the Loader is not available but the Get * utility is and boostrap is not false -- The loader is bootstrapped * before doing the following.... * * * Modules are missing and the Loader is available -- The loader * expands the dependency tree and fetches missing modules. When * the loader is finshed the callback supplied to use is executed * asynchronously. * * @method use * @param modules* {String|Array} 1-n modules to bind (uses arguments array). * @param [callback] {Function} callback function executed when * the instance has the required functionality. If included, it * must be the last parameter. * @param callback.Y {YUI} The `YUI` instance created for this sandbox * @param callback.data {Object} Object data returned from `Loader`. * * @example * // loads and attaches dd and its dependencies * YUI().use('dd', function(Y) {}); * * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0) * YUI().use(['dd', 'node'], function(Y) {}); * * // attaches all modules that are available on the page * YUI().use('*', function(Y) {}); * * // intrinsic YUI gallery support (since 3.1.0) * YUI().use('gallery-yql', function(Y) {}); * * // intrinsic YUI 2in3 support (since 3.1.0) * YUI().use('yui2-datatable', function(Y) {}); * * @return {YUI} the YUI instance. */ use: function() { var args = SLICE.call(arguments, 0), callback = args[args.length - 1], Y = this, i = 0, a = [], name, Env = Y.Env, provisioned = true; // The last argument supplied to use can be a load complete callback if (Y.Lang.isFunction(callback)) { args.pop(); } else { callback = null; } if (Y.Lang.isArray(args[0])) { args = args[0]; } if (Y.config.cacheUse) { while ((name = args[i++])) { if (!Env._attached[name]) { provisioned = false; break; } } if (provisioned) { if (args.length) { } Y._notify(callback, ALREADY_DONE, args); return Y; } } if (Y._loading) { Y._useQueue = Y._useQueue || new Y.Queue(); Y._useQueue.add([args, callback]); } else { Y._use(args, function(Y, response) { Y._notify(callback, response, args); }); } return Y; }, /** * Notify handler from Loader for attachment/load errors * @method _notify * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn` * @param response {Object} The response returned from Loader * @param args {Array} The aruments passed from Loader * @private */ _notify: function(callback, response, args) { if (!response.success && this.config.loadErrorFn) { this.config.loadErrorFn.call(this, this, callback, response, args); } else if (callback) { try { callback(this, response); } catch (e) { this.error('use callback error', e, args); } } }, /** * This private method is called from the `use` method queue. To ensure that only one set of loading * logic is performed at a time. * @method _use * @private * @param args* {String} 1-n modules to bind (uses arguments array). * @param *callback {Function} callback function executed when * the instance has the required functionality. If included, it * must be the last parameter. */ _use: function(args, callback) { if (!this.Array) { this._attach(['yui-base']); } var len, loader, handleBoot, handleRLS, Y = this, G_ENV = YUI.Env, mods = G_ENV.mods, Env = Y.Env, used = Env._used, aliases = G_ENV.aliases, queue = G_ENV._loaderQueue, firstArg = args[0], YArray = Y.Array, config = Y.config, boot = config.bootstrap, missing = [], r = [], ret = true, fetchCSS = config.fetchCSS, process = function(names, skip) { var i = 0, a = []; if (!names.length) { return; } if (aliases) { for (i = 0; i < names.length; i++) { if (aliases[names[i]]) { a = [].concat(a, aliases[names[i]]); } else { a.push(names[i]); } } names = a; } YArray.each(names, function(name) { // add this module to full list of things to attach if (!skip) { r.push(name); } // only attach a module once if (used[name]) { return; } var m = mods[name], req, use; if (m) { used[name] = true; req = m.details.requires; use = m.details.use; } else { // CSS files don't register themselves, see if it has // been loaded if (!G_ENV._loaded[VERSION][name]) { missing.push(name); } else { used[name] = true; // probably css } } // make sure requirements are attached if (req && req.length) { process(req); } // make sure we grab the submodule dependencies too if (use && use.length) { process(use, 1); } }); }, handleLoader = function(fromLoader) { var response = fromLoader || { success: true, msg: 'not dynamic' }, redo, origMissing, ret = true, data = response.data; Y._loading = false; if (data) { origMissing = missing; missing = []; r = []; process(data); redo = missing.length; if (redo) { if (missing.sort().join() == origMissing.sort().join()) { redo = false; } } } if (redo && data) { Y._loading = false; Y._use(args, function() { if (Y._attach(data)) { Y._notify(callback, response, data); } }); } else { if (data) { ret = Y._attach(data); } if (ret) { Y._notify(callback, response, args); } } if (Y._useQueue && Y._useQueue.size() && !Y._loading) { Y._use.apply(Y, Y._useQueue.next()); } }; // YUI().use('*'); // bind everything available if (firstArg === '*') { ret = Y._attach(Y.Object.keys(mods)); if (ret) { handleLoader(); } return Y; } if (mods['loader'] && !Y.Loader) { Y._attach(['loader']); } // use loader to expand dependencies and sort the // requirements if it is available. if (boot && Y.Loader && args.length) { loader = getLoader(Y); loader.require(args); loader.ignoreRegistered = true; loader._boot = true; loader.calculate(null, (fetchCSS) ? null : 'js'); args = loader.sorted; loader._boot = false; } // process each requirement and any additional requirements // the module metadata specifies process(args); len = missing.length; if (len) { missing = Y.Object.keys(YArray.hash(missing)); len = missing.length; } // dynamic load if (boot && len && Y.Loader) { Y._loading = true; loader = getLoader(Y); loader.onEnd = handleLoader; loader.context = Y; loader.data = args; loader.ignoreRegistered = false; loader.require(args); loader.insert(null, (fetchCSS) ? null : 'js'); } else if (boot && len && Y.Get && !Env.bootstrapped) { Y._loading = true; handleBoot = function() { Y._loading = false; queue.running = false; Env.bootstrapped = true; G_ENV._bootstrapping = false; if (Y._attach(['loader'])) { Y._use(args, callback); } }; if (G_ENV._bootstrapping) { queue.add(handleBoot); } else { G_ENV._bootstrapping = true; Y.Get.script(config.base + config.loaderPath, { onEnd: handleBoot }); } } else { ret = Y._attach(args); if (ret) { handleLoader(); } } return Y; }, /** Adds a namespace object onto the YUI global if called statically. // creates YUI.your.namespace.here as nested objects YUI.namespace("your.namespace.here"); If called as a method on a YUI <em>instance</em>, it creates the namespace on the instance. // creates Y.property.package Y.namespace("property.package"); Dots in the input string cause `namespace` to create nested objects for each token. If any part of the requested namespace already exists, the current object will be left in place. This allows multiple calls to `namespace` to preserve existing namespaced properties. If the first token in the namespace string is "YAHOO", the token is discarded. Be careful with namespace tokens. Reserved words may work in some browsers and not others. For instance, the following will fail in some browsers because the supported version of JavaScript reserves the word "long": Y.namespace("really.long.nested.namespace"); <em>Note: If you pass multiple arguments to create multiple namespaces, only the last one created is returned from this function.</em> @method namespace @param {String} namespace* namespaces to create. @return {Object} A reference to the last namespace object created. **/ namespace: function() { var a = arguments, o, i = 0, j, d, arg; for (; i < a.length; i++) { o = this; //Reset base object per argument or it will get reused from the last arg = a[i]; if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present d = arg.split(PERIOD); for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) { o[d[j]] = o[d[j]] || {}; o = o[d[j]]; } } else { o[arg] = o[arg] || {}; o = o[arg]; //Reset base object to the new object so it's returned } } return o; }, // this is replaced if the log module is included log: NOOP, message: NOOP, // this is replaced if the dump module is included dump: function (o) { return ''+o; }, /** * Report an error. The reporting mechanism is controlled by * the `throwFail` configuration attribute. If throwFail is * not specified, the message is written to the Logger, otherwise * a JS error is thrown. If an `errorFn` is specified in the config * it must return `true` to keep the error from being thrown. * @method error * @param msg {String} the error message. * @param e {Error|String} Optional JS error that was caught, or an error string. * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`) * and `throwFail` is specified, this error will be re-thrown. * @return {YUI} this YUI instance. */ error: function(msg, e, src) { //TODO Add check for window.onerror here var Y = this, ret; if (Y.config.errorFn) { ret = Y.config.errorFn.apply(Y, arguments); } if (Y.config.throwFail && !ret) { throw (e || new Error(msg)); } else { Y.message(msg, 'error', ''+src); // don't scrub this one } return Y; }, /** * Generate an id that is unique among all YUI instances * @method guid * @param pre {String} optional guid prefix. * @return {String} the guid. */ guid: function(pre) { var id = this.Env._guidp + '_' + (++this.Env._uidx); return (pre) ? (pre + id) : id; }, /** * Returns a `guid` associated with an object. If the object * does not have one, a new one is created unless `readOnly` * is specified. * @method stamp * @param o {Object} The object to stamp. * @param readOnly {Boolean} if `true`, a valid guid will only * be returned if the object has one assigned to it. * @return {String} The object's guid or null. */ stamp: function(o, readOnly) { var uid; if (!o) { return o; } // IE generates its own unique ID for dom nodes // The uniqueID property of a document node returns a new ID if (o.uniqueID && o.nodeType && o.nodeType !== 9) { uid = o.uniqueID; } else { uid = (typeof o === 'string') ? o : o._yuid; } if (!uid) { uid = this.guid(); if (!readOnly) { try { o._yuid = uid; } catch (e) { uid = null; } } } return uid; }, /** * Destroys the YUI instance * @method destroy * @since 3.3.0 */ destroy: function() { var Y = this; if (Y.Event) { Y.Event._unload(); } delete instances[Y.id]; delete Y.Env; delete Y.config; } /** * instanceof check for objects that works around * memory leak in IE when the item tested is * window/document * @method instanceOf * @param o {Object} The object to check. * @param type {Object} The class to check against. * @since 3.3.0 */ }; YUI.prototype = proto; // inheritance utilities are not available yet for (prop in proto) { if (proto.hasOwnProperty(prop)) { YUI[prop] = proto[prop]; } } /** Static method on the Global YUI object to apply a config to all YUI instances. It's main use case is "mashups" where several third party scripts are trying to write to a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of overwriting other scripts configs. @static @since 3.5.0 @method applyConfig @param {Object} o the configuration object. @example YUI.applyConfig({ modules: { davglass: { fullpath: './davglass.js' } } }); YUI.applyConfig({ modules: { foo: { fullpath: './foo.js' } } }); YUI().use('davglass', function(Y) { //Module davglass will be available here.. }); */ YUI.applyConfig = function(o) { if (!o) { return; } //If there is a GlobalConfig, apply it first to set the defaults if (YUI.GlobalConfig) { this.prototype.applyConfig.call(this, YUI.GlobalConfig); } //Apply this config to it this.prototype.applyConfig.call(this, o); //Reset GlobalConfig to the combined config YUI.GlobalConfig = this.config; }; // set up the environment YUI._init(); if (hasWin) { // add a window load event at load time so we can capture // the case where it fires before dynamic loading is // complete. add(window, 'load', handleLoad); } else { handleLoad(); } YUI.Env.add = add; YUI.Env.remove = remove; /*global exports*/ // Support the CommonJS method for exporting our single global if (typeof exports == 'object') { exports.YUI = YUI; } }()); /** * The config object contains all of the configuration options for * the `YUI` instance. This object is supplied by the implementer * when instantiating a `YUI` instance. Some properties have default * values if they are not supplied by the implementer. This should * not be updated directly because some values are cached. Use * `applyConfig()` to update the config object on a YUI instance that * has already been configured. * * @class config * @static */ /** * Allows the YUI seed file to fetch the loader component and library * metadata to dynamically load additional dependencies. * * @property bootstrap * @type boolean * @default true */ /** * Turns on writing Ylog messages to the browser console. * * @property debug * @type boolean * @default true */ /** * Log to the browser console if debug is on and the browser has a * supported console. * * @property useBrowserConsole * @type boolean * @default true */ /** * A hash of log sources that should be logged. If specified, only * log messages from these sources will be logged. * * @property logInclude * @type object */ /** * A hash of log sources that should be not be logged. If specified, * all sources are logged if not on this list. * * @property logExclude * @type object */ /** * Set to true if the yui seed file was dynamically loaded in * order to bootstrap components relying on the window load event * and the `domready` custom event. * * @property injected * @type boolean * @default false */ /** * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error. * Otherwise the failure is logged. * * @property throwFail * @type boolean * @default true */ /** * The window/frame that this instance should operate in. * * @property win * @type Window * @default the window hosting YUI */ /** * The document associated with the 'win' configuration. * * @property doc * @type Document * @default the document hosting YUI */ /** * A list of modules that defines the YUI core (overrides the default list). * * @property core * @type Array * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ] */ /** * A list of languages in order of preference. This list is matched against * the list of available languages in modules that the YUI instance uses to * determine the best possible localization of language sensitive modules. * Languages are represented using BCP 47 language tags, such as "en-GB" for * English as used in the United Kingdom, or "zh-Hans-CN" for simplified * Chinese as used in China. The list can be provided as a comma-separated * list or as an array. * * @property lang * @type string|string[] */ /** * The default date format * @property dateFormat * @type string * @deprecated use configuration in `DataType.Date.format()` instead. */ /** * The default locale * @property locale * @type string * @deprecated use `config.lang` instead. */ /** * The default interval when polling in milliseconds. * @property pollInterval * @type int * @default 20 */ /** * The number of dynamic nodes to insert by default before * automatically removing them. This applies to script nodes * because removing the node will not make the evaluated script * unavailable. Dynamic CSS is not auto purged, because removing * a linked style sheet will also remove the style definitions. * @property purgethreshold * @type int * @default 20 */ /** * The default interval when polling in milliseconds. * @property windowResizeDelay * @type int * @default 40 */ /** * Base directory for dynamic loading * @property base * @type string */ /* * The secure base dir (not implemented) * For dynamic loading. * @property secureBase * @type string */ /** * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?` * For dynamic loading. * @property comboBase * @type string */ /** * The root path to prepend to module path for the combo service. * Ex: 3.0.0b1/build/ * For dynamic loading. * @property root * @type string */ /** * A filter to apply to result urls. This filter will modify the default * path for all modules. The default path for the YUI library is the * minified version of the files (e.g., event-min.js). The filter property * can be a predefined filter or a custom filter. The valid predefined * filters are: * <dl> * <dt>DEBUG</dt> * <dd>Selects the debug versions of the library (e.g., event-debug.js). * This option will automatically include the Logger widget</dd> * <dt>RAW</dt> * <dd>Selects the non-minified version of the library (e.g., event.js).</dd> * </dl> * You can also define a custom filter, which must be an object literal * containing a search expression and a replace string: * * myFilter: { * 'searchExp': "-min\\.js", * 'replaceStr': "-debug.js" * } * * For dynamic loading. * * @property filter * @type string|object */ /** * The `skin` config let's you configure application level skin * customizations. It contains the following attributes which * can be specified to override the defaults: * * // The default skin, which is automatically applied if not * // overriden by a component-specific skin definition. * // Change this in to apply a different skin globally * defaultSkin: 'sam', * * // This is combined with the loader base property to get * // the default root directory for a skin. * base: 'assets/skins/', * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin * // for a given component as well. * overrides: { * slider: ['capsule', 'round'] * } * * For dynamic loading. * * @property skin */ /** * Hash of per-component filter specification. If specified for a given * component, this overrides the filter config. * * For dynamic loading. * * @property filters */ /** * Use the YUI combo service to reduce the number of http connections * required to load your dependencies. Turning this off will * disable combo handling for YUI and all module groups configured * with a combo service. * * For dynamic loading. * * @property combine * @type boolean * @default true if 'base' is not supplied, false if it is. */ /** * A list of modules that should never be dynamically loaded * * @property ignore * @type string[] */ /** * A list of modules that should always be loaded when required, even if already * present on the page. * * @property force * @type string[] */ /** * Node or id for a node that should be used as the insertion point for new * nodes. For dynamic loading. * * @property insertBefore * @type string */ /** * Object literal containing attributes to add to dynamically loaded script * nodes. * @property jsAttributes * @type string */ /** * Object literal containing attributes to add to dynamically loaded link * nodes. * @property cssAttributes * @type string */ /** * Number of milliseconds before a timeout occurs when dynamically * loading nodes. If not set, there is no timeout. * @property timeout * @type int */ /** * Callback for the 'CSSComplete' event. When dynamically loading YUI * components with CSS, this property fires when the CSS is finished * loading but script loading is still ongoing. This provides an * opportunity to enhance the presentation of a loading page a little * bit before the entire loading process is done. * * @property onCSS * @type function */ /** * A hash of module definitions to add to the list of YUI components. * These components can then be dynamically loaded side by side with * YUI via the `use()` method. This is a hash, the key is the module * name, and the value is an object literal specifying the metdata * for the module. See `Loader.addModule` for the supported module * metadata fields. Also see groups, which provides a way to * configure the base and combo spec for a set of modules. * * modules: { * mymod1: { * requires: ['node'], * fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js' * }, * mymod2: { * requires: ['mymod1'], * fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js' * } * } * * @property modules * @type object */ /** * A hash of module group definitions. It for each group you * can specify a list of modules and the base path and * combo spec to use when dynamically loading the modules. * * groups: { * yui2: { * // specify whether or not this group has a combo service * combine: true, * * // The comboSeperator to use with this group's combo handler * comboSep: ';', * * // The maxURLLength for this server * maxURLLength: 500, * * // the base path for non-combo paths * base: 'http://yui.yahooapis.com/2.8.0r4/build/', * * // the path to the combo service * comboBase: 'http://yui.yahooapis.com/combo?', * * // a fragment to prepend to the path attribute when * // when building combo urls * root: '2.8.0r4/build/', * * // the module definitions * modules: { * yui2_yde: { * path: "yahoo-dom-event/yahoo-dom-event.js" * }, * yui2_anim: { * path: "animation/animation.js", * requires: ['yui2_yde'] * } * } * } * } * * @property groups * @type object */ /** * The loader 'path' attribute to the loader itself. This is combined * with the 'base' attribute to dynamically load the loader component * when boostrapping with the get utility alone. * * @property loaderPath * @type string * @default loader/loader-min.js */ /** * Specifies whether or not YUI().use(...) will attempt to load CSS * resources at all. Any truthy value will cause CSS dependencies * to load when fetching script. The special value 'force' will * cause CSS dependencies to be loaded even if no script is needed. * * @property fetchCSS * @type boolean|string * @default true */ /** * The default gallery version to build gallery module urls * @property gallery * @type string * @since 3.1.0 */ /** * The default YUI 2 version to build yui2 module urls. This is for * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3' * config for pulling different revisions of the wrapped YUI 2 * modules. * @since 3.1.0 * @property yui2 * @type string * @default 2.9.0 */ /** * The 2in3 project is a deployment of the various versions of YUI 2 * deployed as first-class YUI 3 modules. Eventually, the wrapper * for the modules will change (but the underlying YUI 2 code will * be the same), and you can select a particular version of * the wrapper modules via this config. * @since 3.1.0 * @property 2in3 * @type string * @default 4 */ /** * Alternative console log function for use in environments without * a supported native console. The function is executed in the * YUI instance context. * @since 3.1.0 * @property logFn * @type Function */ /** * A callback to execute when Y.error is called. It receives the * error message and an javascript error object if Y.error was * executed because a javascript error was caught. The function * is executed in the YUI instance context. Returning `true` from this * function will stop the Error from being thrown. * * @since 3.2.0 * @property errorFn * @type Function */ /** * A callback to execute when the loader fails to load one or * more resource. This could be because of a script load * failure. It can also fail if a javascript module fails * to register itself, but only when the 'requireRegistration' * is true. If this function is defined, the use() callback will * only be called when the loader succeeds, otherwise it always * executes unless there was a javascript error when attaching * a module. * * @since 3.3.0 * @property loadErrorFn * @type Function */ /** * When set to true, the YUI loader will expect that all modules * it is responsible for loading will be first-class YUI modules * that register themselves with the YUI global. If this is * set to true, loader will fail if the module registration fails * to happen after the script is loaded. * * @since 3.3.0 * @property requireRegistration * @type boolean * @default false */ /** * Cache serviced use() requests. * @since 3.3.0 * @property cacheUse * @type boolean * @default true * @deprecated no longer used */ /** * Whether or not YUI should use native ES5 functionality when available for * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will * always use its own fallback implementations instead of relying on ES5 * functionality, even when it's available. * * @method useNativeES5 * @type Boolean * @default true * @since 3.5.0 */ YUI.add('yui-base', function(Y) { /* * YUI stub * @module yui * @submodule yui-base */ /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Provides core language utilites and extensions used throughout YUI. * * @class Lang * @static */ var L = Y.Lang || (Y.Lang = {}), STRING_PROTO = String.prototype, TOSTRING = Object.prototype.toString, TYPES = { 'undefined' : 'undefined', 'number' : 'number', 'boolean' : 'boolean', 'string' : 'string', '[object Function]': 'function', '[object RegExp]' : 'regexp', '[object Array]' : 'array', '[object Date]' : 'date', '[object Error]' : 'error' }, SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g, TRIMREGEX = /^\s+|\s+$/g, NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i; // -- Protected Methods -------------------------------------------------------- /** Returns `true` if the given function appears to be implemented in native code, `false` otherwise. Will always return `false` -- even in ES5-capable browsers -- if the `useNativeES5` YUI config option is set to `false`. This isn't guaranteed to be 100% accurate and won't work for anything other than functions, but it can be useful for determining whether a function like `Array.prototype.forEach` is native or a JS shim provided by another library. There's a great article by @kangax discussing certain flaws with this technique: <http://perfectionkills.com/detecting-built-in-host-methods/> While his points are valid, it's still possible to benefit from this function as long as it's used carefully and sparingly, and in such a way that false negatives have minimal consequences. It's used internally to avoid using potentially broken non-native ES5 shims that have been added to the page by other libraries. @method _isNative @param {Function} fn Function to test. @return {Boolean} `true` if _fn_ appears to be native, `false` otherwise. @static @protected @since 3.5.0 **/ L._isNative = function (fn) { return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn)); }; // -- Public Methods ----------------------------------------------------------- /** * Determines whether or not the provided item is an array. * * Returns `false` for array-like collections such as the function `arguments` * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to * test for an array-like collection. * * @method isArray * @param o The object to test. * @return {boolean} true if o is an array. * @static */ L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) { return L.type(o) === 'array'; }; /** * Determines whether or not the provided item is a boolean. * @method isBoolean * @static * @param o The object to test. * @return {boolean} true if o is a boolean. */ L.isBoolean = function(o) { return typeof o === 'boolean'; }; /** * Determines whether or not the supplied item is a date instance. * @method isDate * @static * @param o The object to test. * @return {boolean} true if o is a date. */ L.isDate = function(o) { return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o); }; /** * <p> * Determines whether or not the provided item is a function. * Note: Internet Explorer thinks certain functions are objects: * </p> * * <pre> * var obj = document.createElement("object"); * Y.Lang.isFunction(obj.getAttribute) // reports false in IE * &nbsp; * var input = document.createElement("input"); // append to body * Y.Lang.isFunction(input.focus) // reports false in IE * </pre> * * <p> * You will have to implement additional tests if these functions * matter to you. * </p> * * @method isFunction * @static * @param o The object to test. * @return {boolean} true if o is a function. */ L.isFunction = function(o) { return L.type(o) === 'function'; }; /** * Determines whether or not the provided item is null. * @method isNull * @static * @param o The object to test. * @return {boolean} true if o is null. */ L.isNull = function(o) { return o === null; }; /** * Determines whether or not the provided item is a legal number. * @method isNumber * @static * @param o The object to test. * @return {boolean} true if o is a number. */ L.isNumber = function(o) { return typeof o === 'number' && isFinite(o); }; /** * Determines whether or not the provided item is of type object * or function. Note that arrays are also objects, so * <code>Y.Lang.isObject([]) === true</code>. * @method isObject * @static * @param o The object to test. * @param failfn {boolean} fail if the input is a function. * @return {boolean} true if o is an object. * @see isPlainObject */ L.isObject = function(o, failfn) { var t = typeof o; return (o && (t === 'object' || (!failfn && (t === 'function' || L.isFunction(o))))) || false; }; /** * Determines whether or not the provided item is a string. * @method isString * @static * @param o The object to test. * @return {boolean} true if o is a string. */ L.isString = function(o) { return typeof o === 'string'; }; /** * Determines whether or not the provided item is undefined. * @method isUndefined * @static * @param o The object to test. * @return {boolean} true if o is undefined. */ L.isUndefined = function(o) { return typeof o === 'undefined'; }; /** * A convenience method for detecting a legitimate non-null value. * Returns false for null/undefined/NaN, true for other values, * including 0/false/'' * @method isValue * @static * @param o The item to test. * @return {boolean} true if it is not null/undefined/NaN || false. */ L.isValue = function(o) { var t = L.type(o); switch (t) { case 'number': return isFinite(o); case 'null': // fallthru case 'undefined': return false; default: return !!t; } }; /** * Returns the current time in milliseconds. * * @method now * @return {Number} Current time in milliseconds. * @static * @since 3.3.0 */ L.now = Date.now || function () { return new Date().getTime(); }; /** * Lightweight version of <code>Y.substitute</code>. Uses the same template * structure as <code>Y.substitute</code>, but doesn't support recursion, * auto-object coersion, or formats. * @method sub * @param {string} s String to be modified. * @param {object} o Object containing replacement values. * @return {string} the substitute result. * @static * @since 3.2.0 */ L.sub = function(s, o) { return s.replace ? s.replace(SUBREGEX, function (match, key) { return L.isUndefined(o[key]) ? match : o[key]; }) : s; }; /** * Returns a string without any leading or trailing whitespace. If * the input is not a string, the input will be returned untouched. * @method trim * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trim = STRING_PROTO.trim ? function(s) { return s && s.trim ? s.trim() : s; } : function (s) { try { return s.replace(TRIMREGEX, ''); } catch (e) { return s; } }; /** * Returns a string without any leading whitespace. * @method trimLeft * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimLeft = STRING_PROTO.trimLeft ? function (s) { return s.trimLeft(); } : function (s) { return s.replace(/^\s+/, ''); }; /** * Returns a string without any trailing whitespace. * @method trimRight * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimRight = STRING_PROTO.trimRight ? function (s) { return s.trimRight(); } : function (s) { return s.replace(/\s+$/, ''); }; /** * <p> * Returns a string representing the type of the item passed in. * </p> * * <p> * Known issues: * </p> * * <ul> * <li> * <code>typeof HTMLElementCollection</code> returns function in Safari, but * <code>Y.type()</code> reports object, which could be a good thing -- * but it actually caused the logic in <code>Y.Lang.isObject</code> to fail. * </li> * </ul> * * @method type * @param o the item to test. * @return {string} the detected type. * @static */ L.type = function(o) { return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null'); }; /** @module yui @submodule yui-base */ var Lang = Y.Lang, Native = Array.prototype, hasOwn = Object.prototype.hasOwnProperty; /** Provides utility methods for working with arrays. Additional array helpers can be found in the `collection` and `array-extras` modules. `Y.Array(thing)` returns a native array created from _thing_. Depending on _thing_'s type, one of the following will happen: * Arrays are returned unmodified unless a non-zero _startIndex_ is specified. * Array-like collections (see `Array.test()`) are converted to arrays. * For everything else, a new array is created with _thing_ as the sole item. Note: elements that are also collections, such as `<form>` and `<select>` elements, are not automatically converted to arrays. To force a conversion, pass `true` as the value of the _force_ parameter. @class Array @constructor @param {Any} thing The thing to arrayify. @param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like collection, a subset of items starting at the specified index will be returned. @param {Boolean} [force=false] If `true`, _thing_ will be treated as an array-like collection no matter what. @return {Array} A native array created from _thing_, according to the rules described above. **/ function YArray(thing, startIndex, force) { var len, result; startIndex || (startIndex = 0); if (force || YArray.test(thing)) { // IE throws when trying to slice HTMLElement collections. try { return Native.slice.call(thing, startIndex); } catch (ex) { result = []; for (len = thing.length; startIndex < len; ++startIndex) { result.push(thing[startIndex]); } return result; } } return [thing]; } Y.Array = YArray; /** Dedupes an array of strings, returning an array that's guaranteed to contain only one copy of a given string. This method differs from `Array.unique()` in that it's optimized for use only with strings, whereas `unique` may be used with other types (but is slower). Using `dedupe()` with non-string values may result in unexpected behavior. @method dedupe @param {String[]} array Array of strings to dedupe. @return {Array} Deduped copy of _array_. @static @since 3.4.0 **/ YArray.dedupe = function (array) { var hash = {}, results = [], i, item, len; for (i = 0, len = array.length; i < len; ++i) { item = array[i]; if (!hasOwn.call(hash, item)) { hash[item] = 1; results.push(item); } } return results; }; /** Executes the supplied function on each item in the array. This method wraps the native ES5 `Array.forEach()` method if available. @method each @param {Array} array Array to iterate. @param {Function} fn Function to execute on each item in the array. The function will receive the following arguments: @param {Any} fn.item Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated. @param {Object} [thisObj] `this` object to use when calling _fn_. @return {YUI} The YUI instance. @static **/ YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) { Native.forEach.call(array || [], fn, thisObj || Y); return Y; } : function (array, fn, thisObj) { for (var i = 0, len = (array && array.length) || 0; i < len; ++i) { if (i in array) { fn.call(thisObj || Y, array[i], i, array); } } return Y; }; /** Alias for `each()`. @method forEach @static **/ /** Returns an object using the first array as keys and the second as values. If the second array is not provided, or if it doesn't contain the same number of values as the first array, then `true` will be used in place of the missing values. @example Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']); // => {a: 'foo', b: 'bar', c: true} @method hash @param {String[]} keys Array of strings to use as keys. @param {Array} [values] Array to use as values. @return {Object} Hash using the first array as keys and the second as values. @static **/ YArray.hash = function (keys, values) { var hash = {}, vlen = (values && values.length) || 0, i, len; for (i = 0, len = keys.length; i < len; ++i) { if (i in keys) { hash[keys[i]] = vlen > i && i in values ? values[i] : true; } } return hash; }; /** Returns the index of the first item in the array that's equal (using a strict equality check) to the specified _value_, or `-1` if the value isn't found. This method wraps the native ES5 `Array.indexOf()` method if available. @method indexOf @param {Array} array Array to search. @param {Any} value Value to search for. @param {Number} [from=0] The index at which to begin the search. @return {Number} Index of the item strictly equal to _value_, or `-1` if not found. @static **/ YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) { return Native.indexOf.call(array, value, from); } : function (array, value, from) { // http://es5.github.com/#x15.4.4.14 var len = array.length; from = +from || 0; from = (from > 0 || -1) * Math.floor(Math.abs(from)); if (from < 0) { from += len; if (from < 0) { from = 0; } } for (; from < len; ++from) { if (from in array && array[from] === value) { return from; } } return -1; }; /** Numeric sort convenience function. The native `Array.prototype.sort()` function converts values to strings and sorts them in lexicographic order, which is unsuitable for sorting numeric values. Provide `Array.numericSort` as a custom sort function when you want to sort values in numeric order. @example [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort); // => [4, 8, 15, 16, 23, 42] @method numericSort @param {Number} a First value to compare. @param {Number} b Second value to compare. @return {Number} Difference between _a_ and _b_. @static **/ YArray.numericSort = function (a, b) { return a - b; }; /** Executes the supplied function on each item in the array. Returning a truthy value from the function will stop the processing of remaining items. @method some @param {Array} array Array to iterate over. @param {Function} fn Function to execute on each item. The function will receive the following arguments: @param {Any} fn.value Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated over. @param {Object} [thisObj] `this` object to use when calling _fn_. @return {Boolean} `true` if the function returns a truthy value on any of the items in the array; `false` otherwise. @static **/ YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) { return Native.some.call(array, fn, thisObj); } : function (array, fn, thisObj) { for (var i = 0, len = array.length; i < len; ++i) { if (i in array && fn.call(thisObj, array[i], i, array)) { return true; } } return false; }; /** Evaluates _obj_ to determine if it's an array, an array-like collection, or something else. This is useful when working with the function `arguments` collection and `HTMLElement` collections. Note: This implementation doesn't consider elements that are also collections, such as `<form>` and `<select>`, to be array-like. @method test @param {Object} obj Object to test. @return {Number} A number indicating the results of the test: * 0: Neither an array nor an array-like collection. * 1: Real array. * 2: Array-like collection. @static **/ YArray.test = function (obj) { var result = 0; if (Lang.isArray(obj)) { result = 1; } else if (Lang.isObject(obj)) { try { // indexed, but no tagName (element) or alert (window), // or functions without apply/call (Safari // HTMLElementCollection bug). if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) { result = 2; } } catch (ex) {} } return result; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * A simple FIFO queue. Items are added to the Queue with add(1..n items) and * removed using next(). * * @class Queue * @constructor * @param {MIXED} item* 0..n items to seed the queue. */ function Queue() { this._init(); this.add.apply(this, arguments); } Queue.prototype = { /** * Initialize the queue * * @method _init * @protected */ _init: function() { /** * The collection of enqueued items * * @property _q * @type Array * @protected */ this._q = []; }, /** * Get the next item in the queue. FIFO support * * @method next * @return {MIXED} the next item in the queue. */ next: function() { return this._q.shift(); }, /** * Get the last in the queue. LIFO support. * * @method last * @return {MIXED} the last item in the queue. */ last: function() { return this._q.pop(); }, /** * Add 0..n items to the end of the queue. * * @method add * @param {MIXED} item* 0..n items. * @return {object} this queue. */ add: function() { this._q.push.apply(this._q, arguments); return this; }, /** * Returns the current number of queued items. * * @method size * @return {Number} The size. */ size: function() { return this._q.length; } }; Y.Queue = Queue; YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue(); /** The YUI module contains the components required for building the YUI seed file. This includes the script loading mechanism, a simple queue, and the core utilities for the library. @module yui @submodule yui-base **/ var CACHED_DELIMITER = '__', hasOwn = Object.prototype.hasOwnProperty, isObject = Y.Lang.isObject, win = Y.config.win; /** Returns a wrapper for a function which caches the return value of that function, keyed off of the combined string representation of the argument values provided when the wrapper is called. Calling this function again with the same arguments will return the cached value rather than executing the wrapped function. Note that since the cache is keyed off of the string representation of arguments passed to the wrapper function, arguments that aren't strings and don't provide a meaningful `toString()` method may result in unexpected caching behavior. For example, the objects `{}` and `{foo: 'bar'}` would both be converted to the string `[object Object]` when used as a cache key. @method cached @param {Function} source The function to memoize. @param {Object} [cache={}] Object in which to store cached values. You may seed this object with pre-existing cached values if desired. @param {any} [refetch] If supplied, this value is compared with the cached value using a `==` comparison. If the values are equal, the wrapped function is executed again even though a cached value exists. @return {Function} Wrapped function. @for YUI **/ Y.cached = function (source, cache, refetch) { cache || (cache = {}); return function (arg) { var key = arguments.length > 1 ? Array.prototype.join.call(arguments, CACHED_DELIMITER) : String(arg); if (!(key in cache) || (refetch && cache[key] == refetch)) { cache[key] = source.apply(source, arguments); } return cache[key]; }; }; /** Returns the `location` object from the window/frame in which this YUI instance operates, or `undefined` when executing in a non-browser environment (e.g. Node.js). It is _not_ recommended to hold references to the `window.location` object outside of the scope of a function in which its properties are being accessed or its methods are being called. This is because of a nasty bug/issue that exists in both Safari and MobileSafari browsers: [WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679). @method getLocation @return {location} The `location` object from the window/frame in which this YUI instance operates. @since 3.5.0 **/ Y.getLocation = function () { // The reference to the `window` object created outside this function's // scope is safe to hold on to, but it is not safe to do so with the // `location` object. The WebKit engine used in Safari and MobileSafari will // "disconnect" the `location` object from the `window` when a page is // restored from back/forward history cache. return win && win.location; }; /** Returns a new object containing all of the properties of all the supplied objects. The properties from later objects will overwrite those in earlier objects. Passing in a single object will create a shallow copy of it. For a deep copy, use `clone()`. @method merge @param {Object} objects* One or more objects to merge. @return {Object} A new merged object. **/ Y.merge = function () { var args = arguments, i = 0, len = args.length, result = {}; for (; i < len; ++i) { Y.mix(result, args[i], true); } return result; }; /** Mixes _supplier_'s properties into _receiver_. Properties on _receiver_ or _receiver_'s prototype will not be overwritten or shadowed unless the _overwrite_ parameter is `true`, and will not be merged unless the _merge_ parameter is `true`. In the default mode (0), only properties the supplier owns are copied (prototype properties are not copied). The following copying modes are available: * `0`: _Default_. Object to object. * `1`: Prototype to prototype. * `2`: Prototype to prototype and object to object. * `3`: Prototype to object. * `4`: Object to prototype. @method mix @param {Function|Object} receiver The object or function to receive the mixed properties. @param {Function|Object} supplier The object or function supplying the properties to be mixed. @param {Boolean} [overwrite=false] If `true`, properties that already exist on the receiver will be overwritten with properties from the supplier. @param {String[]} [whitelist] An array of property names to copy. If specified, only the whitelisted properties will be copied, and all others will be ignored. @param {Number} [mode=0] Mix mode to use. See above for available modes. @param {Boolean} [merge=false] If `true`, objects and arrays that already exist on the receiver will have the corresponding object/array from the supplier merged into them, rather than being skipped or overwritten. When both _overwrite_ and _merge_ are `true`, _merge_ takes precedence. @return {Function|Object|YUI} The receiver, or the YUI instance if the specified receiver is falsy. **/ Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) { var alwaysOverwrite, exists, from, i, key, len, to; // If no supplier is given, we return the receiver. If no receiver is given, // we return Y. Returning Y doesn't make much sense to me, but it's // grandfathered in for backcompat reasons. if (!receiver || !supplier) { return receiver || Y; } if (mode) { // In mode 2 (prototype to prototype and object to object), we recurse // once to do the proto to proto mix. The object to object mix will be // handled later on. if (mode === 2) { Y.mix(receiver.prototype, supplier.prototype, overwrite, whitelist, 0, merge); } // Depending on which mode is specified, we may be copying from or to // the prototypes of the supplier and receiver. from = mode === 1 || mode === 3 ? supplier.prototype : supplier; to = mode === 1 || mode === 4 ? receiver.prototype : receiver; // If either the supplier or receiver doesn't actually have a // prototype property, then we could end up with an undefined `from` // or `to`. If that happens, we abort and return the receiver. if (!from || !to) { return receiver; } } else { from = supplier; to = receiver; } // If `overwrite` is truthy and `merge` is falsy, then we can skip a // property existence check on each iteration and save some time. alwaysOverwrite = overwrite && !merge; if (whitelist) { for (i = 0, len = whitelist.length; i < len; ++i) { key = whitelist[i]; // We call `Object.prototype.hasOwnProperty` instead of calling // `hasOwnProperty` on the object itself, since the object's // `hasOwnProperty` method may have been overridden or removed. // Also, some native objects don't implement a `hasOwnProperty` // method. if (!hasOwn.call(from, key)) { continue; } // The `key in to` check here is (sadly) intentional for backwards // compatibility reasons. It prevents undesired shadowing of // prototype members on `to`. exists = alwaysOverwrite ? false : key in to; if (merge && exists && isObject(to[key], true) && isObject(from[key], true)) { // If we're in merge mode, and the key is present on both // objects, and the value on both objects is either an object or // an array (but not a function), then we recurse to merge the // `from` value into the `to` value instead of overwriting it. // // Note: It's intentional that the whitelist isn't passed to the // recursive call here. This is legacy behavior that lots of // code still depends on. Y.mix(to[key], from[key], overwrite, null, 0, merge); } else if (overwrite || !exists) { // We're not in merge mode, so we'll only copy the `from` value // to the `to` value if we're in overwrite mode or if the // current key doesn't exist on the `to` object. to[key] = from[key]; } } } else { for (key in from) { // The code duplication here is for runtime performance reasons. // Combining whitelist and non-whitelist operations into a single // loop or breaking the shared logic out into a function both result // in worse performance, and Y.mix is critical enough that the byte // tradeoff is worth it. if (!hasOwn.call(from, key)) { continue; } // The `key in to` check here is (sadly) intentional for backwards // compatibility reasons. It prevents undesired shadowing of // prototype members on `to`. exists = alwaysOverwrite ? false : key in to; if (merge && exists && isObject(to[key], true) && isObject(from[key], true)) { Y.mix(to[key], from[key], overwrite, null, 0, merge); } else if (overwrite || !exists) { to[key] = from[key]; } } // If this is an IE browser with the JScript enumeration bug, force // enumeration of the buggy properties by making a recursive call with // the buggy properties as the whitelist. if (Y.Object._hasEnumBug) { Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge); } } return receiver; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Adds utilities to the YUI instance for working with objects. * * @class Object */ var Lang = Y.Lang, hasOwn = Object.prototype.hasOwnProperty, UNDEFINED, // <-- Note the comma. We're still declaring vars. /** * Returns a new object that uses _obj_ as its prototype. This method wraps the * native ES5 `Object.create()` method if available, but doesn't currently * pass through `Object.create()`'s second argument (properties) in order to * ensure compatibility with older browsers. * * @method () * @param {Object} obj Prototype object. * @return {Object} New object using _obj_ as its prototype. * @static */ O = Y.Object = Lang._isNative(Object.create) ? function (obj) { // We currently wrap the native Object.create instead of simply aliasing it // to ensure consistency with our fallback shim, which currently doesn't // support Object.create()'s second argument (properties). Once we have a // safe fallback for the properties arg, we can stop wrapping // Object.create(). return Object.create(obj); } : (function () { // Reusable constructor function for the Object.create() shim. function F() {} // The actual shim. return function (obj) { F.prototype = obj; return new F(); }; }()), /** * Property names that IE doesn't enumerate in for..in loops, even when they * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to * manually enumerate these properties. * * @property _forceEnum * @type String[] * @protected * @static */ forceEnum = O._forceEnum = [ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'toLocaleString', 'valueOf' ], /** * `true` if this browser has the JScript enumeration bug that prevents * enumeration of the properties named in the `_forceEnum` array, `false` * otherwise. * * See: * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug> * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation> * * @property _hasEnumBug * @type Boolean * @protected * @static */ hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'), /** * `true` if this browser incorrectly considers the `prototype` property of * functions to be enumerable. Currently known to affect Opera 11.50. * * @property _hasProtoEnumBug * @type Boolean * @protected * @static */ hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'), /** * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or * exists only on _obj_'s prototype. This is essentially a safer version of * `obj.hasOwnProperty()`. * * @method owns * @param {Object} obj Object to test. * @param {String} key Property name to look for. * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise. * @static */ owns = O.owns = function (obj, key) { return !!obj && hasOwn.call(obj, key); }; // <-- End of var declarations. /** * Alias for `owns()`. * * @method hasKey * @param {Object} obj Object to test. * @param {String} key Property name to look for. * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise. * @static */ O.hasKey = owns; /** * Returns an array containing the object's enumerable keys. Does not include * prototype keys or non-enumerable keys. * * Note that keys are returned in enumeration order (that is, in the same order * that they would be enumerated by a `for-in` loop), which may not be the same * as the order in which they were defined. * * This method is an alias for the native ES5 `Object.keys()` method if * available. * * @example * * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'}); * // => ['a', 'b', 'c'] * * @method keys * @param {Object} obj An object. * @return {String[]} Array of keys. * @static */ O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) { if (!Lang.isObject(obj)) { throw new TypeError('Object.keys called on a non-object'); } var keys = [], i, key, len; if (hasProtoEnumBug && typeof obj === 'function') { for (key in obj) { if (owns(obj, key) && key !== 'prototype') { keys.push(key); } } } else { for (key in obj) { if (owns(obj, key)) { keys.push(key); } } } if (hasEnumBug) { for (i = 0, len = forceEnum.length; i < len; ++i) { key = forceEnum[i]; if (owns(obj, key)) { keys.push(key); } } } return keys; }; /** * Returns an array containing the values of the object's enumerable keys. * * Note that values are returned in enumeration order (that is, in the same * order that they would be enumerated by a `for-in` loop), which may not be the * same as the order in which they were defined. * * @example * * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'}); * // => ['foo', 'bar', 'baz'] * * @method values * @param {Object} obj An object. * @return {Array} Array of values. * @static */ O.values = function (obj) { var keys = O.keys(obj), i = 0, len = keys.length, values = []; for (; i < len; ++i) { values.push(obj[keys[i]]); } return values; }; /** * Returns the number of enumerable keys owned by an object. * * @method size * @param {Object} obj An object. * @return {Number} The object's size. * @static */ O.size = function (obj) { try { return O.keys(obj).length; } catch (ex) { return 0; // Legacy behavior for non-objects. } }; /** * Returns `true` if the object owns an enumerable property with the specified * value. * * @method hasValue * @param {Object} obj An object. * @param {any} value The value to search for. * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise. * @static */ O.hasValue = function (obj, value) { return Y.Array.indexOf(O.values(obj), value) > -1; }; /** * Executes a function on each enumerable property in _obj_. The function * receives the value, the key, and the object itself as parameters (in that * order). * * By default, only properties owned by _obj_ are enumerated. To include * prototype properties, set the _proto_ parameter to `true`. * * @method each * @param {Object} obj Object to enumerate. * @param {Function} fn Function to execute on each enumerable property. * @param {mixed} fn.value Value of the current property. * @param {String} fn.key Key of the current property. * @param {Object} fn.obj Object being enumerated. * @param {Object} [thisObj] `this` object to use when calling _fn_. * @param {Boolean} [proto=false] Include prototype properties. * @return {YUI} the YUI instance. * @chainable * @static */ O.each = function (obj, fn, thisObj, proto) { var key; for (key in obj) { if (proto || owns(obj, key)) { fn.call(thisObj || Y, obj[key], key, obj); } } return Y; }; /** * Executes a function on each enumerable property in _obj_, but halts if the * function returns a truthy value. The function receives the value, the key, * and the object itself as paramters (in that order). * * By default, only properties owned by _obj_ are enumerated. To include * prototype properties, set the _proto_ parameter to `true`. * * @method some * @param {Object} obj Object to enumerate. * @param {Function} fn Function to execute on each enumerable property. * @param {mixed} fn.value Value of the current property. * @param {String} fn.key Key of the current property. * @param {Object} fn.obj Object being enumerated. * @param {Object} [thisObj] `this` object to use when calling _fn_. * @param {Boolean} [proto=false] Include prototype properties. * @return {Boolean} `true` if any execution of _fn_ returns a truthy value, * `false` otherwise. * @static */ O.some = function (obj, fn, thisObj, proto) { var key; for (key in obj) { if (proto || owns(obj, key)) { if (fn.call(thisObj || Y, obj[key], key, obj)) { return true; } } } return false; }; /** * Retrieves the sub value at the provided path, * from the value object provided. * * @method getValue * @static * @param o The object from which to extract the property value. * @param path {Array} A path array, specifying the object traversal path * from which to obtain the sub value. * @return {Any} The value stored in the path, undefined if not found, * undefined if the source is not an object. Returns the source object * if an empty path is provided. */ O.getValue = function(o, path) { if (!Lang.isObject(o)) { return UNDEFINED; } var i, p = Y.Array(path), l = p.length; for (i = 0; o !== UNDEFINED && i < l; i++) { o = o[p[i]]; } return o; }; /** * Sets the sub-attribute value at the provided path on the * value object. Returns the modified value object, or * undefined if the path is invalid. * * @method setValue * @static * @param o The object on which to set the sub value. * @param path {Array} A path array, specifying the object traversal path * at which to set the sub value. * @param val {Any} The new value for the sub-attribute. * @return {Object} The modified object, with the new sub value set, or * undefined, if the path was invalid. */ O.setValue = function(o, path, val) { var i, p = Y.Array(path), leafIdx = p.length - 1, ref = o; if (leafIdx >= 0) { for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) { ref = ref[p[i]]; } if (ref !== UNDEFINED) { ref[p[i]] = val; } else { return UNDEFINED; } } return o; }; /** * Returns `true` if the object has no enumerable properties of its own. * * @method isEmpty * @param {Object} obj An object. * @return {Boolean} `true` if the object is empty. * @static * @since 3.2.0 */ O.isEmpty = function (obj) { return !O.keys(Object(obj)).length; }; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and the * core utilities for the library. * @module yui * @submodule yui-base */ /** * YUI user agent detection. * Do not fork for a browser if it can be avoided. Use feature detection when * you can. Use the user agent as a last resort. For all fields listed * as @type float, UA stores a version number for the browser engine, * 0 otherwise. This value may or may not map to the version number of * the browser using the engine. The value is presented as a float so * that it can easily be used for boolean evaluation as well as for * looking for a particular range of versions. Because of this, * some of the granularity of the version info may be lost. The fields that * are @type string default to null. The API docs list the values that * these fields can have. * @class UA * @static */ /** * Static method on `YUI.Env` for parsing a UA string. Called at instantiation * to populate `Y.UA`. * * @static * @method parseUA * @param {String} [subUA=navigator.userAgent] UA string to parse * @return {Object} The Y.UA object */ YUI.Env.parseUA = function(subUA) { var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() { return (c++ == 1) ? '' : '.'; })); }, win = Y.config.win, nav = win && win.navigator, o = { /** * Internet Explorer version number or 0. Example: 6 * @property ie * @type float * @static */ ie: 0, /** * Opera version number or 0. Example: 9.2 * @property opera * @type float * @static */ opera: 0, /** * Gecko engine revision number. Will evaluate to 1 if Gecko * is detected but the revision could not be found. Other browsers * will be 0. Example: 1.8 * <pre> * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7 * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8 * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81 * Firefox 3.0 <-- 1.9 * Firefox 3.5 <-- 1.91 * </pre> * @property gecko * @type float * @static */ gecko: 0, /** * AppleWebKit version. KHTML browsers that are not WebKit browsers * will evaluate to 1, other browsers 0. Example: 418.9 * <pre> * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the * latest available for Mac OSX 10.3. * Safari 2.0.2: 416 <-- hasOwnProperty introduced * Safari 2.0.4: 418 <-- preventDefault fixed * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run * different versions of webkit * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been * updated, but not updated * to the latest patch. * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native * SVG and many major issues fixed). * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic * update from 2.x via the 10.4.11 OS patch. * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event. * yahoo.com user agent hack removed. * </pre> * http://en.wikipedia.org/wiki/Safari_version_history * @property webkit * @type float * @static */ webkit: 0, /** * Safari will be detected as webkit, but this property will also * be populated with the Safari version number * @property safari * @type float * @static */ safari: 0, /** * Chrome will be detected as webkit, but this property will also * be populated with the Chrome version number * @property chrome * @type float * @static */ chrome: 0, /** * The mobile property will be set to a string containing any relevant * user agent information when a modern mobile browser is detected. * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series * devices with the WebKit-based browser, and Opera Mini. * @property mobile * @type string * @default null * @static */ mobile: null, /** * Adobe AIR version number or 0. Only populated if webkit is detected. * Example: 1.0 * @property air * @type float */ air: 0, /** * Detects Apple iPad's OS version * @property ipad * @type float * @static */ ipad: 0, /** * Detects Apple iPhone's OS version * @property iphone * @type float * @static */ iphone: 0, /** * Detects Apples iPod's OS version * @property ipod * @type float * @static */ ipod: 0, /** * General truthy check for iPad, iPhone or iPod * @property ios * @type float * @default null * @static */ ios: null, /** * Detects Googles Android OS version * @property android * @type float * @static */ android: 0, /** * Detects Kindle Silk * @property silk * @type float * @static */ silk: 0, /** * Detects Kindle Silk Acceleration * @property accel * @type Boolean * @static */ accel: false, /** * Detects Palms WebOS version * @property webos * @type float * @static */ webos: 0, /** * Google Caja version number or 0. * @property caja * @type float */ caja: nav && nav.cajaVersion, /** * Set to true if the page appears to be in SSL * @property secure * @type boolean * @static */ secure: false, /** * The operating system. Currently only detecting windows or macintosh * @property os * @type string * @default null * @static */ os: null, /** * The Nodejs Version * @property nodejs * @type float * @default 0 * @static */ nodejs: 0 }, ua = subUA || nav && nav.userAgent, loc = win && win.location, href = loc && loc.href, m; /** * The User Agent string that was parsed * @property userAgent * @type String * @static */ o.userAgent = ua; o.secure = href && (href.toLowerCase().indexOf('https') === 0); if (ua) { if ((/windows|win32/i).test(ua)) { o.os = 'windows'; } else if ((/macintosh|mac_powerpc/i).test(ua)) { o.os = 'macintosh'; } else if ((/android/i).test(ua)) { o.os = 'android'; } else if ((/symbos/i).test(ua)) { o.os = 'symbos'; } else if ((/linux/i).test(ua)) { o.os = 'linux'; } else if ((/rhino/i).test(ua)) { o.os = 'rhino'; } // Modern KHTML browsers should qualify as Safari X-Grade if ((/KHTML/).test(ua)) { o.webkit = 1; } if ((/IEMobile|XBLWP7/).test(ua)) { o.mobile = 'windows'; } if ((/Fennec/).test(ua)) { o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade m = ua.match(/AppleWebKit\/([^\s]*)/); if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit; // Mobile browser check if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) { o.mobile = 'Apple'; // iPhone or iPod Touch m = ua.match(/OS ([^\s]*)/); if (m && m[1]) { m = numberify(m[1].replace('_', '.')); } o.ios = m; o.os = 'ios'; o.ipad = o.ipod = o.iphone = 0; m = ua.match(/iPad|iPod|iPhone/); if (m && m[0]) { o[m[0].toLowerCase()] = o.ios; } } else { m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/); if (m) { // Nokia N-series, webOS, ex: NokiaN95 o.mobile = m[0]; } if (/webOS/.test(ua)) { o.mobile = 'WebOS'; m = ua.match(/webOS\/([^\s]*);/); if (m && m[1]) { o.webos = numberify(m[1]); } } if (/ Android/.test(ua)) { if (/Mobile/.test(ua)) { o.mobile = 'Android'; } m = ua.match(/Android ([^\s]*);/); if (m && m[1]) { o.android = numberify(m[1]); } } if (/Silk/.test(ua)) { m = ua.match(/Silk\/([^\s]*)\)/); if (m && m[1]) { o.silk = numberify(m[1]); } if (!o.android) { o.android = 2.34; //Hack for desktop mode in Kindle o.os = 'Android'; } if (/Accelerated=true/.test(ua)) { o.accel = true; } } } m = ua.match(/Chrome\/([^\s]*)/); if (m && m[1]) { o.chrome = numberify(m[1]); // Chrome o.safari = 0; //Reset safari back to 0 } else { m = ua.match(/AdobeAIR\/([^\s]*)/); if (m) { o.air = m[0]; // Adobe AIR 1.0 or better } } } if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr) if (/Opera/.test(ua)) { m = ua.match(/Opera[\s\/]([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); } m = ua.match(/Version\/([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); // opera 10+ } if (/Opera Mobi/.test(ua)) { o.mobile = 'opera'; m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); } } m = ua.match(/Opera Mini[^;]*/); if (m) { o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit m = ua.match(/MSIE\s([^;]*)/); if (m && m[1]) { o.ie = numberify(m[1]); } else { // not opera, webkit, or ie m = ua.match(/Gecko\/([^\s]*)/); if (m) { o.gecko = 1; // Gecko detected, look for revision m = ua.match(/rv:([^\s\)]*)/); if (m && m[1]) { o.gecko = numberify(m[1]); } } } } } } //It was a parsed UA, do not assign the global value. if (!subUA) { if (typeof process == 'object') { if (process.versions && process.versions.node) { //NodeJS o.os = process.platform; o.nodejs = process.versions.node; } } YUI.Env.UA = o; } return o; }; Y.UA = YUI.Env.UA || YUI.Env.parseUA(); YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"], "app": ["app-base","model","model-list","router","view"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"], "base": ["base-base","base-pluginhost","base-build"], "button": ["button-base","button-group","cssbutton"], "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-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-scroll","datatable-datasource","datatable-sort"], "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-uievents","widget-skin"] }; }, '@VERSION@' ); YUI.add('get', function(Y) { /*jslint boss:true, expr:true, laxbreak: true */ /** Provides dynamic loading of remote JavaScript and CSS resources. @module get @class Get @static **/ var Lang = Y.Lang, Get, Transaction; Y.Get = Get = { // -- Public Properties ---------------------------------------------------- /** Default options for CSS requests. Options specified here will override global defaults for CSS requests. See the `options` property for all available options. @property cssOptions @type Object @static @since 3.5.0 **/ cssOptions: { attributes: { rel: 'stylesheet' }, doc : Y.config.linkDoc || Y.config.doc, pollInterval: 50 }, /** Default options for JS requests. Options specified here will override global defaults for JS requests. See the `options` property for all available options. @property jsOptions @type Object @static @since 3.5.0 **/ jsOptions: { autopurge: true, doc : Y.config.scriptDoc || Y.config.doc }, /** Default options to use for all requests. Note that while all available options are documented here for ease of discovery, some options (like callback functions) only make sense at the transaction level. Callback functions specified via the options object or the `options` parameter of the `css()`, `js()`, or `load()` methods will receive the transaction object as a parameter. See `Y.Get.Transaction` for details on the properties and methods available on transactions. @static @since 3.5.0 @property {Object} options @property {Boolean} [options.async=false] Whether or not to load scripts asynchronously, meaning they're requested in parallel and execution order is not guaranteed. Has no effect on CSS, since CSS is always loaded asynchronously. @property {Object} [options.attributes] HTML attribute name/value pairs that should be added to inserted nodes. By default, the `charset` attribute will be set to "utf-8" and nodes will be given an auto-generated `id` attribute, but you can override these with your own values if desired. @property {Boolean} [options.autopurge] Whether or not to automatically purge inserted nodes after the purge threshold is reached. This is `true` by default for JavaScript, but `false` for CSS since purging a CSS node will also remove any styling applied by the referenced file. @property {Object} [options.context] `this` object to use when calling callback functions. Defaults to the transaction object. @property {Mixed} [options.data] Arbitrary data object to pass to "on*" callbacks. @property {Document} [options.doc] Document into which nodes should be inserted. By default, the current document is used. @property {HTMLElement|String} [options.insertBefore] HTML element or id string of an element before which all generated nodes should be inserted. If not specified, Get will automatically determine the best place to insert nodes for maximum compatibility. @property {Function} [options.onEnd] Callback to execute after a transaction is complete, regardless of whether it succeeded or failed. @property {Function} [options.onFailure] Callback to execute after a transaction fails, times out, or is aborted. @property {Function} [options.onProgress] Callback to execute after each individual request in a transaction either succeeds or fails. @property {Function} [options.onSuccess] Callback to execute after a transaction completes successfully with no errors. Note that in browsers that don't support the `error` event on CSS `<link>` nodes, a failed CSS request may still be reported as a success because in these browsers it can be difficult or impossible to distinguish between success and failure for CSS resources. @property {Function} [options.onTimeout] Callback to execute after a transaction times out. @property {Number} [options.pollInterval=50] Polling interval (in milliseconds) for detecting CSS load completion in browsers that don't support the `load` event on `<link>` nodes. This isn't used for JavaScript. @property {Number} [options.purgethreshold=20] Number of nodes to insert before triggering an automatic purge when `autopurge` is `true`. @property {Number} [options.timeout] Number of milliseconds to wait before aborting a transaction. When a timeout occurs, the `onTimeout` callback is called, followed by `onFailure` and finally `onEnd`. By default, there is no timeout. @property {String} [options.type] Resource type ("css" or "js"). This option is set automatically by the `css()` and `js()` functions and will be ignored there, but may be useful when using the `load()` function. If not specified, the type will be inferred from the URL, defaulting to "js" if the URL doesn't contain a recognizable file extension. **/ options: { attributes: { charset: 'utf-8' }, purgethreshold: 20 }, // -- Protected Properties ------------------------------------------------- /** Regex that matches a CSS URL. Used to guess the file type when it's not specified. @property REGEX_CSS @type RegExp @final @protected @static @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i, /** Regex that matches a JS URL. Used to guess the file type when it's not specified. @property REGEX_JS @type RegExp @final @protected @static @since 3.5.0 **/ REGEX_JS : /\.js(?:[?;].*)?$/i, /** Contains information about the current environment, such as what script and link injection features it supports. This object is created and populated the first time the `_getEnv()` method is called. @property _env @type Object @protected @static @since 3.5.0 **/ /** Mapping of document _yuid strings to <head> or <base> node references so we don't have to look the node up each time we want to insert a request node. @property _insertCache @type Object @protected @static @since 3.5.0 **/ _insertCache: {}, /** Information about the currently pending transaction, if any. This is actually an object with two properties: `callback`, containing the optional callback passed to `css()`, `load()`, or `js()`; and `transaction`, containing the actual transaction instance. @property _pending @type Object @protected @static @since 3.5.0 **/ _pending: null, /** HTML nodes eligible to be purged next time autopurge is triggered. @property _purgeNodes @type HTMLElement[] @protected @static @since 3.5.0 **/ _purgeNodes: [], /** Queued transactions and associated callbacks. @property _queue @type Object[] @protected @static @since 3.5.0 **/ _queue: [], // -- Public Methods ------------------------------------------------------- /** Aborts the specified transaction. This will cause the transaction's `onFailure` callback to be called and will prevent any new script and link nodes from being added to the document, but any resources that have already been requested will continue loading (there's no safe way to prevent this, unfortunately). *Note:* This method is deprecated as of 3.5.0, and will be removed in a future version of YUI. Use the transaction-level `abort()` method instead. @method abort @param {Get.Transaction} transaction Transaction to abort. @deprecated Use the `abort()` method on the transaction instead. @static **/ abort: function (transaction) { var i, id, item, len, pending; if (!transaction.abort) { id = transaction; pending = this._pending; transaction = null; if (pending && pending.transaction.id === id) { transaction = pending.transaction; this._pending = null; } else { for (i = 0, len = this._queue.length; i < len; ++i) { item = this._queue[i].transaction; if (item.id === id) { transaction = item; this._queue.splice(i, 1); break; } } } } transaction && transaction.abort(); }, /** Loads one or more CSS files. The _urls_ parameter may be provided as a URL string, a request object, or an array of URL strings and/or request objects. A request object is just an object that contains a `url` property and zero or more options that should apply specifically to that request. Request-specific options take priority over transaction-level options and default options. URLs may be relative or absolute, and do not have to have the same origin as the current page. The `options` parameter may be omitted completely and a callback passed in its place, if desired. @example // Load a single CSS file and log a message on completion. Y.Get.css('foo.css', function (err) { if (err) { } else { } }); // Load multiple CSS files and log a message when all have finished // loading. var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css']; Y.Get.css(urls, function (err) { if (err) { } else { } }); // Specify transaction-level options, which will apply to all requests // within the transaction. Y.Get.css(urls, { attributes: {'class': 'my-css'}, timeout : 5000 }); // Specify per-request options, which override transaction-level and // default options. Y.Get.css([ {url: 'foo.css', attributes: {id: 'foo'}}, {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}} ]); @method css @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} callback.err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} callback.transaction Transaction object. @return {Get.Transaction} Transaction object. @static **/ css: function (urls, options, callback) { return this._load('css', urls, options, callback); }, /** Loads one or more JavaScript resources. The _urls_ parameter may be provided as a URL string, a request object, or an array of URL strings and/or request objects. A request object is just an object that contains a `url` property and zero or more options that should apply specifically to that request. Request-specific options take priority over transaction-level options and default options. URLs may be relative or absolute, and do not have to have the same origin as the current page. The `options` parameter may be omitted completely and a callback passed in its place, if desired. Scripts will be executed in the order they're specified unless the `async` option is `true`, in which case they'll be loaded in parallel and executed in whatever order they finish loading. @example // Load a single JS file and log a message on completion. Y.Get.js('foo.js', function (err) { if (err) { } else { } }); // Load multiple JS files, execute them in order, and log a message when // all have finished loading. var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js']; Y.Get.js(urls, function (err) { if (err) { } else { } }); // Specify transaction-level options, which will apply to all requests // within the transaction. Y.Get.js(urls, { attributes: {'class': 'my-js'}, timeout : 5000 }); // Specify per-request options, which override transaction-level and // default options. Y.Get.js([ {url: 'foo.js', attributes: {id: 'foo'}}, {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}} ]); @method js @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} callback.err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} callback.transaction Transaction object. @return {Get.Transaction} Transaction object. @since 3.5.0 @static **/ js: function (urls, options, callback) { return this._load('js', urls, options, callback); }, /** Loads one or more CSS and/or JavaScript resources in the same transaction. Use this method when you want to load both CSS and JavaScript in a single transaction and be notified when all requested URLs have finished loading, regardless of type. Behavior and options are the same as for the `css()` and `js()` methods. If a resource type isn't specified in per-request options or transaction-level options, Get will guess the file type based on the URL's extension (`.css` or `.js`, with or without a following query string). If the file type can't be guessed from the URL, a warning will be logged and Get will assume the URL is a JavaScript resource. @example // Load both CSS and JS files in a single transaction, and log a message // when all files have finished loading. Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) { if (err) { } else { } }); @method load @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} Transaction object. @return {Get.Transaction} Transaction object. @since 3.5.0 @static **/ load: function (urls, options, callback) { return this._load(null, urls, options, callback); }, // -- Protected Methods ---------------------------------------------------- /** Triggers an automatic purge if the purge threshold has been reached. @method _autoPurge @param {Number} threshold Purge threshold to use, in milliseconds. @protected @since 3.5.0 @static **/ _autoPurge: function (threshold) { if (threshold && this._purgeNodes.length >= threshold) { this._purge(this._purgeNodes); } }, /** Populates the `_env` property with information about the current environment. @method _getEnv @return {Object} Environment information. @protected @since 3.5.0 @static **/ _getEnv: function () { var doc = Y.config.doc, ua = Y.UA; // Note: some of these checks require browser sniffs since it's not // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = { // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes async: doc && doc.createElement('script').async === true, // True if this browser fires an event when a dynamically injected // link node finishes loading. This is currently true for IE, Opera, // and Firefox 9+. Note that IE versions <9 fire the DOM 0 "onload" // event, but not "load". All versions of IE fire "onload". cssLoad: !!(ua.gecko ? ua.gecko >= 9 : !ua.webkit), // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution. preservesScriptOrder: !!(ua.gecko || ua.opera) }); }, _getTransaction: function (urls, options) { var requests = [], i, len, req, url; if (!Lang.isArray(urls)) { urls = [urls]; } options = Y.merge(this.options, options); // Clone the attributes object so we don't end up modifying it by ref. options.attributes = Y.merge(this.options.attributes, options.attributes); for (i = 0, len = urls.length; i < len; ++i) { url = urls[i]; req = {attributes: {}}; // If `url` is a string, we create a URL object for it, then mix in // global options and request-specific options. If it's an object // with a "url" property, we assume it's a request object containing // URL-specific options. if (typeof url === 'string') { req.url = url; } else if (url.url) { // URL-specific options override both global defaults and // request-specific options. Y.mix(req, url, false, null, 0, true); url = url.url; // Make url a string so we can use it later. } else { continue; } Y.mix(req, options, false, null, 0, true); // If we didn't get an explicit type for this URL either in the // request options or the URL-specific options, try to determine // one from the file extension. if (!req.type) { if (this.REGEX_CSS.test(url)) { req.type = 'css'; } else { if (!this.REGEX_JS.test(url)) { } req.type = 'js'; } } // Mix in type-specific default options, but don't overwrite any // options that have already been set. Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions, false, null, 0, true); // Give the node an id attribute if it doesn't already have one. req.attributes.id || (req.attributes.id = Y.guid()); // Backcompat for <3.5.0 behavior. if (req.win) { req.doc = req.win.document; } else { req.win = req.doc.defaultView || req.doc.parentWindow; } if (req.charset) { req.attributes.charset = req.charset; } requests.push(req); } return new Transaction(requests, options); }, _load: function (type, urls, options, callback) { var transaction; // Allow callback as third param. if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); options.type = type; if (!this._env) { this._getEnv(); } transaction = this._getTransaction(urls, options); this._queue.push({ callback : callback, transaction: transaction }); this._next(); return transaction; }, _next: function () { var item; if (this._pending) { return; } item = this._queue.shift(); if (item) { this._pending = item; item.transaction.execute(function () { item.callback && item.callback.apply(this, arguments); Get._pending = null; Get._next(); }); } }, _purge: function (nodes) { var purgeNodes = this._purgeNodes, isTransaction = nodes !== purgeNodes, index, node; while (node = nodes.pop()) { // assignment // Don't purge nodes that haven't finished loading (or errored out), // since this can hang the transaction. if (!node._yuiget_finished) { continue; } node.parentNode && node.parentNode.removeChild(node); // If this is a transaction-level purge and this node also exists in // the Get-level _purgeNodes array, we need to remove it from // _purgeNodes to avoid creating a memory leak. The indexOf lookup // sucks, but until we get WeakMaps, this is the least troublesome // way to do this (we can't just hold onto node ids because they may // not be in the same document). if (isTransaction) { index = Y.Array.indexOf(purgeNodes, node); if (index > -1) { purgeNodes.splice(index, 1); } } } } }; /** Alias for `js()`. @method script @static **/ Get.script = Get.js; /** Represents a Get transaction, which may contain requests for one or more JS or CSS files. This class should not be instantiated manually. Instances will be created and returned as needed by Y.Get's `css()`, `js()`, and `load()` methods. @class Get.Transaction @constructor @since 3.5.0 **/ Get.Transaction = Transaction = function (requests, options) { var self = this; self.id = Transaction._lastId += 1; self.data = options.data; self.errors = []; self.nodes = []; self.options = options; self.requests = requests; self._callbacks = []; // callbacks to call after execution finishes self._queue = []; self._waiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead. self.win = options.win || Y.config.win; }; /** Arbitrary data object associated with this transaction. This object comes from the options passed to `Get.css()`, `Get.js()`, or `Get.load()`, and will be `undefined` if no data object was specified. @property {Object} data **/ /** Array of errors that have occurred during this transaction, if any. @since 3.5.0 @property {Object[]} errors @property {String} errors.error Error message. @property {Object} errors.request Request object related to the error. **/ /** Numeric id for this transaction, unique among all transactions within the same YUI sandbox in the current pageview. @property {Number} id @since 3.5.0 **/ /** HTMLElement nodes (native ones, not YUI Node instances) that have been inserted during the current transaction. @property {HTMLElement[]} nodes **/ /** Options associated with this transaction. See `Get.options` for the full list of available options. @property {Object} options @since 3.5.0 **/ /** Request objects contained in this transaction. Each request object represents one CSS or JS URL that will be (or has been) requested and loaded into the page. @property {Object} requests @since 3.5.0 **/ /** Id of the most recent transaction. @property _lastId @type Number @protected @static **/ Transaction._lastId = 0; Transaction.prototype = { // -- Public Properties ---------------------------------------------------- /** Current state of this transaction. One of "new", "executing", or "done". @property _state @type String @protected **/ _state: 'new', // "new", "executing", or "done" // -- Public Methods ------------------------------------------------------- /** Aborts this transaction. This will cause the transaction's `onFailure` callback to be called and will prevent any new script and link nodes from being added to the document, but any resources that have already been requested will continue loading (there's no safe way to prevent this, unfortunately). @method abort @param {String} [msg="Aborted."] Optional message to use in the `errors` array describing why the transaction was aborted. **/ abort: function (msg) { this._pending = null; this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = []; this._waiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish(); }, /** Begins execting the transaction. There's usually no reason to call this manually, since Get will call it automatically when other pending transactions have finished. If you really want to execute your transaction before Get does, you can, but be aware that this transaction's scripts may end up executing before the scripts in other pending transactions. If the transaction is already executing, the specified callback (if any) will be queued and called after execution finishes. If the transaction has already finished, the callback will be called immediately (the transaction will not be executed again). @method execute @param {Function} callback Callback function to execute after all requests in the transaction are complete, or after the transaction is aborted. **/ execute: function (callback) { var self = this, requests = self.requests, state = self._state, i, len, queue, req; if (state === 'done') { callback && callback(self.errors.length ? self.errors : null, self); return; } else { callback && self._callbacks.push(callback); if (state === 'executing') { return; } } self._state = 'executing'; self._queue = queue = []; if (self.options.timeout) { self._timeout = setTimeout(function () { self.abort('Timeout'); }, self.options.timeout); } for (i = 0, len = requests.length; i < len; ++i) { req = self.requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS. self._insert(req); } else { queue.push(req); } } self._next(); }, /** Manually purges any `<script>` or `<link>` nodes this transaction has created. Be careful when purging a transaction that contains CSS requests, since removing `<link>` nodes will also remove any styles they applied. @method purge **/ purge: function () { Get._purge(this.nodes); }, // -- Protected Methods ---------------------------------------------------- _createNode: function (name, attrs, doc) { var node = doc.createElement(name), attr; for (attr in attrs) { if (attrs.hasOwnProperty(attr)) { node.setAttribute(attr, attrs[attr]); } } return node; }, _finish: function () { var errors = this.errors.length ? this.errors : null, options = this.options, thisObj = options.context || this, data, i, len; if (this._state === 'done') { return; } this._state = 'done'; for (i = 0, len = this._callbacks.length; i < len; ++i) { this._callbacks[i].call(thisObj, errors, this); } data = this._getEventData(); if (errors) { if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') { options.onTimeout.call(thisObj, data); } if (options.onFailure) { options.onFailure.call(thisObj, data); } } else if (options.onSuccess) { options.onSuccess.call(thisObj, data); } if (options.onEnd) { options.onEnd.call(thisObj, data); } }, _getEventData: function (req) { if (req) { // This merge is necessary for backcompat. I hate it. return Y.merge(this, { abort : this.abort, // have to copy these because the prototype isn't preserved purge : this.purge, request: req, url : req.url, win : req.win }); } else { return this; } }, _getInsertBefore: function (req) { var doc = req.doc, el = req.insertBefore, cache, cachedNode, docStamp; if (el) { return typeof el === 'string' ? doc.getElementById(el) : el; } cache = Get._insertCache; docStamp = Y.stamp(doc); if ((el = cache[docStamp])) { // assignment return el; } // Inserting before a <base> tag apparently works around an IE bug // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what // bug that is, exactly. Better safe than sorry? if ((el = doc.getElementsByTagName('base')[0])) { // assignment return (cache[docStamp] = el); } // Look for a <head> element. el = doc.head || doc.getElementsByTagName('head')[0]; if (el) { // Create a marker node at the end of <head> to use as an insertion // point. Inserting before this node will ensure that all our CSS // gets inserted in the correct order, to maintain style precedence. el.appendChild(doc.createTextNode('')); return (cache[docStamp] = el.lastChild); } // If all else fails, just insert before the first script node on the // page, which is virtually guaranteed to exist. return (cache[docStamp] = doc.getElementsByTagName('script')[0]); }, _insert: function (req) { var env = Get._env, insertBefore = this._getInsertBefore(req), isScript = req.type === 'js', node = req.node, self = this, ua = Y.UA, nodeType; if (!node) { if (isScript) { nodeType = 'script'; } else if (!env.cssLoad && ua.gecko) { nodeType = 'style'; } else { nodeType = 'link'; } node = req.node = this._createNode(nodeType, req.attributes, req.doc); } function onError() { self._progress('Failed to load ' + req.url, req); } function onLoad() { self._progress(null, req); } // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url); if (req.async) { // Explicitly indicate that we want the browser to execute this // script asynchronously. This is necessary for older browsers // like Firefox <4. node.async = true; } else { if (env.async) { // This browser treats injected scripts as async by default // (standard HTML5 behavior) but asynchronous loading isn't // desired, so tell the browser not to mark this script as // async. node.async = false; } // If this browser doesn't preserve script execution order based // on insertion order, we'll need to avoid inserting other // scripts until this one finishes loading. if (!env.preservesScriptOrder) { this._pending = req; } } } else { if (!env.cssLoad && ua.gecko) { // In Firefox <9, we can import the requested URL into a <style> // node and poll for the existence of node.sheet.cssRules. This // gives us a reliable way to determine CSS load completion that // also works for cross-domain stylesheets. // // Props to Zach Leatherman for calling my attention to this // technique. node.innerHTML = (req.attributes.charset ? '@charset "' + req.attributes.charset + '";' : '') + '@import "' + req.url + '";'; } else { node.setAttribute('href', req.url); } } // Inject the node. if (isScript && ua.ie && ua.ie < 9) { // Script on IE6, 7, and 8. node.onreadystatechange = function () { if (/loaded|complete/.test(node.readyState)) { node.onreadystatechange = null; onLoad(); } }; } else if (!isScript && !env.cssLoad) { // CSS on Firefox <9 or WebKit. this._poll(req); } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs. node.onerror = onError; node.onload = onLoad; } this._waiting += 1; this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); }, _next: function () { if (this._pending) { return; } // If there are requests in the queue, insert the next queued request. // Otherwise, if we're waiting on already-inserted requests to finish, // wait longer. If there are no queued requests and we're not waiting // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift()); } else if (!this._waiting) { this._finish(); } }, _poll: function (newReq) { var self = this, pendingCSS = self._pendingCSS, isWebKit = Y.UA.webkit, i, hasRules, j, nodeHref, req, sheets; if (newReq) { pendingCSS || (pendingCSS = self._pendingCSS = []); pendingCSS.push(newReq); if (self._pollTimer) { // A poll timeout is already pending, so no need to create a // new one. return; } } self._pollTimer = null; // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s // will still be treated as a success. There's no good workaround for // this. for (i = 0; i < pendingCSS.length; ++i) { req = pendingCSS[i]; if (isWebKit) { // Look for a stylesheet matching the pending URL. sheets = req.doc.styleSheets; j = sheets.length; nodeHref = req.node.href; while (--j >= 0) { if (sheets[j].href === nodeHref) { pendingCSS.splice(i, 1); i -= 1; self._progress(null, req); break; } } } else { // Many thanks to Zach Leatherman for calling my attention to // the @import-based cross-domain technique used here, and to // Oleg Slobodskoi for an earlier same-domain implementation. // // See Zach's blog for more details: // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/ try { // We don't really need to store this value since we never // use it again, but if we don't store it, Closure Compiler // assumes the code is useless and removes it. hasRules = !!req.node.sheet.cssRules; // If we get here, the stylesheet has loaded. pendingCSS.splice(i, 1); i -= 1; self._progress(null, req); } catch (ex) { // An exception means the stylesheet is still loading. } } } if (pendingCSS.length) { self._pollTimer = setTimeout(function () { self._poll.call(self); }, self.options.pollInterval); } }, _progress: function (err, req) { var options = this.options; if (err) { req.error = err; this.errors.push({ error : err, request: req }); } req.node._yuiget_finished = req.finished = true; if (options.onProgress) { options.onProgress.call(options.context || this, this._getEventData(req)); } if (req.autopurge) { // Pre-3.5.0 Get always excludes the most recent node from an // autopurge. I find this odd, but I'm keeping that behavior for // the sake of backcompat. Get._autoPurge(this.options.purgethreshold); Get._purgeNodes.push(req.node); } if (this._pending === req) { this._pending = null; } this._waiting -= 1; this._next(); } }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('features', function(Y) { var feature_tests = {}; /** Contains the core of YUI's feature test architecture. @module features */ /** * Feature detection * @class Features * @static */ Y.mix(Y.namespace('Features'), { /** * Object hash of all registered feature tests * @property tests * @type Object */ tests: feature_tests, /** * Add a test to the system * * ``` * Y.Features.add("load", "1", {}); * ``` * * @method add * @param {String} cat The category, right now only 'load' is supported * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3 * @param {Object} o Object containing test properties * @param {String} o.name The name of the test * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance * @param {String} o.trigger The module that triggers this test. */ add: function(cat, name, o) { feature_tests[cat] = feature_tests[cat] || {}; feature_tests[cat][name] = o; }, /** * Execute all tests of a given category and return the serialized results * * ``` * caps=1:1;2:1;3:0 * ``` * @method all * @param {String} cat The category to execute * @param {Array} args The arguments to pass to the test function * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0 */ all: function(cat, args) { var cat_o = feature_tests[cat], // results = {}; result = []; if (cat_o) { Y.Object.each(cat_o, function(v, k) { result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0)); }); } return (result.length) ? result.join(';') : ''; }, /** * Run a sepecific test and return a Boolean response. * * ``` * Y.Features.test("load", "1"); * ``` * * @method test * @param {String} cat The category of the test to run * @param {String} name The name of the test to run * @param {Array} args The arguments to pass to the test function * @return {Boolean} True or false if the test passed/failed. */ test: function(cat, name, args) { args = args || []; var result, ua, test, cat_o = feature_tests[cat], feature = cat_o && cat_o[name]; if (!feature) { } else { result = feature.result; if (Y.Lang.isUndefined(result)) { ua = feature.ua; if (ua) { result = (Y.UA[ua]); } test = feature.test; if (test && ((!ua) || result)) { result = test.apply(Y, args); } feature.result = result; } } return result; } }); // Y.Features.add("load", "1", {}); // Y.Features.test("load", "1"); // caps=1:1;2:0;3:1; /* This file is auto-generated by src/loader/scripts/meta_join.py */ var add = Y.Features.add; // graphics-canvas-default add('load', '0', { "name": "graphics-canvas-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // autocomplete-list-keys add('load', '1', { "name": "autocomplete-list-keys", "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }); // graphics-svg add('load', '2', { "name": "graphics-svg", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // history-hash-ie add('load', '3', { "name": "history-hash-ie", "test": function (Y) { var docMode = Y.config.doc && Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); // graphics-vml-default add('load', '4', { "name": "graphics-vml-default", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // graphics-svg-default add('load', '5', { "name": "graphics-svg-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // widget-base-ie add('load', '6', { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" }); // transition-timer add('load', '7', { "name": "transition-timer", "test": function (Y) { var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; if (node && node.style) { ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style); } return ret; }, "trigger": "transition" }); // dom-style-ie add('load', '8', { "name": "dom-style-ie", "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }); // selector-css2 add('load', '9', { "name": "selector-css2", "test": function (Y) { var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); return ret; }, "trigger": "selector" }); // event-base-ie add('load', '10', { "name": "event-base-ie", "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // dd-gestures add('load', '11', { "name": "dd-gestures", "test": function(Y) { return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6)); }, "trigger": "dd-drag" }); // scrollview-base-ie add('load', '12', { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }); // graphics-canvas add('load', '13', { "name": "graphics-canvas", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-vml add('load', '14', { "name": "graphics-vml", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('intl-base', function(Y) { /** * The Intl utility provides a central location for managing sets of * localized resources (strings and formatting patterns). * * @class Intl * @uses EventTarget * @static */ var SPLIT_REGEX = /[, ]/; Y.mix(Y.namespace('Intl'), { /** * Returns the language among those available that * best matches the preferred language list, using the Lookup * algorithm of BCP 47. * If none of the available languages meets the user's preferences, * then "" is returned. * Extended language ranges are not supported. * * @method lookupBestLang * @param {String[] | String} preferredLanguages The list of preferred * languages in descending preference order, represented as BCP 47 * language tags. A string array or a comma-separated list. * @param {String[]} availableLanguages The list of languages * that the application supports, represented as BCP 47 language * tags. * * @return {String} The available language that best matches the * preferred language list, or "". * @since 3.1.0 */ lookupBestLang: function(preferredLanguages, availableLanguages) { var i, language, result, index; // check whether the list of available languages contains language; // if so return it function scan(language) { var i; for (i = 0; i < availableLanguages.length; i += 1) { if (language.toLowerCase() === availableLanguages[i].toLowerCase()) { return availableLanguages[i]; } } } if (Y.Lang.isString(preferredLanguages)) { preferredLanguages = preferredLanguages.split(SPLIT_REGEX); } for (i = 0; i < preferredLanguages.length; i += 1) { language = preferredLanguages[i]; if (!language || language === '*') { continue; } // check the fallback sequence for one language while (language.length > 0) { result = scan(language); if (result) { return result; } else { index = language.lastIndexOf('-'); if (index >= 0) { language = language.substring(0, index); // one-character subtags get cut along with the // following subtag if (index >= 2 && language.charAt(index - 2) === '-') { language = language.substring(0, index - 2); } } else { // nothing available for this language break; } } } } return ''; } }); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui-log', function(Y) { /** * Provides console log capability and exposes a custom event for * console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-log */ var INSTANCE = Y, LOGEVENT = 'yui:log', UNDEFINED = 'undefined', LEVELS = { debug: 1, info: 1, warn: 1, error: 1 }; /** * If the 'debug' config is true, a 'yui:log' event will be * dispatched, which the Console widget and anything else * can consume. If the 'useBrowserConsole' config is true, it will * write to the browser console if available. YUI-specific log * messages will only be present in the -debug versions of the * JS files. The build system is supposed to remove log statements * from the raw and minified versions of the files. * * @method log * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.log = function(msg, cat, src, silent) { var bail, excl, incl, m, f, Y = INSTANCE, c = Y.config, publisher = (Y.fire) ? Y : YUI.Env.globalEvents; // suppress log message if the config is off or the event stack // or the event call stack contains a consumer of the yui:log event if (c.debug) { // apply source filters if (src) { excl = c.logExclude; incl = c.logInclude; if (incl && !(src in incl)) { bail = 1; } else if (incl && (src in incl)) { bail = !incl[src]; } else if (excl && (src in excl)) { bail = excl[src]; } } if (!bail) { if (c.useBrowserConsole) { m = (src) ? src + ': ' + msg : msg; if (Y.Lang.isFunction(c.logFn)) { c.logFn.call(Y, msg, cat, src); } else if (typeof console != UNDEFINED && console.log) { f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log'; console[f](m); } else if (typeof opera != UNDEFINED) { opera.postError(m); } } if (publisher && !silent) { if (publisher == Y && (!publisher.getEvent(LOGEVENT))) { publisher.publish(LOGEVENT, { broadcast: 2 }); } publisher.fire(LOGEVENT, { msg: msg, cat: cat, src: src }); } } } return Y; }; /** * Write a system message. This message will be preserved in the * minified and raw versions of the YUI files, unlike log statements. * @method message * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.message = function() { return INSTANCE.log.apply(INSTANCE, arguments); }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui-later', function(Y) { /** * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-later */ var NO_ARGS = []; /** * Executes the supplied function in the context of the supplied * object 'when' milliseconds later. Executes the function a * single time unless periodic is set to true. * @for YUI * @method later * @param when {int} the number of milliseconds to wait until the fn * is executed. * @param o the context object. * @param fn {Function|String} the function to execute or the name of * the method in the 'o' object to execute. * @param data [Array] data that is provided to the function. This * accepts either a single item or an array. If an array is provided, * the function is executed with one parameter for each array item. * If you need to pass a single array parameter, it needs to be wrapped * in an array [myarray]. * * Note: native methods in IE may not have the call and apply methods. * In this case, it will work, but you are limited to four arguments. * * @param periodic {boolean} if true, executes continuously at supplied * interval until canceled. * @return {object} a timer object. Call the cancel() method on this * object to stop the timer. */ Y.later = function(when, o, fn, data, periodic) { when = when || 0; data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS; o = o || Y.config.win || Y; var cancelled = false, method = (o && Y.Lang.isString(fn)) ? o[fn] : fn, wrapper = function() { // IE 8- may execute a setInterval callback one last time // after clearInterval was called, so in order to preserve // the cancel() === no more runny-run, we have to jump through // an extra hoop. if (!cancelled) { if (!method.apply) { method(data[0], data[1], data[2], data[3]); } else { method.apply(o, data || NO_ARGS); } } }, id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when); return { id: id, interval: periodic, cancel: function() { cancelled = true; if (this.interval) { clearInterval(id); } else { clearTimeout(id); } } }; }; Y.Lang.later = Y.later; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui', function(Y){}, '@VERSION@' ,{use:['yui-base','get','features','intl-base','yui-log','yui-later']}); YUI.add('oop', function(Y) { /** Adds object inheritance and manipulation utilities to the YUI instance. This module is required by most YUI components. @module oop **/ var L = Y.Lang, A = Y.Array, OP = Object.prototype, CLONE_MARKER = '_~yuim~_', hasOwn = OP.hasOwnProperty, toString = OP.toString; function dispatch(o, f, c, proto, action) { if (o && o[action] && o !== Y) { return o[action].call(o, f, c); } else { switch (A.test(o)) { case 1: return A[action](o, f, c); case 2: return A[action](Y.Array(o, 0, true), f, c); default: return Y.Object[action](o, f, c, proto); } } } /** Augments the _receiver_ with prototype properties from the _supplier_. The receiver may be a constructor function or an object. The supplier must be a constructor function. If the _receiver_ is an object, then the _supplier_ constructor will be called immediately after _receiver_ is augmented, with _receiver_ as the `this` object. If the _receiver_ is a constructor function, then all prototype methods of _supplier_ that are copied to _receiver_ will be sequestered, and the _supplier_ constructor will not be called immediately. The first time any sequestered method is called on the _receiver_'s prototype, all sequestered methods will be immediately copied to the _receiver_'s prototype, the _supplier_'s constructor will be executed, and finally the newly unsequestered method that was called will be executed. This sequestering logic sounds like a bunch of complicated voodoo, but it makes it cheap to perform frequent augmentation by ensuring that suppliers' constructors are only called if a supplied method is actually used. If none of the supplied methods is ever used, then there's no need to take the performance hit of calling the _supplier_'s constructor. @method augment @param {Function|Object} receiver Object or function to be augmented. @param {Function} supplier Function that supplies the prototype properties with which to augment the _receiver_. @param {Boolean} [overwrite=false] If `true`, properties already on the receiver will be overwritten if found on the supplier's prototype. @param {String[]} [whitelist] An array of property names. If specified, only the whitelisted prototype properties will be applied to the receiver, and all others will be ignored. @param {Array|any} [args] Argument or array of arguments to pass to the supplier's constructor when initializing. @return {Function} Augmented object. @for YUI **/ Y.augment = function (receiver, supplier, overwrite, whitelist, args) { var rProto = receiver.prototype, sequester = rProto && supplier, sProto = supplier.prototype, to = rProto || receiver, copy, newPrototype, replacements, sequestered, unsequester; args = args ? Y.Array(args) : []; if (sequester) { newPrototype = {}; replacements = {}; sequestered = {}; copy = function (value, key) { if (overwrite || !(key in rProto)) { if (toString.call(value) === '[object Function]') { sequestered[key] = value; newPrototype[key] = replacements[key] = function () { return unsequester(this, value, arguments); }; } else { newPrototype[key] = value; } } }; unsequester = function (instance, fn, fnArgs) { // Unsequester all sequestered functions. for (var key in sequestered) { if (hasOwn.call(sequestered, key) && instance[key] === replacements[key]) { instance[key] = sequestered[key]; } } // Execute the supplier constructor. supplier.apply(instance, args); // Finally, execute the original sequestered function. return fn.apply(instance, fnArgs); }; if (whitelist) { Y.Array.each(whitelist, function (name) { if (name in sProto) { copy(sProto[name], name); } }); } else { Y.Object.each(sProto, copy, null, true); } } Y.mix(to, newPrototype || sProto, overwrite, whitelist); if (!sequester) { supplier.apply(to, args); } return receiver; }; /** * Copies object properties from the supplier to the receiver. If the target has * the property, and the property is an object, the target object will be * augmented with the supplier's value. * * @method aggregate * @param {Object} receiver Object to receive the augmentation. * @param {Object} supplier Object that supplies the properties with which to * augment the receiver. * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver * will be overwritten if found on the supplier. * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this * list will be applied to the receiver. * @return {Object} Augmented object. */ Y.aggregate = function(r, s, ov, wl) { return Y.mix(r, s, ov, wl, 0, true); }; /** * Utility to set up the prototype, constructor and superclass properties to * support an inheritance strategy that can chain constructors and methods. * Static members will not be inherited. * * @method extend * @param {function} r the object to modify. * @param {function} s the object to inherit. * @param {object} px prototype properties to add/override. * @param {object} sx static properties to add/override. * @return {object} the extended object. */ Y.extend = function(r, s, px, sx) { if (!s || !r) { Y.error('extend failed, verify dependencies'); } var sp = s.prototype, rp = Y.Object(sp); r.prototype = rp; rp.constructor = r; r.superclass = sp; // assign constructor property if (s != Object && sp.constructor == OP.constructor) { sp.constructor = s; } // add prototype overrides if (px) { Y.mix(rp, px, true); } // add object overrides if (sx) { Y.mix(r, sx, true); } return r; }; /** * Executes the supplied function for each item in * a collection. Supports arrays, objects, and * NodeLists * @method each * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {YUI} the YUI instance. */ Y.each = function(o, f, c, proto) { return dispatch(o, f, c, proto, 'each'); }; /** * Executes the supplied function for each item in * a collection. The operation stops if the function * returns true. Supports arrays, objects, and * NodeLists. * @method some * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {boolean} true if the function ever returns true, * false otherwise. */ Y.some = function(o, f, c, proto) { return dispatch(o, f, c, proto, 'some'); }; /** * Deep object/array copy. Function clones are actually * wrappers around the original function. * Array-like objects are treated as arrays. * Primitives are returned untouched. Optionally, a * function can be provided to handle other data types, * filter keys, validate values, etc. * * @method clone * @param {object} o what to clone. * @param {boolean} safe if true, objects will not have prototype * items from the source. If false, they will. In this case, the * original is initially protected, but the clone is not completely * immune from changes to the source object prototype. Also, cloned * prototype items that are deleted from the clone will result * in the value of the source prototype being exposed. If operating * on a non-safe clone, items should be nulled out rather than deleted. * @param {function} f optional function to apply to each item in a * collection; it will be executed prior to applying the value to * the new object. Return false to prevent the copy. * @param {object} c optional execution context for f. * @param {object} owner Owner object passed when clone is iterating * an object. Used to set up context for cloned functions. * @param {object} cloned hash of previously cloned objects to avoid * multiple clones. * @return {Array|Object} the cloned object. */ Y.clone = function(o, safe, f, c, owner, cloned) { if (!L.isObject(o)) { return o; } // @todo cloning YUI instances doesn't currently work if (Y.instanceOf(o, YUI)) { return o; } var o2, marked = cloned || {}, stamp, yeach = Y.each; switch (L.type(o)) { case 'date': return new Date(o); case 'regexp': // if we do this we need to set the flags too // return new RegExp(o.source); return o; case 'function': // o2 = Y.bind(o, owner); // break; return o; case 'array': o2 = []; break; default: // #2528250 only one clone of a given object should be created. if (o[CLONE_MARKER]) { return marked[o[CLONE_MARKER]]; } stamp = Y.guid(); o2 = (safe) ? {} : Y.Object(o); o[CLONE_MARKER] = stamp; marked[stamp] = o; } // #2528250 don't try to clone element properties if (!o.addEventListener && !o.attachEvent) { yeach(o, function(v, k) { if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) { if (k !== CLONE_MARKER) { if (k == 'prototype') { // skip the prototype // } else if (o[k] === o) { // this[k] = this; } else { this[k] = Y.clone(v, safe, f, c, owner || o, marked); } } } }, o2); } if (!cloned) { Y.Object.each(marked, function(v, k) { if (v[CLONE_MARKER]) { try { delete v[CLONE_MARKER]; } catch (e) { v[CLONE_MARKER] = null; } } }, this); marked = null; } return o2; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the beginning of the arguments collection the * supplied to the function. * * @method bind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to include before the arguments the * function is executed with. * @return {function} the wrapped function. */ Y.bind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? xargs.concat(Y.Array(arguments, 0, true)) : arguments; return fn.apply(c || fn, args); }; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the end of the arguments the function * is executed with. * * @method rbind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to append to the end of * arguments collection supplied to the function. * @return {function} the wrapped function. */ Y.rbind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? Y.Array(arguments, 0, true).concat(xargs) : arguments; return fn.apply(c || fn, args); }; }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('features', function(Y) { var feature_tests = {}; /** Contains the core of YUI's feature test architecture. @module features */ /** * Feature detection * @class Features * @static */ Y.mix(Y.namespace('Features'), { /** * Object hash of all registered feature tests * @property tests * @type Object */ tests: feature_tests, /** * Add a test to the system * * ``` * Y.Features.add("load", "1", {}); * ``` * * @method add * @param {String} cat The category, right now only 'load' is supported * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3 * @param {Object} o Object containing test properties * @param {String} o.name The name of the test * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance * @param {String} o.trigger The module that triggers this test. */ add: function(cat, name, o) { feature_tests[cat] = feature_tests[cat] || {}; feature_tests[cat][name] = o; }, /** * Execute all tests of a given category and return the serialized results * * ``` * caps=1:1;2:1;3:0 * ``` * @method all * @param {String} cat The category to execute * @param {Array} args The arguments to pass to the test function * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0 */ all: function(cat, args) { var cat_o = feature_tests[cat], // results = {}; result = []; if (cat_o) { Y.Object.each(cat_o, function(v, k) { result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0)); }); } return (result.length) ? result.join(';') : ''; }, /** * Run a sepecific test and return a Boolean response. * * ``` * Y.Features.test("load", "1"); * ``` * * @method test * @param {String} cat The category of the test to run * @param {String} name The name of the test to run * @param {Array} args The arguments to pass to the test function * @return {Boolean} True or false if the test passed/failed. */ test: function(cat, name, args) { args = args || []; var result, ua, test, cat_o = feature_tests[cat], feature = cat_o && cat_o[name]; if (!feature) { } else { result = feature.result; if (Y.Lang.isUndefined(result)) { ua = feature.ua; if (ua) { result = (Y.UA[ua]); } test = feature.test; if (test && ((!ua) || result)) { result = test.apply(Y, args); } feature.result = result; } } return result; } }); // Y.Features.add("load", "1", {}); // Y.Features.test("load", "1"); // caps=1:1;2:0;3:1; /* This file is auto-generated by src/loader/scripts/meta_join.py */ var add = Y.Features.add; // graphics-canvas-default add('load', '0', { "name": "graphics-canvas-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // autocomplete-list-keys add('load', '1', { "name": "autocomplete-list-keys", "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }); // graphics-svg add('load', '2', { "name": "graphics-svg", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // history-hash-ie add('load', '3', { "name": "history-hash-ie", "test": function (Y) { var docMode = Y.config.doc && Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); // graphics-vml-default add('load', '4', { "name": "graphics-vml-default", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // graphics-svg-default add('load', '5', { "name": "graphics-svg-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // widget-base-ie add('load', '6', { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" }); // transition-timer add('load', '7', { "name": "transition-timer", "test": function (Y) { var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; if (node && node.style) { ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style); } return ret; }, "trigger": "transition" }); // dom-style-ie add('load', '8', { "name": "dom-style-ie", "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }); // selector-css2 add('load', '9', { "name": "selector-css2", "test": function (Y) { var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); return ret; }, "trigger": "selector" }); // event-base-ie add('load', '10', { "name": "event-base-ie", "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // dd-gestures add('load', '11', { "name": "dd-gestures", "test": function(Y) { return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6)); }, "trigger": "dd-drag" }); // scrollview-base-ie add('load', '12', { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }); // graphics-canvas add('load', '13', { "name": "graphics-canvas", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-vml add('load', '14', { "name": "graphics-vml", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('dom-core', function(Y) { var NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', PARENT_WINDOW = 'parentWindow', TAG_NAME = 'tagName', PARENT_NODE = 'parentNode', PREVIOUS_SIBLING = 'previousSibling', NEXT_SIBLING = 'nextSibling', CONTAINS = 'contains', COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', EMPTY_ARRAY = [], /** * The DOM utility provides a cross-browser abtraction layer * normalizing DOM tasks, and adds extra helper functionality * for other common tasks. * @module dom * @main dom * @submodule dom-base * @for DOM * */ /** * Provides DOM helper methods. * @class DOM * */ Y_DOM = { /** * Returns the HTMLElement with the given ID (Wrapper for document.getElementById). * @method byId * @param {String} id the id attribute * @param {Object} doc optional The document to search. Defaults to current document * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. */ byId: function(id, doc) { // handle dupe IDs and IE name collision return Y_DOM.allById(id, doc)[0] || null; }, /* * Finds the ancestor of the element. * @method ancestor * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, the parentNode is returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {HTMLElement | null} The matching DOM node or null if none found. */ ancestor: function(element, fn, testSelf, stopFn) { var ret = null; if (testSelf) { ret = (!fn || fn(element)) ? element : null; } return ret || Y_DOM.elementByAxis(element, PARENT_NODE, fn, null, stopFn); }, /* * Finds the ancestors of the element. * @method ancestors * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, all ancestors are returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {Array} An array containing all matching DOM nodes. */ ancestors: function(element, fn, testSelf, stopFn) { var ancestor = element, ret = []; while ((ancestor = Y_DOM.ancestor(ancestor, fn, testSelf, stopFn))) { testSelf = false; if (ancestor) { ret.unshift(ancestor); if (stopFn && stopFn(ancestor)) { return ret; } } } return ret; }, /** * Searches the element by the given axis for the first matching element. * @method elementByAxis * @param {HTMLElement} element The html element. * @param {String} axis The axis to search (parentNode, nextSibling, previousSibling). * @param {Function} fn optional An optional boolean test to apply. * @param {Boolean} all optional Whether all node types should be returned, or just element nodes. * The optional function is passed the current HTMLElement being tested as its only argument. * If no function is given, the first element is returned. * @return {HTMLElement | null} The matching element or null if none found. */ elementByAxis: function(element, axis, fn, all, stopAt) { while (element && (element = element[axis])) { // NOTE: assignment if ( (all || element[TAG_NAME]) && (!fn || fn(element)) ) { return element; } if (stopAt && stopAt(element)) { return null; } } return null; }, /** * Determines whether or not one HTMLElement is or contains another HTMLElement. * @method contains * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ contains: function(element, needle) { var ret = false; if ( !needle || !element || !needle[NODE_TYPE] || !element[NODE_TYPE]) { ret = false; } else if (element[CONTAINS]) { if (Y.UA.opera || needle[NODE_TYPE] === 1) { // IE & SAF contains fail if needle not an ELEMENT_NODE ret = element[CONTAINS](needle); } else { ret = Y_DOM._bruteContains(element, needle); } } else if (element[COMPARE_DOCUMENT_POSITION]) { // gecko if (element === needle || !!(element[COMPARE_DOCUMENT_POSITION](needle) & 16)) { ret = true; } } return ret; }, /** * Determines whether or not the HTMLElement is part of the document. * @method inDoc * @param {HTMLElement} element The containing html element. * @param {HTMLElement} doc optional The document to check. * @return {Boolean} Whether or not the element is attached to the document. */ inDoc: function(element, doc) { var ret = false, rootNode; if (element && element.nodeType) { (doc) || (doc = element[OWNER_DOCUMENT]); rootNode = doc[DOCUMENT_ELEMENT]; // contains only works with HTML_ELEMENT if (rootNode && rootNode.contains && element.tagName) { ret = rootNode.contains(element); } else { ret = Y_DOM.contains(rootNode, element); } } return ret; }, allById: function(id, root) { root = root || Y.config.doc; var nodes = [], ret = [], i, node; if (root.querySelectorAll) { ret = root.querySelectorAll('[id="' + id + '"]'); } else if (root.all) { nodes = root.all(id); if (nodes) { // root.all may return HTMLElement or HTMLCollection. // some elements are also HTMLCollection (FORM, SELECT). if (nodes.nodeName) { if (nodes.id === id) { // avoid false positive on name ret.push(nodes); nodes = EMPTY_ARRAY; // done, no need to filter } else { // prep for filtering nodes = [nodes]; } } if (nodes.length) { // filter out matches on node.name // and element.id as reference to element with id === 'id' for (i = 0; node = nodes[i++];) { if (node.id === id || (node.attributes && node.attributes.id && node.attributes.id.value === id)) { ret.push(node); } } } } } else { ret = [Y_DOM._getDoc(root).getElementById(id)]; } return ret; }, isWindow: function(obj) { return !!(obj && obj.alert && obj.document); }, _removeChildNodes: function(node) { while (node.firstChild) { node.removeChild(node.firstChild); } }, siblings: function(node, fn) { var nodes = [], sibling = node; while ((sibling = sibling[PREVIOUS_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.unshift(sibling); } } sibling = node; while ((sibling = sibling[NEXT_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.push(sibling); } } return nodes; }, /** * Brute force version of contains. * Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc). * @method _bruteContains * @private * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ _bruteContains: function(element, needle) { while (needle) { if (element === needle) { return true; } needle = needle.parentNode; } return false; }, // TODO: move to Lang? /** * Memoizes dynamic regular expressions to boost runtime performance. * @method _getRegExp * @private * @param {String} str The string to convert to a regular expression. * @param {String} flags optional An optinal string of flags. * @return {RegExp} An instance of RegExp */ _getRegExp: function(str, flags) { flags = flags || ''; Y_DOM._regexCache = Y_DOM._regexCache || {}; if (!Y_DOM._regexCache[str + flags]) { Y_DOM._regexCache[str + flags] = new RegExp(str, flags); } return Y_DOM._regexCache[str + flags]; }, // TODO: make getDoc/Win true privates? /** * returns the appropriate document. * @method _getDoc * @private * @param {HTMLElement} element optional Target element. * @return {Object} The document for the given element or the default document. */ _getDoc: function(element) { var doc = Y.config.doc; if (element) { doc = (element[NODE_TYPE] === 9) ? element : // element === document element[OWNER_DOCUMENT] || // element === DOM node element.document || // element === window Y.config.doc; // default } return doc; }, /** * returns the appropriate window. * @method _getWin * @private * @param {HTMLElement} element optional Target element. * @return {Object} The window for the given element or the default window. */ _getWin: function(element) { var doc = Y_DOM._getDoc(element); return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win; }, _batch: function(nodes, fn, arg1, arg2, arg3, etc) { fn = (typeof fn === 'string') ? Y_DOM[fn] : fn; var result, i = 0, node, ret; if (fn && nodes) { while ((node = nodes[i++])) { result = result = fn.call(Y_DOM, node, arg1, arg2, arg3, etc); if (typeof result !== 'undefined') { (ret) || (ret = []); ret.push(result); } } } return (typeof ret !== 'undefined') ? ret : nodes; }, generateID: function(el) { var id = el.id; if (!id) { id = Y.stamp(el); el.id = id; } return id; } }; Y.DOM = Y_DOM; }, '@VERSION@' ,{requires:['oop','features']}); YUI.add('dom-base', function(Y) { var documentElement = Y.config.doc.documentElement, Y_DOM = Y.DOM, TAG_NAME = 'tagName', OWNER_DOCUMENT = 'ownerDocument', EMPTY_STRING = '', addFeature = Y.Features.add, testFeature = Y.Features.test; Y.mix(Y_DOM, { /** * Returns the text content of the HTMLElement. * @method getText * @param {HTMLElement} element The html element. * @return {String} The text content of the element (includes text of any descending elements). */ getText: (documentElement.textContent !== undefined) ? function(element) { var ret = ''; if (element) { ret = element.textContent; } return ret || ''; } : function(element) { var ret = ''; if (element) { ret = element.innerText || element.nodeValue; // might be a textNode } return ret || ''; }, /** * Sets the text content of the HTMLElement. * @method setText * @param {HTMLElement} element The html element. * @param {String} content The content to add. */ setText: (documentElement.textContent !== undefined) ? function(element, content) { if (element) { element.textContent = content; } } : function(element, content) { if ('innerText' in element) { element.innerText = content; } else if ('nodeValue' in element) { element.nodeValue = content; } }, CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8 'for': 'htmlFor', 'class': 'className' } : { // w3c 'htmlFor': 'for', 'className': 'class' }, /** * Provides a normalized attribute interface. * @method setAttribute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to set. * @param {String} val The value of the attribute. */ setAttribute: function(el, attr, val, ieAttr) { if (el && attr && el.setAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; el.setAttribute(attr, val, ieAttr); } }, /** * Provides a normalized attribute interface. * @method getAttibute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to get. * @return {String} The current value of the attribute. */ getAttribute: function(el, attr, ieAttr) { ieAttr = (ieAttr !== undefined) ? ieAttr : 2; var ret = ''; if (el && attr && el.getAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; ret = el.getAttribute(attr, ieAttr); if (ret === null) { ret = ''; // per DOM spec } } return ret; }, VALUE_SETTERS: {}, VALUE_GETTERS: {}, getValue: function(node) { var ret = '', // TODO: return null? getter; if (node && node[TAG_NAME]) { getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()]; if (getter) { ret = getter(node); } else { ret = node.value; } } // workaround for IE8 JSON stringify bug // which converts empty string values to null if (ret === EMPTY_STRING) { ret = EMPTY_STRING; // for real } return (typeof ret === 'string') ? ret : ''; }, setValue: function(node, val) { var setter; if (node && node[TAG_NAME]) { setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()]; if (setter) { setter(node, val); } else { node.value = val; } } }, creators: {} }); addFeature('value-set', 'select', { test: function() { var node = Y.config.doc.createElement('select'); node.innerHTML = '<option>1</option><option>2</option>'; node.value = '2'; return (node.value && node.value === '2'); } }); if (!testFeature('value-set', 'select')) { Y_DOM.VALUE_SETTERS.select = function(node, val) { for (var i = 0, options = node.getElementsByTagName('option'), option; option = options[i++];) { if (Y_DOM.getValue(option) === val) { option.selected = true; //Y_DOM.setAttribute(option, 'selected', 'selected'); break; } } } } Y.mix(Y_DOM.VALUE_GETTERS, { button: function(node) { return (node.attributes && node.attributes.value) ? node.attributes.value.value : ''; } }); Y.mix(Y_DOM.VALUE_SETTERS, { // IE: node.value changes the button text, which should be handled via innerHTML button: function(node, val) { var attr = node.attributes.value; if (!attr) { attr = node[OWNER_DOCUMENT].createAttribute('value'); node.setAttributeNode(attr); } attr.value = val; } }); Y.mix(Y_DOM.VALUE_GETTERS, { option: function(node) { var attrs = node.attributes; return (attrs.value && attrs.value.specified) ? node.value : node.text; }, select: function(node) { var val = node.value, options = node.options; if (options && options.length) { // TODO: implement multipe select if (node.multiple) { } else { val = Y_DOM.getValue(options[node.selectedIndex]); } } return val; } }); var addClass, hasClass, removeClass; Y.mix(Y.DOM, { /** * Determines whether a DOM element has the given className. * @method hasClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the given class. */ hasClass: function(node, className) { var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'); return re.test(node.className); }, /** * Adds a class name to a given DOM element. * @method addClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to add to the class attribute */ addClass: function(node, className) { if (!Y.DOM.hasClass(node, className)) { // skip if already present node.className = Y.Lang.trim([node.className, className].join(' ')); } }, /** * Removes a class name from a given element. * @method removeClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to remove from the class attribute */ removeClass: function(node, className) { if (className && hasClass(node, className)) { node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'), ' ')); if ( hasClass(node, className) ) { // in case of multiple adjacent removeClass(node, className); } } }, /** * Replace a class with another class for a given element. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name */ replaceClass: function(node, oldC, newC) { removeClass(node, oldC); // remove first in case oldC === newC addClass(node, newC); }, /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} className the class name to be toggled * @param {Boolean} addClass optional boolean to indicate whether class * should be added or removed regardless of current state */ toggleClass: function(node, className, force) { var add = (force !== undefined) ? force : !(hasClass(node, className)); if (add) { addClass(node, className); } else { removeClass(node, className); } } }); hasClass = Y.DOM.hasClass; removeClass = Y.DOM.removeClass; addClass = Y.DOM.addClass; var re_tag = /<([a-z]+)/i, Y_DOM = Y.DOM, addFeature = Y.Features.add, testFeature = Y.Features.test, creators = {}, createFromDIV = function(html, tag) { var div = Y.config.doc.createElement('div'), ret = true; div.innerHTML = html; if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) { ret = false; } return ret; }, re_tbody = /(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/, TABLE_OPEN = '<table>', TABLE_CLOSE = '</table>'; Y.mix(Y.DOM, { _fragClones: {}, _create: function(html, doc, tag) { tag = tag || 'div'; var frag = Y_DOM._fragClones[tag]; if (frag) { frag = frag.cloneNode(false); } else { frag = Y_DOM._fragClones[tag] = doc.createElement(tag); } frag.innerHTML = html; return frag; }, _children: function(node, tag) { var i = 0, children = node.children, childNodes, hasComments, child; if (children && children.tags) { // use tags filter when possible if (tag) { children = node.children.tags(tag); } else { // IE leaks comments into children hasComments = children.tags('!').length; } } if (!children || (!children.tags && tag) || hasComments) { childNodes = children || node.childNodes; children = []; while ((child = childNodes[i++])) { if (child.nodeType === 1) { if (!tag || tag === child.tagName) { children.push(child); } } } } return children || []; }, /** * Creates a new dom node using the provided markup string. * @method create * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {HTMLElement|DocumentFragment} returns a single HTMLElement * when creating one node, and a documentFragment when creating * multiple nodes. */ create: function(html, doc) { if (typeof html === 'string') { html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML } doc = doc || Y.config.doc; var m = re_tag.exec(html), create = Y_DOM._create, custom = creators, ret = null, creator, tag, nodes; if (html != undefined) { // not undefined or null if (m && m[1]) { creator = custom[m[1].toLowerCase()]; if (typeof creator === 'function') { create = creator; } else { tag = creator; } } nodes = create(html, doc, tag).childNodes; if (nodes.length === 1) { // return single node, breaking parentNode ref from "fragment" ret = nodes[0].parentNode.removeChild(nodes[0]); } else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected) if (nodes.length === 2) { ret = nodes[0].nextSibling; } else { nodes[0].parentNode.removeChild(nodes[0]); ret = Y_DOM._nl2frag(nodes, doc); } } else { // return multiple nodes as a fragment ret = Y_DOM._nl2frag(nodes, doc); } } return ret; }, _nl2frag: function(nodes, doc) { var ret = null, i, len; if (nodes && (nodes.push || nodes.item) && nodes[0]) { doc = doc || nodes[0].ownerDocument; ret = doc.createDocumentFragment(); if (nodes.item) { // convert live list to static array nodes = Y.Array(nodes, 0, true); } for (i = 0, len = nodes.length; i < len; i++) { ret.appendChild(nodes[i]); } } // else inline with log for minification return ret; }, /** * Inserts content in a node at the given location * @method addHTML * @param {HTMLElement} node The node to insert into * @param {HTMLElement | Array | HTMLCollection} content The content to be inserted * @param {HTMLElement} where Where to insert the content * If no "where" is given, content is appended to the node * Possible values for "where" * <dl> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> */ addHTML: function(node, content, where) { var nodeParent = node.parentNode, i = 0, item, ret = content, newNode; if (content != undefined) { // not null or undefined (maybe 0) if (content.nodeType) { // DOM node, just add it newNode = content; } else if (typeof content == 'string' || typeof content == 'number') { ret = newNode = Y_DOM.create(content); } else if (content[0] && content[0].nodeType) { // array or collection newNode = Y.config.doc.createDocumentFragment(); while ((item = content[i++])) { newNode.appendChild(item); // append to fragment for insertion } } } if (where) { if (newNode && where.parentNode) { // insert regardless of relationship to node where.parentNode.insertBefore(newNode, where); } else { switch (where) { case 'replace': while (node.firstChild) { node.removeChild(node.firstChild); } if (newNode) { // allow empty content to clear node node.appendChild(newNode); } break; case 'before': if (newNode) { nodeParent.insertBefore(newNode, node); } break; case 'after': if (newNode) { if (node.nextSibling) { // IE errors if refNode is null nodeParent.insertBefore(newNode, node.nextSibling); } else { nodeParent.appendChild(newNode); } } break; default: if (newNode) { node.appendChild(newNode); } } } } else if (newNode) { node.appendChild(newNode); } return ret; }, wrap: function(node, html) { var parent = (html && html.nodeType) ? html : Y.DOM.create(html), nodes = parent.getElementsByTagName('*'); if (nodes.length) { parent = nodes[nodes.length - 1]; } if (node.parentNode) { node.parentNode.replaceChild(parent, node); } parent.appendChild(node); }, unwrap: function(node) { var parent = node.parentNode, lastChild = parent.lastChild, next = node, grandparent; if (parent) { grandparent = parent.parentNode; if (grandparent) { node = parent.firstChild; while (node !== lastChild) { next = node.nextSibling; grandparent.insertBefore(node, parent); node = next; } grandparent.replaceChild(lastChild, parent); } else { parent.removeChild(node); } } } }); addFeature('innerhtml', 'table', { test: function() { var node = Y.config.doc.createElement('table'); try { node.innerHTML = '<tbody></tbody>'; } catch(e) { return false; } return (node.firstChild && node.firstChild.nodeName === 'TBODY'); } }); addFeature('innerhtml-div', 'tr', { test: function() { return createFromDIV('<tr></tr>', 'tr'); } }); addFeature('innerhtml-div', 'script', { test: function() { return createFromDIV('<script></script>', 'script'); } }); if (!testFeature('innerhtml', 'table')) { // TODO: thead/tfoot with nested tbody // IE adds TBODY when creating TABLE elements (which may share this impl) creators.tbody = function(html, doc) { var frag = Y_DOM.create(TABLE_OPEN + html + TABLE_CLOSE, doc), tb = Y.DOM._children(frag, 'tbody')[0]; if (frag.children.length > 1 && tb && !re_tbody.test(html)) { tb.parentNode.removeChild(tb); // strip extraneous tbody } return frag; }; } if (!testFeature('innerhtml-div', 'script')) { creators.script = function(html, doc) { var frag = doc.createElement('div'); frag.innerHTML = '-' + html; frag.removeChild(frag.firstChild); return frag; } creators.link = creators.style = creators.script; } if (!testFeature('innerhtml-div', 'tr')) { Y.mix(creators, { option: function(html, doc) { return Y_DOM.create('<select><option class="yui3-big-dummy" selected></option>' + html + '</select>', doc); }, tr: function(html, doc) { return Y_DOM.create('<tbody>' + html + '</tbody>', doc); }, td: function(html, doc) { return Y_DOM.create('<tr>' + html + '</tr>', doc); }, col: function(html, doc) { return Y_DOM.create('<colgroup>' + html + '</colgroup>', doc); }, tbody: 'table' }); Y.mix(creators, { legend: 'fieldset', th: creators.td, thead: creators.tbody, tfoot: creators.tbody, caption: creators.tbody, colgroup: creators.tbody, optgroup: creators.option }); } Y_DOM.creators = creators; Y.mix(Y.DOM, { /** * Sets the width of the element to the given size, regardless * of box model, border, padding, etc. * @method setWidth * @param {HTMLElement} element The DOM element. * @param {String|Int} size The pixel height to size to */ setWidth: function(node, size) { Y.DOM._setSize(node, 'width', size); }, /** * Sets the height of the element to the given size, regardless * of box model, border, padding, etc. * @method setHeight * @param {HTMLElement} element The DOM element. * @param {String|Int} size The pixel height to size to */ setHeight: function(node, size) { Y.DOM._setSize(node, 'height', size); }, _setSize: function(node, prop, val) { val = (val > 0) ? val : 0; var size = 0; node.style[prop] = val + 'px'; size = (prop === 'height') ? node.offsetHeight : node.offsetWidth; if (size > val) { val = val - (size - val); if (val < 0) { val = 0; } node.style[prop] = val + 'px'; } } }); }, '@VERSION@' ,{requires:['dom-core']}); YUI.add('dom-style', function(Y) { (function(Y) { /** * Add style management functionality to DOM. * @module dom * @submodule dom-style * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', OWNER_DOCUMENT = 'ownerDocument', STYLE = 'style', FLOAT = 'float', CSS_FLOAT = 'cssFloat', STYLE_FLOAT = 'styleFloat', TRANSPARENT = 'transparent', GET_COMPUTED_STYLE = 'getComputedStyle', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', WINDOW = Y.config.win, DOCUMENT = Y.config.doc, UNDEFINED = undefined, Y_DOM = Y.DOM, TRANSFORM = 'transform', VENDOR_TRANSFORM = [ 'WebkitTransform', 'MozTransform', 'OTransform' ], re_color = /color$/i, re_unit = /width|height|top|left|right|bottom|margin|padding/i; Y.Array.each(VENDOR_TRANSFORM, function(val) { if (val in DOCUMENT[DOCUMENT_ELEMENT].style) { TRANSFORM = val; } }); Y.mix(Y_DOM, { DEFAULT_UNIT: 'px', CUSTOM_STYLES: { }, /** * Sets a style property for a given element. * @method setStyle * @param {HTMLElement} An HTMLElement to apply the style to. * @param {String} att The style property to set. * @param {String|Number} val The value. */ setStyle: function(node, att, val, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES; if (style) { if (val === null || val === '') { // normalize unsetting val = ''; } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit val += Y_DOM.DEFAULT_UNIT; } if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].set) { CUSTOM_STYLES[att].set(node, val, style); return; // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } else if (att === '') { // unset inline styles att = 'cssText'; val = ''; } style[att] = val; } }, /** * Returns the current style value for the given property. * @method getStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. */ getStyle: function(node, att, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES, val = ''; if (style) { if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].get) { return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } val = style[att]; if (val === '') { // TODO: is empty string sufficient? val = Y_DOM[GET_COMPUTED_STYLE](node, att); } } return val; }, /** * Sets multiple style properties. * @method setStyles * @param {HTMLElement} node An HTMLElement to apply the styles to. * @param {Object} hash An object literal of property:value pairs. */ setStyles: function(node, hash) { var style = node.style; Y.each(hash, function(v, n) { Y_DOM.setStyle(node, n, v, style); }, Y_DOM); }, /** * Returns the computed style for the given node. * @method getComputedStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. * @return {String} The computed value of the style property. */ getComputedStyle: function(node, att) { var val = '', doc = node[OWNER_DOCUMENT], computed; if (node[STYLE] && doc[DEFAULT_VIEW] && doc[DEFAULT_VIEW][GET_COMPUTED_STYLE]) { computed = doc[DEFAULT_VIEW][GET_COMPUTED_STYLE](node, null); if (computed) { // FF may be null in some cases (ticket #2530548) val = computed[att]; } } return val; } }); // normalize reserved word float alternatives ("cssFloat" or "styleFloat") if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][CSS_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = CSS_FLOAT; } else if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][STYLE_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = STYLE_FLOAT; } // fix opera computedStyle default color unit (convert to rgb) if (Y.UA.opera) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (re_color.test(att)) { val = Y.Color.toRGB(val); } return val; }; } // safari converts transparent to rgba(), others use "transparent" if (Y.UA.webkit) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (val === 'rgba(0, 0, 0, 0)') { val = TRANSPARENT; } return val; }; } Y.DOM._getAttrOffset = function(node, attr) { var val = Y.DOM[GET_COMPUTED_STYLE](node, attr), offsetParent = node.offsetParent, position, parentOffset, offset; if (val === 'auto') { position = Y.DOM.getStyle(node, 'position'); if (position === 'static' || position === 'relative') { val = 0; } else if (offsetParent && offsetParent[GET_BOUNDING_CLIENT_RECT]) { parentOffset = offsetParent[GET_BOUNDING_CLIENT_RECT]()[attr]; offset = node[GET_BOUNDING_CLIENT_RECT]()[attr]; if (attr === 'left' || attr === 'top') { val = offset - parentOffset; } else { val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr]; } } } return val; }; Y.DOM._getOffset = function(node) { var pos, xy = null; if (node) { pos = Y_DOM.getStyle(node, 'position'); xy = [ parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'left'), 10), parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'top'), 10) ]; if ( isNaN(xy[0]) ) { // in case of 'auto' xy[0] = parseInt(Y_DOM.getStyle(node, 'left'), 10); // try inline if ( isNaN(xy[0]) ) { // default to offset value xy[0] = (pos === 'relative') ? 0 : node.offsetLeft || 0; } } if ( isNaN(xy[1]) ) { // in case of 'auto' xy[1] = parseInt(Y_DOM.getStyle(node, 'top'), 10); // try inline if ( isNaN(xy[1]) ) { // default to offset value xy[1] = (pos === 'relative') ? 0 : node.offsetTop || 0; } } } return xy; }; Y_DOM.CUSTOM_STYLES.transform = { set: function(node, val, style) { style[TRANSFORM] = val; }, get: function(node, style) { return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORM); } }; })(Y); (function(Y) { var PARSE_INT = parseInt, RE = RegExp; Y.Color = { KEYWORDS: { black: '000', silver: 'c0c0c0', gray: '808080', white: 'fff', maroon: '800000', red: 'f00', purple: '800080', fuchsia: 'f0f', green: '008000', lime: '0f0', olive: '808000', yellow: 'ff0', navy: '000080', blue: '00f', teal: '008080', aqua: '0ff' }, re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, re_hex3: /([0-9A-F])/gi, toRGB: function(val) { if (!Y.Color.re_RGB.test(val)) { val = Y.Color.toHex(val); } if(Y.Color.re_hex.exec(val)) { val = 'rgb(' + [ PARSE_INT(RE.$1, 16), PARSE_INT(RE.$2, 16), PARSE_INT(RE.$3, 16) ].join(', ') + ')'; } return val; }, toHex: function(val) { val = Y.Color.KEYWORDS[val] || val; if (Y.Color.re_RGB.exec(val)) { val = [ Number(RE.$1).toString(16), Number(RE.$2).toString(16), Number(RE.$3).toString(16) ]; for (var i = 0; i < val.length; i++) { if (val[i].length < 2) { val[i] = '0' + val[i]; } } val = val.join(''); } if (val.length < 6) { val = val.replace(Y.Color.re_hex3, '$1$1'); } if (val !== 'transparent' && val.indexOf('#') < 0) { val = '#' + val; } return val.toUpperCase(); } }; })(Y); }, '@VERSION@' ,{requires:['dom-base']}); YUI.add('dom-style-ie', function(Y) { (function(Y) { var HAS_LAYOUT = 'hasLayout', PX = 'px', FILTER = 'filter', FILTERS = 'filters', OPACITY = 'opacity', AUTO = 'auto', BORDER_WIDTH = 'borderWidth', BORDER_TOP_WIDTH = 'borderTopWidth', BORDER_RIGHT_WIDTH = 'borderRightWidth', BORDER_BOTTOM_WIDTH = 'borderBottomWidth', BORDER_LEFT_WIDTH = 'borderLeftWidth', WIDTH = 'width', HEIGHT = 'height', TRANSPARENT = 'transparent', VISIBLE = 'visible', GET_COMPUTED_STYLE = 'getComputedStyle', UNDEFINED = undefined, documentElement = Y.config.doc.documentElement, testFeature = Y.Features.test, addFeature = Y.Features.add, // TODO: unit-less lineHeight (e.g. 1.22) re_unit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i, isIE8 = (Y.UA.ie >= 8), _getStyleObj = function(node) { return node.currentStyle || node.style; }, ComputedStyle = { CUSTOM_STYLES: {}, get: function(el, property) { var value = '', current; if (el) { current = _getStyleObj(el)[property]; if (property === OPACITY && Y.DOM.CUSTOM_STYLES[OPACITY]) { value = Y.DOM.CUSTOM_STYLES[OPACITY].get(el); } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert value = current; } else if (Y.DOM.IE.COMPUTED[property]) { // use compute function value = Y.DOM.IE.COMPUTED[property](el, property); } else if (re_unit.test(current)) { // convert to pixel value = ComputedStyle.getPixel(el, property) + PX; } else { value = current; } } return value; }, sizeOffsets: { width: ['Left', 'Right'], height: ['Top', 'Bottom'], top: ['Top'], bottom: ['Bottom'] }, getOffset: function(el, prop) { var current = _getStyleObj(el)[prop], // value of "width", "top", etc. capped = prop.charAt(0).toUpperCase() + prop.substr(1), // "Width", "Top", etc. offset = 'offset' + capped, // "offsetWidth", "offsetTop", etc. pixel = 'pixel' + capped, // "pixelWidth", "pixelTop", etc. sizeOffsets = ComputedStyle.sizeOffsets[prop], mode = el.ownerDocument.compatMode, value = ''; // IE pixelWidth incorrect for percent // manually compute by subtracting padding and border from offset size // NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used // reverting to auto from auto causes position stacking issues (old impl) if (current === AUTO || current.indexOf('%') > -1) { value = el['offset' + capped]; if (mode !== 'BackCompat') { if (sizeOffsets[0]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[0]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[0] + 'Width', 1); } if (sizeOffsets[1]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[1]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[1] + 'Width', 1); } } } else { // use style.pixelWidth, etc. to convert to pixels // need to map style.width to currentStyle (no currentStyle.pixelWidth) if (!el.style[pixel] && !el.style[prop]) { el.style[prop] = current; } value = el.style[pixel]; } return value + PX; }, borderMap: { thin: (isIE8) ? '1px' : '2px', medium: (isIE8) ? '3px': '4px', thick: (isIE8) ? '5px' : '6px' }, getBorderWidth: function(el, property, omitUnit) { var unit = omitUnit ? '' : PX, current = el.currentStyle[property]; if (current.indexOf(PX) < 0) { // look up keywords if a border exists if (ComputedStyle.borderMap[current] && el.currentStyle.borderStyle !== 'none') { current = ComputedStyle.borderMap[current]; } else { // otherwise no border (default is "medium") current = 0; } } return (omitUnit) ? parseFloat(current) : current; }, getPixel: function(node, att) { // use pixelRight to convert to px var val = null, style = _getStyleObj(node), styleRight = style.right, current = style[att]; node.style.right = current; val = node.style.pixelRight; node.style.right = styleRight; // revert return val; }, getMargin: function(node, att) { var val, style = _getStyleObj(node); if (style[att] == AUTO) { val = 0; } else { val = ComputedStyle.getPixel(node, att); } return val + PX; }, getVisibility: function(node, att) { var current; while ( (current = node.currentStyle) && current[att] == 'inherit') { // NOTE: assignment in test node = node.parentNode; } return (current) ? current[att] : VISIBLE; }, getColor: function(node, att) { var current = _getStyleObj(node)[att]; if (!current || current === TRANSPARENT) { Y.DOM.elementByAxis(node, 'parentNode', null, function(parent) { current = _getStyleObj(parent)[att]; if (current && current !== TRANSPARENT) { node = parent; return true; } }); } return Y.Color.toRGB(current); }, getBorderColor: function(node, att) { var current = _getStyleObj(node), val = current[att] || current.color; return Y.Color.toRGB(Y.Color.toHex(val)); } }, //fontSize: getPixelFont, IEComputed = {}; addFeature('style', 'computedStyle', { test: function() { return 'getComputedStyle' in Y.config.win; } }); addFeature('style', 'opacity', { test: function() { return 'opacity' in documentElement.style; } }); addFeature('style', 'filter', { test: function() { return 'filters' in documentElement; } }); // use alpha filter for IE opacity if (!testFeature('style', 'opacity') && testFeature('style', 'filter')) { Y.DOM.CUSTOM_STYLES[OPACITY] = { get: function(node) { var val = 100; try { // will error if no DXImageTransform val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY]; } catch(e) { try { // make sure its in the document val = node[FILTERS]('alpha')[OPACITY]; } catch(err) { } } return val / 100; }, set: function(node, val, style) { var current, styleObj = _getStyleObj(node), currentFilter = styleObj[FILTER]; style = style || node.style; if (val === '') { // normalize inline style behavior current = (OPACITY in styleObj) ? styleObj[OPACITY] : 1; // revert to original opacity val = current; } if (typeof currentFilter == 'string') { // in case not appended style[FILTER] = currentFilter.replace(/alpha([^)]*\))/gi, '') + ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : ''); if (!style[FILTER]) { style.removeAttribute(FILTER); } if (!styleObj[HAS_LAYOUT]) { style.zoom = 1; // needs layout } } } }; } try { Y.config.doc.createElement('div').style.height = '-1px'; } catch(e) { // IE throws error on invalid style set; trap common cases Y.DOM.CUSTOM_STYLES.height = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.height = val; } else { } } }; Y.DOM.CUSTOM_STYLES.width = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.width = val; } else { } } }; } if (!testFeature('style', 'computedStyle')) { // TODO: top, right, bottom, left IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset; IEComputed.color = IEComputed.backgroundColor = ComputedStyle.getColor; IEComputed[BORDER_WIDTH] = IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] = IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] = ComputedStyle.getBorderWidth; IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom = IEComputed.marginLeft = ComputedStyle.getMargin; IEComputed.visibility = ComputedStyle.getVisibility; IEComputed.borderColor = IEComputed.borderTopColor = IEComputed.borderRightColor = IEComputed.borderBottomColor = IEComputed.borderLeftColor = ComputedStyle.getBorderColor; Y.DOM[GET_COMPUTED_STYLE] = ComputedStyle.get; Y.namespace('DOM.IE'); Y.DOM.IE.COMPUTED = IEComputed; Y.DOM.IE.ComputedStyle = ComputedStyle; } })(Y); }, '@VERSION@' ,{requires:['dom-style']}); YUI.add('dom-screen', function(Y) { (function(Y) { /** * Adds position and region management functionality to DOM. * @module dom * @submodule dom-screen * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', COMPAT_MODE = 'compatMode', POSITION = 'position', FIXED = 'fixed', RELATIVE = 'relative', LEFT = 'left', TOP = 'top', _BACK_COMPAT = 'BackCompat', MEDIUM = 'medium', BORDER_LEFT_WIDTH = 'borderLeftWidth', BORDER_TOP_WIDTH = 'borderTopWidth', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', GET_COMPUTED_STYLE = 'getComputedStyle', Y_DOM = Y.DOM, // TODO: how about thead/tbody/tfoot/tr? // TODO: does caption matter? RE_TABLE = /^t(?:able|d|h)$/i, SCROLL_NODE; if (Y.UA.ie) { if (Y.config.doc[COMPAT_MODE] !== 'BackCompat') { SCROLL_NODE = DOCUMENT_ELEMENT; } else { SCROLL_NODE = 'body'; } } Y.mix(Y_DOM, { /** * Returns the inner height of the viewport (exludes scrollbar). * @method winHeight * @return {Number} The current height of the viewport. */ winHeight: function(node) { var h = Y_DOM._getWinSize(node).height; return h; }, /** * Returns the inner width of the viewport (exludes scrollbar). * @method winWidth * @return {Number} The current width of the viewport. */ winWidth: function(node) { var w = Y_DOM._getWinSize(node).width; return w; }, /** * Document height * @method docHeight * @return {Number} The current height of the document. */ docHeight: function(node) { var h = Y_DOM._getDocSize(node).height; return Math.max(h, Y_DOM._getWinSize(node).height); }, /** * Document width * @method docWidth * @return {Number} The current width of the document. */ docWidth: function(node) { var w = Y_DOM._getDocSize(node).width; return Math.max(w, Y_DOM._getWinSize(node).width); }, /** * Amount page has been scroll horizontally * @method docScrollX * @return {Number} The current amount the screen is scrolled horizontally. */ docScrollX: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageXOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft, pageOffset); }, /** * Amount page has been scroll vertically * @method docScrollY * @return {Number} The current amount the screen is scrolled vertically. */ docScrollY: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageYOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop, pageOffset); }, /** * Gets the current position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getXY * @param element The target element * @return {Array} The XY position of the element TODO: test inDocument/display? */ getXY: function() { if (Y.config.doc[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) { return function(node) { var xy = null, scrollLeft, scrollTop, mode, box, offX, offY, doc, win, inDoc, rootNode; if (node && node.tagName) { doc = node.ownerDocument; mode = doc[COMPAT_MODE]; if (mode !== _BACK_COMPAT) { rootNode = doc[DOCUMENT_ELEMENT]; } else { rootNode = doc.body; } // inline inDoc check for perf if (rootNode.contains) { inDoc = rootNode.contains(node); } else { inDoc = Y.DOM.contains(rootNode, node); } if (inDoc) { win = doc.defaultView; // inline scroll calc for perf if (win && 'pageXOffset' in win) { scrollLeft = win.pageXOffset; scrollTop = win.pageYOffset; } else { scrollLeft = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollLeft : Y_DOM.docScrollX(node, doc); scrollTop = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollTop : Y_DOM.docScrollY(node, doc); } if (Y.UA.ie) { // IE < 8, quirks, or compatMode if (!doc.documentMode || doc.documentMode < 8 || mode === _BACK_COMPAT) { offX = rootNode.clientLeft; offY = rootNode.clientTop; } } box = node[GET_BOUNDING_CLIENT_RECT](); xy = [box.left, box.top]; if (offX || offY) { xy[0] -= offX; xy[1] -= offY; } if ((scrollTop || scrollLeft)) { if (!Y.UA.ios || (Y.UA.ios >= 4.2)) { xy[0] += scrollLeft; xy[1] += scrollTop; } } } else { xy = Y_DOM._getOffset(node); } } return xy; }; } else { return function(node) { // manually calculate by crawling up offsetParents //Calculate the Top and Left border sizes (assumes pixels) var xy = null, doc, parentNode, bCheck, scrollTop, scrollLeft; if (node) { if (Y_DOM.inDoc(node)) { xy = [node.offsetLeft, node.offsetTop]; doc = node.ownerDocument; parentNode = node; // TODO: refactor with !! or just falsey bCheck = ((Y.UA.gecko || Y.UA.webkit > 519) ? true : false); // TODO: worth refactoring for TOP/LEFT only? while ((parentNode = parentNode.offsetParent)) { xy[0] += parentNode.offsetLeft; xy[1] += parentNode.offsetTop; if (bCheck) { xy = Y_DOM._calcBorders(parentNode, xy); } } // account for any scrolled ancestors if (Y_DOM.getStyle(node, POSITION) != FIXED) { parentNode = node; while ((parentNode = parentNode.parentNode)) { scrollTop = parentNode.scrollTop; scrollLeft = parentNode.scrollLeft; //Firefox does something funky with borders when overflow is not visible. if (Y.UA.gecko && (Y_DOM.getStyle(parentNode, 'overflow') !== 'visible')) { xy = Y_DOM._calcBorders(parentNode, xy); } if (scrollTop || scrollLeft) { xy[0] -= scrollLeft; xy[1] -= scrollTop; } } xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } else { //Fix FIXED position -- add scrollbars xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } } else { xy = Y_DOM._getOffset(node); } } return xy; }; } }(),// NOTE: Executing for loadtime branching /** Gets the width of vertical scrollbars on overflowed containers in the body content. @method getScrollbarWidth @return {Number} Pixel width of a scrollbar in the current browser **/ getScrollbarWidth: Y.cached(function () { var doc = Y.config.doc, testNode = doc.createElement('div'), body = doc.getElementsByTagName('body')[0], // 0.1 because cached doesn't support falsy refetch values width = 0.1; if (body) { testNode.style.cssText = "position:absolute;visibility:hidden;overflow:scroll;width:20px;"; testNode.appendChild(doc.createElement('p')).style.height = '1px'; body.insertBefore(testNode, body.firstChild); width = testNode.offsetWidth - testNode.clientWidth; body.removeChild(testNode); } return width; }, null, 0.1), /** * Gets the current X position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getX * @param element The target element * @return {Int} The X position of the element */ getX: function(node) { return Y_DOM.getXY(node)[0]; }, /** * Gets the current Y position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getY * @param element The target element * @return {Int} The Y position of the element */ getY: function(node) { return Y_DOM.getXY(node)[1]; }, /** * Set the position of an html element in page coordinates. * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setXY * @param element The target element * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @param {Boolean} noRetry By default we try and set the position a second time if the first fails */ setXY: function(node, xy, noRetry) { var setStyle = Y_DOM.setStyle, pos, delta, newXY, currentXY; if (node && xy) { pos = Y_DOM.getStyle(node, POSITION); delta = Y_DOM._getOffset(node); if (pos == 'static') { // default to relative pos = RELATIVE; setStyle(node, POSITION, pos); } currentXY = Y_DOM.getXY(node); if (xy[0] !== null) { setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px'); } if (xy[1] !== null) { setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px'); } if (!noRetry) { newXY = Y_DOM.getXY(node); if (newXY[0] !== xy[0] || newXY[1] !== xy[1]) { Y_DOM.setXY(node, xy, true); } } } else { } }, /** * Set the X position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setX * @param element The target element * @param {Int} x The X values for new position (coordinates are page-based) */ setX: function(node, x) { return Y_DOM.setXY(node, [x, null]); }, /** * Set the Y position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setY * @param element The target element * @param {Int} y The Y values for new position (coordinates are page-based) */ setY: function(node, y) { return Y_DOM.setXY(node, [null, y]); }, /** * @method swapXY * @description Swap the xy position with another node * @param {Node} node The node to swap with * @param {Node} otherNode The other node to swap with * @return {Node} */ swapXY: function(node, otherNode) { var xy = Y_DOM.getXY(node); Y_DOM.setXY(node, Y_DOM.getXY(otherNode)); Y_DOM.setXY(otherNode, xy); }, _calcBorders: function(node, xy2) { var t = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0, l = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0; if (Y.UA.gecko) { if (RE_TABLE.test(node.tagName)) { t = 0; l = 0; } } xy2[0] += l; xy2[1] += t; return xy2; }, _getWinSize: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; var win = doc.defaultView || doc.parentWindow, mode = doc[COMPAT_MODE], h = win.innerHeight, w = win.innerWidth, root = doc[DOCUMENT_ELEMENT]; if ( mode && !Y.UA.opera ) { // IE, Gecko if (mode != 'CSS1Compat') { // Quirks root = doc.body; } h = root.clientHeight; w = root.clientWidth; } return { height: h, width: w }; }, _getDocSize: function(node) { var doc = (node) ? Y_DOM._getDoc(node) : Y.config.doc, root = doc[DOCUMENT_ELEMENT]; if (doc[COMPAT_MODE] != 'CSS1Compat') { root = doc.body; } return { height: root.scrollHeight, width: root.scrollWidth }; } }); })(Y); (function(Y) { var TOP = 'top', RIGHT = 'right', BOTTOM = 'bottom', LEFT = 'left', getOffsets = function(r1, r2) { var t = Math.max(r1[TOP], r2[TOP]), r = Math.min(r1[RIGHT], r2[RIGHT]), b = Math.min(r1[BOTTOM], r2[BOTTOM]), l = Math.max(r1[LEFT], r2[LEFT]), ret = {}; ret[TOP] = t; ret[RIGHT] = r; ret[BOTTOM] = b; ret[LEFT] = l; return ret; }, DOM = Y.DOM; Y.mix(DOM, { /** * Returns an Object literal containing the following about this element: (top, right, bottom, left) * @for DOM * @method region * @param {HTMLElement} element The DOM element. * @return {Object} Object literal containing the following about this element: (top, right, bottom, left) */ region: function(node) { var xy = DOM.getXY(node), ret = false; if (node && xy) { ret = DOM._getRegion( xy[1], // top xy[0] + node.offsetWidth, // right xy[1] + node.offsetHeight, // bottom xy[0] // left ); } return ret; }, /** * Find the intersect information for the passes nodes. * @method intersect * @for DOM * @param {HTMLElement} element The first element * @param {HTMLElement | Object} element2 The element or region to check the interect with * @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance i.e. DragDrop) * @return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion) */ intersect: function(node, node2, altRegion) { var r = altRegion || DOM.region(node), region = {}, n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } off = getOffsets(region, r); return { top: off[TOP], right: off[RIGHT], bottom: off[BOTTOM], left: off[LEFT], area: ((off[BOTTOM] - off[TOP]) * (off[RIGHT] - off[LEFT])), yoff: ((off[BOTTOM] - off[TOP])), xoff: (off[RIGHT] - off[LEFT]), inRegion: DOM.inRegion(node, node2, false, altRegion) }; }, /** * Check if any part of this node is in the passed region * @method inRegion * @for DOM * @param {Object} node2 The node to get the region from or an Object literal of the region * $param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop) * @return {Boolean} True if in region, false if not. */ inRegion: function(node, node2, all, altRegion) { var region = {}, r = altRegion || DOM.region(node), n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } if (all) { return ( r[LEFT] >= region[LEFT] && r[RIGHT] <= region[RIGHT] && r[TOP] >= region[TOP] && r[BOTTOM] <= region[BOTTOM] ); } else { off = getOffsets(region, r); if (off[BOTTOM] >= off[TOP] && off[RIGHT] >= off[LEFT]) { return true; } else { return false; } } }, /** * Check if any part of this element is in the viewport * @method inViewportRegion * @for DOM * @param {HTMLElement} element The DOM element. * @param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop) * @return {Boolean} True if in region, false if not. */ inViewportRegion: function(node, all, altRegion) { return DOM.inRegion(node, DOM.viewportRegion(node), all, altRegion); }, _getRegion: function(t, r, b, l) { var region = {}; region[TOP] = region[1] = t; region[LEFT] = region[0] = l; region[BOTTOM] = b; region[RIGHT] = r; region.width = region[RIGHT] - region[LEFT]; region.height = region[BOTTOM] - region[TOP]; return region; }, /** * Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left) * @method viewportRegion * @for DOM * @return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left) */ viewportRegion: function(node) { node = node || Y.config.doc.documentElement; var ret = false, scrollX, scrollY; if (node) { scrollX = DOM.docScrollX(node); scrollY = DOM.docScrollY(node); ret = DOM._getRegion(scrollY, // top DOM.winWidth(node) + scrollX, // right scrollY + DOM.winHeight(node), // bottom scrollX); // left } return ret; } }); })(Y); }, '@VERSION@' ,{requires:['dom-base', 'dom-style']}); YUI.add('selector-native', function(Y) { (function(Y) { /** * The selector-native module provides support for native querySelector * @module dom * @submodule selector-native * @for Selector */ /** * Provides support for using CSS selectors to query the DOM * @class Selector * @static * @for Selector */ Y.namespace('Selector'); // allow native module to standalone var COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', OWNER_DOCUMENT = 'ownerDocument'; var Selector = { useNative: true, _compare: ('sourceIndex' in Y.config.doc.documentElement) ? function(nodeA, nodeB) { var a = nodeA.sourceIndex, b = nodeB.sourceIndex; if (a === b) { return 0; } else if (a > b) { return 1; } return -1; } : (Y.config.doc.documentElement[COMPARE_DOCUMENT_POSITION] ? function(nodeA, nodeB) { if (nodeA[COMPARE_DOCUMENT_POSITION](nodeB) & 4) { return -1; } else { return 1; } } : function(nodeA, nodeB) { var rangeA, rangeB, compare; if (nodeA && nodeB) { rangeA = nodeA[OWNER_DOCUMENT].createRange(); rangeA.setStart(nodeA, 0); rangeB = nodeB[OWNER_DOCUMENT].createRange(); rangeB.setStart(nodeB, 0); compare = rangeA.compareBoundaryPoints(1, rangeB); // 1 === Range.START_TO_END } return compare; }), _sort: function(nodes) { if (nodes) { nodes = Y.Array(nodes, 0, true); if (nodes.sort) { nodes.sort(Selector._compare); } } return nodes; }, _deDupe: function(nodes) { var ret = [], i, node; for (i = 0; (node = nodes[i++]);) { if (!node._found) { ret[ret.length] = node; node._found = true; } } for (i = 0; (node = ret[i++]);) { node._found = null; node.removeAttribute('_found'); } return ret; }, /** * Retrieves a set of nodes based on a given CSS selector. * @method query * * @param {string} selector The CSS Selector to test the node against. * @param {HTMLElement} root optional An HTMLElement to start the query from. Defaults to Y.config.doc * @param {Boolean} firstOnly optional Whether or not to return only the first match. * @return {Array} An array of nodes that match the given selector. * @static */ query: function(selector, root, firstOnly, skipNative) { root = root || Y.config.doc; var ret = [], useNative = (Y.Selector.useNative && Y.config.doc.querySelector && !skipNative), queries = [[selector, root]], query, result, i, fn = (useNative) ? Y.Selector._nativeQuery : Y.Selector._bruteQuery; if (selector && fn) { // split group into seperate queries if (!skipNative && // already done if skipping (!useNative || root.tagName)) { // split native when element scoping is needed queries = Selector._splitQueries(selector, root); } for (i = 0; (query = queries[i++]);) { result = fn(query[0], query[1], firstOnly); if (!firstOnly) { // coerce DOM Collection to Array result = Y.Array(result, 0, true); } if (result) { ret = ret.concat(result); } } if (queries.length > 1) { // remove dupes and sort by doc order ret = Selector._sort(Selector._deDupe(ret)); } } return (firstOnly) ? (ret[0] || null) : ret; }, // allows element scoped queries to begin with combinator // e.g. query('> p', document.body) === query('body > p') _splitQueries: function(selector, node) { var groups = selector.split(','), queries = [], prefix = '', i, len; if (node) { // enforce for element scoping if (node.tagName) { node.id = node.id || Y.guid(); prefix = '[id="' + node.id + '"] '; } for (i = 0, len = groups.length; i < len; ++i) { selector = prefix + groups[i]; queries.push([selector, node]); } } return queries; }, _nativeQuery: function(selector, root, one) { if (Y.UA.webkit && selector.indexOf(':checked') > -1 && (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to pick up "selected" with "checked" return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query } try { return root['querySelector' + (one ? '' : 'All')](selector); } catch(e) { // fallback to brute if available return Y.Selector.query(selector, root, one, true); // redo with skipNative true } }, filter: function(nodes, selector) { var ret = [], i, node; if (nodes && selector) { for (i = 0; (node = nodes[i++]);) { if (Y.Selector.test(node, selector)) { ret[ret.length] = node; } } } else { } return ret; }, test: function(node, selector, root) { var ret = false, useFrag = false, groups, parent, item, items, frag, i, j, group; if (node && node.tagName) { // only test HTMLElements if (typeof selector == 'function') { // test with function ret = selector.call(node, node); } else { // test with query // we need a root if off-doc groups = selector.split(','); if (!root && !Y.DOM.inDoc(node)) { parent = node.parentNode; if (parent) { root = parent; } else { // only use frag when no parent to query frag = node[OWNER_DOCUMENT].createDocumentFragment(); frag.appendChild(node); root = frag; useFrag = true; } } root = root || node[OWNER_DOCUMENT]; if (!node.id) { node.id = Y.guid(); } for (i = 0; (group = groups[i++]);) { // TODO: off-dom test group += '[id="' + node.id + '"]'; items = Y.Selector.query(group, root); for (j = 0; item = items[j++];) { if (item === node) { ret = true; break; } } if (ret) { break; } } if (useFrag) { // cleanup frag.removeChild(node); } }; } return ret; }, /** * A convenience function to emulate Y.Node's aNode.ancestor(selector). * @param {HTMLElement} element An HTMLElement to start the query from. * @param {String} selector The CSS selector to test the node against. * @return {HTMLElement} The ancestor node matching the selector, or null. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @static * @method ancestor */ ancestor: function (element, selector, testSelf) { return Y.DOM.ancestor(element, function(n) { return Y.Selector.test(n, selector); }, testSelf); } }; Y.mix(Y.Selector, Selector, true); })(Y); }, '@VERSION@' ,{requires:['dom-base']}); YUI.add('selector', function(Y) { }, '@VERSION@' ,{requires:['selector-native']}); YUI.add('event-custom-base', function(Y) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static */ objs: {}, /** * <p>Execute the supplied method before the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt> * <dd>Replace the arguments that the original function will be * called with.</dd> * <dt></code>Y.Do.Prevent(message)</code></dt> * <dd>Don't execute the wrapped function. Other before phase * wrappers will be executed.</dd> * </dl> * * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * <p>Execute the supplied method after the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt> * <dd>Return <code>returnValue</code> instead of the wrapped * method's original return value. This can be further altered by * other after phase wrappers.</dd> * </dl> * * <p>The static properties <code>Y.Do.originalRetVal</code> and * <code>Y.Do.currentRetVal</code> will be populated for reference.</p> * * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method before or after the specified function. * Used by <code>before</code> and <code>after</code>. * * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (! this.objs[id]) { // create a map entry for the obj if it doesn't exist this.objs[id] = {}; } o = this.objs[id]; if (! o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription. * * @method detach * @param handle {string} the subscription handle * @static */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property originalRetVal * @static * @since 3.2.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property currentRetVal * @static * @since 3.2.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { delete this.before[sid]; delete this.after[sid]; }; /** * <p>Execute the wrapped method. All arguments are passed into the wrapping * functions. If any of the before wrappers return an instance of * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped * function nor any after phase subscribers will be executed.</p> * * <p>The return value will be the return value of the wrapped function or one * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or * <code>Y.Do.AlterReturn</code>. * * @method exec * @param arg* {any} Arguments are passed to the wrapping and wrapped functions * @return {any} Return value of wrapped function unless overwritten (see above) */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. Useful for Do.before subscribers. An * example would be a service that scrubs out illegal characters prior to * executing the core business logic. * @class Do.AlterArgs * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newArgs {Array} Call parameters to be used for the original method * instead of the arguments originally passed in. */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller. Useful for Do.after subscribers. * @class Do.AlterReturn * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newRetVal {any} Return value passed to code that invoked the wrapped * function. */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. Useful for Do.before subscribers. * @class Do.Halt * @constructor * @param msg {String} (optional) Explanation of why the termination was done * @param retVal {any} Return value passed to code that invoked the wrapped * function. */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute. Useful * for Do.before subscribers. * @class Do.Prevent * @constructor * @param msg {String} (optional) Explanation of why the termination was done */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param retVal {any} Return value passed to code that invoked the wrapped * function. * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log'; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} o configuration object. * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { // if (arguments.length > 2) { // this.log('CustomEvent context and silent are now in the config', 'warn', 'Event'); // } o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber {} */ this.subscribers = {}; /** * 'After' subscribers * @property afters * @type Subscriber {} */ this.afters = {}; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ //this.async = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; this.subCount = 0; this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; Y.CustomEvent.prototype = { constructor: Y.CustomEvent, /** * Returns the number of subscribers for this event as the sum of the on() * subscribers and after() subscribers. * * @method hasSubs * @return Number */ hasSubs: function(when) { var s = this.subCount, a = this.afterCount, sib = this.sibling; if (sib) { s += sib.subCount; a += sib.afterCount; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = Y.Array(arguments, 0, true); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var s = Y.merge(this.subscribers), a = Y.merge(this.afters), sib = this.sibling; if (sib) { Y.mix(s, sib.subscribers); Y.mix(a, sib.afters); } return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { if (o) { Y.mix(this, o, force, CONFIGS); } }, /** * Create the Subscription for subscribing function, context, and bound * arguments. If this is a fireOnce event, the subscriber is immediately * notified. * * @method _on * @param fn {Function} Subscription callback * @param [context] {Object} Override `this` in the callback * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire() * @param [when] {String} "after" to slot into after subscribers * @return {EventHandle} * @protected */ _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { if (this.async) { setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } else { this._notify(s, this.firedWith); } } if (when == AFTER) { this.afters[s.id] = s; this.afterCount++; } else { this.subscribers[s.id] = s; this.subCount++; } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; if (this.host) { this.host._monitor('attach', this.type, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = Y.merge(this.subscribers, this.afters); for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @protected */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = Y.Array(arguments, 0, true); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; this.firedWith = args; if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, /** * Set up for notifying subscribers of non-emitFacade events. * * @method fireSimple * @param args {Array} Arguments passed to fire() * @return Boolean false if a subscriber returned false * @protected */ fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { // this._procSubs(Y.merge(this.subscribers, this.afters), args); var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { args[0] = args[0] || {}; return this.fireSimple(args); }, /** * Notifies a list of subscribers. * * @method _procSubs * @param subs {Array} List of subscribers * @param args {Array} Arguments passed to fire() * @param ef {} * @return Boolean false if a subscriber returns false or stops the event * propagation via e.stopPropagation(), * e.stopImmediatePropagation(), or e.halt() * @private */ _procSubs: function(subs, args, ef) { var s, i; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } } return true; }, /** * Notifies the YUI instance if the event is configured with broadcast = 1, * and both the YUI instance and Y.Global if configured with broadcast = 2. * * @method _broadcast * @param args {Array} Arguments sent to fire() * @private */ _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = Y.Array(args); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * Deletes the subscriber from the internal store of on() and after() * subscribers. * * @method _delete * @param subscriber object. * @private */ _delete: function(s) { if (s) { if (this.subscribers[s.id]) { delete this.subscribers[s.id]; this.subCount--; } if (this.afters[s.id]) { delete this.afters[s.id]; this.afterCount--; } } if (this.host) { this.host._monitor('detach', this.type, { ce: this, sub: s }); } if (s) { // delete s.fn; // delete s.context; s.deleted = true; } } }; /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { constructor: Y.Subscriber, _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } } }; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * * @property evt * @type CustomEvent */ this.evt = evt; /** * The subscriber object * * @property sub * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {int} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {String} the prefix to apply to non-prefixed event names */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', YArray = Y.Array, _wildType = Y.cached(function(type) { return type.replace(/(.*)(:)(.*)/, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || !L.isString(type) || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaultTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { constructor: ET, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>after</code> except the * listener is immediatelly detached when it is executed. * @method onceAfter * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ onceAfter: function() { var handle = this.after.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {String} type the type * @param {String} [pre=this._yuievt.config.prefix] the prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe a callback function to a custom event fired by this object or * from an object that bubbles its events to this object. * * Callback functions for events published with `emitFacade = true` will * receive an `EventFacade` as the first argument (typically named "e"). * These callbacks can then call `e.preventDefault()` to disable the * behavior published to that event's `defaultFn`. See the `EventFacade` * API for all available properties and methods. Subscribers to * non-`emitFacade` events will receive the arguments passed to `fire()` * after the event name. * * To subscribe to multiple events at once, pass an object as the first * argument, where the key:value pairs correspond to the eventName:callback, * or pass an array of event names as the first argument to subscribe to * all listed events with the same callback. * * Returning `false` from a callback is supported as an alternative to * calling `e.preventDefault(); e.stopPropagation();`. However, it is * recommended to use the event methods whenever possible. * * @method on * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ on: function(type, fn, context) { var parts = _parseType(type, this._yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = YArray(arguments, 0, true); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (this._yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = YArray(arguments, 0, true); args.splice(2, 0, Node.getDOMNode(this)); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = YArray(arguments, 0, true); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = this._yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? YArray(arguments, 3, true) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (this._yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = YArray(arguments, 0, true); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = YArray(arguments, 0, true); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {String} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {String} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {String} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, defaults, edata = this._yuievt, pre = edata.config.prefix; if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } type = (pre) ? _getType(type, pre) : type; this._monitor('publish', type, { args: arguments }); events = edata.events; ce = events[type]; if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { defaults = edata.defaults; // apply defaults ce = new Y.CustomEvent(type, (opts) ? Y.merge(defaults, opts) : defaults); events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @method _monitor * @param what {String} 'attach', 'detach', 'fire', or 'publish' * @param type {String} Name of the event being monitored * @param o {Object} Information about the event interaction, such as * fire() args, subscription category, publish config * @private */ _monitor: function(what, type, o) { var monitorevt, ce = this.getEvent(type); if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host * */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), ce, ret, pre = this._yuievt.config.prefix, ce2, args = (typeIncluded) ? YArray(arguments, 1, true) : arguments; t = (pre) ? _getType(t, pre) : t; this._monitor('fire', t, { args: args }); ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } // this event has not been published or subscribed to if (!ce) { if (this._yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (this._yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {String} the type, or name of the event * @param prefixed {String} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * * @method after * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ after: function(type, fn) { var a = YArray(arguments, 0, true); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype); ET.call(Y, { bubbles: false }); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** `Y.on()` can do many things: <ul> <li>Subscribe to custom events `publish`ed and `fire`d from Y</li> <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and `fire`d from any object in the YUI instance sandbox</li> <li>Subscribe to DOM events</li> <li>Subscribe to the execution of a method on any object, effectively treating that method as an event</li> </ul> For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument. Y.on('io:complete', function () { Y.MyApp.updateStatus('Transaction complete'); }); To subscribe to DOM events, pass the name of a DOM event as the first argument and a CSS selector string as the third argument after the callback function. Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`, array, or simply omitted (the default is the `window` object). Y.on('click', function (e) { e.preventDefault(); // proceed with ajax form submission var url = this.get('action'); ... }, '#my-form'); The `this` object in DOM event callbacks will be the `Node` targeted by the CSS selector or other identifier. `on()` subscribers for DOM events or custom events `publish`ed with a `defaultFn` can prevent the default behavior with `e.preventDefault()` from the event object passed as the first parameter to the subscription callback. To subscribe to the execution of an object method, pass arguments corresponding to the call signature for <a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>. NOTE: The formal parameter list below is for events, not for function injection. See `Y.Do.before` for that signature. @method on @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @see Do.before @for YUI **/ /** Listen for an event one time. Equivalent to `on()`, except that the listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see on @method once @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Listen for an event one time. Equivalent to `once()`, except, like `after()`, the subscription callback executes after all `on()` subscribers and the event's `defaultFn` (if configured) have executed. Like `after()` if any `on()` phase subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()` subscribers will execute. The listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see once @method onceAfter @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Like `on()`, this method creates a subscription to a custom event or to the execution of a method on an object. For events, `after()` subscribers are executed after the event's `defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber. See the <a href="#methods_on">`on()` method</a> for additional subscription options. NOTE: The subscription signature shown is for events, not for function injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a> for that signature. @see on @see Do.after @method after @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [args*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ }, '@VERSION@' ,{requires:['oop']}); YUI.add('event-custom-complex', function(Y) { /** * Adds event facades, preventable default behavior, and bubbling. * events. * @module event-custom * @submodule event-custom-complex */ var FACADE, FACADE_KEYS, EMPTY = {}, CEProto = Y.CustomEvent.prototype, ETProto = Y.EventTarget.prototype; /** * Wraps and protects a custom event for use when emitFacade is set to true. * Requires the event-custom-complex module * @class EventFacade * @param e {Event} the custom event * @param currentTarget {HTMLElement} the element the listener was attached to */ Y.EventFacade = function(e, currentTarget) { e = e || EMPTY; this._event = e; /** * The arguments passed to fire * @property details * @type Array */ this.details = e.details; /** * The event type, this can be overridden by the fire() payload * @property type * @type string */ this.type = e.type; /** * The real event type * @property _type * @type string * @private */ this._type = e.type; ////////////////////////////////////////////////////// /** * Node reference for the targeted eventtarget * @property target * @type Node */ this.target = e.target; /** * Node reference for the element that the listener was attached to. * @property currentTarget * @type Node */ this.currentTarget = currentTarget; /** * Node reference to the relatedTarget * @property relatedTarget * @type Node */ this.relatedTarget = e.relatedTarget; }; Y.extend(Y.EventFacade, Object, { /** * Stops the propagation to the next bubble target * @method stopPropagation */ stopPropagation: function() { this._event.stopPropagation(); this.stopped = 1; }, /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ stopImmediatePropagation: function() { this._event.stopImmediatePropagation(); this.stopped = 2; }, /** * Prevents the event's default behavior * @method preventDefault */ preventDefault: function() { this._event.preventDefault(); this.prevented = 1; }, /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ halt: function(immediate) { this._event.halt(immediate); this.prevented = 1; this.stopped = (immediate) ? 2 : 1; } }); CEProto.fireComplex = function(args) { var es, ef, q, queue, ce, ret, events, subs, postponed, self = this, host = self.host || self, next, oldbubble; if (self.stack) { // queue this event if the current item in the queue bubbles if (self.queuable && self.type != self.stack.next.type) { self.log('queue ' + self.type); self.stack.queue.push([self, args]); return true; } } es = self.stack || { // id of the first event in the stack id: self.id, next: self, silent: self.silent, stopped: 0, prevented: 0, bubbling: null, type: self.type, // defaultFnQueue: new Y.Queue(), afterQueue: new Y.Queue(), defaultTargetOnly: self.defaultTargetOnly, queue: [] }; subs = self.getSubs(); self.stopped = (self.type !== es.type) ? 0 : es.stopped; self.prevented = (self.type !== es.type) ? 0 : es.prevented; self.target = self.target || host; events = new Y.EventTarget({ fireOnce: true, context: host }); self.events = events; if (self.stoppedFn) { events.on('stopped', self.stoppedFn); } self.currentTarget = host; self.details = args.slice(); // original arguments in the details // self.log("Firing " + self + ", " + "args: " + args); self.log("Firing " + self.type); self._facade = null; // kill facade to eliminate stale properties ef = self._getFacade(args); if (Y.Lang.isObject(args[0])) { args[0] = ef; } else { args.unshift(ef); } // if (subCount) { if (subs[0]) { // self._procSubs(Y.merge(self.subscribers), args, ef); self._procSubs(subs[0], args, ef); } // bubble if this is hosted in an event target and propagation has not been stopped if (self.bubbles && host.bubble && !self.stopped) { oldbubble = es.bubbling; // self.bubbling = true; es.bubbling = self.type; // if (host !== ef.target || es.type != self.type) { if (es.type != self.type) { es.stopped = 0; es.prevented = 0; } ret = host.bubble(self, args, null, es); self.stopped = Math.max(self.stopped, es.stopped); self.prevented = Math.max(self.prevented, es.prevented); // self.bubbling = false; es.bubbling = oldbubble; } if (self.prevented) { if (self.preventedFn) { self.preventedFn.apply(host, args); } } else if (self.defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) { self.defaultFn.apply(host, args); } // broadcast listeners are fired as discreet events on the // YUI instance and potentially the YUI global. self._broadcast(args); // Queue the after if (subs[1] && !self.prevented && self.stopped < 2) { if (es.id === self.id || self.type != host._yuievt.bubbling) { self._procSubs(subs[1], args, ef); while ((next = es.afterQueue.last())) { next(); } } else { postponed = subs[1]; if (es.execDefaultCnt) { postponed = Y.merge(postponed); Y.each(postponed, function(s) { s.postponed = true; }); } es.afterQueue.add(function() { self._procSubs(postponed, args, ef); }); } } self.target = null; if (es.id === self.id) { queue = es.queue; while (queue.length) { q = queue.pop(); ce = q[0]; // set up stack to allow the next item to be processed es.next = ce; ce.fire.apply(ce, q[1]); } self.stack = null; } ret = !(self.stopped); if (self.type != host._yuievt.bubbling) { es.stopped = 0; es.prevented = 0; self.stopped = 0; self.prevented = 0; } return ret; }; CEProto._getFacade = function() { var ef = this._facade, o, o2, args = this.details; if (!ef) { ef = new Y.EventFacade(this, this.currentTarget); } // if the first argument is an object literal, apply the // properties to the event facade o = args && args[0]; if (Y.Lang.isObject(o, true)) { o2 = {}; // protect the event facade properties Y.mix(o2, ef, true, FACADE_KEYS); // mix the data Y.mix(ef, o, true); // restore ef Y.mix(ef, o2, true, FACADE_KEYS); // Allow the event type to be faked // http://yuilibrary.com/projects/yui3/ticket/2528376 ef.type = o.type || ef.type; } // update the details field with the arguments // ef.type = this.type; ef.details = this.details; // use the original target when the event bubbled to this target ef.target = this.originalTarget || this.target; ef.currentTarget = this.currentTarget; ef.stopped = 0; ef.prevented = 0; this._facade = ef; return this._facade; }; /** * Stop propagation to bubble targets * @for CustomEvent * @method stopPropagation */ CEProto.stopPropagation = function() { this.stopped = 1; if (this.stack) { this.stack.stopped = 1; } this.events.fire('stopped', this); }; /** * Stops propagation to bubble targets, and prevents any remaining * subscribers on the current target from executing. * @method stopImmediatePropagation */ CEProto.stopImmediatePropagation = function() { this.stopped = 2; if (this.stack) { this.stack.stopped = 2; } this.events.fire('stopped', this); }; /** * Prevents the execution of this event's defaultFn * @method preventDefault */ CEProto.preventDefault = function() { if (this.preventable) { this.prevented = 1; if (this.stack) { this.stack.prevented = 1; } } }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ CEProto.halt = function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); }; /** * Registers another EventTarget as a bubble target. Bubble order * is determined by the order registered. Multiple targets can * be specified. * * Events can only bubble if emitFacade is true. * * Included in the event-custom-complex submodule. * * @method addTarget * @param o {EventTarget} the target to add * @for EventTarget */ ETProto.addTarget = function(o) { this._yuievt.targets[Y.stamp(o)] = o; this._yuievt.hasTargets = true; }; /** * Returns an array of bubble targets for this object. * @method getTargets * @return EventTarget[] */ ETProto.getTargets = function() { return Y.Object.values(this._yuievt.targets); }; /** * Removes a bubble target * @method removeTarget * @param o {EventTarget} the target to remove * @for EventTarget */ ETProto.removeTarget = function(o) { delete this._yuievt.targets[Y.stamp(o)]; }; /** * Propagate an event. Requires the event-custom-complex module. * @method bubble * @param evt {CustomEvent} the custom event to propagate * @return {boolean} the aggregated return value from Event.Custom.fire * @for EventTarget */ ETProto.bubble = function(evt, args, target, es) { var targs = this._yuievt.targets, ret = true, t, type = evt && evt.type, ce, i, bc, ce2, originalTarget = target || (evt && evt.target) || this, oldbubble; if (!evt || ((!evt.stopped) && targs)) { for (i in targs) { if (targs.hasOwnProperty(i)) { t = targs[i]; ce = t.getEvent(type, true); ce2 = t.getSibling(type, ce); if (ce2 && !ce) { ce = t.publish(type); } oldbubble = t._yuievt.bubbling; t._yuievt.bubbling = type; // if this event was not published on the bubble target, // continue propagating the event. if (!ce) { if (t._yuievt.hasTargets) { t.bubble(evt, args, originalTarget, es); } } else { ce.sibling = ce2; // set the original target to that the target payload on the // facade is correct. ce.target = originalTarget; ce.originalTarget = originalTarget; ce.currentTarget = t; bc = ce.broadcast; ce.broadcast = false; // default publish may not have emitFacade true -- that // shouldn't be what the implementer meant to do ce.emitFacade = true; ce.stack = es; ret = ret && ce.fire.apply(ce, args || evt.details || []); ce.broadcast = bc; ce.originalTarget = null; // stopPropagation() was called if (ce.stopped) { break; } } t._yuievt.bubbling = oldbubble; } } } return ret; }; FACADE = new Y.EventFacade(); FACADE_KEYS = Y.Object.keys(FACADE); }, '@VERSION@' ,{requires:['event-custom-base']}); YUI.add('node-core', function(Y) { /** * The Node Utility provides a DOM-like interface for interacting with DOM nodes. * @module node * @main node * @submodule node-core */ /** * The Node class provides a wrapper for manipulating DOM Nodes. * Node properties can be accessed via the set/get methods. * Use `Y.one()` to retrieve Node instances. * * <strong>NOTE:</strong> Node properties are accessed using * the <code>set</code> and <code>get</code> methods. * * @class Node * @constructor * @param {DOMNode} node the DOM node to be mapped to the Node instance. * @uses EventTarget */ // "globals" var DOT = '.', NODE_NAME = 'nodeName', NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', TAG_NAME = 'tagName', UID = '_yuid', EMPTY_OBJ = {}, _slice = Array.prototype.slice, Y_DOM = Y.DOM, Y_Node = function(node) { if (!this.getDOMNode) { // support optional "new" return new Y_Node(node); } if (typeof node == 'string') { node = Y_Node._fromString(node); if (!node) { return null; // NOTE: return } } var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID]; if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) { node[UID] = null; // unset existing uid to prevent collision (via clone or hack) } uid = uid || Y.stamp(node); if (!uid) { // stamp failed; likely IE non-HTMLElement uid = Y.guid(); } this[UID] = uid; /** * The underlying DOM node bound to the Y.Node instance * @property _node * @private */ this._node = node; this._stateProxy = node; // when augmented with Attribute if (this._initPlugins) { // when augmented with Plugin.Host this._initPlugins(); } }, // used with previous/next/ancestor tests _wrapFn = function(fn) { var ret = null; if (fn) { ret = (typeof fn == 'string') ? function(n) { return Y.Selector.test(n, fn); } : function(n) { return fn(Y.one(n)); }; } return ret; }; // end "globals" Y_Node.ATTRS = {}; Y_Node.DOM_EVENTS = {}; Y_Node._fromString = function(node) { if (node) { if (node.indexOf('doc') === 0) { // doc OR document node = Y.config.doc; } else if (node.indexOf('win') === 0) { // win OR window node = Y.config.win; } else { node = Y.Selector.query(node, null, true); } } return node || null; }; /** * The name of the component * @static * @property NAME */ Y_Node.NAME = 'node'; /* * The pattern used to identify ARIA attributes */ Y_Node.re_aria = /^(?:role$|aria-)/; Y_Node.SHOW_TRANSITION = 'fadeIn'; Y_Node.HIDE_TRANSITION = 'fadeOut'; /** * A list of Node instances that have been created * @private * @property _instances * @static * */ Y_Node._instances = {}; /** * Retrieves the DOM node bound to a Node instance * @method getDOMNode * @static * * @param {Node | HTMLNode} node The Node instance or an HTMLNode * @return {HTMLNode} The DOM node bound to the Node instance. If a DOM node is passed * as the node argument, it is simply returned. */ Y_Node.getDOMNode = function(node) { if (node) { return (node.nodeType) ? node : node._node || null; } return null; }; /** * Checks Node return values and wraps DOM Nodes as Y.Node instances * and DOM Collections / Arrays as Y.NodeList instances. * Other return values just pass thru. If undefined is returned (e.g. no return) * then the Node instance is returned for chainability. * @method scrubVal * @static * * @param {any} node The Node instance or an HTMLNode * @return {Node | NodeList | Any} Depends on what is returned from the DOM node. */ Y_Node.scrubVal = function(val, node) { if (val) { // only truthy values are risky if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window val = Y.one(val); } else if ((val.item && !val._nodes) || // dom collection or Node instance (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes val = Y.all(val); } } } else if (typeof val === 'undefined') { val = node; // for chaining } else if (val === null) { val = null; // IE: DOM null not the same as null } return val; }; /** * Adds methods to the Y.Node prototype, routing through scrubVal. * @method addMethod * @static * * @param {String} name The name of the method to add * @param {Function} fn The function that becomes the method * @param {Object} context An optional context to call the method with * (defaults to the Node instance) * @return {any} Depends on what is returned from the DOM node. */ Y_Node.addMethod = function(name, fn, context) { if (name && fn && typeof fn == 'function') { Y_Node.prototype[name] = function() { var args = _slice.call(arguments), node = this, ret; if (args[0] && args[0]._node) { args[0] = args[0]._node; } if (args[1] && args[1]._node) { args[1] = args[1]._node; } args.unshift(node._node); ret = fn.apply(node, args); if (ret) { // scrub truthy ret = Y_Node.scrubVal(ret, node); } (typeof ret != 'undefined') || (ret = node); return ret; }; } else { } }; /** * Imports utility methods to be added as Y.Node methods. * @method importMethod * @static * * @param {Object} host The object that contains the method to import. * @param {String} name The name of the method to import * @param {String} altName An optional name to use in place of the host name * @param {Object} context An optional context to call the method with */ Y_Node.importMethod = function(host, name, altName) { if (typeof name == 'string') { altName = altName || name; Y_Node.addMethod(altName, host[name], host); } else { Y.Array.each(name, function(n) { Y_Node.importMethod(host, n); }); } }; /** * Retrieves a NodeList based on the given CSS selector. * @method all * * @param {string} selector The CSS selector to test against. * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array. * @for YUI */ /** * Returns a single Node instance bound to the node or the * first element matching the given selector. Returns null if no match found. * <strong>Note:</strong> For chaining purposes you may want to * use <code>Y.all</code>, which returns a NodeList when no match is found. * @method one * @param {String | HTMLElement} node a node or Selector * @return {Node | null} a Node instance or null if no match found. * @for YUI */ /** * Returns a single Node instance bound to the node or the * first element matching the given selector. Returns null if no match found. * <strong>Note:</strong> For chaining purposes you may want to * use <code>Y.all</code>, which returns a NodeList when no match is found. * @method one * @static * @param {String | HTMLElement} node a node or Selector * @return {Node | null} a Node instance or null if no match found. * @for Node */ Y_Node.one = function(node) { var instance = null, cachedNode, uid; if (node) { if (typeof node == 'string') { node = Y_Node._fromString(node); if (!node) { return null; // NOTE: return } } else if (node.getDOMNode) { return node; // NOTE: return } if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc) uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid; instance = Y_Node._instances[uid]; // reuse exising instances cachedNode = instance ? instance._node : null; if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match instance = new Y_Node(node); if (node.nodeType != 11) { // dont cache document fragment Y_Node._instances[instance[UID]] = instance; // cache node } } } } return instance; }; /** * The default setter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_SETTER * @static * @param {String} name The attribute/property being set * @param {any} val The value to be set * @return {any} The value */ Y_Node.DEFAULT_SETTER = function(name, val) { var node = this._stateProxy, strPath; if (name.indexOf(DOT) > -1) { strPath = name; name = name.split(DOT); // only allow when defined on node Y.Object.setValue(node, name, val); } else if (typeof node[name] != 'undefined') { // pass thru DOM properties node[name] = val; } return val; }; /** * The default getter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_GETTER * @static * @param {String} name The attribute/property to look up * @return {any} The current value */ Y_Node.DEFAULT_GETTER = function(name) { var node = this._stateProxy, val; if (name.indexOf && name.indexOf(DOT) > -1) { val = Y.Object.getValue(node, name.split(DOT)); } else if (typeof node[name] != 'undefined') { // pass thru from DOM val = node[name]; } return val; }; Y.mix(Y_Node.prototype, { DATA_PREFIX: 'data-', /** * The method called when outputting Node instances as strings * @method toString * @return {String} A string representation of the Node instance */ toString: function() { var str = this[UID] + ': not bound to a node', node = this._node, attrs, id, className; if (node) { attrs = node.attributes; id = (attrs && attrs.id) ? node.getAttribute('id') : null; className = (attrs && attrs.className) ? node.getAttribute('className') : null; str = node[NODE_NAME]; if (id) { str += '#' + id; } if (className) { str += '.' + className.replace(' ', '.'); } // TODO: add yuid? str += ' ' + this[UID]; } return str; }, /** * Returns an attribute value on the Node instance. * Unless pre-configured (via `Node.ATTRS`), get hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be queried. * @method get * @param {String} attr The attribute * @return {any} The current value of the attribute */ get: function(attr) { var val; if (this._getAttr) { // use Attribute imple val = this._getAttr(attr); } else { val = this._get(attr); } if (val) { val = Y_Node.scrubVal(val, this); } else if (val === null) { val = null; // IE: DOM null is not true null (even though they ===) } return val; }, /** * Helper method for get. * @method _get * @private * @param {String} attr The attribute * @return {any} The current value of the attribute */ _get: function(attr) { var attrConfig = Y_Node.ATTRS[attr], val; if (attrConfig && attrConfig.getter) { val = attrConfig.getter.call(this); } else if (Y_Node.re_aria.test(attr)) { val = this._node.getAttribute(attr, 2); } else { val = Y_Node.DEFAULT_GETTER.apply(this, arguments); } return val; }, /** * Sets an attribute on the Node instance. * Unless pre-configured (via Node.ATTRS), set hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be set. * To set custom attributes use setAttribute. * @method set * @param {String} attr The attribute to be set. * @param {any} val The value to set the attribute to. * @chainable */ set: function(attr, val) { var attrConfig = Y_Node.ATTRS[attr]; if (this._setAttr) { // use Attribute imple this._setAttr.apply(this, arguments); } else { // use setters inline if (attrConfig && attrConfig.setter) { attrConfig.setter.call(this, val, attr); } else if (Y_Node.re_aria.test(attr)) { // special case Aria this._node.setAttribute(attr, val); } else { Y_Node.DEFAULT_SETTER.apply(this, arguments); } } return this; }, /** * Sets multiple attributes. * @method setAttrs * @param {Object} attrMap an object of name/value pairs to set * @chainable */ setAttrs: function(attrMap) { if (this._setAttrs) { // use Attribute imple this._setAttrs(attrMap); } else { // use setters inline Y.Object.each(attrMap, function(v, n) { this.set(n, v); }, this); } return this; }, /** * Returns an object containing the values for the requested attributes. * @method getAttrs * @param {Array} attrs an array of attributes to get values * @return {Object} An object with attribute name/value pairs. */ getAttrs: function(attrs) { var ret = {}; if (this._getAttrs) { // use Attribute imple this._getAttrs(attrs); } else { // use setters inline Y.Array.each(attrs, function(v, n) { ret[v] = this.get(v); }, this); } return ret; }, /** * Compares nodes to determine if they match. * Node instances can be compared to each other and/or HTMLElements. * @method compareTo * @param {HTMLElement | Node} refNode The reference node to compare to the node. * @return {Boolean} True if the nodes match, false if they do not. */ compareTo: function(refNode) { var node = this._node; if (refNode && refNode._node) { refNode = refNode._node; } return node === refNode; }, /** * Determines whether the node is appended to the document. * @method inDoc * @param {Node|HTMLElement} doc optional An optional document to check against. * Defaults to current document. * @return {Boolean} Whether or not this node is appended to the document. */ inDoc: function(doc) { var node = this._node; doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT]; if (doc.documentElement) { return Y_DOM.contains(doc.documentElement, node); } }, getById: function(id) { var node = this._node, ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]); if (ret && Y_DOM.contains(node, ret)) { ret = Y.one(ret); } else { ret = null; } return ret; }, /** * Returns the nearest ancestor that passes the test applied by supplied boolean method. * @method ancestor * @param {String | Function} fn A selector string or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @param {String | Function} stopFn optional A selector string or boolean * method to indicate when the search should stop. The search bails when the function * returns true or the selector matches. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} The matching Node instance or null if not found */ ancestor: function(fn, testSelf, stopFn) { // testSelf is optional, check for stopFn as 2nd arg if (arguments.length === 2 && (typeof testSelf == 'string' || typeof testSelf == 'function')) { stopFn = testSelf; } return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn))); }, /** * Returns the ancestors that pass the test applied by supplied boolean method. * @method ancestors * @param {String | Function} fn A selector string or boolean method for testing elements. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} A NodeList instance containing the matching elements */ ancestors: function(fn, testSelf, stopFn) { if (arguments.length === 2 && (typeof testSelf == 'string' || typeof testSelf == 'function')) { stopFn = testSelf; } return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn))); }, /** * Returns the previous matching sibling. * Returns the nearest element node sibling if no method provided. * @method previous * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ previous: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all)); }, /** * Returns the next matching sibling. * Returns the nearest element node sibling if no method provided. * @method next * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ next: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all)); }, /** * Returns all matching siblings. * Returns all siblings if no method provided. * @method siblings * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} NodeList instance bound to found siblings */ siblings: function(fn) { return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn))); }, /** * Retrieves a Node instance of nodes based on the given CSS selector. * @method one * * @param {string} selector The CSS selector to test against. * @return {Node} A Node instance for the matching HTMLElement. */ one: function(selector) { return Y.one(Y.Selector.query(selector, this._node, true)); }, /** * Retrieves a NodeList based on the given CSS selector. * @method all * * @param {string} selector The CSS selector to test against. * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array. */ all: function(selector) { var nodelist = Y.all(Y.Selector.query(selector, this._node)); nodelist._query = selector; nodelist._queryRoot = this._node; return nodelist; }, // TODO: allow fn test /** * Test if the supplied node matches the supplied selector. * @method test * * @param {string} selector The CSS selector to test against. * @return {boolean} Whether or not the node matches the selector. */ test: function(selector) { return Y.Selector.test(this._node, selector); }, /** * Removes the node from its parent. * Shortcut for myNode.get('parentNode').removeChild(myNode); * @method remove * @param {Boolean} destroy whether or not to call destroy() on the node * after removal. * @chainable * */ remove: function(destroy) { var node = this._node; if (node && node.parentNode) { node.parentNode.removeChild(node); } if (destroy) { this.destroy(); } return this; }, /** * Replace the node with the other node. This is a DOM update only * and does not change the node bound to the Node instance. * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode); * @method replace * @param {Node | HTMLNode} newNode Node to be inserted * @chainable * */ replace: function(newNode) { var node = this._node; if (typeof newNode == 'string') { newNode = Y_Node.create(newNode); } node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node); return this; }, /** * @method replaceChild * @for Node * @param {String | HTMLElement | Node} node Node to be inserted * @param {HTMLElement | Node} refNode Node to be replaced * @return {Node} The replaced node */ replaceChild: function(node, refNode) { if (typeof node == 'string') { node = Y_DOM.create(node); } return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode))); }, /** * Nulls internal node references, removes any plugins and event listeners * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false) * */ destroy: function(recursive) { var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid', instance; this.purge(); // TODO: only remove events add via this Node if (this.unplug) { // may not be a PluginHost this.unplug(); } this.clearData(); if (recursive) { Y.NodeList.each(this.all('*'), function(node) { instance = Y_Node._instances[node[UID]]; if (instance) { instance.destroy(); } }); } this._node = null; this._stateProxy = null; delete Y_Node._instances[this._yuid]; }, /** * Invokes a method on the Node instance * @method invoke * @param {String} method The name of the method to invoke * @param {Any} a, b, c, etc. Arguments to invoke the method with. * @return Whatever the underly method returns. * DOM Nodes and Collections return values * are converted to Node/NodeList instances. * */ invoke: function(method, a, b, c, d, e) { var node = this._node, ret; if (a && a._node) { a = a._node; } if (b && b._node) { b = b._node; } ret = node[method](a, b, c, d, e); return Y_Node.scrubVal(ret, this); }, /** * @method swap * @description Swap DOM locations with the given node. * This does not change which DOM node each Node instance refers to. * @param {Node} otherNode The node to swap with * @chainable */ swap: Y.config.doc.documentElement.swapNode ? function(otherNode) { this._node.swapNode(Y_Node.getDOMNode(otherNode)); } : function(otherNode) { otherNode = Y_Node.getDOMNode(otherNode); var node = this._node, parent = otherNode.parentNode, nextSibling = otherNode.nextSibling; if (nextSibling === node) { parent.insertBefore(node, otherNode); } else if (otherNode === node.nextSibling) { parent.insertBefore(otherNode, node); } else { node.parentNode.replaceChild(otherNode, node); Y_DOM.addHTML(parent, node, nextSibling); } return this; }, hasMethod: function(method) { var node = this._node; return !!(node && method in node && typeof node[method] != 'unknown' && (typeof node[method] == 'function' || String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space }, isFragment: function() { return (this.get('nodeType') === 11); }, /** * Removes and destroys all of the nodes within the node. * @method empty * @chainable */ empty: function() { this.get('childNodes').remove().destroy(true); return this; }, /** * Returns the DOM node bound to the Node instance * @method getDOMNode * @return {DOMNode} */ getDOMNode: function() { return this._node; } }, true); Y.Node = Y_Node; Y.one = Y_Node.one; /** * The NodeList module provides support for managing collections of Nodes. * @module node * @submodule node-core */ /** * The NodeList class provides a wrapper for manipulating DOM NodeLists. * NodeList properties can be accessed via the set/get methods. * Use Y.all() to retrieve NodeList instances. * * @class NodeList * @constructor */ var NodeList = function(nodes) { var tmp = []; if (nodes) { if (typeof nodes === 'string') { // selector query this._query = nodes; nodes = Y.Selector.query(nodes); } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window nodes = [nodes]; } else if (nodes._node) { // Y.Node nodes = [nodes._node]; } else if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes Y.Array.each(nodes, function(node) { if (node._node) { tmp.push(node._node); } }); nodes = tmp; } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes) nodes = Y.Array(nodes, 0, true); } } /** * The underlying array of DOM nodes bound to the Y.NodeList instance * @property _nodes * @private */ this._nodes = nodes || []; }; NodeList.NAME = 'NodeList'; /** * Retrieves the DOM nodes bound to a NodeList instance * @method getDOMNodes * @static * * @param {NodeList} nodelist The NodeList instance * @return {Array} The array of DOM nodes bound to the NodeList */ NodeList.getDOMNodes = function(nodelist) { return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist; }; NodeList.each = function(instance, fn, context) { var nodes = instance._nodes; if (nodes && nodes.length) { Y.Array.each(nodes, fn, context || instance); } else { } }; NodeList.addMethod = function(name, fn, context) { if (name && fn) { NodeList.prototype[name] = function() { var ret = [], args = arguments; Y.Array.each(this._nodes, function(node) { var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid', instance = Y.Node._instances[node[UID]], ctx, result; if (!instance) { instance = NodeList._getTempNode(node); } ctx = context || instance; result = fn.apply(ctx, args); if (result !== undefined && result !== instance) { ret[ret.length] = result; } }); // TODO: remove tmp pointer return ret.length ? ret : this; }; } else { } }; NodeList.importMethod = function(host, name, altName) { if (typeof name === 'string') { altName = altName || name; NodeList.addMethod(name, host[name]); } else { Y.Array.each(name, function(n) { NodeList.importMethod(host, n); }); } }; NodeList._getTempNode = function(node) { var tmp = NodeList._tempNode; if (!tmp) { tmp = Y.Node.create('<div></div>'); NodeList._tempNode = tmp; } tmp._node = node; tmp._stateProxy = node; return tmp; }; Y.mix(NodeList.prototype, { _invoke: function(method, args, getter) { var ret = (getter) ? [] : this; this.each(function(node) { var val = node[method].apply(node, args); if (getter) { ret.push(val); } }); return ret; }, /** * Retrieves the Node instance at the given index. * @method item * * @param {Number} index The index of the target Node. * @return {Node} The Node instance at the given index. */ item: function(index) { return Y.one((this._nodes || [])[index]); }, /** * Applies the given function to each Node in the NodeList. * @method each * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to apply the function with * Default context is the current Node instance * @chainable */ each: function(fn, context) { var instance = this; Y.Array.each(this._nodes, function(node, index) { node = Y.one(node); return fn.call(context || node, node, index, instance); }); return instance; }, batch: function(fn, context) { var nodelist = this; Y.Array.each(this._nodes, function(node, index) { var instance = Y.Node._instances[node[UID]]; if (!instance) { instance = NodeList._getTempNode(node); } return fn.call(context || instance, instance, index, nodelist); }); return nodelist; }, /** * Executes the function once for each node until a true value is returned. * @method some * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to execute the function from. * Default context is the current Node instance * @return {Boolean} Whether or not the function returned true for any node. */ some: function(fn, context) { var instance = this; return Y.Array.some(this._nodes, function(node, index) { node = Y.one(node); context = context || node; return fn.call(context, node, index, instance); }); }, /** * Creates a documenFragment from the nodes bound to the NodeList instance * @method toFrag * @return {Node} a Node instance bound to the documentFragment */ toFrag: function() { return Y.one(Y.DOM._nl2frag(this._nodes)); }, /** * Returns the index of the node in the NodeList instance * or -1 if the node isn't found. * @method indexOf * @param {Node | DOMNode} node the node to search for * @return {Int} the index of the node value or -1 if not found */ indexOf: function(node) { return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node)); }, /** * Filters the NodeList instance down to only nodes matching the given selector. * @method filter * @param {String} selector The selector to filter against * @return {NodeList} NodeList containing the updated collection * @see Selector */ filter: function(selector) { return Y.all(Y.Selector.filter(this._nodes, selector)); }, /** * Creates a new NodeList containing all nodes at every n indices, where * remainder n % index equals r. * (zero-based index). * @method modulus * @param {Int} n The offset to use (return every nth node) * @param {Int} r An optional remainder to use with the modulus operation (defaults to zero) * @return {NodeList} NodeList containing the updated collection */ modulus: function(n, r) { r = r || 0; var nodes = []; NodeList.each(this, function(node, i) { if (i % n === r) { nodes.push(node); } }); return Y.all(nodes); }, /** * Creates a new NodeList containing all nodes at odd indices * (zero-based index). * @method odd * @return {NodeList} NodeList containing the updated collection */ odd: function() { return this.modulus(2, 1); }, /** * Creates a new NodeList containing all nodes at even indices * (zero-based index), including zero. * @method even * @return {NodeList} NodeList containing the updated collection */ even: function() { return this.modulus(2); }, destructor: function() { }, /** * Reruns the initial query, when created using a selector query * @method refresh * @chainable */ refresh: function() { var doc, nodes = this._nodes, query = this._query, root = this._queryRoot; if (query) { if (!root) { if (nodes && nodes[0] && nodes[0].ownerDocument) { root = nodes[0].ownerDocument; } } this._nodes = Y.Selector.query(query, root); } return this; }, _prepEvtArgs: function(type, fn, context) { // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc) var args = Y.Array(arguments, 0, true); if (args.length < 2) { // type only (event hash) just add nodes args[2] = this._nodes; } else { args.splice(2, 0, this._nodes); } args[3] = context || this; // default to NodeList instance as context return args; }, /** * Applies an event listener to each Node bound to the NodeList. * @method on * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @param {Object} context The context to call the handler with. * param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ on: function(type, fn, context) { return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList. * @method once * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ once: function(type, fn, context) { return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an event listener to each Node bound to the NodeList. * The handler is called only after all on() handlers are called * and the event is not prevented. * @method after * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ after: function(type, fn, context) { return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Returns the current number of items in the NodeList. * @method size * @return {Int} The number of items in the NodeList. */ size: function() { return this._nodes.length; }, /** * Determines if the instance is bound to any nodes * @method isEmpty * @return {Boolean} Whether or not the NodeList is bound to any nodes */ isEmpty: function() { return this._nodes.length < 1; }, toString: function() { var str = '', errorMsg = this[UID] + ': not bound to any nodes', nodes = this._nodes, node; if (nodes && nodes[0]) { node = nodes[0]; str += node[NODE_NAME]; if (node.id) { str += '#' + node.id; } if (node.className) { str += '.' + node.className.replace(' ', '.'); } if (nodes.length > 1) { str += '...[' + nodes.length + ' items]'; } } return str || errorMsg; }, /** * Returns the DOM node bound to the Node instance * @method getDOMNodes * @return {Array} */ getDOMNodes: function() { return this._nodes; } }, true); NodeList.importMethod(Y.Node.prototype, [ /** Called on each Node instance * @method destroy * @see Node.destroy */ 'destroy', /** Called on each Node instance * @method empty * @see Node.empty */ 'empty', /** Called on each Node instance * @method remove * @see Node.remove */ 'remove', /** Called on each Node instance * @method set * @see Node.set */ 'set' ]); // one-off implementation to convert array of Nodes to NodeList // e.g. Y.all('input').get('parentNode'); /** Called on each Node instance * @method get * @see Node */ NodeList.prototype.get = function(attr) { var ret = [], nodes = this._nodes, isNodeList = false, getTemp = NodeList._getTempNode, instance, val; if (nodes[0]) { instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]); val = instance._get(attr); if (val && val.nodeType) { isNodeList = true; } } Y.Array.each(nodes, function(node) { instance = Y.Node._instances[node._yuid]; if (!instance) { instance = getTemp(node); } val = instance._get(attr); if (!isNodeList) { // convert array of Nodes to NodeList val = Y.Node.scrubVal(val, instance); } ret.push(val); }); return (isNodeList) ? Y.all(ret) : ret; }; Y.NodeList = NodeList; Y.all = function(nodes) { return new NodeList(nodes); }; Y.Node.all = Y.all; /** * @module node * @submodule node-core */ var Y_NodeList = Y.NodeList, ArrayProto = Array.prototype, ArrayMethods = { /** Returns a new NodeList combining the given NodeList(s) * @for NodeList * @method concat * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to * concatenate to the resulting NodeList * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'concat': 1, /** Removes the last from the NodeList and returns it. * @for NodeList * @method pop * @return {Node} The last item in the NodeList. */ 'pop': 0, /** Adds the given Node(s) to the end of the NodeList. * @for NodeList * @method push * @param {Node | DOMNode} nodes One or more nodes to add to the end of the NodeList. */ 'push': 0, /** Removes the first item from the NodeList and returns it. * @for NodeList * @method shift * @return {Node} The first item in the NodeList. */ 'shift': 0, /** Returns a new NodeList comprising the Nodes in the given range. * @for NodeList * @method slice * @param {Number} begin Zero-based index at which to begin extraction. As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence. * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts to the end of the sequence. * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'slice': 1, /** Changes the content of the NodeList, adding new elements while removing old elements. * @for NodeList * @method splice * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end. * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed. * {Node | DOMNode| element1, ..., elementN The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array. * @return {NodeList} The element(s) removed. */ 'splice': 1, /** Adds the given Node(s) to the beginning of the NodeList. * @for NodeList * @method unshift * @param {Node | DOMNode} nodes One or more nodes to add to the NodeList. */ 'unshift': 0 }; Y.Object.each(ArrayMethods, function(returnNodeList, name) { Y_NodeList.prototype[name] = function() { var args = [], i = 0, arg, ret; while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists args.push(arg._node || arg._nodes || arg); } ret = ArrayProto[name].apply(this._nodes, args); if (returnNodeList) { ret = Y.all(ret); } else { ret = Y.Node.scrubVal(ret); } return ret; }; }); /** * @module node * @submodule node-core */ Y.Array.each([ /** * Passes through to DOM method. * @for Node * @method removeChild * @param {HTMLElement | Node} node Node to be removed * @return {Node} The removed node */ 'removeChild', /** * Passes through to DOM method. * @method hasChildNodes * @return {Boolean} Whether or not the node has any childNodes */ 'hasChildNodes', /** * Passes through to DOM method. * @method cloneNode * @param {Boolean} deep Whether or not to perform a deep clone, which includes * subtree and attributes * @return {Node} The clone */ 'cloneNode', /** * Passes through to DOM method. * @method hasAttribute * @param {String} attribute The attribute to test for * @return {Boolean} Whether or not the attribute is present */ 'hasAttribute', /** * Passes through to DOM method. * @method scrollIntoView * @chainable */ 'scrollIntoView', /** * Passes through to DOM method. * @method getElementsByTagName * @param {String} tagName The tagName to collect * @return {NodeList} A NodeList representing the HTMLCollection */ 'getElementsByTagName', /** * Passes through to DOM method. * @method focus * @chainable */ 'focus', /** * Passes through to DOM method. * @method blur * @chainable */ 'blur', /** * Passes through to DOM method. * Only valid on FORM elements * @method submit * @chainable */ 'submit', /** * Passes through to DOM method. * Only valid on FORM elements * @method reset * @chainable */ 'reset', /** * Passes through to DOM method. * @method select * @chainable */ 'select', /** * Passes through to DOM method. * Only valid on TABLE elements * @method createCaption * @chainable */ 'createCaption' ], function(method) { Y.Node.prototype[method] = function(arg1, arg2, arg3) { var ret = this.invoke(method, arg1, arg2, arg3); return ret; }; }); /** * Passes through to DOM method. * @method removeAttribute * @param {String} attribute The attribute to be removed * @chainable */ // one-off implementation due to IE returning boolean, breaking chaining Y.Node.prototype.removeAttribute = function(attr) { var node = this._node; if (node) { node.removeAttribute(attr); } return this; }; Y.Node.importMethod(Y.DOM, [ /** * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. * @method contains * @param {Node | HTMLElement} needle The possible node or descendent * @return {Boolean} Whether or not this node is the needle its ancestor */ 'contains', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @for Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @for Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Wraps the given HTML around the node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable * @for Node */ 'wrap', /** * Removes the node's parent node. * @method unwrap * @chainable */ 'unwrap', /** * Applies a unique ID to the node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @see Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @see Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows for removing attributes on DOM nodes. * This passes through to the DOM node, allowing for custom attributes. * @method removeAttribute * @see Node * @for NodeList * @param {string} name The attribute to remove */ 'removeAttribute', /** * Removes the parent node from node in the list. * @method unwrap * @chainable */ 'unwrap', /** * Wraps the given HTML around each node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable */ 'wrap', /** * Applies a unique ID to each node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); }, '@VERSION@' ,{requires:['dom-core', 'selector']}); YUI.add('node-base', function(Y) { /** * @module node * @submodule node-base */ var methods = [ /** * Determines whether each node has the given className. * @method hasClass * @for Node * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the specified class */ 'hasClass', /** * Adds a class name to each node. * @method addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ 'addClass', /** * Removes a class name from each node. * @method removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ 'removeClass', /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ 'replaceClass', /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @param {String} className the class name to be toggled * @param {Boolean} force Option to force adding or removing the class. * @chainable */ 'toggleClass' ]; Y.Node.importMethod(Y.DOM, methods); /** * Determines whether each node has the given className. * @method hasClass * @see Node.hasClass * @for NodeList * @param {String} className the class name to search for * @return {Array} An array of booleans for each node bound to the NodeList. */ /** * Adds a class name to each node. * @method addClass * @see Node.addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ /** * Removes a class name from each node. * @method removeClass * @see Node.removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @see Node.replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @see Node.toggleClass * @param {String} className the class name to be toggled * @chainable */ Y.NodeList.importMethod(Y.Node.prototype, methods); /** * @module node * @submodule node-base */ var Y_Node = Y.Node, Y_DOM = Y.DOM; /** * Returns a new dom node using the provided markup string. * @method create * @static * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment * @for Node */ Y_Node.create = function(html, doc) { if (doc && doc._node) { doc = doc._node; } return Y.one(Y_DOM.create(html, doc)); }; Y.mix(Y_Node.prototype, { /** * Creates a new Node using the provided markup string. * @method create * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment */ create: Y_Node.create, /** * Inserts the content before the reference node. * @method insert * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * @param {Int | Node | HTMLElement | String} where The position to insert at. * Possible "where" arguments * <dl> * <dt>Y.Node</dt> * <dd>The Node to insert before</dd> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>Int</dt> * <dd>The index of the child element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> * @chainable */ insert: function(content, where) { this._insert(content, where); return this; }, _insert: function(content, where) { var node = this._node, ret = null; if (typeof where == 'number') { // allow index where = this._node.childNodes[where]; } else if (where && where._node) { // Node where = where._node; } if (content && typeof content != 'string') { // allow Node or NodeList/Array instances content = content._node || content._nodes || content; } ret = Y_DOM.addHTML(node, content, where); return ret; }, /** * Inserts the content as the firstChild of the node. * @method prepend * @param {String | Node | HTMLElement} content The content to insert * @chainable */ prepend: function(content) { return this.insert(content, 0); }, /** * Inserts the content as the lastChild of the node. * @method append * @param {String | Node | HTMLElement} content The content to insert * @chainable */ append: function(content) { return this.insert(content, null); }, /** * @method appendChild * @param {String | HTMLElement | Node} node Node to be appended * @return {Node} The appended node */ appendChild: function(node) { return Y_Node.scrubVal(this._insert(node)); }, /** * @method insertBefore * @param {String | HTMLElement | Node} newNode Node to be appended * @param {HTMLElement | Node} refNode Node to be inserted before * @return {Node} The inserted node */ insertBefore: function(newNode, refNode) { return Y.Node.scrubVal(this._insert(newNode, refNode)); }, /** * Appends the node to the given node. * @method appendTo * @param {Node | HTMLElement} node The node to append to * @chainable */ appendTo: function(node) { Y.one(node).append(this); return this; }, /** * Replaces the node's current content with the content. * @method setContent * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * @chainable */ setContent: function(content) { this._insert(content, 'replace'); return this; }, /** * Returns the node's current content (e.g. innerHTML) * @method getContent * @return {String} The current content */ getContent: function(content) { return this.get('innerHTML'); } }); /** * Replaces the node's current html content with the content provided. * @method setHTML * @param {String | HTML | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * @chainable */ Y.Node.prototype.setHTML = Y.Node.prototype.setContent; /** * Returns the node's current html content (e.g. innerHTML) * @method getContent * @return {String} The html content */ Y.Node.prototype.getHTML = Y.Node.prototype.getContent; Y.NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance * @for NodeList * @method append * @see Node.append */ 'append', /** Called on each Node instance * @method insert * @see Node.insert */ 'insert', /** * Called on each Node instance * @for NodeList * @method appendChild * @see Node.appendChild */ 'appendChild', /** Called on each Node instance * @method insertBefore * @see Node.insertBefore */ 'insertBefore', /** Called on each Node instance * @method prepend * @see Node.prepend */ 'prepend', /** Called on each Node instance * @method setContent * @see Node.setContent */ 'setContent', /** Called on each Node instance * @method getContent * @see Node.getContent */ 'getContent' ]); /** * @module node * @submodule node-base */ var Y_Node = Y.Node, Y_DOM = Y.DOM; /** * Static collection of configuration attributes for special handling * @property ATTRS * @static * @type object */ Y_Node.ATTRS = { /** * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * @config text * @type String */ text: { getter: function() { return Y_DOM.getText(this._node); }, setter: function(content) { Y_DOM.setText(this._node, content); return content; } }, /** * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * @config for * @type String */ 'for': { getter: function() { return Y_DOM.getAttribute(this._node, 'for'); }, setter: function(val) { Y_DOM.setAttribute(this._node, 'for', val); return val; } }, 'options': { getter: function() { return this._node.getElementsByTagName('option'); } }, /** * Returns a NodeList instance of all HTMLElement children. * @readOnly * @config children * @type NodeList */ 'children': { getter: function() { var node = this._node, children = node.children, childNodes, i, len; if (!children) { childNodes = node.childNodes; children = []; for (i = 0, len = childNodes.length; i < len; ++i) { if (childNodes[i].tagName) { children[children.length] = childNodes[i]; } } } return Y.all(children); } }, value: { getter: function() { return Y_DOM.getValue(this._node); }, setter: function(val) { Y_DOM.setValue(this._node, val); return val; } } }; Y.Node.importMethod(Y.DOM, [ /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @for Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @for Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute' ]); /** * @module node * @submodule node-base */ var Y_Node = Y.Node; var Y_NodeList = Y.NodeList; /** * List of events that route to DOM events * @static * @property DOM_EVENTS * @for Node */ Y_Node.DOM_EVENTS = { abort: 1, beforeunload: 1, blur: 1, change: 1, click: 1, close: 1, command: 1, contextmenu: 1, dblclick: 1, DOMMouseScroll: 1, drag: 1, dragstart: 1, dragenter: 1, dragover: 1, dragleave: 1, dragend: 1, drop: 1, error: 1, focus: 1, key: 1, keydown: 1, keypress: 1, keyup: 1, load: 1, message: 1, mousedown: 1, mouseenter: 1, mouseleave: 1, mousemove: 1, mousemultiwheel: 1, mouseout: 1, mouseover: 1, mouseup: 1, mousewheel: 1, orientationchange: 1, reset: 1, resize: 1, select: 1, selectstart: 1, submit: 1, scroll: 1, textInput: 1, unload: 1 }; // Add custom event adaptors to this list. This will make it so // that delegate, key, available, contentready, etc all will // be available through Node.on Y.mix(Y_Node.DOM_EVENTS, Y.Env.evt.plugins); Y.augment(Y_Node, Y.EventTarget); Y.mix(Y_Node.prototype, { /** * Removes event listeners from the node and (optionally) its subtree * @method purge * @param {Boolean} recurse (optional) Whether or not to remove listeners from the * node's subtree * @param {String} type (optional) Only remove listeners of the specified type * @chainable * */ purge: function(recurse, type) { Y.Event.purgeElement(this._node, recurse, type); return this; } }); Y.mix(Y.NodeList.prototype, { _prepEvtArgs: function(type, fn, context) { // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc) var args = Y.Array(arguments, 0, true); if (args.length < 2) { // type only (event hash) just add nodes args[2] = this._nodes; } else { args.splice(2, 0, this._nodes); } args[3] = context || this; // default to NodeList instance as context return args; }, /** Subscribe a callback function for each `Node` in the collection to execute in response to a DOM event. NOTE: Generally, the `on()` method should be avoided on `NodeLists`, in favor of using event delegation from a parent Node. See the Event user guide for details. Most DOM events are associated with a preventable default behavior, such as link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade` object as their first argument (usually called `e`) that can be used to prevent this default behavior with `e.preventDefault()`. See the `DOMEventFacade` API for all available properties and methods on the object. By default, the `this` object will be the `NodeList` that the subscription came from, <em>not the `Node` that received the event</em>. Use `e.currentTarget` to refer to the `Node`. Returning `false` from a callback is supported as an alternative to calling `e.preventDefault(); e.stopPropagation();`. However, it is recommended to use the event methods. @example Y.all(".sku").on("keydown", function (e) { if (e.keyCode === 13) { e.preventDefault(); // Use e.currentTarget to refer to the individual Node var item = Y.MyApp.searchInventory( e.currentTarget.get('value') ); // etc ... } }); @method on @param {String} type The name of the event @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching that subscription @for NodeList **/ on: function(type, fn, context) { return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList. * @method once * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ once: function(type, fn, context) { return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an event listener to each Node bound to the NodeList. * The handler is called only after all on() handlers are called * and the event is not prevented. * @method after * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ after: function(type, fn, context) { return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList * that will be called only after all on() handlers are called and the * event is not prevented. * * @method onceAfter * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ onceAfter: function(type, fn, context) { return Y.onceAfter.apply(Y, this._prepEvtArgs.apply(this, arguments)); } }); Y_NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance * @method detach * @see Node.detach * @for NodeList */ 'detach', /** Called on each Node instance * @method detachAll * @see Node.detachAll * @for NodeList */ 'detachAll' ]); /** Subscribe a callback function to execute in response to a DOM event or custom event. Most DOM events are associated with a preventable default behavior such as link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade` object as their first argument (usually called `e`) that can be used to prevent this default behavior with `e.preventDefault()`. See the `DOMEventFacade` API for all available properties and methods on the object. If the event name passed as the first parameter is not a whitelisted DOM event, it will be treated as a custom event subscriptions, allowing `node.fire('customEventName')` later in the code. Refer to the Event user guide for the full DOM event whitelist. By default, the `this` object in the callback will refer to the subscribed `Node`. Returning `false` from a callback is supported as an alternative to calling `e.preventDefault(); e.stopPropagation();`. However, it is recommended to use the event methods. @example Y.one("#my-form").on("submit", function (e) { e.preventDefault(); // proceed with ajax form submission instead... }); @method on @param {String} type The name of the event @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching that subscription @for Node **/ Y.mix(Y.Node.ATTRS, { offsetHeight: { setter: function(h) { Y.DOM.setHeight(this._node, h); return h; }, getter: function() { return this._node.offsetHeight; } }, offsetWidth: { setter: function(w) { Y.DOM.setWidth(this._node, w); return w; }, getter: function() { return this._node.offsetWidth; } } }); Y.mix(Y.Node.prototype, { sizeTo: function(w, h) { var node; if (arguments.length < 2) { node = Y.one(w); w = node.get('offsetWidth'); h = node.get('offsetHeight'); } this.setAttrs({ offsetWidth: w, offsetHeight: h }); } }); /** * @module node * @submodule node-base */ var Y_Node = Y.Node; Y.mix(Y_Node.prototype, { /** * Makes the node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @for Node * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ show: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(true, callback); return this; }, /** * The implementation for showing nodes. * Default is to toggle the style.display property. * @method _show * @protected * @chainable */ _show: function() { this.setStyle('display', ''); }, _isHidden: function() { return Y.DOM.getStyle(this._node, 'display') === 'none'; }, toggleView: function(on, callback) { this._toggleView.apply(this, arguments); }, _toggleView: function(on, callback) { callback = arguments[arguments.length - 1]; // base on current state if not forcing if (typeof on != 'boolean') { on = (this._isHidden()) ? 1 : 0; } if (on) { this._show(); } else { this._hide(); } if (typeof callback == 'function') { callback.call(this); } return this; }, /** * Hides the node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ hide: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(false, callback); return this; }, /** * The implementation for hiding nodes. * Default is to toggle the style.display property. * @method _hide * @protected * @chainable */ _hide: function() { this.setStyle('display', 'none'); } }); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Makes each node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @for NodeList * @chainable */ 'show', /** * Hides each node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ 'hide', 'toggleView' ]); if (!Y.config.doc.documentElement.hasAttribute) { // IE < 8 Y.Node.prototype.hasAttribute = function(attr) { if (attr === 'value') { if (this.get('value') !== "") { // IE < 8 fails to populate specified when set in HTML return true; } } return !!(this._node.attributes[attr] && this._node.attributes[attr].specified); }; } // IE throws an error when calling focus() on an element that's invisible, not // displayed, or disabled. Y.Node.prototype.focus = function () { try { this._node.focus(); } catch (e) { } return this; }; // IE throws error when setting input.type = 'hidden', // input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden' Y.Node.ATTRS.type = { setter: function(val) { if (val === 'hidden') { try { this._node.type = 'hidden'; } catch(e) { this.setStyle('display', 'none'); this._inputType = 'hidden'; } } else { try { // IE errors when changing the type from "hidden' this._node.type = val; } catch (e) { } } return val; }, getter: function() { return this._inputType || this._node.type; }, _bypassProxy: true // don't update DOM when using with Attribute }; if (Y.config.doc.createElement('form').elements.nodeType) { // IE: elements collection is also FORM node which trips up scrubVal. Y.Node.ATTRS.elements = { getter: function() { return this.all('input, textarea, button, select'); } }; } /** * Provides methods for managing custom Node data. * * @module node * @main node * @submodule node-data */ Y.mix(Y.Node.prototype, { _initData: function() { if (! ('_data' in this)) { this._data = {}; } }, /** * @method getData * @description Retrieves arbitrary data stored on a Node instance. * If no data is associated with the Node, it will attempt to retrieve * a value from the corresponding HTML data attribute. (e.g. node.getData('foo') * will check node.getAttribute('data-foo')). * @param {string} name Optional name of the data field to retrieve. * If no name is given, all data is returned. * @return {any | Object} Whatever is stored at the given field, * or an object hash of all fields. */ getData: function(name) { this._initData(); var data = this._data, ret = data; if (arguments.length) { // single field if (name in data) { ret = data[name]; } else { // initialize from HTML attribute ret = this._getDataAttribute(name); } } else if (typeof data == 'object' && data !== null) { // all fields ret = {}; Y.Object.each(data, function(v, n) { ret[n] = v; }); ret = this._getDataAttributes(ret); } return ret; }, _getDataAttributes: function(ret) { ret = ret || {}; var i = 0, attrs = this._node.attributes, len = attrs.length, prefix = this.DATA_PREFIX, prefixLength = prefix.length, name; while (i < len) { name = attrs[i].name; if (name.indexOf(prefix) === 0) { name = name.substr(prefixLength); if (!(name in ret)) { // only merge if not already stored ret[name] = this._getDataAttribute(name); } } i += 1; } return ret; }, _getDataAttribute: function(name) { var name = this.DATA_PREFIX + name, node = this._node, attrs = node.attributes, data = attrs && attrs[name] && attrs[name].value; return data; }, /** * @method setData * @description Stores arbitrary data on a Node instance. * This is not stored with the DOM node. * @param {string} name The name of the field to set. If no name * is given, name is treated as the data and overrides any existing data. * @param {any} val The value to be assigned to the field. * @chainable */ setData: function(name, val) { this._initData(); if (arguments.length > 1) { this._data[name] = val; } else { this._data = name; } return this; }, /** * @method clearData * @description Clears internally stored data. * @param {string} name The name of the field to clear. If no name * is given, all data is cleared. * @chainable */ clearData: function(name) { if ('_data' in this) { if (typeof name != 'undefined') { delete this._data[name]; } else { delete this._data; } } return this; } }); Y.mix(Y.NodeList.prototype, { /** * @method getData * @description Retrieves arbitrary data stored on each Node instance * bound to the NodeList. * @see Node * @param {string} name Optional name of the data field to retrieve. * If no name is given, all data is returned. * @return {Array} An array containing all of the data for each Node instance. * or an object hash of all fields. */ getData: function(name) { var args = (arguments.length) ? [name] : []; return this._invoke('getData', args, true); }, /** * @method setData * @description Stores arbitrary data on each Node instance bound to the * NodeList. This is not stored with the DOM node. * @param {string} name The name of the field to set. If no name * is given, name is treated as the data and overrides any existing data. * @param {any} val The value to be assigned to the field. * @chainable */ setData: function(name, val) { var args = (arguments.length > 1) ? [name, val] : [name]; return this._invoke('setData', args); }, /** * @method clearData * @description Clears data on all Node instances bound to the NodeList. * @param {string} name The name of the field to clear. If no name * is given, all data is cleared. * @chainable */ clearData: function(name) { var args = (arguments.length) ? [name] : []; return this._invoke('clearData', [name]); } }); }, '@VERSION@' ,{requires:['dom-base', 'node-core', 'event-base']}); (function () { var GLOBAL_ENV = YUI.Env; if (!GLOBAL_ENV._ready) { GLOBAL_ENV._ready = function() { GLOBAL_ENV.DOMReady = true; GLOBAL_ENV.remove(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); }; GLOBAL_ENV.add(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); } })(); YUI.add('event-base', function(Y) { /* * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * The domready event fires at the moment the browser's DOM is * usable. In most cases, this is before images are fully * downloaded, allowing you to provide a more responsive user * interface. * * In YUI 3, domready subscribers will be notified immediately if * that moment has already passed when the subscription is created. * * One exception is if the yui.js file is dynamically injected into * the page. If this is done, you must tell the YUI instance that * you did this in order for DOMReady (and window load events) to * fire normally. That configuration option is 'injected' -- set * it to true if the yui.js script is not included inline. * * This method is part of the 'event-ready' module, which is a * submodule of 'event'. * * @event domready * @for YUI */ Y.publish('domready', { fireOnce: true, async: true }); if (YUI.Env.DOMReady) { Y.fire('domready'); } else { Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready'); } /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ /** * Wraps a DOM event, properties requiring browser abstraction are * fixed here. Provids a security layer when required. * @class DOMEventFacade * @param ev {Event} the DOM event * @param currentTarget {HTMLElement} the element the listener was attached to * @param wrapper {Event.Custom} the custom event wrapper for this DOM event */ var ua = Y.UA, EMPTY = {}, /** * webkit key remapping required for Safari < 3.1 * @property webkitKeymap * @private */ webkitKeymap = { 63232: 38, // up 63233: 40, // down 63234: 37, // left 63235: 39, // right 63276: 33, // page up 63277: 34, // page down 25: 9, // SHIFT-TAB (Safari provides a different key code in // this case, even though the shiftKey modifier is set) 63272: 46, // delete 63273: 36, // home 63275: 35 // end }, /** * Returns a wrapped node. Intended to be used on event targets, * so it will return the node's parent if the target is a text * node. * * If accessing a property of the node throws an error, this is * probably the anonymous div wrapper Gecko adds inside text * nodes. This likely will only occur when attempting to access * the relatedTarget. In this case, we now return null because * the anonymous div is completely useless and we do not know * what the related target was because we can't even get to * the element's parent node. * * @method resolve * @private */ resolve = function(n) { if (!n) { return n; } try { if (n && 3 == n.nodeType) { n = n.parentNode; } } catch(e) { return null; } return Y.one(n); }, DOMEventFacade = function(ev, currentTarget, wrapper) { this._event = ev; this._currentTarget = currentTarget; this._wrapper = wrapper || EMPTY; // if not lazy init this.init(); }; Y.extend(DOMEventFacade, Object, { init: function() { var e = this._event, overrides = this._wrapper.overrides, x = e.pageX, y = e.pageY, c, currentTarget = this._currentTarget; this.altKey = e.altKey; this.ctrlKey = e.ctrlKey; this.metaKey = e.metaKey; this.shiftKey = e.shiftKey; this.type = (overrides && overrides.type) || e.type; this.clientX = e.clientX; this.clientY = e.clientY; this.pageX = x; this.pageY = y; // charCode is unknown in keyup, keydown. keyCode is unknown in keypress. // FF 3.6 - 8+? pass 0 for keyCode in keypress events. // Webkit, FF 3.6-8+?, and IE9+? pass 0 for charCode in keydown, keyup. // Webkit and IE9+? duplicate charCode in keyCode. // Opera never sets charCode, always keyCode (though with the charCode). // IE6-8 don't set charCode or which. // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and // which=charCode in keypress. // // Moral of the story: (e.which || e.keyCode) will always return the // known code for that key event phase. e.keyCode is often different in // keypress from keydown and keyup. c = e.keyCode || e.charCode; if (ua.webkit && (c in webkitKeymap)) { c = webkitKeymap[c]; } this.keyCode = c; this.charCode = c; // Fill in e.which for IE - implementers should always use this over // e.keyCode or e.charCode. this.which = e.which || e.charCode || c; // this.button = e.button; this.button = this.which; this.target = resolve(e.target); this.currentTarget = resolve(currentTarget); this.relatedTarget = resolve(e.relatedTarget); if (e.type == "mousewheel" || e.type == "DOMMouseScroll") { this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1); } if (this._touch) { this._touch(e, currentTarget, this._wrapper); } }, stopPropagation: function() { this._event.stopPropagation(); this._wrapper.stopped = 1; this.stopped = 1; }, stopImmediatePropagation: function() { var e = this._event; if (e.stopImmediatePropagation) { e.stopImmediatePropagation(); } else { this.stopPropagation(); } this._wrapper.stopped = 2; this.stopped = 2; }, preventDefault: function(returnValue) { var e = this._event; e.preventDefault(); e.returnValue = returnValue || false; this._wrapper.prevented = 1; this.prevented = 1; }, halt: function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); } }); DOMEventFacade.resolve = resolve; Y.DOM2EventFacade = DOMEventFacade; Y.DOMEventFacade = DOMEventFacade; /** * The native event * @property _event * @type {Native DOM Event} * @private */ /** The name of the event (e.g. "click") @property type @type {String} **/ /** `true` if the "alt" or "option" key is pressed. @property altKey @type {Boolean} **/ /** `true` if the shift key is pressed. @property shiftKey @type {Boolean} **/ /** `true` if the "Windows" key on a Windows keyboard, "command" key on an Apple keyboard, or "meta" key on other keyboards is pressed. @property metaKey @type {Boolean} **/ /** `true` if the "Ctrl" or "control" key is pressed. @property ctrlKey @type {Boolean} **/ /** * The X location of the event on the page (including scroll) * @property pageX * @type {Number} */ /** * The Y location of the event on the page (including scroll) * @property pageY * @type {Number} */ /** * The X location of the event in the viewport * @property clientX * @type {Number} */ /** * The Y location of the event in the viewport * @property clientY * @type {Number} */ /** * The keyCode for key events. Uses charCode if keyCode is not available * @property keyCode * @type {Number} */ /** * The charCode for key events. Same as keyCode * @property charCode * @type {Number} */ /** * The button that was pushed. 1 for left click, 2 for middle click, 3 for * right click. This is only reliably populated on `mouseup` events. * @property button * @type {Number} */ /** * The button that was pushed. Same as button. * @property which * @type {Number} */ /** * Node reference for the targeted element * @property target * @type {Node} */ /** * Node reference for the element that the listener was attached to. * @property currentTarget * @type {Node} */ /** * Node reference to the relatedTarget * @property relatedTarget * @type {Node} */ /** * Number representing the direction and velocity of the movement of the mousewheel. * Negative is down, the higher the number, the faster. Applies to the mousewheel event. * @property wheelDelta * @type {Number} */ /** * Stops the propagation to the next bubble target * @method stopPropagation */ /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ /** * Prevents the event's default behavior * @method preventDefault * @param returnValue {string} sets the returnValue of the event to this value * (rather than the default false value). This can be used to add a customized * confirmation query to the beforeunload event). */ /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ (function() { /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * @module event * @main event * @submodule event-base */ /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * * @class Event * @static */ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; var _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add, remove = YUI.Env.remove, onLoad = function() { YUI.Env.windowLoaded = true; Y.Event._load(); remove(win, "load", onLoad); }, onUnload = function() { Y.Event._unload(); }, EVENT_READY = 'domready', COMPAT_ARG = '~yui|2|compat~', shouldIterate = function(o) { try { return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !o.alert); } catch(ex) { return false; } }, // aliases to support DOM event subscription clean up when the last // subscriber is detached. deleteAndClean overrides the DOM event's wrapper // CustomEvent _delete method. _ceProtoDelete = Y.CustomEvent.prototype._delete, _deleteAndClean = function(s) { var ret = _ceProtoDelete.apply(this, arguments); if (!this.subCount && !this.afterCount) { Y.Event._clean(this); } return ret; }, Event = function() { /** * True after the onload event has fired * @property _loadComplete * @type boolean * @static * @private */ var _loadComplete = false, /** * The number of times to poll after window.onload. This number is * increased if additional late-bound handlers are requested after * the page load. * @property _retryCount * @static * @private */ _retryCount = 0, /** * onAvailable listeners * @property _avail * @static * @private */ _avail = [], /** * Custom event wrappers for DOM events. Key is * 'event:' + Element uid stamp + event type * @property _wrappers * @type Y.Event.Custom * @static * @private */ _wrappers = _eventenv.dom_wrappers, _windowLoadKey = null, /** * Custom event wrapper map DOM events. Key is * Element uid stamp. Each item is a hash of custom event * wrappers as provided in the _wrappers collection. This * provides the infrastructure for getListeners. * @property _el_events * @static * @private */ _el_events = _eventenv.dom_map; return { /** * The number of times we should look for elements that are not * in the DOM at the time the event is requested after the document * has been loaded. The default is 1000@amp;40 ms, so it will poll * for 40 seconds or until all outstanding handlers are bound * (whichever comes first). * @property POLL_RETRYS * @type int * @static * @final */ POLL_RETRYS: 1000, /** * The poll interval in milliseconds * @property POLL_INTERVAL * @type int * @static * @final */ POLL_INTERVAL: 40, /** * addListener/removeListener can throw errors in unexpected scenarios. * These errors are suppressed, the method returns false, and this property * is set * @property lastError * @static * @type Error */ lastError: null, /** * poll handle * @property _interval * @static * @private */ _interval: null, /** * document readystate poll handle * @property _dri * @static * @private */ _dri: null, /** * True when the document is initially usable * @property DOMReady * @type boolean * @static */ DOMReady: false, /** * @method startInterval * @static * @private */ startInterval: function() { if (!Event._interval) { Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL); } }, /** * Executes the supplied callback when the item with the supplied * id is found. This is meant to be used to execute behavior as * soon as possible as the page loads. If you use this after the * initial page load it will poll for a fixed time for the element. * The number of times it will poll and the frequency are * configurable. By default it will poll for 10 seconds. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onAvailable * * @param {string||string[]} id the id of the element, or an array * of ids to look for. * @param {function} fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} p_override If set to true, fn will execute * in the context of p_obj, if set to an object it * will execute in the context of that object * @param checkContent {boolean} check child node readiness (onContentReady) * @static * @deprecated Use Y.on("available") */ // @TODO fix arguments onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) { var a = Y.Array(id), i, availHandle; for (i=0; i<a.length; i=i+1) { _avail.push({ id: a[i], fn: fn, obj: p_obj, override: p_override, checkReady: checkContent, compat: compat }); } _retryCount = this.POLL_RETRYS; // We want the first test to be immediate, but async setTimeout(Event._poll, 0); availHandle = new Y.EventHandle({ _delete: function() { // set by the event system for lazy DOM listeners if (availHandle.handle) { availHandle.handle.detach(); return; } var i, j; // otherwise try to remove the onAvailable listener(s) for (i = 0; i < a.length; i++) { for (j = 0; j < _avail.length; j++) { if (a[i] === _avail[j].id) { _avail.splice(j, 1); } } } } }); return availHandle; }, /** * Works the same way as onAvailable, but additionally checks the * state of sibling elements to determine if the content of the * available element is safe to modify. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onContentReady * * @param {string} id the id of the element to look for. * @param {function} fn what to execute when the element is ready. * @param {object} obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} override If set to true, fn will execute * in the context of p_obj. If an object, fn will * exectute in the context of that object * * @static * @deprecated Use Y.on("contentready") */ // @TODO fix arguments onContentReady: function(id, fn, obj, override, compat) { return Event.onAvailable(id, fn, obj, override, true, compat); }, /** * Adds an event listener * * @method attach * * @param {String} type The type of event to append * @param {Function} fn The method the event invokes * @param {String|HTMLElement|Array|NodeList} el An id, an element * reference, or a collection of ids and/or elements to assign the * listener to. * @param {Object} context optional context object * @param {Boolean|object} args 0..n arguments to pass to the callback * @return {EventHandle} an object to that can be used to detach the listener * * @static */ attach: function(type, fn, el, context) { return Event._attach(Y.Array(arguments, 0, true)); }, _createWrapper: function (el, type, capture, compat, facade) { var cewrapper, ek = Y.stamp(el), key = 'event:' + ek + type; if (false === facade) { key += 'native'; } if (capture) { key += 'capture'; } cewrapper = _wrappers[key]; if (!cewrapper) { // create CE wrapper cewrapper = Y.publish(key, { silent: true, bubbles: false, contextFn: function() { if (compat) { return cewrapper.el; } else { cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el); return cewrapper.nodeRef; } } }); cewrapper.overrides = {}; // for later removeListener calls cewrapper.el = el; cewrapper.key = key; cewrapper.domkey = ek; cewrapper.type = type; cewrapper.fn = function(e) { cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade)))); }; cewrapper.capture = capture; if (el == win && type == "load") { // window load happens once cewrapper.fireOnce = true; _windowLoadKey = key; } cewrapper._delete = _deleteAndClean; _wrappers[key] = cewrapper; _el_events[ek] = _el_events[ek] || {}; _el_events[ek][key] = cewrapper; add(el, type, cewrapper.fn, capture); } return cewrapper; }, _attach: function(args, conf) { var compat, handles, oEl, cewrapper, context, fireNow = false, ret, type = args[0], fn = args[1], el = args[2] || win, facade = conf && conf.facade, capture = conf && conf.capture, overrides = conf && conf.overrides; if (args[args.length-1] === COMPAT_ARG) { compat = true; } if (!fn || !fn.call) { // throw new TypeError(type + " attach call failed, callback undefined"); return false; } // The el argument can be an array of elements or element ids. if (shouldIterate(el)) { handles=[]; Y.each(el, function(v, k) { args[2] = v; handles.push(Event._attach(args.slice(), conf)); }); // return (handles.length === 1) ? handles[0] : handles; return new Y.EventHandle(handles); // If the el argument is a string, we assume it is // actually the id of the element. If the page is loaded // we convert el to the actual element, otherwise we // defer attaching the event until the element is // ready } else if (Y.Lang.isString(el)) { // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) { oEl = Y.DOM.byId(el); } else { oEl = Y.Selector.query(el); switch (oEl.length) { case 0: oEl = null; break; case 1: oEl = oEl[0]; break; default: args[2] = oEl; return Event._attach(args, conf); } } if (oEl) { el = oEl; // Not found = defer adding the event until the element is available } else { ret = Event.onAvailable(el, function() { ret.handle = Event._attach(args, conf); }, Event, true, false, compat); return ret; } } // Element should be an html element or node if (!el) { return false; } if (Y.Node && Y.instanceOf(el, Y.Node)) { el = Y.Node.getDOMNode(el); } cewrapper = Event._createWrapper(el, type, capture, compat, facade); if (overrides) { Y.mix(cewrapper.overrides, overrides); } if (el == win && type == "load") { // if the load is complete, fire immediately. // all subscribers, including the current one // will be notified. if (YUI.Env.windowLoaded) { fireNow = true; } } if (compat) { args.pop(); } context = args[3]; // set context to the Node if not specified // ret = cewrapper.on.apply(cewrapper, trimmedArgs); ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null); if (fireNow) { cewrapper.fire(); } return ret; }, /** * Removes an event listener. Supports the signature the event was bound * with, but the preferred way to remove listeners is using the handle * that is returned when using Y.on * * @method detach * * @param {String} type the type of event to remove. * @param {Function} fn the method the event invokes. If fn is * undefined, then all event handlers for the type of event are * removed. * @param {String|HTMLElement|Array|NodeList|EventHandle} el An * event handle, an id, an element reference, or a collection * of ids and/or elements to remove the listener from. * @return {boolean} true if the unbind was successful, false otherwise. * @static */ detach: function(type, fn, el, obj) { var args=Y.Array(arguments, 0, true), compat, l, ok, i, id, ce; if (args[args.length-1] === COMPAT_ARG) { compat = true; // args.pop(); } if (type && type.detach) { return type.detach(); } // The el argument can be a string if (typeof el == "string") { // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) { el = Y.DOM.byId(el); } else { el = Y.Selector.query(el); l = el.length; if (l < 1) { el = null; } else if (l == 1) { el = el[0]; } } // return Event.detach.apply(Event, args); } if (!el) { return false; } if (el.detach) { args.splice(2, 1); return el.detach.apply(el, args); // The el argument can be an array of elements or element ids. } else if (shouldIterate(el)) { ok = true; for (i=0, l=el.length; i<l; ++i) { args[2] = el[i]; ok = ( Y.Event.detach.apply(Y.Event, args) && ok ); } return ok; } if (!type || !fn || !fn.call) { return Event.purgeElement(el, false, type); } id = 'event:' + Y.stamp(el) + type; ce = _wrappers[id]; if (ce) { return ce.detach(fn); } else { return false; } }, /** * Finds the event in the window object, the caller's arguments, or * in the arguments of another method in the callstack. This is * executed automatically for events registered through the event * manager, so the implementer should not normally need to execute * this function at all. * @method getEvent * @param {Event} e the event parameter from the handler * @param {HTMLElement} el the element the listener was attached to * @return {Event} the event * @static */ getEvent: function(e, el, noFacade) { var ev = e || win.event; return (noFacade) ? ev : new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]); }, /** * Generates an unique ID for the element if it does not already * have one. * @method generateId * @param el the element to create the id for * @return {string} the resulting id of the element * @static */ generateId: function(el) { return Y.DOM.generateID(el); }, /** * We want to be able to use getElementsByTagName as a collection * to attach a group of events to. Unfortunately, different * browsers return different types of collections. This function * tests to determine if the object is array-like. It will also * fail if the object is an array, but is empty. * @method _isValidCollection * @param o the object to test * @return {boolean} true if the object is array-like and populated * @deprecated was not meant to be used directly * @static * @private */ _isValidCollection: shouldIterate, /** * hook up any deferred listeners * @method _load * @static * @private */ _load: function(e) { if (!_loadComplete) { _loadComplete = true; // Just in case DOMReady did not go off for some reason // E._ready(); if (Y.fire) { Y.fire(EVENT_READY); } // Available elements may not have been detected before the // window load event fires. Try to find them now so that the // the user is more likely to get the onAvailable notifications // before the window load notification Event._poll(); } }, /** * Polling function that runs before the onload event fires, * attempting to attach to DOM Nodes as soon as they are * available * @method _poll * @static * @private */ _poll: function() { if (Event.locked) { return; } if (Y.UA.ie && !YUI.Env.DOMReady) { // Hold off if DOMReady has not fired and check current // readyState to protect against the IE operation aborted // issue. Event.startInterval(); return; } Event.locked = true; // keep trying until after the page is loaded. We need to // check the page load state prior to trying to bind the // elements so that we can be certain all elements have been // tested appropriately var i, len, item, el, notAvail, executeItem, tryAgain = !_loadComplete; if (!tryAgain) { tryAgain = (_retryCount > 0); } // onAvailable notAvail = []; executeItem = function (el, item) { var context, ov = item.override; try { if (item.compat) { if (item.override) { if (ov === true) { context = item.obj; } else { context = ov; } } else { context = el; } item.fn.call(context, item.obj); } else { context = item.obj || Y.one(el); item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []); } } catch (e) { } }; // onAvailable for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { executeItem(el, item); _avail[i] = null; } else { notAvail.push(item); } } } // onContentReady for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready // @todo should we test parentNode.nextSibling? if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) { executeItem(el, item); _avail[i] = null; } } else { notAvail.push(item); } } } _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1; if (tryAgain) { // we may need to strip the nulled out items here Event.startInterval(); } else { clearInterval(Event._interval); Event._interval = null; } Event.locked = false; return; }, /** * Removes all listeners attached to the given element via addListener. * Optionally, the node's children can also be purged. * Optionally, you can specify a specific type of event to remove. * @method purgeElement * @param {HTMLElement} el the element to purge * @param {boolean} recurse recursively purge this element's children * as well. Use with caution. * @param {string} type optional type of listener to purge. If * left out, all listeners will be removed * @static */ purgeElement: function(el, recurse, type) { // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el, var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el, lis = Event.getListeners(oEl, type), i, len, children, child; if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl); i = 0; len = children.length; for (; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child); } } } if (lis) { for (i = 0, len = lis.length; i < len; ++i) { lis[i].detachAll(); } } }, /** * Removes all object references and the DOM proxy subscription for * a given event for a DOM node. * * @method _clean * @param wrapper {CustomEvent} Custom event proxy for the DOM * subscription * @private * @static * @since 3.4.0 */ _clean: function (wrapper) { var key = wrapper.key, domkey = wrapper.domkey; remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture); delete _wrappers[key]; delete Y._yuievt.events[key]; if (_el_events[domkey]) { delete _el_events[domkey][key]; if (!Y.Object.size(_el_events[domkey])) { delete _el_events[domkey]; } } }, /** * Returns all listeners attached to the given element via addListener. * Optionally, you can specify a specific type of event to return. * @method getListeners * @param el {HTMLElement|string} the element or element id to inspect * @param type {string} optional type of listener to return. If * left out, all listeners will be returned * @return {CustomEvent} the custom event wrapper for the DOM event(s) * @static */ getListeners: function(el, type) { var ek = Y.stamp(el, true), evts = _el_events[ek], results=[] , key = (type) ? 'event:' + ek + type : null, adapters = _eventenv.plugins; if (!evts) { return null; } if (key) { // look for synthetic events if (adapters[type] && adapters[type].eventDef) { key += '_synth'; } if (evts[key]) { results.push(evts[key]); } // get native events as well key += 'native'; if (evts[key]) { results.push(evts[key]); } } else { Y.each(evts, function(v, k) { results.push(v); }); } return (results.length) ? results : null; }, /** * Removes all listeners registered by pe.event. Called * automatically during the unload event. * @method _unload * @static * @private */ _unload: function(e) { Y.each(_wrappers, function(v, k) { if (v.type == 'unload') { v.fire(e); } v.detachAll(); }); remove(win, "unload", onUnload); }, /** * Adds a DOM event directly without the caching, cleanup, context adj, etc * * @method nativeAdd * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeAdd: add, /** * Basic remove listener * * @method nativeRemove * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeRemove: remove }; }(); Y.Event = Event; if (config.injected || YUI.Env.windowLoaded) { onLoad(); } else { add(win, "load", onLoad); } // Process onAvailable/onContentReady items when when the DOM is ready in IE if (Y.UA.ie) { Y.on(EVENT_READY, Event._poll); } add(win, "unload", onUnload); Event.Custom = Y.CustomEvent; Event.Subscriber = Y.Subscriber; Event.Target = Y.EventTarget; Event.Handle = Y.EventHandle; Event.Facade = Y.EventFacade; Event._poll(); })(); /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * Executes the callback as soon as the specified element * is detected in the DOM. This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event available * @param type {string} 'available' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.available = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onAvailable.call(Y.Event, id, fn, o, a); } }; /** * Executes the callback as soon as the specified element * is detected in the DOM with a nextSibling property * (indicating that the element's children are available). * This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event contentready * @param type {string} 'contentready' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.contentready = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onContentReady.call(Y.Event, id, fn, o, a); } }; }, '@VERSION@' ,{requires:['event-custom-base']}); YUI.add('pluginhost-base', function(Y) { /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost */ /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost-base */ /** * <p> * An augmentable class, which provides the augmented class with the ability to host plugins. * It adds <a href="#method_plug">plug</a> and <a href="#method_unplug">unplug</a> methods to the augmented class, which can * be used to add or remove plugins from instances of the class. * </p> * * <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using * the "plugins" property. Supported values for the "plugins" property are those defined by the <a href="#method_plug">plug</a> method. * * For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host): * <xmp> * var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:"header"}}]}); * </xmp> * </p> * <p> * Plug.Host's protected <a href="#method_initPlugins">_initPlugins</a> and <a href="#method_destroyPlugins">_destroyPlugins</a> * methods should be invoked by the host class at the appropriate point in the host's lifecyle. * </p> * * @class Plugin.Host */ var L = Y.Lang; function PluginHost() { this._plugins = {}; } PluginHost.prototype = { /** * Adds a plugin to the host object. This will instantiate the * plugin and attach it to the configured namespace on the host object. * * @method plug * @chainable * @param P {Function | Object |Array} Accepts the plugin class, or an * object with a "fn" property specifying the plugin class and * a "cfg" property specifying the configuration for the Plugin. * <p> * Additionally an Array can also be passed in, with the above function or * object values, allowing the user to add multiple plugins in a single call. * </p> * @param config (Optional) If the first argument is the plugin class, the second argument * can be the configuration for the plugin. * @return {Base} A reference to the host object */ plug: function(Plugin, config) { var i, ln, ns; if (L.isArray(Plugin)) { for (i = 0, ln = Plugin.length; i < ln; i++) { this.plug(Plugin[i]); } } else { if (Plugin && !L.isFunction(Plugin)) { config = Plugin.cfg; Plugin = Plugin.fn; } // Plugin should be fn by now if (Plugin && Plugin.NS) { ns = Plugin.NS; config = config || {}; config.host = this; if (this.hasPlugin(ns)) { // Update config this[ns].setAttrs(config); } else { // Create new instance this[ns] = new Plugin(config); this._plugins[ns] = Plugin; } } } return this; }, /** * Removes a plugin from the host object. This will destroy the * plugin instance and delete the namepsace from the host object. * * @method unplug * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided, * all registered plugins are unplugged. * @return {Base} A reference to the host object * @chainable */ unplug: function(plugin) { var ns = plugin, plugins = this._plugins; if (plugin) { if (L.isFunction(plugin)) { ns = plugin.NS; if (ns && (!plugins[ns] || plugins[ns] !== plugin)) { ns = null; } } if (ns) { if (this[ns]) { this[ns].destroy(); delete this[ns]; } if (plugins[ns]) { delete plugins[ns]; } } } else { for (ns in this._plugins) { if (this._plugins.hasOwnProperty(ns)) { this.unplug(ns); } } } return this; }, /** * Determines if a plugin has plugged into this host. * * @method hasPlugin * @param {String} ns The plugin's namespace * @return {boolean} returns true, if the plugin has been plugged into this host, false otherwise. */ hasPlugin : function(ns) { return (this._plugins[ns] && this[ns]); }, /** * Initializes static plugins registered on the host (using the * Base.plug static method) and any plugins passed to the * instance through the "plugins" configuration property. * * @method _initPlugins * @param {Config} config The configuration object with property name/value pairs. * @private */ _initPlugins: function(config) { this._plugins = this._plugins || {}; if (this._initConfigPlugins) { this._initConfigPlugins(config); } }, /** * Unplugs and destroys all plugins on the host * @method _destroyPlugins * @private */ _destroyPlugins: function() { this.unplug(); } }; Y.namespace("Plugin").Host = PluginHost; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('pluginhost-config', function(Y) { /** * Adds pluginhost constructor configuration and static configuration support * @submodule pluginhost-config */ var PluginHost = Y.Plugin.Host, L = Y.Lang; /** * A protected initialization method, used by the host class to initialize * plugin configurations passed the constructor, through the config object. * * Host objects should invoke this method at the appropriate time in their * construction lifecycle. * * @method _initConfigPlugins * @param {Object} config The configuration object passed to the constructor * @protected * @for Plugin.Host */ PluginHost.prototype._initConfigPlugins = function(config) { // Class Configuration var classes = (this._getClasses) ? this._getClasses() : [this.constructor], plug = [], unplug = {}, constructor, i, classPlug, classUnplug, pluginClassName; // TODO: Room for optimization. Can we apply statically/unplug in same pass? for (i = classes.length - 1; i >= 0; i--) { constructor = classes[i]; classUnplug = constructor._UNPLUG; if (classUnplug) { // subclasses over-write Y.mix(unplug, classUnplug, true); } classPlug = constructor._PLUG; if (classPlug) { // subclasses over-write Y.mix(plug, classPlug, true); } } for (pluginClassName in plug) { if (plug.hasOwnProperty(pluginClassName)) { if (!unplug[pluginClassName]) { this.plug(plug[pluginClassName]); } } } // User Configuration if (config && config.plugins) { this.plug(config.plugins); } }; /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of the class by default). * * @method plug * @static * * @param {Function} hostClass The host class on which to register the plugins * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin * @for Plugin.Host */ PluginHost.plug = function(hostClass, plugin, config) { // Cannot plug into Base, since Plugins derive from Base [ will cause infinite recurrsion ] var p, i, l, name; if (hostClass !== Y.Base) { hostClass._PLUG = hostClass._PLUG || {}; if (!L.isArray(plugin)) { if (config) { plugin = {fn:plugin, cfg:config}; } plugin = [plugin]; } for (i = 0, l = plugin.length; i < l;i++) { p = plugin[i]; name = p.NAME || p.fn.NAME; hostClass._PLUG[name] = p; } } }; /** * Unregisters any class level plugins which have been registered by the host class, or any * other class in the hierarchy. * * @method unplug * @static * * @param {Function} hostClass The host class from which to unregister the plugins * @param {Function | Array} plugin The plugin class, or an array of plugin classes * @for Plugin.Host */ PluginHost.unplug = function(hostClass, plugin) { var p, i, l, name; if (hostClass !== Y.Base) { hostClass._UNPLUG = hostClass._UNPLUG || {}; if (!L.isArray(plugin)) { plugin = [plugin]; } for (i = 0, l = plugin.length; i < l; i++) { p = plugin[i]; name = p.NAME; if (!hostClass._PLUG[name]) { hostClass._UNPLUG[name] = p; } else { delete hostClass._PLUG[name]; } } } }; }, '@VERSION@' ,{requires:['pluginhost-base']}); YUI.add('event-delegate', function(Y) { /** * Adds event delegation support to the library. * * @module event * @submodule event-delegate */ var toArray = Y.Array, YLang = Y.Lang, isString = YLang.isString, isObject = YLang.isObject, isArray = YLang.isArray, selectorTest = Y.Selector.test, detachCategories = Y.Env.evt.handles; /** * <p>Sets up event delegation on a container element. The delegated event * will use a supplied selector or filtering function to test if the event * references at least one node that should trigger the subscription * callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {String|node} the element that is the delegation container * @param spec {string|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @static * @for Event */ function delegate(type, fn, el, filter) { var args = toArray(arguments, 0, true), query = isString(el) ? el : null, typeBits, synth, container, categories, cat, i, len, handles, handle; // Support Y.delegate({ click: fnA, key: fnB }, el, filter, ...); // and Y.delegate(['click', 'key'], fn, el, filter, ...); if (isObject(type)) { handles = []; if (isArray(type)) { for (i = 0, len = type.length; i < len; ++i) { args[0] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } else { // Y.delegate({'click', fn}, el, filter) => // Y.delegate('click', fn, el, filter) args.unshift(null); // one arg becomes two; need to make space for (i in type) { if (type.hasOwnProperty(i)) { args[0] = i; args[1] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } } return new Y.EventHandle(handles); } typeBits = type.split(/\|/); if (typeBits.length > 1) { cat = typeBits.shift(); args[0] = type = typeBits.shift(); } synth = Y.Node.DOM_EVENTS[type]; if (isObject(synth) && synth.delegate) { handle = synth.delegate.apply(synth, arguments); } if (!handle) { if (!type || !fn || !el || !filter) { return; } container = (query) ? Y.Selector.query(query, null, true) : el; if (!container && isString(el)) { handle = Y.on('available', function () { Y.mix(handle, Y.delegate.apply(Y, args), true); }, el); } if (!handle && container) { args.splice(2, 2, container); // remove the filter handle = Y.Event._attach(args, { facade: false }); handle.sub.filter = filter; handle.sub._notify = delegate.notifySub; } } if (handle && cat) { categories = detachCategories[cat] || (detachCategories[cat] = {}); categories = categories[type] || (categories[type] = []); categories.push(handle); } return handle; } /** Overrides the <code>_notify</code> method on the normal DOM subscription to inject the filtering logic and only proceed in the case of a match. This method is hosted as a private property of the `delegate` method (e.g. `Y.delegate.notifySub`) @method notifySub @param thisObj {Object} default 'this' object for the callback @param args {Array} arguments passed to the event's <code>fire()</code> @param ce {CustomEvent} the custom event managing the DOM subscriptions for the subscribed event on the subscribing node. @return {Boolean} false if the event was stopped @private @static @since 3.2.0 **/ delegate.notifySub = function (thisObj, args, ce) { // Preserve args for other subscribers args = args.slice(); if (this.args) { args.push.apply(args, this.args); } // Only notify subs if the event occurred on a targeted element var currentTarget = delegate._applyFilter(this.filter, args, ce), //container = e.currentTarget, e, i, len, ret; if (currentTarget) { // Support multiple matches up the the container subtree currentTarget = toArray(currentTarget); // The second arg is the currentTarget, but we'll be reusing this // facade, replacing the currentTarget for each use, so it doesn't // matter what element we seed it with. e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce); e.container = Y.one(ce.el); for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) { e.currentTarget = Y.one(currentTarget[i]); ret = this.fn.apply(this.context || e.currentTarget, args); if (ret === false) { // stop further notifications break; } } return ret; } }; /** Compiles a selector string into a filter function to identify whether Nodes along the parent axis of an event's target should trigger event notification. This function is memoized, so previously compiled filter functions are returned if the same selector string is provided. This function may be useful when defining synthetic events for delegate handling. Hosted as a property of the `delegate` method (e.g. `Y.delegate.compileFilter`). @method compileFilter @param selector {String} the selector string to base the filtration on @return {Function} @since 3.2.0 @static **/ delegate.compileFilter = Y.cached(function (selector) { return function (target, e) { return selectorTest(target._node, selector, e.currentTarget._node); }; }); /** Walks up the parent axis of an event's target, and tests each element against a supplied filter function. If any Nodes, including the container, satisfy the filter, the delegated callback will be triggered for each. Hosted as a protected property of the `delegate` method (e.g. `Y.delegate._applyFilter`). @method _applyFilter @param filter {Function} boolean function to test for inclusion in event notification @param args {Array} the arguments that would be passed to subscribers @param ce {CustomEvent} the DOM event wrapper @return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter @protected **/ delegate._applyFilter = function (filter, args, ce) { var e = args[0], container = ce.el, // facadeless events in IE, have no e.currentTarget target = e.target || e.srcElement, match = [], isContainer = false; // Resolve text nodes to their containing element if (target.nodeType === 3) { target = target.parentNode; } // passing target as the first arg rather than leaving well enough alone // making 'this' in the filter function refer to the target. This is to // support bound filter functions. args.unshift(target); if (isString(filter)) { while (target) { isContainer = (target === container); if (selectorTest(target, filter, (isContainer ?null: container))) { match.push(target); } if (isContainer) { break; } target = target.parentNode; } } else { // filter functions are implementer code and should receive wrappers args[0] = Y.one(target); args[1] = new Y.DOMEventFacade(e, container, ce); while (target) { // filter(target, e, extra args...) - this === target if (filter.apply(args[0], args)) { match.push(target); } if (target === container) { break; } target = target.parentNode; args[0] = Y.one(target); } args[1] = e; // restore the raw DOM event } if (match.length <= 1) { match = match[0]; // single match or undefined } // remove the target args.shift(); return match; }; /** * Sets up event delegation on a container element. The delegated event * will use a supplied filter to test if the callback should be executed. * This filter can be either a selector string or a function that returns * a Node to use as the currentTarget for the event. * * The event object for the delegated event is supplied to the callback * function. It is modified slightly in order to support all properties * that may be needed for event delegation. 'currentTarget' is set to * the element that matched the selector string filter or the Node returned * from the filter function. 'container' is set to the element that the * listener is delegated from (this normally would be the 'currentTarget'). * * Filter functions will be called with the arguments that would be passed to * the callback function, including the event object as the first parameter. * The function should return false (or a falsey value) if the success criteria * aren't met, and the Node to use as the event's currentTarget and 'this' * object if they are. * * @method delegate * @param type {string} the event type to delegate * @param fn {function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {string|node} the element that is the delegation container * @param filter {string|function} a selector that must match the target of the * event or a function that returns a Node or false. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.delegate = Y.Event.delegate = delegate; }, '@VERSION@' ,{requires:['node-base']}); YUI.add('node-event-delegate', function(Y) { /** * Functionality to make the node a delegated event container * @module node * @submodule node-event-delegate */ /** * <p>Sets up a delegation listener for an event occurring inside the Node. * The delegated event will be verified against a supplied selector or * filtering function to test if the event references at least one node that * should trigger the subscription callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param spec {String|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context {Object} optional argument that specifies what 'this' refers to. * @param args* {any} 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for Node */ Y.Node.prototype.delegate = function(type) { var args = Y.Array(arguments, 0, true), index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2; args.splice(index, 0, this._node); return Y.delegate.apply(Y, args); }; }, '@VERSION@' ,{requires:['node-base', 'event-delegate']}); YUI.add('node-pluginhost', function(Y) { /** * @module node * @submodule node-pluginhost */ /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of Node by default). * * @method plug * @static * @for Node * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin */ Y.Node.plug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.plug.apply(Y.Base, args); return Y.Node; }; /** * Unregisters any class level plugins which have been registered by the Node * * @method unplug * @static * * @param {Function | Array} plugin The plugin class, or an array of plugin classes */ Y.Node.unplug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.unplug.apply(Y.Base, args); return Y.Node; }; Y.mix(Y.Node, Y.Plugin.Host, false, null, 1); // allow batching of plug/unplug via NodeList // doesn't use NodeList.importMethod because we need real Nodes (not tmpNode) Y.NodeList.prototype.plug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.plug.apply(Y.one(node), args); }); }; Y.NodeList.prototype.unplug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.unplug.apply(Y.one(node), args); }); }; }, '@VERSION@' ,{requires:['node-base', 'pluginhost']}); YUI.add('node-screen', function(Y) { /** * Extended Node interface for managing regions and screen positioning. * Adds support for positioning elements and normalizes window size and scroll detection. * @module node * @submodule node-screen */ // these are all "safe" returns, no wrapping required Y.each([ /** * Returns the inner width of the viewport (exludes scrollbar). * @config winWidth * @for Node * @type {Int} */ 'winWidth', /** * Returns the inner height of the viewport (exludes scrollbar). * @config winHeight * @type {Int} */ 'winHeight', /** * Document width * @config winHeight * @type {Int} */ 'docWidth', /** * Document height * @config docHeight * @type {Int} */ 'docHeight', /** * Pixel distance the page has been scrolled horizontally * @config docScrollX * @type {Int} */ 'docScrollX', /** * Pixel distance the page has been scrolled vertically * @config docScrollY * @type {Int} */ 'docScrollY' ], function(name) { Y.Node.ATTRS[name] = { getter: function() { var args = Array.prototype.slice.call(arguments); args.unshift(Y.Node.getDOMNode(this)); return Y.DOM[name].apply(this, args); } }; } ); Y.Node.ATTRS.scrollLeft = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollLeft' in node) { node.scrollLeft = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc } } else { } } }; Y.Node.ATTRS.scrollTop = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollTop' in node) { node.scrollTop = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc } } else { } } }; Y.Node.importMethod(Y.DOM, [ /** * Gets the current position of the node in page coordinates. * @method getXY * @for Node * @return {Array} The XY position of the node */ 'getXY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setXY * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @chainable */ 'setXY', /** * Gets the current position of the node in page coordinates. * @method getX * @return {Int} The X position of the node */ 'getX', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setX * @param {Int} x X value for new position (coordinates are page-based) * @chainable */ 'setX', /** * Gets the current position of the node in page coordinates. * @method getY * @return {Int} The Y position of the node */ 'getY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setY * @param {Int} y Y value for new position (coordinates are page-based) * @chainable */ 'setY', /** * Swaps the XY position of this node with another node. * @method swapXY * @param {Node | HTMLElement} otherNode The node to swap with. * @chainable */ 'swapXY' ]); /** * @module node * @submodule node-screen */ /** * Returns a region object for the node * @config region * @for Node * @type Node */ Y.Node.ATTRS.region = { getter: function() { var node = this.getDOMNode(), region; if (node && !node.tagName) { if (node.nodeType === 9) { // document node = node.documentElement; } } if (Y.DOM.isWindow(node)) { region = Y.DOM.viewportRegion(node); } else { region = Y.DOM.region(node); } return region; } }; /** * Returns a region object for the node's viewport * @config viewportRegion * @type Node */ Y.Node.ATTRS.viewportRegion = { getter: function() { return Y.DOM.viewportRegion(Y.Node.getDOMNode(this)); } }; Y.Node.importMethod(Y.DOM, 'inViewportRegion'); // these need special treatment to extract 2nd node arg /** * Compares the intersection of the node with another node or region * @method intersect * @for Node * @param {Node|Object} node2 The node or region to compare with. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Object} An object representing the intersection of the regions. */ Y.Node.prototype.intersect = function(node2, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.intersect(node1, node2, altRegion); }; /** * Determines whether or not the node is within the giving region. * @method inRegion * @param {Node|Object} node2 The node or region to compare with. * @param {Boolean} all Whether or not all of the node must be in the region. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Object} An object representing the intersection of the regions. */ Y.Node.prototype.inRegion = function(node2, all, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.inRegion(node1, node2, all, altRegion); }; }, '@VERSION@' ,{requires:['node-base', 'dom-screen']}); YUI.add('node-style', function(Y) { (function(Y) { /** * Extended Node interface for managing node styles. * @module node * @submodule node-style */ Y.mix(Y.Node.prototype, { /** * Sets a style property of the node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ setStyle: function(attr, val) { Y.DOM.setStyle(this._node, attr, val); return this; }, /** * Sets multiple style properties on the node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ setStyles: function(hash) { Y.DOM.setStyles(this._node, hash); return this; }, /** * Returns the style's current value. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getStyle * @for Node * @param {String} attr The style attribute to retrieve. * @return {String} The current value of the style property for the element. */ getStyle: function(attr) { return Y.DOM.getStyle(this._node, attr); }, /** * Returns the computed value for the given style property. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {String} The computed value of the style property for the element. */ getComputedStyle: function(attr) { return Y.DOM.getComputedStyle(this._node, attr); } }); /** * Returns an array of values for each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getStyle * @for NodeList * @see Node.getStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The current values of the style property for the element. */ /** * Returns an array of the computed value for each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getComputedStyle * @see Node.getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The computed values for each node. */ /** * Sets a style property on each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyle * @see Node.setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ /** * Sets multiple style properties on each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyles * @see Node.setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ // These are broken out to handle undefined return (avoid false positive for // chainable) Y.NodeList.importMethod(Y.Node.prototype, ['getStyle', 'getComputedStyle', 'setStyle', 'setStyles']); })(Y); }, '@VERSION@' ,{requires:['dom-style', 'node-base']}); 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']}); YUI.add('io-base', function(Y) { /** Base IO functionality. Provides basic XHR transport support. @module io @submodule io-base @for IO **/ var // List of events that comprise the IO event lifecycle. EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'], // Whitelist of used XHR response object properties. XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'], win = Y.config.win, XHR = win.XMLHttpRequest, XDR = win.XDomainRequest, uid = 0; /** The IO class is a utility that brokers HTTP requests through a simplified interface. Specifically, it allows JavaScript to make HTTP requests to a resource without a page reload. The underlying transport for making same-domain requests is the XMLHttpRequest object. IO can also use Flash, if specified as a transport, for cross-domain requests. @class IO @constructor @param {Object} config Object of EventTarget's publish method configurations used to configure IO's events. **/ function IO (config) { var io = this; io._uid = 'io:' + uid++; io._init(config); Y.io._map[io._uid] = io; } IO.prototype = { //-------------------------------------- // Properties //-------------------------------------- /** * A counter that increments for each transaction. * * @property _id * @private * @type {Number} */ _id: 0, /** * Object of IO HTTP headers sent with each transaction. * * @property _headers * @private * @type {Object} */ _headers: { 'X-Requested-With' : 'XMLHttpRequest' }, /** * Object that stores timeout values for any transaction with a defined * "timeout" configuration property. * * @property _timeout * @private * @type {Object} */ _timeout: {}, //-------------------------------------- // Methods //-------------------------------------- _init: function(config) { var io = this, i, len; io.cfg = config || {}; Y.augment(io, Y.EventTarget); for (i = 0, len = EVENTS.length; i < len; ++i) { // Publish IO global events with configurations, if any. // IO global events are set to broadcast by default. // These events use the "io:" namespace. io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config)); // Publish IO transaction events with configurations, if // any. These events use the "io-trn:" namespace. io.publish('io-trn:' + EVENTS[i], config); } }, /** * Method that creates a unique transaction object for each request. * * @method _create * @private * @param {Object} config Configuration object subset to determine if * the transaction is an XDR or file upload, * requiring an alternate transport. * @param {Number} id Transaction id * @return {Object} The transaction object */ _create: function(config, id) { var io = this, transaction = { id : Y.Lang.isNumber(id) ? id : io._id++, uid: io._uid }, xdrConfig = config.xdr, use = xdrConfig && xdrConfig.use, ie = (xdrConfig && xdrConfig.use === 'native' && XDR), transport = io._transport; if (!use) { use = (config.form && config.form.upload) ? 'iframe' : 'xhr'; } switch (use) { case 'native': case 'xhr': transaction.c = ie ? new XDR() : XHR ? new XHR() : new ActiveXObject('Microsoft.XMLHTTP'); if (win && win.FormData && config.data instanceof FormData) { //u = Y.UA.chrome ? transaction.c : transaction.c.upload; transaction.c.upload.onprogress = function (e) { io.progress(transaction, e, config); }; transaction.c.onload = function (e) { io.load(transaction, e, config); }; transaction.c.onerror = function (e) { io.error(transaction, e, config); }; transaction.upload = true; } transaction.transport = ie ? true : false; break; default: transaction.c = (transport && transport[use]) || {}; transaction.transport = true; } return transaction; }, _destroy: function(transaction) { if (win && !transaction.transport) { if (XHR && !transaction.upload) { transaction.c.onreadystatechange = null; } else if (transaction.upload) { transaction.c.upload.onprogress = null; transaction.c.onload = null; transaction.c.onerror = null; } else if (Y.UA.ie && !transaction.e) { // IE, when using XMLHttpRequest as an ActiveX Object, will throw // a "Type Mismatch" error if the event handler is set to "null". transaction.c.abort(); } } transaction = transaction.c = null; }, /** * Method for creating and firing events. * * @method _evt * @private * @param {String} eventName Event to be published. * @param {Object} transaction Transaction object. * @param {Object} config Configuration data subset for event subscription. */ _evt: function(eventName, transaction, config) { var io = this, params, args = config['arguments'], emitFacade = io.cfg.emitFacade, globalEvent = "io:" + eventName, trnEvent = "io-trn:" + eventName; if (transaction.e) { transaction.c = { status: 0, statusText: transaction.e }; } // Fire event with parameters or an Event Facade. params = [ emitFacade ? { id: transaction.id, data: transaction.c, cfg: config, 'arguments': args } : transaction.id ]; if (!emitFacade) { if (eventName === EVENTS[0] || eventName === EVENTS[2] && args) { if (args) { params.push(args); } } else { if (transaction.evt) { params.push(transaction.evt); } else { params.push(transaction.c); } if (args) { params.push(args); } } } params.unshift(globalEvent); // Fire global events. io.fire.apply(io, params); // Fire transaction events, if receivers are defined. if (config.on) { params[0] = trnEvent; io.once(trnEvent, config.on[eventName], config.context || Y); io.fire.apply(io, params); } }, /** * Fires event "io:start" and creates, fires a transaction-specific * start event, if `config.on.start` is defined. * * @method start * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ start: function(transaction, config) { /** * Signals the start of an IO request. * @event io:start */ this._evt(EVENTS[0], transaction, config); }, /** * Fires event "io:complete" and creates, fires a * transaction-specific "complete" event, if config.on.complete is * defined. * * @method complete * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ complete: function(transaction, config) { /** * Signals the completion of the request-response phase of a * transaction. Response status and data are accessible, if * available, in this event. * @event io:complete */ this._evt(EVENTS[1], transaction, config); }, /** * Fires event "io:end" and creates, fires a transaction-specific "end" * event, if config.on.end is defined. * * @method end * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ end: function(transaction, config) { /** * Signals the end of the transaction lifecycle. * @event io:end */ this._evt(EVENTS[2], transaction, config); this._destroy(transaction); }, /** * Fires event "io:success" and creates, fires a transaction-specific * "success" event, if config.on.success is defined. * * @method success * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ success: function(transaction, config) { /** * Signals an HTTP response with status in the 2xx range. * Fires after io:complete. * @event io:success */ this._evt(EVENTS[3], transaction, config); this.end(transaction, config); }, /** * Fires event "io:failure" and creates, fires a transaction-specific * "failure" event, if config.on.failure is defined. * * @method failure * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ failure: function(transaction, config) { /** * Signals an HTTP response with status outside of the 2xx range. * Fires after io:complete. * @event io:failure */ this._evt(EVENTS[4], transaction, config); this.end(transaction, config); }, /** * Fires event "io:progress" and creates, fires a transaction-specific * "progress" event -- for XMLHttpRequest file upload -- if * config.on.progress is defined. * * @method progress * @param {Object} transaction Transaction object. * @param {Object} progress event. * @param {Object} config Configuration object for the transaction. */ progress: function(transaction, e, config) { /** * Signals the interactive state during a file upload transaction. * This event fires after io:start and before io:complete. * @event io:progress */ transaction.evt = e; this._evt(EVENTS[5], transaction, config); }, /** * Fires event "io:complete" and creates, fires a transaction-specific * "complete" event -- for XMLHttpRequest file upload -- if * config.on.complete is defined. * * @method load * @param {Object} transaction Transaction object. * @param {Object} load event. * @param {Object} config Configuration object for the transaction. */ load: function (transaction, e, config) { transaction.evt = e.target; this._evt(EVENTS[1], transaction, config); }, /** * Fires event "io:failure" and creates, fires a transaction-specific * "failure" event -- for XMLHttpRequest file upload -- if * config.on.failure is defined. * * @method error * @param {Object} transaction Transaction object. * @param {Object} error event. * @param {Object} config Configuration object for the transaction. */ error: function (transaction, e, config) { transaction.evt = e; this._evt(EVENTS[4], transaction, config); }, /** * Retry an XDR transaction, using the Flash tranport, if the native * transport fails. * * @method _retry * @private * @param {Object} transaction Transaction object. * @param {String} uri Qualified path to transaction resource. * @param {Object} config Configuration object for the transaction. */ _retry: function(transaction, uri, config) { this._destroy(transaction); config.xdr.use = 'flash'; return this.send(uri, config, transaction.id); }, /** * Method that concatenates string data for HTTP GET transactions. * * @method _concat * @private * @param {String} uri URI or root data. * @param {String} data Data to be concatenated onto URI. * @return {String} */ _concat: function(uri, data) { uri += (uri.indexOf('?') === -1 ? '?' : '&') + data; return uri; }, /** * Stores default client headers for all transactions. If a label is * passed with no value argument, the header will be deleted. * * @method setHeader * @param {String} name HTTP header * @param {String} value HTTP header value */ setHeader: function(name, value) { if (value) { this._headers[name] = value; } else { delete this._headers[name]; } }, /** * Method that sets all HTTP headers to be sent in a transaction. * * @method _setHeaders * @private * @param {Object} transaction - XHR instance for the specific transaction. * @param {Object} headers - HTTP headers for the specific transaction, as * defined in the configuration object passed to YUI.io(). */ _setHeaders: function(transaction, headers) { headers = Y.merge(this._headers, headers); Y.Object.each(headers, function(value, name) { if (value !== 'disable') { transaction.setRequestHeader(name, headers[name]); } }); }, /** * Starts timeout count if the configuration object has a defined * timeout property. * * @method _startTimeout * @private * @param {Object} transaction Transaction object generated by _create(). * @param {Object} timeout Timeout in milliseconds. */ _startTimeout: function(transaction, timeout) { var io = this; io._timeout[transaction.id] = win.setTimeout(function() { io._abort(transaction, 'timeout'); }, timeout); }, /** * Clears the timeout interval started by _startTimeout(). * * @method _clearTimeout * @private * @param {Number} id - Transaction id. */ _clearTimeout: function(id) { win.clearTimeout(this._timeout[id]); delete this._timeout[id]; }, /** * Method that determines if a transaction response qualifies as success * or failure, based on the response HTTP status code, and fires the * appropriate success or failure events. * * @method _result * @private * @static * @param {Object} transaction Transaction object generated by _create(). * @param {Object} config Configuration object passed to io(). */ _result: function(transaction, config) { var status; // Firefox will throw an exception if attempting to access // an XHR object's status property, after a request is aborted. try { status = transaction.c.status; } catch(e) { status = 0; } // IE reports HTTP 204 as HTTP 1223. if (status >= 200 && status < 300 || status === 304 || status === 1223) { this.success(transaction, config); } else { this.failure(transaction, config); } }, /** * Event handler bound to onreadystatechange. * * @method _rS * @private * @param {Object} transaction Transaction object generated by _create(). * @param {Object} config Configuration object passed to YUI.io(). */ _rS: function(transaction, config) { var io = this; if (transaction.c.readyState === 4) { if (config.timeout) { io._clearTimeout(transaction.id); } // Yield in the event of request timeout or abort. win.setTimeout(function() { io.complete(transaction, config); io._result(transaction, config); }, 0); } }, /** * Terminates a transaction due to an explicit abort or timeout. * * @method _abort * @private * @param {Object} transaction Transaction object generated by _create(). * @param {String} type Identifies timed out or aborted transaction. */ _abort: function(transaction, type) { if (transaction && transaction.c) { transaction.e = type; transaction.c.abort(); } }, /** * Requests a transaction. `send()` is implemented as `Y.io()`. Each * transaction may include a configuration object. Its properties are: * * <dl> * <dt>method</dt> * <dd>HTTP method verb (e.g., GET or POST). If this property is not * not defined, the default value will be GET.</dd> * * <dt>data</dt> * <dd>This is the name-value string that will be sent as the * transaction data. If the request is HTTP GET, the data become * part of querystring. If HTTP POST, the data are sent in the * message body.</dd> * * <dt>xdr</dt> * <dd>Defines the transport to be used for cross-domain requests. * By setting this property, the transaction will use the specified * transport instead of XMLHttpRequest. The properties of the * transport object are: * <dl> * <dt>use</dt> * <dd>The transport to be used: 'flash' or 'native'</dd> * <dt>dataType</dt> * <dd>Set the value to 'XML' if that is the expected response * content type.</dd> * </dl></dd> * * <dt>form</dt> * <dd>Form serialization configuration object. Its properties are: * <dl> * <dt>id</dt> * <dd>Node object or id of HTML form</dd> * <dt>useDisabled</dt> * <dd>`true` to also serialize disabled form field values * (defaults to `false`)</dd> * </dl></dd> * * <dt>on</dt> * <dd>Assigns transaction event subscriptions. Available events are: * <dl> * <dt>start</dt> * <dd>Fires when a request is sent to a resource.</dd> * <dt>complete</dt> * <dd>Fires when the transaction is complete.</dd> * <dt>success</dt> * <dd>Fires when the HTTP response status is within the 2xx * range.</dd> * <dt>failure</dt> * <dd>Fires when the HTTP response status is outside the 2xx * range, if an exception occurs, if the transation is aborted, * or if the transaction exceeds a configured `timeout`.</dd> * <dt>end</dt> * <dd>Fires at the conclusion of the transaction * lifecycle, after `success` or `failure`.</dd> * </dl> * * <p>Callback functions for `start` and `end` receive the id of the * transaction as a first argument. For `complete`, `success`, and * `failure`, callbacks receive the id and the response object * (usually the XMLHttpRequest instance). If the `arguments` * property was included in the configuration object passed to * `Y.io()`, the configured data will be passed to all callbacks as * the last argument.</p> * </dd> * * <dt>sync</dt> * <dd>Pass `true` to make a same-domain transaction synchronous. * <strong>CAVEAT</strong>: This will negatively impact the user * experience. Have a <em>very</em> good reason if you intend to use * this.</dd> * * <dt>context</dt> * <dd>The "`this'" object for all configured event handlers. If a * specific context is needed for individual callbacks, bind the * callback to a context using `Y.bind()`.</dd> * * <dt>headers</dt> * <dd>Object map of transaction headers to send to the server. The * object keys are the header names and the values are the header * values.</dd> * * <dt>timeout</dt> * <dd>Millisecond threshold for the transaction before being * automatically aborted.</dd> * * <dt>arguments</dt> * <dd>User-defined data passed to all registered event handlers. * This value is available as the second argument in the "start" and * "end" event handlers. It is the third argument in the "complete", * "success", and "failure" event handlers. <strong>Be sure to quote * this property name in the transaction configuration as * "arguments" is a reserved word in JavaScript</strong> (e.g. * `Y.io({ ..., "arguments": stuff })`).</dd> * </dl> * * @method send * @public * @param {String} uri Qualified path to transaction resource. * @param {Object} config Configuration object for the transaction. * @param {Number} id Transaction id, if already set. * @return {Object} */ send: function(uri, config, id) { var transaction, method, i, len, sync, data, io = this, u = uri, response = {}; config = config ? Y.Object(config) : {}; transaction = io._create(config, id); method = config.method ? config.method.toUpperCase() : 'GET'; sync = config.sync; data = config.data; // Serialize an map object into a key-value string using // querystring-stringify-simple. if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) { data = Y.QueryString.stringify(data); } if (config.form) { if (config.form.upload) { // This is a file upload transaction, calling // upload() in io-upload-iframe. return io.upload(transaction, uri, config); } else { // Serialize HTML form data into a key-value string. data = io._serialize(config.form, data); } } if (data) { switch (method) { case 'GET': case 'HEAD': case 'DELETE': u = io._concat(u, data); data = ''; break; case 'POST': case 'PUT': // If Content-Type is defined in the configuration object, or // or as a default header, it will be used instead of // 'application/x-www-form-urlencoded; charset=UTF-8' config.headers = Y.merge({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, config.headers); break; } } if (transaction.transport) { // Cross-domain request or custom transport configured. return io.xdr(u, transaction, config); } if (!sync && !transaction.upload) { transaction.c.onreadystatechange = function() { io._rS(transaction, config); }; } try { // Determine if request is to be set as // synchronous or asynchronous. transaction.c.open(method, u, !sync, config.username || null, config.password || null); io._setHeaders(transaction.c, config.headers || {}); io.start(transaction, config); // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft. if (config.xdr && config.xdr.credentials) { if (!Y.UA.ie) { transaction.c.withCredentials = true; } } // Using "null" with HTTP POST will result in a request // with no Content-Length header defined. transaction.c.send(data); if (sync) { // Create a response object for synchronous transactions, // mixing id and arguments properties with the xhr // properties whitelist. for (i = 0, len = XHR_PROPS.length; i < len; ++i) { response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]]; } response.getAllResponseHeaders = function() { return transaction.c.getAllResponseHeaders(); }; response.getResponseHeader = function(name) { return transaction.c.getResponseHeader(name); }; io.complete(transaction, config); io._result(transaction, config); return response; } } catch(e) { if (transaction.transport) { // This exception is usually thrown by browsers // that do not support XMLHttpRequest Level 2. // Retry the request with the XDR transport set // to 'flash'. If the Flash transport is not // initialized or available, the transaction // will resolve to a transport error. return io._retry(transaction, uri, config); } else { io.complete(transaction, config); io._result(transaction, config); } } // If config.timeout is defined, and the request is standard XHR, // initialize timeout polling. if (config.timeout) { io._startTimeout(transaction, config.timeout); } return { id: transaction.id, abort: function() { return transaction.c ? io._abort(transaction, 'abort') : false; }, isInProgress: function() { return transaction.c ? (transaction.c.readyState % 4) : false; }, io: io }; } }; /** Method for initiating an ajax call. The first argument is the url end point for the call. The second argument is an object to configure the transaction and attach event subscriptions. The configuration object supports the following properties: <dl> <dt>method</dt> <dd>HTTP method verb (e.g., GET or POST). If this property is not not defined, the default value will be GET.</dd> <dt>data</dt> <dd>This is the name-value string that will be sent as the transaction data. If the request is HTTP GET, the data become part of querystring. If HTTP POST, the data are sent in the message body.</dd> <dt>xdr</dt> <dd>Defines the transport to be used for cross-domain requests. By setting this property, the transaction will use the specified transport instead of XMLHttpRequest. The properties of the transport object are: <dl> <dt>use</dt> <dd>The transport to be used: 'flash' or 'native'</dd> <dt>dataType</dt> <dd>Set the value to 'XML' if that is the expected response content type.</dd> </dl></dd> <dt>form</dt> <dd>Form serialization configuration object. Its properties are: <dl> <dt>id</dt> <dd>Node object or id of HTML form</dd> <dt>useDisabled</dt> <dd>`true` to also serialize disabled form field values (defaults to `false`)</dd> </dl></dd> <dt>on</dt> <dd>Assigns transaction event subscriptions. Available events are: <dl> <dt>start</dt> <dd>Fires when a request is sent to a resource.</dd> <dt>complete</dt> <dd>Fires when the transaction is complete.</dd> <dt>success</dt> <dd>Fires when the HTTP response status is within the 2xx range.</dd> <dt>failure</dt> <dd>Fires when the HTTP response status is outside the 2xx range, if an exception occurs, if the transation is aborted, or if the transaction exceeds a configured `timeout`.</dd> <dt>end</dt> <dd>Fires at the conclusion of the transaction lifecycle, after `success` or `failure`.</dd> </dl> <p>Callback functions for `start` and `end` receive the id of the transaction as a first argument. For `complete`, `success`, and `failure`, callbacks receive the id and the response object (usually the XMLHttpRequest instance). If the `arguments` property was included in the configuration object passed to `Y.io()`, the configured data will be passed to all callbacks as the last argument.</p> </dd> <dt>sync</dt> <dd>Pass `true` to make a same-domain transaction synchronous. <strong>CAVEAT</strong>: This will negatively impact the user experience. Have a <em>very</em> good reason if you intend to use this.</dd> <dt>context</dt> <dd>The "`this'" object for all configured event handlers. If a specific context is needed for individual callbacks, bind the callback to a context using `Y.bind()`.</dd> <dt>headers</dt> <dd>Object map of transaction headers to send to the server. The object keys are the header names and the values are the header values.</dd> <dt>timeout</dt> <dd>Millisecond threshold for the transaction before being automatically aborted.</dd> <dt>arguments</dt> <dd>User-defined data passed to all registered event handlers. This value is available as the second argument in the "start" and "end" event handlers. It is the third argument in the "complete", "success", and "failure" event handlers. <strong>Be sure to quote this property name in the transaction configuration as "arguments" is a reserved word in JavaScript</strong> (e.g. `Y.io({ ..., "arguments": stuff })`).</dd> </dl> @method io @static @param {String} url qualified path to transaction resource. @param {Object} config configuration object for the transaction. @return {Object} @for YUI **/ Y.io = function(url, config) { // Calling IO through the static interface will use and reuse // an instance of IO. var transaction = Y.io._map['io:0'] || new IO(); return transaction.send.apply(transaction, [url, config]); }; /** Method for setting and deleting IO HTTP headers to be sent with every request. Hosted as a property on the `io` function (e.g. `Y.io.header`). @method header @param {String} name HTTP header @param {String} value HTTP header value @static @for IO **/ Y.io.header = function(name, value) { // Calling IO through the static interface will use and reuse // an instance of IO. var transaction = Y.io._map['io:0'] || new IO(); transaction.setHeader(name, value); }; Y.IO = IO; // Map of all IO instances created. Y.io._map = {}; }, '@VERSION@' ,{requires:['event-custom-base', 'querystring-stringify-simple']}); YUI.add('json-parse', function(Y) { /** * <p>The JSON module adds support for serializing JavaScript objects into * JSON strings and parsing JavaScript objects from strings in JSON format.</p> * * <p>The JSON namespace is added to your YUI instance including static methods * Y.JSON.parse(..) and Y.JSON.stringify(..).</p> * * <p>The functionality and method signatures follow the ECMAScript 5 * specification. In browsers with native JSON support, the native * implementation is used.</p> * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p> * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to * include either of the submodules individually if you don't need the * complementary functionality, or include the rollup for both.</p> * * @module json * @main json * @class JSON * @static */ /** * Provides Y.JSON.parse method to accept JSON strings and return native * JavaScript objects. * * @module json * @submodule json-parse * @for JSON * @static */ // All internals kept private for security reasons function fromGlobal(ref) { return (Y.config.win || this || {})[ref]; } /** * Alias to native browser implementation of the JSON object if available. * * @property Native * @type {Object} * @private */ var _JSON = fromGlobal('JSON'), Native = (Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON), useNative = !!Native, /** * Replace certain Unicode characters that JavaScript may handle incorrectly * during eval--either by deleting them or treating them as line * endings--with escape sequences. * IMPORTANT NOTE: This regex will be used to modify the input if a match is * found. * * @property _UNICODE_EXCEPTIONS * @type {RegExp} * @private */ _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, /** * First step in the safety evaluation. Regex used to replace all escape * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). * * @property _ESCAPES * @type {RegExp} * @private */ _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, /** * Second step in the safety evaluation. Regex used to replace all simple * values with ']' characters. * * @property _VALUES * @type {RegExp} * @private */ _VALUES = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, /** * Third step in the safety evaluation. Regex used to remove all open * square brackets following a colon, comma, or at the beginning of the * string. * * @property _BRACKETS * @type {RegExp} * @private */ _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g, /** * Final step in the safety evaluation. Regex used to test the string left * after all previous replacements for invalid characters. * * @property _UNSAFE * @type {RegExp} * @private */ _UNSAFE = /[^\],:{}\s]/, /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval. * * @method escapeException * @param c {String} Unicode character * @return {String} the \unnnn escapement of the character * @private */ _escapeException = function (c) { return '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); }, /** * Traverses nested objects, applying a reviver function to each (key,value) * from the scope if the key:value's containing object. The value returned * from the function will replace the original value in the key:value pair. * If the value returned is undefined, the key will be omitted from the * returned object. * * @method _revive * @param data {MIXED} Any JavaScript data * @param reviver {Function} filter or mutation function * @return {MIXED} The results of the filtered data * @private */ _revive = function (data, reviver) { var walk = function (o,key) { var k,v,value = o[key]; if (value && typeof value === 'object') { for (k in value) { if (value.hasOwnProperty(k)) { v = walk(value, k); if (v === undefined) { delete value[k]; } else { value[k] = v; } } } } return reviver.call(o,key,value); }; return typeof reviver === 'function' ? walk({'':data},'') : data; }, /** * Parse a JSON string, returning the native JavaScript representation. * * @param s {string} JSON string data * @param reviver {function} (optional) function(k,v) passed each key value * pair of object literals, allowing pruning or altering values * @return {MIXED} the native JavaScript representation of the JSON string * @throws SyntaxError * @method parse * @static */ // JavaScript implementation in lieu of native browser support. Based on // the json2.js library from http://json.org _parse = function (s,reviver) { // Replace certain Unicode characters that are otherwise handled // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException); // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']'). replace(_BRACKETS,''))) { // Eval the text into a JavaScript data structure, apply any // reviver function, and return return _revive( eval('(' + s + ')'), reviver ); } throw new SyntaxError('JSON.parse'); }; Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += ''; } return Native && Y.JSON.useNativeParse ? Native.parse(s,reviver) : _parse(s,reviver); }; function workingNative( k, v ) { return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2 if ( Native ) { try { useNative = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) { useNative = false; } } /** * Leverage native JSON parse if the browser has a native implementation. * In general, this is a good idea. See the Known Issues section in the * JSON user guide for caveats. The default value is true for browsers with * native JSON support. * * @property useNativeParse * @type Boolean * @default true * @static */ Y.JSON.useNativeParse = useNative; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('transition', function(Y) { /** * Provides the transition method for Node. * Transition has no API of its own, but adds the transition method to Node. * * @module transition * @requires node-style */ var CAMEL_VENDOR_PREFIX = '', VENDOR_PREFIX = '', DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition', TRANSITION_CAMEL = 'Transition', TRANSITION_PROPERTY_CAMEL, TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END, TRANSFORM_CAMEL, EMPTY_OBJ = {}, VENDORS = [ 'Webkit', 'Moz' ], VENDOR_TRANSITION_END = { Webkit: 'webkitTransitionEnd' }, /** * A class for constructing transition instances. * Adds the "transition" method to Node. * @class Transition * @constructor */ Transition = function() { this.init.apply(this, arguments); }; Transition._toCamel = function(property) { property = property.replace(/-([a-z])/gi, function(m0, m1) { return m1.toUpperCase(); }); return property; }; Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2; if (m3) { str += '-' + m3.toLowerCase(); } return str; }); return property; }; Transition.SHOW_TRANSITION = 'fadeIn'; Transition.HIDE_TRANSITION = 'fadeOut'; Transition.useNative = false; Y.Array.each(VENDORS, function(val) { // then vendor specific var property = val + TRANSITION_CAMEL; if (property in DOCUMENT[DOCUMENT_ELEMENT].style) { CAMEL_VENDOR_PREFIX = val; VENDOR_PREFIX = Transition._toHyphen(val) + '-'; Transition.useNative = true; Transition.supported = true; // TODO: remove Transition._VENDOR_PREFIX = val; } }); TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL; TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty'; TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property'; TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration'; TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function'; TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; TRANSITION_END = 'transitionend'; ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend'; TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform'; Transition.fx = {}; Transition.toggles = {}; Transition._hasEnd = {}; Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; Transition.DEFAULT_EASING = 'ease'; Transition.DEFAULT_DURATION = 0.5; Transition.DEFAULT_DELAY = 0; Transition._nodeAttrs = {}; Transition.prototype = { constructor: Transition, init: function(node, config) { var anim = this; anim._node = node; if (!anim._running && config) { anim._config = config; node._transition = anim; // cache for reuse anim._duration = ('duration' in config) ? config.duration: anim.constructor.DEFAULT_DURATION; anim._delay = ('delay' in config) ? config.delay: anim.constructor.DEFAULT_DELAY; anim._easing = config.easing || anim.constructor.DEFAULT_EASING; anim._count = 0; // track number of animated properties anim._running = false; } return anim; }, addProperty: function(prop, config) { var anim = this, node = this._node, uid = Y.stamp(node), nodeInstance = Y.one(node), attrs = Transition._nodeAttrs[uid], computed, compareVal, dur, attr, val; if (!attrs) { attrs = Transition._nodeAttrs[uid] = {}; } attr = attrs[prop]; // might just be a value if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) { val = config; config = EMPTY_OBJ; } if (typeof val === 'function') { val = val.call(nodeInstance, nodeInstance); } if (attr && attr.transition) { // take control if another transition owns this property if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition } } anim._count++; // properties per transition // make 0 async and fire events dur = ((typeof config.duration != 'undefined') ? config.duration : anim._duration) || 0.0001; attrs[prop] = { value: val, duration: dur, delay: (typeof config.delay != 'undefined') ? config.delay : anim._delay, easing: config.easing || anim._easing, transition: anim }; // native end event doesnt fire when setting to same value // supplementing with timer // val may be a string or number (height: 0, etc), but computedStyle is always string computed = Y.DOM.getComputedStyle(node, prop); compareVal = (typeof val === 'string') ? computed : parseFloat(computed); if (Transition.useNative && compareVal === val) { setTimeout(function() { anim._onNativeEnd.call(node, { propertyName: prop, elapsedTime: dur }); }, dur * 1000); } }, removeProperty: function(prop) { var anim = this, attrs = Transition._nodeAttrs[Y.stamp(anim._node)]; if (attrs && attrs[prop]) { delete attrs[prop]; anim._count--; } }, initAttrs: function(config) { var attr, node = this._node; if (config.transform && !config[TRANSFORM_CAMEL]) { config[TRANSFORM_CAMEL] = config.transform; delete config.transform; // TODO: copy } for (attr in config) { if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') { Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr)); } } } }, /** * Starts or an animation. * @method run * @chainable * @private */ run: function(callback) { var anim = this, node = anim._node, config = anim._config, data = { type: 'transition:start', config: config }; if (!anim._running) { anim._running = true; if (config.on && config.on.start) { config.on.start.call(Y.one(node), data); } anim.initAttrs(anim._config); anim._callback = callback; anim._start(); } return anim; }, _start: function() { this._runNative(); }, _prepDur: function(dur) { dur = parseFloat(dur); return dur + 's'; }, _runNative: function(time) { var anim = this, node = anim._node, uid = Y.stamp(node), style = node.style, computed = node.ownerDocument.defaultView.getComputedStyle(node), attrs = Transition._nodeAttrs[uid], cssText = '', cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)], transitionText = TRANSITION_PROPERTY + ': ', duration = TRANSITION_DURATION + ': ', easing = TRANSITION_TIMING_FUNCTION + ': ', delay = TRANSITION_DELAY + ': ', hyphy, attr, name; // preserve existing transitions if (cssTransition !== 'all') { transitionText += cssTransition + ','; duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ','; easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ','; delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ','; } // run transitions mapped to this instance for (name in attrs) { hyphy = Transition._toHyphen(name); attr = attrs[name]; if ((attr = attrs[name]) && attr.transition === anim) { if (name in node.style) { // only native styles allowed duration += anim._prepDur(attr.duration) + ','; delay += anim._prepDur(attr.delay) + ','; easing += (attr.easing) + ','; transitionText += hyphy + ','; cssText += hyphy + ': ' + attr.value + '; '; } else { this.removeProperty(name); } } } transitionText = transitionText.replace(/,$/, ';'); duration = duration.replace(/,$/, ';'); easing = easing.replace(/,$/, ';'); delay = delay.replace(/,$/, ';'); // only one native end event per node if (!Transition._hasEnd[uid]) { node.addEventListener(TRANSITION_END, anim._onNativeEnd, ''); Transition._hasEnd[uid] = true; } style.cssText += transitionText + duration + easing + delay + cssText; }, _end: function(elapsed) { var anim = this, node = anim._node, callback = anim._callback, config = anim._config, data = { type: 'transition:end', config: config, elapsedTime: elapsed }, nodeInstance = Y.one(node); anim._running = false; anim._callback = null; if (node) { if (config.on && config.on.end) { setTimeout(function() { // IE: allow previous update to finish config.on.end.call(nodeInstance, data); // nested to ensure proper fire order if (callback) { callback.call(nodeInstance, data); } }, 1); } else if (callback) { setTimeout(function() { // IE: allow previous update to finish callback.call(nodeInstance, data); }, 1); } } }, _endNative: function(name) { var node = this._node, value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)]; name = Transition._toHyphen(name); if (typeof value === 'string') { value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ','); value = value.replace(/^,|,$/, ''); node.style[TRANSITION_CAMEL] = value; } }, _onNativeEnd: function(e) { var node = this, uid = Y.stamp(node), event = e,//e._event, name = Transition._toCamel(event.propertyName), elapsed = event.elapsedTime, attrs = Transition._nodeAttrs[uid], attr = attrs[name], anim = (attr) ? attr.transition : null, data, config; if (anim) { anim.removeProperty(name); anim._endNative(name); config = anim._config[name]; data = { type: 'propertyEnd', propertyName: name, elapsedTime: elapsed, config: config }; if (config && config.on && config.on.end) { config.on.end.call(Y.one(node), data); } if (anim._count <= 0) { // after propertyEnd fires anim._end(elapsed); node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style } } }, destroy: function() { var anim = this, node = anim._node; if (node) { node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false); anim._node = null; } } }; Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) { var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop; if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config; config = null; } fxConfig = Transition.fx[name]; if (config && typeof config !== 'boolean') { config = Y.clone(config); for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) { config[prop] = fxConfig[prop]; } } } } else { config = fxConfig; } } else { // name is a config, config is a callback or undefined callback = config; config = name; } if (anim && !anim._running) { anim.init(this, config); } else { anim = new Transition(this._node, config); } anim.run(callback); return this; }; Y.Node.prototype.show = function(name, config, callback) { this._show(); // show prior to transition if (name && Y.Transition) { if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = Transition.SHOW_TRANSITION; } this.transition(name, config, callback); } return this; }; var _wrapCallBack = function(anim, fn, callback) { return function() { if (fn) { fn.call(anim); } if (callback) { callback.apply(anim._node, arguments); } }; }; Y.Node.prototype.hide = function(name, config, callback) { if (name && Y.Transition) { if (typeof config === 'function') { callback = config; config = null; } callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = Transition.HIDE_TRANSITION; } this.transition(name, config, callback); } else { this._hide(); } return this; }; /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for NodeList * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. The callback fires * once per item in the NodeList. * @chainable */ Y.NodeList.prototype.transition = function(config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).transition(config, callback); } return this; }; Y.Node.prototype.toggleView = function(name, on, callback) { this._toggles = this._toggles || []; callback = arguments[arguments.length - 1]; if (typeof name == 'boolean') { // no transition, just toggle on = name; name = null; } name = name || Y.Transition.DEFAULT_TOGGLE; if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle on = ! this._toggles[name]; } on = (on) ? 1 : 0; if (on) { this._show(); } else { callback = _wrapCallBack(this, this._hide, callback); } this._toggles[name] = on; this.transition(Y.Transition.toggles[name][on], callback); return this; }; Y.NodeList.prototype.toggleView = function(name, on, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).toggleView(name, on, callback); } return this; }; Y.mix(Transition.fx, { fadeOut: { opacity: 0, duration: 0.5, easing: 'ease-out' }, fadeIn: { opacity: 1, duration: 0.5, easing: 'ease-in' }, sizeOut: { height: 0, width: 0, duration: 0.75, easing: 'ease-out' }, sizeIn: { height: function(node) { return node.get('scrollHeight') + 'px'; }, width: function(node) { return node.get('scrollWidth') + 'px'; }, duration: 0.5, easing: 'ease-in', on: { start: function() { var overflow = this.getStyle('overflow'); if (overflow !== 'hidden') { // enable scrollHeight/Width this.setStyle('overflow', 'hidden'); this._transitionOverflow = overflow; } }, end: function() { if (this._transitionOverflow) { // revert overridden value this.setStyle('overflow', this._transitionOverflow); delete this._transitionOverflow; } } } } }); Y.mix(Transition.toggles, { size: ['sizeOut', 'sizeIn'], fade: ['fadeOut', 'fadeIn'] }); Transition.DEFAULT_TOGGLE = 'fade'; }, '@VERSION@' ,{requires:['node-style']}); YUI.add('selector-css2', function(Y) { /** * The selector module provides helper methods allowing CSS2 Selectors to be used with DOM elements. * @module dom * @submodule selector-css2 * @for Selector */ /* * Provides helper methods for collecting and filtering DOM elements. */ var PARENT_NODE = 'parentNode', TAG_NAME = 'tagName', ATTRIBUTES = 'attributes', COMBINATOR = 'combinator', PSEUDOS = 'pseudos', Selector = Y.Selector, SelectorCSS2 = { _reRegExpTokens: /([\^\$\?\[\]\*\+\-\.\(\)\|\\])/, SORT_RESULTS: true, _re: { attr: /(\[[^\]]*\])/g, esc: /\\[:\[\]\(\)#\.\'\>+~"]/gi, pseudos: /(\([^\)]*\))/g }, // TODO: better detection, document specific _isXML: (function() { var isXML = (Y.config.doc.createElement('div').tagName !== 'DIV'); return isXML; }()), /** * Mapping of shorthand tokens to corresponding attribute selector * @property shorthand * @type object */ shorthand: { '\\#(-?[_a-z0-9]+[-\\w\\uE000]*)': '[id=$1]', '\\.(-?[_a-z]+[-\\w\\uE000]*)': '[className~=$1]' }, /** * List of operators and corresponding boolean functions. * These functions are passed the attribute and the current node's value of the attribute. * @property operators * @type object */ operators: { '': function(node, attr) { return Y.DOM.getAttribute(node, attr) !== ''; }, // Just test for existence of attribute '~=': '(?:^|\\s+){val}(?:\\s+|$)', // space-delimited '|=': '^{val}-?' // optional hyphen-delimited }, pseudos: { 'first-child': function(node) { return Y.DOM._children(node[PARENT_NODE])[0] === node; } }, _bruteQuery: function(selector, root, firstOnly) { var ret = [], nodes = [], tokens = Selector._tokenize(selector), token = tokens[tokens.length - 1], rootDoc = Y.DOM._getDoc(root), child, id, className, tagName; if (token) { // prefilter nodes id = token.id; className = token.className; tagName = token.tagName || '*'; if (root.getElementsByTagName) { // non-IE lacks DOM api on doc frags // try ID first, unless no root.all && root not in document // (root.all works off document, but not getElementById) if (id && (root.all || (root.nodeType === 9 || Y.DOM.inDoc(root)))) { nodes = Y.DOM.allById(id, root); // try className } else if (className) { nodes = root.getElementsByClassName(className); } else { // default to tagName nodes = root.getElementsByTagName(tagName); } } else { // brute getElementsByTagName() child = root.firstChild; while (child) { // only collect HTMLElements // match tag to supplement missing getElementsByTagName if (child.tagName && (tagName === '*' || child.tagName === tagName)) { nodes.push(child); } child = child.nextSibling || child.firstChild; } } if (nodes.length) { ret = Selector._filterNodes(nodes, tokens, firstOnly); } } return ret; }, _filterNodes: function(nodes, tokens, firstOnly) { var i = 0, j, len = tokens.length, n = len - 1, result = [], node = nodes[0], tmpNode = node, getters = Y.Selector.getters, operator, combinator, token, path, pass, value, tests, test; for (i = 0; (tmpNode = node = nodes[i++]);) { n = len - 1; path = null; testLoop: while (tmpNode && tmpNode.tagName) { token = tokens[n]; tests = token.tests; j = tests.length; if (j && !pass) { while ((test = tests[--j])) { operator = test[1]; if (getters[test[0]]) { value = getters[test[0]](tmpNode, test[0]); } else { value = tmpNode[test[0]]; if (test[0] === 'tagName' && !Selector._isXML) { value = value.toUpperCase(); } // use getAttribute for non-standard attributes if (value === undefined && tmpNode.getAttribute) { value = tmpNode.getAttribute(test[0]); } } if ((operator === '=' && value !== test[2]) || // fast path for equality (typeof operator !== 'string' && // protect against String.test monkey-patch (Moo) operator.test && !operator.test(value)) || // regex test (!operator.test && // protect against RegExp as function (webkit) typeof operator === 'function' && !operator(tmpNode, test[0], test[2]))) { // function test // skip non element nodes or non-matching tags if ((tmpNode = tmpNode[path])) { while (tmpNode && (!tmpNode.tagName || (token.tagName && token.tagName !== tmpNode.tagName)) ) { tmpNode = tmpNode[path]; } } continue testLoop; } } } n--; // move to next token // now that we've passed the test, move up the tree by combinator if (!pass && (combinator = token.combinator)) { path = combinator.axis; tmpNode = tmpNode[path]; // skip non element nodes while (tmpNode && !tmpNode.tagName) { tmpNode = tmpNode[path]; } if (combinator.direct) { // one pass only path = null; } } else { // success if we made it this far result.push(node); if (firstOnly) { return result; } break; } } } node = tmpNode = null; return result; }, combinators: { ' ': { axis: 'parentNode' }, '>': { axis: 'parentNode', direct: true }, '+': { axis: 'previousSibling', direct: true } }, _parsers: [ { name: ATTRIBUTES, re: /^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i, fn: function(match, token) { var operator = match[2] || '', operators = Selector.operators, escVal = (match[3]) ? match[3].replace(/\\/g, '') : '', test; // add prefiltering for ID and CLASS if ((match[1] === 'id' && operator === '=') || (match[1] === 'className' && Y.config.doc.documentElement.getElementsByClassName && (operator === '~=' || operator === '='))) { token.prefilter = match[1]; match[3] = escVal; // escape all but ID for prefilter, which may run through QSA (via Dom.allById) token[match[1]] = (match[1] === 'id') ? match[3] : escVal; } // add tests if (operator in operators) { test = operators[operator]; if (typeof test === 'string') { match[3] = escVal.replace(Selector._reRegExpTokens, '\\$1'); test = new RegExp(test.replace('{val}', match[3])); } match[2] = test; } if (!token.last || token.prefilter !== match[1]) { return match.slice(1); } } }, { name: TAG_NAME, re: /^((?:-?[_a-z]+[\w-]*)|\*)/i, fn: function(match, token) { var tag = match[1]; if (!Selector._isXML) { tag = tag.toUpperCase(); } token.tagName = tag; if (tag !== '*' && (!token.last || token.prefilter)) { return [TAG_NAME, '=', tag]; } if (!token.prefilter) { token.prefilter = 'tagName'; } } }, { name: COMBINATOR, re: /^\s*([>+~]|\s)\s*/, fn: function(match, token) { } }, { name: PSEUDOS, re: /^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i, fn: function(match, token) { var test = Selector[PSEUDOS][match[1]]; if (test) { // reorder match array and unescape special chars for tests if (match[2]) { match[2] = match[2].replace(/\\/g, ''); } return [match[2], test]; } else { // selector token not supported (possibly missing CSS3 module) return false; } } } ], _getToken: function(token) { return { tagName: null, id: null, className: null, attributes: {}, combinator: null, tests: [] }; }, /* Break selector into token units per simple selector. Combinator is attached to the previous token. */ _tokenize: function(selector) { selector = selector || ''; selector = Selector._replaceShorthand(Y.Lang.trim(selector)); var token = Selector._getToken(), // one token per simple selector (left selector holds combinator) query = selector, // original query for debug report tokens = [], // array of tokens found = false, // whether or not any matches were found this pass match, // the regex match test, i, parser; /* Search for selector patterns, store, and strip them from the selector string until no patterns match (invalid selector) or we run out of chars. Multiple attributes and pseudos are allowed, in any order. for example: 'form:first-child[type=button]:not(button)[lang|=en]' */ outer: do { found = false; // reset after full pass for (i = 0; (parser = Selector._parsers[i++]);) { if ( (match = parser.re.exec(selector)) ) { // note assignment if (parser.name !== COMBINATOR ) { token.selector = selector; } selector = selector.replace(match[0], ''); // strip current match from selector if (!selector.length) { token.last = true; } if (Selector._attrFilters[match[1]]) { // convert class to className, etc. match[1] = Selector._attrFilters[match[1]]; } test = parser.fn(match, token); if (test === false) { // selector not supported found = false; break outer; } else if (test) { token.tests.push(test); } if (!selector.length || parser.name === COMBINATOR) { tokens.push(token); token = Selector._getToken(token); if (parser.name === COMBINATOR) { token.combinator = Y.Selector.combinators[match[1]]; } } found = true; } } } while (found && selector.length); if (!found || selector.length) { // not fully parsed tokens = []; } return tokens; }, _replaceShorthand: function(selector) { var shorthand = Selector.shorthand, esc = selector.match(Selector._re.esc), // pull escaped colon, brackets, etc. attrs, pseudos, re, i, len; if (esc) { selector = selector.replace(Selector._re.esc, '\uE000'); } attrs = selector.match(Selector._re.attr); pseudos = selector.match(Selector._re.pseudos); if (attrs) { selector = selector.replace(Selector._re.attr, '\uE001'); } if (pseudos) { selector = selector.replace(Selector._re.pseudos, '\uE002'); } for (re in shorthand) { if (shorthand.hasOwnProperty(re)) { selector = selector.replace(new RegExp(re, 'gi'), shorthand[re]); } } if (attrs) { for (i = 0, len = attrs.length; i < len; ++i) { selector = selector.replace(/\uE001/, attrs[i]); } } if (pseudos) { for (i = 0, len = pseudos.length; i < len; ++i) { selector = selector.replace(/\uE002/, pseudos[i]); } } selector = selector.replace(/\[/g, '\uE003'); selector = selector.replace(/\]/g, '\uE004'); selector = selector.replace(/\(/g, '\uE005'); selector = selector.replace(/\)/g, '\uE006'); if (esc) { for (i = 0, len = esc.length; i < len; ++i) { selector = selector.replace('\uE000', esc[i]); } } return selector; }, _attrFilters: { 'class': 'className', 'for': 'htmlFor' }, getters: { href: function(node, attr) { return Y.DOM.getAttribute(node, attr); } } }; Y.mix(Y.Selector, SelectorCSS2, true); Y.Selector.getters.src = Y.Selector.getters.rel = Y.Selector.getters.href; // IE wants class with native queries if (Y.Selector.useNative && Y.config.doc.querySelector) { Y.Selector.shorthand['\\.(-?[_a-z]+[-\\w]*)'] = '[class~=$1]'; } }, '@VERSION@' ,{requires:['selector-native']}); YUI.add('selector-css3', function(Y) { /** * The selector css3 module provides support for css3 selectors. * @module dom * @submodule selector-css3 * @for Selector */ /* an+b = get every _a_th node starting at the _b_th 0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element 1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n") an+0 = get every _a_th element, "0" may be omitted */ Y.Selector._reNth = /^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/; Y.Selector._getNth = function(node, expr, tag, reverse) { Y.Selector._reNth.test(expr); var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_) n = RegExp.$2, // "n" oddeven = RegExp.$3, // "odd" or "even" b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_ result = [], siblings = Y.DOM._children(node.parentNode, tag), op; if (oddeven) { a = 2; // always every other op = '+'; n = 'n'; b = (oddeven === 'odd') ? 1 : 0; } else if ( isNaN(a) ) { a = (n) ? 1 : 0; // start from the first or no repeat } if (a === 0) { // just the first if (reverse) { b = siblings.length - b + 1; } if (siblings[b - 1] === node) { return true; } else { return false; } } else if (a < 0) { reverse = !!reverse; a = Math.abs(a); } if (!reverse) { for (var i = b - 1, len = siblings.length; i < len; i += a) { if ( i >= 0 && siblings[i] === node ) { return true; } } } else { for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) { if ( i < len && siblings[i] === node ) { return true; } } } return false; }; Y.mix(Y.Selector.pseudos, { 'root': function(node) { return node === node.ownerDocument.documentElement; }, 'nth-child': function(node, expr) { return Y.Selector._getNth(node, expr); }, 'nth-last-child': function(node, expr) { return Y.Selector._getNth(node, expr, null, true); }, 'nth-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName); }, 'nth-last-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName, true); }, 'last-child': function(node) { var children = Y.DOM._children(node.parentNode); return children[children.length - 1] === node; }, 'first-of-type': function(node) { return Y.DOM._children(node.parentNode, node.tagName)[0] === node; }, 'last-of-type': function(node) { var children = Y.DOM._children(node.parentNode, node.tagName); return children[children.length - 1] === node; }, 'only-child': function(node) { var children = Y.DOM._children(node.parentNode); return children.length === 1 && children[0] === node; }, 'only-of-type': function(node) { var children = Y.DOM._children(node.parentNode, node.tagName); return children.length === 1 && children[0] === node; }, 'empty': function(node) { return node.childNodes.length === 0; }, 'not': function(node, expr) { return !Y.Selector.test(node, expr); }, 'contains': function(node, expr) { var text = node.innerText || node.textContent || ''; return text.indexOf(expr) > -1; }, 'checked': function(node) { return (node.checked === true || node.selected === true); }, enabled: function(node) { return (node.disabled !== undefined && !node.disabled); }, disabled: function(node) { return (node.disabled); } }); Y.mix(Y.Selector.operators, { '^=': '^{val}', // Match starts with value '$=': '{val}$', // Match ends with value '*=': '{val}' // Match contains value as substring }); Y.Selector.combinators['~'] = { axis: 'previousSibling' }; }, '@VERSION@' ,{requires:['selector-native', 'selector-css2']}); YUI.add('yui-log', function(Y) { /** * Provides console log capability and exposes a custom event for * console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-log */ var INSTANCE = Y, LOGEVENT = 'yui:log', UNDEFINED = 'undefined', LEVELS = { debug: 1, info: 1, warn: 1, error: 1 }; /** * If the 'debug' config is true, a 'yui:log' event will be * dispatched, which the Console widget and anything else * can consume. If the 'useBrowserConsole' config is true, it will * write to the browser console if available. YUI-specific log * messages will only be present in the -debug versions of the * JS files. The build system is supposed to remove log statements * from the raw and minified versions of the files. * * @method log * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.log = function(msg, cat, src, silent) { var bail, excl, incl, m, f, Y = INSTANCE, c = Y.config, publisher = (Y.fire) ? Y : YUI.Env.globalEvents; // suppress log message if the config is off or the event stack // or the event call stack contains a consumer of the yui:log event if (c.debug) { // apply source filters if (src) { excl = c.logExclude; incl = c.logInclude; if (incl && !(src in incl)) { bail = 1; } else if (incl && (src in incl)) { bail = !incl[src]; } else if (excl && (src in excl)) { bail = excl[src]; } } if (!bail) { if (c.useBrowserConsole) { m = (src) ? src + ': ' + msg : msg; if (Y.Lang.isFunction(c.logFn)) { c.logFn.call(Y, msg, cat, src); } else if (typeof console != UNDEFINED && console.log) { f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log'; console[f](m); } else if (typeof opera != UNDEFINED) { opera.postError(m); } } if (publisher && !silent) { if (publisher == Y && (!publisher.getEvent(LOGEVENT))) { publisher.publish(LOGEVENT, { broadcast: 2 }); } publisher.fire(LOGEVENT, { msg: msg, cat: cat, src: src }); } } } return Y; }; /** * Write a system message. This message will be preserved in the * minified and raw versions of the YUI files, unlike log statements. * @method message * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.message = function() { return INSTANCE.log.apply(INSTANCE, arguments); }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('dump', function(Y) { /** * 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']}); YUI.add('transition-timer', function(Y) { /* * The Transition Utility provides an API for creating advanced transitions. * @module transition */ /* * Provides the base Transition class, for animating numeric properties. * * @module transition * @submodule transition-timer */ var Transition = Y.Transition; Y.mix(Transition.prototype, { _start: function() { if (Transition.useNative) { this._runNative(); } else { this._runTimer(); } }, _runTimer: function() { var anim = this; anim._initAttrs(); Transition._running[Y.stamp(anim)] = anim; anim._startTime = new Date(); Transition._startTimer(); }, _endTimer: function() { var anim = this; delete Transition._running[Y.stamp(anim)]; anim._startTime = null; }, _runFrame: function() { var t = new Date() - this._startTime; this._runAttrs(t); }, _runAttrs: function(time) { var anim = this, node = anim._node, config = anim._config, uid = Y.stamp(node), attrs = Transition._nodeAttrs[uid], customAttr = Transition.behaviors, done = false, allDone = false, data, name, attribute, setter, elapsed, delay, d, t, i; for (name in attrs) { if ((attribute = attrs[name]) && attribute.transition === anim) { d = attribute.duration; delay = attribute.delay; elapsed = (time - delay) / 1000; t = time; data = { type: 'propertyEnd', propertyName: name, config: config, elapsedTime: elapsed }; setter = (i in customAttr && 'set' in customAttr[i]) ? customAttr[i].set : Transition.DEFAULT_SETTER; done = (t >= d); if (t > d) { t = d; } if (!delay || time >= delay) { setter(anim, name, attribute.from, attribute.to, t - delay, d - delay, attribute.easing, attribute.unit); if (done) { delete attrs[name]; anim._count--; if (config[name] && config[name].on && config[name].on.end) { config[name].on.end.call(Y.one(node), data); } //node.fire('transition:propertyEnd', data); if (!allDone && anim._count <= 0) { allDone = true; anim._end(elapsed); anim._endTimer(); } } } } } }, _initAttrs: function() { var anim = this, customAttr = Transition.behaviors, uid = Y.stamp(anim._node), attrs = Transition._nodeAttrs[uid], attribute, duration, delay, easing, val, name, mTo, mFrom, unit, begin, end; for (name in attrs) { if ((attribute = attrs[name]) && attribute.transition === anim) { duration = attribute.duration * 1000; delay = attribute.delay * 1000; easing = attribute.easing; val = attribute.value; // only allow supported properties if (name in anim._node.style || name in Y.DOM.CUSTOM_STYLES) { begin = (name in customAttr && 'get' in customAttr[name]) ? customAttr[name].get(anim, name) : Transition.DEFAULT_GETTER(anim, name); mFrom = Transition.RE_UNITS.exec(begin); mTo = Transition.RE_UNITS.exec(val); begin = mFrom ? mFrom[1] : begin; end = mTo ? mTo[1] : val; unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units if (!unit && Transition.RE_DEFAULT_UNIT.test(name)) { unit = Transition.DEFAULT_UNIT; } if (typeof easing === 'string') { if (easing.indexOf('cubic-bezier') > -1) { easing = easing.substring(13, easing.length - 1).split(','); } else if (Transition.easings[easing]) { easing = Transition.easings[easing]; } } attribute.from = Number(begin); attribute.to = Number(end); attribute.unit = unit; attribute.easing = easing; attribute.duration = duration + delay; attribute.delay = delay; } else { delete attrs[name]; anim._count--; } } } }, destroy: function() { this.detachAll(); this._node = null; } }, true); Y.mix(Y.Transition, { _runtimeAttrs: {}, /* * Regex of properties that should use the default unit. * * @property RE_DEFAULT_UNIT * @static */ RE_DEFAULT_UNIT: /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i, /* * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. * * @property DEFAULT_UNIT * @static */ DEFAULT_UNIT: 'px', /* * Time in milliseconds passed to setInterval for frame processing * * @property intervalTime * @default 20 * @static */ intervalTime: 20, /* * Bucket for custom getters and setters * * @property behaviors * @static */ behaviors: { left: { get: function(anim, attr) { return Y.DOM._getAttrOffset(anim._node, attr); } } }, /* * The default setter to use when setting object properties. * * @property DEFAULT_SETTER * @static */ DEFAULT_SETTER: function(anim, att, from, to, elapsed, duration, fn, unit) { from = Number(from); to = Number(to); var node = anim._node, val = Transition.cubicBezier(fn, elapsed / duration); val = from + val[0] * (to - from); if (node) { if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { unit = unit || ''; Y.DOM.setStyle(node, att, val + unit); } } else { anim._end(); } }, /* * The default getter to use when getting object properties. * * @property DEFAULT_GETTER * @static */ DEFAULT_GETTER: function(anim, att) { var node = anim._node, val = ''; if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { val = Y.DOM.getComputedStyle(node, att); } return val; }, _startTimer: function() { if (!Transition._timer) { Transition._timer = setInterval(Transition._runFrame, Transition.intervalTime); } }, _stopTimer: function() { clearInterval(Transition._timer); Transition._timer = null; }, /* * Called per Interval to handle each animation frame. * @method _runFrame * @private * @static */ _runFrame: function() { var done = true, anim; for (anim in Transition._running) { if (Transition._running[anim]._runFrame) { done = false; Transition._running[anim]._runFrame(); } } if (done) { Transition._stopTimer(); } }, cubicBezier: function(p, t) { var x0 = 0, y0 = 0, x1 = p[0], y1 = p[1], x2 = p[2], y2 = p[3], x3 = 1, y3 = 0, A = x3 - 3 * x2 + 3 * x1 - x0, B = 3 * x2 - 6 * x1 + 3 * x0, C = 3 * x1 - 3 * x0, D = x0, E = y3 - 3 * y2 + 3 * y1 - y0, F = 3 * y2 - 6 * y1 + 3 * y0, G = 3 * y1 - 3 * y0, H = y0, x = (((A*t) + B)*t + C)*t + D, y = (((E*t) + F)*t + G)*t + H; return [x, y]; }, easings: { ease: [0.25, 0, 1, 0.25], linear: [0, 0, 1, 1], 'ease-in': [0.42, 0, 1, 1], 'ease-out': [0, 0, 0.58, 1], 'ease-in-out': [0.42, 0, 0.58, 1] }, _running: {}, _timer: null, RE_UNITS: /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/ }, true); Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left; Y.Transition = Transition; }, '@VERSION@' ,{requires:['transition']}); YUI.add('simpleyui', function(Y) { // empty }, '@VERSION@' ,{use:['yui','oop','dom','event-custom-base','event-base','pluginhost','node','event-delegate','io-base','json-parse','transition','selector-css3','dom-style-ie','querystring-stringify-simple']}); var Y = YUI().use('*');
app/components/Navbar.js
kongchun/BigData-Web
import React from 'react'; import { Link } from 'react-router'; //import NavbarStore from '../stores/NavbarStore'; //import NavbarActions from '../actions/NavbarActions'; class Navbar extends React.Component { render() { return ( <div className='alert alert-info'> Navbar </div> ); } } export default Navbar;
src/js/components/stories/LoginDialog.js
mosen/micromdm-ui
import React from 'react'; import {createStore, applyMiddleware, compose} from 'redux'; import {combineReducers} from 'redux'; import {reducer as formReducer} from 'redux-form'; import {Provider} from 'react-redux'; import {storiesOf, action} from '@kadira/storybook'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import LoginDialog from '../LoginDialog'; const store = createStore( combineReducers({ form: formReducer }), {} ); storiesOf('LoginDialog', module) .add('default', () => { 'use strict'; return (<MuiThemeProvider> <Provider store={store}> <LoginDialog /> </Provider> </MuiThemeProvider>); });
src/components/form.js
Brogency/react-form-tools
import React from 'react'; import _ from 'lodash'; import defaultStrategy from 'yup-validation-strategy'; import BaobabPropTypes from 'baobab-prop-types'; export default React.createClass({ propTypes: { onSubmit: React.PropTypes.func, onInvalidSubmit: React.PropTypes.func, cursor: BaobabPropTypes.cursor.isRequired, // TODO: concretize type validationSchema: React.PropTypes.any.isRequired, strategy: React.PropTypes.object.isRequired, formStateCursor: BaobabPropTypes.cursor, validateOnFly: React.PropTypes.bool, useHtmlForm: React.PropTypes.bool, className: React.PropTypes.string, style: React.PropTypes.object, }, childContextTypes: { form: React.PropTypes.object, }, contextTypes: { form: React.PropTypes.object, }, subscribers: [], _isHtmlForm: null, getDefaultProps() { return { validateOnFly: true, strategy: defaultStrategy(), onSubmit: _.identity, onInvalidSubmit: _.identity, useHtmlForm: true, }; }, getChildContext() { return { form: { parentForm: this.context.form, isHtmlForm: this.isHtmlForm, cursor: this.props.cursor, isValid: this.isValid, isDirty: this.isDirty, getValidationErrors: this.getValidationErrors, setDirtyState: this.setDirtyState, setPristineState: this.setPristineState, submit: this.submit, validate: this.validate, subscribe: this.subscribe, unsubscribe: this.unsubscribe, }, }; }, getInitialState() { if (this.props.formStateCursor) { return {}; } return { errors: {}, dirtyStates: {}, isFormDirty: false, }; }, componentDidMount() { if (this.props.validateOnFly) { this.props.cursor.on('update', this.onUpdate); } this.validate(); }, componentWillUnmount() { if (this.props.validateOnFly) { this.props.cursor.off('update', this.onUpdate); } }, render() { const props = _.pick(this.props, ['className', 'style']); if (this.isHtmlForm()) { return ( <form noValidate {...props} onSubmit={this.onFormSubmit}> {this.props.children} </form> ); } return ( <div {...props}> {this.props.children} </div> ); }, hasParentHtmlForm() { let parentForm = this.context.form; while (parentForm) { if (parentForm.isHtmlForm()) { return true; } parentForm = parentForm.parentForm; } }, isHtmlForm() { if (this._isHtmlForm === null) { this._isHtmlForm = this.props.useHtmlForm && !this.hasParentHtmlForm(); } return this._isHtmlForm; }, publish(...args) { _.each(this.subscribers, (subscriber) => subscriber(...args)); }, subscribe(subscriber) { this.subscribers = _.concat(this.subscribers, subscriber); // Notify new subscriber about initial form state subscriber(this.getFormState(), null); }, unsubscribe(subscriber) { this.subscribers = _.without(this.subscribers, subscriber); }, onFormStateUpdate(data, previousData) { // Notify subscribers about changed data only if (_.isEqual(data, previousData)) { return; } this.publish(data, previousData); }, setFormState(nextState) { // It is necessary because validation strategy is asynchronous and validation's // callback might be called after component unmount if (!this.isMounted()) { return; } const prevState = this.getFormState(); if (this.props.formStateCursor) { this.props.formStateCursor.once( 'update', ({ data }) => this.onFormStateUpdate(data.currentData, prevState) ); this.props.formStateCursor.merge(nextState); } else { this.setState( nextState, () => this.onFormStateUpdate(this.state, prevState) ); } }, getFormState() { if (this.props.formStateCursor) { return this.props.formStateCursor.get(); } return this.state; }, onFormSubmit(event) { event.preventDefault(); event.stopPropagation(); return this.submit(); }, onUpdate() { this.validate(); }, submit() { return this.validate(this.props.onSubmit, this.props.onInvalidSubmit); }, getFormData() { return this.props.cursor.get(); }, validate(successCallback, errorCallback) { const data = this.getFormData(); const schema = _.isFunction(this.props.validationSchema) ? this.props.validationSchema(data) : this.props.validationSchema; this.props.strategy.validate(data, schema, {}, errors => { this.setFormState({ errors }); if (_.isEmpty(errors)) { if (successCallback) { return successCallback(data); } } else { if (errorCallback) { return errorCallback(errors); } } }); }, getValidationErrors(fieldPath) { const formState = this.getFormState(); if (fieldPath) { return _.get(formState.errors, fieldPath); } return formState.errors; }, isValid(fieldPath) { const formState = this.getFormState(); if (fieldPath) { return !_.get(formState.errors, fieldPath); } return _.isEmpty(formState.errors); }, isDirty(fieldPath) { const formState = this.getFormState(); const isFormDirty = formState.isFormDirty; if (isFormDirty) { return true; } if (!fieldPath) { return !_.isEmpty(formState.dirtyStates); } return !!_.get(formState.dirtyStates, fieldPath); }, resetValidationErrors() { this.setValidationErrors({}); }, setValidationErrors(errors) { this.setFormState({ errors, }); }, setDirtyState(fieldPath) { if (!fieldPath) { this.setFormState({ dirtyStates: {}, isFormDirty: true, }); return; } this.updateDirtyState(fieldPath, true); }, setPristineState(fieldPath) { if (!fieldPath) { this.setFormState({ dirtyStates: {}, isFormDirty: false, }); return; } this.updateDirtyState(fieldPath, false); }, updateDirtyState(fieldPath, dirtyState) { if (this.isDirty(fieldPath) === dirtyState) { return; } let { dirtyStates } = this.getFormState(); dirtyStates = _.cloneDeep(dirtyStates || {}); _.set(dirtyStates, fieldPath, dirtyState); this.setFormState({ dirtyStates, }); }, });
packages/starter-scripts/fixtures/kitchensink/src/features/syntax/ComputedProperties.js
chungchiehlun/create-starter-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; function load(prefix) { return [ { id: 1, [`${prefix} name`]: '1' }, { id: 2, [`${prefix} name`]: '2' }, { id: 3, [`${prefix} name`]: '3' }, { id: 4, [`${prefix} name`]: '4' }, ]; } export default class extends Component { static propTypes = { onReady: PropTypes.func.isRequired, }; constructor(props) { super(props); this.state = { users: [] }; } async componentDidMount() { const users = load('user_'); this.setState({ users }); } componentDidUpdate() { this.props.onReady(); } render() { return ( <div id="feature-computed-properties"> {this.state.users.map(user => ( <div key={user.id}>{user.user_name}</div> ))} </div> ); } }
ajax/libs/onsen/2.0.0-rc.19/js/angular-onsenui.js
BenjaminVanRyseghem/cdnjs
/*! angular-onsenui.js for onsenui - v2.0.0-rc.18 - 2016-09-15 */ /* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. */ // Inspired by base2 and Prototype (function () { var initializing = false, fnTest = /xyz/.test(function () { xyz; }) ? /\b_super\b/ : /.*/; // The base Class implementation (does nothing) this.Class = function () {}; // Create a new Class that inherits from this class Class.extend = function (prop) { var _super = this.prototype; // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? function (name, fn) { return function () { var tmp = this._super; // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; // The method only need to be bound temporarily, so we // remove it when we're done executing var ret = fn.apply(this, arguments); this._super = tmp; return ret; }; }(name, prop[name]) : prop[name]; } // The dummy class constructor function Class() { // All construction is actually done in the init method if (!initializing && this.init) this.init.apply(this, arguments); } // Populate our constructed prototype object Class.prototype = prototype; // Enforce the constructor to be what we expect Class.prototype.constructor = Class; // And make this class extendable Class.extend = arguments.callee; return Class; }; })(); //HEAD (function (app) { try { app = angular.module("templates-main"); } catch (err) { app = angular.module("templates-main", []); } app.run(["$templateCache", function ($templateCache) { "use strict"; $templateCache.put("templates/sliding_menu.tpl", "<div class=\"onsen-sliding-menu__menu ons-sliding-menu-inner\"></div>\n" + "<div class=\"onsen-sliding-menu__main ons-sliding-menu-inner\"></div>\n" + ""); $templateCache.put("templates/split_view.tpl", "<div class=\"onsen-split-view__secondary full-screen ons-split-view-inner\"></div>\n" + "<div class=\"onsen-split-view__main full-screen ons-split-view-inner\"></div>\n" + ""); }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @object ons * @description * [ja]Onsen UIで利用できるグローバルなオブジェクトです。このオブジェクトは、AngularJSのスコープから参照することができます。 [/ja] * [en]A global object that's used in Onsen UI. This object can be reached from the AngularJS scope.[/en] */ (function (ons) { 'use strict'; var module = angular.module('onsen', ['templates-main']); angular.module('onsen.directives', ['onsen']); // for BC // JS Global facade for Onsen UI. initOnsenFacade(); waitOnsenUILoad(); initAngularModule(); initTemplateCache(); function waitOnsenUILoad() { var unlockOnsenUI = ons._readyLock.lock(); module.run(['$compile', '$rootScope', function ($compile, $rootScope) { // for initialization hook. if (document.readyState === 'loading' || document.readyState == 'uninitialized') { window.addEventListener('DOMContentLoaded', function () { document.body.appendChild(document.createElement('ons-dummy-for-init')); }); } else if (document.body) { document.body.appendChild(document.createElement('ons-dummy-for-init')); } else { throw new Error('Invalid initialization state.'); } $rootScope.$on('$ons-ready', unlockOnsenUI); }]); } function initAngularModule() { module.value('$onsGlobal', ons); module.run(['$compile', '$rootScope', '$onsen', '$q', function ($compile, $rootScope, $onsen, $q) { ons._onsenService = $onsen; ons._qService = $q; $rootScope.ons = window.ons; $rootScope.console = window.console; $rootScope.alert = window.alert; ons.$compile = $compile; }]); } function initTemplateCache() { module.run(['$templateCache', function ($templateCache) { var tmp = ons._internal.getTemplateHTMLAsync; ons._internal.getTemplateHTMLAsync = function (page) { var cache = $templateCache.get(page); if (cache) { return Promise.resolve(cache); } else { return tmp(page); } }; }]); } function initOnsenFacade() { ons._onsenService = null; // Object to attach component variables to when using the var="..." attribute. // Can be set to null to avoid polluting the global scope. ons.componentBase = window; /** * @method bootstrap * @signature bootstrap([moduleName, [dependencies]]) * @description * [ja]Onsen UIの初期化を行います。Angular.jsのng-app属性を利用すること無しにOnsen UIを読み込んで初期化してくれます。[/ja] * [en]Initialize Onsen UI. Can be used to load Onsen UI without using the <code>ng-app</code> attribute from AngularJS.[/en] * @param {String} [moduleName] * [en]AngularJS module name.[/en] * [ja]Angular.jsでのモジュール名[/ja] * @param {Array} [dependencies] * [en]List of AngularJS module dependencies.[/en] * [ja]依存するAngular.jsのモジュール名の配列[/ja] * @return {Object} * [en]An AngularJS module object.[/en] * [ja]AngularJSのModuleオブジェクトを表します。[/ja] */ ons.bootstrap = function (name, deps) { if (angular.isArray(name)) { deps = name; name = undefined; } if (!name) { name = 'myOnsenApp'; } deps = ['onsen'].concat(angular.isArray(deps) ? deps : []); var module = angular.module(name, deps); var doc = window.document; if (doc.readyState == 'loading' || doc.readyState == 'uninitialized' || doc.readyState == 'interactive') { doc.addEventListener('DOMContentLoaded', function () { angular.bootstrap(doc.documentElement, [name]); }, false); } else if (doc.documentElement) { angular.bootstrap(doc.documentElement, [name]); } else { throw new Error('Invalid state'); } return module; }; /** * @method findParentComponentUntil * @signature findParentComponentUntil(name, [dom]) * @param {String} name * [en]Name of component, i.e. 'ons-page'.[/en] * [ja]コンポーネント名を指定します。例えばons-pageなどを指定します。[/ja] * @param {Object/jqLite/HTMLElement} [dom] * [en]$event, jqLite or HTMLElement object.[/en] * [ja]$eventオブジェクト、jqLiteオブジェクト、HTMLElementオブジェクトのいずれかを指定できます。[/ja] * @return {Object} * [en]Component object. Will return null if no component was found.[/en] * [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja] * @description * [en]Find parent component object of <code>dom</code> element.[/en] * [ja]指定されたdom引数の親要素をたどってコンポーネントを検索します。[/ja] */ ons.findParentComponentUntil = function (name, dom) { var element; if (dom instanceof HTMLElement) { element = angular.element(dom); } else if (dom instanceof angular.element) { element = dom; } else if (dom.target) { element = angular.element(dom.target); } return element.inheritedData(name); }; /** * @method findComponent * @signature findComponent(selector, [dom]) * @param {String} selector * [en]CSS selector[/en] * [ja]CSSセレクターを指定します。[/ja] * @param {HTMLElement} [dom] * [en]DOM element to search from.[/en] * [ja]検索対象とするDOM要素を指定します。[/ja] * @return {Object/null} * [en]Component object. Will return null if no component was found.[/en] * [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja] * @description * [en]Find component object using CSS selector.[/en] * [ja]CSSセレクタを使ってコンポーネントのオブジェクトを検索します。[/ja] */ ons.findComponent = function (selector, dom) { var target = (dom ? dom : document).querySelector(selector); return target ? angular.element(target).data(target.nodeName.toLowerCase()) || null : null; }; /** * @method compile * @signature compile(dom) * @param {HTMLElement} dom * [en]Element to compile.[/en] * [ja]コンパイルする要素を指定します。[/ja] * @description * [en]Compile Onsen UI components.[/en] * [ja]通常のHTMLの要素をOnsen UIのコンポーネントにコンパイルします。[/ja] */ ons.compile = function (dom) { if (!ons.$compile) { throw new Error('ons.$compile() is not ready. Wait for initialization with ons.ready().'); } if (!(dom instanceof HTMLElement)) { throw new Error('First argument must be an instance of HTMLElement.'); } var scope = angular.element(dom).scope(); if (!scope) { throw new Error('AngularJS Scope is null. Argument DOM element must be attached in DOM document.'); } ons.$compile(dom)(scope); }; ons._getOnsenService = function () { if (!this._onsenService) { throw new Error('$onsen is not loaded, wait for ons.ready().'); } return this._onsenService; }; /** * @param {String} elementName * @param {Function} lastReady * @return {Function} */ ons._waitDiretiveInit = function (elementName, lastReady) { return function (element, callback) { if (angular.element(element).data(elementName)) { lastReady(element, callback); } else { var listen = function listen() { lastReady(element, callback); element.removeEventListener(elementName + ':init', listen, false); }; element.addEventListener(elementName + ':init', listen, false); } }; }; /** * @method createAlertDialog * @signature createAlertDialog(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-alert-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the alert dialog component object.[/en] * [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a alert dialog instance from a template.[/en] * [ja]テンプレートからアラートダイアログのインスタンスを生成します。[/ja] */ ons.createAlertDialog = function (page, options) { options = options || {}; options.link = function (element) { if (options.parentScope) { ons.$compile(angular.element(element))(options.parentScope.$new()); } else { ons.compile(element); } }; return ons._createAlertDialogOriginal(page, options).then(function (alertDialog) { return angular.element(alertDialog).data('ons-alert-dialog'); }); }; /** * @method createDialog * @signature createDialog(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the dialog component object.[/en] * [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a dialog instance from a template.[/en] * [ja]テンプレートからダイアログのインスタンスを生成します。[/ja] */ ons.createDialog = function (page, options) { options = options || {}; options.link = function (element) { if (options.parentScope) { ons.$compile(angular.element(element))(options.parentScope.$new()); } else { ons.compile(element); } }; return ons._createDialogOriginal(page, options).then(function (dialog) { return angular.element(dialog).data('ons-dialog'); }); }; /** * @method createPopover * @signature createPopover(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the popover component object.[/en] * [ja]ポップオーバーのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a popover instance from a template.[/en] * [ja]テンプレートからポップオーバーのインスタンスを生成します。[/ja] */ ons.createPopover = function (page, options) { options = options || {}; options.link = function (element) { if (options.parentScope) { ons.$compile(angular.element(element))(options.parentScope.$new()); } else { ons.compile(element); } }; return ons._createPopoverOriginal(page, options).then(function (popover) { return angular.element(popover).data('ons-popover'); }); }; /** * @param {String} page */ ons.resolveLoadingPlaceholder = function (page) { return ons._resolveLoadingPlaceholderOriginal(page, function (element, done) { ons.compile(element); angular.element(element).scope().$evalAsync(function () { setImmediate(done); }); }); }; ons._setupLoadingPlaceHolders = function () { // Do nothing }; } })(window.ons = window.ons || {}); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('AlertDialogView', ['$onsen', function ($onsen) { var AlertDialogView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide', 'cancel'], function (detail) { if (detail.alertDialog) { detail.alertDialog = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); MicroEvent.mixin(AlertDialogView); $onsen.derivePropertiesFromElement(AlertDialogView, ['disabled', 'cancelable', 'visible', 'onDeviceBackButton']); return AlertDialogView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ angular.module('onsen').value('AlertDialogAnimator', ons._internal.AlertDialogAnimator).value('AndroidAlertDialogAnimator', ons._internal.AndroidAlertDialogAnimator).value('IOSAlertDialogAnimator', ons._internal.IOSAlertDialogAnimator); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ angular.module('onsen').value('AnimationChooser', ons._internal.AnimatorFactory); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('CarouselView', ['$onsen', function ($onsen) { /** * @class CarouselView */ var CarouselView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['setActiveIndex', 'getActiveIndex', 'next', 'prev', 'refresh', 'first', 'last']); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['refresh', 'postchange', 'overscroll'], function (detail) { if (detail.carousel) { detail.carousel = this; } return detail; }.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(CarouselView); $onsen.derivePropertiesFromElement(CarouselView, ['centered', 'overscrollable', 'disabled', 'autoScroll', 'swipeable', 'autoScrollRatio', 'itemCount']); return CarouselView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('DialogView', ['$onsen', function ($onsen) { var DialogView = Class.extend({ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide', 'cancel'], function (detail) { if (detail.dialog) { detail.dialog = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); DialogView.registerAnimator = function (name, Animator) { return window.ons.DialogElement.registerAnimator(name, Animator); }; MicroEvent.mixin(DialogView); $onsen.derivePropertiesFromElement(DialogView, ['disabled', 'cancelable', 'visible', 'onDeviceBackButton']); return DialogView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ angular.module('onsen').value('DialogAnimator', ons._internal.DialogAnimator).value('IOSDialogAnimator', ons._internal.IOSDialogAnimator).value('AndroidDialogAnimator', ons._internal.AndroidDialogAnimator).value('SlideDialogAnimator', ons._internal.SlideDialogAnimator); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('FabView', ['$onsen', function ($onsen) { /** * @class FabView */ var FabView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['show', 'hide', 'toggle']); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); $onsen.derivePropertiesFromElement(FabView, ['disabled', 'visible']); MicroEvent.mixin(FabView); return FabView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('GenericView', ['$onsen', function ($onsen) { var GenericView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs * @param {Object} [options] * @param {Boolean} [options.directiveOnly] * @param {Function} [options.onDestroy] * @param {String} [options.modifierTemplate] */ init: function init(scope, element, attrs, options) { var self = this; options = {}; this._element = element; this._scope = scope; this._attrs = attrs; if (options.directiveOnly) { if (!options.modifierTemplate) { throw new Error('options.modifierTemplate is undefined.'); } $onsen.addModifierMethods(this, options.modifierTemplate, element); } else { $onsen.addModifierMethodsForCustomElements(this, element); } $onsen.cleaner.onDestroy(scope, function () { self._events = undefined; $onsen.removeModifierMethods(self); if (options.onDestroy) { options.onDestroy(self); } $onsen.clearComponent({ scope: scope, attrs: attrs, element: element }); self = element = self._element = self._scope = scope = self._attrs = attrs = options = null; }); } }); /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs * @param {Object} options * @param {String} options.viewKey * @param {Boolean} [options.directiveOnly] * @param {Function} [options.onDestroy] * @param {String} [options.modifierTemplate] */ GenericView.register = function (scope, element, attrs, options) { var view = new GenericView(scope, element, attrs, options); if (!options.viewKey) { throw new Error('options.viewKey is required.'); } $onsen.declareVarAttribute(attrs, view); element.data(options.viewKey, view); var destroy = options.onDestroy || angular.noop; options.onDestroy = function (view) { destroy(view); element.data(options.viewKey, null); }; return view; }; MicroEvent.mixin(GenericView); return GenericView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('LazyRepeatView', ['AngularLazyRepeatDelegate', function (AngularLazyRepeatDelegate) { var LazyRepeatView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs, linker) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._linker = linker; ons._util.updateParentPosition(element[0]); var userDelegate = this._scope.$eval(this._attrs.onsLazyRepeat); var internalDelegate = new AngularLazyRepeatDelegate(userDelegate, element[0], element.scope()); this._provider = new ons._internal.LazyRepeatProvider(element[0].parentNode, internalDelegate); // Expose refresh method to user. userDelegate.refresh = this._provider.refresh.bind(this._provider); element.remove(); // Render when number of items change. this._scope.$watch(internalDelegate.countItems.bind(internalDelegate), this._provider._onChange.bind(this._provider)); this._scope.$on('$destroy', function () { _this._element = _this._scope = _this._attrs = _this._linker = null; }); } }); return LazyRepeatView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('AngularLazyRepeatDelegate', ['$compile', function ($compile) { var directiveAttributes = ['ons-lazy-repeat', 'ons:lazy:repeat', 'ons_lazy_repeat', 'data-ons-lazy-repeat', 'x-ons-lazy-repeat']; var AngularLazyRepeatDelegate = function (_ons$_internal$LazyRe) { babelHelpers.inherits(AngularLazyRepeatDelegate, _ons$_internal$LazyRe); /** * @param {Object} userDelegate * @param {Element} templateElement * @param {Scope} parentScope */ function AngularLazyRepeatDelegate(userDelegate, templateElement, parentScope) { babelHelpers.classCallCheck(this, AngularLazyRepeatDelegate); var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(AngularLazyRepeatDelegate).call(this, userDelegate, templateElement)); _this._parentScope = parentScope; directiveAttributes.forEach(function (attr) { return templateElement.removeAttribute(attr); }); _this._linker = $compile(templateElement ? templateElement.cloneNode(true) : null); return _this; } babelHelpers.createClass(AngularLazyRepeatDelegate, [{ key: 'configureItemScope', value: function configureItemScope(item, scope) { if (this._userDelegate.configureItemScope instanceof Function) { this._userDelegate.configureItemScope(item, scope); } } }, { key: 'destroyItemScope', value: function destroyItemScope(item, element) { if (this._userDelegate.destroyItemScope instanceof Function) { this._userDelegate.destroyItemScope(item, element); } } }, { key: '_usingBinding', value: function _usingBinding() { if (this._userDelegate.configureItemScope) { return true; } if (this._userDelegate.createItemContent) { return false; } throw new Error('`lazy-repeat` delegate object is vague.'); } }, { key: 'loadItemElement', value: function loadItemElement(index, parent, done) { this._prepareItemElement(index, function (_ref) { var element = _ref.element; var scope = _ref.scope; parent.appendChild(element); done({ element: element, scope: scope }); }); } }, { key: '_prepareItemElement', value: function _prepareItemElement(index, done) { var _this2 = this; var scope = this._parentScope.$new(); this._addSpecialProperties(index, scope); if (this._usingBinding()) { this.configureItemScope(index, scope); } this._linker(scope, function (cloned) { var element = cloned[0]; if (!_this2._usingBinding()) { element = _this2._userDelegate.createItemContent(index, element); $compile(element)(scope); } done({ element: element, scope: scope }); }); } /** * @param {Number} index * @param {Object} scope */ }, { key: '_addSpecialProperties', value: function _addSpecialProperties(i, scope) { var last = this.countItems() - 1; angular.extend(scope, { $index: i, $first: i === 0, $last: i === last, $middle: i !== 0 && i !== last, $even: i % 2 === 0, $odd: i % 2 === 1 }); } }, { key: 'updateItem', value: function updateItem(index, item) { var _this3 = this; if (this._usingBinding()) { item.scope.$evalAsync(function () { return _this3.configureItemScope(index, item.scope); }); } else { babelHelpers.get(Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'updateItem', this).call(this, index, item); } } /** * @param {Number} index * @param {Object} item * @param {Object} item.scope * @param {Element} item.element */ }, { key: 'destroyItem', value: function destroyItem(index, item) { if (this._usingBinding()) { this.destroyItemScope(index, item.scope); } else { babelHelpers.get(Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'destroyItem', this).call(this, index, item.element); } item.scope.$destroy(); } }, { key: 'destroy', value: function destroy() { babelHelpers.get(Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'destroy', this).call(this); this._scope = null; } }]); return AngularLazyRepeatDelegate; }(ons._internal.LazyRepeatDelegate); return AngularLazyRepeatDelegate; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.value('ModalAnimator', ons._internal.ModalAnimator); module.value('FadeModalAnimator', ons._internal.FadeModalAnimator); module.factory('ModalView', ['$onsen', '$parse', function ($onsen, $parse) { var ModalView = Class.extend({ _element: undefined, _scope: undefined, init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._scope.$on('$destroy', this._destroy.bind(this)); element[0]._animatorFactory.setAnimationOptions($parse(attrs.animationOptions)()); }, show: function show(options) { return this._element[0].show(options); }, hide: function hide(options) { return this._element[0].hide(options); }, toggle: function toggle(options) { return this._element[0].toggle(options); }, _destroy: function _destroy() { this.emit('destroy', { page: this }); this._events = this._element = this._scope = null; } }); ModalView.registerAnimator = function (name, Animator) { return window.ons.ModalElement.registerAnimator(name, Animator); }; MicroEvent.mixin(ModalView); $onsen.derivePropertiesFromElement(ModalView, ['onDeviceBackButton']); return ModalView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('NavigatorView', ['$compile', '$onsen', function ($compile, $onsen) { /** * Manages the page navigation backed by page stack. * * @class NavigatorView */ var NavigatorView = Class.extend({ /** * @member {jqLite} Object */ _element: undefined, /** * @member {Object} Object */ _attrs: undefined, /** * @member {Object} */ _scope: undefined, /** * @param {Object} scope * @param {jqLite} element jqLite Object to manage with navigator * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element || angular.element(window.document.body); this._scope = scope || this._element.scope(); this._attrs = attrs; this._previousPageScope = null; this._boundOnPrepop = this._onPrepop.bind(this); this._boundOnPostpop = this._onPostpop.bind(this); this._element.on('prepop', this._boundOnPrepop); this._element.on('postpop', this._boundOnPostpop); this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['prepush', 'postpush', 'prepop', 'postpop', 'init', 'show', 'hide', 'destroy'], function (detail) { if (detail.navigator) { detail.navigator = this; } return detail; }.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['insertPage', 'pushPage', 'bringPageTop', 'popPage', 'replacePage', 'resetToPage', 'canPopPage']); }, _onPrepop: function _onPrepop(event) { var pages = event.detail.navigator.pages; angular.element(pages[pages.length - 2]).data('_scope').$evalAsync(); this._previousPageScope = angular.element(pages[pages.length - 1]).data('_scope'); }, _onPostpop: function _onPostpop(event) { this._previousPageScope.$destroy(); }, _compileAndLink: function _compileAndLink(pageElement, callback) { var link = $compile(pageElement); var pageScope = this._createPageScope(); link(pageScope); pageScope.$evalAsync(function () { callback(pageElement); }); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element.off('prepop', this._boundOnPrepop); this._element.off('postpop', this._boundOnPostpop); this._element = this._scope = this._attrs = null; }, _createPageScope: function _createPageScope() { return this._scope.$new(); } }); MicroEvent.mixin(NavigatorView); $onsen.derivePropertiesFromElement(NavigatorView, ['pages', 'topPage']); return NavigatorView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ angular.module('onsen').value('NavigatorTransitionAnimator', ons._internal.NavigatorTransitionAnimator).value('FadeTransitionAnimator', ons._internal.FadeNavigatorTransitionAnimator).value('IOSSlideTransitionAnimator', ons._internal.IOSSlideNavigatorTransitionAnimator).value('LiftTransitionAnimator', ons._internal.LiftNavigatorTransitionAnimator).value('NullTransitionAnimator', ons._internal.NavigatorTransitionAnimator).value('SimpleSlideTransitionAnimator', ons._internal.SimpleSlideNavigatorTransitionAnimator); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('OverlaySlidingMenuAnimator', ['SlidingMenuAnimator', function (SlidingMenuAnimator) { var OverlaySlidingMenuAnimator = SlidingMenuAnimator.extend({ _blackMask: undefined, _isRight: false, _element: false, _menuPage: false, _mainPage: false, _width: false, /** * @param {jqLite} element "ons-sliding-menu" or "ons-split-view" element * @param {jqLite} mainPage * @param {jqLite} menuPage * @param {Object} options * @param {String} options.width "width" style value * @param {Boolean} options.isRight */ setup: function setup(element, mainPage, menuPage, options) { options = options || {}; this._width = options.width || '90%'; this._isRight = !!options.isRight; this._element = element; this._mainPage = mainPage; this._menuPage = menuPage; menuPage.css('box-shadow', '0px 0 10px 0px rgba(0, 0, 0, 0.2)'); menuPage.css({ width: options.width, display: 'none', zIndex: 2 }); // Fix for transparent menu page on iOS8. menuPage.css('-webkit-transform', 'translate3d(0px, 0px, 0px)'); mainPage.css({ zIndex: 1 }); if (this._isRight) { menuPage.css({ right: '-' + options.width, left: 'auto' }); } else { menuPage.css({ right: 'auto', left: '-' + options.width }); } this._blackMask = angular.element('<div></div>').css({ backgroundColor: 'black', top: '0px', left: '0px', right: '0px', bottom: '0px', position: 'absolute', display: 'none', zIndex: 0 }); element.prepend(this._blackMask); }, /** * @param {Object} options * @param {String} options.width */ onResized: function onResized(options) { this._menuPage.css('width', options.width); if (this._isRight) { this._menuPage.css({ right: '-' + options.width, left: 'auto' }); } else { this._menuPage.css({ right: 'auto', left: '-' + options.width }); } if (options.isOpened) { var max = this._menuPage[0].clientWidth; var menuStyle = this._generateMenuPageStyle(max); animit(this._menuPage[0]).queue(menuStyle).play(); } }, /** */ destroy: function destroy() { if (this._blackMask) { this._blackMask.remove(); this._blackMask = null; } this._mainPage.removeAttr('style'); this._menuPage.removeAttr('style'); this._element = this._mainPage = this._menuPage = null; }, /** * @param {Function} callback * @param {Boolean} instant */ openMenu: function openMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; this._menuPage.css('display', 'block'); this._blackMask.css('display', 'block'); var max = this._menuPage[0].clientWidth; var menuStyle = this._generateMenuPageStyle(max); var mainPageStyle = this._generateMainPageStyle(max); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue(mainPageStyle, { duration: duration, timing: this.timing }).queue(function (done) { callback(); done(); }).play(); animit(this._menuPage[0]).wait(delay).queue(menuStyle, { duration: duration, timing: this.timing }).play(); }.bind(this), 1000 / 60); }, /** * @param {Function} callback * @param {Boolean} instant */ closeMenu: function closeMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; this._blackMask.css({ display: 'block' }); var menuPageStyle = this._generateMenuPageStyle(0); var mainPageStyle = this._generateMainPageStyle(0); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue(mainPageStyle, { duration: duration, timing: this.timing }).queue(function (done) { this._menuPage.css('display', 'none'); callback(); done(); }.bind(this)).play(); animit(this._menuPage[0]).wait(delay).queue(menuPageStyle, { duration: duration, timing: this.timing }).play(); }.bind(this), 1000 / 60); }, /** * @param {Object} options * @param {Number} options.distance * @param {Number} options.maxDistance */ translateMenu: function translateMenu(options) { this._menuPage.css('display', 'block'); this._blackMask.css({ display: 'block' }); var menuPageStyle = this._generateMenuPageStyle(Math.min(options.maxDistance, options.distance)); var mainPageStyle = this._generateMainPageStyle(Math.min(options.maxDistance, options.distance)); delete mainPageStyle.opacity; animit(this._menuPage[0]).queue(menuPageStyle).play(); if (Object.keys(mainPageStyle).length > 0) { animit(this._mainPage[0]).queue(mainPageStyle).play(); } }, _generateMenuPageStyle: function _generateMenuPageStyle(distance) { var x = this._isRight ? -distance : distance; var transform = 'translate3d(' + x + 'px, 0, 0)'; return { transform: transform, 'box-shadow': distance === 0 ? 'none' : '0px 0 10px 0px rgba(0, 0, 0, 0.2)' }; }, _generateMainPageStyle: function _generateMainPageStyle(distance) { var max = this._menuPage[0].clientWidth; var opacity = 1 - 0.1 * distance / max; return { opacity: opacity }; }, copy: function copy() { return new OverlaySlidingMenuAnimator(); } }); return OverlaySlidingMenuAnimator; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('PageView', ['$onsen', '$parse', function ($onsen, $parse) { var PageView = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._scope = scope; this._element = element; this._attrs = attrs; this._clearListener = scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['init', 'show', 'hide', 'destroy']); Object.defineProperty(this, 'onDeviceBackButton', { get: function get() { return _this._element[0].onDeviceBackButton; }, set: function set(value) { if (!_this._userBackButtonHandler) { _this._enableBackButtonHandler(); } _this._userBackButtonHandler = value; } }); if (this._attrs.ngDeviceBackButton || this._attrs.onDeviceBackButton) { this._enableBackButtonHandler(); } if (this._attrs.ngInfiniteScroll) { this._element[0].onInfiniteScroll = function (done) { $parse(_this._attrs.ngInfiniteScroll)(_this._scope)(done); }; } }, _enableBackButtonHandler: function _enableBackButtonHandler() { this._userBackButtonHandler = angular.noop; this._element[0].onDeviceBackButton = this._onDeviceBackButton.bind(this); }, _onDeviceBackButton: function _onDeviceBackButton($event) { this._userBackButtonHandler($event); // ng-device-backbutton if (this._attrs.ngDeviceBackButton) { $parse(this._attrs.ngDeviceBackButton)(this._scope, { $event: $event }); } // on-device-backbutton /* jshint ignore:start */ if (this._attrs.onDeviceBackButton) { var lastEvent = window.$event; window.$event = $event; new Function(this._attrs.onDeviceBackButton)(); // eslint-disable-line no-new-func window.$event = lastEvent; } /* jshint ignore:end */ }, _destroy: function _destroy() { this._clearDerivingEvents(); this._element = null; this._scope = null; this._clearListener(); } }); MicroEvent.mixin(PageView); return PageView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('PopoverView', ['$onsen', function ($onsen) { var PopoverView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide'], function (detail) { if (detail.popover) { detail.popover = this; } return detail; }.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._clearDerivingEvents(); this._element.remove(); this._element = this._scope = null; } }); MicroEvent.mixin(PopoverView); $onsen.derivePropertiesFromElement(PopoverView, ['cancelable', 'disabled', 'onDeviceBackButton']); return PopoverView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ angular.module('onsen').value('PopoverAnimator', ons._internal.PopoverAnimator).value('FadePopoverAnimator', ons._internal.FadePopoverAnimator); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('PullHookView', ['$onsen', '$parse', function ($onsen, $parse) { var PullHookView = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['changestate'], function (detail) { if (detail.pullHook) { detail.pullHook = _this; } return detail; }); this.on('changestate', function () { return _this._scope.$evalAsync(); }); this._element[0].onAction = function (done) { if (_this._attrs.ngAction) { _this._scope.$eval(_this._attrs.ngAction, { $done: done }); } else { _this.onAction ? _this.onAction(done) : done(); } }; this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(PullHookView); $onsen.derivePropertiesFromElement(PullHookView, ['state', 'pullDistance', 'height', 'thresholdHeight', 'disabled']); return PullHookView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('PushSlidingMenuAnimator', ['SlidingMenuAnimator', function (SlidingMenuAnimator) { var PushSlidingMenuAnimator = SlidingMenuAnimator.extend({ _isRight: false, _element: undefined, _menuPage: undefined, _mainPage: undefined, _width: undefined, /** * @param {jqLite} element "ons-sliding-menu" or "ons-split-view" element * @param {jqLite} mainPage * @param {jqLite} menuPage * @param {Object} options * @param {String} options.width "width" style value * @param {Boolean} options.isRight */ setup: function setup(element, mainPage, menuPage, options) { options = options || {}; this._element = element; this._mainPage = mainPage; this._menuPage = menuPage; this._isRight = !!options.isRight; this._width = options.width || '90%'; menuPage.css({ width: options.width, display: 'none' }); if (this._isRight) { menuPage.css({ right: '-' + options.width, left: 'auto' }); } else { menuPage.css({ right: 'auto', left: '-' + options.width }); } }, /** * @param {Object} options * @param {String} options.width * @param {Object} options.isRight */ onResized: function onResized(options) { this._menuPage.css('width', options.width); if (this._isRight) { this._menuPage.css({ right: '-' + options.width, left: 'auto' }); } else { this._menuPage.css({ right: 'auto', left: '-' + options.width }); } if (options.isOpened) { var max = this._menuPage[0].clientWidth; var mainPageTransform = this._generateAbovePageTransform(max); var menuPageStyle = this._generateBehindPageStyle(max); animit(this._mainPage[0]).queue({ transform: mainPageTransform }).play(); animit(this._menuPage[0]).queue(menuPageStyle).play(); } }, /** */ destroy: function destroy() { this._mainPage.removeAttr('style'); this._menuPage.removeAttr('style'); this._element = this._mainPage = this._menuPage = null; }, /** * @param {Function} callback * @param {Boolean} instant */ openMenu: function openMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; this._menuPage.css('display', 'block'); var max = this._menuPage[0].clientWidth; var aboveTransform = this._generateAbovePageTransform(max); var behindStyle = this._generateBehindPageStyle(max); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue({ transform: aboveTransform }, { duration: duration, timing: this.timing }).queue(function (done) { callback(); done(); }).play(); animit(this._menuPage[0]).wait(delay).queue(behindStyle, { duration: duration, timing: this.timing }).play(); }.bind(this), 1000 / 60); }, /** * @param {Function} callback * @param {Boolean} instant */ closeMenu: function closeMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; var aboveTransform = this._generateAbovePageTransform(0); var behindStyle = this._generateBehindPageStyle(0); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue({ transform: aboveTransform }, { duration: duration, timing: this.timing }).queue({ transform: 'translate3d(0, 0, 0)' }).queue(function (done) { this._menuPage.css('display', 'none'); callback(); done(); }.bind(this)).play(); animit(this._menuPage[0]).wait(delay).queue(behindStyle, { duration: duration, timing: this.timing }).queue(function (done) { done(); }).play(); }.bind(this), 1000 / 60); }, /** * @param {Object} options * @param {Number} options.distance * @param {Number} options.maxDistance */ translateMenu: function translateMenu(options) { this._menuPage.css('display', 'block'); var aboveTransform = this._generateAbovePageTransform(Math.min(options.maxDistance, options.distance)); var behindStyle = this._generateBehindPageStyle(Math.min(options.maxDistance, options.distance)); animit(this._mainPage[0]).queue({ transform: aboveTransform }).play(); animit(this._menuPage[0]).queue(behindStyle).play(); }, _generateAbovePageTransform: function _generateAbovePageTransform(distance) { var x = this._isRight ? -distance : distance; var aboveTransform = 'translate3d(' + x + 'px, 0, 0)'; return aboveTransform; }, _generateBehindPageStyle: function _generateBehindPageStyle(distance) { var behindX = this._isRight ? -distance : distance; var behindTransform = 'translate3d(' + behindX + 'px, 0, 0)'; return { transform: behindTransform }; }, copy: function copy() { return new PushSlidingMenuAnimator(); } }); return PushSlidingMenuAnimator; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('RevealSlidingMenuAnimator', ['SlidingMenuAnimator', function (SlidingMenuAnimator) { var RevealSlidingMenuAnimator = SlidingMenuAnimator.extend({ _blackMask: undefined, _isRight: false, _menuPage: undefined, _element: undefined, _mainPage: undefined, /** * @param {jqLite} element "ons-sliding-menu" or "ons-split-view" element * @param {jqLite} mainPage * @param {jqLite} menuPage * @param {Object} options * @param {String} options.width "width" style value * @param {Boolean} options.isRight */ setup: function setup(element, mainPage, menuPage, options) { this._element = element; this._menuPage = menuPage; this._mainPage = mainPage; this._isRight = !!options.isRight; this._width = options.width || '90%'; mainPage.css({ boxShadow: '0px 0 10px 0px rgba(0, 0, 0, 0.2)' }); menuPage.css({ width: options.width, opacity: 0.9, display: 'none' }); if (this._isRight) { menuPage.css({ right: '0px', left: 'auto' }); } else { menuPage.css({ right: 'auto', left: '0px' }); } this._blackMask = angular.element('<div></div>').css({ backgroundColor: 'black', top: '0px', left: '0px', right: '0px', bottom: '0px', position: 'absolute', display: 'none' }); element.prepend(this._blackMask); // Dirty fix for broken rendering bug on android 4.x. animit(mainPage[0]).queue({ transform: 'translate3d(0, 0, 0)' }).play(); }, /** * @param {Object} options * @param {Boolean} options.isOpened * @param {String} options.width */ onResized: function onResized(options) { this._width = options.width; this._menuPage.css('width', this._width); if (options.isOpened) { var max = this._menuPage[0].clientWidth; var aboveTransform = this._generateAbovePageTransform(max); var behindStyle = this._generateBehindPageStyle(max); animit(this._mainPage[0]).queue({ transform: aboveTransform }).play(); animit(this._menuPage[0]).queue(behindStyle).play(); } }, /** * @param {jqLite} element "ons-sliding-menu" or "ons-split-view" element * @param {jqLite} mainPage * @param {jqLite} menuPage */ destroy: function destroy() { if (this._blackMask) { this._blackMask.remove(); this._blackMask = null; } if (this._mainPage) { this._mainPage.attr('style', ''); } if (this._menuPage) { this._menuPage.attr('style', ''); } this._mainPage = this._menuPage = this._element = undefined; }, /** * @param {Function} callback * @param {Boolean} instant */ openMenu: function openMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; this._menuPage.css('display', 'block'); this._blackMask.css('display', 'block'); var max = this._menuPage[0].clientWidth; var aboveTransform = this._generateAbovePageTransform(max); var behindStyle = this._generateBehindPageStyle(max); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue({ transform: aboveTransform }, { duration: duration, timing: this.timing }).queue(function (done) { callback(); done(); }).play(); animit(this._menuPage[0]).wait(delay).queue(behindStyle, { duration: duration, timing: this.timing }).play(); }.bind(this), 1000 / 60); }, /** * @param {Function} callback * @param {Boolean} instant */ closeMenu: function closeMenu(callback, instant) { var duration = instant === true ? 0.0 : this.duration; var delay = instant === true ? 0.0 : this.delay; this._blackMask.css('display', 'block'); var aboveTransform = this._generateAbovePageTransform(0); var behindStyle = this._generateBehindPageStyle(0); setTimeout(function () { animit(this._mainPage[0]).wait(delay).queue({ transform: aboveTransform }, { duration: duration, timing: this.timing }).queue({ transform: 'translate3d(0, 0, 0)' }).queue(function (done) { this._menuPage.css('display', 'none'); callback(); done(); }.bind(this)).play(); animit(this._menuPage[0]).wait(delay).queue(behindStyle, { duration: duration, timing: this.timing }).queue(function (done) { done(); }).play(); }.bind(this), 1000 / 60); }, /** * @param {Object} options * @param {Number} options.distance * @param {Number} options.maxDistance */ translateMenu: function translateMenu(options) { this._menuPage.css('display', 'block'); this._blackMask.css('display', 'block'); var aboveTransform = this._generateAbovePageTransform(Math.min(options.maxDistance, options.distance)); var behindStyle = this._generateBehindPageStyle(Math.min(options.maxDistance, options.distance)); delete behindStyle.opacity; animit(this._mainPage[0]).queue({ transform: aboveTransform }).play(); animit(this._menuPage[0]).queue(behindStyle).play(); }, _generateAbovePageTransform: function _generateAbovePageTransform(distance) { var x = this._isRight ? -distance : distance; var aboveTransform = 'translate3d(' + x + 'px, 0, 0)'; return aboveTransform; }, _generateBehindPageStyle: function _generateBehindPageStyle(distance) { var max = this._menuPage[0].getBoundingClientRect().width; var behindDistance = (distance - max) / max * 10; behindDistance = isNaN(behindDistance) ? 0 : Math.max(Math.min(behindDistance, 0), -10); var behindX = this._isRight ? -behindDistance : behindDistance; var behindTransform = 'translate3d(' + behindX + '%, 0, 0)'; var opacity = 1 + behindDistance / 100; return { transform: behindTransform, opacity: opacity }; }, copy: function copy() { return new RevealSlidingMenuAnimator(); } }); return RevealSlidingMenuAnimator; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); var SlidingMenuViewModel = Class.extend({ /** * @member Number */ _distance: 0, /** * @member Number */ _maxDistance: undefined, /** * @param {Object} options * @param {Number} maxDistance */ init: function init(options) { if (!angular.isNumber(options.maxDistance)) { throw new Error('options.maxDistance must be number'); } this.setMaxDistance(options.maxDistance); }, /** * @param {Number} maxDistance */ setMaxDistance: function setMaxDistance(maxDistance) { if (maxDistance <= 0) { throw new Error('maxDistance must be greater then zero.'); } if (this.isOpened()) { this._distance = maxDistance; } this._maxDistance = maxDistance; }, /** * @return {Boolean} */ shouldOpen: function shouldOpen() { return !this.isOpened() && this._distance >= this._maxDistance / 2; }, /** * @return {Boolean} */ shouldClose: function shouldClose() { return !this.isClosed() && this._distance < this._maxDistance / 2; }, openOrClose: function openOrClose(options) { if (this.shouldOpen()) { this.open(options); } else if (this.shouldClose()) { this.close(options); } }, close: function close(options) { var callback = options.callback || function () {}; if (!this.isClosed()) { this._distance = 0; this.emit('close', options); } else { callback(); } }, open: function open(options) { var callback = options.callback || function () {}; if (!this.isOpened()) { this._distance = this._maxDistance; this.emit('open', options); } else { callback(); } }, /** * @return {Boolean} */ isClosed: function isClosed() { return this._distance === 0; }, /** * @return {Boolean} */ isOpened: function isOpened() { return this._distance === this._maxDistance; }, /** * @return {Number} */ getX: function getX() { return this._distance; }, /** * @return {Number} */ getMaxDistance: function getMaxDistance() { return this._maxDistance; }, /** * @param {Number} x */ translate: function translate(x) { this._distance = Math.max(1, Math.min(this._maxDistance - 1, x)); var options = { distance: this._distance, maxDistance: this._maxDistance }; this.emit('translate', options); }, toggle: function toggle() { if (this.isClosed()) { this.open(); } else { this.close(); } } }); MicroEvent.mixin(SlidingMenuViewModel); module.factory('SlidingMenuView', ['$onsen', '$compile', '$parse', 'AnimationChooser', 'SlidingMenuAnimator', 'RevealSlidingMenuAnimator', 'PushSlidingMenuAnimator', 'OverlaySlidingMenuAnimator', function ($onsen, $compile, $parse, AnimationChooser, SlidingMenuAnimator, RevealSlidingMenuAnimator, PushSlidingMenuAnimator, OverlaySlidingMenuAnimator) { var SlidingMenuView = Class.extend({ _scope: undefined, _attrs: undefined, _element: undefined, _menuPage: undefined, _mainPage: undefined, _doorLock: undefined, _isRightMenu: false, init: function init(scope, element, attrs) { this._scope = scope; this._attrs = attrs; this._element = element; this._menuPage = angular.element(element[0].querySelector('.onsen-sliding-menu__menu')); this._mainPage = angular.element(element[0].querySelector('.onsen-sliding-menu__main')); this._doorLock = new ons._DoorLock(); this._isRightMenu = attrs.side === 'right'; // Close menu on tap event. this._mainPageGestureDetector = new ons.GestureDetector(this._mainPage[0]); this._boundOnTap = this._onTap.bind(this); var maxDistance = this._normalizeMaxSlideDistanceAttr(); this._logic = new SlidingMenuViewModel({ maxDistance: Math.max(maxDistance, 1) }); this._logic.on('translate', this._translate.bind(this)); this._logic.on('open', function (options) { this._open(options); }.bind(this)); this._logic.on('close', function (options) { this._close(options); }.bind(this)); attrs.$observe('maxSlideDistance', this._onMaxSlideDistanceChanged.bind(this)); attrs.$observe('swipeable', this._onSwipeableChanged.bind(this)); this._boundOnWindowResize = this._onWindowResize.bind(this); window.addEventListener('resize', this._boundOnWindowResize); this._boundHandleEvent = this._handleEvent.bind(this); this._bindEvents(); if (attrs.mainPage) { this.setMainPage(attrs.mainPage); } if (attrs.menuPage) { this.setMenuPage(attrs.menuPage); } this._deviceBackButtonHandler = ons._deviceBackButtonDispatcher.createHandler(this._element[0], this._onDeviceBackButton.bind(this)); var unlock = this._doorLock.lock(); window.setTimeout(function () { var maxDistance = this._normalizeMaxSlideDistanceAttr(); this._logic.setMaxDistance(maxDistance); this._menuPage.css({ opacity: 1 }); var animationChooser = new AnimationChooser({ animators: SlidingMenuView._animatorDict, baseClass: SlidingMenuAnimator, baseClassName: 'SlidingMenuAnimator', defaultAnimation: attrs.type, defaultAnimationOptions: $parse(attrs.animationOptions)() }); this._animator = animationChooser.newAnimator(); this._animator.setup(this._element, this._mainPage, this._menuPage, { isRight: this._isRightMenu, width: this._attrs.maxSlideDistance || '90%' }); unlock(); }.bind(this), 400); scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['init', 'show', 'hide', 'destroy']); if (!attrs.swipeable) { this.setSwipeable(true); } }, getDeviceBackButtonHandler: function getDeviceBackButtonHandler() { return this._deviceBackButtonHandler; }, _onDeviceBackButton: function _onDeviceBackButton(event) { if (this.isMenuOpened()) { this.closeMenu(); } else { event.callParentHandler(); } }, _onTap: function _onTap() { if (this.isMenuOpened()) { this.closeMenu(); } }, _refreshMenuPageWidth: function _refreshMenuPageWidth() { var width = 'maxSlideDistance' in this._attrs ? this._attrs.maxSlideDistance : '90%'; if (this._animator) { this._animator.onResized({ isOpened: this._logic.isOpened(), width: width }); } }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._deviceBackButtonHandler.destroy(); window.removeEventListener('resize', this._boundOnWindowResize); this._mainPageGestureDetector.off('tap', this._boundOnTap); this._element = this._scope = this._attrs = null; }, _onSwipeableChanged: function _onSwipeableChanged(swipeable) { swipeable = swipeable === '' || swipeable === undefined || swipeable == 'true'; this.setSwipeable(swipeable); }, /** * @param {Boolean} enabled */ setSwipeable: function setSwipeable(enabled) { if (enabled) { this._activateGestureDetector(); } else { this._deactivateGestureDetector(); } }, _onWindowResize: function _onWindowResize() { this._recalculateMAX(); this._refreshMenuPageWidth(); }, _onMaxSlideDistanceChanged: function _onMaxSlideDistanceChanged() { this._recalculateMAX(); this._refreshMenuPageWidth(); }, /** * @return {Number} */ _normalizeMaxSlideDistanceAttr: function _normalizeMaxSlideDistanceAttr() { var maxDistance = this._attrs.maxSlideDistance; if (!('maxSlideDistance' in this._attrs)) { maxDistance = 0.9 * this._mainPage[0].clientWidth; } else if (typeof maxDistance == 'string') { if (maxDistance.indexOf('px', maxDistance.length - 2) !== -1) { maxDistance = parseInt(maxDistance.replace('px', ''), 10); } else if (maxDistance.indexOf('%', maxDistance.length - 1) > 0) { maxDistance = maxDistance.replace('%', ''); maxDistance = parseFloat(maxDistance) / 100 * this._mainPage[0].clientWidth; } } else { throw new Error('invalid state'); } return maxDistance; }, _recalculateMAX: function _recalculateMAX() { var maxDistance = this._normalizeMaxSlideDistanceAttr(); if (maxDistance) { this._logic.setMaxDistance(parseInt(maxDistance, 10)); } }, _activateGestureDetector: function _activateGestureDetector() { this._gestureDetector.on('touch dragleft dragright swipeleft swiperight release', this._boundHandleEvent); }, _deactivateGestureDetector: function _deactivateGestureDetector() { this._gestureDetector.off('touch dragleft dragright swipeleft swiperight release', this._boundHandleEvent); }, _bindEvents: function _bindEvents() { this._gestureDetector = new ons.GestureDetector(this._element[0], { dragMinDistance: 1 }); }, _appendMainPage: function _appendMainPage(pageUrl, templateHTML) { var pageScope = this._scope.$new(); var pageContent = angular.element(templateHTML); var link = $compile(pageContent); this._mainPage.append(pageContent); if (this._currentPageElement) { this._currentPageElement.remove(); this._currentPageScope.$destroy(); } link(pageScope); this._currentPageElement = pageContent; this._currentPageScope = pageScope; this._currentPageUrl = pageUrl; this._currentPageElement[0]._show(); }, /** * @param {String} */ _appendMenuPage: function _appendMenuPage(templateHTML) { var pageScope = this._scope.$new(); var pageContent = angular.element(templateHTML); var link = $compile(pageContent); this._menuPage.append(pageContent); if (this._currentMenuPageScope) { this._currentMenuPageScope.$destroy(); this._currentMenuPageElement.remove(); } link(pageScope); this._currentMenuPageElement = pageContent; this._currentMenuPageScope = pageScope; }, /** * @param {String} page * @param {Object} options * @param {Boolean} [options.closeMenu] * @param {Boolean} [options.callback] */ setMenuPage: function setMenuPage(page, options) { if (page) { options = options || {}; options.callback = options.callback || function () {}; var self = this; $onsen.getPageHTMLAsync(page).then(function (html) { self._appendMenuPage(angular.element(html)); if (options.closeMenu) { self.close(); } options.callback(); }, function () { throw new Error('Page is not found: ' + page); }); } else { throw new Error('cannot set undefined page'); } }, /** * @param {String} pageUrl * @param {Object} options * @param {Boolean} [options.closeMenu] * @param {Boolean} [options.callback] */ setMainPage: function setMainPage(pageUrl, options) { options = options || {}; options.callback = options.callback || function () {}; var done = function () { if (options.closeMenu) { this.close(); } options.callback(); }.bind(this); if (this._currentPageUrl === pageUrl) { done(); return; } if (pageUrl) { var self = this; $onsen.getPageHTMLAsync(pageUrl).then(function (html) { self._appendMainPage(pageUrl, html); done(); }, function () { throw new Error('Page is not found: ' + page); }); } else { throw new Error('cannot set undefined page'); } }, _handleEvent: function _handleEvent(event) { if (this._doorLock.isLocked()) { return; } if (this._isInsideIgnoredElement(event.target)) { this._deactivateGestureDetector(); } switch (event.type) { case 'dragleft': case 'dragright': if (this._logic.isClosed() && !this._isInsideSwipeTargetArea(event)) { return; } event.gesture.preventDefault(); var deltaX = event.gesture.deltaX; var deltaDistance = this._isRightMenu ? -deltaX : deltaX; var startEvent = event.gesture.startEvent; if (!('isOpened' in startEvent)) { startEvent.isOpened = this._logic.isOpened(); } if (deltaDistance < 0 && this._logic.isClosed()) { break; } if (deltaDistance > 0 && this._logic.isOpened()) { break; } var distance = startEvent.isOpened ? deltaDistance + this._logic.getMaxDistance() : deltaDistance; this._logic.translate(distance); break; case 'swipeleft': event.gesture.preventDefault(); if (this._logic.isClosed() && !this._isInsideSwipeTargetArea(event)) { return; } if (this._isRightMenu) { this.open(); } else { this.close(); } event.gesture.stopDetect(); break; case 'swiperight': event.gesture.preventDefault(); if (this._logic.isClosed() && !this._isInsideSwipeTargetArea(event)) { return; } if (this._isRightMenu) { this.close(); } else { this.open(); } event.gesture.stopDetect(); break; case 'release': this._lastDistance = null; if (this._logic.shouldOpen()) { this.open(); } else if (this._logic.shouldClose()) { this.close(); } break; } }, /** * @param {jqLite} element * @return {Boolean} */ _isInsideIgnoredElement: function _isInsideIgnoredElement(element) { do { if (element.getAttribute && element.getAttribute('sliding-menu-ignore')) { return true; } element = element.parentNode; } while (element); return false; }, _isInsideSwipeTargetArea: function _isInsideSwipeTargetArea(event) { var x = event.gesture.center.pageX; if (!('_swipeTargetWidth' in event.gesture.startEvent)) { event.gesture.startEvent._swipeTargetWidth = this._getSwipeTargetWidth(); } var targetWidth = event.gesture.startEvent._swipeTargetWidth; return this._isRightMenu ? this._mainPage[0].clientWidth - x < targetWidth : x < targetWidth; }, _getSwipeTargetWidth: function _getSwipeTargetWidth() { var targetWidth = this._attrs.swipeTargetWidth; if (typeof targetWidth == 'string') { targetWidth = targetWidth.replace('px', ''); } var width = parseInt(targetWidth, 10); if (width < 0 || !targetWidth) { return this._mainPage[0].clientWidth; } else { return width; } }, closeMenu: function closeMenu() { return this.close.apply(this, arguments); }, /** * Close sliding-menu page. * * @param {Object} options */ close: function close(options) { options = options || {}; options = typeof options == 'function' ? { callback: options } : options; if (!this._logic.isClosed()) { this.emit('preclose', { slidingMenu: this }); this._doorLock.waitUnlock(function () { this._logic.close(options); }.bind(this)); } }, _close: function _close(options) { var callback = options.callback || function () {}, unlock = this._doorLock.lock(), instant = options.animation == 'none'; this._animator.closeMenu(function () { unlock(); this._mainPage.children().css('pointer-events', ''); this._mainPageGestureDetector.off('tap', this._boundOnTap); this.emit('postclose', { slidingMenu: this }); callback(); }.bind(this), instant); }, /** * Open sliding-menu page. * * @param {Object} [options] * @param {Function} [options.callback] */ openMenu: function openMenu() { return this.open.apply(this, arguments); }, /** * Open sliding-menu page. * * @param {Object} [options] * @param {Function} [options.callback] */ open: function open(options) { options = options || {}; options = typeof options == 'function' ? { callback: options } : options; this.emit('preopen', { slidingMenu: this }); this._doorLock.waitUnlock(function () { this._logic.open(options); }.bind(this)); }, _open: function _open(options) { var callback = options.callback || function () {}, unlock = this._doorLock.lock(), instant = options.animation == 'none'; this._animator.openMenu(function () { unlock(); this._mainPage.children().css('pointer-events', 'none'); this._mainPageGestureDetector.on('tap', this._boundOnTap); this.emit('postopen', { slidingMenu: this }); callback(); }.bind(this), instant); }, /** * Toggle sliding-menu page. * @param {Object} [options] * @param {Function} [options.callback] */ toggle: function toggle(options) { if (this._logic.isClosed()) { this.open(options); } else { this.close(options); } }, /** * Toggle sliding-menu page. */ toggleMenu: function toggleMenu() { return this.toggle.apply(this, arguments); }, /** * @return {Boolean} */ isMenuOpened: function isMenuOpened() { return this._logic.isOpened(); }, /** * @param {Object} event */ _translate: function _translate(event) { this._animator.translateMenu(event); } }); // Preset sliding menu animators. SlidingMenuView._animatorDict = { 'default': RevealSlidingMenuAnimator, 'overlay': OverlaySlidingMenuAnimator, 'reveal': RevealSlidingMenuAnimator, 'push': PushSlidingMenuAnimator }; /** * @param {String} name * @param {Function} Animator */ SlidingMenuView.registerAnimator = function (name, Animator) { if (!(Animator.prototype instanceof SlidingMenuAnimator)) { throw new Error('"Animator" param must inherit SlidingMenuAnimator'); } this._animatorDict[name] = Animator; }; MicroEvent.mixin(SlidingMenuView); return SlidingMenuView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('SlidingMenuAnimator', function () { return Class.extend({ delay: 0, duration: 0.4, timing: 'cubic-bezier(.1, .7, .1, 1)', /** * @param {Object} options * @param {String} options.timing * @param {Number} options.duration * @param {Number} options.delay */ init: function init(options) { options = options || {}; this.timing = options.timing || this.timing; this.duration = options.duration !== undefined ? options.duration : this.duration; this.delay = options.delay !== undefined ? options.delay : this.delay; }, /** * @param {jqLite} element "ons-sliding-menu" or "ons-split-view" element * @param {jqLite} mainPage * @param {jqLite} menuPage * @param {Object} options * @param {String} options.width "width" style value * @param {Boolean} options.isRight */ setup: function setup(element, mainPage, menuPage, options) {}, /** * @param {Object} options * @param {Boolean} options.isRight * @param {Boolean} options.isOpened * @param {String} options.width */ onResized: function onResized(options) {}, /** * @param {Function} callback */ openMenu: function openMenu(callback) {}, /** * @param {Function} callback */ closeClose: function closeClose(callback) {}, /** */ destroy: function destroy() {}, /** * @param {Object} options * @param {Number} options.distance * @param {Number} options.maxDistance */ translateMenu: function translateMenu(mainPage, menuPage, options) {}, /** * @return {SlidingMenuAnimator} */ copy: function copy() { throw new Error('Override copy method.'); } }); }); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('SpeedDialView', ['$onsen', function ($onsen) { /** * @class SpeedDialView */ var SpeedDialView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['show', 'hide', 'showItems', 'hideItems', 'isOpen', 'toggle', 'toggleItems']); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['open', 'close']).bind(this); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(SpeedDialView); $onsen.derivePropertiesFromElement(SpeedDialView, ['disabled', 'visible', 'inline']); return SpeedDialView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.factory('SplitView', ['$compile', 'RevealSlidingMenuAnimator', '$onsen', '$onsGlobal', function ($compile, RevealSlidingMenuAnimator, $onsen, $onsGlobal) { var SPLIT_MODE = 0; var COLLAPSE_MODE = 1; var MAIN_PAGE_RATIO = 0.9; var SplitView = Class.extend({ init: function init(scope, element, attrs) { element.addClass('onsen-sliding-menu'); this._element = element; this._scope = scope; this._attrs = attrs; this._mainPage = angular.element(element[0].querySelector('.onsen-split-view__main')); this._secondaryPage = angular.element(element[0].querySelector('.onsen-split-view__secondary')); this._max = this._mainPage[0].clientWidth * MAIN_PAGE_RATIO; this._mode = SPLIT_MODE; this._doorLock = new ons._DoorLock(); this._doSplit = false; this._doCollapse = false; $onsGlobal.orientation.on('change', this._onResize.bind(this)); this._animator = new RevealSlidingMenuAnimator(); this._element.css('display', 'none'); if (attrs.mainPage) { this.setMainPage(attrs.mainPage); } if (attrs.secondaryPage) { this.setSecondaryPage(attrs.secondaryPage); } var unlock = this._doorLock.lock(); this._considerChangingCollapse(); this._setSize(); setTimeout(function () { this._element.css('display', 'block'); unlock(); }.bind(this), 1000 / 60 * 2); scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['init', 'show', 'hide', 'destroy']); }, /** * @param {String} templateHTML */ _appendSecondPage: function _appendSecondPage(templateHTML) { var pageScope = this._scope.$new(); var pageContent = $compile(templateHTML)(pageScope); this._secondaryPage.append(pageContent); if (this._currentSecondaryPageElement) { this._currentSecondaryPageElement.remove(); this._currentSecondaryPageScope.$destroy(); } this._currentSecondaryPageElement = pageContent; this._currentSecondaryPageScope = pageScope; }, /** * @param {String} templateHTML */ _appendMainPage: function _appendMainPage(templateHTML) { var pageScope = this._scope.$new(); var pageContent = $compile(templateHTML)(pageScope); this._mainPage.append(pageContent); if (this._currentPage) { this._currentPageScope.$destroy(); } this._currentPage = pageContent; this._currentPageScope = pageScope; this._currentPage[0]._show(); }, /** * @param {String} page */ setSecondaryPage: function setSecondaryPage(page) { if (page) { $onsen.getPageHTMLAsync(page).then(function (html) { this._appendSecondPage(angular.element(html.trim())); }.bind(this), function () { throw new Error('Page is not found: ' + page); }); } else { throw new Error('cannot set undefined page'); } }, /** * @param {String} page */ setMainPage: function setMainPage(page) { if (page) { $onsen.getPageHTMLAsync(page).then(function (html) { this._appendMainPage(angular.element(html.trim())); }.bind(this), function () { throw new Error('Page is not found: ' + page); }); } else { throw new Error('cannot set undefined page'); } }, _onResize: function _onResize() { var lastMode = this._mode; this._considerChangingCollapse(); if (lastMode === COLLAPSE_MODE && this._mode === COLLAPSE_MODE) { this._animator.onResized({ isOpened: false, width: '90%' }); } this._max = this._mainPage[0].clientWidth * MAIN_PAGE_RATIO; }, _considerChangingCollapse: function _considerChangingCollapse() { var should = this._shouldCollapse(); if (should && this._mode !== COLLAPSE_MODE) { this._fireUpdateEvent(); if (this._doSplit) { this._activateSplitMode(); } else { this._activateCollapseMode(); } } else if (!should && this._mode === COLLAPSE_MODE) { this._fireUpdateEvent(); if (this._doCollapse) { this._activateCollapseMode(); } else { this._activateSplitMode(); } } this._doCollapse = this._doSplit = false; }, update: function update() { this._fireUpdateEvent(); var should = this._shouldCollapse(); if (this._doSplit) { this._activateSplitMode(); } else if (this._doCollapse) { this._activateCollapseMode(); } else if (should) { this._activateCollapseMode(); } else if (!should) { this._activateSplitMode(); } this._doSplit = this._doCollapse = false; }, _getOrientation: function _getOrientation() { if ($onsGlobal.orientation.isPortrait()) { return 'portrait'; } else { return 'landscape'; } }, getCurrentMode: function getCurrentMode() { if (this._mode === COLLAPSE_MODE) { return 'collapse'; } else { return 'split'; } }, _shouldCollapse: function _shouldCollapse() { var c = 'portrait'; if (typeof this._attrs.collapse === 'string') { c = this._attrs.collapse.trim(); } if (c == 'portrait') { return $onsGlobal.orientation.isPortrait(); } else if (c == 'landscape') { return $onsGlobal.orientation.isLandscape(); } else if (c.substr(0, 5) == 'width') { var num = c.split(' ')[1]; if (num.indexOf('px') >= 0) { num = num.substr(0, num.length - 2); } var width = window.innerWidth; return isNumber(num) && width < num; } else { var mq = window.matchMedia(c); return mq.matches; } }, _setSize: function _setSize() { if (this._mode === SPLIT_MODE) { if (!this._attrs.mainPageWidth) { this._attrs.mainPageWidth = '70'; } var secondarySize = 100 - this._attrs.mainPageWidth.replace('%', ''); this._secondaryPage.css({ width: secondarySize + '%', opacity: 1 }); this._mainPage.css({ width: this._attrs.mainPageWidth + '%' }); this._mainPage.css('left', secondarySize + '%'); } }, _fireEvent: function _fireEvent(name) { this.emit(name, { splitView: this, width: window.innerWidth, orientation: this._getOrientation() }); }, _fireUpdateEvent: function _fireUpdateEvent() { var that = this; this.emit('update', { splitView: this, shouldCollapse: this._shouldCollapse(), currentMode: this.getCurrentMode(), split: function split() { that._doSplit = true; that._doCollapse = false; }, collapse: function collapse() { that._doSplit = false; that._doCollapse = true; }, width: window.innerWidth, orientation: this._getOrientation() }); }, _activateCollapseMode: function _activateCollapseMode() { if (this._mode !== COLLAPSE_MODE) { this._fireEvent('precollapse'); this._secondaryPage.attr('style', ''); this._mainPage.attr('style', ''); this._mode = COLLAPSE_MODE; this._animator.setup(this._element, this._mainPage, this._secondaryPage, { isRight: false, width: '90%' }); this._fireEvent('postcollapse'); } }, _activateSplitMode: function _activateSplitMode() { if (this._mode !== SPLIT_MODE) { this._fireEvent('presplit'); this._animator.destroy(); this._secondaryPage.attr('style', ''); this._mainPage.attr('style', ''); this._mode = SPLIT_MODE; this._setSize(); this._fireEvent('postsplit'); } }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._element = null; this._scope = null; } }); function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } MicroEvent.mixin(SplitView); return SplitView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('SplitterContent', ['$onsen', '$compile', function ($onsen, $compile) { var SplitterContent = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this.load = function () { var _element$; _this._pageScope && _this._pageScope.$destroy(); return (_element$ = _this._element[0]).load.apply(_element$, arguments); }; scope.$on('$destroy', this._destroy.bind(this)); }, _link: function _link(fragment, done) { this._pageScope = this._scope.$new(); $compile(fragment)(this._pageScope); this._pageScope.$evalAsync(function () { return done(fragment); }); }, _destroy: function _destroy() { this.emit('destroy'); this._element = this._scope = this._attrs = this.load = this._pageScope = null; } }); MicroEvent.mixin(SplitterContent); $onsen.derivePropertiesFromElement(SplitterContent, ['page']); return SplitterContent; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('SplitterSide', ['$onsen', '$compile', function ($onsen, $compile) { var SplitterSide = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['open', 'close', 'toggle']); this.load = function () { var _element$; _this._pageScope && _this._pageScope.$destroy(); return (_element$ = _this._element[0]).load.apply(_element$, arguments); }; this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['modechange', 'preopen', 'preclose', 'postopen', 'postclose'], function (detail) { return detail.side ? angular.extend(detail, { side: _this }) : detail; }); scope.$on('$destroy', this._destroy.bind(this)); }, _link: function _link(fragment, done) { var link = $compile(fragment); this._pageScope = this._scope.$new(); link(this._pageScope); this._pageScope.$evalAsync(function () { return done(fragment); }); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._clearDerivingEvents(); this._element = this._scope = this._attrs = this.load = this._pageScope = null; } }); MicroEvent.mixin(SplitterSide); $onsen.derivePropertiesFromElement(SplitterSide, ['page', 'mode', 'isOpen']); return SplitterSide; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('Splitter', ['$onsen', function ($onsen) { var Splitter = Class.extend({ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(Splitter); $onsen.derivePropertiesFromElement(Splitter, ['onDeviceBackButton']); ['left', 'right', 'content', 'mask'].forEach(function (prop, i) { Object.defineProperty(Splitter.prototype, prop, { get: function get() { var tagName = 'ons-splitter-' + (i < 2 ? 'side' : prop); return angular.element(this._element[0][prop]).data(tagName); } }); }); return Splitter; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').factory('SwitchView', ['$parse', '$onsen', function ($parse, $onsen) { var SwitchView = Class.extend({ /** * @param {jqLite} element * @param {Object} scope * @param {Object} attrs */ init: function init(element, scope, attrs) { var _this = this; this._element = element; this._checkbox = angular.element(element[0].querySelector('input[type=checkbox]')); this._scope = scope; this._checkbox.on('change', function () { _this.emit('change', { 'switch': _this, value: _this._checkbox[0].checked, isInteractive: true }); }); this._prepareNgModel(element, scope, attrs); this._scope.$on('$destroy', function () { _this.emit('destroy'); _this._element = _this._checkbox = _this._scope = null; }); }, _prepareNgModel: function _prepareNgModel(element, scope, attrs) { var _this2 = this; if (attrs.ngModel) { var set = $parse(attrs.ngModel).assign; scope.$parent.$watch(attrs.ngModel, function (value) { _this2.checked = !!value; }); this._checkbox.on('change', function (e) { set(scope.$parent, _this2.checked); if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }); } } }); MicroEvent.mixin(SwitchView); $onsen.derivePropertiesFromElement(SwitchView, ['disabled', 'checked', 'checkbox']); return SwitchView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); module.value('TabbarNoneAnimator', ons._internal.TabbarNoneAnimator); module.value('TabbarFadeAnimator', ons._internal.TabbarFadeAnimator); module.value('TabbarSlideAnimator', ons._internal.TabbarSlideAnimator); module.factory('TabbarView', ['$onsen', '$compile', '$parse', function ($onsen, $compile, $parse) { var TabbarView = Class.extend({ init: function init(scope, element, attrs) { if (element[0].nodeName.toLowerCase() !== 'ons-tabbar') { throw new Error('"element" parameter must be a "ons-tabbar" element.'); } this._scope = scope; this._element = element; this._attrs = attrs; this._lastPageElement = null; this._lastPageScope = null; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['reactive', 'postchange', 'prechange', 'init', 'show', 'hide', 'destroy']); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['setActiveTab', 'setTabbarVisibility', 'getActiveTabIndex', 'loadPage']); }, _compileAndLink: function _compileAndLink(pageElement, callback) { var link = $compile(pageElement); var pageScope = this._scope.$new(); link(pageScope); pageScope.$evalAsync(function () { callback(pageElement); }); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(TabbarView); TabbarView.registerAnimator = function (name, Animator) { return window.ons.TabbarElement.registerAnimator(name, Animator); }; return TabbarView; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-alert-dialog */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this alert dialog.[/en] * [ja]このアラートダイアログを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火された際に呼び出されるコールバックを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出されるコールバックを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしlistenerパラメータが指定されなかった場合、そのイベントのリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーの関数オブジェクトを渡します。[/ja] */ (function () { 'use strict'; /** * Alert dialog directive. */ angular.module('onsen').directive('onsAlertDialog', ['$onsen', 'AlertDialogView', function ($onsen, AlertDialogView) { return { restrict: 'E', replace: false, scope: true, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var alertDialog = new AlertDialogView(scope, element, attrs); $onsen.declareVarAttribute(attrs, alertDialog); $onsen.registerEventHandlers(alertDialog, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(alertDialog, element); element.data('ons-alert-dialog', alertDialog); scope.$on('$destroy', function () { alertDialog._events = undefined; $onsen.removeModifierMethods(alertDialog); element.data('ons-alert-dialog', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsBackButton', ['$onsen', '$compile', 'GenericView', 'ComponentCleaner', function ($onsen, $compile, GenericView, ComponentCleaner) { return { restrict: 'E', replace: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs, controller, transclude) { var backButton = GenericView.register(scope, element, attrs, { viewKey: 'ons-back-button' }); scope.$on('$destroy', function () { backButton._events = undefined; $onsen.removeModifierMethods(backButton); element = null; }); ComponentCleaner.onDestroy(scope, function () { ComponentCleaner.destroyScope(scope); ComponentCleaner.destroyAttributes(attrs); element = scope = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsBottomToolbar', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: { pre: function pre(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-bottomToolbar' }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-button */ (function () { 'use strict'; angular.module('onsen').directive('onsButton', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { var button = GenericView.register(scope, element, attrs, { viewKey: 'ons-button' }); Object.defineProperty(button, 'disabled', { get: function get() { return this._element[0].disabled; }, set: function set(value) { return this._element[0].disabled = value; } }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-carousel * @description * [en]Carousel component.[/en] * [ja]カルーセルを表示できるコンポーネント。[/ja] * @codepen xbbzOQ * @guide UsingCarousel * [en]Learn how to use the carousel component.[/en] * [ja]carouselコンポーネントの使い方[/ja] * @example * <ons-carousel style="width: 100%; height: 200px"> * <ons-carousel-item> * ... * </ons-carousel-item> * <ons-carousel-item> * ... * </ons-carousel-item> * </ons-carousel> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this carousel.[/en] * [ja]このカルーセルを参照するための変数名を指定します。[/ja] */ /** * @attribute ons-postchange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postchange" event is fired.[/en] * [ja]"postchange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-refresh * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "refresh" event is fired.[/en] * [ja]"refresh"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-overscroll * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "overscroll" event is fired.[/en] * [ja]"overscroll"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsCarousel', ['$onsen', 'CarouselView', function ($onsen, CarouselView) { return { restrict: 'E', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var carousel = new CarouselView(scope, element, attrs); element.data('ons-carousel', carousel); $onsen.registerEventHandlers(carousel, 'postchange refresh overscroll destroy'); $onsen.declareVarAttribute(attrs, carousel); scope.$on('$destroy', function () { carousel._events = undefined; element.data('ons-carousel', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); module.directive('onsCarouselItem', function () { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { if (scope.$last) { element[0].parentElement._setup(); element[0].parentElement._setupInitialIndex(); element[0].parentElement._saveLastState(); } }; } }; }); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-dialog */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this dialog.[/en] * [ja]このダイアログを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsDialog', ['$onsen', 'DialogView', function ($onsen, DialogView) { return { restrict: 'E', scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var dialog = new DialogView(scope, element, attrs); $onsen.declareVarAttribute(attrs, dialog); $onsen.registerEventHandlers(dialog, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(dialog, element); element.data('ons-dialog', dialog); scope.$on('$destroy', function () { dialog._events = undefined; $onsen.removeModifierMethods(dialog); element.data('ons-dialog', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsDummyForInit', ['$rootScope', function ($rootScope) { var isReady = false; return { restrict: 'E', replace: false, link: { post: function post(scope, element) { if (!isReady) { isReady = true; $rootScope.$broadcast('$ons-ready'); } element.remove(); } } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-fab */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer the floating action button.[/en] * [ja]このフローティングアクションボタンを参照するための変数名をしてします。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsFab', ['$onsen', 'FabView', function ($onsen, FabView) { return { restrict: 'E', replace: false, scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var fab = new FabView(scope, element, attrs); element.data('ons-fab', fab); $onsen.declareVarAttribute(attrs, fab); scope.$on('$destroy', function () { element.data('ons-fab', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; var EVENTS = ('drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight ' + 'swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate').split(/ +/); angular.module('onsen').directive('onsGestureDetector', ['$onsen', function ($onsen) { var scopeDef = EVENTS.reduce(function (dict, name) { dict['ng' + titlize(name)] = '&'; return dict; }, {}); function titlize(str) { return str.charAt(0).toUpperCase() + str.slice(1); } return { restrict: 'E', scope: scopeDef, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. replace: false, transclude: true, compile: function compile(element, attrs) { return function link(scope, element, attrs, _, transclude) { transclude(scope.$parent, function (cloned) { element.append(cloned); }); var handler = function handler(event) { var attr = 'ng' + titlize(event.type); if (attr in scopeDef) { scope[attr]({ $event: event }); } }; var gestureDetector; setImmediate(function () { gestureDetector = element[0]._gestureDetector; gestureDetector.on(EVENTS.join(' '), handler); }); $onsen.cleaner.onDestroy(scope, function () { gestureDetector.off(EVENTS.join(' '), handler); $onsen.clearComponent({ scope: scope, element: element, attrs: attrs }); gestureDetector.element = scope = element = attrs = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-icon */ (function () { 'use strict'; angular.module('onsen').directive('onsIcon', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', compile: function compile(element, attrs) { if (attrs.icon.indexOf('{{') !== -1) { attrs.$observe('icon', function () { setImmediate(function () { return element[0]._update(); }); }); } return function (scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-icon' }); // $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-if-orientation * @category conditional * @description * [en]Conditionally display content depending on screen orientation. Valid values are portrait and landscape. Different from other components, this component is used as attribute in any element.[/en] * [ja]画面の向きに応じてコンテンツの制御を行います。portraitもしくはlandscapeを指定できます。すべての要素の属性に使用できます。[/ja] * @seealso ons-if-platform [en]ons-if-platform component[/en][ja]ons-if-platformコンポーネント[/ja] * @guide UtilityAPIs [en]Other utility APIs[/en][ja]他のユーティリティAPI[/ja] * @example * <div ons-if-orientation="portrait"> * <p>This will only be visible in portrait mode.</p> * </div> */ /** * @attribute ons-if-orientation * @initonly * @type {String} * @description * [en]Either "portrait" or "landscape".[/en] * [ja]portraitもしくはlandscapeを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsIfOrientation', ['$onsen', '$onsGlobal', function ($onsen, $onsGlobal) { return { restrict: 'A', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: false, compile: function compile(element) { element.css('display', 'none'); return function (scope, element, attrs) { element.addClass('ons-if-orientation-inner'); attrs.$observe('onsIfOrientation', update); $onsGlobal.orientation.on('change', update); update(); $onsen.cleaner.onDestroy(scope, function () { $onsGlobal.orientation.off('change', update); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); function update() { var userOrientation = ('' + attrs.onsIfOrientation).toLowerCase(); var orientation = getLandscapeOrPortrait(); if (userOrientation === 'portrait' || userOrientation === 'landscape') { if (userOrientation === orientation) { element.css('display', ''); } else { element.css('display', 'none'); } } } function getLandscapeOrPortrait() { return $onsGlobal.orientation.isPortrait() ? 'portrait' : 'landscape'; } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-if-platform * @category conditional * @description * [en]Conditionally display content depending on the platform / browser. Valid values are "opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios" and "wp".[/en] * [ja]プラットフォームやブラウザーに応じてコンテンツの制御をおこないます。opera, firefox, safari, chrome, ie, edge, android, blackberry, ios, wpのいずれかの値を空白区切りで複数指定できます。[/ja] * @seealso ons-if-orientation [en]ons-if-orientation component[/en][ja]ons-if-orientationコンポーネント[/ja] * @guide UtilityAPIs [en]Other utility APIs[/en][ja]他のユーティリティAPI[/ja] * @example * <div ons-if-platform="android"> * ... * </div> */ /** * @attribute ons-if-platform * @type {String} * @initonly * @description * [en]One or multiple space separated values: "opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios" or "wp".[/en] * [ja]"opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios", "wp"のいずれか空白区切りで複数指定できます。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsIfPlatform', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: false, compile: function compile(element) { element.addClass('ons-if-platform-inner'); element.css('display', 'none'); var platform = getPlatformString(); return function (scope, element, attrs) { attrs.$observe('onsIfPlatform', function (userPlatform) { if (userPlatform) { update(); } }); update(); $onsen.cleaner.onDestroy(scope, function () { $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); function update() { var userPlatforms = attrs.onsIfPlatform.toLowerCase().trim().split(/\s+/); if (userPlatforms.indexOf(platform.toLowerCase()) >= 0) { element.css('display', 'block'); } else { element.css('display', 'none'); } } }; function getPlatformString() { if (navigator.userAgent.match(/Android/i)) { return 'android'; } if (navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/RIM Tablet OS/i) || navigator.userAgent.match(/BB10/i)) { return 'blackberry'; } if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { return 'ios'; } if (navigator.userAgent.match(/Windows Phone|IEMobile|WPDesktop/i)) { return 'wp'; } // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; if (isOpera) { return 'opera'; } var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ if (isFirefox) { return 'firefox'; } var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; // At least Safari 3+: "[object HTMLElementConstructor]" if (isSafari) { return 'safari'; } var isEdge = navigator.userAgent.indexOf(' Edge/') >= 0; if (isEdge) { return 'edge'; } var isChrome = !!window.chrome && !isOpera && !isEdge; // Chrome 1+ if (isChrome) { return 'chrome'; } var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6 if (isIE) { return 'ie'; } return 'unknown'; } } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @ngdoc directive * @id input * @name ons-input * @category form * @description * [en]Input component.[/en] * [ja]inputコンポ―ネントです。[/ja] * @codepen ojQxLj * @guide UsingFormComponents * [en]Using form components[/en] * [ja]フォームを使う[/ja] * @guide EventHandling * [en]Event handling descriptions[/en] * [ja]イベント処理の使い方[/ja] * @example * <ons-input></ons-input> * <ons-input modifier="material" label="Username"></ons-input> */ /** * @ngdoc attribute * @name label * @type {String} * @description * [en]Text for animated floating label.[/en] * [ja]アニメーションさせるフローティングラベルのテキストを指定します。[/ja] */ /** * @ngdoc attribute * @name float * @description * [en]If this attribute is present, the label will be animated.[/en] * [ja]この属性が設定された時、ラベルはアニメーションするようになります。[/ja] */ /** * @ngdoc attribute * @name ng-model * @extensionOf angular * @description * [en]Bind the value to a model. Works just like for normal input elements.[/en] * [ja]この要素の値をモデルに紐付けます。通常のinput要素の様に動作します。[/ja] */ /** * @ngdoc attribute * @name ng-change * @extensionOf angular * @description * [en]Executes an expression when the value changes. Works just like for normal input elements.[/en] * [ja]値が変わった時にこの属性で指定したexpressionが実行されます。通常のinput要素の様に動作します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsInput', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var el = element[0]; var onInput = function onInput() { var set = $parse(attrs.ngModel).assign; if (el._isTextInput) { set(scope, el.value); } else if (el.type === 'radio' && el.checked) { set(scope, el.value); } else { set(scope, el.checked); } if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { if (el._isTextInput && typeof value !== 'undefined') { el.value = value; } else if (el.type === 'radio') { el.checked = value === el.value; } else { el.checked = value; } }); el._isTextInput ? element.on('input', onInput) : element.on('change', onInput); } scope.$on('$destroy', function () { el._isTextInput ? element.off('input', onInput) : element.off('change', onInput); scope = element = attrs = el = null; }); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-keyboard-active * @category form * @description * [en] * Conditionally display content depending on if the software keyboard is visible or hidden. * This component requires cordova and that the com.ionic.keyboard plugin is installed. * [/en] * [ja] * ソフトウェアキーボードが表示されているかどうかで、コンテンツを表示するかどうかを切り替えることが出来ます。 * このコンポーネントは、Cordovaやcom.ionic.keyboardプラグインを必要とします。 * [/ja] * @guide UtilityAPIs * [en]Other utility APIs[/en] * [ja]他のユーティリティAPI[/ja] * @example * <div ons-keyboard-active> * This will only be displayed if the software keyboard is open. * </div> * <div ons-keyboard-inactive> * There is also a component that does the opposite. * </div> */ /** * @attribute ons-keyboard-active * @description * [en]The content of tags with this attribute will be visible when the software keyboard is open.[/en] * [ja]この属性がついた要素は、ソフトウェアキーボードが表示された時に初めて表示されます。[/ja] */ /** * @attribute ons-keyboard-inactive * @description * [en]The content of tags with this attribute will be visible when the software keyboard is hidden.[/en] * [ja]この属性がついた要素は、ソフトウェアキーボードが隠れている時のみ表示されます。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); var compileFunction = function compileFunction(show, $onsen) { return function (element) { return function (scope, element, attrs) { var dispShow = show ? 'block' : 'none', dispHide = show ? 'none' : 'block'; var onShow = function onShow() { element.css('display', dispShow); }; var onHide = function onHide() { element.css('display', dispHide); }; var onInit = function onInit(e) { if (e.visible) { onShow(); } else { onHide(); } }; ons.softwareKeyboard.on('show', onShow); ons.softwareKeyboard.on('hide', onHide); ons.softwareKeyboard.on('init', onInit); if (ons.softwareKeyboard._visible) { onShow(); } else { onHide(); } $onsen.cleaner.onDestroy(scope, function () { ons.softwareKeyboard.off('show', onShow); ons.softwareKeyboard.off('hide', onHide); ons.softwareKeyboard.off('init', onInit); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); }; }; }; module.directive('onsKeyboardActive', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, compile: compileFunction(true, $onsen) }; }]); module.directive('onsKeyboardInactive', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, compile: compileFunction(false, $onsen) }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-lazy-repeat * @description * [en] * Using this component a list with millions of items can be rendered without a drop in performance. * It does that by "lazily" loading elements into the DOM when they come into view and * removing items from the DOM when they are not visible. * [/en] * [ja] * このコンポーネント内で描画されるアイテムのDOM要素の読み込みは、画面に見えそうになった時まで自動的に遅延され、 * 画面から見えなくなった場合にはその要素は動的にアンロードされます。 * このコンポーネントを使うことで、パフォーマンスを劣化させること無しに巨大な数の要素を描画できます。 * [/ja] * @codepen QwrGBm * @guide UsingLazyRepeat * [en]How to use Lazy Repeat[/en] * [ja]レイジーリピートの使い方[/ja] * @example * <script> * ons.bootstrap() * * .controller('MyController', function($scope) { * $scope.MyDelegate = { * countItems: function() { * // Return number of items. * return 1000000; * }, * * calculateItemHeight: function(index) { * // Return the height of an item in pixels. * return 45; * }, * * configureItemScope: function(index, itemScope) { * // Initialize scope * itemScope.item = 'Item #' + (index + 1); * }, * * destroyItemScope: function(index, itemScope) { * // Optional method that is called when an item is unloaded. * console.log('Destroyed item with index: ' + index); * } * }; * }); * </script> * * <ons-list ng-controller="MyController"> * <ons-list-item ons-lazy-repeat="MyDelegate"> * {{ item }} * </ons-list-item> * </ons-list> */ /** * @attribute ons-lazy-repeat * @type {Expression} * @initonly * @description * [en]A delegate object, can be either an object attached to the scope (when using AngularJS) or a normal JavaScript variable.[/en] * [ja]要素のロード、アンロードなどの処理を委譲するオブジェクトを指定します。AngularJSのスコープの変数名や、通常のJavaScriptの変数名を指定します。[/ja] */ /** * @property delegate.configureItemScope * @type {Function} * @description * [en]Function which recieves an index and the scope for the item. Can be used to configure values in the item scope.[/en] * [ja][/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); /** * Lazy repeat directive. */ module.directive('onsLazyRepeat', ['$onsen', 'LazyRepeatView', function ($onsen, LazyRepeatView) { return { restrict: 'A', replace: false, priority: 1000, terminal: true, compile: function compile(element, attrs) { return function (scope, element, attrs) { var lazyRepeat = new LazyRepeatView(scope, element, attrs); scope.$on('$destroy', function () { scope = element = attrs = lazyRepeat = null; }); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsList', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsListHeader', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-listHeader' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsListItem', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list-item' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-loading-placeholder * @category util * @description * [en]Display a placeholder while the content is loading.[/en] * [ja]Onsen UIが読み込まれるまでに表示するプレースホルダーを表現します。[/ja] * @guide UtilityAPIs [en]Other utility APIs[/en][ja]他のユーティリティAPI[/ja] * @example * <div ons-loading-placeholder="page.html"> * Loading... * </div> */ /** * @attribute ons-loading-placeholder * @initonly * @type {String} * @description * [en]The url of the page to load.[/en] * [ja]読み込むページのURLを指定します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsLoadingPlaceholder', function () { return { restrict: 'A', link: function link(scope, element, attrs) { if (attrs.onsLoadingPlaceholder) { ons._resolveLoadingPlaceholder(element[0], attrs.onsLoadingPlaceholder, function (contentElement, done) { ons.compile(contentElement); scope.$evalAsync(function () { setImmediate(done); }); }); } } }; }); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-modal */ /** * @attribute var * @type {String} * @initonly * @description * [en]Variable name to refer this modal.[/en] * [ja]このモーダルを参照するための名前を指定します。[/ja] */ (function () { 'use strict'; /** * Modal directive. */ angular.module('onsen').directive('onsModal', ['$onsen', 'ModalView', function ($onsen, ModalView) { return { restrict: 'E', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var modal = new ModalView(scope, element, attrs); $onsen.addModifierMethodsForCustomElements(modal, element); $onsen.declareVarAttribute(attrs, modal); element.data('ons-modal', modal); scope.$on('$destroy', function () { $onsen.removeModifierMethods(modal); element.data('ons-modal', undefined); modal = element = scope = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-navigator * @example * <ons-navigator animation="slide" var="app.navi"> * <ons-page> * <ons-toolbar> * <div class="center">Title</div> * </ons-toolbar> * * <p style="text-align: center"> * <ons-button modifier="light" ng-click="app.navi.pushPage('page.html');">Push</ons-button> * </p> * </ons-page> * </ons-navigator> * * <ons-template id="page.html"> * <ons-page> * <ons-toolbar> * <div class="center">Title</div> * </ons-toolbar> * * <p style="text-align: center"> * <ons-button modifier="light" ng-click="app.navi.popPage();">Pop</ons-button> * </p> * </ons-page> * </ons-template> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this navigator.[/en] * [ja]このナビゲーターを参照するための名前を指定します。[/ja] */ /** * @attribute ons-prepush * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prepush" event is fired.[/en] * [ja]"prepush"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prepop * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prepop" event is fired.[/en] * [ja]"prepop"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postpush * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postpush" event is fired.[/en] * [ja]"postpush"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postpop * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postpop" event is fired.[/en] * [ja]"postpop"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; var lastReady = window.ons.NavigatorElement.rewritables.ready; window.ons.NavigatorElement.rewritables.ready = ons._waitDiretiveInit('ons-navigator', lastReady); var lastLink = window.ons.NavigatorElement.rewritables.link; window.ons.NavigatorElement.rewritables.link = function (navigatorElement, target, options, callback) { var view = angular.element(navigatorElement).data('ons-navigator'); view._compileAndLink(target, function (target) { lastLink(navigatorElement, target, options, callback); }); }; angular.module('onsen').directive('onsNavigator', ['NavigatorView', '$onsen', function (NavigatorView, $onsen) { return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: true, compile: function compile(element) { return { pre: function pre(scope, element, attrs, controller) { var navigator = new NavigatorView(scope, element, attrs); $onsen.declareVarAttribute(attrs, navigator); $onsen.registerEventHandlers(navigator, 'prepush prepop postpush postpop init show hide destroy'); element.data('ons-navigator', navigator); scope.$on('$destroy', function () { navigator._events = undefined; element.data('ons-navigator', undefined); element = null; }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-page */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this page.[/en] * [ja]このページを参照するための名前を指定します。[/ja] */ /** * @attribute ng-infinite-scroll * @initonly * @type {String} * @description * [en]Path of the function to be executed on infinite scrolling. The path is relative to $scope. The function receives a done callback that must be called when it's finished.[/en] * [ja][/ja] */ /** * @attribute on-device-back-button * @type {Expression} * @description * [en]Allows you to specify custom behavior when the back button is pressed.[/en] * [ja]デバイスのバックボタンが押された時の挙動を設定できます。[/ja] */ /** * @attribute ng-device-back-button * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior with an AngularJS expression when the back button is pressed.[/en] * [ja]デバイスのバックボタンが押された時の挙動を設定できます。AngularJSのexpressionを指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "init" event is fired.[/en] * [ja]"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "show" event is fired.[/en] * [ja]"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "hide" event is fired.[/en] * [ja]"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsPage', ['$onsen', 'PageView', function ($onsen, PageView) { function firePageInitEvent(element) { // TODO: remove dirty fix var i = 0, f = function f() { if (i++ < 15) { if (isAttached(element)) { $onsen.fireComponentEvent(element, 'init'); fireActualPageInitEvent(element); } else { if (i > 10) { setTimeout(f, 1000 / 60); } else { setImmediate(f); } } } else { throw new Error('Fail to fire "pageinit" event. Attach "ons-page" element to the document after initialization.'); } }; f(); } function fireActualPageInitEvent(element) { var event = document.createEvent('HTMLEvents'); event.initEvent('pageinit', true, true); element.dispatchEvent(event); } function isAttached(element) { if (document.documentElement === element) { return true; } return element.parentNode ? isAttached(element.parentNode) : false; } return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var page = new PageView(scope, element, attrs); $onsen.declareVarAttribute(attrs, page); $onsen.registerEventHandlers(page, 'init show hide destroy'); element.data('ons-page', page); $onsen.addModifierMethodsForCustomElements(page, element); element.data('_scope', scope); $onsen.cleaner.onDestroy(scope, function () { page._events = undefined; $onsen.removeModifierMethods(page); element.data('ons-page', undefined); element.data('_scope', undefined); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); scope = element = attrs = null; }); }, post: function postLink(scope, element, attrs) { firePageInitEvent(element[0]); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-popover */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this popover.[/en] * [ja]このポップオーバーを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsPopover', ['$onsen', 'PopoverView', function ($onsen, PopoverView) { return { restrict: 'E', replace: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var popover = new PopoverView(scope, element, attrs); $onsen.declareVarAttribute(attrs, popover); $onsen.registerEventHandlers(popover, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(popover, element); element.data('ons-popover', popover); scope.$on('$destroy', function () { popover._events = undefined; $onsen.removeModifierMethods(popover); element.data('ons-popover', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-pull-hook * @example * <script> * ons.bootstrap() * * .controller('MyController', function($scope, $timeout) { * $scope.items = [3, 2 ,1]; * * $scope.load = function($done) { * $timeout(function() { * $scope.items.unshift($scope.items.length + 1); * $done(); * }, 1000); * }; * }); * </script> * * <ons-page ng-controller="MyController"> * <ons-pull-hook var="loader" ng-action="load($done)"> * <span ng-switch="loader.state"> * <span ng-switch-when="initial">Pull down to refresh</span> * <span ng-switch-when="preaction">Release to refresh</span> * <span ng-switch-when="action">Loading data. Please wait...</span> * </span> * </ons-pull-hook> * <ons-list> * <ons-list-item ng-repeat="item in items"> * Item #{{ item }} * </ons-list-item> * </ons-list> * </ons-page> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this component.[/en] * [ja]このコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ng-action * @initonly * @type {Expression} * @description * [en]Use to specify custom behavior when the page is pulled down. A <code>$done</code> function is available to tell the component that the action is completed.[/en] * [ja]pull downしたときの振る舞いを指定します。アクションが完了した時には<code>$done</code>関数を呼び出します。[/ja] */ /** * @attribute ons-changestate * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "changestate" event is fired.[/en] * [ja]"changestate"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; /** * Pull hook directive. */ angular.module('onsen').directive('onsPullHook', ['$onsen', 'PullHookView', function ($onsen, PullHookView) { return { restrict: 'E', replace: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var pullHook = new PullHookView(scope, element, attrs); $onsen.declareVarAttribute(attrs, pullHook); $onsen.registerEventHandlers(pullHook, 'changestate destroy'); element.data('ons-pull-hook', pullHook); scope.$on('$destroy', function () { pullHook._events = undefined; element.data('ons-pull-hook', undefined); scope = element = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsRange', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var onInput = function onInput() { var set = $parse(attrs.ngModel).assign; set(scope, element[0].value); if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { element[0].value = value; }); element.on('input', onInput); } scope.$on('$destroy', function () { element.off('input', onInput); scope = element = attrs = null; }); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsRipple', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-ripple' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-scope * @category util * @description * [en]All child elements using the "var" attribute will be attached to the scope of this element.[/en] * [ja]"var"属性を使っている全ての子要素のviewオブジェクトは、この要素のAngularJSスコープに追加されます。[/ja] * @example * <ons-list> * <ons-list-item ons-scope ng-repeat="item in items"> * <ons-carousel var="carousel"> * <ons-carousel-item ng-click="carousel.next()"> * {{ item }} * </ons-carousel-item> * </ons-carousel-item ng-click="carousel.prev()"> * ... * </ons-carousel-item> * </ons-carousel> * </ons-list-item> * </ons-list> */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsScope', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, link: function link(scope, element) { element.data('_scope', scope); scope.$on('$destroy', function () { element.data('_scope', undefined); }); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-sliding-menu * @category menu * @description * [en]Component for sliding UI where one page is overlayed over another page. The above page can be slided aside to reveal the page behind.[/en] * [ja]スライディングメニューを表現するためのコンポーネントで、片方のページが別のページの上にオーバーレイで表示されます。above-pageで指定されたページは、横からスライドして表示します。[/ja] * @codepen IDvFJ * @seealso ons-page * [en]ons-page component[/en] * [ja]ons-pageコンポーネント[/ja] * @guide UsingSlidingMenu * [en]Using sliding menu[/en] * [ja]スライディングメニューを使う[/ja] * @guide EventHandling * [en]Using events[/en] * [ja]イベントの利用[/ja] * @guide CallingComponentAPIsfromJavaScript * [en]Using navigator from JavaScript[/en] * [ja]JavaScriptからコンポーネントを呼び出す[/ja] * @guide DefiningMultiplePagesinSingleHTML * [en]Defining multiple pages in single html[/en] * [ja]複数のページを1つのHTMLに記述する[/ja] * @example * <ons-sliding-menu var="app.menu" main-page="page.html" menu-page="menu.html" max-slide-distance="200px" type="reveal" side="left"> * </ons-sliding-menu> * * <ons-template id="page.html"> * <ons-page> * <p style="text-align: center"> * <ons-button ng-click="app.menu.toggleMenu()">Toggle</ons-button> * </p> * </ons-page> * </ons-template> * * <ons-template id="menu.html"> * <ons-page> * <!-- menu page's contents --> * </ons-page> * </ons-template> * */ /** * @event preopen * @description * [en]Fired just before the sliding menu is opened.[/en] * [ja]スライディングメニューが開く前に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクトです。[/ja] * @param {Object} event.slidingMenu * [en]Sliding menu view object.[/en] * [ja]イベントが発火したSlidingMenuオブジェクトです。[/ja] */ /** * @event postopen * @description * [en]Fired just after the sliding menu is opened.[/en] * [ja]スライディングメニューが開き終わった後に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクトです。[/ja] * @param {Object} event.slidingMenu * [en]Sliding menu view object.[/en] * [ja]イベントが発火したSlidingMenuオブジェクトです。[/ja] */ /** * @event preclose * @description * [en]Fired just before the sliding menu is closed.[/en] * [ja]スライディングメニューが閉じる前に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクトです。[/ja] * @param {Object} event.slidingMenu * [en]Sliding menu view object.[/en] * [ja]イベントが発火したSlidingMenuオブジェクトです。[/ja] */ /** * @event postclose * @description * [en]Fired just after the sliding menu is closed.[/en] * [ja]スライディングメニューが閉じ終わった後に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクトです。[/ja] * @param {Object} event.slidingMenu * [en]Sliding menu view object.[/en] * [ja]イベントが発火したSlidingMenuオブジェクトです。[/ja] */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this sliding menu.[/en] * [ja]このスライディングメニューを参照するための名前を指定します。[/ja] */ /** * @attribute menu-page * @initonly * @type {String} * @description * [en]The url of the menu page.[/en] * [ja]左に位置するメニューページのURLを指定します。[/ja] */ /** * @attribute main-page * @initonly * @type {String} * @description * [en]The url of the main page.[/en] * [ja]右に位置するメインページのURLを指定します。[/ja] */ /** * @attribute swipeable * @initonly * @type {Boolean} * @description * [en]Whether to enable swipe interaction.[/en] * [ja]スワイプ操作を有効にする場合に指定します。[/ja] */ /** * @attribute swipe-target-width * @initonly * @type {String} * @description * [en]The width of swipeable area calculated from the left (in pixels). Use this to enable swipe only when the finger touch on the screen edge.[/en] * [ja]スワイプの判定領域をピクセル単位で指定します。画面の端から指定した距離に達するとページが表示されます。[/ja] */ /** * @attribute max-slide-distance * @initonly * @type {String} * @description * [en]How far the menu page will slide open. Can specify both in px and %. eg. 90%, 200px[/en] * [ja]menu-pageで指定されたページの表示幅を指定します。ピクセルもしくは%の両方で指定できます(例: 90%, 200px)[/ja] */ /** * @attribute side * @initonly * @type {String} * @description * [en]Specify which side of the screen the menu page is located on. Possible values are "left" and "right".[/en] * [ja]menu-pageで指定されたページが画面のどちら側から表示されるかを指定します。leftもしくはrightのいずれかを指定できます。[/ja] */ /** * @attribute type * @initonly * @type {String} * @description * [en]Sliding menu animator. Possible values are reveal (default), push and overlay.[/en] * [ja]スライディングメニューのアニメーションです。"reveal"(デフォルト)、"push"、"overlay"のいずれかを指定できます。[/ja] */ /** * @attribute ons-preopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preopen" event is fired.[/en] * [ja]"preopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-preclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preclose" event is fired.[/en] * [ja]"preclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postopen" event is fired.[/en] * [ja]"postopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postclose" event is fired.[/en] * [ja]"postclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method setMainPage * @signature setMainPage(pageUrl, [options]) * @param {String} pageUrl * [en]Page URL. Can be either an HTML document or an <code>&lt;ons-template&gt;</code>.[/en] * [ja]pageのURLか、ons-templateで宣言したテンプレートのid属性の値を指定します。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Boolean} [options.closeMenu] * [en]If true the menu will be closed.[/en] * [ja]trueを指定すると、開いているメニューを閉じます。[/ja] * @param {Function} [options.callback] * [en]Function that is executed after the page has been set.[/en] * [ja]ページが読み込まれた後に呼び出される関数オブジェクトを指定します。[/ja] * @description * [en]Show the page specified in pageUrl in the main contents pane.[/en] * [ja]中央部分に表示されるページをpageUrlに指定します。[/ja] */ /** * @method setMenuPage * @signature setMenuPage(pageUrl, [options]) * @param {String} pageUrl * [en]Page URL. Can be either an HTML document or an <code>&lt;ons-template&gt;</code>.[/en] * [ja]pageのURLか、ons-templateで宣言したテンプレートのid属性の値を指定します。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Boolean} [options.closeMenu] * [en]If true the menu will be closed after the menu page has been set.[/en] * [ja]trueを指定すると、開いているメニューを閉じます。[/ja] * @param {Function} [options.callback] * [en]This function will be executed after the menu page has been set.[/en] * [ja]メニューページが読み込まれた後に呼び出される関数オブジェクトを指定します。[/ja] * @description * [en]Show the page specified in pageUrl in the side menu pane.[/en] * [ja]メニュー部分に表示されるページをpageUrlに指定します。[/ja] */ /** * @method openMenu * @signature openMenu([options]) * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Function} [options.callback] * [en]This function will be called after the menu has been opened.[/en] * [ja]メニューが開いた後に呼び出される関数オブジェクトを指定します。[/ja] * @description * [en]Slide the above layer to reveal the layer behind.[/en] * [ja]メニューページを表示します。[/ja] */ /** * @method closeMenu * @signature closeMenu([options]) * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Function} [options.callback] * [en]This function will be called after the menu has been closed.[/en] * [ja]メニューが閉じられた後に呼び出される関数オブジェクトを指定します。[/ja] * @description * [en]Slide the above layer to hide the layer behind.[/en] * [ja]メニューページを非表示にします。[/ja] */ /** * @method toggleMenu * @signature toggleMenu([options]) * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Function} [options.callback] * [en]This function will be called after the menu has been opened or closed.[/en] * [ja]メニューが開き終わった後か、閉じ終わった後に呼び出される関数オブジェクトです。[/ja] * @description * [en]Slide the above layer to reveal the layer behind if it is currently hidden, otherwise, hide the layer behind.[/en] * [ja]現在の状況に合わせて、メニューページを表示もしくは非表示にします。[/ja] */ /** * @method isMenuOpened * @signature isMenuOpened() * @return {Boolean} * [en]true if the menu is currently open.[/en] * [ja]メニューが開いていればtrueとなります。[/ja] * @description * [en]Returns true if the menu page is open, otherwise false.[/en] * [ja]メニューページが開いている場合はtrue、そうでない場合はfalseを返します。[/ja] */ /** * @method getDeviceBackButtonHandler * @signature getDeviceBackButtonHandler() * @return {Object} * [en]Device back button handler.[/en] * [ja]デバイスのバックボタンハンドラを返します。[/ja] * @description * [en]Retrieve the back-button handler.[/en] * [ja]ons-sliding-menuに紐付いているバックボタンハンドラを取得します。[/ja] */ /** * @method setSwipeable * @signature setSwipeable(swipeable) * @param {Boolean} swipeable * [en]If true the menu will be swipeable.[/en] * [ja]スワイプで開閉できるようにする場合にはtrueを指定します。[/ja] * @description * [en]Specify if the menu should be swipeable or not.[/en] * [ja]スワイプで開閉するかどうかを設定する。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsSlidingMenu', ['$compile', 'SlidingMenuView', '$onsen', function ($compile, SlidingMenuView, $onsen) { return { restrict: 'E', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: true, compile: function compile(element, attrs) { var main = element[0].querySelector('.main'), menu = element[0].querySelector('.menu'); if (main) { var mainHtml = angular.element(main).remove().html().trim(); } if (menu) { var menuHtml = angular.element(menu).remove().html().trim(); } return function (scope, element, attrs) { element.append(angular.element('<div></div>').addClass('onsen-sliding-menu__menu ons-sliding-menu-inner')); element.append(angular.element('<div></div>').addClass('onsen-sliding-menu__main ons-sliding-menu-inner')); var slidingMenu = new SlidingMenuView(scope, element, attrs); $onsen.registerEventHandlers(slidingMenu, 'preopen preclose postopen postclose init show hide destroy'); if (mainHtml && !attrs.mainPage) { slidingMenu._appendMainPage(null, mainHtml); } if (menuHtml && !attrs.menuPage) { slidingMenu._appendMenuPage(menuHtml); } $onsen.declareVarAttribute(attrs, slidingMenu); element.data('ons-sliding-menu', slidingMenu); scope.$on('$destroy', function () { slidingMenu._events = undefined; element.data('ons-sliding-menu', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-speed-dial */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer the speed dial.[/en] * [ja]このスピードダイアルを参照するための変数名をしてします。[/ja] */ /** * @attribute ons-open * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "open" event is fired.[/en] * [ja]"open"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-close * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "close" event is fired.[/en] * [ja]"close"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsSpeedDial', ['$onsen', 'SpeedDialView', function ($onsen, SpeedDialView) { return { restrict: 'E', replace: false, scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var speedDial = new SpeedDialView(scope, element, attrs); element.data('ons-speed-dial', speedDial); $onsen.registerEventHandlers(speedDial, 'open close'); $onsen.declareVarAttribute(attrs, speedDial); scope.$on('$destroy', function () { speedDial._events = undefined; element.data('ons-speed-dial', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-split-view * @category control * @description * [en]Divides the screen into a left and right section.[/en] * [ja]画面を左右に分割するコンポーネントです。[/ja] * @codepen nKqfv {wide} * @guide Usingonssplitviewcomponent * [en]Using ons-split-view.[/en] * [ja]ons-split-viewコンポーネントを使う[/ja] * @guide CallingComponentAPIsfromJavaScript * [en]Using navigator from JavaScript[/en] * [ja]JavaScriptからコンポーネントを呼び出す[/ja] * @example * <ons-split-view * secondary-page="secondary.html" * main-page="main.html" * main-page-width="70%" * collapse="portrait"> * </ons-split-view> */ /** * @event update * @description * [en]Fired when the split view is updated.[/en] * [ja]split viewの状態が更新された際に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクトです。[/ja] * @param {Object} event.splitView * [en]Split view object.[/en] * [ja]イベントが発火したSplitViewオブジェクトです。[/ja] * @param {Boolean} event.shouldCollapse * [en]True if the view should collapse.[/en] * [ja]collapse状態の場合にtrueになります。[/ja] * @param {String} event.currentMode * [en]Current mode.[/en] * [ja]現在のモード名を返します。"collapse"か"split"かのいずれかです。[/ja] * @param {Function} event.split * [en]Call to force split.[/en] * [ja]この関数を呼び出すと強制的にsplitモードにします。[/ja] * @param {Function} event.collapse * [en]Call to force collapse.[/en] * [ja]この関数を呼び出すと強制的にcollapseモードにします。[/ja] * @param {Number} event.width * [en]Current width.[/en] * [ja]現在のSplitViewの幅を返します。[/ja] * @param {String} event.orientation * [en]Current orientation.[/en] * [ja]現在の画面のオリエンテーションを返します。"portrait"かもしくは"landscape"です。 [/ja] */ /** * @event presplit * @description * [en]Fired just before the view is split.[/en] * [ja]split状態にる前に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクト。[/ja] * @param {Object} event.splitView * [en]Split view object.[/en] * [ja]イベントが発火したSplitViewオブジェクトです。[/ja] * @param {Number} event.width * [en]Current width.[/en] * [ja]現在のSplitViewnの幅です。[/ja] * @param {String} event.orientation * [en]Current orientation.[/en] * [ja]現在の画面のオリエンテーションを返します。"portrait"もしくは"landscape"です。[/ja] */ /** * @event postsplit * @description * [en]Fired just after the view is split.[/en] * [ja]split状態になった後に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクト。[/ja] * @param {Object} event.splitView * [en]Split view object.[/en] * [ja]イベントが発火したSplitViewオブジェクトです。[/ja] * @param {Number} event.width * [en]Current width.[/en] * [ja]現在のSplitViewnの幅です。[/ja] * @param {String} event.orientation * [en]Current orientation.[/en] * [ja]現在の画面のオリエンテーションを返します。"portrait"もしくは"landscape"です。[/ja] */ /** * @event precollapse * @description * [en]Fired just before the view is collapsed.[/en] * [ja]collapse状態になる前に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクト。[/ja] * @param {Object} event.splitView * [en]Split view object.[/en] * [ja]イベントが発火したSplitViewオブジェクトです。[/ja] * @param {Number} event.width * [en]Current width.[/en] * [ja]現在のSplitViewnの幅です。[/ja] * @param {String} event.orientation * [en]Current orientation.[/en] * [ja]現在の画面のオリエンテーションを返します。"portrait"もしくは"landscape"です。[/ja] */ /** * @event postcollapse * @description * [en]Fired just after the view is collapsed.[/en] * [ja]collapse状態になった後に発火します。[/ja] * @param {Object} event * [en]Event object.[/en] * [ja]イベントオブジェクト。[/ja] * @param {Object} event.splitView * [en]Split view object.[/en] * [ja]イベントが発火したSplitViewオブジェクトです。[/ja] * @param {Number} event.width * [en]Current width.[/en] * [ja]現在のSplitViewnの幅です。[/ja] * @param {String} event.orientation * [en]Current orientation.[/en] * [ja]現在の画面のオリエンテーションを返します。"portrait"もしくは"landscape"です。[/ja] */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this split view.[/en] * [ja]このスプリットビューコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute main-page * @initonly * @type {String} * @description * [en]The url of the page on the right.[/en] * [ja]右側に表示するページのURLを指定します。[/ja] */ /** * @attribute main-page-width * @initonly * @type {Number} * @description * [en]Main page width percentage. The secondary page width will be the remaining percentage.[/en] * [ja]右側のページの幅をパーセント単位で指定します。[/ja] */ /** * @attribute secondary-page * @initonly * @type {String} * @description * [en]The url of the page on the left.[/en] * [ja]左側に表示するページのURLを指定します。[/ja] */ /** * @attribute collapse * @initonly * @type {String} * @description * [en] * Specify the collapse behavior. Valid values are portrait, landscape, width #px or a media query. * "portrait" or "landscape" means the view will collapse when device is in landscape or portrait orientation. * "width #px" means the view will collapse when the window width is smaller than the specified #px. * If the value is a media query, the view will collapse when the media query is true. * [/en] * [ja] * 左側のページを非表示にする条件を指定します。portrait, landscape、width #pxもしくはメディアクエリの指定が可能です。 * portraitもしくはlandscapeを指定すると、デバイスの画面が縦向きもしくは横向きになった時に適用されます。 * width #pxを指定すると、画面が指定した横幅よりも短い場合に適用されます。 * メディアクエリを指定すると、指定したクエリに適合している場合に適用されます。 * [/ja] */ /** * @attribute ons-update * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "update" event is fired.[/en] * [ja]"update"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-presplit * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "presplit" event is fired.[/en] * [ja]"presplit"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-precollapse * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "precollapse" event is fired.[/en] * [ja]"precollapse"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postsplit * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postsplit" event is fired.[/en] * [ja]"postsplit"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postcollapse * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postcollapse" event is fired.[/en] * [ja]"postcollapse"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method setMainPage * @signature setMainPage(pageUrl) * @param {String} pageUrl * [en]Page URL. Can be either an HTML document or an <ons-template>.[/en] * [ja]pageのURLか、ons-templateで宣言したテンプレートのid属性の値を指定します。[/ja] * @description * [en]Show the page specified in pageUrl in the right section[/en] * [ja]指定したURLをメインページを読み込みます。[/ja] */ /** * @method setSecondaryPage * @signature setSecondaryPage(pageUrl) * @param {String} pageUrl * [en]Page URL. Can be either an HTML document or an <ons-template>.[/en] * [ja]pageのURLか、ons-templateで宣言したテンプレートのid属性の値を指定します。[/ja] * @description * [en]Show the page specified in pageUrl in the left section[/en] * [ja]指定したURLを左のページの読み込みます。[/ja] */ /** * @method update * @signature update() * @description * [en]Trigger an 'update' event and try to determine if the split behavior should be changed.[/en] * [ja]splitモードを変えるべきかどうかを判断するための'update'イベントを発火します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsSplitView', ['$compile', 'SplitView', '$onsen', function ($compile, SplitView, $onsen) { return { restrict: 'E', replace: false, transclude: false, scope: true, compile: function compile(element, attrs) { var mainPage = element[0].querySelector('.main-page'), secondaryPage = element[0].querySelector('.secondary-page'); if (mainPage) { var mainHtml = angular.element(mainPage).remove().html().trim(); } if (secondaryPage) { var secondaryHtml = angular.element(secondaryPage).remove().html().trim(); } return function (scope, element, attrs) { element.append(angular.element('<div></div>').addClass('onsen-split-view__secondary full-screen ons-split-view-inner')); element.append(angular.element('<div></div>').addClass('onsen-split-view__main full-screen ons-split-view-inner')); var splitView = new SplitView(scope, element, attrs); if (mainHtml && !attrs.mainPage) { splitView._appendMainPage(mainHtml); } if (secondaryHtml && !attrs.secondaryPage) { splitView._appendSecondPage(secondaryHtml); } $onsen.declareVarAttribute(attrs, splitView); $onsen.registerEventHandlers(splitView, 'update presplit precollapse postsplit postcollapse init show hide destroy'); element.data('ons-split-view', splitView); scope.$on('$destroy', function () { splitView._events = undefined; element.data('ons-split-view', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-splitter */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this split view.[/en] * [ja]このスプリットビューコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsSplitter', ['$compile', 'Splitter', '$onsen', function ($compile, Splitter, $onsen) { return { restrict: 'E', scope: true, compile: function compile(element, attrs) { return function (scope, element, attrs) { var splitter = new Splitter(scope, element, attrs); $onsen.declareVarAttribute(attrs, splitter); $onsen.registerEventHandlers(splitter, 'destroy'); element.data('ons-splitter', splitter); scope.$on('$destroy', function () { splitter._events = undefined; element.data('ons-splitter', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-splitter-content */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { 'use strict'; var lastReady = window.ons.SplitterContentElement.rewritables.ready; window.ons.SplitterContentElement.rewritables.ready = ons._waitDiretiveInit('ons-splitter-content', lastReady); var lastLink = window.ons.SplitterContentElement.rewritables.link; window.ons.SplitterContentElement.rewritables.link = function (element, target, options, callback) { var view = angular.element(element).data('ons-splitter-content'); lastLink(element, target, options, function (target) { view._link(target, callback); }); }; angular.module('onsen').directive('onsSplitterContent', ['$compile', 'SplitterContent', '$onsen', function ($compile, SplitterContent, $onsen) { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { var view = new SplitterContent(scope, element, attrs); $onsen.declareVarAttribute(attrs, view); $onsen.registerEventHandlers(view, 'destroy'); element.data('ons-splitter-content', view); scope.$on('$destroy', function () { view._events = undefined; element.data('ons-splitter-content', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-splitter-side */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-preopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preopen" event is fired.[/en] * [ja]"preopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-preclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preclose" event is fired.[/en] * [ja]"preclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postopen" event is fired.[/en] * [ja]"postopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postclose" event is fired.[/en] * [ja]"postclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { 'use strict'; var lastReady = window.ons.SplitterSideElement.rewritables.ready; window.ons.SplitterSideElement.rewritables.ready = ons._waitDiretiveInit('ons-splitter-side', lastReady); var lastLink = window.ons.SplitterSideElement.rewritables.link; window.ons.SplitterSideElement.rewritables.link = function (element, target, options, callback) { var view = angular.element(element).data('ons-splitter-side'); lastLink(element, target, options, function (target) { view._link(target, callback); }); }; angular.module('onsen').directive('onsSplitterSide', ['$compile', 'SplitterSide', '$onsen', function ($compile, SplitterSide, $onsen) { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { var view = new SplitterSide(scope, element, attrs); $onsen.declareVarAttribute(attrs, view); $onsen.registerEventHandlers(view, 'destroy'); element.data('ons-splitter-side', view); scope.$on('$destroy', function () { view._events = undefined; element.data('ons-splitter-side', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-switch */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this switch.[/en] * [ja]JavaScriptから参照するための変数名を指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsSwitch', ['$onsen', 'SwitchView', function ($onsen, SwitchView) { return { restrict: 'E', replace: false, scope: true, link: function link(scope, element, attrs) { if (attrs.ngController) { throw new Error('This element can\'t accept ng-controller directive.'); } var switchView = new SwitchView(element, scope, attrs); $onsen.addModifierMethodsForCustomElements(switchView, element); $onsen.declareVarAttribute(attrs, switchView); element.data('ons-switch', switchView); $onsen.cleaner.onDestroy(scope, function () { switchView._events = undefined; $onsen.removeModifierMethods(switchView); element.data('ons-switch', undefined); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = attrs = scope = null; }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; tab.$inject = ['$onsen']; angular.module('onsen').directive('onsTab', tab).directive('onsTabbarItem', tab); // for BC function tab($onsen) { return { restrict: 'E', link: function link(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } }; } })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-tabbar */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this tab bar.[/en] * [ja]このタブバーを参照するための名前を指定します。[/ja] */ /** * @attribute hide-tabs * @initonly * @type {Boolean} * @default false * @description * [en]Whether to hide the tabs. Valid values are true/false.[/en] * [ja]タブを非表示にする場合に指定します。trueもしくはfalseを指定できます。[/ja] */ /** * @attribute ons-reactive * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "reactive" event is fired.[/en] * [ja]"reactive"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prechange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prechange" event is fired.[/en] * [ja]"prechange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postchange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postchange" event is fired.[/en] * [ja]"postchange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { 'use strict'; var lastReady = window.ons.TabbarElement.rewritables.ready; window.ons.TabbarElement.rewritables.ready = ons._waitDiretiveInit('ons-tabbar', lastReady); var lastLink = window.ons.TabbarElement.rewritables.link; window.ons.TabbarElement.rewritables.link = function (tabbarElement, target, options, callback) { var view = angular.element(tabbarElement).data('ons-tabbar'); view._compileAndLink(target, function (target) { lastLink(tabbarElement, target, options, callback); }); }; var lastUnlink = window.ons.TabbarElement.rewritables.unlink; window.ons.TabbarElement.rewritables.unlink = function (tabbarElement, target, callback) { angular.element(target).data('_scope').$destroy(); lastUnlink(tabbarElement, target, callback); }; angular.module('onsen').directive('onsTabbar', ['$onsen', '$compile', '$parse', 'TabbarView', function ($onsen, $compile, $parse, TabbarView) { return { restrict: 'E', replace: false, scope: true, link: function link(scope, element, attrs, controller) { scope.$watch(attrs.hideTabs, function (hide) { if (typeof hide === 'string') { hide = hide === 'true'; } element[0].setTabbarVisibility(!hide); }); var tabbarView = new TabbarView(scope, element, attrs); $onsen.addModifierMethodsForCustomElements(tabbarView, element); $onsen.registerEventHandlers(tabbarView, 'reactive prechange postchange init show hide destroy'); element.data('ons-tabbar', tabbarView); $onsen.declareVarAttribute(attrs, tabbarView); scope.$on('$destroy', function () { tabbarView._events = undefined; $onsen.removeModifierMethods(tabbarView); element.data('ons-tabbar', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; (function () { 'use strict'; angular.module('onsen').directive('onsTemplate', ['$templateCache', function ($templateCache) { return { restrict: 'E', terminal: true, compile: function compile(element) { var content = element[0].template || element.html(); $templateCache.put(element.attr('id'), content); } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-toolbar */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this toolbar.[/en] * [ja]このツールバーを参照するための名前を指定します。[/ja] */ (function () { 'use strict'; angular.module('onsen').directive('onsToolbar', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element) { return { pre: function pre(scope, element, attrs) { // TODO: Remove this dirty fix! if (element[0].nodeName === 'ons-toolbar') { GenericView.register(scope, element, attrs, { viewKey: 'ons-toolbar' }); } }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /** * @element ons-toolbar-button */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this button.[/en] * [ja]このボタンを参照するための名前を指定します。[/ja] */ (function () { 'use strict'; var module = angular.module('onsen'); module.directive('onsToolbarButton', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', scope: false, link: { pre: function pre(scope, element, attrs) { var toolbarButton = new GenericView(scope, element, attrs); element.data('ons-toolbar-button', toolbarButton); $onsen.declareVarAttribute(attrs, toolbarButton); $onsen.addModifierMethodsForCustomElements(toolbarButton, element); $onsen.cleaner.onDestroy(scope, function () { toolbarButton._events = undefined; $onsen.removeModifierMethods(toolbarButton); element.data('ons-toolbar-button', undefined); element = null; $onsen.clearComponent({ scope: scope, attrs: attrs, element: element }); scope = element = attrs = null; }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } } }; }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); var ComponentCleaner = { /** * @param {jqLite} element */ decomposeNode: function decomposeNode(element) { var children = element.remove().children(); for (var i = 0; i < children.length; i++) { ComponentCleaner.decomposeNode(angular.element(children[i])); } }, /** * @param {Attributes} attrs */ destroyAttributes: function destroyAttributes(attrs) { attrs.$$element = null; attrs.$$observers = null; }, /** * @param {jqLite} element */ destroyElement: function destroyElement(element) { element.remove(); }, /** * @param {Scope} scope */ destroyScope: function destroyScope(scope) { scope.$$listeners = {}; scope.$$watchers = null; scope = null; }, /** * @param {Scope} scope * @param {Function} fn */ onDestroy: function onDestroy(scope, fn) { var clear = scope.$on('$destroy', function () { clear(); fn.apply(null, arguments); }); } }; module.factory('ComponentCleaner', function () { return ComponentCleaner; }); // override builtin ng-(eventname) directives (function () { var ngEventDirectives = {}; 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' ').forEach(function (name) { var directiveName = directiveNormalize('ng-' + name); ngEventDirectives[directiveName] = ['$parse', function ($parse) { return { compile: function compile($element, attr) { var fn = $parse(attr[directiveName]); return function (scope, element, attr) { var listener = function listener(event) { scope.$apply(function () { fn(scope, { $event: event }); }); }; element.on(name, listener); ComponentCleaner.onDestroy(scope, function () { element.off(name, listener); element = null; ComponentCleaner.destroyScope(scope); scope = null; ComponentCleaner.destroyAttributes(attr); attr = null; }); }; } }; }]; function directiveNormalize(name) { return name.replace(/-([a-z])/g, function (matches) { return matches[1].toUpperCase(); }); } }); module.config(['$provide', function ($provide) { var shift = function shift($delegate) { $delegate.shift(); return $delegate; }; Object.keys(ngEventDirectives).forEach(function (directiveName) { $provide.decorator(directiveName + 'Directive', ['$delegate', shift]); }); }]); Object.keys(ngEventDirectives).forEach(function (directiveName) { module.directive(directiveName, ngEventDirectives[directiveName]); }); })(); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; var module = angular.module('onsen'); /** * Internal service class for framework implementation. */ module.factory('$onsen', ['$rootScope', '$window', '$cacheFactory', '$document', '$templateCache', '$http', '$q', '$onsGlobal', 'ComponentCleaner', function ($rootScope, $window, $cacheFactory, $document, $templateCache, $http, $q, $onsGlobal, ComponentCleaner) { var $onsen = createOnsenService(); var ModifierUtil = $onsGlobal._internal.ModifierUtil; return $onsen; function createOnsenService() { return { DIRECTIVE_TEMPLATE_URL: 'templates', cleaner: ComponentCleaner, DeviceBackButtonHandler: $onsGlobal._deviceBackButtonDispatcher, _defaultDeviceBackButtonHandler: $onsGlobal._defaultDeviceBackButtonHandler, /** * @return {Object} */ getDefaultDeviceBackButtonHandler: function getDefaultDeviceBackButtonHandler() { return this._defaultDeviceBackButtonHandler; }, /** * @param {Object} view * @param {Element} element * @param {Array} methodNames * @return {Function} A function that dispose all driving methods. */ deriveMethods: function deriveMethods(view, element, methodNames) { methodNames.forEach(function (methodName) { view[methodName] = function () { return element[methodName].apply(element, arguments); }; }); return function () { methodNames.forEach(function (methodName) { view[methodName] = null; }); view = element = null; }; }, /** * @param {Class} klass * @param {Array} properties */ derivePropertiesFromElement: function derivePropertiesFromElement(klass, properties) { properties.forEach(function (property) { Object.defineProperty(klass.prototype, property, { get: function get() { return this._element[0][property]; }, set: function set(value) { return this._element[0][property] = value; // eslint-disable-line no-return-assign } }); }); }, /** * @param {Object} view * @param {Element} element * @param {Array} eventNames * @param {Function} [map] * @return {Function} A function that clear all event listeners */ deriveEvents: function deriveEvents(view, element, eventNames, map) { map = map || function (detail) { return detail; }; eventNames = [].concat(eventNames); var listeners = []; eventNames.forEach(function (eventName) { var listener = function listener(event) { view.emit(eventName, map(Object.create(event.detail))); }; listeners.push(listener); element.addEventListener(eventName, listener, false); }); return function () { eventNames.forEach(function (eventName, index) { element.removeEventListener(eventName, listeners[index], false); }); view = element = listeners = map = null; }; }, /** * @return {Boolean} */ isEnabledAutoStatusBarFill: function isEnabledAutoStatusBarFill() { return !!$onsGlobal._config.autoStatusBarFill; }, /** * @return {Boolean} */ shouldFillStatusBar: $onsGlobal.shouldFillStatusBar, /** * @param {Function} action */ autoStatusBarFill: $onsGlobal.autoStatusBarFill, /** * @param {Object} params * @param {Scope} [params.scope] * @param {jqLite} [params.element] * @param {Array} [params.elements] * @param {Attributes} [params.attrs] */ clearComponent: function clearComponent(params) { if (params.scope) { ComponentCleaner.destroyScope(params.scope); } if (params.attrs) { ComponentCleaner.destroyAttributes(params.attrs); } if (params.element) { ComponentCleaner.destroyElement(params.element); } if (params.elements) { params.elements.forEach(function (element) { ComponentCleaner.destroyElement(element); }); } }, /** * @param {jqLite} element * @param {String} name */ findElementeObject: function findElementeObject(element, name) { return element.inheritedData(name); }, /** * @param {String} page * @return {Promise} */ getPageHTMLAsync: function getPageHTMLAsync(page) { var cache = $templateCache.get(page); if (cache) { var deferred = $q.defer(); var html = typeof cache === 'string' ? cache : cache[1]; deferred.resolve(this.normalizePageHTML(html)); return deferred.promise; } else { return $http({ url: page, method: 'GET' }).then(function (response) { var html = response.data; return this.normalizePageHTML(html); }.bind(this)); } }, /** * @param {String} html * @return {String} */ normalizePageHTML: function normalizePageHTML(html) { html = ('' + html).trim(); if (!html.match(/^<ons-page/)) { html = '<ons-page _muted>' + html + '</ons-page>'; } return html; }, /** * Create modifier templater function. The modifier templater generate css classes bound modifier name. * * @param {Object} attrs * @param {Array} [modifiers] an array of appendix modifier * @return {Function} */ generateModifierTemplater: function generateModifierTemplater(attrs, modifiers) { var attrModifiers = attrs && typeof attrs.modifier === 'string' ? attrs.modifier.trim().split(/ +/) : []; modifiers = angular.isArray(modifiers) ? attrModifiers.concat(modifiers) : attrModifiers; /** * @return {String} template eg. 'ons-button--*', 'ons-button--*__item' * @return {String} */ return function (template) { return modifiers.map(function (modifier) { return template.replace('*', modifier); }).join(' '); }; }, /** * Add modifier methods to view object for custom elements. * * @param {Object} view object * @param {jqLite} element */ addModifierMethodsForCustomElements: function addModifierMethodsForCustomElements(view, element) { var methods = { hasModifier: function hasModifier(needle) { var tokens = ModifierUtil.split(element.attr('modifier')); needle = typeof needle === 'string' ? needle.trim() : ''; return ModifierUtil.split(needle).some(function (needle) { return tokens.indexOf(needle) != -1; }); }, removeModifier: function removeModifier(needle) { needle = typeof needle === 'string' ? needle.trim() : ''; var modifier = ModifierUtil.split(element.attr('modifier')).filter(function (token) { return token !== needle; }).join(' '); element.attr('modifier', modifier); }, addModifier: function addModifier(modifier) { element.attr('modifier', element.attr('modifier') + ' ' + modifier); }, setModifier: function setModifier(modifier) { element.attr('modifier', modifier); }, toggleModifier: function toggleModifier(modifier) { if (this.hasModifier(modifier)) { this.removeModifier(modifier); } else { this.addModifier(modifier); } } }; for (var method in methods) { if (methods.hasOwnProperty(method)) { view[method] = methods[method]; } } }, /** * Add modifier methods to view object. * * @param {Object} view object * @param {String} template * @param {jqLite} element */ addModifierMethods: function addModifierMethods(view, template, element) { var _tr = function _tr(modifier) { return template.replace('*', modifier); }; var fns = { hasModifier: function hasModifier(modifier) { return element.hasClass(_tr(modifier)); }, removeModifier: function removeModifier(modifier) { element.removeClass(_tr(modifier)); }, addModifier: function addModifier(modifier) { element.addClass(_tr(modifier)); }, setModifier: function setModifier(modifier) { var classes = element.attr('class').split(/\s+/), patt = template.replace('*', '.'); for (var i = 0; i < classes.length; i++) { var cls = classes[i]; if (cls.match(patt)) { element.removeClass(cls); } } element.addClass(_tr(modifier)); }, toggleModifier: function toggleModifier(modifier) { var cls = _tr(modifier); if (element.hasClass(cls)) { element.removeClass(cls); } else { element.addClass(cls); } } }; var append = function append(oldFn, newFn) { if (typeof oldFn !== 'undefined') { return function () { return oldFn.apply(null, arguments) || newFn.apply(null, arguments); }; } else { return newFn; } }; view.hasModifier = append(view.hasModifier, fns.hasModifier); view.removeModifier = append(view.removeModifier, fns.removeModifier); view.addModifier = append(view.addModifier, fns.addModifier); view.setModifier = append(view.setModifier, fns.setModifier); view.toggleModifier = append(view.toggleModifier, fns.toggleModifier); }, /** * Remove modifier methods. * * @param {Object} view object */ removeModifierMethods: function removeModifierMethods(view) { view.hasModifier = view.removeModifier = view.addModifier = view.setModifier = view.toggleModifier = undefined; }, /** * Define a variable to JavaScript global scope and AngularJS scope as 'var' attribute name. * * @param {Object} attrs * @param object */ declareVarAttribute: function declareVarAttribute(attrs, object) { if (typeof attrs.var === 'string') { var varName = attrs.var; this._defineVar(varName, object); } }, _registerEventHandler: function _registerEventHandler(component, eventName) { var capitalizedEventName = eventName.charAt(0).toUpperCase() + eventName.slice(1); component.on(eventName, function (event) { $onsen.fireComponentEvent(component._element[0], eventName, event); var handler = component._attrs['ons' + capitalizedEventName]; if (handler) { component._scope.$eval(handler, { $event: event }); component._scope.$evalAsync(); } }); }, /** * Register event handlers for attributes. * * @param {Object} component * @param {String} eventNames */ registerEventHandlers: function registerEventHandlers(component, eventNames) { eventNames = eventNames.trim().split(/\s+/); for (var i = 0, l = eventNames.length; i < l; i++) { var eventName = eventNames[i]; this._registerEventHandler(component, eventName); } }, /** * @return {Boolean} */ isAndroid: function isAndroid() { return !!window.navigator.userAgent.match(/android/i); }, /** * @return {Boolean} */ isIOS: function isIOS() { return !!window.navigator.userAgent.match(/(ipad|iphone|ipod touch)/i); }, /** * @return {Boolean} */ isWebView: function isWebView() { return window.ons.isWebView(); }, /** * @return {Boolean} */ isIOS7above: function () { var ua = window.navigator.userAgent; var match = ua.match(/(iPad|iPhone|iPod touch);.*CPU.*OS (\d+)_(\d+)/i); var result = match ? parseFloat(match[2] + '.' + match[3]) >= 7 : false; return function () { return result; }; }(), /** * Fire a named event for a component. The view object, if it exists, is attached to event.component. * * @param {HTMLElement} [dom] * @param {String} event name */ fireComponentEvent: function fireComponentEvent(dom, eventName, data) { data = data || {}; var event = document.createEvent('HTMLEvents'); for (var key in data) { if (data.hasOwnProperty(key)) { event[key] = data[key]; } } event.component = dom ? angular.element(dom).data(dom.nodeName.toLowerCase()) || null : null; event.initEvent(dom.nodeName.toLowerCase() + ':' + eventName, true, true); dom.dispatchEvent(event); }, /** * Define a variable to JavaScript global scope and AngularJS scope. * * Util.defineVar('foo', 'foo-value'); * // => window.foo and $scope.foo is now 'foo-value' * * Util.defineVar('foo.bar', 'foo-bar-value'); * // => window.foo.bar and $scope.foo.bar is now 'foo-bar-value' * * @param {String} name * @param object */ _defineVar: function _defineVar(name, object) { var names = name.split(/\./); function set(container, names, object) { var name; for (var i = 0; i < names.length - 1; i++) { name = names[i]; if (container[name] === undefined || container[name] === null) { container[name] = {}; } container = container[name]; } container[names[names.length - 1]] = object; if (container[names[names.length - 1]] !== object) { throw new Error('Cannot set var="' + object._attrs.var + '" because it will overwrite a read-only variable.'); } } if (ons.componentBase) { set(ons.componentBase, names, object); } // Attach to ancestor with ons-scope attribute. var element = object._element[0]; while (element.parentNode) { if (element.hasAttribute('ons-scope')) { set(angular.element(element).data('_scope'), names, object); element = null; return; } element = element.parentNode; } element = null; // If no ons-scope element was found, attach to $rootScope. set($rootScope, names, object); } }; } }]); })(); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ ['alert', 'confirm', 'prompt'].forEach(function (name) { ons.notification[name] = function (message) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; typeof message === 'string' ? options.message = message : options = message; var compile = options.compile; options.compile = function (element) { var $element = angular.element(compile ? compile(element) : element); return ons.$compile($element)($element.injector().get('$rootScope')); }; return ons.notification['_' + name + 'Original'](options); }; }); var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; // confirm to use jqLite if (window.jQuery && angular.element === window.jQuery) { console.warn('Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior.'); // eslint-disable-line no-console } var babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; babelHelpers; /* Copyright 2013-2015 ASIAL CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ (function () { 'use strict'; angular.module('onsen').run(['$templateCache', function ($templateCache) { var templates = window.document.querySelectorAll('script[type="text/ons-template"]'); for (var i = 0; i < templates.length; i++) { var template = angular.element(templates[i]); var id = template.attr('id'); if (typeof id === 'string') { $templateCache.put(id, template.text()); } } }]); })(); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsYXNzLmpzIiwidGVtcGxhdGVzLmpzIiwib25zZW4uanMiLCJhbGVydERpYWxvZy5qcyIsImFsZXJ0RGlhbG9nQW5pbWF0b3IuanMiLCJhb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XJuIHtCb29sZWFufVxuICAgICAgICAgKi9cbiAgICAgICAgaXNFbmFibGVkQXV0b1N0YXR1c0JhckZpbGw6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiAhISRvbnNHbG9iYWwuX2NvbmZpZy5hdXRvU3RhdHVzQmFyRmlsbDtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICAgICAgICovXG4gICAgICAgIHNob3VsZEZpbGxTdGF0dXNCYXI6ICRvbnNHbG9iYWwuc2hvdWxkRmlsbFN0YXR1c0JhcixcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gYWN0aW9uXG4gICAgICAgICAqL1xuICAgICAgICBhdXRvU3RhdHVzQmFyRmlsbDogJG9uc0dsb2JhbC5hdXRvU3RhdHVzQmFyRmlsbCxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IHBhcmFtc1xuICAgICAgICAgKiBAcGFyYW0ge1Njb3BlfSBbcGFyYW1zLnNjb3BlXVxuICAgICAgICAgKiBAcGFyYW0ge2pxTGl0ZX0gW3BhcmFtcy5lbGVtZW50XVxuICAgICAgICAgKiBAcGFyYW0ge0FycmF5fSBbcGFyYW1zLmVsZW1lbnRzXVxuICAgICAgICAgKiBAcGFyYW0ge0F0dHJpYnV0ZXN9IFtwYXJhbXMuYXR0cnNdXG4gICAgICAgICAqL1xuICAgICAgICBjbGVhckNvbXBvbmVudDogZnVuY3Rpb24ocGFyYW1zKSB7XG4gICAgICAgICAgaWYgKHBhcmFtcy5zY29wZSkge1xuICAgICAgICAgICAgQ29tcG9uZW50Q2xlYW5lci5kZXN0cm95U2NvcGUocGFyYW1zLnNjb3BlKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAocGFyYW1zLmF0dHJzKSB7XG4gICAgICAgICAgICBDb21wb25lbnRDbGVhbmVyLmRlc3Ryb3lBdHRyaWJ1dGVzKHBhcmFtcy5hdHRycyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHBhcmFtcy5lbGVtZW50KSB7XG4gICAgICAgICAgICBDb21wb25lbnRDbGVhbmVyLmRlc3Ryb3lFbGVtZW50KHBhcmFtcy5lbGVtZW50KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAocGFyYW1zLmVsZW1lbnRzKSB7XG4gICAgICAgICAgICBwYXJhbXMuZWxlbWVudHMuZm9yRWFjaChmdW5jdGlvbihlbGVtZW50KSB7XG4gICAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIuZGVzdHJveUVsZW1lbnQoZWxlbWVudCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7anFMaXRlfSBlbGVtZW50XG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBuYW1lXG4gICAgICAgICAqL1xuICAgICAgICBmaW5kRWxlbWVudGVPYmplY3Q6IGZ1bmN0aW9uKGVsZW1lbnQsIG5hbWUpIHtcbiAgICAgICAgICByZXR1cm4gZWxlbWVudC5pbmhlcml0ZWREYXRhKG5hbWUpO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gcGFnZVxuICAgICAgICAgKiBAcmV0dXJuIHtQcm9taXNlfVxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0UGFnZUhUTUxBc3luYzogZnVuY3Rpb24ocGFnZSkge1xuICAgICAgICAgIHZhciBjYWNoZSA9ICR0ZW1wbGF0ZUNhY2hlLmdldChwYWdlKTtcblxuICAgICAgICAgIGlmIChjYWNoZSkge1xuICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcblxuICAgICAgICAgICAgdmFyIGh0bWwgPSB0eXBlb2YgY2FjaGUgPT09ICdzdHJpbmcnID8gY2FjaGUgOiBjYWNoZVsxXTtcbiAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUodGhpcy5ub3JtYWxpemVQYWdlSFRNTChodG1sKSk7XG5cbiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAkaHR0cCh7XG4gICAgICAgICAgICAgIHVybDogcGFnZSxcbiAgICAgICAgICAgICAgbWV0aG9kOiAnR0VUJ1xuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgICB2YXIgaHRtbCA9IHJlc3BvbnNlLmRhdGE7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubm9ybWFsaXplUGFnZUhUTUwoaHRtbCk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd9IGh0bWxcbiAgICAgICAgICogQHJldHVybiB7U3RyaW5nfVxuICAgICAgICAgKi9cbiAgICAgICAgbm9ybWFsaXplUGFnZUhUTUw6IGZ1bmN0aW9uKGh0bWwpIHtcbiAgICAgICAgICBodG1sID0gKCcnICsgaHRtbCkudHJpbSgpO1xuXG4gICAgICAgICAgaWYgKCFodG1sLm1hdGNoKC9ePG9ucy1wYWdlLykpIHtcbiAgICAgICAgICAgIGh0bWwgPSAnPG9ucy1wYWdlIF9tdXRlZD4nICsgaHRtbCArICc8L29ucy1wYWdlPic7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGh0bWw7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIENyZWF0ZSBtb2RpZmllciB0ZW1wbGF0ZXIgZnVuY3Rpb24uIFRoZSBtb2RpZmllciB0ZW1wbGF0ZXIgZ2VuZXJhdGUgY3NzIGNsYX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FkZCBtb2RpZmllciBtZXRob2RzIHRvIHZpZXcgb2JqZWN0IGZvciBjdXN0b20gZWxlbWVudHMuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSB2aWV3IG9iamVjdFxuICAgICAgICAgKiBAcGFyYW0ge2pxTGl0ZX0gZWxlbWVudFxuICAgICAgICAgKi9cbiAgICAgICAgYWRkTW9kaWZpZXJNZXRob2RzRm9yQ3VzdG9tRWxlbWVudHM6IGZ1bmN0aW9uKHZpZXcsIGVsZW1lbnQpIHtcbiAgICAgICAgICB2YXIgbWV0aG9kcyA9IHtcbiAgICAgICAgICAgIGhhc01vZGlmaWVyOiBmdW5jdGlvbihuZWVkbGUpIHtcbiAgICAgICAgICAgICAgdmFyIHRva2VucyA9IE1vZGlmaWVyVXRpbC5zcGxpdChlbGVtZW50LmF0dHIoJ21vZGlmaWVyJykpO1xuICAgICAgICAgICAgICBuZWVkbGUgPSB0eXBlb2YgbmVlZGxlID09PSAnc3RyaW5nJyA/IG5lZWRsZS50cmltKCkgOiAnJztcblxuICAgICAgICAgICAgICByZXR1cm4gTW9kaWZpZXJVdGlsLnNwbGl0KG5lZWRsZSkuc29tZShmdW5jdGlvbihuZWVkbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW5zLmluZGV4T2YobmVlZGxlKSAhPSAtMTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICByZW1vdmVNb2RpZmllcjogZnVuY3Rpb24obmVlZGxlKSB7XG4gICAgICAgICAgICAgIG5lZWRsZSA9IHR5cGVvZiBuZWVkbGUgPT09ICdzdHJpbmcnID8gbmVlZGxlLnRyaW0oKSA6ICcnO1xuXG4gICAgICAgICAgICAgIHZhciBtb2RpZmllciA9IE1vZGlmaWVyVXRpbC5zcGxpdChlbGVtZW50LmF0dHIoJ21vZGlmaWVyJykpLmZpbHRlcihmdW5jdGlvbih0b2tlbikge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbiAhPT0gbmVlZGxlO1xuICAgICAgICAgICAgICB9KS5qb2luKCcgJyk7XG5cbiAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdtb2RpZmllcicsIG1vZGlmaWVyKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIGFkZE1vZGlmaWVyOiBmdW5jdGlvbihtb2RpZmllcikge1xuICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoJ21vZGlmaWVyJywgZWxlbWVudC5hdHRyKCdtb2RpZmllcicpICsgJyAnICsgbW9kaWZpZXIpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgc2V0TW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIGVsZW1lbnQuYXR0cignbW9kaWZpZXInLCBtb2RpZmllcik7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICB0b2dnbGVNb2RpZmllcjogZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgaWYgKHRoaXMuaGFzTW9kaWZpZXIobW9kaWZpZXIpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVNb2RpZmllcihtb2RpZmllcik7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hZGRNb2RpZmllcihtb2RpZmllcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgZm9yICh2YXIgbWV0aG9kIGluIG1ldGhvZHMpIHtcbiAgICAgICAgICAgIGlmIChtZXRob2RzLmhhc093blByb3BlcnR5KG1ldGhvZCkpIHtcbiAgICAgICAgICAgICAgdmlld1ttZXRob2RdID0gbWV0aG9kc1ttZXRob2RdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQWRkIG1vZGlmaWVyIG1ldGhvZHMgdG8gdmlldyBvYmplY3QuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSB2aWV3IG9iamVjdFxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gdGVtcGxhdGVcbiAgICAgICAgICogQHBhcmFtIHtqcUxpdGV9IGVsZW1lbnRcbiAgICAgICAgICovXG4gICAgICAgIGFkZE1vZGlmaWVyTWV0aG9kczogZnVuY3Rpb24odmlldywgdGVtcGxhdGUsIGVsZW1lbnQpIHtcbiAgICAgICAgICB2YXIgX3RyID0gZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgIHJldHVybiB0ZW1wbGF0ZS5yZXBsYWNlKCcqJywgbW9kaWZpZXIpO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICB2YXIgZm5zID0ge1xuICAgICAgICAgICAgaGFzTW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIHJldHVybiBlbGVtZW50Lmhhc0NsYXNzKF90cihtb2RpZmllcikpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgcmVtb3ZlTW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoX3RyKG1vZGlmaWVyKSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBhZGRNb2RpZmllcjogZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhfdHIobW9kaWZpZXIpKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHNldE1vZGlmaWVyOiBmdW5jdGlvbihtb2RpZmllcikge1xuICAgICAgICAgICAgICB2YXIgY2xhc3NlcyA9IGVsZW1lbnQuYXR0cignY2xhc3MnKS5zcGxpdCgvXFxzKy8pLFxuICAgICAgICAgICAgICAgICAgcGF0dCA9IHRlbXBsYXRlLnJlcGxhY2UoJyonLCAnLicpO1xuXG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2xhc3Nlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBjbGFzc2VzW2ldO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNscy5tYXRjaChwYXR0KSkge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhjbHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoX3RyKG1vZGlmaWVyKSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICB0b2dnbGVNb2RpZmllcjogZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgdmFyIGNscyA9IF90cihtb2RpZmllcik7XG4gICAgICAgICAgICAgIGlmIChlbGVtZW50Lmhhc0NsYXNzKGNscykpIHtcbiAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGNscyk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhjbHMpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciBhcHBlbmQgPSBmdW5jdGlvbihvbGRGbiwgbmV3Rm4pIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygb2xkRm4gIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2xkRm4uYXBwbHkobnVsbCwgYXJndW1lbnRzKSB8fCBuZXdGbi5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNl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XB0IGdsb2JhbCBzY29wZSBhbmQgQW5ndWxhckpTIHNjb3BlIGFzICd2YXInIGF0dHJpYnV0ZSBuYW1lLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gYXR0cnNcbiAgICAgICAgICogQHBhcmFtIG9iamVjdFxuICAgICAgICAgKi9cbiAgICAgICAgZGVjbGFyZVZhckF0dHJpYnV0ZTogZnVuY3Rpb24oYXR0cnMsIG9iamVjdCkge1xuICAgICAgICAgIGlmICh0eXBlb2YgYXR0cnMudmFyID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdmFyIHZhck5hbWUgPSBhdHRycy52YXI7XG4gICAgICAgICAgICB0aGlzLl9kZWZpbmVWYXIodmFyTmFtZSwgb2JqZWN0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3JlZ2lzdGVyRXZlbnRIYW5kbGVyOiBmdW5jdGlvbihjb21wb25lbnQsIGV2ZW50TmFtZSkge1xuICAgICAgICAgIHZhciBjYXBpdGFsaXplZEV2ZW50TmFtZSA9IGV2ZW50TmFtZS5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIGV2ZW50TmFtZS5zbGljZSgxKTtcblxuICAgICAgICAgIGNvbXBvbmVudC5vbihldmVudE5hbWUsIGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAkb25zZW4uZmlyZUNvbXBvbmVudEV2ZW50KGNvbXBvbmVudC5fZWxlbWVudFswXSwgZXZlbnROYW1lLCBldmVudCk7XG5cbiAgICAgICAgICAgIHZhciBoYW5kbGVyID0gY29tcG9uZW50Ll9hdHRyc1snb25zJyArIGNhcGl0YWxpemVkRXZlbnROYW1lXTtcbiAgICAgICAgICAgIGlmIChoYW5kbGVyKSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5fc2NvcGUuJGV2YWwoaGFuZGxlciwgeyRldmVudDogZXZlbnR9KTtcbiAgICAgICAgICAgICAgY29tcG9uZW50Ll9zY29wZS4kZXZhbEFzeW5jKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZ2lzdGVyIGV2ZW50IGhhbmRsZXJzIGZvciBhdHRyaWJ1dGVzLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gY29tcG9uZW50XG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBldmVudE5hbWVzXG4gICAgICAgICAqL1xuICAgICAgICByZWdpc3RlckV2ZW50SGFuZGxlcnM6IGZ1bmN0aW9uKGNvbXBvbmVudCwgZXZlbnROYW1lcykge1xuICAgICAgICAgIGV2ZW50TmFtZXMgPSBldmVudE5hbWVzLnRyaW0oKS5zcGxpdCgvXFxzKy8pO1xuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGwgPSBldmVudE5hbWVzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgdmFyIGV2ZW50TmFtZSA9IGV2ZW50TmFtZXNbaV07XG4gICAgICAgICAgICB0aGlzLl9yZWdpc3RlckV2ZW50SGFuZGxlcihjb21wb25lbnQsIGV2ZW50TmFtZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgICAgICAgKi9cbiAgICAgICAgaXNBbmRyb2lkOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gISF3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvYW5kcm9pZC9pKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICAgICAgICovXG4gICAgICAgIGlzSU9TOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gISF3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2Vud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gd2luZG93LmZvby5iYXIgYW5kICRzY29wZS5mb28uYmFyIGlzIG5vdyAnZm9vLWJhci12YWx1ZSdcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd9IG5hbWVcbiAgICAgICAgICogQHBhcmFtIG9iamVjdFxuICAgICAgICAgKi9cbiAgICAgICAgX2RlZmluZVZhcjogZnVuY3Rpb24obmFtZSwgb2JqZWN0KSB7XG4gICAgICAgICAgdmFyIG5hbWVzID0gbmFtZS5zcGxpdCgvXFwuLyk7XG5cbiAgICAgICAgICBmdW5jdGlvbiBzZXQoY29udGFpbmVyLCBuYW1lcywgb2JqZWN0KSB7XG4gICAgICAgICAgICB2YXIgbmFtZTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmFtZXMubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICAgICAgICAgIG5hbWUgPSBuYW1lc1tpXTtcbiAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lcltuYW1lXSA9PT0gdW5kZWZpbmVkIHx8IGNvbnRhaW5lcltuYW1lXSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRhaW5lcltuYW1lXSA9IHt9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRhaW5lciA9IGNvbnRhaW5lcltuYW1lXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29udGFpbmVyW25hbWVzW25hbWVzLmxlbmd0aCAtIDFdXSA9IG9iamVjdDtcblxuICAgICAgICAgICAgaWYgKGNvbnRhaW5lcltuYW1lc1tuYW1lcy5sZW5ndGggLSAxXV0gIT09IG9iamVjdCkge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0Nhbm5vdCBzZXQgdmFyPVwiJyArIG9iamVjdC5fYXR0cnMudmFyICsgJ1wiIGJlY2F1c2UgaXQgd2lsbCBvdmVyd3JpdGUgYSByZWFkLW9ubHkgdmFyaWFibGUuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKG9ucy5jb21wb25lbnRCYXNlKSB7XG4gICAgICAgICAgICBzZXQob25zLmNvbXBvbmVudEJhc2UsIG5hbWVzLCBvYmplY3QpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIEF0dGFjaCB0byBhbmNlc3RvciB3aXRoIG9ucy1zY29wZSBhdHRyaWJ1dGUuXG4gICAgICAgICAgdmFyIGVsZW1lbnQgPSBvYmplY3QuX2VsZW1lbnRbMF07XG5cbiAgICAgICAgICB3aGlsZSAoZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICBpZiAoZWxlbWVudC5oYXNBdHRyaWJ1dGUoJ29ucy1zY29wZScpKSB7XG4gICAgICAgICAgICAgIHNldChhbmd1bGFyLmVsZW1lbnQoZWxlbWVudCkuZGF0YSgnX3Njb3BlJyksIG5hbWVzLCBvYmplY3QpO1xuICAgICAgICAgICAgICBlbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBlbGVtZW50ID0gZWxlbWVudC5wYXJlbnROb2RlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbGVtZW50ID0gbnVsbDtcblxuICAgICAgICAgIC8vIElmIG5vIG9ucy1zY29wZSBlbGVtZW50IHdhcyBmb3VuZCwgYXR0YWNoIHRvICRyb290U2NvcGUuXG4gICAgICAgICAgc2V0KCRyb290U2NvcGUsIG5hbWVzLCBvYmplY3QpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cblxuICB9KTtcbn0pKCk7XG4iLCIvKipcbiAqIEBlbGVtZW50IG9ucy1hbGVydC1kaWFsb2dcbiAqL1xuXG4vKipcbiAqIEBhdHRyaWJ1dGUgdmFyXG4gKiBAaW5pdG9ubHlcbiAqIEB0eXBlIHtTdHJpbmd9XG4gKiBAZGVzY3JpcHRpb25cbiAqICBbZW5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44GL44KJ6KaL44GI44Gq44GP44Gq44Gj44Gf5aC05ZCI44Gr44Gv44Gd44Gu6KaB57Sg44Gv5YuV55qE44Gr44Ki44Oz44Ot44O844OJ44GV44KM44G+44GZ44CCXG4gKiAgICAg44GT44Gu44Kz44Oz44Od44O844ON44Oz44OI44KS5L2/44GG44GT44Go44Gn44CB44OR44OV44Kp44O844Oe44Oz44K544KS5Yqj5YyW44GV44Gb44KL44GT44Go54Sh44GX44Gr5beo5aSn44Gq5pWw44Gu6KaB57Sg44KS5o+P55S744Gn44GN44G+44GZ44CCXG4gKiAgIFsvamFdXG4gKiBAY29kZXBlbiBRd3JHQm1cbiAqIEBndWlkZSBVc2luZ0xhenlSZXBlYXRcbiAqICAgW2VuXUhvdyB0byB1c2UgTGF6eSBSZXBlYXRbL2VuXVxuICogICBbamFd44Os44Kk44K444O844Oq44OU44O844OI44Gu5L2/44GE5pa5Wy9qYV1cbiAqIEBleGFtcGxlXG4gKiA8c2NyaXB0PlxuICogICBvbnMuYm9vdHN0cmFwKClcbiAqXG4gKiAgIC5jb250cm9sbGVyKCdNeUNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUpIHtcbiAqICAgICAkc2NvcGUuTXlEZWxlZ2F0ZSA9IHtcbiAqICAgICAgIGNvdW50SXRlbXM6IGZ1bmN0aW9uKCkge1xuICogICAgICAgICAvLyBSZXR1cm4gbnVtYmVyIG9mIGl0ZW1zLlxuICogICAgICAgICByZXR1cm4gMTAwMDAwMDtcbiAqICAgICAgIH0sXG4gKlxuICogICAgICAgY2FsY3VsYXRlSXRlbUhlaWdodDogZnVuY3Rpb24oaW5kZXgpIHtcbiAqICAgICAgICAgLy8gUmV0dXJuIHRoZSBoZWlnaHQgb2YgYW4gaXRlbSBpbiBwaXhlbHMuXG4gKiAgICAgICAgIHJldHVybiA0NTtcbiAqICAgICAgIH0sXG4gKlxuICogICAgICAgY29uZmlndXJlSXRlbVNjb3BlOiBmdW5jdGlvbihpbmRleCwgaXRlbV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ucy53aWR0aCxcbiAgICAgICAgICAgIGxlZnQ6ICdhdXRvJ1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG1lbnVQYWdlLmNzcyh7XG4gICAgICAgICAgICByaWdodDogJ2F1dG8nLFxuICAgICAgICAgICAgbGVmdDogJy0nICsgb3B0aW9ucy53aWR0aFxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fYmxhY2tNYXNrID0gYW5ndWxhci5lbGVtZW50KCc8ZGl2PjwvZGl2PicpLmNzcyh7XG4gICAgICAgICAgYmFja2dyb3VuZENvbG9yOiAnYmxhY2snLFxuICAgICAgICAgIHRvcDogJzBweCcsXG4gICAgICAgICAgbGVmdDogJzBweCcsXG4gICAgICAgICAgcmlnaHQ6ICcwcHgnLFxuICAgICAgICAgIGJvdHRvbTogJzBweCcsXG4gICAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgICAgZGlzcGxheTogJ25vbmUnLFxuICAgICAgICAgIHpJbmRleDogMFxuICAgICAgICB9KTtcblxuICAgICAgICBlbGVtZW50LnByZXBlbmQodGhpcy5fYmxhY2tNYXNrKTtcbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAgICAgICogQHBhcmFtIHtPYmplY3R9IG9wdGlvbnNcbiAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBvcHRpb25zLndpZHRoXG4gICAgICAgKi9cbiAgICAgIG9uUmVzaXplZDogZnVuY3Rpb24ob3B0aW9ucykge1xuICAgICAgICB0aGlzLl9tZW51UGFnZS5jc3MoJ3dpZHRoJywgb3B0aW9ucy53aWR0aCk7XG5cbiAgICAgICAgaWYgKHRoaXMuX2lzUmlnaHQpIHtcbiAgICAgICAgICB0aGlzLl9tZW51UGFnZS5jc3Moe1xuICAgICAgICAgICAgcmlnaHQ6ICctJyArIG9wdGlvbnMud2lkdGgsXG4gICAgICAgICAgICBsZWZ0OiAnYXV0bydcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9tZW51UGFnZS5jc3Moe1xuICAgICAgICAgICAgcmlnaHQ6ICdhdXRvJyxcbiAgICAgICAgICAgIGxlZnQ6ICctJyArIG9wdGlvbnMud2lkdGhcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvcHRpb25zLmlzT3BlbmVkKSB7XG4gICAgICAgICAgdmFyIG1heCA9IHRoaXMuX21lbnVQYWdlWzBdLmNsaWVudFdpZHRoO1xuICAgICAgICAgIHZhciBtZW51U3R5bGUgPSB0aGlzLl9nZW5lcmF0ZU1lbnVQYWdlU3R5bGUobWF4KTtcbiAgICAgICAgICBhbmltaXQodGhpcy5fbWVudVBhZ2VbMF0pLnF1ZXVlKG1lbnVTdHlsZSkucGxheSgpO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICAvKipcbiAgICAgICAqL1xuICAgICAgZGVzdHJveTogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICh0aGlzLl9ibGFja01hc2spIHtcbiAgICAgICAgICB0aGlzLl9ibGFja01hc2sucmVtb3ZlKCk7XG4gICAgICAgICAgdGhpcy5fYmxhY2tNYXNrID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX21haW5QYWdlLnJlbW92ZUF0dHIoJ3N0eWxlJyk7XG4gICAgICAgIHRoaXMuX21lbnVQYWdlLnJlbW92ZUF0dHIoJ3N0eWxlJyk7XG5cbiAgICAgICAgdGhpcy5fZWxlbWVudCA9IHRoaXMuX21haW5QYWdlID0gdGhpcy5fbWVudVBhZ2UgPSBudWxsO1xuICAgICAgfSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBjYWxsYmFja1xuICAgICAgICogQHBhcmFtIHtCb29sZWFufSBpbnN0YW50XG4gICAgICAgKi9cbiAgICAgIG9wZW5NZW51OiBmdW5jdGlvbihjYWxsYmFjaywgaW5zdGFudCkge1xuICAgICAgICB2YXIgZHVyYXRpb24gPSBpbnN0YW50ID09PSB0cnVlID8gMC4wIDogdGhpcy5kdXJhdGlvbjtcbiAgICAgICAgdmFyIGRlbGF5ID0gaW5zdGFudCA9PT0gdHJ1ZSA/IDAuMCA6IHRoaXMuZGVsYXk7XG5cbiAgICAgICAgdGhpcy5fbWVudVBhZ2UuY3NzKCdkaXNwbGF5JywgJ2Jsb2NrJyk7XG4gICAgICAgIHRoaXMuX2JsYWNrTWFzay5jc3MoJ2Rpc3BsYXknLCAnYmxvY2snKTtcblxuICAgICAgICB2YXIgbWF4ID0gdGhpcy5fbWVudVBhZ2VbMF0uY2xpZW50V2lkdGg7XG4gICAgICAgIHZhciBtZW51U3R5bGUgPSB0aGlzLl9nZW5lcmF0ZU1lbnVQYWdlU3R5bGUobWF4KTtcbiAgICAgICAgdmFyIG1haW5QYWdlU3R5bGUgPSB0aGlzLl9nZW5lcmF0ZU1haW5QYWdlU3R5bGUobWF4KTtcblxuICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuXG4gICAgICAgICAgYW5pbWl0KHRoaXMuX21haW5QYWdlWzBdKVxuICAgICAgICAgICAgLndhaXQoZGVsYXkpXG4gICAgICAgICAgICAucXVldWUobWFpblBhZ2VTdHlsZSwge1xuICAgICAgICAgICAgICBkdXJhdGlvbjogZHVyYXRpb24sXG4gICAgICAgICAgICAgIHRpbWluZzogdGhpcy50aW1pbmdcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucXVldWUoZnVuY3Rpb24oZG9uZSkge1xuICAgICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnBsYXkoKTtcblxuICAgICAgICAgIGFuaW1pdCh0aGlzLl9tZW51UGFnZVswXSlcbiAgICAgICAgICAgIC53YWl0KGRlbGF5KVxuICAgICAgICAgICAgLnF1ZXVlKG1lbnVTdHlsZSwge1xuICAgICAgICAgICAgICBkdXJhdGlvbjogZHVyYXRpb24sXG4gICAgICAgICAgICAgIHRpbWluZzogdGhpcy50aW1pbmdcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucGxheSgpO1xuXG4gICAgICAgIH0uYmluZCh0aGlzKSwgMTAwMCAvIDYwKTtcbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gY2FsbGJhY2tcbiAgICAgICAqIEBwYXJhbSB7Qm9vbGVhbn0gaW5zdGFudFxuICAgICAgICovXG4gICAgICBjbG9zZU1lbnU6IGZ1bmN0aW9uKGNhbGxiYWNrLCBpbnN0YW50KSB7XG4gICAgICAgIHZhciBkdXJhdGlvbiA9IGluc3RhbnQgPT09IHRydWUgPyAwLjAgOiB0aGlzLmR1cmF0aW9uO1xuICAgICAgICB2YXIgZGVsYXkgPSBpbnN0YW50ID09PSB0cnVlID8gMC4wIDogdGhpcy5kZWxheTtcblxuICAgICAgICB0aGlzLl9ibGFja01hc2suY3NzKHtkaXNwbGF5OiAnYmxvY2snfSk7XG5cbiAgICAgICAgdmFyIG1lbnVQYWdlU3R5bGUgPSB0aGlzLl9nZW5lcmF0ZU1lbnVQYWdlU3R5bGUoMCk7XG4gICAgICAgIHZhciBtYWluUGFnZVN0eWxlID0gdGhpcy5fZ2VuZXJhdGVNYWluUGFnZVN0eWxlKDApO1xuXG4gICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG5cbiAgICAgICAgICBhbmltaXQodGhpcy5fbWFpblBhZ2VbMF0pXG4gICAgICAgICAgICAud2FpdChkZWxheSlcbiAgICAgICAgICAgIC5xdWV1ZShtYWluUGFnZVN0eWxlLCB7XG4gICAgICAgICAgICAgIGR1cmF0aW9uOiBkdXJhdGlvbixcbiAgICAgICAgICAgICAgdGltaW5nOiB0aGlzLnRpbWluZ1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAg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ycyk7XG5cbiAgICAgICAgICAgICRvbnNlbi5kZWNsYXJlVmFyQXR0cmlidXRlKGF0dHJzLCBwYWdlKTtcbiAgICAgICAgICAgICRvbnNlbi5yZWdpc3RlckV2ZW50SGFuZGxlcnMocGFnZSwgJ2luaXQgc2hvdyBoaWRlIGRlc3Ryb3knKTtcblxuICAgICAgICAgICAgZWxlbWVudC5kYXRhKCdvbnMtcGFnZScsIHBhZ2UpO1xuICAgICAgICAgICAgJG9uc2VuLmFkZE1vZGlmaWVyTWV0aG9kc0ZvckN1c3RvbUVsZW1lbnRzKHBhZ2UsIGVsZW1lbnQpO1xuXG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoJ19zY29wZScsIHNjb3BlKTtcblxuICAgICAgICAgICAgJG9uc2VuLmNsZWFuZXIub25EZXN0cm95KHNjb3BlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcGFnZS5fZXZlbnRzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAkb25zZW4ucmVtb3ZlTW9kaWZpZXJNZXRob2RzKHBhZ2UpO1xuICAgICAgICAgICAgICBlbGVtZW50LmRhdGEoJ29ucy1wYWdlJywgdW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgZWxlbWVudC5kYXRhKCdfc2NvcGUnLCB1bmRlZmluZWQpO1xuXG4gICAgICAgICAgICAgICRvbnNlbi5jbGVhckNvbXBvbmVudCh7XG4gICAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgICBzY29wZTogc2NvcGUsXG4gICAgICAgICAgICAgICAgYXR0cnM6IGF0dHJzXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBzY29wZSA9IGVsZW1lbnQgPSBhdHRycyA9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgcG9zdDogZnVuY3Rpb24gcG9zdExpbmsoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7XG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leGVjdXRlIHdoZW4gdGhlIGV2ZW50IGlzIHRyaWdnZXJlZC5bL2VuXVxuICogICBbamFd5YmK6Zmk44GZ44KL44Kk44OZ44Oz44OI44Oq44K544OK44O844KS5oyH5a6a44GX44G+44GZ44CCWy9qYV1cbiAqL1xuXG4oZnVuY3Rpb24oKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvKipcbiAgICogUHVsbCBob29rIGRpcmVjdGl2ZS5cbiAgICovXG4gIGFuZ3VsYXIubW9kdWxlKCdvbnNlbicpLmRpcmVjdGl2ZSgnb25zUHVsbEhvb2snLCBmdW5jdGlvbigkb25zZW4sIFB1bGxIb29rVmlldykge1xuICAgIHJldHVybiB7XG4gICAgICByZXN0cmljdDogJ0UnLFxuICAgICAgcmVwbGFjZTogZmFsc2UsXG4gICAgICBzY29wZTogdHJ1ZSxcblxuICAgICAgY29tcGlsZTogZnVuY3Rpb24oZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBwcmU6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgICAgICAgICAgdmFyIHB1bGxIb29rID0gbmV3IFB1bGxIb29rVmlldyhzY29wZSwgZWxlbWVudCwgYXR0cnMpO1xuXG4gICAgICAgICAgICAkb25zZW4uZGVjbGFyZVZhckF0dHJpYnV0ZShhdHRycywgcHVsbEhvb2spO1xuICAgICAgICAgICAgJG9uc2VuLnJlZ2lzdGVyRXZlbnRIYW5kbGVycyhwdWxsSG9vaywgJ2NoYW5nZXN0YXRlIGRlc3Ryb3knKTtcbiAgICAgICAgICAgIGVsZW1lbnQuZGF0YSgnb25zLXB1bGwtaG9vaycsIHB1bGxIb29rKTtcblxuICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBwdWxsSG9vay5fZXZlbnRzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICBlbGVtZW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LnF1ZXVlKGZ1bmN0aW9uKGRvbmUpIHtcbiAgICAgICAgICAgICAgY2FsbGJhY2soKTtcbiAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5wbGF5KCk7XG5cbiAgICAgICAgICBhbmltaXQodGhpcy5fbWVudVBhZ2VbMF0pXG4gICAgICAgICAgICAud2FpdChkZWxheSlcbiAgICAgICAgICAgIC5xdWV1ZShiZWhpbmRTdHlsZSwge1xuICAgICAgICAgICAgICBkdXJhdGlvbjogZHVyYXRpb24sXG4gICAgICAgICAgICAgIHRpbWluZzogdGhpcy50aW1pbmdcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucGxheSgpO1xuXG4gICAgICAgIH0uYmluZCh0aGlzKSwgMTAwMCAvIDYwKTtcbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gY2FsbGJhY2tcbiAgICAgICAqIEBwYXJhbSB7Qm9vbGVhbn0gaW5zdGFudFxuICAgICAgICovXG4gICAgICBjbG9zZU1lbnU6IGZ1bmN0aW9uKGNhbGxiYWNrLCBpbnN0YW50KSB7XG4gICAgICAgIHZhciBkdXJhdGlvbiA9IGluc3RhbnQgPT09IHRydWUgPyAwLjAgOiB0aGlzLmR1cmF0aW9uO1xuICAgICAgICB2YXIgZGVsYXkgPSBpbnN0YW50ID09PSB0cnVlID8gMC4wIDogdGhpcy5kZWxheTtcblxuICAgICAgICB2YXIgYWJvdmVUcmFuc2Zvcm0gPSB0aGlzLl9nZW5lcmF0ZUFib3ZlUGFnZVRyYW5zZm9ybSgwKTtcbiAgICAgICAgdmFyIGJlaGluZFN0eWxlID0gdGhpcy5fZ2VuZXJhdGVCZWhpbmRQYWdlU3R5bGUoMCk7XG5cbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcblxuICAgICAgICAgIGFuaW1pdCh0aGlzLl9tYWluUGFnZVswXSlcbiAgICAgICAgICAgIC53YWl0KGRlbGF5KVxuICAgICAgICAgICAgLnF1ZXVlKHtcbiAgICAgICAgICAgICAgdHJhbnNmb3JtOiBhYm92ZVRyYW5zZm9ybVxuICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICBkdXJhdGlvbjogZHVyYXRpb24sXG4gICAgICAgICAgICAgIHRpbWluZzogdGhpcy50aW1pbmdcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucXVldWUoe1xuICAgICAgICAgICAgICB0cmFuc2Zvcm06ICd0cmFuc2xhdGUzZCgwLCAwLCAwKSdcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucXVldWUoZnVuY3Rpb24oZG9uZSkge1xuICAgICAgICAgICAgICB0aGlzLl9tZW51UGFnZS5jc3MoJ2Rpc3BsYXknLCAnbm9uZScpO1xuICAgICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpXG4gICAgICAgICAgICAucGxheSgpO1xuXG4gICAgICAgICAgYW5pbWl0KHRoaXMuX21lbnVQYWdlWzBdKVxuICAgICAgICAgICAgLndhaXQoZGVsYXkpXG4gICAgICAgICAgICAucXVldWUoYmVoaW5kU3R5bGUsIHtcbiAgICAgICAgICAgICAgZHVyYXRpb246IGR1cmF0aW9uLFxuICAgICAgICAgICAgICB0aW1pbmc6IHRoaXMudGltaW5nXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnF1ZXVlKGZ1bmN0aW9uKGRvbmUpIHtcbiAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5wbGF5KCk7XG5cbiAgICAgICAgfS5iaW5kKHRoaXMpLCAxMDAwIC8gNjApO1xuICAgICAgfSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0aW9uc1xuICAgICAgICogQHBhcmFtIHtOdW1iZXJ9IG9wdGlvbnMuZ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1ZVxuICAgICAgICogQHBhcmFtIHtCb29sZWFufSBvcHRpb25zLmlzUmlnaHRcbiAgICAgICAqL1xuICAgICAgc2V0dXA6IGZ1bmN0aW9uKGVsZW1lbnQsIG1haW5QYWdlLCBtZW51UGFnZSwgb3B0aW9ucykge1xuICAgICAgICB0aGlzLl9lbGVtZW50ID0gZWxlbWVudDtcbiAgICAgICAgdGhpcy5fbWVudVBhZ2UgPSBtZW51UGFnZTtcbiAgICAgICAgdGhpcy5fbWFpblBhZ2UgPSBtYWluUGFnZTtcbiAgICAgICAgdGhpcy5faXNSaWdodCA9ICEhb3B0aW9ucy5pc1JpZ2h0O1xuICAgICAgICB0aGlzLl93aWR0aCA9IG9wdGlvbnMud2lkdGggfHwgJzkwJSc7XG5cbiAgICAgICAgbWFpblBhZ2UuY3NzKHtcbiAgICAgICAgICBib3hTaGFkb3c6ICcwcHggMCAxMHB4IDBweCByZ2JhKDAsIDAsIDAsIDAuMiknXG4gICAgICAgIH0pO1xuXG4gICAgICAgIG1lbnVQYWdlLmNzcyh7XG4gICAgICAgICAgd2lkdGg6IG9wdGlvbnMud2lkdGgsXG4gICAgICAgICAgb3BhY2l0eTogMC45LFxuICAgICAgICAgIGRpc3BsYXk6ICdub25lJ1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAodGhpcy5faXNSaWdodCkge1xuICAgICAgICAgIG1lbnVQYWdlLmNzcyh7XG4gICAgICAgICAgICByaWdodDogJzBweCcsXG4gICAgICAgICAgICBsZWZ0OiAnYXV0bydcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBtZW51UGFnZS5jc3Moe1xuICAgICAgICAgICAgcmlnaHQ6ICdhdXRvJyxcbiAgICAgICAgICAgIGxlZnQ6ICcwcHgnXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLl9ibGFja01hc2sgPSBhbmd1bGFyLmVsZW1lbnQoJzxkaXY+PC9kaXY+JykuY3NzKH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AgICBhbmltaXQodGhpcy5fbWFpblBhZ2VbMF0pXG4gICAgICAgICAgICAud2FpdChkZWxheSlcbiAgICAgICAgICAgIC5xdWV1ZSh7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybTogYWJvdmVUcmFuc2Zvcm1cbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgZHVyYXRpb246IGR1cmF0aW9uLFxuICAgICAgICAgICAgICB0aW1pbmc6IHRoaXMudGltaW5nXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnF1ZXVlKHtcbiAgICAgICAgICAgICAgdHJhbnNmb3JtOiAndHJhbnNsYXRlM2QoMCwgMCwgMCknXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnF1ZXVlKGZ1bmN0aW9uKGRvbmUpIHtcbiAgICAgICAgICAgICAgdGhpcy5fbWVudVBhZ2UuY3NzKCdkaXNwbGF5JywgJ25vbmUnKTtcbiAgICAgICAgICAgICAgY2FsbGJhY2soKTtcbiAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgfS5iaW5kKHRoaXMpKVxuICAgICAgICAgICAgLnBsYXkoKTtcblxuICAgICAgICAgIGFuaW1pdCh0aGlzLl9tZW51UGFnZVswXSlcbiAgICAgICAgICAgIC53YWl0KGRlbGF5KVxuICAgICAgICAgICAgLnF1ZXVlKGJlaGluZFN0eWxlLCB7XG4gICAgICAgICAgICAgIGR1cmF0aW9uOiBkdXJhdGlvbixcbiAgICAgICAgICAgICAgdGltaW5nOiB0aGlzLnRpbWluZ1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5xdWV1ZShmdW5jdGlvbihkb25lKSB7XG4gICAgICAgICAgICAgIGRvbmUoKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucGxheSgpO1xuXG4gICAgICAgIH0uYmluZCh0aGlzKSwgMTAwMCAvIDYwKTtcbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAgICAgICogQHBhcmFtIHtPYm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mFuc2NsdWRlLlxuICAgICAgdHJhbnNjbHVkZTogZmFsc2UsXG4gICAgICBzY29wZTogdHJ1ZSxcblxuICAgICAgY29tcGlsZTogZnVuY3Rpb24oZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgICAgdmFyIG1haW4gPSBlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJy5tYWluJyksXG4gICAgICAgICAgICBtZW51ID0gZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCcubWVudScpO1xuXG4gICAgICAgIGlmIChtYWluKSB7XG4gICAgICAgICAgdmFyIG1haW5IdG1sID0gYW5ndWxhci5lbGVtZW50KG1haW4pLnJlbW92ZSgpLmh0bWwoKS50cmltKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWVudSkge1xuICAgICAgICAgIHZhciBtZW51SHRtbCA9IGFuZ3VsYXIuZWxlbWVudChtZW51KS5yZW1vdmUoKS5odG1sKCkudHJpbSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgICAgICAgIGVsZW1lbnQuYXBwZW5kKGFuZ3VsYXIuZWxlbWVudCgnPGRpdj48L2Rpdj4nKS5hZGRDbGFzcygnb25zZW4tc2xpZGluZy1tZW51X19tZW51IG9ucy1zbGlkaW5nLW1lbnUtaW5uZXInKSk7XG4gICAgICAgICAgZWxlbWVudC5hcHBlbmQoYW5ndWxhci5lbGVtZW50KCc8ZGl2PjwvZGl2PicpLmFkZENsYXNzKCdvbnNlbi1zbGlkaW5nLW1lbnVfX21haW4gb25zLXNsaWRpbmctbWVudS1pbm5lcicpKTtcblxuICAgICAgICAgIHZhciBzbGlkaW5nTWVudSA9IG5ldyBTbGlkaW5nTWVudVZpZXcoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKTtcblxuICAgICAgICAgICRvbnNlbi5yZWdpc3RlckV2ZW50SGFuZGxlcnMoc2xpZGluZ01lbnUsICdw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R9IGV2ZW50XG4gKiAgIFtlbl1FdmVudCBvYmplY3QuWy9lbl1cbiAqICAgW2phXeOCpOODmeODs+ODiOOCquODluOCuOOCp+OCr+ODiOOAglsvamFdXG4gKiBAcGFyYW0ge09iamVjdH0gZXZlbnQuc3BsaXRWaWV3XG4gKiAgIFtlbl1TcGxpdCB2aWV3IG9iamVjdC5bL2VuXVxuICogICBbamFd44Kk44OZ44Oz44OI44GM55m654Gr44GX44GfU3BsaXRWaWV344Kq44OW44K444Kn44Kv44OI44Gn44GZ44CCWy9qYV1cbiAqIEBwYXJhbSB7TnVtYmVyfSBldmVudC53aWR0aFxuICogICBbZW5dQ3VycmVudCB3aWR0aC5bL2VuXVxuICogICBbamFd54++5Zyo44GuU3BsaXRWaWV3buOBruW5heOBp+OBmeOAglsvamFdXG4gKiBAcGFyYW0ge1N0cmluZ30gZXZlbnQub3JpZW50YXRpb25cbiAqICAgW2VuXUN1cnJlbnQgb3JpZW50YXRpb24uWy9lbl1cbiAqICAgW2phXeePvuWcqOOBrueUu+mdouOBruOCquODquOCqOODs+ODhuODvOOCt+ODp+ODs+OCkui/lOOBl+OBvuOBmeOAglwicG9ydHJhaXRcIuOCguOBl+OBj+OBr1wibGFuZHNjYXBlXCLjgafjgZnjgIJbL2phXVxuICovXG5cbi8qKlxuICogQGV2ZW50IHByZWNvbGxhcHNlXG4gKiBAZGVzY3JpcHRpb25cbiAqICAgW2VuXUZpcmVkIGp1c3QgYmVmb3JlIHRoZSB2aWV3IGlzIGNvbGxhcHNlZC5bL2VuXVxuICogICBbamFdY29sbGFwc2XnirbmhYvjgavjgarjgovliY3jgavnmbrngavjgZfjgb7jgZnjgIJbL2phXVxuICogQHBhcmFtIHtPYmplY3R9IGV2ZW50XG4gKiAgIFtlbl1FdmVudCBvYmplY3QuWy9lbl1cbiAqICAgW2phXeOCpOODmeODs+ODiOOCquODluOCuOOCp+OCr+ODiOOAglsvamFdXG4gKiBAcGFyYW0ge09iamVjdH0gZXZlbnQuc3BsaXRWaWV3XG4gKiAgIFtlbl1TcGxpdCB2aWV3IG9iamVjdC5bL2VuXVxuICogICBbamFd44Kk44OZ44Oz44OI44GM55m654Gr44GX44GfU3BsaXRWaWV344Kq44OW44K444Kn44Kv44OI44Gn44GZ44CCWy9qYV1cbiAqIEBwYXJhbSB7TnVtYmVyfSBldmVudC53aWR0aFxuICogICBbZW5dQ3VycmVudCB3aWR0aC5bL2VuXVxuICogICBbamFd54++5Zyo44GuU3BsaXRWaWV3buOBruW5heOBp+OBmeOAglsvamFdXG4gKiBAcGFyYW0ge1N0cmluZ30gZXZlbnQub3JpZW50YXRpb25cbiAqICAgW2VuXUN1cnJlbnQgb3JpZW50YXRpb24uWy9lbl1cbiAqICAgW2phXeePvuWcqOOBrueUu+mdouOBruOCquODquOCqOODs+ODhuODvOOCt+ODp+ODs+OCkui/lOOBl+OBvuOBmeOAglwicG9ydHJhaXRcIuOCguOBl+OBj+OBr1wibGFuZHNjYXBlXCLjgafjgZnjgIJbL2phXVxuICovXG5cbi8qKlxuICogQGV2ZW50IHBvc3Rjb2xsYXBzZVxuICogQGRlc2NyaXB0aW9uXG4gKiAgIFtlbl1GaXJlZCBqdXN0IGFmdGVyIHRoZSB2aWV3IGlzIGNvbGxhcHNlZC5bL2VuXVxuICogICBbamFdY29sbGFwc2XnirbmhYvjgavjgarjgaPjgZ/lvozjgavnmbrngavjgZfjgb7jgZnjgIJbL2phXVxuICogQHBhcmFtIHtPYmplY3R9IGV2ZW50XG4gKiAgIFtlbl1FdmVudCBvYmplY3QuWy9lbl1cbiAqICAgW2phXeOCpOODmeODs+ODiOOCquODluOCuOOCp+OCr+ODiOOAglsvamFdXG4gKiBAcGFyYW0ge09iamVjdH0gZXZlbnQuc3BsaXRWaWV3XG4gKiAgIFtlbl1TcGxpdCB2aWV3IG9iamVjdC5bL2VuXVxuICogICBbamFd44Kk44OZ44Oz44OI44GM55m654Gr44GX44GfU3BsaXRWaWV344Kq44OW44K444Kn44Kv44OI44Gn44GZ44CCWy9qYV1cbiAqIEBwYXJhbSB7TnVtYmVyfSBldmVudC53aWR0aFxuICogICBbZW5dQ3VycmVudCB3aWR0aC5bL2VuXVxuICogICBbamFd54++5Zyo44GuU3BsaXRWaWV3buOBruW5heOBp+OBmeOAglsvamFdXG4gKiBAcGFyYW0ge1N0cmluZ30gZXZlbnQub3JpZW50YXRpb25cbiAqICAgW2VuXUN1cnJlbnQgb3JpZW50YXRpb24uWy9lbl1cbiAqICAgW2phXeePvuWcqOOBrueUu+mdouOBruOCquODquOCqOODs+ODhuODvOOCt+ODp+ODs+OCkui/lOOBl+OBvuOBmeOAglwicG9ydHJhaXRcIuOCguOBl+OBj+OBr1wibGFuZHNjYXBlXCLjgafjgZnjgIJbL2phXVxuICovXG5cbi8qKlxuICogQGF0dHJpYnV0ZSB2YXJcbiAqIEBpbml0b25seVxuICogQHR5cGUge1N0cmluZ31cbiAqIEBkZXNjcmlwdGlvblxuICogICBbZW5dVmFyaWFibGUgbmFtZSB0byByZWZlciB0aGlzIHNwbGl0IHZpZXcuWy9lbl1cbiAqICAgW2phXeOBk+OBruOCueODl+ODquODg+ODiOODk+ODpeODvOOCs+ODs+ODneODvOODjeODs+ODiOOCkuWPgueFp+OBmeOCi+OBn+OCgeOBruWQjeWJjeOCkuaMh+WumuOBl+OBvuOBmeOAglsvamFdXG4gKi9cblxuLyoqXG4gKiBAYXR0cmlidXRlIG1haW4tcGFnZVxuICogQGluaXRvbmx5XG4gKiBAdHlwZSB7U3RyaW5nfVxuICogQGRlc2NyaXB0aW9uXG4gKiAgIFtlbl1UaGUgdXJsIG9mIHRoZSBwYWdlIG9uIHRoZSByaWdodC5bL2VuXVxuICogICBbamFd5Y+z5YG044Gr6KGo56S644GZ44KL44Oa44O844K444GuVVJM44KS5oyH5a6a44GX44G+44GZ44CCWy9qYV1cbiAqL1xuXG4vKipcbiAqIEBhdHRyaWJ1dGUgbWFpbi1wYWdlLXdpZHRoXG4gKiBAaW5pdG9ubHlcbiAqIEB0eXB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ID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgIHZhciBhdHRyID0gJ25nJyArIHRpdGxpemUoZXZlbnQudHlwZSk7XG5cbiAgICAgICAgICAgIGlmIChhdHRyIGluIHNjb3BlRGVmKSB7XG4gICAgICAgICAgICAgIHNjb3BlW2F0dHJdKHskZXZlbnQ6IGV2ZW50fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciBnZXN0dXJlRGV0ZWN0b3I7XG5cbiAgICAgICAgICBzZXRJbW1lZGlhdGUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBnZXN0dXJlRGV0ZWN0b3IgPSBlbGVtZW50WzBdLl9nZXN0dXJlRGV0ZWN0b3I7XG4gICAgICAgICAgICBnZXN0dXJlRGV0ZWN0b3Iub24oRVZFTlRTLmpvaW4oJyAnKSwgaGFuZGxlcik7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAkb25zZW4uY2xlYW5lci5vbkRlc3Ryb3koc2NvcGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZ2VzdHVyZURldGVjdG9yLm9mZihFVkVOVFMuam9pbignICcpLCBoYW5kbGVyKTtcbiAgICAgICAgICAgICRvbnNlbi5jbGVhckNvbXBvbmVudCh7XG4gICAgICAgICAgICAgIHNjb3BlOiBzY29wZSxcbiAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgYXR0cnM6IGF0dHJzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGdlc3R1cmVEZXRlY3Rvci5lbGVtZW50ID0gc2NvcGUgPSBlbGVtZW50ID0gYXR0cnMgPSBudWxsO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgJG9uc2VuLmZpcmVDb21wb25lbnRFdmVudChlbGVtZW50WzBdLCAnaW5pdCcpO1xuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH0pO1xufSkoKTtcblxuIi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xvYmFsLm9yaWVudGF0aW9uLm9mZignY2hhbmdlJywgdXBkYXRlKTtcblxuICAgICAgICAgICAgJG9uc2VuLmNsZWFyQ29tcG9uZW50KHtcbiAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgc2NvcGU6IHNjb3BlLFxuICAgICAgICAgICAgICBhdHRyczogYXR0cnNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZWxlbWVudCA9IHNjb3BlID0gYXR0cnMgPSBudWxsO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgZnVuY3Rpb24gdXBkYXRlKCkge1xuICAgICAgICAgICAgdmFyIHVzZXJPcmllbnRhdGlvbiA9ICgnJyArIGF0dHJzLm9uc0lmT3JpZW50YXRpb24pLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICB2YXIgb3JpZW50YXRpb24gPSBnZXRMYW5kc2NhcGVPclBvcnRyYWl0KCk7XG5cbiAgICAgICAgICAgIGlmICh1c2VyT3JpZW50YXRpb24gPT09ICdwb3J0cmFpdCcgfHwgdXNlck9yaWVudGF0aW9uID09PSAnbGFuZHNjYXBlJykge1xuICAgICAgICAgICAgICBpZiAodXNlck9yaWVudGF0aW9uID09PSBvcmllbnRhdGlvbikge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQuY3NzKCdkaXNwbGF5JywgJycpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQuY3NzKCdkaXNwbGF5JywgJ25vbmUnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGZ1bmN0aW9uIGdldExhbmRzY2FwZU9yUG9ydHJhaXQoKSB7XG4gICAgICAgICAgICByZXR1cm4gJG9uc0dsb2JhbC5vcmllbnRhdGlvbi5pc1BvcnRyYWl0KCkgPyAncG9ydHJhaXQnIDogJ2xhbmRzY2FwZSc7XG4gICAgICAgICAg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2NvcGUsIGVsLnZhbHVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzZXQoc2NvcGUsIGVsLmNoZWNrZWQpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChhdHRycy5uZ0NoYW5nZSkge1xuICAgICAgICAgICAgc2NvcGUuJGV2YWwoYXR0cnMubmdDaGFuZ2UpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHNjb3BlLiRwYXJlbnQuJGV2YWxBc3luYygpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChhdHRycy5uZ01vZGVsKSB7XG4gICAgICAgICAgc2NvcGUuJHdhdGNoKGF0dHJzLm5nTW9kZWwsICh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgaWYgKGVsLl9pc1RleHRJbnB1dCAmJiB0eXBlb2YgdmFsdWUgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgIGVsLnZhbHVlID0gdmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChlbC50eXBlID09PSAncmFkaW8nKSB7XG4gICAgICAgICAgICAgIGVsLmNoZWNrZWQgPSB2YWx1ZSA9PT0gZWwudmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZWwuY2hlY2tlZCA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgZWwuX2lzVGV4dElucHV0XG4gICAgICAgICAgICA/IGVsZW1lbnQub24oJ2lucHV0Jywgb25JbnB1dClcbiAgICAgICAgICAgIDogZWxlbWVudC5vbignY2hhbmdlJywgb25JbnB1dCk7XG4gICAgICAgIH1cblxuICAgICAgICBzY29wZS4kb24oJyRkZXN0cm95JywgKCkgPT4ge1xuICAgICAgICAgIGVsLl9pc1RleHRJbnB1dFxuICAgICAgICAgICAgPyBlbGVtZW50Lm9mZignaW5wdXQnLCBvbklucHV0KVxuICAgICAgICAgICAgOiBlbGVtZW50Lm9mZignY2hhbmdlJywgb25JbnB1dCk7XG5cbiAgICAgICAgICBzY29wZSA9IGVsZW1lbnQgPSBhdHRycyA9IGVsID0gbnVsbDtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfTtcbiAgfSk7XG59KSgpO1xuIiwiLyoqXG4gKiBAZWxlbWVudCBvbnMta2V5Ym9hcmQtYWN0aXZlXG4gKiBAY2F0ZWdvcnkgZm9ybVxuICogQGRlc2NyaXB0aW9uXG4gKiAgIFtlbl1cbiAqICAgICBDb25kaXRpb25hbGx5IGRpc3BsYXkgY29udGVudCBkZXBlbmRpbmcgb24gaWYgdGhlIHNvZnR3YXJlIGtleWJvYXJkIGlzIHZpc2libGUgb3IgaGlkZGVuLlxuICogICAgIFRoaXMgY29tcG9uZW50IHJlcXVpcmVzIGNvcmRvdmEgYW5kIHRoYXQgdGhlIGNvbS5pb25pYy5rZXlib2FyZCBwbHVnaW4gaXMgaW5zdGFsbGVkLlxuICogICBbL2VuXVxuICogICBbamFdXG4gKiAgICAg44K944OV44OI44Km44Kn44Ki44Kt44O844Oc44O844OJ44GM6KGo56S644GV44KM44Gm44GE44KL44GL44Gp44GG44GL44Gn44CB44Kz44Oz44OG44Oz44OE44KS6KGo56S644GZ44KL44GL44Gp44GG44GL44KS5YiH44KK5pu/44GI44KL44GT44Go44GM5Ye65p2l44G+44GZ44CCXG4gKiAgICAg44GT44Gu44Kz44Oz44Od44O844ON44Oz44OI44Gv44CBQ29yZG92YeOChGNvbS5pb25pYy5rZXlib2FyZOODl+ODqeOCsOOCpOODs+OCkuW/heimgeOBqOOBl+OBvuOBmeOAglxuICogICBbL2phXVxuICogQGd1aWRlIFV0aWxpdHlBUElzXG4gKiAgIFtlbl1PdGhlciB1dGlsaXR5IEFQSXNbL2VuXVxuICogICBbamFd5LuW44Gu44Om44O844OG44Kj44Oq44OG44KjQVBJWy9qYV1cbiAqIEBleGFtcGxlXG4gK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GlvbigkcGFyc2UpIHtcbiAgICByZXR1cm4ge1xuICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgIHJlcGxhY2U6IGZhbHNlLFxuICAgICAgc2NvcGU6IGZhbHNlLFxuXG4gICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcblxuICAgICAgICBjb25zdCBvbklucHV0ID0gKCkgPT4ge1xuICAgICAgICAgIGNvbnN0IHNldCA9ICRwYXJzZShhdHRycy5uZ01vZGVsKS5hc3NpZ247XG5cbiAgICAgICAgICBzZXQoc2NvcGUsIGVsZW1lbnRbMF0udmFsdWUpO1xuICAgICAgICAgIGlmIChhdHRycy5uZ0NoYW5nZSkge1xuICAgICAgICAgICAgc2NvcGUuJGV2YWwoYXR0cnMubmdDaGFuZ2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzY29wZS4kcGFyZW50LiRldmFsQXN5bmMoKTtcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoYXR0cnMubmdNb2RlbCkge1xuICAgICAgICAgIHNjb3BlLiR3YXRjaChhdHRycy5uZ01vZGVsLCAodmFsdWUpID0+IHtcbiAgICAgICAgICAgIGVsZW1lbnRbMF0udmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGVsZW1lbnQub24oJ2lucHV0Jywgb25JbnB1dCk7XG4gICAgICAgIH1cblxuICAgICAgICBzY29wZS4kb24oJyRkZXN0cm95JywgKCkgPT4ge1xuICAgICAgICAgIGVsZW1lbnQub2ZmKCdpbnB1dCcsIG9uSW5wdXQpO1xuICAgICAgICAgIHNjb3BlID0gZWxlbWVudCA9IGF0dHJzID0gbnVsbDtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfTtcbiAgfSk7XG59KSgpO1xuIiwiKGZ1bmN0aW9uKCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgYW5ndWxhci5tb2R1bGUoJ29uc2VuJykuZGlyZWN0aXZ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ryb3koc2NvcGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYobmFtZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgICAgICAgZWxlbWVudCA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIuZGVzdHJveVNjb3BlKHNjb3BlKTtcbiAgICAgICAgICAgICAgICAgIHNjb3BlID0gbnVsbDtcblxuICAgICAgICAgICAgICAgICAgQ29tcG9uZW50Q2xlYW5lci5kZXN0cm95QXR0cmlidXRlcyhhdHRyKTtcbiAgICAgICAgICAgICAgICAgIGF0dHIgPSBudWxsO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgIH1dO1xuXG4gICAgICAgIGZ1bmN0aW9uIGRpcmVjdGl2ZU5vcm1hbGl6ZShuYW1lKSB7XG4gICAgICAgICAgcmV0dXJuIG5hbWUucmVwbGFjZSgvLShbYS16XSkvZywgZnVuY3Rpb24obWF0Y2hlcykge1xuICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXNbMV0udG9VcHBlckNhc2UoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICk7XG4gICAgbW9kdWxlLmNvbmZpZyhmdW5jdGlvbigkcHJvdmlkZSkge1xuICAgICAgdmFyIHNoaWZ0ID0gZnVuY3Rpb24oJGRlbGVnYXRlKSB7XG4gICAgICAgICRkZWxlZ2F0ZS5zaGlmdCgpO1xuICAgICAgICByZXR1cm4gJGRlbGVnYXRlO1xuICAgICAgfTtcbiAgICAgIE9iamVjdC5rZXlzKG5nRXZlbnREaXJlY3RpdmVzKS5mb3JFYWNoKGZ1bmN0aW9uKGRpcmVjdGl2ZU5hbWUpIHtcbiAgICAgICAgJHByb3ZpZGUuZGVjb3JhdG9yKGRpcmVjdGl2ZU5hbWUgKyAnRGlyZWN0aXZ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gICAgdmFyIHRlbXBsYXRlID0gYW5ndWxhci5lbGVtZW50KHRlbXBsYXRlc1tpXSk7XG4gICAgICB2YXIgaWQgPSB0ZW1wbGF0ZS5hdHRyKCdpZCcpO1xuICAgICAgaWYgKHR5cGVvZiBpZCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgJHRlbXBsYXRlQ2FjaGUucHV0KGlkLCB0ZW1wbGF0ZS50ZXh0KCkpO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbn0pKCk7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
src/svg-icons/action/hourglass-empty.js
mit-cml/iot-website-source
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionHourglassEmpty = (props) => ( <SvgIcon {...props}> <path d="M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"/> </SvgIcon> ); ActionHourglassEmpty = pure(ActionHourglassEmpty); ActionHourglassEmpty.displayName = 'ActionHourglassEmpty'; ActionHourglassEmpty.muiName = 'SvgIcon'; export default ActionHourglassEmpty;
step4-router/node_modules/react-router/modules/IndexRedirect.js
jintoppy/react-training
import React from 'react' import warning from './routerWarning' import invariant from 'invariant' import Redirect from './Redirect' import { falsy } from './PropTypes' const { string, object } = React.PropTypes /** * An <IndexRedirect> is used to redirect from an indexRoute. */ const IndexRedirect = React.createClass({ statics: { createRouteFromReactElement(element, parentRoute) { /* istanbul ignore else: sanity check */ if (parentRoute) { parentRoute.indexRoute = Redirect.createRouteFromReactElement(element) } else { warning( false, 'An <IndexRedirect> does not make sense at the root of your route config' ) } } }, propTypes: { to: string.isRequired, query: object, state: object, onEnter: falsy, children: falsy }, /* istanbul ignore next: sanity check */ render() { invariant( false, '<IndexRedirect> elements are for router configuration only and should not be rendered' ) } }) export default IndexRedirect
app/javascript/flavours/glitch/components/spoilers.js
Kirishima21/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; export default class Spoilers extends React.PureComponent { static propTypes = { spoilerText: PropTypes.string, children: PropTypes.node, }; state = { hidden: true, } handleSpoilerClick = () => { this.setState({ hidden: !this.state.hidden }); } render () { const { spoilerText, children } = this.props; const { hidden } = this.state; const toggleText = hidden ? <FormattedMessage id='status.show_more' defaultMessage='Show more' key='0' /> : <FormattedMessage id='status.show_less' defaultMessage='Show less' key='0' />; return ([ <p className='spoiler__text'> {spoilerText} {' '} <button tabIndex='0' className='status__content__spoiler-link' onClick={this.handleSpoilerClick}> {toggleText} </button> </p>, <div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}> {children} </div> ]); } }
App.js
kapone89/MonteOfficeExpo
import React from 'react'; import { StyleProvider } from 'native-base'; import { observer } from 'mobx-react/native'; import { observable } from 'mobx'; import Expo from 'expo'; import getTheme from './native-base-theme/components'; import montePlatform from './native-base-theme/variables/monte_platform'; import MonteOffice from './components/app'; @observer export default class App extends React.Component { async componentWillMount() { await Expo.Font.loadAsync({ Roboto: require('native-base/Fonts/Roboto.ttf'), Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf') }); this.fontsLoaded = true; } @observable fontsLoaded = false render() { return ( this.fontsLoaded && <StyleProvider style={getTheme(montePlatform)}> <MonteOffice /> </StyleProvider> ); } }
js/screens/HomeScreenComponents/OnBoardingView.js
ujwalramesh/REHU-discourse
/* @flow */ 'use strict' import React from 'react' import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' import colors from '../../colors' class OnBoardingView extends React.Component { static propTypes = { onDidPressAddSite: React.PropTypes.func.isRequired } render() { return ( <View style={styles.container}> <Text style={styles.text}> <Text style={{color: colors.grayTitle}}> You don’t have any sites yet. </Text> {'\n'} <Text style={{color: colors.graySubtitle}}> Add Discourse sites to keep track of. </Text> </Text> <View style={styles.button}> <TouchableOpacity onPress={() => this.props.onDidPressAddSite()}> <Text style={styles.buttonText}> + Add your first site </Text> </TouchableOpacity> </View> </View> ) } } const styles = StyleSheet.create({ container: { alignItems: 'center', backgroundColor: 'transparent', flex: 1, justifyContent: 'center' }, text: { fontSize: 16, marginBottom: 12, padding: 24, textAlign: 'center' }, buttonText: { backgroundColor: colors.blueCallToAction, color: 'white', fontSize: 16, fontWeight: '500', padding: 8 } }) export default OnBoardingView
ajax/libs/vue-material/0.5.0/components/mdSpinner/index.js
kennynaoh/cdnjs
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueMaterial=t():e.VueMaterial=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}({0:function(e,t,n){e.exports=n(25)},1:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i);t.default={props:{mdTheme:String},data:function(){return{closestThemedParent:!1}},methods:{getClosestThemedParent:function(e){return!(!e||!e.$el||0===e._uid)&&(e.mdTheme||e.mdName?e:this.getClosestThemedParent(e.$parent))}},computed:{themeClass:function(){if(this.mdTheme)return"md-theme-"+this.mdTheme;var e=this.closestThemedParent.mdTheme;return e||(e=this.closestThemedParent.mdName),"md-theme-"+(e||o.default.material.currentTheme)}},mounted:function(){this.closestThemedParent=this.getClosestThemedParent(this.$parent),o.default.material.currentTheme||o.default.material.setCurrentTheme("default")}},e.exports=t.default},2:function(e,t,n){(function(t){/*! * Vue.js v2.1.6 * (c) 2014-2016 Evan You * Released under the MIT License. */ "use strict";function n(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function r(e){var t=parseFloat(e,10);return t||0===t?t:e}function i(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}function o(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}function a(e,t){return yn.call(e,t)}function s(e){return"string"==typeof e||"number"==typeof e}function u(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function c(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function l(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function d(e,t){for(var n in t)e[n]=t[n];return e}function f(e){return null!==e&&"object"==typeof e}function p(e){return xn.call(e)===An}function v(e){for(var t={},n=0;n<e.length;n++)e[n]&&d(t,e[n]);return t}function h(){}function m(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}function y(e,t){return e==t||!(!f(e)||!f(t))&&JSON.stringify(e)===JSON.stringify(t)}function g(e,t){for(var n=0;n<e.length;n++)if(y(e[n],t))return n;return-1}function _(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function b(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function w(e){if(!Sn.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}function C(e){return/native code/.test(e.toString())}function x(e){qn.target&&Wn.push(qn.target),qn.target=e}function A(){qn.target=Wn.pop()}function $(e,t){e.__proto__=t}function k(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];b(e,o,t[o])}}function O(e){if(f(e)){var t;return a(e,"__ob__")&&e.__ob__ instanceof Gn?t=e.__ob__:Zn.shouldConvert&&!In()&&(Array.isArray(e)||p(e))&&Object.isExtensible(e)&&!e._isVue&&(t=new Gn(e)),t}}function S(e,t,n,r){var i=new qn,o=Object.getOwnPropertyDescriptor(e,t);if(!o||o.configurable!==!1){var a=o&&o.get,s=o&&o.set,u=O(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=a?a.call(e):n;return qn.target&&(i.depend(),u&&u.dep.depend(),Array.isArray(t)&&j(t)),t},set:function(t){var o=a?a.call(e):n;t===o||t!==t&&o!==o||(r&&r(),s?s.call(e,t):n=t,u=O(t),i.notify())}})}}function T(e,t,n){if(Array.isArray(e))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(a(e,t))return void(e[t]=n);var r=e.__ob__;return e._isVue||r&&r.vmCount?void Fn("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."):r?(S(r.value,t,n),r.dep.notify(),n):void(e[t]=n)}function E(e,t){var n=e.__ob__;return e._isVue||n&&n.vmCount?void Fn("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):void(a(e,t)&&(delete e[t],n&&n.dep.notify()))}function j(e){for(var t=void 0,n=0,r=e.length;n<r;n++)t=e[n],t&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&j(t)}function P(e,t){if(!t)return e;for(var n,r,i,o=Object.keys(t),s=0;s<o.length;s++)n=o[s],r=e[n],i=t[n],a(e,n)?p(r)&&p(i)&&P(r,i):T(e,n,i);return e}function M(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}function N(e,t){var n=Object.create(e||null);return t?d(n,t):n}function D(e){for(var t in e.components){var n=t.toLowerCase();(mn(n)||On.isReservedTag(n))&&Fn("Do not use built-in or reserved HTML elements as component id: "+t)}}function L(e){var t=e.props;if(t){var n,r,i,o={};if(Array.isArray(t))for(n=t.length;n--;)r=t[n],"string"==typeof r?(i=_n(r),o[i]={type:null}):Fn("props must be strings when using array syntax.");else if(p(t))for(var a in t)r=t[a],i=_n(a),o[i]=p(r)?r:{type:r};e.props=o}}function I(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function R(e,t,n){function r(r){var i=Qn[r]||er;l[r]=i(e[r],t[r],n,r)}D(t),L(t),I(t);var i=t.extends;if(i&&(e="function"==typeof i?R(e,i.options,n):R(e,i,n)),t.mixins)for(var o=0,s=t.mixins.length;o<s;o++){var u=t.mixins[o];u.prototype instanceof He&&(u=u.options),e=R(e,u,n)}var c,l={};for(c in e)r(c);for(c in t)a(e,c)||r(c);return l}function U(e,t,n,r){if("string"==typeof n){var i=e[t];if(a(i,n))return i[n];var o=_n(n);if(a(i,o))return i[o];var s=bn(o);if(a(i,s))return i[s];var u=i[n]||i[o]||i[s];return r&&!u&&Fn("Failed to resolve "+t.slice(0,-1)+": "+n,e),u}}function V(e,t,n,r){var i=t[e],o=!a(n,e),s=n[e];if(q(i.type)&&(o&&!a(i,"default")?s=!1:""!==s&&s!==Cn(e)||(s=!0)),void 0===s){s=F(r,i,e);var u=Zn.shouldConvert;Zn.shouldConvert=!0,O(s),Zn.shouldConvert=u}return B(i,e,s,r,o),s}function F(e,t,n){if(a(t,"default")){var r=t.default;return f(r)&&Fn('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',e),e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e[n]?e[n]:"function"==typeof r&&t.type!==Function?r.call(e):r}}function B(e,t,n,r,i){if(e.required&&i)return void Fn('Missing required prop: "'+t+'"',r);if(null!=n||e.required){var o=e.type,a=!o||o===!0,s=[];if(o){Array.isArray(o)||(o=[o]);for(var u=0;u<o.length&&!a;u++){var c=H(n,o[u]);s.push(c.expectedType),a=c.valid}}if(!a)return void Fn('Invalid prop: type check failed for prop "'+t+'". Expected '+s.map(bn).join(", ")+", got "+Object.prototype.toString.call(n).slice(8,-1)+".",r);var l=e.validator;l&&(l(n)||Fn('Invalid prop: custom validator check failed for prop "'+t+'".',r))}}function H(e,t){var n,r=z(t);return n="String"===r?typeof e==(r="string"):"Number"===r?typeof e==(r="number"):"Boolean"===r?typeof e==(r="boolean"):"Function"===r?typeof e==(r="function"):"Object"===r?p(e):"Array"===r?Array.isArray(e):e instanceof t,{valid:n,expectedType:r}}function z(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t&&t[1]}function q(e){if(!Array.isArray(e))return"Boolean"===z(e);for(var t=0,n=e.length;t<n;t++)if("Boolean"===z(e[t]))return!0;return!1}function W(){ur.length=0,cr={},lr={},dr=fr=!1}function K(){for(fr=!0,ur.sort(function(e,t){return e.id-t.id}),pr=0;pr<ur.length;pr++){var e=ur[pr],t=e.id;if(cr[t]=null,e.run(),null!=cr[t]&&(lr[t]=(lr[t]||0)+1,lr[t]>On._maxUpdateCount)){Fn("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}}Rn&&On.devtools&&Rn.emit("flush"),W()}function J(e){var t=e.id;if(null==cr[t]){if(cr[t]=!0,fr){for(var n=ur.length-1;n>=0&&ur[n].id>e.id;)n--;ur.splice(Math.max(n,pr)+1,0,e)}else ur.push(e);dr||(dr=!0,Un(K))}}function Y(e){mr.clear(),Z(e,mr)}function Z(e,t){var n,r,i=Array.isArray(e);if((i||f(e))&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Z(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)Z(e[r[n]],t)}}function G(e){e._watchers=[],Q(e),ne(e),X(e),ee(e),re(e)}function Q(e){var t=e.$options.props;if(t){var n=e.$options.propsData||{},r=e.$options._propKeys=Object.keys(t),i=!e.$parent;Zn.shouldConvert=i;for(var o=function(i){var o=r[i];yr[o]&&Fn('"'+o+'" is a reserved attribute and cannot be used as component prop.',e),S(e,o,V(o,t,n,e),function(){e.$parent&&!Zn.isSettingProps&&Fn("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+o+'"',e)})},a=0;a<r.length;a++)o(a);Zn.shouldConvert=!0}}function X(e){var t=e.$options.data;t=e._data="function"==typeof t?t.call(e):t||{},p(t)||(t={},Fn("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));for(var n=Object.keys(t),r=e.$options.props,i=n.length;i--;)r&&a(r,n[i])?Fn('The data property "'+n[i]+'" is already declared as a prop. Use prop default value instead.',e):ae(e,n[i]);O(t),t.__ob__&&t.__ob__.vmCount++}function ee(e){var t=e.$options.computed;if(t)for(var n in t){var r=t[n];"function"==typeof r?(gr.get=te(r,e),gr.set=h):(gr.get=r.get?r.cache!==!1?te(r.get,e):c(r.get,e):h,gr.set=r.set?c(r.set,e):h),Object.defineProperty(e,n,gr)}}function te(e,t){var n=new hr(t,e,h,{lazy:!0});return function(){return n.dirty&&n.evaluate(),qn.target&&n.depend(),n.value}}function ne(e){var t=e.$options.methods;if(t)for(var n in t)e[n]=null==t[n]?h:c(t[n],e),null==t[n]&&Fn('method "'+n+'" has an undefined value in the component definition. Did you reference the function correctly?',e)}function re(e){var t=e.$options.watch;if(t)for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)ie(e,n,r[i]);else ie(e,n,r)}}function ie(e,t,n){var r;p(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function oe(e){var t={};t.get=function(){return this._data},t.set=function(e){Fn("Avoid replacing instance root $data. Use nested data properties instead.",this)},Object.defineProperty(e.prototype,"$data",t),e.prototype.$set=T,e.prototype.$delete=E,e.prototype.$watch=function(e,t,n){var r=this;n=n||{},n.user=!0;var i=new hr(r,e,t,n);return n.immediate&&t.call(r,i.value),function(){i.teardown()}}}function ae(e,t){_(t)||Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return e._data[t]},set:function(n){e._data[t]=n}})}function se(e){return new _r(void 0,void 0,void 0,String(e))}function ue(e){var t=new _r(e.tag,e.data,e.children,e.text,e.elm,e.context,e.componentOptions);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isCloned=!0,t}function ce(e){for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=ue(e[n]);return t}function le(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function de(e){e.prototype._mount=function(e,t){var n=this;return n.$el=e,n.$options.render||(n.$options.render=br,n.$options.template&&"#"!==n.$options.template.charAt(0)?Fn("You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",n):Fn("Failed to mount component: template or render function not defined.",n)),fe(n,"beforeMount"),n._watcher=new hr(n,function(){n._update(n._render(),t)},h),t=!1,null==n.$vnode&&(n._isMounted=!0,fe(n,"mounted")),n},e.prototype._update=function(e,t){var n=this;n._isMounted&&fe(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=wr;wr=n,n._vnode=e,i?n.$el=n.__patch__(i,e):n.$el=n.__patch__(n.$el,e,t,!1,n.$options._parentElm,n.$options._refElm),wr=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el),n._isMounted&&fe(n,"updated")},e.prototype._updateFromParent=function(e,t,n,r){var i=this,o=!(!i.$options._renderChildren&&!r);if(i.$options._parentVnode=n,i.$vnode=n,i._vnode&&(i._vnode.parent=n),i.$options._renderChildren=r,e&&i.$options.props){Zn.shouldConvert=!1,Zn.isSettingProps=!0;for(var a=i.$options._propKeys||[],s=0;s<a.length;s++){var u=a[s];i[u]=V(u,i.$options.props,e,i)}Zn.shouldConvert=!0,Zn.isSettingProps=!1,i.$options.propsData=e}if(t){var c=i.$options._parentListeners;i.$options._parentListeners=t,i._updateListeners(t,c)}o&&(i.$slots=Ie(r,n.context),i.$forceUpdate())},e.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){fe(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||o(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,fe(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.__patch__(e._vnode,null)}}}function fe(e,t){var n=e.$options[t];if(n)for(var r=0,i=n.length;r<i;r++)n[r].call(e);e.$emit("hook:"+t)}function pe(e,t,n,r,i){if(e){var o=n.$options._base;if(f(e)&&(e=o.extend(e)),"function"!=typeof e)return void Fn("Invalid Component definition: "+String(e),n);if(!e.cid)if(e.resolved)e=e.resolved;else if(e=be(e,o,function(){n.$forceUpdate()}),!e)return;Be(e),t=t||{};var a=we(t,e);if(e.options.functional)return ve(e,a,t,n,r);var s=t.on;t.on=t.nativeOn,e.options.abstract&&(t={}),xe(t);var u=e.options.name||i,c=new _r("vue-component-"+e.cid+(u?"-"+u:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:a,listeners:s,tag:i,children:r});return c}}function ve(e,t,n,r,i){var o={},a=e.options.props;if(a)for(var s in a)o[s]=V(s,a,t);var u=Object.create(r),c=function(e,t,n,r){return Pe(u,e,t,n,r,!0)},l=e.options.render.call(null,c,{props:o,data:n,parent:r,children:i,slots:function(){return Ie(i,r)}});return l instanceof _r&&(l.functionalContext=r,n.slot&&((l.data||(l.data={})).slot=n.slot)),l}function he(e,t,n,r){var i=e.componentOptions,o={_isComponent:!0,parent:t,propsData:i.propsData,_componentTag:i.tag,_parentVnode:e,_parentListeners:i.listeners,_renderChildren:i.children,_parentElm:n||null,_refElm:r||null},a=e.data.inlineTemplate;return a&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new i.Ctor(o)}function me(e,t,n,r){if(!e.child||e.child._isDestroyed){var i=e.child=he(e,wr,n,r);i.$mount(t?e.elm:void 0,t)}else if(e.data.keepAlive){var o=e;ye(o,o)}}function ye(e,t){var n=t.componentOptions,r=t.child=e.child;r._updateFromParent(n.propsData,n.listeners,t,n.children)}function ge(e){e.child._isMounted||(e.child._isMounted=!0,fe(e.child,"mounted")),e.data.keepAlive&&(e.child._inactive=!1,fe(e.child,"activated"))}function _e(e){e.child._isDestroyed||(e.data.keepAlive?(e.child._inactive=!0,fe(e.child,"deactivated")):e.child.$destroy())}function be(e,t,n){if(!e.requested){e.requested=!0;var r=e.pendingCallbacks=[n],i=!0,o=function(n){if(f(n)&&(n=t.extend(n)),e.resolved=n,!i)for(var o=0,a=r.length;o<a;o++)r[o](n)},a=function(t){Fn("Failed to resolve async component: "+String(e)+(t?"\nReason: "+t:""))},s=e(o,a);return s&&"function"==typeof s.then&&!e.resolved&&s.then(o,a),i=!1,e.resolved}e.pendingCallbacks.push(n)}function we(e,t){var n=t.options.props;if(n){var r={},i=e.attrs,o=e.props,a=e.domProps;if(i||o||a)for(var s in n){var u=Cn(s);Ce(r,o,s,u,!0)||Ce(r,i,s,u)||Ce(r,a,s,u)}return r}}function Ce(e,t,n,r,i){if(t){if(a(t,n))return e[n]=t[n],i||delete t[n],!0;if(a(t,r))return e[n]=t[r],i||delete t[r],!0}return!1}function xe(e){e.hook||(e.hook={});for(var t=0;t<xr.length;t++){var n=xr[t],r=e.hook[n],i=Cr[n];e.hook[n]=r?Ae(i,r):i}}function Ae(e,t){return function(n,r,i,o){e(n,r,i,o),t(n,r,i,o)}}function $e(e,t,n,r){r+=t;var i=e.__injected||(e.__injected={});if(!i[r]){i[r]=!0;var o=e[t];o?e[t]=function(){o.apply(this,arguments),n.apply(this,arguments)}:e[t]=n}}function ke(e,t,n,r,i){var o,a,s,u,c,l,d;for(o in e)if(a=e[o],s=t[o],a)if(s){if(a!==s)if(Array.isArray(s)){s.length=a.length;for(var f=0;f<s.length;f++)s[f]=a[f];e[o]=s}else s.fn=a,e[o]=s}else d="~"===o.charAt(0),c=d?o.slice(1):o,l="!"===c.charAt(0),c=l?c.slice(1):c,Array.isArray(a)?n(c,a.invoker=Oe(a),d,l):(a.invoker||(u=a,a=e[o]={},a.fn=u,a.invoker=Se(a)),n(c,a.invoker,d,l));else Fn('Invalid handler for event "'+o+'": got '+String(a),i);for(o in t)e[o]||(d="~"===o.charAt(0),c=d?o.slice(1):o,l="!"===c.charAt(0),c=l?c.slice(1):c,r(c,t[o].invoker,l))}function Oe(e){return function(t){for(var n=arguments,r=1===arguments.length,i=0;i<e.length;i++)r?e[i](t):e[i].apply(null,n)}}function Se(e){return function(t){var n=1===arguments.length;n?e.fn(t):e.fn.apply(null,arguments)}}function Te(e){return s(e)?[se(e)]:Array.isArray(e)?Ee(e):void 0}function Ee(e,t){var n,r,i,o=[];for(n=0;n<e.length;n++)r=e[n],null!=r&&"boolean"!=typeof r&&(i=o[o.length-1],Array.isArray(r)?o.push.apply(o,Ee(r,(t||"")+"_"+n)):s(r)?i&&i.text?i.text+=String(r):""!==r&&o.push(se(r)):r.text&&i&&i.text?o[o.length-1]=se(i.text+r.text):(r.tag&&null==r.key&&null!=t&&(r.key="__vlist"+t+"_"+n+"__"),o.push(r)));return o}function je(e){return e&&e.filter(function(e){return e&&e.componentOptions})[0]}function Pe(e,t,n,r,i,o){return(Array.isArray(n)||s(n))&&(i=r,r=n,n=void 0),o&&(i=!0),Me(e,t,n,r,i)}function Me(e,t,n,r,i){if(n&&n.__ob__)return Fn("Avoid using observed data object as vnode data: "+JSON.stringify(n)+"\nAlways create fresh vnode data objects in each render!",e),br();if(!t)return br();Array.isArray(r)&&"function"==typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),i&&(r=Te(r));var o,a;if("string"==typeof t){var s;a=On.getTagNamespace(t),On.isReservedTag(t)?o=new _r(On.parsePlatformTagName(t),n,r,void 0,void 0,e):(s=U(e.$options,"components",t))?o=pe(s,n,e,r,t):(a="foreignObject"===t?"xhtml":a,o=new _r(t,n,r,void 0,void 0,e))}else o=pe(t,n,e,r);return o?(a&&Ne(o,a),o):br()}function Ne(e,t){if(e.ns=t,e.children)for(var n=0,r=e.children.length;n<r;n++){var i=e.children[n];i.tag&&!i.ns&&Ne(i,t)}}function De(e){e.$vnode=null,e._vnode=null,e._staticTrees=null;var t=e.$options._parentVnode,n=t&&t.context;e.$slots=Ie(e.$options._renderChildren,n),e.$scopedSlots={},e._c=function(t,n,r,i){return Pe(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Pe(e,t,n,r,i,!0)},e.$options.el&&e.$mount(e.$options.el)}function Le(e){function t(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&i(e[r],t+"_"+r,n);else i(e,t,n)}function i(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}e.prototype.$nextTick=function(e){return Un(e,this)},e.prototype._render=function(){var e=this,t=e.$options,n=t.render,r=t.staticRenderFns,i=t._parentVnode;if(e._isMounted)for(var o in e.$slots)e.$slots[o]=ce(e.$slots[o]);i&&i.data.scopedSlots&&(e.$scopedSlots=i.data.scopedSlots),r&&!e._staticTrees&&(e._staticTrees=[]),e.$vnode=i;var a;try{a=n.call(e._renderProxy,e.$createElement)}catch(t){if(!On.errorHandler)throw Fn("Error when rendering "+Vn(e)+":"),t;On.errorHandler.call(null,t,e),a=e._vnode}return a instanceof _r||(Array.isArray(a)&&Fn("Multiple root nodes returned from render function. Render function should return a single root node.",e),a=br()),a.parent=i,a},e.prototype._s=n,e.prototype._v=se,e.prototype._n=r,e.prototype._e=br,e.prototype._q=y,e.prototype._i=g,e.prototype._m=function(e,n){var r=this._staticTrees[e];return r&&!n?Array.isArray(r)?ce(r):ue(r):(r=this._staticTrees[e]=this.$options.staticRenderFns[e].call(this._renderProxy),t(r,"__static__"+e,!1),r)},e.prototype._o=function(e,n,r){return t(e,"__once__"+n+(r?"_"+r:""),!0),e},e.prototype._f=function(e){return U(this.$options,"filters",e,!0)||kn},e.prototype._l=function(e,t){var n,r,i,o,a;if(Array.isArray(e))for(n=new Array(e.length),r=0,i=e.length;r<i;r++)n[r]=t(e[r],r);else if("number"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(f(e))for(o=Object.keys(e),n=new Array(o.length),r=0,i=o.length;r<i;r++)a=o[r],n[r]=t(e[a],a,r);return n},e.prototype._t=function(e,t,n){var r=this.$scopedSlots[e];if(r)return r(n||{})||t;var i=this.$slots[e];return i&&(i._rendered&&Fn('Duplicate presence of slot "'+e+'" found in the same render tree - this will likely cause render errors.',this),i._rendered=!0),i||t},e.prototype._b=function(e,t,n,r){if(n)if(f(n)){Array.isArray(n)&&(n=v(n));for(var i in n)if("class"===i||"style"===i)e[i]=n[i];else{var o=r||On.mustUseProp(t,i)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={});o[i]=n[i]}}else Fn("v-bind without argument expects an Object or Array value",this);return e},e.prototype._k=function(e,t,n){var r=On.keyCodes[t]||n;return Array.isArray(r)?r.indexOf(e)===-1:r!==e}}function Ie(e,t){var n={};if(!e)return n;for(var r,i,o=[],a=0,s=e.length;a<s;a++)if(i=e[a],(i.context===t||i.functionalContext===t)&&i.data&&(r=i.data.slot)){var u=n[r]||(n[r]=[]);"template"===i.tag?u.push.apply(u,i.children):u.push(i)}else o.push(i);return o.length&&(1!==o.length||" "!==o[0].text&&!o[0].isComment)&&(n.default=o),n}function Re(e){e._events=Object.create(null);var t=e.$options._parentListeners,n=function(t,n,r){r?e.$once(t,n):e.$on(t,n)},r=c(e.$off,e);e._updateListeners=function(t,i){ke(t,i||{},n,r,e)},t&&e._updateListeners(t)}function Ue(e){e.prototype.$on=function(e,t){var n=this;return(n._events[e]||(n._events[e]=[])).push(t),n},e.prototype.$once=function(e,t){function n(){r.$off(e,n),t.apply(r,arguments)}var r=this;return n.fn=t,r.$on(e,n),r},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;var r=n._events[e];if(!r)return n;if(1===arguments.length)return n._events[e]=null,n;for(var i,o=r.length;o--;)if(i=r[o],i===t||i.fn===t){r.splice(o,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?l(n):n;for(var r=l(arguments,1),i=0,o=n.length;i<o;i++)n[i].apply(t,r)}return t}}function Ve(e){e.prototype._init=function(e){var t=this;t._uid=Ar++,t._isVue=!0,e&&e._isComponent?Fe(t,e):t.$options=R(Be(t.constructor),e||{},t),Xn(t),t._self=t,le(t),Re(t),fe(t,"beforeCreate"),G(t),fe(t,"created"),De(t)}}function Fe(e,t){var n=e.$options=Object.create(e.constructor.options);n.parent=t.parent,n.propsData=t.propsData,n._parentVnode=t._parentVnode,n._parentListeners=t._parentListeners,n._renderChildren=t._renderChildren,n._componentTag=t._componentTag,n._parentElm=t._parentElm,n._refElm=t._refElm,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function Be(e){var t=e.options;if(e.super){var n=e.super.options,r=e.superOptions,i=e.extendOptions;n!==r&&(e.superOptions=n,i.render=t.render,i.staticRenderFns=t.staticRenderFns,i._scopeId=t._scopeId,t=e.options=R(n,i),t.name&&(t.components[t.name]=e))}return t}function He(e){this instanceof He||Fn("Vue is a constructor and should be called with the `new` keyword"),this._init(e)}function ze(e){e.use=function(e){if(!e.installed){var t=l(arguments,1);return t.unshift(this),"function"==typeof e.install?e.install.apply(e,t):e.apply(null,t),e.installed=!0,this}}}function qe(e){e.mixin=function(e){this.options=R(this.options,e)}}function We(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;/^[a-zA-Z][\w-]*$/.test(o)||Fn('Invalid component name: "'+o+'". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.');var a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=R(n.options,e),a.super=n,a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,On._assetTypes.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,i[r]=a,a}}function Ke(e){On._assetTypes.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&On.isReservedTag(e)&&Fn("Do not use built-in or reserved HTML elements as component id: "+e),"component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function Je(e,t){return"string"==typeof e?e.split(",").indexOf(t)>-1:e.test(t)}function Ye(e){var t={};t.get=function(){return On},t.set=function(){Fn("Do not replace the Vue.config object, set individual fields instead.")},Object.defineProperty(e,"config",t),e.util=tr,e.set=T,e.delete=E,e.nextTick=Un,e.options=Object.create(null),On._assetTypes.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,d(e.options.components,Or),ze(e),qe(e),We(e),Ke(e)}function Ze(e){for(var t=e.data,n=e,r=e;r.child;)r=r.child._vnode,r.data&&(t=Ge(r.data,t));for(;n=n.parent;)n.data&&(t=Ge(t,n.data));return Qe(t)}function Ge(e,t){return{staticClass:Xe(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function Qe(e){var t=e.class,n=e.staticClass;return n||t?Xe(n,et(t)):""}function Xe(e,t){return e?t?e+" "+t:e:t||""}function et(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r<i;r++)e[r]&&(n=et(e[r]))&&(t+=n+" ");return t.slice(0,-1)}if(f(e)){for(var o in e)e[o]&&(t+=o+" ");return t.slice(0,-1)}return t}function tt(e){return Vr(e)?"svg":"math"===e?"math":void 0}function nt(e){if(!En)return!0;if(Fr(e))return!1;if(e=e.toLowerCase(),null!=Br[e])return Br[e];var t=document.createElement(e);return e.indexOf("-")>-1?Br[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Br[e]=/HTMLUnknownElement/.test(t.toString())}function rt(e){if("string"==typeof e){var t=e;if(e=document.querySelector(e),!e)return Fn("Cannot find element: "+t),document.createElement("div")}return e}function it(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function ot(e,t){return document.createElementNS(Rr[e],t)}function at(e){return document.createTextNode(e)}function st(e){return document.createComment(e)}function ut(e,t,n){e.insertBefore(t,n)}function ct(e,t){e.removeChild(t)}function lt(e,t){e.appendChild(t)}function dt(e){return e.parentNode}function ft(e){return e.nextSibling}function pt(e){return e.tagName}function vt(e,t){e.textContent=t}function ht(e,t,n){e.setAttribute(t,n)}function mt(e,t){var n=e.data.ref;if(n){var r=e.context,i=e.child||e.elm,a=r.$refs;t?Array.isArray(a[n])?o(a[n],i):a[n]===i&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(i)<0?a[n].push(i):a[n]=[i]:a[n]=i}}function yt(e){return null==e}function gt(e){return null!=e}function _t(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function bt(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,gt(i)&&(o[i]=r);return o}function wt(e){function t(e){return new _r(T.tagName(e).toLowerCase(),{},[],void 0,e)}function r(e,t){function n(){0===--n.listeners&&o(e)}return n.listeners=t,n}function o(e){var t=T.parentNode(e);t&&T.removeChild(t,e)}function a(e,t,n,r,i){if(e.isRootInsert=!i,!u(e,t,n,r)){var o=e.data,a=e.children,s=e.tag;gt(s)?(o&&o.pre&&E++,E||e.ns||On.ignoredElements&&On.ignoredElements.indexOf(s)>-1||!On.isUnknownElement(s)||Fn("Unknown custom element: <"+s+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?T.createElementNS(e.ns,s):T.createElement(s,e),h(e),d(e,a,t),gt(o)&&p(e,t),l(n,e.elm,r),o&&o.pre&&E--):e.isComment?(e.elm=T.createComment(e.text),l(n,e.elm,r)):(e.elm=T.createTextNode(e.text),l(n,e.elm,r))}}function u(e,t,n,r){var i=e.data;if(gt(i)){var o=gt(e.child)&&i.keepAlive;if(gt(i=i.hook)&&gt(i=i.init)&&i(e,!1,n,r),gt(e.child))return v(e,t),o&&c(e,t,n,r),!0}}function c(e,t,n,r){for(var i,o=e;o.child;)if(o=o.child._vnode,gt(i=o.data)&&gt(i=i.transition)){for(i=0;i<O.activate.length;++i)O.activate[i](qr,o);t.push(o);break}l(n,e.elm,r)}function l(e,t,n){e&&(n?T.insertBefore(e,t,n):T.appendChild(e,t))}function d(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)a(t[r],n,e.elm,null,!0);else s(e.text)&&T.appendChild(e.elm,T.createTextNode(e.text))}function f(e){for(;e.child;)e=e.child._vnode;return gt(e.tag)}function p(e,t){for(var n=0;n<O.create.length;++n)O.create[n](qr,e);$=e.data.hook,gt($)&&($.create&&$.create(qr,e),$.insert&&t.push(e))}function v(e,t){e.data.pendingInsert&&t.push.apply(t,e.data.pendingInsert),e.elm=e.child.$el,f(e)?(p(e,t),h(e)):(mt(e),t.push(e))}function h(e){var t;gt(t=e.context)&&gt(t=t.$options._scopeId)&&T.setAttribute(e.elm,t,""),gt(t=wr)&&t!==e.context&&gt(t=t.$options._scopeId)&&T.setAttribute(e.elm,t,"")}function m(e,t,n,r,i,o){for(;r<=i;++r)a(n[r],o,e,t)}function y(e){var t,n,r=e.data;if(gt(r))for(gt(t=r.hook)&&gt(t=t.destroy)&&t(e),t=0;t<O.destroy.length;++t)O.destroy[t](e);if(gt(t=e.children))for(n=0;n<e.children.length;++n)y(e.children[n])}function g(e,t,n,r){for(;n<=r;++n){var i=t[n];gt(i)&&(gt(i.tag)?(_(i),y(i)):T.removeChild(e,i.elm))}}function _(e,t){if(t||gt(e.data)){var n=O.remove.length+1;for(t?t.listeners+=n:t=r(e.elm,n),gt($=e.child)&&gt($=$._vnode)&&gt($.data)&&_($,t),$=0;$<O.remove.length;++$)O.remove[$](e,t);gt($=e.data.hook)&&gt($=$.remove)?$(e,t):t()}else o(e.elm)}function b(e,t,n,r,i){for(var o,s,u,c,l=0,d=0,f=t.length-1,p=t[0],v=t[f],h=n.length-1,y=n[0],_=n[h],b=!i;l<=f&&d<=h;)yt(p)?p=t[++l]:yt(v)?v=t[--f]:_t(p,y)?(w(p,y,r),p=t[++l],y=n[++d]):_t(v,_)?(w(v,_,r),v=t[--f],_=n[--h]):_t(p,_)?(w(p,_,r),b&&T.insertBefore(e,p.elm,T.nextSibling(v.elm)),p=t[++l],_=n[--h]):_t(v,y)?(w(v,y,r),b&&T.insertBefore(e,v.elm,p.elm),v=t[--f],y=n[++d]):(yt(o)&&(o=bt(t,l,f)),s=gt(y.key)?o[y.key]:null,yt(s)?(a(y,r,e,p.elm),y=n[++d]):(u=t[s],u||Fn("It seems there are duplicate keys that is causing an update error. Make sure each v-for item has a unique key."),_t(u,y)?(w(u,y,r),t[s]=void 0,b&&T.insertBefore(e,y.elm,p.elm),y=n[++d]):(a(y,r,e,p.elm),y=n[++d])));l>f?(c=yt(n[h+1])?null:n[h+1].elm,m(e,c,n,d,h,r)):d>h&&g(e,t,l,f)}function w(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.child=e.child);var i,o=t.data,a=gt(o);a&&gt(i=o.hook)&&gt(i=i.prepatch)&&i(e,t);var s=t.elm=e.elm,u=e.children,c=t.children;if(a&&f(t)){for(i=0;i<O.update.length;++i)O.update[i](e,t);gt(i=o.hook)&&gt(i=i.update)&&i(e,t)}yt(t.text)?gt(u)&&gt(c)?u!==c&&b(s,u,c,n,r):gt(c)?(gt(e.text)&&T.setTextContent(s,""),m(s,null,c,0,c.length-1,n)):gt(u)?g(s,u,0,u.length-1):gt(e.text)&&T.setTextContent(s,""):e.text!==t.text&&T.setTextContent(s,t.text),a&&gt(i=o.hook)&&gt(i=i.postpatch)&&i(e,t)}}function C(e,t,n){if(n&&e.parent)e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}function x(e,t,n){if(!A(e,t))return!1;t.elm=e;var r=t.tag,i=t.data,o=t.children;if(gt(i)&&(gt($=i.hook)&&gt($=$.init)&&$(t,!0),gt($=t.child)))return v(t,n),!0;if(gt(r)){if(gt(o))if(e.hasChildNodes()){for(var a=!0,s=e.firstChild,u=0;u<o.length;u++){if(!s||!x(s,o[u],n)){a=!1;break}s=s.nextSibling}if(!a||s)return"undefined"==typeof console||j||(j=!0,console.warn("Parent: ",e),console.warn("Mismatching childNodes vs. VNodes: ",e.childNodes,o)),!1}else d(t,o,n);if(gt(i))for(var c in i)if(!P(c)){p(t,n);break}}return!0}function A(e,t){return t.tag?0===t.tag.indexOf("vue-component")||t.tag.toLowerCase()===(e.tagName&&e.tagName.toLowerCase()):n(t.text)===e.data}var $,k,O={},S=e.modules,T=e.nodeOps;for($=0;$<Wr.length;++$)for(O[Wr[$]]=[],k=0;k<S.length;++k)void 0!==S[k][Wr[$]]&&O[Wr[$]].push(S[k][Wr[$]]);var E=0,j=!1,P=i("attrs,style,class,staticClass,staticStyle,key");return function(e,n,r,i,o,s){if(!n)return void(e&&y(e));var u,c,l=!1,d=[];if(e){var p=gt(e.nodeType);if(!p&&_t(e,n))w(e,n,d,i);else{if(p){if(1===e.nodeType&&e.hasAttribute("server-rendered")&&(e.removeAttribute("server-rendered"),r=!0),r){if(x(e,n,d))return C(n,d,!0),e;Fn("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}e=t(e)}if(u=e.elm,c=T.parentNode(u),a(n,d,c,T.nextSibling(u)),n.parent){for(var v=n.parent;v;)v.elm=n.elm,v=v.parent;if(f(n))for(var h=0;h<O.create.length;++h)O.create[h](qr,n.parent)}null!==c?g(c,[e],0,0):gt(e.tag)&&y(e)}}else l=!0,a(n,d,o,s);return C(n,d,l),n.elm}}function Ct(e,t){(e.data.directives||t.data.directives)&&xt(e,t)}function xt(e,t){var n,r,i,o=e===qr,a=At(e.data.directives,e.context),s=At(t.data.directives,t.context),u=[],c=[];for(n in s)r=a[n],i=s[n],r?(i.oldValue=r.value,kt(i,"update",t,e),i.def&&i.def.componentUpdated&&c.push(i)):(kt(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var l=function(){for(var n=0;n<u.length;n++)kt(u[n],"inserted",t,e)};o?$e(t.data.hook||(t.data.hook={}),"insert",l,"dir-insert"):l()}if(c.length&&$e(t.data.hook||(t.data.hook={}),"postpatch",function(){for(var n=0;n<c.length;n++)kt(c[n],"componentUpdated",t,e)},"dir-postpatch"),!o)for(n in a)s[n]||kt(a[n],"unbind",e)}function At(e,t){var n=Object.create(null);if(!e)return n;var r,i;for(r=0;r<e.length;r++)i=e[r], i.modifiers||(i.modifiers=Jr),n[$t(i)]=i,i.def=U(t.$options,"directives",i.name,!0);return n}function $t(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function kt(e,t,n,r){var i=e.def&&e.def[t];i&&i(n.elm,e,n,r)}function Ot(e,t){if(e.data.attrs||t.data.attrs){var n,r,i,o=t.elm,a=e.data.attrs||{},s=t.data.attrs||{};s.__ob__&&(s=t.data.attrs=d({},s));for(n in s)r=s[n],i=a[n],i!==r&&St(o,n,r);Mn&&s.value!==a.value&&St(o,"value",s.value);for(n in a)null==s[n]&&(Dr(n)?o.removeAttributeNS(Nr,Lr(n)):Pr(n)||o.removeAttribute(n))}}function St(e,t,n){Mr(t)?Ir(n)?e.removeAttribute(t):e.setAttribute(t,t):Pr(t)?e.setAttribute(t,Ir(n)||"false"===n?"false":"true"):Dr(t)?Ir(n)?e.removeAttributeNS(Nr,Lr(t)):e.setAttributeNS(Nr,t,n):Ir(n)?e.removeAttribute(t):e.setAttribute(t,n)}function Tt(e,t){var n=t.elm,r=t.data,i=e.data;if(r.staticClass||r.class||i&&(i.staticClass||i.class)){var o=Ze(t),a=n._transitionClasses;a&&(o=Xe(o,et(a))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}function Et(e,t,n,r){if(n){var i=t;t=function(n){jt(e,t,r),1===arguments.length?i(n):i.apply(null,arguments)}}Sr.addEventListener(e,t,r)}function jt(e,t,n){Sr.removeEventListener(e,t,n)}function Pt(e,t){if(e.data.on||t.data.on){var n=t.data.on||{},r=e.data.on||{};Sr=t.elm,ke(n,r,Et,jt,t.context)}}function Mt(e,t){if(e.data.domProps||t.data.domProps){var n,r,i=t.elm,o=e.data.domProps||{},a=t.data.domProps||{};a.__ob__&&(a=t.data.domProps=d({},a));for(n in o)null==a[n]&&(i[n]="");for(n in a)if(r=a[n],"textContent"!==n&&"innerHTML"!==n||(t.children&&(t.children.length=0),r!==o[n]))if("value"===n){i._value=r;var s=null==r?"":String(r);!i.composing&&(document.activeElement!==i&&i.value!==s||Nt(t,s))&&(i.value=s)}else i[n]=r}}function Nt(e,t){var n=e.elm.value,i=e.elm._vModifiers;return i&&i.number||"number"===e.elm.type?r(n)!==r(t):i&&i.trim?n.trim()!==t.trim():n!==t}function Dt(e){var t=Lt(e.style);return e.staticStyle?d(e.staticStyle,t):t}function Lt(e){return Array.isArray(e)?v(e):"string"==typeof e?ei(e):e}function It(e,t){var n,r={};if(t)for(var i=e;i.child;)i=i.child._vnode,i.data&&(n=Dt(i.data))&&d(r,n);(n=Dt(e.data))&&d(r,n);for(var o=e;o=o.parent;)o.data&&(n=Dt(o.data))&&d(r,n);return r}function Rt(e,t){var n=t.data,r=e.data;if(n.staticStyle||n.style||r.staticStyle||r.style){var i,o,a=t.elm,s=e.data.staticStyle,u=e.data.style||{},c=s||u,l=Lt(t.data.style)||{};t.data.style=l.__ob__?d({},l):l;var f=It(t,!0);for(o in c)null==f[o]&&ri(a,o,"");for(o in f)i=f[o],i!==c[o]&&ri(a,o,null==i?"":i)}}function Ut(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Vt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Ft(e){vi(function(){vi(e)})}function Bt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Ut(e,t)}function Ht(e,t){e._transitionClasses&&o(e._transitionClasses,t),Vt(e,t)}function zt(e,t,n){var r=qt(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ui?di:pi,u=0,c=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++u>=a&&c()};setTimeout(function(){u<a&&c()},o+1),e.addEventListener(s,l)}function qt(e,t){var n,r=window.getComputedStyle(e),i=r[li+"Delay"].split(", "),o=r[li+"Duration"].split(", "),a=Wt(i,o),s=r[fi+"Delay"].split(", "),u=r[fi+"Duration"].split(", "),c=Wt(s,u),l=0,d=0;t===ui?a>0&&(n=ui,l=a,d=o.length):t===ci?c>0&&(n=ci,l=c,d=u.length):(l=Math.max(a,c),n=l>0?a>c?ui:ci:null,d=n?n===ui?o.length:u.length:0);var f=n===ui&&hi.test(r[li+"Property"]);return{type:n,timeout:l,propCount:d,hasTransform:f}}function Wt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Kt(t)+Kt(e[n])}))}function Kt(e){return 1e3*Number(e.slice(0,-1))}function Jt(e,t){var n=e.elm;n._leaveCb&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Zt(e.data.transition);if(r&&!n._enterCb&&1===n.nodeType){for(var i=r.css,o=r.type,a=r.enterClass,s=r.enterActiveClass,u=r.appearClass,c=r.appearActiveClass,l=r.beforeEnter,d=r.enter,f=r.afterEnter,p=r.enterCancelled,v=r.beforeAppear,h=r.appear,m=r.afterAppear,y=r.appearCancelled,g=wr,_=wr.$vnode;_&&_.parent;)_=_.parent,g=_.context;var b=!g._isMounted||!e.isRootInsert;if(!b||h||""===h){var w=b?u:a,C=b?c:s,x=b?v||l:l,A=b&&"function"==typeof h?h:d,$=b?m||f:f,k=b?y||p:p,O=i!==!1&&!Mn,S=A&&(A._length||A.length)>1,T=n._enterCb=Gt(function(){O&&Ht(n,C),T.cancelled?(O&&Ht(n,w),k&&k(n)):$&&$(n),n._enterCb=null});e.data.show||$e(e.data.hook||(e.data.hook={}),"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.context===e.context&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),A&&A(n,T)},"transition-insert"),x&&x(n),O&&(Bt(n,w),Bt(n,C),Ft(function(){Ht(n,w),T.cancelled||S||zt(n,o,T)})),e.data.show&&(t&&t(),A&&A(n,T)),O||S||T()}}}function Yt(e,t){function n(){m.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),c&&c(r),v&&(Bt(r,s),Bt(r,u),Ft(function(){Ht(r,s),m.cancelled||h||zt(r,a,m)})),l&&l(r,m),v||h||m())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=Zt(e.data.transition);if(!i)return t();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,u=i.leaveActiveClass,c=i.beforeLeave,l=i.leave,d=i.afterLeave,f=i.leaveCancelled,p=i.delayLeave,v=o!==!1&&!Mn,h=l&&(l._length||l.length)>1,m=r._leaveCb=Gt(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),v&&Ht(r,u),m.cancelled?(v&&Ht(r,s),f&&f(r)):(t(),d&&d(r)),r._leaveCb=null});p?p(n):n()}}function Zt(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&d(t,mi(e.name||"v")),d(t,e),t}return"string"==typeof e?mi(e):void 0}}function Gt(e){var t=!1;return function(){t||(t=!0,e())}}function Qt(e,t){t.data.show||Jt(t)}function Xt(e,t,n){var r=t.value,i=e.multiple;if(i&&!Array.isArray(r))return void Fn('<select multiple v-model="'+t.expression+'"> expects an Array value for its binding, but got '+Object.prototype.toString.call(r).slice(8,-1),n);for(var o,a,s=0,u=e.options.length;s<u;s++)if(a=e.options[s],i)o=g(r,tn(a))>-1,a.selected!==o&&(a.selected=o);else if(y(tn(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}function en(e,t){for(var n=0,r=t.length;n<r;n++)if(y(tn(t[n]),e))return!1;return!0}function tn(e){return"_value"in e?e._value:e.value}function nn(e){e.target.composing=!0}function rn(e){e.target.composing=!1,on(e.target,"input")}function on(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function an(e){return!e.child||e.data&&e.data.transition?e:an(e.child._vnode)}function sn(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?sn(je(t.children)):e}function un(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_n(o)]=i[o].fn;return t}function cn(e,t){return/\d-keep-alive$/.test(t.tag)?e("keep-alive"):null}function ln(e){for(;e=e.parent;)if(e.data.transition)return!0}function dn(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function fn(e){e.data.newPos=e.elm.getBoundingClientRect()}function pn(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var vn,hn,mn=i("slot,component",!0),yn=Object.prototype.hasOwnProperty,gn=/-(\w)/g,_n=u(function(e){return e.replace(gn,function(e,t){return t?t.toUpperCase():""})}),bn=u(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),wn=/([^-])([A-Z])/g,Cn=u(function(e){return e.replace(wn,"$1-$2").replace(wn,"$1-$2").toLowerCase()}),xn=Object.prototype.toString,An="[object Object]",$n=function(){return!1},kn=function(e){return e},On={optionMergeStrategies:Object.create(null),silent:!1,devtools:!0,errorHandler:null,ignoredElements:null,keyCodes:Object.create(null),isReservedTag:$n,isUnknownElement:$n,getTagNamespace:h,parsePlatformTagName:kn,mustUseProp:$n,_assetTypes:["component","directive","filter"],_lifecycleHooks:["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated"],_maxUpdateCount:100},Sn=/[^\w.$]/,Tn="__proto__"in{},En="undefined"!=typeof window,jn=En&&window.navigator.userAgent.toLowerCase(),Pn=jn&&/msie|trident/.test(jn),Mn=jn&&jn.indexOf("msie 9.0")>0,Nn=jn&&jn.indexOf("edge/")>0,Dn=jn&&jn.indexOf("android")>0,Ln=jn&&/iphone|ipad|ipod|ios/.test(jn),In=function(){return void 0===vn&&(vn=!En&&"undefined"!=typeof t&&"server"===t.process.env.VUE_ENV),vn},Rn=En&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Un=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t<e.length;t++)e[t]()}var t,n=[],r=!1;if("undefined"!=typeof Promise&&C(Promise)){var i=Promise.resolve(),o=function(e){console.error(e)};t=function(){i.then(e).catch(o),Ln&&setTimeout(h)}}else if("undefined"==typeof MutationObserver||!C(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())t=function(){setTimeout(e,0)};else{var a=1,s=new MutationObserver(e),u=document.createTextNode(String(a));s.observe(u,{characterData:!0}),t=function(){a=(a+1)%2,u.data=String(a)}}return function(e,i){var o;if(n.push(function(){e&&e.call(i),o&&o(i)}),r||(r=!0,t()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){o=e})}}();hn="undefined"!=typeof Set&&C(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return this.set[e]===!0},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var Vn,Fn=h,Bn="undefined"!=typeof console;Fn=function(e,t){Bn&&!On.silent&&console.error("[Vue warn]: "+e+" "+(t?Hn(Vn(t)):""))},Vn=function(e){if(e.$root===e)return"root instance";var t=e._isVue?e.$options.name||e.$options._componentTag:e.name;return(t?"component <"+t+">":"anonymous component")+(e._isVue&&e.$options.__file?" at "+e.$options.__file:"")};var Hn=function(e){return"anonymous component"===e&&(e+=' - use the "name" option for better debugging messages.'),"\n(found in "+e+")"},zn=0,qn=function(){this.id=zn++,this.subs=[]};qn.prototype.addSub=function(e){this.subs.push(e)},qn.prototype.removeSub=function(e){o(this.subs,e)},qn.prototype.depend=function(){qn.target&&qn.target.addDep(this)},qn.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},qn.target=null;var Wn=[],Kn=Array.prototype,Jn=Object.create(Kn);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=Kn[e];b(Jn,e,function(){for(var n=arguments,r=arguments.length,i=new Array(r);r--;)i[r]=n[r];var o,a=t.apply(this,i),s=this.__ob__;switch(e){case"push":o=i;break;case"unshift":o=i;break;case"splice":o=i.slice(2)}return o&&s.observeArray(o),s.dep.notify(),a})});var Yn=Object.getOwnPropertyNames(Jn),Zn={shouldConvert:!0,isSettingProps:!1},Gn=function(e){if(this.value=e,this.dep=new qn,this.vmCount=0,b(e,"__ob__",this),Array.isArray(e)){var t=Tn?$:k;t(e,Jn,Yn),this.observeArray(e)}else this.walk(e)};Gn.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)S(e,t[n],e[t[n]])},Gn.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)O(e[t])};var Qn=On.optionMergeStrategies;Qn.el=Qn.propsData=function(e,t,n,r){return n||Fn('option "'+r+'" can only be used during instance creation with the `new` keyword.'),er(e,t)},Qn.data=function(e,t,n){return n?e||t?function(){var r="function"==typeof t?t.call(n):t,i="function"==typeof e?e.call(n):void 0;return r?P(r,i):i}:void 0:t?"function"!=typeof t?(Fn('The "data" option should be a function that returns a per-instance value in component definitions.',n),e):e?function(){return P(t.call(this),e.call(this))}:t:e},On._lifecycleHooks.forEach(function(e){Qn[e]=M}),On._assetTypes.forEach(function(e){Qn[e+"s"]=N}),Qn.watch=function(e,t){if(!t)return e;if(!e)return t;var n={};d(n,e);for(var r in t){var i=n[r],o=t[r];i&&!Array.isArray(i)&&(i=[i]),n[r]=i?i.concat(o):[o]}return n},Qn.props=Qn.methods=Qn.computed=function(e,t){if(!t)return e;if(!e)return t;var n=Object.create(null);return d(n,e),d(n,t),n};var Xn,er=function(e,t){return void 0===t?e:t},tr=Object.freeze({defineReactive:S,_toString:n,toNumber:r,makeMap:i,isBuiltInTag:mn,remove:o,hasOwn:a,isPrimitive:s,cached:u,camelize:_n,capitalize:bn,hyphenate:Cn,bind:c,toArray:l,extend:d,isObject:f,isPlainObject:p,toObject:v,noop:h,no:$n,identity:kn,genStaticKeys:m,looseEqual:y,looseIndexOf:g,isReserved:_,def:b,parsePath:w,hasProto:Tn,inBrowser:En,UA:jn,isIE:Pn,isIE9:Mn,isEdge:Nn,isAndroid:Dn,isIOS:Ln,isServerRendering:In,devtools:Rn,nextTick:Un,get _Set(){return hn},mergeOptions:R,resolveAsset:U,get warn(){return Fn},get formatComponentName(){return Vn},validateProp:V}),nr=i("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,require"),rr=function(e,t){Fn('Property or method "'+t+'" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.',e)},ir="undefined"!=typeof Proxy&&Proxy.toString().match(/native code/);if(ir){var or=i("stop,prevent,self,ctrl,shift,alt,meta");On.keyCodes=new Proxy(On.keyCodes,{set:function(e,t,n){return or(t)?(Fn("Avoid overwriting built-in modifier in config.keyCodes: ."+t),!1):(e[t]=n,!0)}})}var ar={has:function e(t,n){var e=n in t,r=nr(n)||"_"===n.charAt(0);return e||r||rr(t,n),e||!r}},sr={get:function(e,t){return"string"!=typeof t||t in e||rr(e,t),e[t]}};Xn=function(e){if(ir){var t=e.$options,n=t.render&&t.render._withStripped?sr:ar;e._renderProxy=new Proxy(e,n)}else e._renderProxy=e};var ur=[],cr={},lr={},dr=!1,fr=!1,pr=0,vr=0,hr=function(e,t,n,r){void 0===r&&(r={}),this.vm=e,e._watchers.push(this),this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.expression=t.toString(),this.cb=n,this.id=++vr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new hn,this.newDepIds=new hn,"function"==typeof t?this.getter=t:(this.getter=w(t),this.getter||(this.getter=function(){},Fn('Failed watching path: "'+t+'" Watcher only accepts simple dot-delimited paths. For full control, use a function instead.',e))),this.value=this.lazy?void 0:this.get()};hr.prototype.get=function(){x(this);var e=this.getter.call(this.vm,this.vm);return this.deep&&Y(e),A(),this.cleanupDeps(),e},hr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},hr.prototype.cleanupDeps=function(){for(var e=this,t=this.deps.length;t--;){var n=e.deps[t];e.newDepIds.has(n.id)||n.removeSub(e)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},hr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():J(this)},hr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||f(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){if(!On.errorHandler)throw Fn('Error in watcher "'+this.expression+'"',this.vm),e;On.errorHandler.call(null,e,this.vm)}else this.cb.call(this.vm,e,t)}}},hr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},hr.prototype.depend=function(){for(var e=this,t=this.deps.length;t--;)e.deps[t].depend()},hr.prototype.teardown=function(){var e=this;if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||o(this.vm._watchers,this);for(var t=this.deps.length;t--;)e.deps[t].removeSub(e);this.active=!1}};var mr=new hn,yr={key:1,ref:1,slot:1},gr={enumerable:!0,configurable:!0,get:h,set:h},_r=function(e,t,n,r,i,o,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.functionalContext=void 0,this.key=t&&t.key,this.componentOptions=a,this.child=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1},br=function(){var e=new _r;return e.text="",e.isComment=!0,e},wr=null,Cr={init:me,prepatch:ye,insert:ge,destroy:_e},xr=Object.keys(Cr),Ar=0;Ve(He),oe(He),Ue(He),de(He),Le(He);var $r=[String,RegExp],kr={name:"keep-alive",abstract:!0,props:{include:$r,exclude:$r},created:function(){this.cache=Object.create(null)},render:function(){var e=je(this.$slots.default);if(e&&e.componentOptions){var t=e.componentOptions,n=t.Ctor.options.name||t.tag;if(n&&(this.include&&!Je(this.include,n)||this.exclude&&Je(this.exclude,n)))return e;var r=null==e.key?t.Ctor.cid+(t.tag?"::"+t.tag:""):e.key;this.cache[r]?e.child=this.cache[r].child:this.cache[r]=e,e.data.keepAlive=!0}return e},destroyed:function(){var e=this;for(var t in this.cache){var n=e.cache[t];fe(n.child,"deactivated"),n.child.$destroy()}}},Or={KeepAlive:kr};Ye(He),Object.defineProperty(He.prototype,"$isServer",{get:In}),He.version="2.1.6";var Sr,Tr,Er=i("input,textarea,option,select"),jr=function(e,t){return"value"===t&&Er(e)||"selected"===t&&"option"===e||"checked"===t&&"input"===e||"muted"===t&&"video"===e},Pr=i("contenteditable,draggable,spellcheck"),Mr=i("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Nr="http://www.w3.org/1999/xlink",Dr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Lr=function(e){return Dr(e)?e.slice(6,e.length):""},Ir=function(e){return null==e||e===!1},Rr={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML",xhtml:"http://www.w3.org/1999/xhtml"},Ur=i("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template"),Vr=i("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Fr=function(e){return Ur(e)||Vr(e)},Br=Object.create(null),Hr=Object.freeze({createElement:it,createElementNS:ot,createTextNode:at,createComment:st,insertBefore:ut,removeChild:ct,appendChild:lt,parentNode:dt,nextSibling:ft,tagName:pt,setTextContent:vt,setAttribute:ht}),zr={create:function(e,t){mt(t)},update:function(e,t){e.data.ref!==t.data.ref&&(mt(e,!0),mt(t))},destroy:function(e){mt(e,!0)}},qr=new _r("",{},[]),Wr=["create","activate","update","remove","destroy"],Kr={create:Ct,update:Ct,destroy:function(e){Ct(e,qr)}},Jr=Object.create(null),Yr=[zr,Kr],Zr={create:Ot,update:Ot},Gr={create:Tt,update:Tt},Qr={create:Pt,update:Pt},Xr={create:Mt,update:Mt},ei=u(function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach(function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}),ti=/^--/,ni=/\s*!important$/,ri=function(e,t,n){ti.test(t)?e.style.setProperty(t,n):ni.test(n)?e.style.setProperty(t,n.replace(ni,""),"important"):e.style[oi(t)]=n},ii=["Webkit","Moz","ms"],oi=u(function(e){if(Tr=Tr||document.createElement("div"),e=_n(e),"filter"!==e&&e in Tr.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<ii.length;n++){var r=ii[n]+t;if(r in Tr.style)return r}}),ai={create:Rt,update:Rt},si=En&&!Mn,ui="transition",ci="animation",li="transition",di="transitionend",fi="animation",pi="animationend";si&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(li="WebkitTransition",di="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(fi="WebkitAnimation",pi="webkitAnimationEnd"));var vi=En&&window.requestAnimationFrame||setTimeout,hi=/\b(transform|all)(,|$)/,mi=u(function(e){return{enterClass:e+"-enter",leaveClass:e+"-leave",appearClass:e+"-enter",enterActiveClass:e+"-enter-active",leaveActiveClass:e+"-leave-active",appearActiveClass:e+"-enter-active"}}),yi=En?{create:Qt,activate:Qt,remove:function(e,t){e.data.show?t():Yt(e,t)}}:{},gi=[Zr,Gr,Qr,Xr,ai,yi],_i=gi.concat(Yr),bi=wt({nodeOps:Hr,modules:_i}),wi=/^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;Mn&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&on(e,"input")});var Ci={inserted:function(e,t,n){if(wi.test(n.tag)||Fn("v-model is not supported on element type: <"+n.tag+">. If you are working with contenteditable, it's recommended to wrap a library dedicated for that purpose inside a custom component.",n.context),"select"===n.tag){var r=function(){Xt(e,t,n.context)};r(),(Pn||Nn)&&setTimeout(r,0)}else"textarea"!==n.tag&&"text"!==e.type||(e._vModifiers=t.modifiers,t.modifiers.lazy||(Dn||(e.addEventListener("compositionstart",nn),e.addEventListener("compositionend",rn)),Mn&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Xt(e,t,n.context);var r=e.multiple?t.value.some(function(t){return en(t,e.options)}):t.value!==t.oldValue&&en(t.value,e.options);r&&on(e,"change")}}},xi={bind:function(e,t,n){var r=t.value;n=an(n);var i=n.data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i&&!Mn?(n.data.show=!0,Jt(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value,i=t.oldValue;if(r!==i){n=an(n);var o=n.data&&n.data.transition;o&&!Mn?(n.data.show=!0,r?Jt(n,function(){e.style.display=e.__vOriginalDisplay}):Yt(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none"}}},Ai={model:Ci,show:xi},$i={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String},ki={name:"transition",props:$i,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(function(e){return e.tag}),n.length)){n.length>1&&Fn("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;r&&"in-out"!==r&&"out-in"!==r&&Fn("invalid <transition> mode: "+r,this.$parent);var i=n[0];if(ln(this.$vnode))return i;var o=sn(i);if(!o)return i;if(this._leaving)return cn(e,i);var a=o.key=null==o.key||o.isStatic?"__v"+(o.tag+this._uid)+"__":o.key,s=(o.data||(o.data={})).transition=un(this),u=this._vnode,c=sn(u);if(o.data.directives&&o.data.directives.some(function(e){return"show"===e.name})&&(o.data.show=!0),c&&c.data&&c.key!==a){var l=c.data.transition=d({},s);if("out-in"===r)return this._leaving=!0,$e(l,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()},a),cn(e,i);if("in-out"===r){var f,p=function(){f()};$e(s,"afterEnter",p,a),$e(s,"enterCancelled",p,a),$e(l,"delayLeave",function(e){f=e},a)}}return i}}},Oi=d({tag:String,moveClass:String},$i);delete Oi.mode;var Si={props:Oi,render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=un(this),s=0;s<i.length;s++){var u=i[s];if(u.tag)if(null!=u.key&&0!==String(u.key).indexOf("__vlist"))o.push(u),n[u.key]=u,(u.data||(u.data={})).transition=a;else{var c=u.componentOptions,l=c?c.Ctor.options.name||c.tag:u.tag;Fn("<transition-group> children must be keyed: <"+l+">")}}if(r){for(var d=[],f=[],p=0;p<r.length;p++){var v=r[p];v.data.transition=a,v.data.pos=v.elm.getBoundingClientRect(),n[v.key]?d.push(v):f.push(v)}this.kept=e(t,null,d),this.removed=f}return e(t,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";if(e.length&&this.hasMove(e[0].elm,t)){e.forEach(dn),e.forEach(fn),e.forEach(pn);document.body.offsetHeight;e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Bt(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(di,n._moveCb=function e(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(di,e),n._moveCb=null,Ht(n,t))})}})}},methods:{hasMove:function(e,t){if(!si)return!1;if(null!=this._hasMove)return this._hasMove;Bt(e,t);var n=qt(e);return Ht(e,t),this._hasMove=n.hasTransform}}},Ti={Transition:ki,TransitionGroup:Si};He.config.isUnknownElement=nt,He.config.isReservedTag=Fr,He.config.getTagNamespace=tt,He.config.mustUseProp=jr,d(He.options.directives,Ai),d(He.options.components,Ti),He.prototype.__patch__=En?bi:h,He.prototype.$mount=function(e,t){return e=e&&En?rt(e):void 0,this._mount(e,t)},setTimeout(function(){On.devtools&&(Rn?Rn.emit("init",He):En&&!Nn&&/Chrome\/\d+/.test(window.navigator.userAgent)&&console.log("Download the Vue Devtools for a better development experience:\nhttps://github.com/vuejs/vue-devtools"))},0),e.exports=He}).call(t,function(){return this}())},25:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){e.component("md-spinner",e.extend(a.default)),e.material.styles.push(u.default)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(180),a=r(o),s=n(132),u=r(s);e.exports=t.default},72:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);t.default={props:{mdSize:{type:Number,default:50},mdStroke:{type:Number,default:3.5},mdIndeterminate:Boolean,mdProgress:{type:Number,default:0}},mixins:[o.default],computed:{classes:function(){return{"md-indeterminate":this.mdIndeterminate}},styles:function(){var e=this.mdSize+"px";return{width:e,height:e}},dashProgress:function(){var e=125*this.mdProgress/100;return!this.mdIndeterminate&&(e>=125&&(e=130),e+", 200")}},data:function(){return{}},methods:{}},e.exports=t.default},109:function(e,t){},132:function(e,t){e.exports=".THEME_NAME.md-spinner .md-spinner-path{stroke:PRIMARY-COLOR}.THEME_NAME.md-spinner.md-accent .md-spinner-path{stroke:ACCENT-COLOR}.THEME_NAME.md-spinner.md-warn .md-spinner-path{stroke:WARN-COLOR}\n"},180:function(e,t,n){var r,i;n(109),r=n(72);var o=n(233);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,e.exports=r},233:function(e,t){e.exports={render:function(){var e=this,t=(e.$createElement,e._c);return t("transition",{attrs:{name:"md-spinner",appear:""}},[t("div",{staticClass:"md-spinner",class:[e.themeClass,e.classes],style:e.styles},[t("svg",{staticClass:"md-spinner-draw",attrs:{viewBox:"25 25 50 50"}},[t("circle",{staticClass:"md-spinner-path",attrs:{cx:"50",cy:"50",r:"20","stroke-width":e.mdStroke,"stroke-dasharray":e.dashProgress}})])])])},staticRenderFns:[]}}})});
examples/huge-apps/routes/Course/routes/Assignments/components/Assignments.js
zenlambda/react-router
import React from 'react' class Assignments extends React.Component { render() { return ( <div> <h3>Assignments</h3> {this.props.children || <p>Choose an assignment from the sidebar.</p>} </div> ) } } module.exports = Assignments
node_modules/react-icons/fa/try.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const FaTry = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m32.7 18.6q0 4.2-2.1 7.8t-5.7 5.8-7.9 2.1h-3.6q-0.3 0-0.5-0.2t-0.2-0.5v-13.7l-4.8 1.5q0 0-0.2 0-0.2 0-0.4-0.1-0.3-0.2-0.3-0.6v-2.8q0-0.6 0.5-0.7l5.2-1.6v-2.1l-4.8 1.5q0 0-0.2 0-0.2 0-0.4-0.1-0.3-0.3-0.3-0.6v-2.9q0-0.5 0.5-0.7l5.2-1.6v-5.5q0-0.3 0.2-0.5t0.5-0.2h3.6q0.3 0 0.5 0.2t0.2 0.5v4l8.4-2.6q0.3-0.1 0.6 0.1t0.3 0.6v2.9q0 0.5-0.5 0.7l-8.8 2.7v2l8.4-2.6q0.3-0.1 0.6 0.2t0.3 0.5v2.9q0 0.5-0.5 0.7l-8.8 2.7v10.9q4.2-0.3 7.1-3.4t2.9-7.3q0-0.3 0.2-0.5t0.5-0.2h3.6q0.3 0 0.5 0.2t0.2 0.5z"/></g> </Icon> ) export default FaTry
assets/search-view/profile-view/components/ProfileAbout.js
janta-devs/nyumbani
import React, { Component } from 'react'; class ProfileAbout extends Component{ render() { return ( <div /> ); } }; export default ProfileAbout;
ajax/libs/reactive-coffee/1.0.0/reactive-coffee.js
adelevie/cdnjs
(function() { var DepArray, DepCell, DepMap, DepMgr, Ev, FakeObsCell, FakeSrcCell, IndexedArray, IndexedDepArray, IndexedMappedDepArray, MappedDepArray, ObsArray, ObsCell, ObsMap, ObsMapEntryCell, RawHtml, Recorder, SrcArray, SrcCell, SrcMap, SrcMapEntryCell, asyncBind, bind, depMgr, ev, events, firstWhere, flatten, lagBind, mkMap, mktag, mkuid, nextUid, nthWhere, permToSplices, popKey, postLagBind, prop, propSet, props, recorder, rx, rxt, setDynProp, setProp, specialAttrs, sum, tag, tags, _fn, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, _this = this; if (typeof exports === 'undefined') { this.rx = rx = {}; } else { rx = exports; } nextUid = 0; mkuid = function() { return nextUid += 1; }; popKey = function(x, k) { var v; if (!(k in x)) { throw new Error('object has no key ' + k); } v = x[k]; delete x[k]; return v; }; nthWhere = function(xs, n, f) { var i, x, _i, _len; for (i = _i = 0, _len = xs.length; _i < _len; i = ++_i) { x = xs[i]; if (f(x) && (n -= 1) < 0) { return [x, i]; } } return [null, -1]; }; firstWhere = function(xs, f) { return nthWhere(xs, 0, f); }; mkMap = function(xs) { var k, map, v, _i, _len, _ref; if (xs == null) { xs = []; } map = Object.create != null ? Object.create(null) : {}; if (_.isArray(xs)) { for (_i = 0, _len = xs.length; _i < _len; _i++) { _ref = xs[_i], k = _ref[0], v = _ref[1]; map[k] = v; } } else { for (k in xs) { v = xs[k]; map[k] = v; } } return map; }; sum = function(xs) { var n, x, _i, _len; n = 0; for (_i = 0, _len = xs.length; _i < _len; _i++) { x = xs[_i]; n += x; } return n; }; DepMgr = rx.DepMgr = (function() { function DepMgr() { this.uid2src = {}; this.buffering = false; this.buffer = []; } DepMgr.prototype.sub = function(uid, src) { return this.uid2src[uid] = src; }; DepMgr.prototype.unsub = function(uid) { return popKey(this.uid2src, uid); }; DepMgr.prototype.transaction = function(f) { var b, res, _i, _len, _ref; this.buffering = true; try { res = f(); } finally { _ref = this.buffer; for (_i = 0, _len = _ref.length; _i < _len; _i++) { b = _ref[_i]; b(); } this.buffer = []; this.buffering = false; } return res; }; return DepMgr; })(); rx._depMgr = depMgr = new DepMgr(); Ev = rx.Ev = (function() { function Ev(inits) { this.inits = inits; this.subs = mkMap(); } Ev.prototype.sub = function(listener) { var init, uid, _i, _len, _ref; uid = mkuid(); if (this.inits != null) { _ref = this.inits(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { init = _ref[_i]; listener(init); } } this.subs[uid] = listener; depMgr.sub(uid, this); return uid; }; Ev.prototype.pub = function(data) { var listener, uid, _ref, _results, _this = this; if (depMgr.buffering) { return depMgr.buffer.push(function() { return _this.pub(data); }); } else { _ref = this.subs; _results = []; for (uid in _ref) { listener = _ref[uid]; _results.push(listener(data)); } return _results; } }; Ev.prototype.unsub = function(uid) { popKey(this.subs, uid); return depMgr.unsub(uid, this); }; Ev.prototype.scoped = function(listener, context) { var uid; uid = this.sub(listener); try { return context(); } finally { this.unsub(uid); } }; return Ev; })(); rx.skipFirst = function(f) { var first; first = true; return function() { var args; args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; if (first) { return first = false; } else { return f.apply(null, args); } }; }; Recorder = rx.Recorder = (function() { function Recorder() { this.stack = []; this.isMutating = false; this.isIgnoring = false; this.onMutationWarning = new Ev(); } Recorder.prototype.record = function(dep, f) { var wasIgnoring, wasMutating; if (this.stack.length > 0 && !this.isMutating) { _(this.stack).last().addNestedBind(dep); } this.stack.push(dep); wasMutating = this.isMutating; this.isMutating = false; wasIgnoring = this.isIgnoring; this.isIgnoring = false; try { return f(); } finally { this.isIgnoring = wasIgnoring; this.isMutating = wasMutating; this.stack.pop(); } }; Recorder.prototype.sub = function(sub) { var handle, topCell; if (this.stack.length > 0 && !this.isIgnoring) { topCell = _(this.stack).last(); return handle = sub(topCell); } }; Recorder.prototype.addCleanup = function(cleanup) { if (this.stack.length > 0) { return _(this.stack).last().addCleanup(cleanup); } }; Recorder.prototype.mutating = function(f) { var wasMutating; if (this.stack.length > 0) { console.warn('Mutation to observable detected during a bind context'); this.onMutationWarning.pub(null); } wasMutating = this.isMutating; this.isMutating = true; try { return f(); } finally { this.isMutating = wasMutating; } }; Recorder.prototype.ignoring = function(f) { var wasIgnoring; wasIgnoring = this.isIgnoring; this.isIgnoring = true; try { return f(); } finally { this.isIgnoring = wasIgnoring; } }; return Recorder; })(); rx._recorder = recorder = new Recorder(); rx.asyncBind = asyncBind = function(init, f) { var dep; dep = new DepCell(f, init); dep.refresh(); return dep; }; rx.bind = bind = function(f) { return asyncBind(null, function() { return this.done(this.record(f)); }); }; rx.lagBind = lagBind = function(lag, init, f) { var timeout; timeout = null; return asyncBind(init, function() { var _this = this; if (timeout != null) { clearTimeout(timeout); } return timeout = setTimeout(function() { return _this.done(_this.record(f)); }, lag); }); }; rx.postLagBind = postLagBind = function(init, f) { var timeout; timeout = null; return asyncBind(init, function() { var ms, val, _ref, _this = this; _ref = this.record(f), val = _ref.val, ms = _ref.ms; if (timeout != null) { clearTimeout(timeout); } return timeout = setTimeout((function() { return _this.done(val); }), ms); }); }; rx.snap = function(f) { return recorder.ignoring(f); }; rx.onDispose = function(cleanup) { return recorder.addCleanup(cleanup); }; rx.autoSub = function(ev, listener) { var subid; subid = ev.sub(listener); rx.onDispose(function() { return ev.unsub(subid); }); return subid; }; ObsCell = rx.ObsCell = (function() { function ObsCell(x) { var _ref, _this = this; this.x = x; this.x = (_ref = this.x) != null ? _ref : null; this.onSet = new Ev(function() { return [[null, _this.x]]; }); } ObsCell.prototype.get = function() { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onSet, function() { return target.refresh(); }); }); return this.x; }; return ObsCell; })(); SrcCell = rx.SrcCell = (function(_super) { __extends(SrcCell, _super); function SrcCell() { _ref = SrcCell.__super__.constructor.apply(this, arguments); return _ref; } SrcCell.prototype.set = function(x) { var _this = this; return recorder.mutating(function() { var old; if (_this.x !== x) { old = _this.x; _this.x = x; _this.onSet.pub([old, x]); return old; } }); }; return SrcCell; })(ObsCell); DepCell = rx.DepCell = (function(_super) { __extends(DepCell, _super); function DepCell(body, init) { this.body = body; DepCell.__super__.constructor.call(this, init != null ? init : null); this.refreshing = false; this.nestedBinds = []; this.cleanups = []; } DepCell.prototype.refresh = function() { var env, isSynchronous, old, realDone, syncResult, _this = this; if (!this.refreshing) { old = this.x; realDone = function(x) { _this.x = x; return _this.onSet.pub([old, _this.x]); }; ({ recorded: false }); syncResult = null; isSynchronous = false; env = { record: function(f) { var recorded, res; if (!_this.refreshing) { _this.disconnect(); if (recorded) { throw new Error('this refresh has already recorded its dependencies'); } _this.refreshing = true; recorded = true; try { res = recorder.record(_this, function() { return f.call(env); }); } finally { _this.refreshing = false; } if (isSynchronous) { realDone(syncResult); } return res; } }, done: function(x) { if (old !== x) { if (_this.refreshing) { isSynchronous = true; return syncResult = x; } else { return realDone(x); } } } }; return this.body.call(env); } }; DepCell.prototype.disconnect = function() { var cleanup, nestedBind, _i, _j, _len, _len1, _ref1, _ref2; _ref1 = this.cleanups; for (_i = 0, _len = _ref1.length; _i < _len; _i++) { cleanup = _ref1[_i]; cleanup(); } _ref2 = this.nestedBinds; for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { nestedBind = _ref2[_j]; nestedBind.disconnect(); } this.nestedBinds = []; return this.cleanups = []; }; DepCell.prototype.addNestedBind = function(nestedBind) { return this.nestedBinds.push(nestedBind); }; DepCell.prototype.addCleanup = function(cleanup) { return this.cleanups.push(cleanup); }; return DepCell; })(ObsCell); ObsArray = rx.ObsArray = (function() { function ObsArray(xs, diff) { var _this = this; this.xs = xs != null ? xs : []; this.diff = diff != null ? diff : rx.basicDiff(); this.onChange = new Ev(function() { return [[0, [], _this.xs]]; }); this.indexed_ = null; } ObsArray.prototype.all = function() { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onChange, function() { return target.refresh(); }); }); return _.clone(this.xs); }; ObsArray.prototype.raw = function() { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onChange, function() { return target.refresh(); }); }); return this.xs; }; ObsArray.prototype.at = function(i) { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onChange, function(_arg) { var added, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; if (index === i) { return target.refresh(); } }); }); return this.xs[i]; }; ObsArray.prototype.length = function() { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onChange, function(_arg) { var added, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; if (removed.length !== added.length) { return target.refresh(); } }); }); return this.xs.length; }; ObsArray.prototype.map = function(f) { var ys; ys = new MappedDepArray(); rx.autoSub(this.onChange, function(_arg) { var added, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; return ys.realSplice(index, removed.length, added.map(f)); }); return ys; }; ObsArray.prototype.indexed = function() { var _this = this; if (this.indexed_ == null) { this.indexed_ = new IndexedDepArray(); rx.autoSub(this.onChange, function(_arg) { var added, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; return _this.indexed_.realSplice(index, removed.length, added); }); } return this.indexed_; }; ObsArray.prototype.concat = function(that) { return rx.concat(this, that); }; ObsArray.prototype.realSplice = function(index, count, additions) { var removed; removed = this.xs.splice.apply(this.xs, [index, count].concat(additions)); return this.onChange.pub([index, removed, additions]); }; ObsArray.prototype._update = function(val, diff) { var additions, count, fullSplice, index, old, splice, splices, x, _i, _len, _ref1, _results; if (diff == null) { diff = this.diff; } old = this.xs; fullSplice = [0, old.length, val]; x = null; splices = diff != null ? (_ref1 = permToSplices(old.length, val, diff(old, val))) != null ? _ref1 : [fullSplice] : [fullSplice]; _results = []; for (_i = 0, _len = splices.length; _i < _len; _i++) { splice = splices[_i]; index = splice[0], count = splice[1], additions = splice[2]; _results.push(this.realSplice(index, count, additions)); } return _results; }; return ObsArray; })(); SrcArray = rx.SrcArray = (function(_super) { __extends(SrcArray, _super); function SrcArray() { _ref1 = SrcArray.__super__.constructor.apply(this, arguments); return _ref1; } SrcArray.prototype.spliceArray = function(index, count, additions) { var _this = this; return recorder.mutating(function() { return _this.realSplice(index, count, additions); }); }; SrcArray.prototype.splice = function() { var additions, count, index; index = arguments[0], count = arguments[1], additions = 3 <= arguments.length ? __slice.call(arguments, 2) : []; return this.spliceArray(index, count, additions); }; SrcArray.prototype.insert = function(x, index) { return this.splice(index, 0, x); }; SrcArray.prototype.remove = function(x) { var i; i = _(this.raw()).indexOf(x); if (i >= 0) { return this.removeAt(i); } }; SrcArray.prototype.removeAt = function(index) { return this.splice(index, 1); }; SrcArray.prototype.push = function(x) { return this.splice(this.length(), 0, x); }; SrcArray.prototype.put = function(i, x) { return this.splice(i, 1, x); }; SrcArray.prototype.replace = function(xs) { return this.spliceArray(0, this.length(), xs); }; SrcArray.prototype.update = function(xs) { var _this = this; return recorder.mutating(function() { return _this._update(xs); }); }; return SrcArray; })(ObsArray); MappedDepArray = rx.MappedDepArray = (function(_super) { __extends(MappedDepArray, _super); function MappedDepArray() { _ref2 = MappedDepArray.__super__.constructor.apply(this, arguments); return _ref2; } return MappedDepArray; })(ObsArray); IndexedDepArray = rx.IndexedDepArray = (function(_super) { __extends(IndexedDepArray, _super); function IndexedDepArray(xs, diff) { var i, x, _this = this; if (xs == null) { xs = []; } IndexedDepArray.__super__.constructor.call(this, xs, diff); this.is = (function() { var _i, _len, _ref3, _results; _ref3 = this.xs; _results = []; for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { x = _ref3[i]; _results.push(rx.cell(i)); } return _results; }).call(this); this.onChange = new Ev(function() { return [[0, [], _.zip(_this.xs, _this.is)]]; }); } IndexedDepArray.prototype.map = function(f) { var ys; ys = new IndexedMappedDepArray(); rx.autoSub(this.onChange, function(_arg) { var a, added, i, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; return ys.realSplice(index, removed.length, (function() { var _i, _len, _ref3, _results; _results = []; for (_i = 0, _len = added.length; _i < _len; _i++) { _ref3 = added[_i], a = _ref3[0], i = _ref3[1]; _results.push(f(a, i)); } return _results; })()); }); return ys; }; IndexedDepArray.prototype.realSplice = function(index, count, additions) { var i, newIs, offset, removed, _i, _len, _ref3, _ref4, _ref5; removed = (_ref3 = this.xs).splice.apply(_ref3, [index, count].concat(__slice.call(additions))); _ref4 = this.is.slice(index + count); for (offset = _i = 0, _len = _ref4.length; _i < _len; offset = ++_i) { i = _ref4[offset]; i.set(index + additions.length + offset); } newIs = (function() { var _j, _ref5, _results; _results = []; for (i = _j = 0, _ref5 = additions.length; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; i = 0 <= _ref5 ? ++_j : --_j) { _results.push(rx.cell(index + i)); } return _results; })(); (_ref5 = this.is).splice.apply(_ref5, [index, count].concat(__slice.call(newIs))); return this.onChange.pub([index, removed, _.zip(additions, newIs)]); }; return IndexedDepArray; })(ObsArray); IndexedMappedDepArray = rx.IndexedMappedDepArray = (function(_super) { __extends(IndexedMappedDepArray, _super); function IndexedMappedDepArray() { _ref3 = IndexedMappedDepArray.__super__.constructor.apply(this, arguments); return _ref3; } return IndexedMappedDepArray; })(IndexedDepArray); DepArray = rx.DepArray = (function(_super) { __extends(DepArray, _super); function DepArray(f, diff) { var _this = this; this.f = f; DepArray.__super__.constructor.call(this, [], diff); rx.autoSub((bind(function() { return _this.f(); })).onSet, function(_arg) { var old, val; old = _arg[0], val = _arg[1]; return _this._update(val); }); } return DepArray; })(ObsArray); IndexedArray = rx.IndexedArray = (function(_super) { __extends(IndexedArray, _super); function IndexedArray(xs) { this.xs = xs; } IndexedArray.prototype.map = function(f) { var ys; ys = new MappedDepArray(); rx.autoSub(this.xs.onChange, function(_arg) { var added, index, removed; index = _arg[0], removed = _arg[1], added = _arg[2]; return ys.realSplice(index, removed.length, added.map(f)); }); return ys; }; return IndexedArray; })(DepArray); rx.concat = function() { var repLens, xs, xss, ys; xss = 1 <= arguments.length ? __slice.call(arguments, 0) : []; ys = new MappedDepArray(); repLens = (function() { var _i, _len, _results; _results = []; for (_i = 0, _len = xss.length; _i < _len; _i++) { xs = xss[_i]; _results.push(0); } return _results; })(); xss.map(function(xs, i) { return rx.autoSub(xs.onChange, function(_arg) { var added, index, removed, xsOffset; index = _arg[0], removed = _arg[1], added = _arg[2]; xsOffset = sum(repLens.slice(0, i)); repLens[i] += added.length - removed.length; return ys.realSplice(xsOffset + index, removed.length, added); }); }); return ys; }; FakeSrcCell = rx.FakeSrcCell = (function(_super) { __extends(FakeSrcCell, _super); function FakeSrcCell(_getter, _setter) { this._getter = _getter; this._setter = _setter; } FakeSrcCell.prototype.get = function() { return this._getter(); }; FakeSrcCell.prototype.set = function(x) { return this._setter(x); }; return FakeSrcCell; })(SrcCell); FakeObsCell = rx.FakeObsCell = (function(_super) { __extends(FakeObsCell, _super); function FakeObsCell(_getter) { this._getter = _getter; } FakeObsCell.prototype.get = function() { return this._getter(); }; return FakeObsCell; })(ObsCell); SrcMapEntryCell = rx.MapEntryCell = (function(_super) { __extends(MapEntryCell, _super); function MapEntryCell(_map, _key) { this._map = _map; this._key = _key; } MapEntryCell.prototype.get = function() { return this._map.get(this._key); }; MapEntryCell.prototype.set = function(x) { return this._map.put(this._key, x); }; return MapEntryCell; })(FakeSrcCell); ObsMapEntryCell = rx.ObsMapEntryCell = (function(_super) { __extends(ObsMapEntryCell, _super); function ObsMapEntryCell(_map, _key) { this._map = _map; this._key = _key; } ObsMapEntryCell.prototype.get = function() { return this._map.get(this._key); }; return ObsMapEntryCell; })(FakeObsCell); ObsMap = rx.ObsMap = (function() { function ObsMap(x) { var _this = this; this.x = x != null ? x : {}; this.onAdd = new Ev(function() { var k, v, _results; _results = []; for (k in x) { v = x[k]; _results.push([k, v]); } return _results; }); this.onRemove = new Ev(); this.onChange = new Ev(); } ObsMap.prototype.get = function(key) { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onAdd, function(_arg) { var subkey, val; subkey = _arg[0], val = _arg[1]; if (key === subkey) { return target.refresh(); } }); }); recorder.sub(function(target) { return rx.autoSub(_this.onChange, function(_arg) { var old, subkey, val; subkey = _arg[0], old = _arg[1], val = _arg[2]; if (key === subkey) { return target.refresh(); } }); }); recorder.sub(function(target) { return rx.autoSub(_this.onRemove, function(_arg) { var old, subkey; subkey = _arg[0], old = _arg[1]; if (key === subkey) { return target.refresh(); } }); }); return this.x[key]; }; ObsMap.prototype.all = function() { var _this = this; recorder.sub(function(target) { return rx.autoSub(_this.onAdd, function() { return target.refresh(); }); }); recorder.sub(function(target) { return rx.autoSub(_this.onChange, function() { return target.refresh(); }); }); recorder.sub(function(target) { return rx.autoSub(_this.onRemove, function() { return target.refresh(); }); }); return _.clone(this.x); }; ObsMap.prototype.realPut = function(key, val) { var old; if (key in this.x) { old = this.x[key]; this.x[key] = val; this.onChange.pub([key, old, val]); return old; } else { this.x[key] = val; this.onAdd.pub([key, val]); return void 0; } }; ObsMap.prototype.realRemove = function(key) { var val; val = popKey(this.x, key); this.onRemove.pub([key, val]); return val; }; ObsMap.prototype.cell = function(key) { return new ObsMapEntryCell(this, key); }; return ObsMap; })(); SrcMap = rx.SrcMap = (function(_super) { __extends(SrcMap, _super); function SrcMap() { _ref4 = SrcMap.__super__.constructor.apply(this, arguments); return _ref4; } SrcMap.prototype.put = function(key, val) { var _this = this; return recorder.mutating(function() { return _this.realPut(key, val); }); }; SrcMap.prototype.remove = function(key) { var _this = this; return recorder.mutating(function() { return _this.realRemove(key); }); }; SrcMap.prototype.cell = function(key) { return new SrcMapEntryCell(this, key); }; return SrcMap; })(ObsMap); DepMap = rx.DepMap = (function(_super) { __extends(DepMap, _super); function DepMap(f) { this.f = f; DepMap.__super__.constructor.call(this); rx.autoSub(new DepCell(this.f).onSet, function(_arg) { var k, old, v, val, _results; old = _arg[0], val = _arg[1]; for (k in old) { v = old[k]; if (!(k in val)) { this.realRemove(k); } } _results = []; for (k in val) { v = val[k]; if (this.x[k] !== v) { _results.push(this.realPut(k, v)); } else { _results.push(void 0); } } return _results; }); } return DepMap; })(ObsMap); rx.liftSpec = function(obj) { var name, type, val; return _.object((function() { var _i, _len, _ref5, _results; _ref5 = Object.getOwnPropertyNames(obj); _results = []; for (_i = 0, _len = _ref5.length; _i < _len; _i++) { name = _ref5[_i]; val = obj[name]; if ((val != null) && (val instanceof rx.ObsMap || val instanceof rx.ObsCell || val instanceof rx.ObsArray)) { continue; } type = _.isFunction(val) ? null : _.isArray(val) ? 'array' : 'cell'; _results.push([ name, { type: type, val: val } ]); } return _results; })()); }; rx.lift = function(x, fieldspec) { var name, spec; if (fieldspec == null) { fieldspec = rx.liftSpec(x); } for (name in fieldspec) { spec = fieldspec[name]; x[name] = (function() { switch (spec.type) { case 'cell': return rx.cell(x[name]); case 'array': return rx.array(x[name]); case 'map': return rx.map(x[name]); default: return x[name]; } })(); } return x; }; rx.unlift = function(x) { var k, v; return _.object((function() { var _results; _results = []; for (k in x) { v = x[k]; _results.push([k, v instanceof rx.ObsCell ? v.get() : v instanceof rx.ObsArray ? v.all() : v]); } return _results; })()); }; rx.reactify = function(obj, fieldspec) { var arr, methName, name, spec; if (_.isArray(obj)) { arr = rx.array(_.clone(obj)); Object.defineProperties(obj, _.object((function() { var _i, _len, _ref5, _results; _ref5 = _.functions(arr); _results = []; for (_i = 0, _len = _ref5.length; _i < _len; _i++) { methName = _ref5[_i]; if (methName !== 'length') { _results.push((function(methName) { var meth, newMeth, spec; meth = obj[methName]; newMeth = function() { var args, res, _ref6; args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; if (meth != null) { res = meth.call.apply(meth, [obj].concat(__slice.call(args))); } (_ref6 = arr[methName]).call.apply(_ref6, [arr].concat(__slice.call(args))); return res; }; spec = { configurable: true, enumerable: false, value: newMeth, writable: true }; return [methName, spec]; })(methName)); } } return _results; })())); return obj; } else { return Object.defineProperties(obj, _.object((function() { var _results; _results = []; for (name in fieldspec) { spec = fieldspec[name]; _results.push((function(name, spec) { var desc, obs, view, _ref5, _ref6; desc = null; switch (spec.type) { case 'cell': obs = rx.cell((_ref5 = spec.val) != null ? _ref5 : null); desc = { configurable: true, enumerable: true, get: function() { return obs.get(); }, set: function(x) { return obs.set(x); } }; break; case 'array': view = rx.reactify((_ref6 = spec.val) != null ? _ref6 : []); desc = { configurable: true, enumerable: true, get: function() { view.raw(); return view; }, set: function(x) { view.splice.apply(view, [0, view.length].concat(__slice.call(x))); return view; } }; break; default: throw new Error("Unknown observable type: " + type); } return [name, desc]; })(name, spec)); } return _results; })())); } }; rx.autoReactify = function(obj) { var name, type, val; return rx.reactify(obj, _.object((function() { var _i, _len, _ref5, _results; _ref5 = Object.getOwnPropertyNames(obj); _results = []; for (_i = 0, _len = _ref5.length; _i < _len; _i++) { name = _ref5[_i]; val = obj[name]; if (val instanceof ObsMap || val instanceof ObsCell || val instanceof ObsArray) { continue; } type = _.isFunction(val) ? null : _.isArray(val) ? 'array' : 'cell'; _results.push([ name, { type: type, val: val } ]); } return _results; })())); }; _.extend(rx, { cell: function(x) { return new SrcCell(x); }, array: function(xs, diff) { return new SrcArray(xs, diff); }, map: function(x) { return new SrcMap(x); } }); rx.flatten = function(xs) { return new DepArray(function() { var x; return _((function() { var _i, _len, _results; _results = []; for (_i = 0, _len = xs.length; _i < _len; _i++) { x = xs[_i]; if (x instanceof ObsArray) { _results.push(x.raw()); } else if (x instanceof ObsCell) { _results.push(x.get()); } else { _results.push(x); } } return _results; })()).chain().flatten(true).filter(function(x) { return x != null; }).value(); }); }; flatten = function(xss) { var xs; xs = _.flatten(xss); return rx.cellToArray(bind(function() { return _.flatten(xss); })); }; rx.cellToArray = function(cell, diff) { return new DepArray((function() { return cell.get(); }), diff); }; rx.basicDiff = function(key) { if (key == null) { key = rx.smartUidify; } return function(oldXs, newXs) { var i, oldKeys, x, _i, _len, _ref5, _results; oldKeys = mkMap((function() { var _i, _len, _results; _results = []; for (i = _i = 0, _len = oldXs.length; _i < _len; i = ++_i) { x = oldXs[i]; _results.push([key(x), i]); } return _results; })()); _results = []; for (_i = 0, _len = newXs.length; _i < _len; _i++) { x = newXs[_i]; _results.push((_ref5 = oldKeys[key(x)]) != null ? _ref5 : -1); } return _results; }; }; rx.uidify = function(x) { var _ref5; return (_ref5 = x.__rxUid) != null ? _ref5 : (Object.defineProperty(x, '__rxUid', { enumerable: false, value: mkuid() })).__rxUid; }; rx.smartUidify = function(x) { if (_.isObject(x)) { return rx.uidify(x); } else { return JSON.stringify(x); } }; permToSplices = function(oldLength, newXs, perm) { var cur, i, last, refs, splice, splices; refs = (function() { var _i, _len, _results; _results = []; for (_i = 0, _len = perm.length; _i < _len; _i++) { i = perm[_i]; if (i >= 0) { _results.push(i); } } return _results; })(); if (_.some((function() { var _i, _ref5, _results; _results = []; for (i = _i = 0, _ref5 = refs.length - 1; 0 <= _ref5 ? _i < _ref5 : _i > _ref5; i = 0 <= _ref5 ? ++_i : --_i) { _results.push(refs[i + 1] - refs[i] <= 0); } return _results; })())) { return null; } splices = []; last = -1; i = 0; while (i < perm.length) { while (i < perm.length && perm[i] === last + 1) { last += 1; i += 1; } splice = { index: i, count: 0, additions: [] }; while (i < perm.length && perm[i] === -1) { splice.additions.push(newXs[i]); i += 1; } cur = i === perm.length ? oldLength : perm[i]; splice.count = cur - (last + 1); if (splice.count > 0 || splice.additions.length > 0) { splices.push([splice.index, splice.count, splice.additions]); } last = cur; i += 1; } return splices; }; rx.transaction = function(f) { return depMgr.transaction(f); }; $.fn.rx = function(prop) { var checked, focused, map, val; map = this.data('rx-map'); if (map == null) { this.data('rx-map', map = mkMap()); } if (prop in map) { return map[prop]; } return map[prop] = (function() { var _this = this; switch (prop) { case 'focused': focused = rx.cell(this.is(':focus')); this.focus(function() { return focused.set(true); }); this.blur(function() { return focused.set(false); }); return focused; case 'val': val = rx.cell(this.val()); this.change(function() { return val.set(_this.val()); }); this.on('input', function() { return val.set(_this.val()); }); return val; case 'checked': checked = rx.cell(this.is(':checked')); this.change(function() { return checked.set(_this.is(':checked')); }); return checked; default: throw new Error('Unknown reactive property type'); } }).call(this); }; if (typeof exports === 'undefined') { this.rxt = rxt = {}; } else { rxt = exports; } RawHtml = rxt.RawHtml = (function() { function RawHtml(html) { this.html = html; } return RawHtml; })(); events = ["blur", "change", "click", "dblclick", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "load", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "ready", "resize", "scroll", "select", "submit", "toggle", "unload"]; specialAttrs = rxt.specialAttrs = { init: function(elt, fn) { return fn.call(elt); } }; _fn = function(ev) { return specialAttrs[ev] = function(elt, fn) { return elt[ev](function(e) { return fn.call(elt, e); }); }; }; for (_i = 0, _len = events.length; _i < _len; _i++) { ev = events[_i]; _fn(ev); } props = ['async', 'autofocus', 'checked', 'location', 'multiple', 'readOnly', 'selected', 'selectedIndex', 'tagName', 'nodeName', 'nodeType', 'ownerDocument', 'defaultChecked', 'defaultSelected']; propSet = _.object((function() { var _j, _len1, _results; _results = []; for (_j = 0, _len1 = props.length; _j < _len1; _j++) { prop = props[_j]; _results.push([prop, null]); } return _results; })()); setProp = function(elt, prop, val) { if (prop === 'value') { return elt.val(val); } else if (prop in propSet) { return elt.prop(prop, val); } else { return elt.attr(prop, val); } }; setDynProp = function(elt, prop, val, xform) { if (xform == null) { xform = _.identity; } if (val instanceof ObsCell) { return rx.autoSub(val.onSet, function(_arg) { var n, o; o = _arg[0], n = _arg[1]; return setProp(elt, prop, xform(n)); }); } else { return setProp(elt, prop, xform(val)); } }; rxt.mktag = mktag = function(tag) { return function(arg1, arg2) { var attrs, contents, elt, key, name, toNodes, updateContents, value, _ref5, _ref6; _ref5 = (arg1 == null) && (arg2 == null) ? [{}, null] : arg2 != null ? [arg1, arg2] : _.isString(arg1) || arg1 instanceof Element || arg1 instanceof RawHtml || arg1 instanceof $ || _.isArray(arg1) || arg1 instanceof ObsCell || arg1 instanceof ObsArray ? [{}, arg1] : [arg1, null], attrs = _ref5[0], contents = _ref5[1]; elt = $("<" + tag + "/>"); _ref6 = _.omit(attrs, _.keys(specialAttrs)); for (name in _ref6) { value = _ref6[name]; setDynProp(elt, name, value); } if (contents != null) { toNodes = function(contents) { var child, parsed, _j, _len1, _results; _results = []; for (_j = 0, _len1 = contents.length; _j < _len1; _j++) { child = contents[_j]; if (_.isString(child)) { _results.push(document.createTextNode(child)); } else if (child instanceof Element) { _results.push(child); } else if (child instanceof RawHtml) { parsed = $(child.html); if (parsed.length !== 1) { throw new Error('RawHtml must wrap a single element'); } _results.push(parsed[0]); } else if (child instanceof $) { if (child.length !== 1) { throw new Error('jQuery object must wrap a single element'); } _results.push(child[0]); } else { throw new Error("Unknown element type in array: " + child.constructor.name + " (must be string, Element, RawHtml, or jQuery objects)"); } } return _results; }; updateContents = function(contents) { var covers, hasWidth, left, node, nodes, top; elt.html(''); if (_.isArray(contents)) { nodes = toNodes(contents); elt.append(nodes); if (false) { hasWidth = function(node) { var e; try { return ($(node).width() != null) !== 0; } catch (_error) { e = _error; return false; } }; covers = (function() { var _j, _len1, _ref7, _ref8, _results; _ref7 = nodes != null ? nodes : []; _results = []; for (_j = 0, _len1 = _ref7.length; _j < _len1; _j++) { node = _ref7[_j]; if (!(hasWidth(node))) { continue; } _ref8 = $(node).offset(), left = _ref8.left, top = _ref8.top; _results.push($('<div/>').appendTo($('body').first()).addClass('updated-element').offset({ top: top, left: left }).width($(node).width()).height($(node).height())); } return _results; })(); return setTimeout((function() { var cover, _j, _len1, _results; _results = []; for (_j = 0, _len1 = covers.length; _j < _len1; _j++) { cover = covers[_j]; _results.push($(cover).remove()); } return _results; }), 2000); } } else if (_.isString(contents) || contents instanceof Element || contents instanceof RawHtml || contents instanceof $) { return updateContents([contents]); } else { throw new Error("Unknown type for element contents: " + contents.constructor.name + " (accepted types: string, Element, RawHtml, jQuery object of single element, or array of the aforementioned)"); } }; if (contents instanceof ObsArray) { rx.autoSub(contents.onChange, function(_arg) { var added, index, removed, toAdd; index = _arg[0], removed = _arg[1], added = _arg[2]; elt.contents().slice(index, index + removed.length).remove(); toAdd = toNodes(added); if (index === elt.contents().length) { return elt.append(toAdd); } else { return elt.contents().eq(index).before(toAdd); } }); } else if (contents instanceof ObsCell) { rx.autoSub(contents.onSet, function(_arg) { var old, val; old = _arg[0], val = _arg[1]; return updateContents(val); }); } else { updateContents(contents); } } for (key in attrs) { if (key in specialAttrs) { specialAttrs[key](elt, attrs[key], attrs, contents); } } return elt; }; }; tags = ['html', 'head', 'title', 'base', 'link', 'meta', 'style', 'script', 'noscript', 'body', 'body', 'section', 'nav', 'article', 'aside', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h1', 'h6', 'header', 'footer', 'address', 'main', 'main', 'p', 'hr', 'pre', 'blockquote', 'ol', 'ul', 'li', 'dl', 'dt', 'dd', 'dd', 'figure', 'figcaption', 'div', 'a', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'data', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'span', 'br', 'wbr', 'ins', 'del', 'img', 'iframe', 'embed', 'object', 'param', 'object', 'video', 'audio', 'source', 'video', 'audio', 'track', 'video', 'audio', 'canvas', 'map', 'area', 'area', 'map', 'svg', 'math', 'table', 'caption', 'colgroup', 'col', 'tbody', 'thead', 'tfoot', 'tr', 'td', 'th', 'form', 'fieldset', 'legend', 'fieldset', 'label', 'input', 'button', 'select', 'datalist', 'optgroup', 'option', 'select', 'datalist', 'textarea', 'keygen', 'output', 'progress', 'meter', 'details', 'summary', 'details', 'menuitem', 'menu']; rxt.tags = _.object((function() { var _j, _len1, _results; _results = []; for (_j = 0, _len1 = tags.length; _j < _len1; _j++) { tag = tags[_j]; _results.push([tag, rxt.mktag(tag)]); } return _results; })()); rxt.rawHtml = function(html) { return new RawHtml(html); }; rxt.importTags = function(x) { return _(x != null ? x : _this).extend(rxt.tags); }; rxt.cast = function(opts, types) { var key, newval, value; return _.object((function() { var _results; _results = []; for (key in opts) { value = opts[key]; newval = (function() { switch (types[key]) { case 'array': if (value instanceof rx.ObsArray) { return value; } else if (_.isArray(value)) { return new rx.DepArray(function() { return value; }); } else if (value instanceof rx.ObsCell) { return new rx.DepArray(function() { return value.get(); }); } else { throw new Error('Cannot cast to array: ' + value.constructor.name); } break; case 'cell': if (value instanceof rx.ObsCell) { return value; } else { return bind(function() { return value; }); } break; default: return value; } })(); _results.push([key, newval]); } return _results; })()); }; rxt.cssify = function(map) { var k, v; return ((function() { var _results; _results = []; for (k in map) { v = map[k]; if (v != null) { _results.push("" + (_.str.dasherize(k)) + ": " + (_.isNumber(v) ? v + 'px' : v) + ";"); } } return _results; })()).join(' '); }; specialAttrs.style = function(elt, value) { return setDynProp(elt, 'style', value, function(val) { if (_.isString(val)) { return val; } else { return rxt.cssify(val); } }); }; rxt.smushClasses = function(xs) { return _(xs).chain().flatten().compact().value().join(' ').replace(/\s+/, ' ').trim(); }; specialAttrs["class"] = function(elt, value) { return setDynProp(elt, 'class', value, function(val) { if (_.isString(val)) { return val; } else { return rxt.smushClasses(val); } }); }; }).call(this);
app/components/Footer/index.js
kdprojects/nichesportapp
import React, { Component } from 'react'; import FontIcon from 'material-ui/FontIcon'; import { BottomNavigation, BottomNavigationItem } from 'material-ui/BottomNavigation'; import Paper from 'material-ui/Paper'; import IconLocationOn from 'material-ui/svg-icons/communication/location-on'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; const nearbyIcon = <IconLocationOn />; // const StyleFooter = { // bottom: 0, // position: 'absolute', // width: '100%', // }; class Footer extends Component { state = { selectedIndex: 0, }; select = (index) => this.setState({ selectedIndex: index }); render() { return ( <MuiThemeProvider> <Paper zDepth={1}> <div> <BottomNavigation selectedIndex={this.state.selectedIndex}> <BottomNavigationItem label="Copyright @ Athliche Sports 2017" icon={nearbyIcon} style={{ maxWidth:300, cursor:"text"}} onTouchTap={() => this.select(0)} /> <BottomNavigationItem label="Privacy Policy" icon={nearbyIcon} onTouchTap={() => this.select(1)} /> <BottomNavigationItem label="Terms & Conditions" icon={nearbyIcon} onTouchTap={() => this.select(2)} /> <BottomNavigationItem label="Support" icon={nearbyIcon} onTouchTap={() => this.select(3)} /> <BottomNavigationItem label="Contact Us" icon={nearbyIcon} onTouchTap={() => this.select(4)} /> </BottomNavigation> </div> </Paper> </MuiThemeProvider> ); } } export default Footer;
client/src/index.js
Kxeta/product_searcher_react
import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter } from 'react-router-dom' import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap-theme.css'; import 'font-awesome/css/font-awesome.css'; import App from './main/App'; import registerServiceWorker from './registerServiceWorker'; import './index.css'; ReactDOM.render( <BrowserRouter> <App /> </BrowserRouter>, document.getElementById('root')) registerServiceWorker();
doc/examples/simple/develop/stories/index.js
sm-react/storybook-adk
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable react/jsx-filename-extension */ import React from 'react'; import { storiesOf } from '@storybook/react'; import { setOptions } from '@storybook/addon-options'; import { muiTheme } from 'storybook-addon-material-ui'; import { WithNotes } from '@storybook/addon-notes'; import { withKnobs, text, boolean, number } from '@storybook/addon-knobs'; //import decorator from '../../src/store/decorator'; import { addonDecorator, globalDecorator } from '../../setup/'; import '../App.css'; import Button from '../button'; const reqThemes = require.context('../.themes/', true, /.json/); const themesList = []; reqThemes.keys().forEach((filename) => { themesList.push(reqThemes(filename)); }); /** note: decorators * You can add decorator globally: * addDecorator(muiTheme(greyTheme)); * You can pass a single object or an array of themes */ globalDecorator('Global decorator'); // addDecorator(globalDecorator('Global decorator')) storiesOf('No decorator', module) .add('Example1', () => ( <div className="example-component"> <Button title="no decor 1" /> </div> )) .add('Example2', () => ( <div className="example-component"> <Button title="no decor 2" /> </div> )) storiesOf('Podda App1', module) .addDecorator(addonDecorator('Decor111')) .add('Example1', () => ( <div className="example-component"> <Button title="Example 1" /> </div> )) .add('Example2', () => ( <div className="example-component"> <Button title="Example 2" /> </div> )); storiesOf('Podda App2', module) .addDecorator(addonDecorator('Decor222')) .add('Example3', () => ( <div className="example-component"> <Button title="Example 3" /> </div> )) .add('Example4', () => ( <div className="example-component"> <Button title="Example 4" /> </div> )); storiesOf('Knobs1', module) .addDecorator(withKnobs) .add('Knob1', () => ( <header> <p>{text('Title1', 'Knob1.Title')}!!!</p> <p>{text('Subtitle1', 'Knob1.SubTitle')}</p> </header> )) .add('Knob2', () => ( <header> <p>{text('Title2', 'Knob2.Title')}</p> <p>{text('Subtitle2', 'Knob2.SubTitle')}</p> </header> )); storiesOf('Knobs2', module) .addDecorator(withKnobs) .add('Knob3', () => ( <header> <p>{text('Title3', 'Knob1.Title')}</p> <p>{text('Subtitle3', 'Knob1.SubTitle')}</p> </header> )) .add('Knob4', () => ( <header> <p>{text('Title4', 'Knob2.Title')}</p> <p>{text('Subtitle4', 'Knob2.SubTitle')}</p> </header> )); function withNote(note, child) { return ( <WithNotes notes={note}>{child || null}</WithNotes> ); }
node_modules/react-icons/md/crop.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const MdCrop = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m11.6 28.4h26.8v3.2h-6.8v6.8h-3.2v-6.8h-16.8c-1.8 0-3.2-1.4-3.2-3.2v-16.8h-6.8v-3.2h6.8v-6.8h3.2v26.8z m16.8-3.4v-13.4h-13.4v-3.2h13.4c1.8 0 3.2 1.4 3.2 3.2v13.4h-3.2z"/></g> </Icon> ) export default MdCrop
src/svg-icons/image/compare.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageCompare = (props) => ( <SvgIcon {...props}> <path d="M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2v2zm0 15H5l5-6v6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/> </SvgIcon> ); ImageCompare = pure(ImageCompare); ImageCompare.displayName = 'ImageCompare'; ImageCompare.muiName = 'SvgIcon'; export default ImageCompare;
views/Enigmas.js
joan17cast/Enigma
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ 'use strict'; import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, TextInput, Image, ListView, } from 'react-native'; import { StackNavigator } from 'react-navigation'; import * as firebase from 'firebase'; // Initialize Firebase const firebaseConfig = { apiKey: "AIzaSyApjVv2fxBkdXmvvfFx8L6YI_RfVAVOCUs", authDomain: "enigma-ae63b.firebaseapp.com", databaseURL: "https://enigma-ae63b.firebaseio.com", storageBucket: "enigma-ae63b.appspot.com", }; const firebaseApp = firebase.initializeApp(firebaseConfig); class Enigmas extends React.Component { static navigationOptions = { title: 'Welcome', header: null }; constructor(props) { super(props); this.itemsRef = firebaseApp.database().ref(); this.state = { dataSource: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }) }; } listenForItems(itemsRef) { itemsRef.on('Preguntas', (snap) => { // get children as an array var items = []; snap.forEach((child) => { items.push({ title: child.val().title, _key: child.key }); }); this.setState({ dataSource: this.state.dataSource.cloneWithRows(items) }); }); } componentDidMount() { this.listenForItems(this.itemsRef); } render() { this.componentDidMount(); return ( <View style={styles.container}> <Image style={{width: 150, height: 200}} source={require('../img/enigma.png')} /> <TextInput placeholder='Answer' placeholderTextColor="#C1C1C1" style={styles.answer} autocorrect={false} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#0B0B0B', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, answer: { width: 200, color: '#C1C1C1', backgroundColor: '#0B0B0B', }, }); module.exports = Enigmas;
builds/build_ver-2015_08_20-13_15_53/static/js/main.min.js
dumperize/fm
function sendForm(form_DOM,successHandler,errorHandler){jQuery.ajax({url:form_DOM.attr("action"),type:form_DOM.attr("method"),dataType:"json",data:form_DOM.serialize(),success:function(response){if(response.success)form_DOM.find(".error-summary").remove(),successHandler(response);else{form_DOM.find(".error-summary").remove(),form_DOM.prepend('<div class="error-summary format">'+response.errorSummary+"</div>"),form_DOM.find(".error").removeClass(".error");for(var k in response.fields)form_DOM.find('[name="'+response.object+"["+k+']"]').addClass("error");errorHandler&&errorHandler(response)}},error:function(response){form_DOM.find(".error-summary").remove(),form_DOM.prepend('<div class="error-summary format">Ошибка при отправке формы, попробуйте еще раз.</div>')},cache:!1})}function yandexGoal_showPhone(masterID){return yaCounter21591305.reachGoal("show_number",{master:masterID}),!0}function servicesCut(){$(".js-services-cut").each(function(){for(;$(this).height()>170;)$(this).find("li").last().remove()})}function master_minicard_preload(){$(".js-content-icon-switch.active").each(function(){$(this).parents(".master_presentation").find(".master_have-content-widget_"+$(this).attr("data-toggle")).addClass("active")})}if(function(e,t){function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function it(){return!0}function ot(){return!1}function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){for(var n,r=0;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;i--;)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}var o={},a=e===jn;return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){for(var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a)for(;o>i&&(r=t.apply(e[i],n),r!==!1);i++);else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a)for(;o>i&&(r=t.call(e[i],i,e[i]),r!==!1);i++);else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff ")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()}),r=b(o);var _={};b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){for(var r;(r=b.inArray(t,u,r))>-1;)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,u,l,t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return this.each(b.isFunction(e)?function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var o,a=0,s=b(this),u=t,l=e.match(w)||[];o=l[a++];)u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o);else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)):void 0}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;return e&&3!==u&&8!==u&&2!==u?typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)for(;n=o[i++];)r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}} },propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;l--;)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){for(t=(t||"").match(w)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(l=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=b.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;u--;)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=i.preFilter;s;){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r)for(l=mt(y,d),r(l,[],s,u),c=l.length;c--;)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}for(c=y.length;c--;)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r&&!i.relative[e[r].type];r++);return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){for(g=0;m=e[g++];)if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){for(g=0;m=t[g++];)m(x,y,u,c);if(s){if(v>0)for(;b--;)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}function xt(e,t,n){for(var r=0,i=t.length;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}for(o=U.needsContext.test(e)?0:a.length;o--&&(u=a[o],!i.relative[l=u.type]);)if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}return s(e,p)(r,t,d,n,V.test(e)),n}function Tt(){}var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[x]||(p[x]={}))[e]=[N,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){for(t||(t=ft(e)),n=t.length;n--;)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o},i.pseudos.nth=i.pseudos.eq,i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){ return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(b.isFunction(e)?function(t){b(this).wrapInner(e.call(this,t))}:function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&b.cleanData(Ot(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=0,i=[],o=b(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody)for(o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(b.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;return s?(n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o):void 0},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var p,f,i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={};u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||o.documentElement;e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position");)e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})}(window),function($){$.fn.extend({easyResponsiveTabs:function(options){var defaults={type:"default",width:"auto",fit:!0,closed:!1,tabidentify:"",activetab_bg:"#f0f3fa",inactive_bg:"#d3d5d6",active_border_color:"#d3d5d6",active_content_border_color:"#d3d5d6",activate:function(){}},options=$.extend(defaults,options),opt=options,jtype=opt.type,jfit=opt.fit,jwidth=opt.width,vtabs="vertical",accord="accordion",hash=window.location.hash,historyApi=!(!window.history||!history.replaceState);$(this).bind("tabactivate",function(e,currentTab){"function"==typeof options.activate&&options.activate.call(currentTab,e)}),this.each(function(){function jtab_options(){jtype==vtabs&&$respTabs.addClass("resp-vtabs").addClass(options.tabidentify),1==jfit&&$respTabs.css({width:"100%",margin:"0px"}),jtype==accord&&($respTabs.addClass("resp-easy-accordion").addClass(options.tabidentify),$respTabs.find(".resp-tabs-list").css("display","none"))}var $respTabs=$(this),$respTabsList=$respTabs.find("ul.resp-tabs-list."+options.tabidentify),respTabsId=$respTabs.attr("id");$respTabs.find("ul.resp-tabs-list."+options.tabidentify+" li").addClass("resp-tab-item").addClass(options.tabidentify),$respTabs.css({display:"block",width:jwidth}),"vertical"==options.type&&$respTabsList.css("margin-top","3px"),$respTabs.find(".resp-tabs-container."+options.tabidentify).css("border-color",options.active_content_border_color),$respTabs.find(".resp-tabs-container."+options.tabidentify+" > div").addClass("resp-tab-content").addClass(options.tabidentify),jtab_options();var $tabItemh2;$respTabs.find(".resp-tab-content."+options.tabidentify).before("<h2 class='resp-accordion "+options.tabidentify+"' role='tab'><span class='resp-arrow'></span></h2>"),$respTabs.find(".resp-tab-content."+options.tabidentify).prev("h2").css({"background-color":options.inactive_bg,"border-color":options.active_border_color});var itemCount=0;$respTabs.find(".resp-accordion").each(function(){$tabItemh2=$(this);var $tabItem=$respTabs.find(".resp-tab-item:eq("+itemCount+")"),$accItem=$respTabs.find(".resp-accordion:eq("+itemCount+")");$accItem.append($tabItem.html()),$accItem.data($tabItem.data()),$tabItemh2.attr("aria-controls",options.tabidentify+"_tab_item-"+itemCount),itemCount++});var $tabContent,count=0;$respTabs.find(".resp-tab-item").each(function(){$tabItem=$(this),$tabItem.attr("aria-controls",options.tabidentify+"_tab_item-"+count), $tabItem.attr("role","tab"),$tabItem.css({"background-color":options.inactive_bg,"border-color":"none"});var tabcount=0;$respTabs.find(".resp-tab-content."+options.tabidentify).each(function(){$tabContent=$(this),$tabContent.attr("aria-labelledby",options.tabidentify+"_tab_item-"+tabcount).css({"border-color":options.active_border_color}),tabcount++}),count++});var tabNum=0;if(""!=hash){var matches=hash.match(new RegExp(respTabsId+"([0-9]+)"));null!==matches&&2===matches.length&&(tabNum=parseInt(matches[1],10)-1,tabNum>count&&(tabNum=0))}$($respTabs.find(".resp-tab-item."+options.tabidentify)[tabNum]).addClass("resp-tab-active").css({"background-color":options.activetab_bg,"border-color":options.active_border_color}),options.closed===!0||"accordion"===options.closed&&!$respTabsList.is(":visible")||"tabs"===options.closed&&$respTabsList.is(":visible")?$($respTabs.find(".resp-tab-content."+options.tabidentify)[tabNum]).addClass("resp-accordion-closed"):$($respTabs.find(".resp-tab-content."+options.tabidentify)[tabNum]).addClass("resp-tab-content-active").addClass(options.tabidentify),$respTabs.find("[role=tab]").each(function(){var $currentTab=$(this);$currentTab.click(function(){var $currentTab=$(this),$tabAria=$currentTab.attr("aria-controls");if($currentTab.hasClass("resp-accordion")&&$currentTab.hasClass("resp-tab-active"))return $respTabs.find(".resp-tab-content-active."+options.tabidentify).slideUp("",function(){$(this).addClass("resp-accordion-closed")}),$currentTab.removeClass("resp-tab-active").css({"background-color":options.inactive_bg,"border-color":"none"}),!1;if(!$currentTab.hasClass("resp-tab-active")&&$currentTab.hasClass("resp-accordion")?($respTabs.find(".resp-tab-active."+options.tabidentify).removeClass("resp-tab-active").css({"background-color":options.inactive_bg,"border-color":"none"}),$respTabs.find(".resp-tab-content-active."+options.tabidentify).slideUp().removeClass("resp-tab-content-active resp-accordion-closed"),$respTabs.find("[aria-controls="+$tabAria+"]").addClass("resp-tab-active").css({"background-color":options.activetab_bg,"border-color":options.active_border_color}),$respTabs.find(".resp-tab-content[aria-labelledby = "+$tabAria+"]."+options.tabidentify).slideDown().addClass("resp-tab-content-active")):($respTabs.find(".resp-tab-active."+options.tabidentify).removeClass("resp-tab-active").css({"background-color":options.inactive_bg,"border-color":"none"}),$respTabs.find(".resp-tab-content-active."+options.tabidentify).removeAttr("style").removeClass("resp-tab-content-active").removeClass("resp-accordion-closed"),$respTabs.find("[aria-controls="+$tabAria+"]").addClass("resp-tab-active").css({"background-color":options.activetab_bg,"border-color":options.active_border_color}),$respTabs.find(".resp-tab-content[aria-labelledby = "+$tabAria+"]."+options.tabidentify).addClass("resp-tab-content-active").attr("style","display:block")),$currentTab.trigger("tabactivate",$currentTab),historyApi){var currentHash=window.location.hash,tabAriaParts=$tabAria.split("tab_item-"),newHash=respTabsId+(parseInt(tabAriaParts[1],10)+1).toString();if(""!=currentHash){var re=new RegExp(respTabsId+"[0-9]+");newHash=null!=currentHash.match(re)?currentHash.replace(re,newHash):currentHash+"|"+newHash}else newHash="#"+newHash;history.replaceState(null,null,newHash)}})}),$(window).resize(function(){$respTabs.find(".resp-accordion-closed").removeAttr("style")})})}})}(jQuery),function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;return d&&E(a)&&(e*=b.getViewport()[d]/100),Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){return a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0))?(f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var g,h,j,m,l,k={};"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,c.metadata())):k=c),g=d.href||k.href||(q(c)?c:null),h=d.title!==v?d.title:k.title||"",m=(j=d.content||k.content)?"html":d.type||k.type,!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null)),q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift())),j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&!g&&k.isDom&&(m="inline",j=c)),f.extend(k,{href:g,type:m,content:j,title:h,selector:l}),a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)):void 0},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a))},close:function(a){b.cancel(),!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d(),b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d(),p.unbind(".player"),b.player.isActive=!1,b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index<b.group.length-1)&&(b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")):c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var k,e=b.current,c=e?e.wrap:null;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null),b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading"),f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading(),a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body"),p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())}),b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:.5*d.h+d.y,left:.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),y:n.scrollTop()};return a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height()),d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb"),p.unbind(".fb"),n.unbind(".fb")},bindEvents:function(){var d,a=b.current;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;return 27===c&&b.coming?!1:void!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||k&&(k.type||f(k).is("[contenteditable]"))||!f.each(d,function(d,k){return 1<a.group.length&&k[c]!==v?(b[d](k[c]),e.preventDefault(),!1):-1<f.inArray(c,k)?(b[d](),e.preventDefault(),!1):void 0}))}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!j&&1<b.group.length&&!a.canShrink&&(g>0||k>0?b.prev(g>0?"down":"left"):(0>g||0>k)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){if(f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1))),!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){e&&b.helpers[d]&&f.isFunction(b.helpers[d][a])&&b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)}),p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var e,c,d={};if(a=l(a),e=b.group[a]||null,!e)return!1;if(d=f.extend(!0,{},b.opts,e),e=d.margin,c=d.padding,"number"===f.type(e)&&(d.margin=[e,e,e,e]),"number"===f.type(c)&&(d.padding=[c,c,c,c]),d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),d.autoSize&&(d.autoWidth=d.autoHeight=!0),"auto"===d.width&&(d.autoWidth=!0),"auto"===d.height&&(d.autoHeight=!0),d.group=b.group,d.index=a,b.coming=d,!1===b.trigger("beforeLoad"))b.coming=null;else{if(c=d.type,e=d.href,!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;if(b.isActive=!0,("image"===c||"swf"===c)&&(d.autoHeight=d.autoWidth=!1,d.scrolling="visible"),"image"===c&&(d.aspectRatio=!0),"iframe"===c&&s&&(d.scrolling="scroll"),d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body"),f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)}),f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))}),b.trigger("onReady"),"inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error}),b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null,b.coming.width=this.width/b.opts.pixelRatio,b.coming.height=this.height/b.opts.pixelRatio,b._afterLoad()},a.onerror=function(){this.onload=this.onerror=null,b._error("image")},a.src=b.coming.href,!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading(),b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}}),a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1),s||f(this).bind("load.fb",b.update),f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),b._afterLoad()})),a.content=d.appendTo(a.inner),a.iframe.preload||b._afterLoad()},_preloadImages:function(){var f,g,a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0;for(g=1;c>=g;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var e,c,k,g,h,a=b.coming,d=b.current;if(b.hideLoading(),a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{switch(d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),b.unbindEvents(),e=a.content,c=a.type,k=a.scrolling,f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d}),g=a.href,c){case"inline":case"ajax":case"html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=a.tpl.image.replace("{href}",g);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>',h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e),b.trigger("beforeShow"),a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k),b._setDimension(),b.reposition(),b.isOpen=!1,b.coming=null,b.bindEvents(),b.isOpened?d.prevMethod&&b.transitions[d.prevMethod]():f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove(),b.transitions[b.isOpened?a.nextMethod:a.openMethod](),b._preloadImages()}},_setDimension:function(){var v,z,t,C,A,F,B,D,H,a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]);if(e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp"),x=l(k.outerWidth(!0)-k.width()),v=l(k.outerHeight(!0)-k.height()),z=y+x,t=r+v,C=E(c)?(a.w-z)*l(c)/100:c,A=E(j)?(a.h-t)*l(j)/100:j,"iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else(h.autoWidth||h.autoHeight)&&(g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp"));if(c=l(C),j=l(A),D=C/A,m=l(E(m)?l(m,"w")-z:m),n=l(E(n)?l(n,"w")-z:n),u=l(E(u)?l(u,"h")-t:u),p=l(E(p)?l(p,"h")-t:p),F=n,B=p,h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p)),z=a.w-y,r=a.h-r,h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),m>c&&(c=m,j=l(c/D)),u>j&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p))),h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&c>m&&j>u&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),m>c&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&"auto"===s&&A>j&&z>c+x+q&&(c+=q),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),e=(a>z||y>r)&&c>m&&j>u,c=h.aspectRatio?F>c&&B>j&&C>c&&A>j:(F>c||B>j)&&(C>c||A>j),f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j}),!H&&h.autoHeight&&j>u&&p>j&&!c&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};return d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x),c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio)),c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio)),c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault(),b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),a.loop||a.index!==a.group.length-1?b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()):b.play(!1))},_afterZoomOut:function(a){a=a||b.current,f(".fancybox-wrap").trigger("onReset").remove(),f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),b.trigger("afterClose",a)}}),b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();return!e&&a.isDom&&d.is(":visible")&&(e=d.find("img:first"),e.length||(e=d)),t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio),("fixed"===b.wrap.css("position")||a.locked)&&(c.top-=m.y,c.left-=m.x),c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;("width"===f||"height"===f)&&(e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===f?c:c-g*e-h*e)))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position,c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=.1)):"fade"===e&&(d.opacity=.1),b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=.1)),b.wrap.animate(c,{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var g,a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction;e.opacity=.1,"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px")),"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,d=a.prevEffect,e={opacity:.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px"),a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}},b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a),this.overlay&&this.close(),this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent),this.fixed=!1,a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a),this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update()),a.closeClick&&this.overlay.bind("click.overlay",function(a){return f(a.target).hasClass("fancybox-overlay")?(b.isActive?b.close():d.close(),!1):void 0}),this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b)),f(".fancybox-overlay").remove().hide(),f.extend(this,{overlay:null,fixed:!1})},update:function(){var b,a="100%";this.overlay.width(a).height("100%"),I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width()),this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0),e||this.create(a),a.locked&&this.fixed&&b.fixed&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1),!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c)),this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}},b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;if(f.isFunction(e)&&(e=e.call(d.element,d)),q(e)&&""!==f.trim(e)){switch(d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>"),c){case"inside":c=b.skin;break;case"outside":c=b.wrap;break;case"over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}},f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var k,l,h=f(this).blur(),j=d;!(g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&""!==l&&"nofollow"!==l&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1===b.open(h,a)||!g.preventDefault()))};return a=a||{},d=a.index||0,c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k):e.unbind("click.fb-start").bind("click.fb-start",k),this.filter("[data-fancybox-start=1]").trigger("click"),this},p.ready(function(){var a,d;if(f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();return a.remove(),b}),f.support.fixedPosition===v){a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove(),a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")}),a=f(r).width(),J.addClass("fancybox-lock-test"),d=f(r).width(),J.removeClass("fancybox-lock-test"),f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})}(window,document,jQuery),$("a.js-scrollto[href^=#]").each(function(){var $target=$(this.hash);$(this).on("click",function(){return $target.length>0&&$("html, body").animate({scrollTop:$target.offset().top},"slow"),!1})}),$("a.scrollto[href^=#]").each(function(){var $target=$(this.hash);$(this).on("click",function(){return $target.length>0&&$("html, body").animate({scrollTop:$target.offset().top},"slow"),!1})}),fotoramaVersion="4.6.4",function(a,b,c,d,e){"use strict";function f(a){var b="bez_"+d.makeArray(arguments).join("_").replace(".","p");if("function"!=typeof d.easing[b]){var c=function(a,b){var c=[null,null],d=[null,null],e=[null,null],f=function(f,g){return e[g]=3*a[g],d[g]=3*(b[g]-a[g])-e[g],c[g]=1-e[g]-d[g],f*(e[g]+f*(d[g]+f*c[g]))},g=function(a){return e[0]+a*(2*d[0]+3*c[0]*a)},h=function(a){for(var b,c=a,d=0;++d<14&&(b=f(c,0)-a,!(Math.abs(b)<.001));)c-=b/g(c);return c};return function(a){return f(h(a),1)}};d.easing[b]=function(b,d,e,f,g){return f*c([a[0],a[1]],[a[2],a[3]])(d/g)+e}}return b}function g(){}function h(a,b,c){return Math.max(isNaN(b)?-1/0:b,Math.min(isNaN(c)?1/0:c,a))}function i(a){return a.match(/ma/)&&a.match(/-?\d+(?!d)/g)[a.match(/3d/)?12:4]}function j(a){return Ic?+i(a.css("transform")):+a.css("left").replace("px","")}function k(a){var b={};return Ic?b.transform="translate3d("+a+"px,0,0)":b.left=a,b}function l(a){return{"transition-duration":a+"ms"}}function m(a,b){return isNaN(a)?b:a}function n(a,b){return m(+String(a).replace(b||"px",""))}function o(a){return/%$/.test(a)?n(a,"%"):e}function p(a,b){return m(o(a)/100*b,n(a))}function q(a){return(!isNaN(n(a))||!isNaN(n(a,"%")))&&a}function r(a,b,c,d){return(a-(d||0))*(b+(c||0))}function s(a,b,c,d){return-Math.round(a/(b+(c||0))-(d||0))}function t(a){var b=a.data();if(!b.tEnd){var c=a[0],d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};T(c,d[uc.prefixed("transition")],function(a){b.tProp&&a.propertyName.match(b.tProp)&&b.onEndFn()}),b.tEnd=!0}}function u(a,b,c,d){var e,f=a.data();f&&(f.onEndFn=function(){e||(e=!0,clearTimeout(f.tT),c())},f.tProp=b,clearTimeout(f.tT),f.tT=setTimeout(function(){f.onEndFn()},1.5*d),t(a))}function v(a,b){if(a.length){var c=a.data();Ic?(a.css(l(0)),c.onEndFn=g,clearTimeout(c.tT)):a.stop();var d=w(b,function(){return j(a)});return a.css(k(d)),d}}function w(){for(var a,b=0,c=arguments.length;c>b&&(a=b?arguments[b]():arguments[b],"number"!=typeof a);b++);return a}function x(a,b){return Math.round(a+(b-a)/1.5)}function y(){return y.p=y.p||("https:"===c.protocol?"https://":"http://"),y.p}function z(a){var c=b.createElement("a");return c.href=a,c}function A(a,b){if("string"!=typeof a)return a;a=z(a);var c,d;if(a.host.match(/youtube\.com/)&&a.search){if(c=a.search.split("v=")[1]){var e=c.indexOf("&");-1!==e&&(c=c.substring(0,e)),d="youtube"}}else a.host.match(/youtube\.com|youtu\.be/)?(c=a.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,""),d="youtube"):a.host.match(/vimeo\.com/)&&(d="vimeo",c=a.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,""));return c&&d||!b||(c=a.href,d="custom"),c?{id:c,type:d,s:a.search.replace(/^\?/,""),p:y()}:!1}function B(a,b,c){var e,f,g=a.video;return"youtube"===g.type?(f=y()+"img.youtube.com/vi/"+g.id+"/default.jpg",e=f.replace(/\/default.jpg$/,"/hqdefault.jpg"),a.thumbsReady=!0):"vimeo"===g.type?d.ajax({url:y()+"vimeo.com/api/v2/video/"+g.id+".json",dataType:"jsonp",success:function(d){a.thumbsReady=!0,C(b,{img:d[0].thumbnail_large,thumb:d[0].thumbnail_small},a.i,c)}}):a.thumbsReady=!0,{img:e,thumb:f}}function C(a,b,c,e){for(var f=0,g=a.length;g>f;f++){var h=a[f];if(h.i===c&&h.thumbsReady){var i={videoReady:!0};i[Xc]=i[Zc]=i[Yc]=!1,e.splice(f,1,d.extend({},h,i,b));break}}}function D(a){function b(a,b,e){var f=a.children("img").eq(0),g=a.attr("href"),h=a.attr("src"),i=f.attr("src"),j=b.video,k=e?A(g,j===!0):!1;k?g=!1:k=j,c(a,f,d.extend(b,{video:k,img:b.img||g||h||i,thumb:b.thumb||i||h||g}))}function c(a,b,c){var e=c.thumb&&c.img!==c.thumb,f=n(c.width||a.attr("width")),g=n(c.height||a.attr("height"));d.extend(c,{width:f,height:g,thumbratio:S(c.thumbratio||n(c.thumbwidth||b&&b.attr("width")||e||f)/n(c.thumbheight||b&&b.attr("height")||e||g))})}var e=[];return a.children().each(function(){var a=d(this),f=R(d.extend(a.data(),{id:a.attr("id")}));if(a.is("a, img"))b(a,f,!0);else{if(a.is(":empty"))return;c(a,null,d.extend(f,{html:this,_html:a.html()}))}e.push(f)}),e}function E(a){return 0===a.offsetWidth&&0===a.offsetHeight}function F(a){return!d.contains(b.documentElement,a)}function G(a,b,c,d){return G.i||(G.i=1,G.ii=[!0]),d=d||G.i,"undefined"==typeof G.ii[d]&&(G.ii[d]=!0),a()?b():G.ii[d]&&setTimeout(function(){G.ii[d]&&G(a,b,c,d)},c||100),G.i++}function H(a){c.replace(c.protocol+"//"+c.host+c.pathname.replace(/^\/?/,"/")+c.search+"#"+a)}function I(a,b,c,d){var e=a.data(),f=e.measures;if(f&&(!e.l||e.l.W!==f.width||e.l.H!==f.height||e.l.r!==f.ratio||e.l.w!==b.w||e.l.h!==b.h||e.l.m!==c||e.l.p!==d)){var g=f.width,i=f.height,j=b.w/b.h,k=f.ratio>=j,l="scaledown"===c,m="contain"===c,n="cover"===c,o=$(d);k&&(l||m)||!k&&n?(g=h(b.w,0,l?g:1/0),i=g/f.ratio):(k&&n||!k&&(l||m))&&(i=h(b.h,0,l?i:1/0),g=i*f.ratio),a.css({width:g,height:i,left:p(o.x,b.w-g),top:p(o.y,b.h-i)}),e.l={W:f.width,H:f.height,r:f.ratio,w:b.w,h:b.h,m:c,p:d}}return!0}function J(a,b){var c=a[0];c.styleSheet?c.styleSheet.cssText=b:a.html(b)}function K(a,b,c){return b===c?!1:b>=a?"left":a>=c?"right":"left right"}function L(a,b,c,d){if(!c)return!1;if(!isNaN(a))return a-(d?0:1);for(var e,f=0,g=b.length;g>f;f++){var h=b[f]; if(h.id===a){e=f;break}}return e}function M(a,b,c){c=c||{},a.each(function(){var a,e=d(this),f=e.data();f.clickOn||(f.clickOn=!0,d.extend(cb(e,{onStart:function(b){a=b,(c.onStart||g).call(this,b)},onMove:c.onMove||g,onTouchEnd:c.onTouchEnd||g,onEnd:function(c){c.moved||b.call(this,a)}}),{noMove:!0}))})}function N(a,b){return'<div class="'+a+'">'+(b||"")+"</div>"}function O(a){for(var b=a.length;b;){var c=Math.floor(Math.random()*b--),d=a[b];a[b]=a[c],a[c]=d}return a}function P(a){return"[object Array]"==Object.prototype.toString.call(a)&&d.map(a,function(a){return d.extend({},a)})}function Q(a,b,c){a.scrollLeft(b||0).scrollTop(c||0)}function R(a){if(a){var b={};return d.each(a,function(a,c){b[a.toLowerCase()]=c}),b}}function S(a){if(a){var b=+a;return isNaN(b)?(b=a.split("/"),+b[0]/+b[1]||e):b}}function T(a,b,c,d){b&&(a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent("on"+b,c))}function U(a){return!!a.getAttribute("disabled")}function V(a){return{tabindex:-1*a+"",disabled:a}}function W(a,b){T(a,"keyup",function(c){U(a)||13==c.keyCode&&b.call(a,c)})}function X(a,b){T(a,"focus",a.onfocusin=function(c){b.call(a,c)},!0)}function Y(a,b){a.preventDefault?a.preventDefault():a.returnValue=!1,b&&a.stopPropagation&&a.stopPropagation()}function Z(a){return a?">":"<"}function $(a){return a=(a+"").split(/\s+/),{x:q(a[0])||bd,y:q(a[1])||bd}}function _(a,b){var c=a.data(),e=Math.round(b.pos),f=function(){c.sliding=!1,(b.onEnd||g)()};"undefined"!=typeof b.overPos&&b.overPos!==b.pos&&(e=b.overPos,f=function(){_(a,d.extend({},b,{overPos:b.pos,time:Math.max(Qc,b.time/2)}))});var h=d.extend(k(e),b.width&&{width:b.width});c.sliding=!0,Ic?(a.css(d.extend(l(b.time),h)),b.time>10?u(a,"transform",f,b.time):f()):a.stop().animate(h,b.time,_c,f)}function ab(a,b,c,e,f,h){var i="undefined"!=typeof h;if(i||(f.push(arguments),Array.prototype.push.call(arguments,f.length),!(f.length>1))){a=a||d(a),b=b||d(b);var j=a[0],k=b[0],l="crossfade"===e.method,m=function(){if(!m.done){m.done=!0;var a=(i||f.shift())&&f.shift();a&&ab.apply(this,a),(e.onEnd||g)(!!a)}},n=e.time/(h||1);c.removeClass(Rb+" "+Qb),a.stop().addClass(Rb),b.stop().addClass(Qb),l&&k&&a.fadeTo(0,0),a.fadeTo(l?n:0,1,l&&m),b.fadeTo(n,0,m),j&&l||k||m()}}function bb(a){var b=(a.touches||[])[0]||a;a._x=b.pageX,a._y=b.clientY,a._now=d.now()}function cb(a,c){function e(a){return m=d(a.target),u.checked=p=q=s=!1,k||u.flow||a.touches&&a.touches.length>1||a.which>1||ed&&ed.type!==a.type&&gd||(p=c.select&&m.is(c.select,t))?p:(o="touchstart"===a.type,q=m.is("a, a *",t),n=u.control,r=u.noMove||u.noSwipe||n?16:u.snap?0:4,bb(a),l=ed=a,fd=a.type.replace(/down|start/,"move").replace(/Down/,"Move"),(c.onStart||g).call(t,a,{control:n,$target:m}),k=u.flow=!0,void((!o||u.go)&&Y(a)))}function f(a){if(a.touches&&a.touches.length>1||Nc&&!a.isPrimary||fd!==a.type||!k)return k&&h(),void(c.onTouchEnd||g)();bb(a);var b=Math.abs(a._x-l._x),d=Math.abs(a._y-l._y),e=b-d,f=(u.go||u.x||e>=0)&&!u.noSwipe,i=0>e;o&&!u.checked?(k=f)&&Y(a):(Y(a),(c.onMove||g).call(t,a,{touch:o})),!s&&Math.sqrt(Math.pow(b,2)+Math.pow(d,2))>r&&(s=!0),u.checked=u.checked||f||i}function h(a){(c.onTouchEnd||g)();var b=k;u.control=k=!1,b&&(u.flow=!1),!b||q&&!u.checked||(a&&Y(a),gd=!0,clearTimeout(hd),hd=setTimeout(function(){gd=!1},1e3),(c.onEnd||g).call(t,{moved:s,$target:m,control:n,touch:o,startEvent:l,aborted:!a||"MSPointerCancel"===a.type}))}function i(){u.flow||setTimeout(function(){u.flow=!0},10)}function j(){u.flow&&setTimeout(function(){u.flow=!1},Pc)}var k,l,m,n,o,p,q,r,s,t=a[0],u={};return Nc?(T(t,"MSPointerDown",e),T(b,"MSPointerMove",f),T(b,"MSPointerCancel",h),T(b,"MSPointerUp",h)):(T(t,"touchstart",e),T(t,"touchmove",f),T(t,"touchend",h),T(b,"touchstart",i),T(b,"touchend",j),T(b,"touchcancel",j),Ec.on("scroll",j),a.on("mousedown",e),Fc.on("mousemove",f).on("mouseup",h)),a.on("click","a",function(a){u.checked&&Y(a)}),u}function db(a,b){function c(c,d){A=!0,j=l=c._x,q=c._now,p=[[q,j]],m=n=D.noMove||d?0:v(a,(b.getPos||g)()),(b.onStart||g).call(B,c)}function e(a,b){s=D.min,t=D.max,u=D.snap,w=a.altKey,A=z=!1,y=b.control,y||C.sliding||c(a)}function f(d,e){D.noSwipe||(A||c(d),l=d._x,p.push([d._now,l]),n=m-(j-l),o=K(n,s,t),s>=n?n=x(n,s):n>=t&&(n=x(n,t)),D.noMove||(a.css(k(n)),z||(z=!0,e.touch||Nc||a.addClass(ec)),(b.onMove||g).call(B,d,{pos:n,edge:o})))}function i(e){if(!D.noSwipe||!e.moved){A||c(e.startEvent,!0),e.touch||Nc||a.removeClass(ec),r=d.now();for(var f,i,j,k,o,q,v,x,y,z=r-Pc,C=null,E=Qc,F=b.friction,G=p.length-1;G>=0;G--){if(f=p[G][0],i=Math.abs(f-z),null===C||j>i)C=f,k=p[G][1];else if(C===z||i>j)break;j=i}v=h(n,s,t);var H=k-l,I=H>=0,J=r-C,K=J>Pc,L=!K&&n!==m&&v===n;u&&(v=h(Math[L?I?"floor":"ceil":"round"](n/u)*u,s,t),s=t=v),L&&(u||v===n)&&(y=-(H/J),E*=h(Math.abs(y),b.timeLow,b.timeHigh),o=Math.round(n+y*E/F),u||(v=o),(!I&&o>t||I&&s>o)&&(q=I?s:t,x=o-q,u||(v=q),x=h(v+.03*x,q-50,q+50),E=Math.abs((n-x)/(y/F)))),E*=w?10:1,(b.onEnd||g).call(B,d.extend(e,{moved:e.moved||K&&u,pos:n,newPos:v,overPos:x,time:E}))}}var j,l,m,n,o,p,q,r,s,t,u,w,y,z,A,B=a[0],C=a.data(),D={};return D=d.extend(cb(b.$wrap,d.extend({},b,{onStart:e,onMove:f,onEnd:i})),D)}function eb(a,b){var c,e,f,h=a[0],i={prevent:{}};return T(h,Oc,function(a){var h=a.wheelDeltaY||-1*a.deltaY||0,j=a.wheelDeltaX||-1*a.deltaX||0,k=Math.abs(j)&&!Math.abs(h),l=Z(0>j),m=e===l,n=d.now(),o=Pc>n-f;e=l,f=n,k&&i.ok&&(!i.prevent[l]||c)&&(Y(a,!0),c&&m&&o||(b.shift&&(c=!0,clearTimeout(i.t),i.t=setTimeout(function(){c=!1},Rc)),(b.onEnd||g)(a,b.shift?l:j)))}),i}function fb(){d.each(d.Fotorama.instances,function(a,b){b.index=a})}function gb(a){d.Fotorama.instances.push(a),fb()}function hb(a){d.Fotorama.instances.splice(a.index,1),fb()}var ib="fotorama",jb="fullscreen",kb=ib+"__wrap",lb=kb+"--css2",mb=kb+"--css3",nb=kb+"--video",ob=kb+"--fade",pb=kb+"--slide",qb=kb+"--no-controls",rb=kb+"--no-shadows",sb=kb+"--pan-y",tb=kb+"--rtl",ub=kb+"--only-active",vb=kb+"--no-captions",wb=kb+"--toggle-arrows",xb=ib+"__stage",yb=xb+"__frame",zb=yb+"--video",Ab=xb+"__shaft",Bb=ib+"__grab",Cb=ib+"__pointer",Db=ib+"__arr",Eb=Db+"--disabled",Fb=Db+"--prev",Gb=Db+"--next",Hb=ib+"__nav",Ib=Hb+"-wrap",Jb=Hb+"__shaft",Kb=Hb+"--dots",Lb=Hb+"--thumbs",Mb=Hb+"__frame",Nb=Mb+"--dot",Ob=Mb+"--thumb",Pb=ib+"__fade",Qb=Pb+"-front",Rb=Pb+"-rear",Sb=ib+"__shadow",Tb=Sb+"s",Ub=Tb+"--left",Vb=Tb+"--right",Wb=ib+"__active",Xb=ib+"__select",Yb=ib+"--hidden",Zb=ib+"--fullscreen",$b=ib+"__fullscreen-icon",_b=ib+"__error",ac=ib+"__loading",bc=ib+"__loaded",cc=bc+"--full",dc=bc+"--img",ec=ib+"__grabbing",fc=ib+"__img",gc=fc+"--full",hc=ib+"__dot",ic=ib+"__thumb",jc=ic+"-border",kc=ib+"__html",lc=ib+"__video",mc=lc+"-play",nc=lc+"-close",oc=ib+"__caption",pc=ib+"__caption__wrap",qc=ib+"__spinner",rc='" tabindex="0" role="button',sc=d&&d.fn.jquery.split(".");if(!sc||sc[0]<1||1==sc[0]&&sc[1]<8)throw"Fotorama requires jQuery 1.8 or later and will not run without it.";var tc={},uc=function(a,b,c){function d(a){r.cssText=a}function e(a,b){return typeof a===b}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){for(var d in a){var e=a[d];if(!f(e,"-")&&r[e]!==c)return"pfx"==b?e:!0}return!1}function h(a,b,d){for(var f in a){var g=b[a[f]];if(g!==c)return d===!1?a[f]:e(g,"function")?g.bind(d||b):g}return!1}function i(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+u.join(d+" ")+d).split(" ");return e(b,"string")||e(b,"undefined")?g(f,b):(f=(a+" "+v.join(d+" ")+d).split(" "),h(f,b,c))}var j,k,l,m="2.6.2",n={},o=b.documentElement,p="modernizr",q=b.createElement(p),r=q.style,s=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),t="Webkit Moz O ms",u=t.split(" "),v=t.toLowerCase().split(" "),w={},x=[],y=x.slice,z=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:p+(d+1),j.appendChild(h);return f=["&#173;",'<style id="s',p,'">',a,"</style>"].join(""),j.id=p,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=o.style.overflow,o.style.overflow="hidden",o.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),o.style.overflow=i),!!g},A={}.hasOwnProperty;l=e(A,"undefined")||e(A.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return A.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=y.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(y.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(y.call(arguments)))};return d}),w.csstransforms3d=function(){var a=!!i("perspective");return a};for(var B in w)l(w,B)&&(k=B.toLowerCase(),n[k]=w[B](),x.push((n[k]?"":"no-")+k));return n.addTest=function(a,b){if("object"==typeof a)for(var d in a)l(a,d)&&n.addTest(d,a[d]);else{if(a=a.toLowerCase(),n[a]!==c)return n;b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(o.className+=" "+(b?"":"no-")+a),n[a]=b}return n},d(""),q=j=null,n._version=m,n._prefixes=s,n._domPrefixes=v,n._cssomPrefixes=u,n.testProp=function(a){return g([a])},n.testAllProps=i,n.testStyles=z,n.prefixed=function(a,b,c){return b?i(a,b,c):i(a,"pfx")},n}(a,b),vc={ok:!1,is:function(){return!1},request:function(){},cancel:function(){},event:"",prefix:""},wc="webkit moz o ms khtml".split(" ");if("undefined"!=typeof b.cancelFullScreen)vc.ok=!0;else for(var xc=0,yc=wc.length;yc>xc;xc++)if(vc.prefix=wc[xc],"undefined"!=typeof b[vc.prefix+"CancelFullScreen"]){vc.ok=!0;break}vc.ok&&(vc.event=vc.prefix+"fullscreenchange",vc.is=function(){switch(this.prefix){case"":return b.fullScreen;case"webkit":return b.webkitIsFullScreen;default:return b[this.prefix+"FullScreen"]}},vc.request=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},vc.cancel=function(){return""===this.prefix?b.cancelFullScreen():b[this.prefix+"CancelFullScreen"]()});var zc,Ac={lines:12,length:5,width:2,radius:7,corners:1,rotate:15,color:"rgba(128, 128, 128, .75)",hwaccel:!0},Bc={top:"auto",left:"auto",className:""};!function(a,b){zc=b()}(this,function(){function a(a,c){var d,e=b.createElement(a||"div");for(d in c)e[d]=c[d];return e}function c(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function d(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=m.substring(0,m.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return o[e]||(p.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",p.cssRules.length),o[e]=1),e}function f(a,b){var c,d,f=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<n.length;d++)if(c=n[d]+b,f[c]!==e)return c;return f[b]!==e?b:void 0}function g(a,b){for(var c in b)a.style[f(a,c)||c]=b[c];return a}function h(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)a[d]===e&&(a[d]=c[d])}return a}function i(a){for(var b={x:a.offsetLeft,y:a.offsetTop};a=a.offsetParent;)b.x+=a.offsetLeft,b.y+=a.offsetTop;return b}function j(a,b){return"string"==typeof a?a:a[b%a.length]}function k(a){return"undefined"==typeof this?new k(a):void(this.opts=h(a||{},k.defaults,q))}function l(){function b(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}p.addRule(".spin-vml","behavior:url(#default#VML)"),k.prototype.lines=function(a,d){function e(){return g(b("group",{coordsize:k+" "+k,coordorigin:-i+" "+-i}),{width:k,height:k})}function f(a,f,h){c(m,c(g(e(),{rotation:360/d.lines*a+"deg",left:~~f}),c(g(b("roundrect",{arcsize:d.corners}),{width:i,height:d.width,left:d.radius,top:-d.width>>1,filter:h}),b("fill",{color:j(d.color,a),opacity:d.opacity}),b("stroke",{opacity:0}))))}var h,i=d.length+d.width,k=2*i,l=2*-(d.width+d.length)+"px",m=g(e(),{position:"absolute",top:l,left:l});if(d.shadow)for(h=1;h<=d.lines;h++)f(h,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(h=1;h<=d.lines;h++)f(h);return c(a,m)},k.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var m,n=["webkit","Moz","ms","O"],o={},p=function(){var d=a("style",{type:"text/css"});return c(b.getElementsByTagName("head")[0],d),d.sheet||d.styleSheet}(),q={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};k.defaults={},h(k.prototype,{spin:function(b){this.stop();var c,d,e=this,f=e.opts,h=e.el=g(a(0,{className:f.className}),{position:f.position,width:0,zIndex:f.zIndex}),j=f.radius+f.length+f.width;if(b&&(b.insertBefore(h,b.firstChild||null),d=i(b),c=i(h),g(h,{left:("auto"==f.left?d.x-c.x+(b.offsetWidth>>1):parseInt(f.left,10)+j)+"px",top:("auto"==f.top?d.y-c.y+(b.offsetHeight>>1):parseInt(f.top,10)+j)+"px"})),h.setAttribute("role","progressbar"),e.lines(h,e.opts),!m){var k,l=0,n=(f.lines-1)*(1-f.direction)/2,o=f.fps,p=o/f.speed,q=(1-f.opacity)/(p*f.trail/100),r=p/f.lines;!function s(){l++;for(var a=0;a<f.lines;a++)k=Math.max(1-(l+(f.lines-a)*r)%p*q,f.opacity),e.opacity(h,a*f.direction+n,k,f);e.timeout=e.el&&setTimeout(s,~~(1e3/o))}()}return e},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=e),this},lines:function(b,e){function f(b,c){return g(a(),{position:"absolute",width:e.length+e.width+"px",height:e.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/e.lines*i+e.rotate)+"deg) translate("+e.radius+"px,0)",borderRadius:(e.corners*e.width>>1)+"px"})}for(var h,i=0,k=(e.lines-1)*(1-e.direction)/2;i<e.lines;i++)h=g(a(),{position:"absolute",top:1+~(e.width/2)+"px",transform:e.hwaccel?"translate3d(0,0,0)":"",opacity:e.opacity,animation:m&&d(e.opacity,e.trail,k+i*e.direction,e.lines)+" "+1/e.speed+"s linear infinite"}),e.shadow&&c(h,g(f("#000","0 0 4px #000"),{top:"2px"})),c(b,c(h,f(j(e.color,i),"0 0 1px rgba(0,0,0,.1)")));return b},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var r=g(a("group"),{behavior:"url(#default#VML)"});return!f(r,"transform")&&r.adj?l():m=f(r,"animation"),k});var Cc,Dc,Ec=d(a),Fc=d(b),Gc="quirks"===c.hash.replace("#",""),Hc=uc.csstransforms3d,Ic=Hc&&!Gc,Jc=Hc||"CSS1Compat"===b.compatMode,Kc=vc.ok,Lc=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i),Mc=!Ic||Lc,Nc=navigator.msPointerEnabled,Oc="onwheel"in b.createElement("div")?"wheel":b.onmousewheel!==e?"mousewheel":"DOMMouseScroll",Pc=250,Qc=300,Rc=1400,Sc=5e3,Tc=2,Uc=64,Vc=500,Wc=333,Xc="$stageFrame",Yc="$navDotFrame",Zc="$navThumbFrame",$c="auto",_c=f([.1,0,.25,1]),ad=99999,bd="50%",cd={width:null,minwidth:null,maxwidth:"100%",height:null,minheight:null,maxheight:null,ratio:null,margin:Tc,glimpse:0,fit:"contain",position:bd,thumbposition:bd,nav:"dots",navposition:"bottom",navwidth:null,thumbwidth:Uc,thumbheight:Uc,thumbmargin:Tc,thumbborderwidth:Tc,thumbfit:"cover",allowfullscreen:!1,transition:"slide",clicktransition:null,transitionduration:Qc,captions:!0,hash:!1,startindex:0,loop:!1,autoplay:!1,stopautoplayontouch:!0,keyboard:!1,arrows:!0,click:!0,swipe:!0,trackpad:!1,enableifsingleframe:!1,controlsonstart:!0,shuffle:!1,direction:"ltr",shadows:!0,spinner:null},dd={left:!0,right:!0,down:!1,up:!1,space:!1,home:!1,end:!1};G.stop=function(a){G.ii[a]=!1};var ed,fd,gd,hd;jQuery.Fotorama=function(a,e){function f(){d.each(yd,function(a,b){if(!b.i){b.i=me++;var c=A(b.video,!0);if(c){var d={};b.video=c,b.img||b.thumb?b.thumbsReady=!0:d=B(b,yd,ie),C(yd,{img:d.img,thumb:d.thumb},b.i,ie)}}})}function g(a){return Zd[a]||ie.fullScreen}function i(a){var b="keydown."+ib,c=ib+je,d="keydown."+c,f="resize."+c+" orientationchange."+c;a?(Fc.on(d,function(a){var b,c;Cd&&27===a.keyCode?(b=!0,md(Cd,!0,!0)):(ie.fullScreen||e.keyboard&&!ie.index)&&(27===a.keyCode?(b=!0,ie.cancelFullScreen()):a.shiftKey&&32===a.keyCode&&g("space")||37===a.keyCode&&g("left")||38===a.keyCode&&g("up")?c="<":32===a.keyCode&&g("space")||39===a.keyCode&&g("right")||40===a.keyCode&&g("down")?c=">":36===a.keyCode&&g("home")?c="<<":35===a.keyCode&&g("end")&&(c=">>")),(b||c)&&Y(a),c&&ie.show({index:c,slow:a.altKey,user:!0})}),ie.index||Fc.off(b).on(b,"textarea, input, select",function(a){!Dc.hasClass(jb)&&a.stopPropagation()}),Ec.on(f,ie.resize)):(Fc.off(d),Ec.off(f))}function j(b){b!==j.f&&(b?(a.html("").addClass(ib+" "+ke).append(qe).before(oe).before(pe),gb(ie)):(qe.detach(),oe.detach(),pe.detach(),a.html(ne.urtext).removeClass(ke),hb(ie)),i(b),j.f=b)}function m(){yd=ie.data=yd||P(e.data)||D(a),zd=ie.size=yd.length,!xd.ok&&e.shuffle&&O(yd),f(),Je=y(Je),zd&&j(!0)}function o(){var a=2>zd&&!e.enableifsingleframe||Cd;Me.noMove=a||Sd,Me.noSwipe=a||!e.swipe,!Wd&&se.toggleClass(Bb,!e.click&&!Me.noMove&&!Me.noSwipe),Nc&&qe.toggleClass(sb,!Me.noSwipe)}function t(a){a===!0&&(a=""),e.autoplay=Math.max(+a||Sc,1.5*Vd)}function u(){function a(a,c){b[a?"add":"remove"].push(c)}ie.options=e=R(e),Sd="crossfade"===e.transition||"dissolve"===e.transition,Md=e.loop&&(zd>2||Sd&&(!Wd||"slide"!==Wd)),Vd=+e.transitionduration||Qc,Yd="rtl"===e.direction,Zd=d.extend({},e.keyboard&&dd,e.keyboard);var b={add:[],remove:[]};zd>1||e.enableifsingleframe?(Nd=e.nav,Pd="top"===e.navposition,b.remove.push(Xb),we.toggle(!!e.arrows)):(Nd=!1,we.hide()),Rb(),Bd=new zc(d.extend(Ac,e.spinner,Bc,{direction:Yd?-1:1})),Gc(),Hc(),e.autoplay&&t(e.autoplay),Td=n(e.thumbwidth)||Uc,Ud=n(e.thumbheight)||Uc,Ne.ok=Pe.ok=e.trackpad&&!Mc,o(),ed(e,[Le]),Od="thumbs"===Nd,Od?(lc(zd,"navThumb"),Ad=Be,he=Zc,J(oe,d.Fotorama.jst.style({w:Td,h:Ud,b:e.thumbborderwidth,m:e.thumbmargin,s:je,q:!Jc})),ye.addClass(Lb).removeClass(Kb)):"dots"===Nd?(lc(zd,"navDot"),Ad=Ae,he=Yc,ye.addClass(Kb).removeClass(Lb)):(Nd=!1,ye.removeClass(Lb+" "+Kb)),Nd&&(Pd?xe.insertBefore(re):xe.insertAfter(re),wc.nav=!1,wc(Ad,ze,"nav")),Qd=e.allowfullscreen,Qd?(De.prependTo(re),Rd=Kc&&"native"===Qd):(De.detach(),Rd=!1),a(Sd,ob),a(!Sd,pb),a(!e.captions,vb),a(Yd,tb),a("always"!==e.arrows,wb),Xd=e.shadows&&!Mc,a(!Xd,rb),qe.addClass(b.add.join(" ")).removeClass(b.remove.join(" ")),Ke=d.extend({},e)}function x(a){return 0>a?(zd+a%zd)%zd:a>=zd?a%zd:a}function y(a){return h(a,0,zd-1)}function z(a){return Md?x(a):y(a)}function E(a){return a>0||Md?a-1:!1}function U(a){return zd-1>a||Md?a+1:!1}function $(){Me.min=Md?-1/0:-r(zd-1,Le.w,e.margin,Fd),Me.max=Md?1/0:-r(0,Le.w,e.margin,Fd),Me.snap=Le.w+e.margin}function bb(){Oe.min=Math.min(0,Le.nw-ze.width()),Oe.max=0,ze.toggleClass(Bb,!(Oe.noMove=Oe.min===Oe.max))}function cb(a,b,c){if("number"==typeof a){a=new Array(a);var e=!0}return d.each(a,function(a,d){if(e&&(d=a),"number"==typeof d){var f=yd[x(d)];if(f){var g="$"+b+"Frame",h=f[g];c.call(this,a,d,f,h,g,h&&h.data())}}})}function fb(a,b,c,d){(!$d||"*"===$d&&d===Ld)&&(a=q(e.width)||q(a)||Vc,b=q(e.height)||q(b)||Wc,ie.resize({width:a,ratio:e.ratio||c||a/b},0,d!==Ld&&"*"))}function Pb(a,b,c,f,g,h){cb(a,b,function(a,i,j,k,l,m){function n(a){var b=x(i);fd(a,{index:b,src:w,frame:yd[b]})}function o(){t.remove(),d.Fotorama.cache[w]="error",j.html&&"stage"===b||!y||y===w?(!w||j.html||r?"stage"===b&&(k.trigger("f:load").removeClass(ac+" "+_b).addClass(bc),n("load"),fb()):(k.trigger("f:error").removeClass(ac).addClass(_b),n("error")),m.state="error",!(zd>1&&yd[i]===j)||j.html||j.deleted||j.video||r||(j.deleted=!0,ie.splice(i,1))):(j[v]=w=y,Pb([i],b,c,f,g,!0))}function p(){d.Fotorama.measures[w]=u.measures=d.Fotorama.measures[w]||{width:s.width,height:s.height,ratio:s.width/s.height},fb(u.measures.width,u.measures.height,u.measures.ratio,i),t.off("load error").addClass(fc+(r?" "+gc:"")).prependTo(k),I(t,(d.isFunction(c)?c():c)||Le,f||j.fit||e.fit,g||j.position||e.position),d.Fotorama.cache[w]=m.state="loaded",setTimeout(function(){k.trigger("f:load").removeClass(ac+" "+_b).addClass(bc+" "+(r?cc:dc)),"stage"===b?n("load"):(j.thumbratio===$c||!j.thumbratio&&e.thumbratio===$c)&&(j.thumbratio=u.measures.ratio,vd())},0)}function q(){var a=10;G(function(){return!fe||!a--&&!Mc},function(){p()})}if(k){var r=ie.fullScreen&&j.full&&j.full!==j.img&&!m.$full&&"stage"===b;if(!m.$img||h||r){var s=new Image,t=d(s),u=t.data();m[r?"$full":"$img"]=t;var v="stage"===b?r?"full":"img":"thumb",w=j[v],y=r?null:j["stage"===b?"thumb":"img"];if("navThumb"===b&&(k=m.$wrap),!w)return void o();d.Fotorama.cache[w]?!function z(){"error"===d.Fotorama.cache[w]?o():"loaded"===d.Fotorama.cache[w]?setTimeout(q,0):setTimeout(z,100)}():(d.Fotorama.cache[w]="*",t.on("load",q).on("error",o)),m.state="",s.src=w}}})}function Qb(a){Ie.append(Bd.spin().el).appendTo(a)}function Rb(){Ie.detach(),Bd&&Bd.stop()}function Sb(){var a=Dd[Xc];a&&!a.data().state&&(Qb(a),a.on("f:load f:error",function(){a.off("f:load f:error"),Rb()}))}function ec(a){W(a,sd),X(a,function(){setTimeout(function(){Q(ye)},0),Rc({time:Vd,guessIndex:d(this).data().eq,minMax:Oe})})}function lc(a,b){cb(a,b,function(a,c,e,f,g,h){if(!f){f=e[g]=qe[g].clone(),h=f.data(),h.data=e;var i=f[0];"stage"===b?(e.html&&d('<div class="'+kc+'"></div>').append(e._html?d(e.html).removeAttr("id").html(e._html):e.html).appendTo(f),e.caption&&d(N(oc,N(pc,e.caption))).appendTo(f),e.video&&f.addClass(zb).append(Fe.clone()),X(i,function(){setTimeout(function(){Q(re)},0),pd({index:h.eq,user:!0})}),te=te.add(f)):"navDot"===b?(ec(i),Ae=Ae.add(f)):"navThumb"===b&&(ec(i),h.$wrap=f.children(":first"),Be=Be.add(f),e.video&&h.$wrap.append(Fe.clone()))}})}function sc(a,b,c,d){return a&&a.length&&I(a,b,c,d)}function tc(a){cb(a,"stage",function(a,b,c,f,g,h){if(f){var i=x(b),j=c.fit||e.fit,k=c.position||e.position;h.eq=i,Re[Xc][i]=f.css(d.extend({left:Sd?0:r(b,Le.w,e.margin,Fd)},Sd&&l(0))),F(f[0])&&(f.appendTo(se),md(c.$video)),sc(h.$img,Le,j,k),sc(h.$full,Le,j,k)}})}function uc(a,b){if("thumbs"===Nd&&!isNaN(a)){var c=-a,f=-a+Le.nw;Be.each(function(){var a=d(this),g=a.data(),h=g.eq,i=function(){return{h:Ud,w:g.w}},j=i(),k=yd[h]||{},l=k.thumbfit||e.thumbfit,m=k.thumbposition||e.thumbposition;j.w=g.w,g.l+g.w<c||g.l>f||sc(g.$img,j,l,m)||b&&Pb([h],"navThumb",i,l,m)})}}function wc(a,b,c){if(!wc[c]){var f="nav"===c&&Od,g=0;b.append(a.filter(function(){for(var a,b=d(this),c=b.data(),e=0,f=yd.length;f>e;e++)if(c.data===yd[e]){a=!0,c.eq=e;break}return a||b.remove()&&!1}).sort(function(a,b){return d(a).data().eq-d(b).data().eq}).each(function(){if(f){var a=d(this),b=a.data(),c=Math.round(Ud*b.data.thumbratio)||Td;b.l=g,b.w=c,a.css({width:c}),g+=c+e.thumbmargin}})),wc[c]=!0}}function xc(a){return a-Se>Le.w/3}function yc(a){return!(Md||Je+a&&Je-zd+a||Cd)}function Gc(){var a=yc(0),b=yc(1);ue.toggleClass(Eb,a).attr(V(a)),ve.toggleClass(Eb,b).attr(V(b))}function Hc(){Ne.ok&&(Ne.prevent={"<":yc(0),">":yc(1)})}function Lc(a){var b,c,d=a.data();return Od?(b=d.l,c=d.w):(b=a.position().left,c=a.width()),{c:b+c/2,min:-b+10*e.thumbmargin,max:-b+Le.w-c-10*e.thumbmargin}}function Oc(a){var b=Dd[he].data();_(Ce,{time:1.2*a,pos:b.l,width:b.w-2*e.thumbborderwidth})}function Rc(a){var b=yd[a.guessIndex][he];if(b){var c=Oe.min!==Oe.max,d=a.minMax||c&&Lc(Dd[he]),e=c&&(a.keep&&Rc.l?Rc.l:h((a.coo||Le.nw/2)-Lc(b).c,d.min,d.max)),f=c&&h(e,Oe.min,Oe.max),g=1.1*a.time;_(ze,{time:g,pos:f||0,onEnd:function(){uc(f,!0)}}),ld(ye,K(f,Oe.min,Oe.max)),Rc.l=e}}function Tc(){_c(he),Qe[he].push(Dd[he].addClass(Wb))}function _c(a){for(var b=Qe[a];b.length;)b.shift().removeClass(Wb)}function bd(a){var b=Re[a];d.each(Ed,function(a,c){delete b[x(c)]}),d.each(b,function(a,c){delete b[a],c.detach()})}function cd(a){Fd=Gd=Je;var b=Dd[Xc];b&&(_c(Xc),Qe[Xc].push(b.addClass(Wb)),a||ie.show.onEnd(!0),v(se,0,!0),bd(Xc),tc(Ed),$(),bb())}function ed(a,b){a&&d.each(b,function(b,c){c&&d.extend(c,{width:a.width||c.width,height:a.height,minwidth:a.minwidth,maxwidth:a.maxwidth,minheight:a.minheight,maxheight:a.maxheight,ratio:S(a.ratio)})})}function fd(b,c){a.trigger(ib+":"+b,[ie,c])}function gd(){clearTimeout(hd.t),fe=1,e.stopautoplayontouch?ie.stopAutoplay():ce=!0}function hd(){fe&&(e.stopautoplayontouch||(id(),jd()),hd.t=setTimeout(function(){fe=0},Qc+Pc))}function id(){ce=!(!Cd&&!de)}function jd(){if(clearTimeout(jd.t),G.stop(jd.w),!e.autoplay||ce)return void(ie.autoplay&&(ie.autoplay=!1,fd("stopautoplay")));ie.autoplay||(ie.autoplay=!0,fd("startautoplay"));var a=Je,b=Dd[Xc].data();jd.w=G(function(){return b.state||a!==Je},function(){jd.t=setTimeout(function(){if(!ce&&a===Je){var b=Kd,c=yd[b][Xc].data();jd.w=G(function(){return c.state||b!==Kd},function(){ce||b!==Kd||ie.show(Md?Z(!Yd):Kd)})}},e.autoplay)})}function kd(){ie.fullScreen&&(ie.fullScreen=!1,Kc&&vc.cancel(le),Dc.removeClass(jb),Cc.removeClass(jb),a.removeClass(Zb).insertAfter(pe),Le=d.extend({},ee),md(Cd,!0,!0),rd("x",!1),ie.resize(),Pb(Ed,"stage"),Q(Ec,ae,_d),fd("fullscreenexit"))}function ld(a,b){Xd&&(a.removeClass(Ub+" "+Vb),b&&!Cd&&a.addClass(b.replace(/^|\s/g," "+Tb+"--")))}function md(a,b,c){b&&(qe.removeClass(nb),Cd=!1,o()),a&&a!==Cd&&(a.remove(),fd("unloadvideo")),c&&(id(),jd())}function nd(a){qe.toggleClass(qb,a)}function od(a){if(!Me.flow){var b=a?a.pageX:od.x,c=b&&!yc(xc(b))&&e.click;od.p!==c&&re.toggleClass(Cb,c)&&(od.p=c,od.x=b)}}function pd(a){clearTimeout(pd.t),e.clicktransition&&e.clicktransition!==e.transition?setTimeout(function(){var b=e.transition;ie.setOptions({transition:e.clicktransition}),Wd=b,pd.t=setTimeout(function(){ie.show(a)},10)},0):ie.show(a)}function qd(a,b){var c=a.target,f=d(c);f.hasClass(mc)?ie.playVideo():c===Ee?ie.toggleFullScreen():Cd?c===He&&md(Cd,!0,!0):b?nd():e.click&&pd({index:a.shiftKey||Z(xc(a._x)),slow:a.altKey,user:!0})}function rd(a,b){Me[a]=Oe[a]=b}function sd(a){var b=d(this).data().eq;pd({index:b,slow:a.altKey,user:!0,coo:a._x-ye.offset().left})}function td(a){pd({index:we.index(this)?">":"<",slow:a.altKey,user:!0})}function ud(a){X(a,function(){setTimeout(function(){Q(re)},0),nd(!1)})}function vd(){if(m(),u(),!vd.i){vd.i=!0;var a=e.startindex;(a||e.hash&&c.hash)&&(Ld=L(a||c.hash.replace(/^#/,""),yd,0===ie.index||a,a)),Je=Fd=Gd=Hd=Ld=z(Ld)||0}if(zd){if(wd())return;Cd&&md(Cd,!0),Ed=[],bd(Xc),vd.ok=!0,ie.show({index:Je,time:0}),ie.resize()}else ie.destroy()}function wd(){return!wd.f===Yd?(wd.f=Yd,Je=zd-1-Je,ie.reverse(),!0):void 0}function xd(){xd.ok||(xd.ok=!0,fd("ready"))}Cc=d("html"),Dc=d("body");var yd,zd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Id,Jd,Kd,Ld,Md,Nd,Od,Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,Yd,Zd,$d,_d,ae,be,ce,de,ee,fe,ge,he,ie=this,je=d.now(),ke=ib+je,le=a[0],me=1,ne=a.data(),oe=d("<style></style>"),pe=d(N(Yb)),qe=d(N(kb)),re=d(N(xb)).appendTo(qe),se=(re[0],d(N(Ab)).appendTo(re)),te=d(),ue=d(N(Db+" "+Fb+rc)),ve=d(N(Db+" "+Gb+rc)),we=ue.add(ve).appendTo(re),xe=d(N(Ib)),ye=d(N(Hb)).appendTo(xe),ze=d(N(Jb)).appendTo(ye),Ae=d(),Be=d(),Ce=(se.data(),ze.data(),d(N(jc)).appendTo(ze)),De=d(N($b+rc)),Ee=De[0],Fe=d(N(mc)),Ge=d(N(nc)).appendTo(re),He=Ge[0],Ie=d(N(qc)),Je=!1,Ke={},Le={},Me={},Ne={},Oe={},Pe={},Qe={},Re={},Se=0,Te=[];qe[Xc]=d(N(yb)),qe[Zc]=d(N(Mb+" "+Ob+rc,N(ic))),qe[Yc]=d(N(Mb+" "+Nb+rc,N(hc))),Qe[Xc]=[],Qe[Zc]=[],Qe[Yc]=[],Re[Xc]={},qe.addClass(Ic?mb:lb).toggleClass(qb,!e.controlsonstart),ne.fotorama=this,ie.startAutoplay=function(a){return ie.autoplay?this:(ce=de=!1,t(a||e.autoplay),jd(),this)},ie.stopAutoplay=function(){return ie.autoplay&&(ce=de=!0,jd()),this},ie.show=function(a){var b;"object"!=typeof a?(b=a,a={}):b=a.index,b=">"===b?Gd+1:"<"===b?Gd-1:"<<"===b?0:">>"===b?zd-1:b,b=isNaN(b)?L(b,yd,!0):b,b="undefined"==typeof b?Je||0:b,ie.activeIndex=Je=z(b),Id=E(Je),Jd=U(Je),Kd=x(Je+(Yd?-1:1)),Ed=[Je,Id,Jd],Gd=Md?b:Je;var c=Math.abs(Hd-Gd),d=w(a.time,function(){return Math.min(Vd*(1+(c-1)/12),2*Vd)}),f=a.overPos;a.slow&&(d*=10);var g=Dd;ie.activeFrame=Dd=yd[Je];var i=g===Dd&&!a.user;md(Cd,Dd.i!==yd[x(Fd)].i),lc(Ed,"stage"),tc(Mc?[Gd]:[Gd,E(Gd),U(Gd)]),rd("go",!0),i||fd("show",{user:a.user,time:d}),ce=!0;var j=ie.show.onEnd=function(b){if(!j.ok){if(j.ok=!0,b||cd(!0),i||fd("showend",{user:a.user}),!b&&Wd&&Wd!==e.transition)return ie.setOptions({transition:Wd}),void(Wd=!1);Sb(),Pb(Ed,"stage"),rd("go",!1),Hc(),od(),id(),jd()}};if(Sd){var k=Dd[Xc],l=Je!==Hd?yd[Hd][Xc]:null;ab(k,l,te,{time:d,method:e.transition,onEnd:j},Te)}else _(se,{pos:-r(Gd,Le.w,e.margin,Fd),overPos:f,time:d,onEnd:j});if(Gc(),Nd){Tc();var m=y(Je+h(Gd-Hd,-1,1));Rc({time:d,coo:m!==Je&&a.coo,guessIndex:"undefined"!=typeof a.coo?m:Je,keep:i}),Od&&Oc(d)}return be="undefined"!=typeof Hd&&Hd!==Je,Hd=Je,e.hash&&be&&!ie.eq&&H(Dd.id||Je+1),this},ie.requestFullScreen=function(){return Qd&&!ie.fullScreen&&(_d=Ec.scrollTop(),ae=Ec.scrollLeft(),Q(Ec),rd("x",!0),ee=d.extend({},Le),a.addClass(Zb).appendTo(Dc.addClass(jb)),Cc.addClass(jb),md(Cd,!0,!0),ie.fullScreen=!0,Rd&&vc.request(le),ie.resize(),Pb(Ed,"stage"),Sb(),fd("fullscreenenter")),this},ie.cancelFullScreen=function(){return Rd&&vc.is()?vc.cancel(b):kd(),this},ie.toggleFullScreen=function(){return ie[(ie.fullScreen?"cancel":"request")+"FullScreen"]()},T(b,vc.event,function(){!yd||vc.is()||Cd||kd()}),ie.resize=function(a){if(!yd)return this;var b=arguments[1]||0,c=arguments[2];ed(ie.fullScreen?{width:"100%",maxwidth:null,minwidth:null,height:"100%",maxheight:null,minheight:null}:R(a),[Le,c||ie.fullScreen||e]);var d=Le.width,f=Le.height,g=Le.ratio,i=Ec.height()-(Nd?ye.height():0);return q(d)&&(qe.addClass(ub).css({width:d,minWidth:Le.minwidth||0,maxWidth:Le.maxwidth||ad}),d=Le.W=Le.w=qe.width(),Le.nw=Nd&&p(e.navwidth,d)||d,e.glimpse&&(Le.w-=Math.round(2*(p(e.glimpse,d)||0))),se.css({width:Le.w,marginLeft:(Le.W-Le.w)/2}),f=p(f,i),f=f||g&&d/g,f&&(d=Math.round(d),f=Le.h=Math.round(h(f,p(Le.minheight,i),p(Le.maxheight,i))),re.stop().animate({width:d,height:f},b,function(){qe.removeClass(ub)}),cd(),Nd&&(ye.stop().animate({width:Le.nw},b),Rc({guessIndex:Je,time:b,keep:!0}),Od&&wc.nav&&Oc(b)),$d=c||!0,xd())),Se=re.offset().left,this},ie.setOptions=function(a){return d.extend(e,a),vd(),this},ie.shuffle=function(){return yd&&O(yd)&&vd(),this},ie.destroy=function(){return ie.cancelFullScreen(),ie.stopAutoplay(),yd=ie.data=null,j(),Ed=[],bd(Xc),vd.ok=!1,this},ie.playVideo=function(){var a=Dd,b=a.video,c=Je;return"object"==typeof b&&a.videoReady&&(Rd&&ie.fullScreen&&ie.cancelFullScreen(),G(function(){return!vc.is()||c!==Je},function(){c===Je&&(a.$video=a.$video||d(d.Fotorama.jst.video(b)),a.$video.appendTo(a[Xc]),qe.addClass(nb),Cd=a.$video,o(),we.blur(),De.blur(),fd("loadvideo"))})),this},ie.stopVideo=function(){return md(Cd,!0,!0),this},re.on("mousemove",od),Me=db(se,{onStart:gd,onMove:function(a,b){ld(re,b.edge)},onTouchEnd:hd,onEnd:function(a){ld(re);var b=(Nc&&!ge||a.touch)&&e.arrows&&"always"!==e.arrows;if(a.moved||b&&a.pos!==a.newPos&&!a.control){var c=s(a.newPos,Le.w,e.margin,Fd);ie.show({index:c,time:Sd?Vd:a.time,overPos:a.overPos,user:!0})}else a.aborted||a.control||qd(a.startEvent,b)},timeLow:1,timeHigh:1,friction:2,select:"."+Xb+", ."+Xb+" *",$wrap:re}),Oe=db(ze,{onStart:gd,onMove:function(a,b){ld(ye,b.edge)},onTouchEnd:hd,onEnd:function(a){function b(){Rc.l=a.newPos,id(),jd(),uc(a.newPos,!0)}if(a.moved)a.pos!==a.newPos?(ce=!0,_(ze,{time:a.time,pos:a.newPos,overPos:a.overPos,onEnd:b}),uc(a.newPos),Xd&&ld(ye,K(a.newPos,Oe.min,Oe.max))):b();else{var c=a.$target.closest("."+Mb,ze)[0];c&&sd.call(c,a.startEvent)}},timeLow:.5,timeHigh:2,friction:5,$wrap:ye}),Ne=eb(re,{shift:!0,onEnd:function(a,b){gd(),hd(),ie.show({index:b,slow:a.altKey})}}),Pe=eb(ye,{onEnd:function(a,b){gd(),hd();var c=v(ze)+.25*b;ze.css(k(h(c,Oe.min,Oe.max))),Xd&&ld(ye,K(c,Oe.min,Oe.max)),Pe.prevent={"<":c>=Oe.max,">":c<=Oe.min},clearTimeout(Pe.t),Pe.t=setTimeout(function(){Rc.l=c,uc(c,!0)},Pc),uc(c)}}),qe.hover(function(){setTimeout(function(){fe||nd(!(ge=!0))},0)},function(){ge&&nd(!(ge=!1))}),M(we,function(a){Y(a),td.call(this,a)},{onStart:function(){gd(),Me.control=!0},onTouchEnd:hd}),we.each(function(){W(this,function(a){td.call(this,a)}), ud(this)}),W(Ee,ie.toggleFullScreen),ud(Ee),d.each("load push pop shift unshift reverse sort splice".split(" "),function(a,b){ie[b]=function(){return yd=yd||[],"load"!==b?Array.prototype[b].apply(yd,arguments):arguments[0]&&"object"==typeof arguments[0]&&arguments[0].length&&(yd=P(arguments[0])),vd(),ie}}),vd()},d.fn.fotorama=function(b){return this.each(function(){var c=this,e=d(this),f=e.data(),g=f.fotorama;g?g.setOptions(b,!0):G(function(){return!E(c)},function(){f.urtext=e.html(),new d.Fotorama(e,d.extend({},cd,a.fotoramaDefaults,b,f))})})},d.Fotorama.instances=[],d.Fotorama.cache={},d.Fotorama.measures={},d=d||{},d.Fotorama=d.Fotorama||{},d.Fotorama.jst=d.Fotorama.jst||{},d.Fotorama.jst.style=function(a){var b,c="";return tc.escape,c+=".fotorama"+(null==(b=a.s)?"":b)+" .fotorama__nav--thumbs .fotorama__nav__frame{\npadding:"+(null==(b=a.m)?"":b)+"px;\nheight:"+(null==(b=a.h)?"":b)+"px}\n.fotorama"+(null==(b=a.s)?"":b)+" .fotorama__thumb-border{\nheight:"+(null==(b=a.h-a.b*(a.q?0:2))?"":b)+"px;\nborder-width:"+(null==(b=a.b)?"":b)+"px;\nmargin-top:"+(null==(b=a.m)?"":b)+"px}"},d.Fotorama.jst.video=function(a){function b(){c+=d.call(arguments,"")}var c="",d=(tc.escape,Array.prototype.join);return c+='<div class="fotorama__video"><iframe src="',b(("youtube"==a.type?a.p+"youtube.com/embed/"+a.id+"?autoplay=1":"vimeo"==a.type?a.p+"player.vimeo.com/video/"+a.id+"?autoplay=1&badge=0":a.id)+(a.s&&"custom"!=a.type?"&"+a.s:"")),c+='" frameborder="0" allowfullscreen></iframe></div>\n'},d(function(){d("."+ib+':not([data-auto="false"])').fotorama()})}(window,document,location,"undefined"!=typeof jQuery&&jQuery),function($){var F=$.fancybox;F.helpers.buttons={defaults:{skipSingle:!1,position:"top",tpl:'<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'},list:null,buttons:null,beforeLoad:function(opts,obj){return opts.skipSingle&&obj.group.length<2?(obj.helpers.buttons=!1,void(obj.closeBtn=!0)):void(obj.margin["bottom"===opts.position?2:0]+=30)},onPlayStart:function(){this.buttons&&this.buttons.play.attr("title","Pause slideshow").addClass("btnPlayOn")},onPlayEnd:function(){this.buttons&&this.buttons.play.attr("title","Start slideshow").removeClass("btnPlayOn")},afterShow:function(opts,obj){var buttons=this.buttons;buttons||(this.list=$(opts.tpl).addClass(opts.position).appendTo("body"),buttons={prev:this.list.find(".btnPrev").click(F.prev),next:this.list.find(".btnNext").click(F.next),play:this.list.find(".btnPlay").click(F.play),toggle:this.list.find(".btnToggle").click(F.toggle),close:this.list.find(".btnClose").click(F.close)}),obj.index>0||obj.loop?buttons.prev.removeClass("btnDisabled"):buttons.prev.addClass("btnDisabled"),obj.loop||obj.index<obj.group.length-1?(buttons.next.removeClass("btnDisabled"),buttons.play.removeClass("btnDisabled")):(buttons.next.addClass("btnDisabled"),buttons.play.addClass("btnDisabled")),this.buttons=buttons,this.onUpdate(opts,obj)},onUpdate:function(opts,obj){var toggle;this.buttons&&(toggle=this.buttons.toggle.removeClass("btnDisabled btnToggleOn"),obj.canShrink?toggle.addClass("btnToggleOn"):obj.canExpand||toggle.addClass("btnDisabled"))},beforeClose:function(){this.list&&this.list.remove(),this.list=null,this.buttons=null}}}(jQuery),function($){"use strict";var F=$.fancybox,format=function(url,rez,params){return params=params||"","object"===$.type(params)&&(params=$.param(params,!0)),$.each(rez,function(key,value){url=url.replace("$"+key,value||"")}),params.length&&(url+=(url.indexOf("?")>0?"&":"?")+params),url};F.helpers.media={defaults:{youtube:{matcher:/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"opaque",enablejsapi:1},type:"iframe",url:"//www.youtube.com/embed/$3"},vimeo:{matcher:/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},type:"iframe",url:"//player.vimeo.com/video/$1"},metacafe:{matcher:/metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,params:{autoPlay:"yes"},type:"swf",url:function(rez,params,obj){return obj.swf.flashVars="playerVars="+$.param(params,!0),"//www.metacafe.com/fplayer/"+rez[1]+"/.swf"}},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:"swf",url:"//www.dailymotion.com/swf/video/$1"},twitvid:{matcher:/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,params:{autoplay:0},type:"iframe",url:"//www.twitvid.com/embed.php?guid=$1"},twitpic:{matcher:/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,type:"image",url:"//twitpic.com/show/full/$1/"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},google_maps:{matcher:/maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,type:"iframe",url:function(rez){return"//maps.google."+rez[1]+"/"+rez[3]+rez[4]+"&output="+(rez[4].indexOf("layer=c")>0?"svembed":"embed")}}},beforeLoad:function(opts,obj){var what,item,rez,params,url=obj.href||"",type=!1;for(what in opts)if(opts.hasOwnProperty(what)&&(item=opts[what],rez=url.match(item.matcher))){type=item.type,params=$.extend(!0,{},item.params,obj[what]||($.isPlainObject(opts[what])?opts[what].params:null)),url="function"===$.type(item.url)?item.url.call(this,rez,params,obj):format(item.url,rez,params);break}type&&(obj.href=url,obj.type=type,obj.autoHeight=!1)}}}(jQuery),function($){var F=$.fancybox;F.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(item){var href;return item.element&&(href=$(item.element).find("img").attr("src")),!href&&"image"===item.type&&item.href&&(href=item.href),href}},wrap:null,list:null,width:0,init:function(opts,obj){var list,that=this,thumbWidth=opts.width,thumbHeight=opts.height,thumbSource=opts.source;list="";for(var n=0;n<obj.group.length;n++)list+='<li><a style="width:'+thumbWidth+"px;height:"+thumbHeight+'px;" href="javascript:jQuery.fancybox.jumpto('+n+');"></a></li>';this.wrap=$('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo("body"),this.list=$("<ul>"+list+"</ul>").appendTo(this.wrap),$.each(obj.group,function(i){var href=thumbSource(obj.group[i]);href&&$("<img />").load(function(){var widthRatio,heightRatio,parent,width=this.width,height=this.height;that.list&&width&&height&&(widthRatio=width/thumbWidth,heightRatio=height/thumbHeight,parent=that.list.children().eq(i).find("a"),widthRatio>=1&&heightRatio>=1&&(widthRatio>heightRatio?(width=Math.floor(width/heightRatio),height=thumbHeight):(width=thumbWidth,height=Math.floor(height/widthRatio))),$(this).css({width:width,height:height,top:Math.floor(thumbHeight/2-height/2),left:Math.floor(thumbWidth/2-width/2)}),parent.width(thumbWidth).height(thumbHeight),$(this).hide().appendTo(parent).fadeIn(300))}).attr("src",href)}),this.width=this.list.children().eq(0).outerWidth(!0),this.list.width(this.width*(obj.group.length+1)).css("left",Math.floor(.5*$(window).width()-(obj.index*this.width+.5*this.width)))},beforeLoad:function(opts,obj){return obj.group.length<2?void(obj.helpers.thumbs=!1):void(obj.margin["top"===opts.position?0:2]+=opts.height+15)},afterShow:function(opts,obj){this.list?this.onUpdate(opts,obj):this.init(opts,obj),this.list.children().removeClass("active").eq(obj.index).addClass("active")},onUpdate:function(opts,obj){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*$(window).width()-(obj.index*this.width+.5*this.width))},150)},beforeClose:function(){this.wrap&&this.wrap.remove(),this.wrap=null,this.list=null,this.width=0}}}(jQuery),!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,g,h,e=this;if(e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<span data-role="none" class="slick-prev"><i class="icon"></i></span>',nextArrow:'<span data-role="none" class="slick-next"><i class="icon"></i></span>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'<button type="button" data-role="none">'+(b+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,g=e.options.responsive||null,g&&g.length>-1){e.respondTo=e.options.respondTo||"window";for(h in g)g.hasOwnProperty(h)&&(e.breakpoints.push(g[h].breakpoint),e.breakpointSettings[g[h].breakpoint]=g[h].settings);e.breakpoints.sort(function(a,b){return e.options.mobileFirst===!0?a-b:b-a})}"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.init(),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=null!==c.options.asNavFor?a(c.options.asNavFor).slick("getSlick"):null;null!==d&&d.slideHandler(b,!0)},b.prototype.applyTransition=function(a){var b=this,c={};c[b.transitionType]=b.options.fade===!1?b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:"opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow=a(b.options.prevArrow),b.$nextArrow=a(b.options.nextArrow),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.appendTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled"))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="'+b.options.dotsClass+'">',c=0;c<=b.getDotCount();c+=1)d+="<li>"+b.options.customPaging.call(this,b,c)+"</li>";d+="</ul>",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),b.$slidesCache=b.$slides,b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.options.accessibility===!0&&b.$list.prop("tabIndex",0),b.setSlideClasses("number"==typeof this.currentSlide?this.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.html(e),a.$slider.children().children().children().width(100/a.options.slidesPerRow+"%").css({display:"inline-block"})}},b.prototype.checkResponsive=function(b){var d,e,f,c=this,g=c.$slider.width(),h=window.innerWidth||a(window).width();if("window"===c.respondTo?f=h:"slider"===c.respondTo?f=g:"min"===c.respondTo&&(f=Math.min(h,g)),c.originalSettings.responsive&&c.originalSettings.responsive.length>-1&&null!==c.originalSettings.responsive){e=null;for(d in c.breakpoints)c.breakpoints.hasOwnProperty(d)&&(c.originalSettings.mobileFirst===!1?f<c.breakpoints[d]&&(e=c.breakpoints[d]):f>c.breakpoints[d]&&(e=c.breakpoints[d]));null!==e?null!==c.activeBreakpoint?e!==c.activeBreakpoint&&(c.activeBreakpoint=e,"unslick"===c.breakpointSettings[e]?c.unslick():(c.options=a.extend({},c.originalSettings,c.breakpointSettings[e]),b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh())):(c.activeBreakpoint=e,"unslick"===c.breakpointSettings[e]?c.unslick():(c.options=a.extend({},c.originalSettings,c.breakpointSettings[e]),b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh())):null!==c.activeBreakpoint&&(c.activeBreakpoint=null,c.options=c.originalSettings,b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh())}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),h=0!==d.slideCount%d.options.slidesToScroll,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||a(b.target).parent().index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c);break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).off("click.slick",b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).off("mouseenter.slick",b.setPaused.bind(b,!0)).off("mouseleave.slick",b.setPaused.bind(b,!1)),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),b.options.autoplay===!0&&a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",b.setPaused.bind(b,!0)),b.$list.off("mouseleave.slick",b.setPaused.bind(b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(){var b=this;b.autoPlayClear(),b.touchObject={},b.cleanUpEvents(),a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&"object"!=typeof b.options.prevArrow&&b.$prevArrow.remove(),b.$nextArrow&&"object"!=typeof b.options.nextArrow&&b.$nextArrow.remove(),b.$slides&&(b.$slides.removeClass("slick-slide slick-active slick-center slick-visible").attr("aria-hidden","true").removeAttr("data-slick-index").css({position:"",left:"",top:"",zIndex:"",opacity:"",width:""}),b.$slider.html(b.$slides)),b.cleanUpRows(),b.$slider.removeClass("slick-slider"),b.$slider.removeClass("slick-initialized")},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:1e3}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:1e3}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)d=Math.ceil(a.slideCount/a.options.slidesToScroll);else if(a.options.centerMode===!0)d=a.slideCount;else for(;b<a.slideCount;)++d,b=c+a.options.slidesToShow,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=-1*b.slideWidth*b.options.slidesToShow,e=-1*d*b.options.slidesToShow),0!==b.slideCount%b.options.slidesToScroll&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=-1*(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth,e=-1*(b.options.slidesToShow-(a-b.slideCount))*d):(b.slideOffset=-1*b.slideCount%b.options.slidesToScroll*b.slideWidth,e=-1*b.slideCount%b.options.slidesToScroll*d))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?-1*a*b.slideWidth+b.slideOffset:-1*a*d+e,b.options.variableWidth===!0&&(f=b.$slideTrack.children(".slick-slide").eq(b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?a:a+b.options.slidesToShow),c=f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.$slideTrack.children(".slick-slide").eq(b.options.infinite===!1?a:a+b.options.slidesToShow+1),c=f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?(e=a.slideCount-a.options.slidesToShow+1,a.options.centerMode===!0&&(e=a.slideCount)):(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(){var b=this;a(b.$slider).hasClass("slick-initialized")||(a(b.$slider).addClass("slick-initialized"),b.buildRows(),b.buildOut(),b.setProps(),b.startLoad(),b.loadSlider(),b.initializeEvents(),b.updateArrows(),b.updateDots()),b.$slider.trigger("init",[b])},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",b.setPaused.bind(b,!0)).on("mouseleave.slick",b.setPaused.bind(b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),b.options.autoplay===!0&&a(document).on(b.visibilityChange,b.visibility.bind(b)),b.$list.on("mouseenter.slick",b.setPaused.bind(b,!0)),b.$list.on("mouseleave.slick",b.setPaused.bind(b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange.bind(b)),a(window).on("resize.slick.slick-"+b.instanceUid,b.resize.bind(b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}})},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:1},200)},d.src=c,b.css({opacity:0}).attr("src",c).removeAttr("data-lazy").removeClass("slick-loading")})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(){var b=this,c=b.currentSlide;b.destroy(),a.extend(b,b.initials),b.init(),b.changeSlide({data:{message:"index",index:c}},!1)},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b])},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b); },b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=-1*b.slideWidth*d,a(e).css(b.options.rtl===!0?{position:"relative",right:c,top:0,zIndex:800,opacity:0}:{position:"relative",left:c,top:0,zIndex:800,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:900,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(a,b,c){var d=this;d.options[a]=b,c===!0&&(d.unload(),d.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;b.$slider.find(".slick-slide").removeClass("slick-active").attr("aria-hidden","true").removeClass("slick-center"),d=b.$slider.find(".slick-slide"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,b.autoPlayClear())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.$slider.find(".slick-slide").removeClass("slick-active").attr("aria-hidden","true"),c.$slides.eq(e).addClass("slick-active").attr("aria-hidden","false"),c.options.centerMode===!0&&(c.$slider.find(".slick-slide").removeClass("slick-center"),c.$slides.eq(e).addClass("slick-center")),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?0!==i.slideCount%i.options.slidesToScroll?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?0!==i.slideCount%i.options.slidesToScroll?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?i.fadeSlide(e,function(){i.postSlide(e)}):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.swipeLeft=b.options.vertical===!1?d+f*g:d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&"object"!=typeof b.options.prevArrow&&b.$prevArrow.remove(),b.$nextArrow&&"object"!=typeof b.options.nextArrow&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(){var a=this;a.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.options.infinite!==!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.removeClass("slick-disabled"),a.$nextArrow.removeClass("slick-disabled"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled"),a.$nextArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled"),a.$prevArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled"),a.$prevArrow.removeClass("slick-disabled")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):(a.paused=!1,a.autoPlay())},a.fn.slick=function(){var g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length,f=0;for(f;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}}),$(".js-parent-rub").click(function(){var pos=$(".js-parent-rub").position().left+$(".js-parent-rub").width();return $(".js-breadcrumbs-list").css("left",pos).toggle(),!1}),$("#callback-request-popup-form").submit(function(){return sendForm($(this),function(){$("#callback-request-popup-form").hide(),$(".success_response").show(),setTimeout(function(){$.fancybox.close()},1500)}),!1}),$("#callback-request-form").submit(function(){return sendForm($(this),function(){$("#callback-request-form").hide(),$(".success_response").show(),setTimeout(function(){$(".success_response").hide(),$("#callback-request-form").show()},2e3)}),!1}),$("#reg-link").click(function(){$("#entry-form").hide(),$("#registration-form").show()}),$("#entry-link").click(function(){$("#registration-form").hide(),$("#entry-form").show()}),$(".js-filter-toggle-btn.active").click(function(){return $(this).parent().find(".js-filter-toggle-section").slideToggle(),$(this).find(".filter-section__arrow-icon").toggleClass("down"),!1}),$(document).on("mouseenter",".master_content-icon.exist",function(e){var x=e.pageX+20,y=e.pageY-10,name=$(this).attr("data-nameLink");0==$(".tooltip").length&&$("body").prepend('<span class="tooltip" style="z-index:2;position:absolute;margin-left:'+x+"px;margin-top:"+y+'px">'+name+"</span>")}),$(document).on("mouseleave",".master_content-icon.exist",function(e){$(".tooltip").remove()}),$(".master_list").length>0){var busy=!1,page=1;$(window).scroll(function(){var masterList=$(".master_list");$(window).height()+$(window).scrollTop()>=masterList.offset().top+masterList.height()&&!busy&&(busy=!0,page++,jQuery.ajax({url:masterList.attr("data-url"),type:masterList.attr("data-method"),dataType:"json",data:{page:page},beforeSend:function(){$(".master_list__preloader").show()},success:function(response){if(1==response.success){var card="";response.content.forEach(function(entry){card+='<div class="master_list__item">'+entry+"</div>"}),$(".master_list__preloader").before(card),$(".master_list__preloader").hide(),master_minicard_preload(),servicesCut(),busy=!1}else $(".master_list__preloader").hide()}}))})}servicesCut(),$(window).resize(function(){var width=$(window).width();750>=width&&servicesCut()}),master_minicard_preload(),$(document).on("mouseenter",".js-content-icon-switch.exist",function(){var current=$(this).attr("data-toggle");$(this).parents(".master_presentation").find(".active").removeClass("active").end().find(".master_have-content-widget_"+current).addClass("active"),$(this).addClass("active")}),$(document).on("click",".js-services-toggle",function(){return $(this).hide(),$(this).parents(".master_minicard").find(".master_services").slideDown(),$(this).parent().find(".master_photo-and-contacts__to-page")&&$(this).parent().find(".master_photo-and-contacts__to-page").css("display","block"),!1}),$(".master_recommended__slider").slick({dots:!1,infinite:!1,speed:700,slidesToShow:4,slidesToScroll:3}),$("#recovery-password-form").submit(function(){return sendForm($(this),function(response){$("#recovery-password-form").html('<p class="recovery-password-block__success-msg">Пароль выслан на указанный телефон и Email</p>')},function(response){$(".capcha__code-img img").remove(),$(".capcha__code-img").append('<img alt="capcha" src="'+response.capcha_url+'">')}),!1}),$(".capcha__reload-link a").click(function(){return jQuery.ajax({url:$(this).attr("href"),type:"get",dataType:"json",success:function(response){response.url&&($(".capcha__code-img img").remove(),$(".capcha__code-img").append('<img alt="capcha" src="'+response.url+'">'))}}),!1}),$(".js-open-video").fancybox({type:"iframe",padding:0,helpers:{overlay:{locked:!1}}}),function(w,doc){if(!w.__utlWdgt){w.__utlWdgt=!0;var d=doc,s=d.createElement("script"),g="getElementsByTagName";s.type="text/javascript",s.charset="UTF-8",s.async=!0,s.src=("https:"==w.location.protocol?"https":"http")+"://w.uptolike.com/widgets/v1/uptolike.js";var h=d[g]("body")[0];h.appendChild(s)}}(window,document),$(".dop-function-block-js").click(function(){$(this).parent().find("ul").toggleClass("dop-function-block-uncollapse")}),$(".js-find-master").click(function(){return $(this).parent().find(".catalogs").is(":hidden")?($(this).parent().find(".catalogs").show(),!1):void 0}),$(window).on("scroll",function(){$(window).scrollTop()>145?$(".js-arrive_block-fix").addClass("arrive_block_fix"):$(".js-arrive_block-fix").removeClass("arrive_block_fix")}),$(".js-contacts-show").click(function(){$(this).hide(),$(this).parent().find(".js-contacts-content").show(),yandexGoal_showPhone($(this).attr("data-id"))}),$(".js-callback-popup").click(function(){var form=$(".callback_popup");form.length>0&&$.fancybox.open(form,{padding:0})}),$(".js-open-map").fancybox({padding:0}),$(window).on("scroll",function(){$(window).scrollTop()>460?$(".js-menu-fix").addClass("master_page_menu_fix"):$(".js-menu-fix").removeClass("master_page_menu_fix")}),$(".master_page_menu__link").on("click",function(){$(".master_page_menu__link").removeClass("master_page_menu__link_active"),$(this).addClass("master_page_menu__link_active")}),$(".photo_slider").fotorama({allowfullscreen:!0,nav:"thumbs",width:"100%",height:500}),$(".js-photo-album").click(function(){var photo=$(".master_page_photo"),id=$(this).attr("data-id"),container=$("#album"+id+" .photo_slider");""==$.trim(container.html())&&jQuery.ajax({url:photo.attr("data-url"),type:photo.attr("data-method"),dataType:"html",data:{id:id},success:function(response){container.html(response)}}),$(this).parents(".master_page_photo").find(".master_page_photo__album_content").hide(),$(this).siblings().removeClass("active"),$(this).toggleClass("active"),$(".js-photo-album").hasClass("active")&&$("#album"+id).show()}),$("#feedback-form").submit(function(){return sendForm($(this),function(response){$("#feedback-form").html('<p class="feedback-block__success-msg">Ваше сообщение отправленно</p>')}),!1}),$(".js-present-competition-work").click(function(){var current=$(this).attr("href"),photos=[];$(current).find(".js-present-competition-work-photo").each(function(){var photo={};photo.href=$(this).attr("src"),photo.title=$(this).attr("alt"),photos.push(photo)}),$.fancybox.open(photos,{prevEffect:"none",nextEffect:"none",helpers:{title:{type:"inside"},thumbs:{width:50,height:50,position:"top"}}})}),$(".js-present-competition-vote").click(function(){var id=$(this).parent().attr("data-id");return jQuery.ajax({url:$(this).attr("href"),type:"get",dataType:"json",data:{id:id},success:function(response){response.count&&($(".js-present-competition-vote").hide(),$('[data-id="'+id+'"]').find(".present_competition_member__score").html(response.count),$(".js-present-competition-score").show())}}),!1}),$(".js-present-competition-vote").parents(".voted")&&($(".js-present-competition-vote").hide(),$(".js-present-competition-score").show()),$(".faq__item-title").click(function(){$(this).parent().toggleClass("faq__item_uncollapse")}),$(".form__form").submit(function(){var form=$(this);return sendForm(form,function(response){form.html("<p>Вы успешно зарегистрированны, сейчас вы будете перенаправлены в личный кабинет.</p>")}),!1}),$(".more-page__item").click(function(){$(this).toggleClass("more-page__item_uncollapse")}),$("#horizontalTab").easyResponsiveTabs({type:"default",width:"auto",tabidentify:"hor_1"}),$(".js-rubrika-list").click(function(){$(this).parent().find(".rubrika-list__list").toggle()}),$(".js-rubrika-collapsed").click(function(){var cl="master-rubrikator-page",cl_col=cl+"_collapsed",el=$(".master-rubrikator-page");el.hasClass(cl_col)?(el.removeClass(cl_col),$(".rubrika-list__list").show(),$(this).find(".rubrika-list__name").html("Свернуть все рубрики").end().find(".rubrika-list__icon").addClass("rubrika-list__icon_rotate")):(el.addClass(cl_col),$(".rubrika-list__list").hide(),$(this).find(".rubrika-list__name").html("Развернуть все рубрики").end().find(".rubrika-list__icon").removeClass("rubrika-list__icon_rotate"))}),$(document).on("click",".js-show-phone",function(){$(this).hide().parent().find(".js-show-phone_details").show(),tellAboutUs($(this),".master_photo-and-contacts__contact-wrap"),yandexGoal_showPhone($(this).attr("data-id"))}),tellAboutUs=function(el,parent){var tip=el.parents(parent).find(".js-tip");tip.show(),setTimeout(function(){tip.hide()},5e3)},$(".js-close-tip").click(function(){$(this).parent(".js-tip").hide()}),$(window).scroll(function(){$(this).scrollTop()>300?$(".js-to-top").css("display","block"):$(".js-to-top").hide()}),$(".js-to-top").click(function(){return $("body,html").animate({scrollTop:0},1e3),!1}),$("#comment_form").submit(function(){return sendForm($(this),function(){$(".comment__fields").hide(),$(".comment__success").show(),setTimeout(function(){$(".comment__success").hide(),$(".comment__fields").show()},3e3)}),!1});
client/src/containers/Layout/Layout.js
JaredHawkins/TweetGeoViz
import React, { Component } from 'react'; class Layout extends Component { render() { return ( <div className="container"> {this.props.children} </div> ); } } export default Layout;
docs/app/Examples/modules/Accordion/index.js
shengnian/shengnian-ui-react
import React from 'react' import Advanced from './Advanced' import Types from './Types' import Variations from './Variations' import Usage from './Usage' const AccordionExamples = () => ( <div> <Types /> <Variations /> <Usage /> <Advanced /> </div> ) export default AccordionExamples
ajax/libs/mediaelement/2.0.0/jquery.js
ZDroid/cdnjs
/*! * jQuery JavaScript Library v1.4.4 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu Nov 11 19:04:53 2010 -0500 */ (function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, "`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, "margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| [];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== 1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, "__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== "object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, [y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, "")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, "<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== "object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", [b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", 3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| 1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
ajax/libs/core-js/0.9.9/core.js
steadiest/cdnjs
/** * Core.js 0.9.9 * https://github.com/zloirock/core-js * License: http://rock.mit-license.org * © 2015 Denis Pushkarev */ !function(undefined){ 'use strict'; var __e = null, __g = null; /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(48); __webpack_require__(2); __webpack_require__(3); __webpack_require__(4); __webpack_require__(5); __webpack_require__(6); __webpack_require__(7); __webpack_require__(8); __webpack_require__(9); __webpack_require__(10); __webpack_require__(11); __webpack_require__(12); __webpack_require__(13); __webpack_require__(14); __webpack_require__(15); __webpack_require__(16); __webpack_require__(17); __webpack_require__(18); __webpack_require__(19); __webpack_require__(20); __webpack_require__(21); __webpack_require__(22); __webpack_require__(23); __webpack_require__(24); __webpack_require__(25); __webpack_require__(26); __webpack_require__(27); __webpack_require__(28); __webpack_require__(29); __webpack_require__(30); __webpack_require__(31); __webpack_require__(32); __webpack_require__(33); __webpack_require__(34); __webpack_require__(35); __webpack_require__(36); __webpack_require__(37); __webpack_require__(38); __webpack_require__(39); __webpack_require__(40); __webpack_require__(41); __webpack_require__(42); __webpack_require__(43); __webpack_require__(44); __webpack_require__(45); __webpack_require__(46); __webpack_require__(47); __webpack_require__(1); __webpack_require__(49); __webpack_require__(50); __webpack_require__(51); __webpack_require__(52); __webpack_require__(53); __webpack_require__(54); __webpack_require__(55); __webpack_require__(56); __webpack_require__(57); __webpack_require__(58); __webpack_require__(59); __webpack_require__(60); __webpack_require__(61); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , $def = __webpack_require__(65) , assign = __webpack_require__(76) , keyOf = __webpack_require__(73) , ITER = __webpack_require__(68).safe('iter') , assert = __webpack_require__(69) , $iter = __webpack_require__(79) , forOf = __webpack_require__(87) , step = $iter.step , getKeys = $.getKeys , toObject = $.toObject , has = $.has; function Dict(iterable){ var dict = $.create(null); if(iterable != undefined){ if($iter.is(iterable)){ forOf(iterable, true, function(key, value){ dict[key] = value; }); } else assign(dict, iterable); } return dict; } Dict.prototype = null; function DictIterator(iterated, kind){ $.set(this, ITER, {o: toObject(iterated), a: getKeys(iterated), i: 0, k: kind}); } $iter.create(DictIterator, 'Dict', function(){ var iter = this[ITER] , O = iter.o , keys = iter.a , kind = iter.k , key; do { if(iter.i >= keys.length){ iter.o = undefined; return step(1); } } while(!has(O, key = keys[iter.i++])); if(kind == 'keys' )return step(0, key); if(kind == 'values')return step(0, O[key]); return step(0, [key, O[key]]); }); function createDictIter(kind){ return function(it){ return new DictIterator(it, kind); }; } function generic(A, B){ // strange IE quirks mode bug -> use typeof instead of isFunction return typeof A == 'function' ? A : B; } // 0 -> Dict.forEach // 1 -> Dict.map // 2 -> Dict.filter // 3 -> Dict.some // 4 -> Dict.every // 5 -> Dict.find // 6 -> Dict.findKey // 7 -> Dict.mapPairs function createDictMethod(TYPE){ var IS_MAP = TYPE == 1 , IS_EVERY = TYPE == 4; return function(object, callbackfn, that /* = undefined */){ var f = ctx(callbackfn, that, 3) , O = toObject(object) , result = IS_MAP || TYPE == 7 || TYPE == 2 ? new (generic(this, Dict)) : undefined , key, val, res; for(key in O)if(has(O, key)){ val = O[key]; res = f(val, key, object); if(TYPE){ if(IS_MAP)result[key] = res; // map else if(res)switch(TYPE){ case 2: result[key] = val; break; // filter case 3: return true; // some case 5: return val; // find case 6: return key; // findKey case 7: result[res[0]] = res[1]; // mapPairs } else if(IS_EVERY)return false; // every } } return TYPE == 3 || IS_EVERY ? IS_EVERY : result; }; } // true -> Dict.turn // false -> Dict.reduce function createDictReduce(IS_TURN){ return function(object, mapfn, init){ assert.fn(mapfn); var O = toObject(object) , keys = getKeys(O) , length = keys.length , i = 0 , memo, key, result; if(IS_TURN){ memo = init == undefined ? new (generic(this, Dict)) : Object(init); } else if(arguments.length < 3){ assert(length, 'Reduce of empty object with no initial value'); memo = O[keys[i++]]; } else memo = Object(init); while(length > i)if(has(O, key = keys[i++])){ result = mapfn(memo, O[key], key, object); if(IS_TURN){ if(result === false)break; } else memo = result; } return memo; }; } var findKey = createDictMethod(6); $def($def.G + $def.F, {Dict: $.mix(Dict, { keys: createDictIter('keys'), values: createDictIter('values'), entries: createDictIter('entries'), forEach: createDictMethod(0), map: createDictMethod(1), filter: createDictMethod(2), some: createDictMethod(3), every: createDictMethod(4), find: createDictMethod(5), findKey: findKey, mapPairs: createDictMethod(7), reduce: createDictReduce(false), turn: createDictReduce(true), keyOf: keyOf, includes: function(object, el){ return (el == el ? keyOf(object, el) : findKey(object, function(it){ return it != it; })) !== undefined; }, // Has / get / set own property has: has, get: function(object, key){ if(has(object, key))return object[key]; }, set: $.def, isDict: function(it){ return $.isObject(it) && $.getProto(it) === Dict.prototype; } })}); /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // ECMAScript 6 symbols shim var $ = __webpack_require__(62) , setTag = __webpack_require__(64).set , uid = __webpack_require__(68) , $def = __webpack_require__(65) , keyOf = __webpack_require__(73) , enumKeys = __webpack_require__(74) , assertObject = __webpack_require__(69).obj , has = $.has , $create = $.create , getDesc = $.getDesc , setDesc = $.setDesc , desc = $.desc , getNames = $.getNames , toObject = $.toObject , $Symbol = $.g.Symbol , setter = false , TAG = uid('tag') , HIDDEN = uid('hidden') , _propertyIsEnumerable = {}.propertyIsEnumerable , SymbolRegistry = {} , AllSymbols = {} , useNative = $.isFunction($Symbol); function wrap(tag){ var sym = AllSymbols[tag] = $.set($create($Symbol.prototype), TAG, tag); $.DESC && setter && setDesc(Object.prototype, tag, { configurable: true, set: function(value){ if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setDesc(this, tag, desc(1, value)); } }); return sym; } function defineProperty(it, key, D){ if(D && has(AllSymbols, key)){ if(!D.enumerable){ if(!has(it, HIDDEN))setDesc(it, HIDDEN, desc(1, {})); it[HIDDEN][key] = true; } else { if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; D = $create(D, {enumerable: desc(0, false)}); } } return setDesc(it, key, D); } function defineProperties(it, P){ assertObject(it); var keys = enumKeys(P = toObject(P)) , i = 0 , l = keys.length , key; while(l > i)defineProperty(it, key = keys[i++], P[key]); return it; } function create(it, P){ return P === undefined ? $create(it) : defineProperties($create(it), P); } function propertyIsEnumerable(key){ var E = _propertyIsEnumerable.call(this, key); return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; } function getOwnPropertyDescriptor(it, key){ var D = getDesc(it = toObject(it), key); if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; return D; } function getOwnPropertyNames(it){ var names = getNames(toObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); return result; } function getOwnPropertySymbols(it){ var names = getNames(toObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); return result; } // 19.4.1.1 Symbol([description]) if(!useNative){ $Symbol = function Symbol(description){ if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor'); return wrap(uid(description)); }; $.hide($Symbol.prototype, 'toString', function(){ return this[TAG]; }); $.create = create; $.setDesc = defineProperty; $.getDesc = getOwnPropertyDescriptor; $.setDescs = defineProperties; $.getNames = getOwnPropertyNames; $.getSymbols = getOwnPropertySymbols; if($.DESC && $.FW)$.hide(Object.prototype, 'propertyIsEnumerable', propertyIsEnumerable); } var symbolStatics = { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(key){ return keyOf(SymbolRegistry, key); }, useSetter: function(){ setter = true; }, useSimple: function(){ setter = false; } }; // 19.4.2.2 Symbol.hasInstance // 19.4.2.3 Symbol.isConcatSpreadable // 19.4.2.4 Symbol.iterator // 19.4.2.6 Symbol.match // 19.4.2.8 Symbol.replace // 19.4.2.9 Symbol.search // 19.4.2.10 Symbol.species // 19.4.2.11 Symbol.split // 19.4.2.12 Symbol.toPrimitive // 19.4.2.13 Symbol.toStringTag // 19.4.2.14 Symbol.unscopables $.each.call(( 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + 'species,split,toPrimitive,toStringTag,unscopables' ).split(','), function(it){ var sym = __webpack_require__(75)(it); symbolStatics[it] = useNative ? sym : wrap(sym); } ); setter = true; $def($def.G + $def.W, {Symbol: $Symbol}); $def($def.S, 'Symbol', symbolStatics); $def($def.S + $def.F * !useNative, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: getOwnPropertySymbols }); // 19.4.3.5 Symbol.prototype[@@toStringTag] setTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setTag($.g.JSON, 'JSON', true); /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $def = __webpack_require__(65); $def($def.S, 'Object', {assign: __webpack_require__(76)}); /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.10 Object.is(value1, value2) var $def = __webpack_require__(65); $def($def.S, 'Object', { is: function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; } }); /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) var $def = __webpack_require__(65); $def($def.S, 'Object', {setPrototypeOf: __webpack_require__(77).set}); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 19.1.3.6 Object.prototype.toString() var $ = __webpack_require__(62) , cof = __webpack_require__(64) , src = String({}.toString) , tmp = {}; function toString(){ return '[object ' + cof.classof(this) + ']'; } // lodash uses String(Object.prototype.toString) in isNative toString.toString = function(){ return src; }; tmp[__webpack_require__(75)('toStringTag')] = 'z'; if($.FW && cof(tmp) != 'z')$.hide(Object.prototype, 'toString', toString); /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , isObject = $.isObject , toObject = $.toObject; $.each.call(('freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,' + 'getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames').split(',') , function(KEY, ID){ var fn = ($.core.Object || {})[KEY] || Object[KEY] , forced = 0 , method = {}; method[KEY] = ID == 0 ? function freeze(it){ return isObject(it) ? fn(it) : it; } : ID == 1 ? function seal(it){ return isObject(it) ? fn(it) : it; } : ID == 2 ? function preventExtensions(it){ return isObject(it) ? fn(it) : it; } : ID == 3 ? function isFrozen(it){ return isObject(it) ? fn(it) : true; } : ID == 4 ? function isSealed(it){ return isObject(it) ? fn(it) : true; } : ID == 5 ? function isExtensible(it){ return isObject(it) ? fn(it) : false; } : ID == 6 ? function getOwnPropertyDescriptor(it, key){ return fn(toObject(it), key); } : ID == 7 ? function getPrototypeOf(it){ return fn(Object($.assertDefined(it))); } : ID == 8 ? function keys(it){ return fn(toObject(it)); } : function getOwnPropertyNames(it){ return fn(toObject(it)); }; try { fn('z'); } catch(e){ forced = 1; } $def($def.S + $def.F * forced, 'Object', method); }); /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , NAME = 'name' , setDesc = $.setDesc , FunctionProto = Function.prototype; // 19.2.4.2 name NAME in FunctionProto || $.FW && $.DESC && setDesc(FunctionProto, NAME, { configurable: true, get: function(){ var match = String(this).match(/^\s*function ([^ (]*)/) , name = match ? match[1] : ''; $.has(this, NAME) || setDesc(this, NAME, $.desc(5, name)); return name; }, set: function(value){ $.has(this, NAME) || setDesc(this, NAME, $.desc(0, value)); } }); /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , HAS_INSTANCE = __webpack_require__(75)('hasInstance') , FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O){ if(!$.isFunction(this) || !$.isObject(O))return false; if(!$.isObject(this.prototype))return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while(O = $.getProto(O))if(this.prototype === O)return true; return false; }}); /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , isObject = $.isObject , isFunction = $.isFunction , NUMBER = 'Number' , $Number = $.g[NUMBER] , Base = $Number , proto = $Number.prototype; function toPrimitive(it){ var fn, val; if(isFunction(fn = it.valueOf) && !isObject(val = fn.call(it)))return val; if(isFunction(fn = it.toString) && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to number"); } function toNumber(it){ if(isObject(it))it = toPrimitive(it); if(typeof it == 'string' && it.length > 2 && it.charCodeAt(0) == 48){ var binary = false; switch(it.charCodeAt(1)){ case 66 : case 98 : binary = true; case 79 : case 111 : return parseInt(it.slice(2), binary ? 2 : 8); } } return +it; } if($.FW && !($Number('0o1') && $Number('0b1'))){ $Number = function Number(it){ return this instanceof $Number ? new Base(toNumber(it)) : toNumber(it); }; $.each.call($.DESC ? $.getNames(Base) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES6 (in case, if modules with ES6 Number statics required before): 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' ).split(','), function(key){ if($.has(Base, key) && !$.has($Number, key)){ $.setDesc($Number, key, $.getDesc(Base, key)); } } ); $Number.prototype = proto; proto.constructor = $Number; $.hide($.g, NUMBER, $Number); } /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , abs = Math.abs , floor = Math.floor , _isFinite = $.g.isFinite , MAX_SAFE_INTEGER = 0x1fffffffffffff; // pow(2, 53) - 1 == 9007199254740991; function isInteger(it){ return !$.isObject(it) && _isFinite(it) && floor(it) === it; } $def($def.S, 'Number', { // 20.1.2.1 Number.EPSILON EPSILON: Math.pow(2, -52), // 20.1.2.2 Number.isFinite(number) isFinite: function isFinite(it){ return typeof it == 'number' && _isFinite(it); }, // 20.1.2.3 Number.isInteger(number) isInteger: isInteger, // 20.1.2.4 Number.isNaN(number) isNaN: function isNaN(number){ return number != number; }, // 20.1.2.5 Number.isSafeInteger(number) isSafeInteger: function isSafeInteger(number){ return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER; }, // 20.1.2.6 Number.MAX_SAFE_INTEGER MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, // 20.1.2.10 Number.MIN_SAFE_INTEGER MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER, // 20.1.2.12 Number.parseFloat(string) parseFloat: parseFloat, // 20.1.2.13 Number.parseInt(string, radix) parseInt: parseInt }); /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { var Infinity = 1 / 0 , $def = __webpack_require__(65) , E = Math.E , pow = Math.pow , abs = Math.abs , exp = Math.exp , log = Math.log , sqrt = Math.sqrt , ceil = Math.ceil , floor = Math.floor , EPSILON = pow(2, -52) , EPSILON32 = pow(2, -23) , MAX32 = pow(2, 127) * (2 - EPSILON32) , MIN32 = pow(2, -126); function roundTiesToEven(n){ return n + 1 / EPSILON - 1 / EPSILON; } // 20.2.2.28 Math.sign(x) function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; } // 20.2.2.5 Math.asinh(x) function asinh(x){ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1)); } // 20.2.2.14 Math.expm1(x) function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; } $def($def.S, 'Math', { // 20.2.2.3 Math.acosh(x) acosh: function acosh(x){ return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x; }, // 20.2.2.5 Math.asinh(x) asinh: asinh, // 20.2.2.7 Math.atanh(x) atanh: function atanh(x){ return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2; }, // 20.2.2.9 Math.cbrt(x) cbrt: function cbrt(x){ return sign(x = +x) * pow(abs(x), 1 / 3); }, // 20.2.2.11 Math.clz32(x) clz32: function clz32(x){ return (x >>>= 0) ? 31 - floor(log(x + 0.5) * Math.LOG2E) : 32; }, // 20.2.2.12 Math.cosh(x) cosh: function cosh(x){ return (exp(x = +x) + exp(-x)) / 2; }, // 20.2.2.14 Math.expm1(x) expm1: expm1, // 20.2.2.16 Math.fround(x) fround: function fround(x){ var $abs = abs(x) , $sign = sign(x) , a, result; if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); if(result > MAX32 || result != result)return $sign * Infinity; return $sign * result; }, // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars var sum = 0 , len1 = arguments.length , len2 = len1 , args = Array(len1) , larg = 0 , arg; while(len1--){ arg = args[len1] = abs(arguments[len1]); if(arg == Infinity)return Infinity; if(arg > larg)larg = arg; } larg = larg || 1; while(len2--)sum += pow(args[len2] / larg, 2); return larg * sqrt(sum); }, // 20.2.2.18 Math.imul(x, y) imul: function imul(x, y){ var UInt16 = 0xffff , xn = +x , yn = +y , xl = UInt16 & xn , yl = UInt16 & yn; return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0); }, // 20.2.2.20 Math.log1p(x) log1p: function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x); }, // 20.2.2.21 Math.log10(x) log10: function log10(x){ return log(x) / Math.LN10; }, // 20.2.2.22 Math.log2(x) log2: function log2(x){ return log(x) / Math.LN2; }, // 20.2.2.28 Math.sign(x) sign: sign, // 20.2.2.30 Math.sinh(x) sinh: function sinh(x){ return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2); }, // 20.2.2.33 Math.tanh(x) tanh: function tanh(x){ var a = expm1(x = +x) , b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); }, // 20.2.2.34 Math.trunc(x) trunc: function trunc(it){ return (it > 0 ? floor : ceil)(it); } }); /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65) , toIndex = __webpack_require__(62).toIndex , fromCharCode = String.fromCharCode , $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $def($def.S + $def.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars var res = [] , len = arguments.length , i = 0 , code; while(len > i){ code = +arguments[i++]; if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65); $def($def.S, 'String', { // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function raw(callSite){ var tpl = $.toObject(callSite.raw) , len = $.toLength(tpl.length) , sln = arguments.length , res = [] , i = 0; while(len > i){ res.push(String(tpl[i++])); if(i < sln)res.push(String(arguments[i])); } return res.join(''); } }); /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { var set = __webpack_require__(62).set , $at = __webpack_require__(78)(true) , ITER = __webpack_require__(68).safe('iter') , $iter = __webpack_require__(79) , step = $iter.step; // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(80)(String, 'String', function(iterated){ set(this, ITER, {o: String(iterated), i: 0}); // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , index = iter.i , point; if(index >= O.length)return step(1); point = $at(O, index); iter.i += point.length; return step(0, point); }); /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(65) , $at = __webpack_require__(78)(false); $def($def.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos){ return $at(this, pos); } }); /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , cof = __webpack_require__(64) , $def = __webpack_require__(65) , toLength = $.toLength; // should throw error on regex $def($def.P + $def.F * !__webpack_require__(72)(function(){ 'q'.endsWith(/./); }), 'String', { // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) endsWith: function endsWith(searchString /*, endPosition = @length */){ if(cof(searchString) == 'RegExp')throw TypeError(); var that = String($.assertDefined(this)) , endPosition = arguments[1] , len = toLength(that.length) , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); searchString += ''; return that.slice(end - searchString.length, end) === searchString; } }); /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , cof = __webpack_require__(64) , $def = __webpack_require__(65); $def($def.P, 'String', { // 21.1.3.7 String.prototype.includes(searchString, position = 0) includes: function includes(searchString /*, position = 0 */){ if(cof(searchString) == 'RegExp')throw TypeError(); return !!~String($.assertDefined(this)).indexOf(searchString, arguments[1]); } }); /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65); $def($def.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: __webpack_require__(81) }); /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , cof = __webpack_require__(64) , $def = __webpack_require__(65); // should throw error on regex $def($def.P + $def.F * !__webpack_require__(72)(function(){ 'q'.startsWith(/./); }), 'String', { // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) startsWith: function startsWith(searchString /*, position = 0 */){ if(cof(searchString) == 'RegExp')throw TypeError(); var that = String($.assertDefined(this)) , index = $.toLength(Math.min(arguments[1], that.length)); searchString += ''; return that.slice(index, index + searchString.length) === searchString; } }); /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , $def = __webpack_require__(65) , $iter = __webpack_require__(79) , call = __webpack_require__(83); $def($def.S + $def.F * !__webpack_require__(84)(function(iter){ Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ var O = Object($.assertDefined(arrayLike)) , mapfn = arguments[1] , mapping = mapfn !== undefined , f = mapping ? ctx(mapfn, arguments[2], 2) : undefined , index = 0 , length, result, step, iterator; if($iter.is(O)){ iterator = $iter.get(O); // strange IE quirks mode bug -> use typeof instead of isFunction result = new (typeof this == 'function' ? this : Array); for(; !(step = iterator.next()).done; index++){ result[index] = mapping ? call(iterator, f, [step.value, index], true) : step.value; } } else { // strange IE quirks mode bug -> use typeof instead of isFunction result = new (typeof this == 'function' ? this : Array)(length = $.toLength(O.length)); for(; length > index; index++){ result[index] = mapping ? f(O[index], index) : O[index]; } } result.length = index; return result; } }); /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65); $def($def.S, 'Array', { // 22.1.2.3 Array.of( ...items) of: function of(/* ...args */){ var index = 0 , length = arguments.length // strange IE quirks mode bug -> use typeof instead of isFunction , result = new (typeof this == 'function' ? this : Array)(length); while(length > index)result[index] = arguments[index++]; result.length = length; return result; } }); /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , setUnscope = __webpack_require__(85) , ITER = __webpack_require__(68).safe('iter') , $iter = __webpack_require__(79) , step = $iter.step , Iterators = $iter.Iterators; // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() __webpack_require__(80)(Array, 'Array', function(iterated, kind){ $.set(this, ITER, {o: $.toObject(iterated), i: 0, k: kind}); // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , kind = iter.k , index = iter.i++; if(!O || index >= O.length){ iter.o = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; setUnscope('keys'); setUnscope('values'); setUnscope('entries'); /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(86)(Array); /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65) , toIndex = $.toIndex; $def($def.P, 'Array', { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) copyWithin: function copyWithin(target/* = 0 */, start /* = 0, end = @length */){ var O = Object($.assertDefined(this)) , len = $.toLength(O.length) , to = toIndex(target, len) , from = toIndex(start, len) , end = arguments[2] , fin = end === undefined ? len : toIndex(end, len) , count = Math.min(fin - from, len - to) , inc = 1; if(from < to && to < from + count){ inc = -1; from = from + count - 1; to = to + count - 1; } while(count-- > 0){ if(from in O)O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; } }); __webpack_require__(85)('copyWithin'); /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65) , toIndex = $.toIndex; $def($def.P, 'Array', { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) fill: function fill(value /*, start = 0, end = @length */){ var O = Object($.assertDefined(this)) , length = $.toLength(O.length) , index = toIndex(arguments[1], length) , end = arguments[2] , endPos = end === undefined ? length : toIndex(end, length); while(endPos > index)O[index++] = value; return O; } }); __webpack_require__(85)('fill'); /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var KEY = 'find' , $def = __webpack_require__(65) , forced = true , $find = __webpack_require__(67)(5); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { find: function find(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(85)(KEY); /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var KEY = 'findIndex' , $def = __webpack_require__(65) , forced = true , $find = __webpack_require__(67)(6); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { findIndex: function findIndex(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(85)(KEY); /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , cof = __webpack_require__(64) , $RegExp = $.g.RegExp , Base = $RegExp , proto = $RegExp.prototype , re = /a/g // "new" creates a new object , CORRECT_NEW = new $RegExp(re) !== re // RegExp allows a regex with flags as the pattern , ALLOWS_RE_WITH_FLAGS = function(){ try { return $RegExp(re, 'i') == '/a/i'; } catch(e){ /* empty */ } }(); if($.FW && $.DESC){ if(!CORRECT_NEW || !ALLOWS_RE_WITH_FLAGS){ $RegExp = function RegExp(pattern, flags){ var patternIsRegExp = cof(pattern) == 'RegExp' , flagsIsUndefined = flags === undefined; if(!(this instanceof $RegExp) && patternIsRegExp && flagsIsUndefined)return pattern; return CORRECT_NEW ? new Base(patternIsRegExp && !flagsIsUndefined ? pattern.source : pattern, flags) : new Base(patternIsRegExp ? pattern.source : pattern , patternIsRegExp && flagsIsUndefined ? pattern.flags : flags); }; $.each.call($.getNames(Base), function(key){ key in $RegExp || $.setDesc($RegExp, key, { configurable: true, get: function(){ return Base[key]; }, set: function(it){ Base[key] = it; } }); }); proto.constructor = $RegExp; $RegExp.prototype = proto; $.hide($.g, 'RegExp', $RegExp); } // 21.2.5.3 get RegExp.prototype.flags() if(/./g.flags != 'g')$.setDesc(proto, 'flags', { configurable: true, get: __webpack_require__(71)(/^.*\/(\w*)$/, '$1') }); } __webpack_require__(86)($RegExp); /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , cof = __webpack_require__(64) , $def = __webpack_require__(65) , assert = __webpack_require__(69) , forOf = __webpack_require__(87) , setProto = __webpack_require__(77).set , species = __webpack_require__(86) , SPECIES = __webpack_require__(75)('species') , RECORD = __webpack_require__(68).safe('record') , PROMISE = 'Promise' , global = $.g , process = global.process , asap = process && process.nextTick || __webpack_require__(88).set , P = global[PROMISE] , isFunction = $.isFunction , isObject = $.isObject , assertFunction = assert.fn , assertObject = assert.obj; var useNative = function(){ var test, works = false; function P2(x){ var self = new P(x); setProto(self, P2.prototype); return self; } try { works = isFunction(P) && isFunction(P.resolve) && P.resolve(test = new P(function(){})) == test; setProto(P2, P); P2.prototype = $.create(P.prototype, {constructor: {value: P2}}); // actual Firefox has broken subclass support, test that if(!(P2.resolve(5).then(function(){}) instanceof P2)){ works = false; } } catch(e){ works = false; } return works; }(); // helpers function getConstructor(C){ var S = assertObject(C)[SPECIES]; return S != undefined ? S : C; } function isThenable(it){ var then; if(isObject(it))then = it.then; return isFunction(then) ? then : false; } function notify(record){ var chain = record.c; if(chain.length)asap(function(){ var value = record.v , ok = record.s == 1 , i = 0; function run(react){ var cb = ok ? react.ok : react.fail , ret, then; try { if(cb){ if(!ok)record.h = true; ret = cb === true ? value : cb(value); if(ret === react.P){ react.rej(TypeError('Promise-chain cycle')); } else if(then = isThenable(ret)){ then.call(ret, react.res, react.rej); } else react.res(ret); } else react.rej(value); } catch(err){ react.rej(err); } } while(chain.length > i)run(chain[i++]); // variable length - can't use forEach chain.length = 0; }); } function isUnhandled(promise){ var record = promise[RECORD] , chain = record.a || record.c , i = 0 , react; if(record.h)return false; while(chain.length > i){ react = chain[i++]; if(react.fail || !isUnhandled(react.P))return false; } return true; } function $reject(value){ var record = this , promise; if(record.d)return; record.d = true; record = record.r || record; // unwrap record.v = value; record.s = 2; record.a = record.c.slice(); setTimeout(function(){ asap(function(){ if(isUnhandled(promise = record.p)){ if(cof(process) == 'process'){ process.emit('unhandledRejection', value, promise); } else if(global.console && isFunction(console.error)){ console.error('Unhandled promise rejection', value); } } record.a = undefined; }); }, 1); notify(record); } function $resolve(value){ var record = this , then, wrapper; if(record.d)return; record.d = true; record = record.r || record; // unwrap try { if(then = isThenable(value)){ wrapper = {r: record, d: false}; // wrap then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } else { record.v = value; record.s = 1; notify(record); } } catch(err){ $reject.call(wrapper || {r: record, d: false}, err); // wrap } } // constructor polyfill if(!useNative){ // 25.4.3.1 Promise(executor) P = function Promise(executor){ assertFunction(executor); var record = { p: assert.inst(this, P, PROMISE), // <- promise c: [], // <- awaiting reactions a: undefined, // <- checked in isUnhandled reactions s: 0, // <- state d: false, // <- done v: undefined, // <- value h: false // <- handled rejection }; $.hide(this, RECORD, record); try { executor(ctx($resolve, record, 1), ctx($reject, record, 1)); } catch(err){ $reject.call(record, err); } }; $.mix(P.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected){ var S = assertObject(assertObject(this).constructor)[SPECIES]; var react = { ok: isFunction(onFulfilled) ? onFulfilled : true, fail: isFunction(onRejected) ? onRejected : false }; var promise = react.P = new (S != undefined ? S : P)(function(res, rej){ react.res = assertFunction(res); react.rej = assertFunction(rej); }); var record = this[RECORD]; record.c.push(react); if(record.a)record.a.push(react); record.s && notify(record); return promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function(onRejected){ return this.then(undefined, onRejected); } }); } // export $def($def.G + $def.W + $def.F * !useNative, {Promise: P}); cof.set(P, PROMISE); species(P); species($.core[PROMISE]); // for wrapper // statics $def($def.S + $def.F * !useNative, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r){ return new (getConstructor(this))(function(res, rej){ rej(r); }); }, // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x){ return isObject(x) && RECORD in x && $.getProto(x) === this.prototype ? x : new (getConstructor(this))(function(res){ res(x); }); } }); $def($def.S + $def.F * !(useNative && __webpack_require__(84)(function(iter){ P.all(iter)['catch'](function(){}); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable){ var C = getConstructor(this) , values = []; return new C(function(res, rej){ forOf(iterable, false, values.push, values); var remaining = values.length , results = Array(remaining); if(remaining)$.each.call(values, function(promise, index){ C.resolve(promise).then(function(value){ results[index] = value; --remaining || res(results); }, rej); }); else res(results); }); }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable){ var C = getConstructor(this); return new C(function(res, rej){ forOf(iterable, false, function(promise){ C.resolve(promise).then(res, rej); }); }); } }); /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(89); // 23.1 Map Objects __webpack_require__(90)('Map', { // 23.1.3.6 Map.prototype.get(key) get: function get(key){ var entry = strong.getEntry(this, key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(89); // 23.2 Set Objects __webpack_require__(90)('Set', { // 23.2.3.1 Set.prototype.add(value) add: function add(value){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , weak = __webpack_require__(91) , leakStore = weak.leakStore , ID = weak.ID , WEAK = weak.WEAK , has = $.has , isObject = $.isObject , isFrozen = Object.isFrozen || $.core.Object.isFrozen , tmp = {}; // 23.3 WeakMap Objects var WeakMap = __webpack_require__(90)('WeakMap', { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key){ if(isObject(key)){ if(isFrozen(key))return leakStore(this).get(key); if(has(key, WEAK))return key[WEAK][this[ID]]; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value){ return weak.def(this, key, value); } }, weak, true, true); // IE11 WeakMap frozen keys fix if($.FW && new WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ $.each.call(['delete', 'has', 'get', 'set'], function(key){ var method = WeakMap.prototype[key]; WeakMap.prototype[key] = function(a, b){ // store frozen objects on leaky map if(isObject(a) && isFrozen(a)){ var result = leakStore(this)[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }; }); } /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var weak = __webpack_require__(91); // 23.4 WeakSet Objects __webpack_require__(90)('WeakSet', { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value){ return weak.def(this, value, true); } }, weak, false, true); /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , setProto = __webpack_require__(77) , $iter = __webpack_require__(79) , ITERATOR = __webpack_require__(75)('iterator') , ITER = __webpack_require__(68).safe('iter') , step = $iter.step , assert = __webpack_require__(69) , isObject = $.isObject , getProto = $.getProto , $Reflect = $.g.Reflect , _apply = Function.apply , assertObject = assert.obj , _isExtensible = Object.isExtensible || $.isObject , _preventExtensions = Object.preventExtensions || $.it // IE TP has broken Reflect.enumerate , buggyEnumerate = !($Reflect && $Reflect.enumerate && ITERATOR in $Reflect.enumerate({})); function Enumerate(iterated){ $.set(this, ITER, {o: iterated, k: undefined, i: 0}); } $iter.create(Enumerate, 'Object', function(){ var iter = this[ITER] , keys = iter.k , key; if(keys == undefined){ iter.k = keys = []; for(key in iter.o)keys.push(key); } do { if(iter.i >= keys.length)return step(1); } while(!((key = keys[iter.i++]) in iter.o)); return step(0, key); }); var reflect = { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) apply: function apply(target, thisArgument, argumentsList){ return _apply.call(target, thisArgument, argumentsList); }, // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) construct: function construct(target, argumentsList /*, newTarget*/){ var proto = assert.fn(arguments.length < 3 ? target : arguments[2]).prototype , instance = $.create(isObject(proto) ? proto : Object.prototype) , result = _apply.call(target, instance, argumentsList); return isObject(result) ? result : instance; }, // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) defineProperty: function defineProperty(target, propertyKey, attributes){ assertObject(target); try { $.setDesc(target, propertyKey, attributes); return true; } catch(e){ return false; } }, // 26.1.4 Reflect.deleteProperty(target, propertyKey) deleteProperty: function deleteProperty(target, propertyKey){ var desc = $.getDesc(assertObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; }, // 26.1.6 Reflect.get(target, propertyKey [, receiver]) get: function get(target, propertyKey/*, receiver*/){ var receiver = arguments.length < 3 ? target : arguments[2] , desc = $.getDesc(assertObject(target), propertyKey), proto; if(desc)return $.has(desc, 'value') ? desc.value : desc.get === undefined ? undefined : desc.get.call(receiver); return isObject(proto = getProto(target)) ? get(proto, propertyKey, receiver) : undefined; }, // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ return $.getDesc(assertObject(target), propertyKey); }, // 26.1.8 Reflect.getPrototypeOf(target) getPrototypeOf: function getPrototypeOf(target){ return getProto(assertObject(target)); }, // 26.1.9 Reflect.has(target, propertyKey) has: function has(target, propertyKey){ return propertyKey in target; }, // 26.1.10 Reflect.isExtensible(target) isExtensible: function isExtensible(target){ return _isExtensible(assertObject(target)); }, // 26.1.11 Reflect.ownKeys(target) ownKeys: __webpack_require__(92), // 26.1.12 Reflect.preventExtensions(target) preventExtensions: function preventExtensions(target){ assertObject(target); try { _preventExtensions(target); return true; } catch(e){ return false; } }, // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) set: function set(target, propertyKey, V/*, receiver*/){ var receiver = arguments.length < 4 ? target : arguments[3] , ownDesc = $.getDesc(assertObject(target), propertyKey) , existingDescriptor, proto; if(!ownDesc){ if(isObject(proto = getProto(target))){ return set(proto, propertyKey, V, receiver); } ownDesc = $.desc(0); } if($.has(ownDesc, 'value')){ if(ownDesc.writable === false || !isObject(receiver))return false; existingDescriptor = $.getDesc(receiver, propertyKey) || $.desc(0); existingDescriptor.value = V; $.setDesc(receiver, propertyKey, existingDescriptor); return true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } }; // 26.1.14 Reflect.setPrototypeOf(target, proto) if(setProto)reflect.setPrototypeOf = function setPrototypeOf(target, proto){ setProto.check(target, proto); try { setProto.set(target, proto); return true; } catch(e){ return false; } }; $def($def.G, {Reflect: {}}); $def($def.S + $def.F * buggyEnumerate, 'Reflect', { // 26.1.5 Reflect.enumerate(target) enumerate: function enumerate(target){ return new Enumerate(assertObject(target)); } }); $def($def.S, 'Reflect', reflect); /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/domenic/Array.prototype.includes var $def = __webpack_require__(65) , $includes = __webpack_require__(70)(true); $def($def.P, 'Array', { includes: function includes(el /*, fromIndex = 0 */){ return $includes(this, el, arguments[1]); } }); __webpack_require__(85)('includes'); /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/mathiasbynens/String.prototype.at 'use strict'; var $def = __webpack_require__(65) , $at = __webpack_require__(78)(true); $def($def.P, 'String', { at: function at(pos){ return $at(this, pos); } }); /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(65) , $pad = __webpack_require__(93); $def($def.P, 'String', { lpad: function lpad(n){ return $pad(this, n, arguments[1], true); } }); /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(65) , $pad = __webpack_require__(93); $def($def.P, 'String', { rpad: function rpad(n){ return $pad(this, n, arguments[1], false); } }); /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { // https://gist.github.com/kangax/9698100 var $def = __webpack_require__(65); $def($def.S, 'RegExp', { escape: __webpack_require__(71)(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true) }); /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { // https://gist.github.com/WebReflection/9353781 var $ = __webpack_require__(62) , $def = __webpack_require__(65) , ownKeys = __webpack_require__(92); $def($def.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ var O = $.toObject(object) , result = {}; $.each.call(ownKeys(O), function(key){ $.setDesc(result, key, $.desc(0, $.getDesc(O, key))); }); return result; } }); /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { // http://goo.gl/XkBrjD var $ = __webpack_require__(62) , $def = __webpack_require__(65); function createObjectToArray(isEntries){ return function(object){ var O = $.toObject(object) , keys = $.getKeys(O) , length = keys.length , i = 0 , result = Array(length) , key; if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]]; else while(length > i)result[i] = O[keys[i++]]; return result; }; } $def($def.S, 'Object', { values: createObjectToArray(false), entries: createObjectToArray(true) }); /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON __webpack_require__(94)('Map'); /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON __webpack_require__(94)('Set'); /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65) , $task = __webpack_require__(88); $def($def.G + $def.B, { setImmediate: $task.set, clearImmediate: $task.clear }); /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(23); var $ = __webpack_require__(62) , Iterators = __webpack_require__(79).Iterators , ITERATOR = __webpack_require__(75)('iterator') , ArrayValues = Iterators.Array , NodeList = $.g.NodeList; if($.FW && NodeList && !(ITERATOR in NodeList.prototype)){ $.hide(NodeList.prototype, ITERATOR, ArrayValues); } Iterators.NodeList = ArrayValues; /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { // ie9- setTimeout & setInterval additional parameters fix var $ = __webpack_require__(62) , $def = __webpack_require__(65) , invoke = __webpack_require__(66) , partial = __webpack_require__(95) , navigator = $.g.navigator , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check function wrap(set){ return MSIE ? function(fn, time /*, ...args */){ return set(invoke( partial, [].slice.call(arguments, 2), $.isFunction(fn) ? fn : Function(fn) ), time); } : set; } $def($def.G + $def.B + $def.F * MSIE, { setTimeout: wrap($.g.setTimeout), setInterval: wrap($.g.setInterval) }); /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , cel = __webpack_require__(63) , cof = __webpack_require__(64) , $def = __webpack_require__(65) , invoke = __webpack_require__(66) , arrayMethod = __webpack_require__(67) , IE_PROTO = __webpack_require__(68).safe('__proto__') , assert = __webpack_require__(69) , assertObject = assert.obj , ObjectProto = Object.prototype , html = $.html , A = [] , _slice = A.slice , _join = A.join , classof = cof.classof , has = $.has , defineProperty = $.setDesc , getOwnDescriptor = $.getDesc , defineProperties = $.setDescs , isFunction = $.isFunction , toObject = $.toObject , toLength = $.toLength , toIndex = $.toIndex , IE8_DOM_DEFINE = false , $indexOf = __webpack_require__(70)(false) , $forEach = arrayMethod(0) , $map = arrayMethod(1) , $filter = arrayMethod(2) , $some = arrayMethod(3) , $every = arrayMethod(4); if(!$.DESC){ try { IE8_DOM_DEFINE = defineProperty(cel('div'), 'x', {get: function(){ return 8; }} ).x == 8; } catch(e){ /* empty */ } $.setDesc = function(O, P, Attributes){ if(IE8_DOM_DEFINE)try { return defineProperty(O, P, Attributes); } catch(e){ /* empty */ } if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); if('value' in Attributes)assertObject(O)[P] = Attributes.value; return O; }; $.getDesc = function(O, P){ if(IE8_DOM_DEFINE)try { return getOwnDescriptor(O, P); } catch(e){ /* empty */ } if(has(O, P))return $.desc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); }; $.setDescs = defineProperties = function(O, Properties){ assertObject(O); var keys = $.getKeys(Properties) , length = keys.length , i = 0 , P; while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); return O; }; } $def($def.S + $def.F * !$.DESC, 'Object', { // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $.getDesc, // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) defineProperty: $.setDesc, // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) defineProperties: defineProperties }); // IE 8- don't enum bug keys var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + 'toLocaleString,toString,valueOf').split(',') // Additional keys for getOwnPropertyNames , keys2 = keys1.concat('length', 'prototype') , keysLen1 = keys1.length; // Create object with `null` prototype: use iframe Object with cleared prototype var createDict = function(){ // Thrash, waste and sodomy: IE GC bug var iframe = cel('iframe') , i = keysLen1 , gt = '>' , iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write('<script>document.F=Object</script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict.prototype[keys1[i]]; return createDict(); }; function createGetKeys(names, length){ return function(object){ var O = toObject(object) , i = 0 , result = [] , key; for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(length > i)if(has(O, key = names[i++])){ ~$indexOf(result, key) || result.push(key); } return result; }; } function isPrimitive(it){ return !$.isObject(it); } function Empty(){} $def($def.S, 'Object', { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) getPrototypeOf: $.getProto = $.getProto || function(O){ O = Object(assert.def(O)); if(has(O, IE_PROTO))return O[IE_PROTO]; if(isFunction(O.constructor) && O instanceof O.constructor){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }, // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true), // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) create: $.create = $.create || function(O, /*?*/Properties){ var result; if(O !== null){ Empty.prototype = assertObject(O); result = new Empty(); Empty.prototype = null; // add "__proto__" for Object.getPrototypeOf shim result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }, // 19.1.2.14 / 15.2.3.14 Object.keys(O) keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false), // 19.1.2.17 / 15.2.3.8 Object.seal(O) seal: $.it, // <- cap // 19.1.2.5 / 15.2.3.9 Object.freeze(O) freeze: $.it, // <- cap // 19.1.2.15 / 15.2.3.10 Object.preventExtensions(O) preventExtensions: $.it, // <- cap // 19.1.2.13 / 15.2.3.11 Object.isSealed(O) isSealed: isPrimitive, // <- cap // 19.1.2.12 / 15.2.3.12 Object.isFrozen(O) isFrozen: isPrimitive, // <- cap // 19.1.2.11 / 15.2.3.13 Object.isExtensible(O) isExtensible: $.isObject // <- cap }); // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) $def($def.P, 'Function', { bind: function(that /*, args... */){ var fn = assert.fn(this) , partArgs = _slice.call(arguments, 1); function bound(/* args... */){ var args = partArgs.concat(_slice.call(arguments)); return invoke(fn, args, this instanceof bound ? $.create(fn.prototype) : that); } if(fn.prototype)bound.prototype = fn.prototype; return bound; } }); // Fix for not array-like ES3 string and DOM objects if(!(0 in Object('z') && 'z'[0] == 'z')){ $.ES5Object = function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; } var buggySlice = true; try { if(html)_slice.call(html); buggySlice = false; } catch(e){ /* empty */ } $def($def.P + $def.F * buggySlice, 'Array', { slice: function slice(begin, end){ var len = toLength(this.length) , klass = cof(this); end = end === undefined ? len : end; if(klass == 'Array')return _slice.call(this, begin, end); var start = toIndex(begin, len) , upTo = toIndex(end, len) , size = toLength(upTo - start) , cloned = Array(size) , i = 0; for(; i < size; i++)cloned[i] = klass == 'String' ? this.charAt(start + i) : this[start + i]; return cloned; } }); $def($def.P + $def.F * ($.ES5Object != Object), 'Array', { join: function join(){ return _join.apply($.ES5Object(this), arguments); } }); // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) $def($def.S, 'Array', { isArray: function(arg){ return cof(arg) == 'Array'; } }); function createArrayReduce(isRight){ return function(callbackfn, memo){ assert.fn(callbackfn); var O = toObject(this) , length = toLength(O.length) , index = isRight ? length - 1 : 0 , i = isRight ? -1 : 1; if(arguments.length < 2)for(;;){ if(index in O){ memo = O[index]; index += i; break; } index += i; assert(isRight ? index >= 0 : length > index, 'Reduce of empty array with no initial value'); } for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ memo = callbackfn(memo, O[index], index, this); } return memo; }; } $def($def.P, 'Array', { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: $.each = $.each || function forEach(callbackfn/*, that = undefined */){ return $forEach(this, callbackfn, arguments[1]); }, // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: function map(callbackfn/*, that = undefined */){ return $map(this, callbackfn, arguments[1]); }, // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: function filter(callbackfn/*, that = undefined */){ return $filter(this, callbackfn, arguments[1]); }, // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: function some(callbackfn/*, that = undefined */){ return $some(this, callbackfn, arguments[1]); }, // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: function every(callbackfn/*, that = undefined */){ return $every(this, callbackfn, arguments[1]); }, // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: createArrayReduce(false), // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: createArrayReduce(true), // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: function indexOf(el /*, fromIndex = 0 */){ return $indexOf(this, el, arguments[1]); }, // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function(el, fromIndex /* = @[*-1] */){ var O = toObject(this) , length = toLength(O.length) , index = length - 1; if(arguments.length > 1)index = Math.min(index, $.toInteger(fromIndex)); if(index < 0)index = toLength(length + index); for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; return -1; } }); // 21.1.3.25 / 15.5.4.20 String.prototype.trim() $def($def.P, 'String', {trim: __webpack_require__(71)(/^\s*([\s\S]*\S)?\s*$/, '$1')}); // 20.3.3.1 / 15.9.4.4 Date.now() $def($def.S, 'Date', {now: function(){ return +new Date; }}); function lz(num){ return num > 9 ? num : '0' + num; } // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() // PhantomJS and old webkit had a broken Date implementation. var date = new Date(-5e13 - 1) , brokenDate = !(date.toISOString && date.toISOString() == '0385-07-25T07:06:39.999Z' && __webpack_require__(72)(function(){ new Date(NaN).toISOString(); })); $def($def.P + $def.F * brokenDate, 'Date', {toISOString: function(){ if(!isFinite(this))throw RangeError('Invalid time value'); var d = this , y = d.getUTCFullYear() , m = d.getUTCMilliseconds() , s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; }}); if(classof(function(){ return arguments; }()) == 'Object')cof.classof = function(it){ var tag = classof(it); return tag == 'Object' && isFunction(it.callee) ? 'Arguments' : tag; }; /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { var core = __webpack_require__(62).core , $iter = __webpack_require__(79); core.isIterable = $iter.is; core.getIterator = $iter.get; /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , safe = __webpack_require__(68).safe , $def = __webpack_require__(65) , $iter = __webpack_require__(79) , forOf = __webpack_require__(87) , ENTRIES = safe('entries') , FN = safe('fn') , ITER = safe('iter') , call = __webpack_require__(83) , getIterator = $iter.get , setIterator = $iter.set , createIterator = $iter.create; function $for(iterable, entries){ if(!(this instanceof $for))return new $for(iterable, entries); this[ITER] = getIterator(iterable); this[ENTRIES] = !!entries; } createIterator($for, 'Wrapper', function(){ return this[ITER].next(); }); var $forProto = $for.prototype; setIterator($forProto, function(){ return this[ITER]; // unwrap }); function createChainIterator(next){ function Iterator(iter, fn, that){ this[ITER] = getIterator(iter); this[ENTRIES] = iter[ENTRIES]; this[FN] = ctx(fn, that, iter[ENTRIES] ? 2 : 1); } createIterator(Iterator, 'Chain', next, $forProto); setIterator(Iterator.prototype, $.that); // override $forProto iterator return Iterator; } var MapIter = createChainIterator(function(){ var step = this[ITER].next(); return step.done ? step : $iter.step(0, call(this[ITER], this[FN], step.value, this[ENTRIES])); }); var FilterIter = createChainIterator(function(){ for(;;){ var step = this[ITER].next(); if(step.done || call(this[ITER], this[FN], step.value, this[ENTRIES]))return step; } }); $.mix($forProto, { of: function(fn, that){ forOf(this, this[ENTRIES], fn, that); }, array: function(fn, that){ var result = []; forOf(fn != undefined ? this.map(fn, that) : this, false, result.push, result); return result; }, filter: function(fn, that){ return new FilterIter(this, fn, that); }, map: function(fn, that){ return new MapIter(this, fn, that); } }); $for.isIterable = $iter.is; $for.getIterator = getIterator; $def($def.G + $def.F, {$for: $for}); /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , partial = __webpack_require__(95); // https://esdiscuss.org/topic/promise-returning-delay-function $def($def.G + $def.F, { delay: function(time){ return new ($.core.Promise || $.g.Promise)(function(resolve){ setTimeout(partial.call(resolve, true), time); }); } }); /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65); // Placeholder $.core._ = $.path._ = $.path._ || {}; $def($def.P + $def.F, 'Function', { part: __webpack_require__(95) }); /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , ownKeys = __webpack_require__(92); function define(target, mixin){ var keys = ownKeys($.toObject(mixin)) , length = keys.length , i = 0, key; while(length > i)$.setDesc(target, key = keys[i++], $.getDesc(mixin, key)); return target; } $def($def.S + $def.F, 'Object', { isObject: $.isObject, classof: __webpack_require__(64).classof, define: define, make: function(proto, mixin){ return define($.create(proto), mixin); } }); /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65) , assertFunction = __webpack_require__(69).fn; $def($def.P + $def.F, 'Array', { turn: function(fn, target /* = [] */){ assertFunction(fn); var memo = target == undefined ? [] : Object(target) , O = $.ES5Object(this) , length = $.toLength(O.length) , index = 0; while(length > index)if(fn(memo, O[index], index++, this) === false)break; return memo; } }); __webpack_require__(85)('turn'); /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , ITER = __webpack_require__(68).safe('iter'); __webpack_require__(80)(Number, 'Number', function(iterated){ $.set(this, ITER, {l: $.toLength(iterated), i: 0}); }, function(){ var iter = this[ITER] , i = iter.i++ , done = i >= iter.l; return {done: done, value: done ? undefined : i}; }); /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65) , invoke = __webpack_require__(66) , methods = {}; methods.random = function(lim /* = 0 */){ var a = +this , b = lim == undefined ? 0 : +lim , m = Math.min(a, b); return Math.random() * (Math.max(a, b) - m) + m; }; if($.FW)$.each.call(( // ES3: 'round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,' + // ES6: 'acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc' ).split(','), function(key){ var fn = Math[key]; if(fn)methods[key] = function(/* ...args */){ // ie9- dont support strict mode & convert `this` to object -> convert it to number var args = [+this] , i = 0; while(arguments.length > i)args.push(arguments[i++]); return invoke(fn, args); }; } ); $def($def.P + $def.F, 'Number', methods); /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65) , replacer = __webpack_require__(71); var escapeHTMLDict = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&apos;' }, unescapeHTMLDict = {}, key; for(key in escapeHTMLDict)unescapeHTMLDict[escapeHTMLDict[key]] = key; $def($def.P + $def.F, 'String', { escapeHTML: replacer(/[&<>"']/g, escapeHTMLDict), unescapeHTML: replacer(/&(?:amp|lt|gt|quot|apos);/g, unescapeHTMLDict) }); /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , core = $.core , formatRegExp = /\b\w\w?\b/g , flexioRegExp = /:(.*)\|(.*)$/ , locales = {} , current = 'en' , SECONDS = 'Seconds' , MINUTES = 'Minutes' , HOURS = 'Hours' , DATE = 'Date' , MONTH = 'Month' , YEAR = 'FullYear'; function lz(num){ return num > 9 ? num : '0' + num; } function createFormat(prefix){ return function(template, locale /* = current */){ var that = this , dict = locales[$.has(locales, locale) ? locale : current]; function get(unit){ return that[prefix + unit](); } return String(template).replace(formatRegExp, function(part){ switch(part){ case 's' : return get(SECONDS); // Seconds : 0-59 case 'ss' : return lz(get(SECONDS)); // Seconds : 00-59 case 'm' : return get(MINUTES); // Minutes : 0-59 case 'mm' : return lz(get(MINUTES)); // Minutes : 00-59 case 'h' : return get(HOURS); // Hours : 0-23 case 'hh' : return lz(get(HOURS)); // Hours : 00-23 case 'D' : return get(DATE); // Date : 1-31 case 'DD' : return lz(get(DATE)); // Date : 01-31 case 'W' : return dict[0][get('Day')]; // Day : Понедельник case 'N' : return get(MONTH) + 1; // Month : 1-12 case 'NN' : return lz(get(MONTH) + 1); // Month : 01-12 case 'M' : return dict[2][get(MONTH)]; // Month : Январь case 'MM' : return dict[1][get(MONTH)]; // Month : Января case 'Y' : return get(YEAR); // Year : 2014 case 'YY' : return lz(get(YEAR) % 100); // Year : 14 } return part; }); }; } function addLocale(lang, locale){ function split(index){ var result = []; $.each.call(locale.months.split(','), function(it){ result.push(it.replace(flexioRegExp, '$' + index)); }); return result; } locales[lang] = [locale.weekdays.split(','), split(1), split(2)]; return core; } $def($def.P + $def.F, DATE, { format: createFormat('get'), formatUTC: createFormat('getUTC') }); addLocale(current, { weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', months: 'January,February,March,April,May,June,July,August,September,October,November,December' }); addLocale('ru', { weekdays: 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота', months: 'Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,' + 'Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь' }); core.locale = function(locale){ return $.has(locales, locale) ? current = locale : current; }; core.addLocale = addLocale; /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65); $def($def.G + $def.F, {global: __webpack_require__(62).g}); /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , $def = __webpack_require__(65) , log = {} , enabled = true; // Methods from https://github.com/DeveloperToolsWG/console-object/blob/master/api.md $.each.call(('assert,clear,count,debug,dir,dirxml,error,exception,' + 'group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,' + 'markTimeline,profile,profileEnd,table,time,timeEnd,timeline,' + 'timelineEnd,timeStamp,trace,warn').split(','), function(key){ log[key] = function(){ if(enabled && $.g.console && $.isFunction(console[key])){ return Function.apply.call(console[key], console, arguments); } }; }); $def($def.G + $def.F, {log: __webpack_require__(76)(log.log, log, { enable: function(){ enabled = true; }, disable: function(){ enabled = false; } })}); /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { // JavaScript 1.6 / Strawman array statics shim var $ = __webpack_require__(62) , $def = __webpack_require__(65) , $Array = $.core.Array || Array , statics = {}; function setStatics(keys, length){ $.each.call(keys.split(','), function(key){ if(length == undefined && key in $Array)statics[key] = $Array[key]; else if(key in [])statics[key] = __webpack_require__(82)(Function.call, [][key], length); }); } setStatics('pop,reverse,shift,keys,values,entries', 1); setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + 'reduce,reduceRight,copyWithin,fill,turn'); $def($def.S, 'Array', statics); /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var global = typeof self != 'undefined' ? self : Function('return this')() , core = {} , defineProperty = Object.defineProperty , hasOwnProperty = {}.hasOwnProperty , ceil = Math.ceil , floor = Math.floor , max = Math.max , min = Math.min; // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty. var DESC = !!function(){ try { return defineProperty({}, 'a', {get: function(){ return 2; }}).a == 2; } catch(e){ /* empty */ } }(); var hide = createDefiner(1); // 7.1.4 ToInteger function toInteger(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); } function desc(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; } function simpleSet(object, key, value){ object[key] = value; return object; } function createDefiner(bitmap){ return DESC ? function(object, key, value){ return $.setDesc(object, key, desc(bitmap, value)); } : simpleSet; } function isObject(it){ return it !== null && (typeof it == 'object' || typeof it == 'function'); } function isFunction(it){ return typeof it == 'function'; } function assertDefined(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; } var $ = module.exports = __webpack_require__(96)({ g: global, core: core, html: global.document && document.documentElement, // http://jsperf.com/core-js-isobject isObject: isObject, isFunction: isFunction, it: function(it){ return it; }, that: function(){ return this; }, // 7.1.4 ToInteger toInteger: toInteger, // 7.1.15 ToLength toLength: function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }, toIndex: function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }, has: function(it, key){ return hasOwnProperty.call(it, key); }, create: Object.create, getProto: Object.getPrototypeOf, DESC: DESC, desc: desc, getDesc: Object.getOwnPropertyDescriptor, setDesc: defineProperty, setDescs: Object.defineProperties, getKeys: Object.keys, getNames: Object.getOwnPropertyNames, getSymbols: Object.getOwnPropertySymbols, assertDefined: assertDefined, // Dummy, fix for not array-like ES3 string in es5 module ES5Object: Object, toObject: function(it){ return $.ES5Object(assertDefined(it)); }, hide: hide, def: createDefiner(0), set: global.Symbol ? simpleSet : hide, mix: function(target, src){ for(var key in src)hide(target, key, src[key]); return target; }, each: [].forEach }); /* eslint-disable no-undef */ if(typeof __e != 'undefined')__e = core; if(typeof __g != 'undefined')__g = global; /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , document = $.g.document , isObject = $.isObject // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , TAG = __webpack_require__(75)('toStringTag') , toString = {}.toString; function cof(it){ return toString.call(it).slice(8, -1); } cof.classof = function(it){ var O, T; return it == undefined ? it === undefined ? 'Undefined' : 'Null' : typeof (T = (O = Object(it))[TAG]) == 'string' ? T : cof(O); }; cof.set = function(it, tag, stat){ if(it && !$.has(it = stat ? it : it.prototype, TAG))$.hide(it, TAG, tag); }; module.exports = cof; /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , global = $.g , core = $.core , isFunction = $.isFunction; function ctx(fn, that){ return function(){ return fn.apply(that, arguments); }; } global.core = core; // type bitmap $def.F = 1; // forced $def.G = 2; // global $def.S = 4; // static $def.P = 8; // proto $def.B = 16; // bind $def.W = 32; // wrap function $def(type, name, source){ var key, own, out, exp , isGlobal = type & $def.G , target = isGlobal ? global : type & $def.S ? global[name] : (global[name] || {}).prototype , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // contains in native own = !(type & $def.F) && target && key in target; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context if(type & $def.B && own)exp = ctx(out, global); else exp = type & $def.P && isFunction(out) ? ctx(Function.call, out) : out; // extend global if(target && !own){ if(isGlobal)target[key] = out; else delete target[key] && $.hide(target, key, out); } // export if(exports[key] != out)$.hide(exports, key, exp); } } module.exports = $def; /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { // Fast apply // http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; switch(args.length){ case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4]) : fn.call(that, args[0], args[1], args[2], args[3], args[4]); } return fn.apply(that, args); }; /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var $ = __webpack_require__(62) , ctx = __webpack_require__(82); module.exports = function(TYPE){ var IS_MAP = TYPE == 1 , IS_FILTER = TYPE == 2 , IS_SOME = TYPE == 3 , IS_EVERY = TYPE == 4 , IS_FIND_INDEX = TYPE == 6 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function($this, callbackfn, that){ var O = Object($.assertDefined($this)) , self = $.ES5Object(O) , f = ctx(callbackfn, that, 3) , length = $.toLength(self.length) , index = 0 , result = IS_MAP ? Array(length) : IS_FILTER ? [] : undefined , val, res; for(;length > index; index++)if(NO_HOLES || index in self){ val = self[index]; res = f(val, index, O); if(TYPE){ if(IS_MAP)result[index] = res; // map else if(res)switch(TYPE){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(IS_EVERY)return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { var sid = 0; function uid(key){ return 'Symbol(' + key + ')_' + (++sid + Math.random()).toString(36); } uid.safe = __webpack_require__(62).g.Symbol || uid; module.exports = uid; /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62); function assert(condition, msg1, msg2){ if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1); } assert.def = $.assertDefined; assert.fn = function(it){ if(!$.isFunction(it))throw TypeError(it + ' is not a function!'); return it; }; assert.obj = function(it){ if(!$.isObject(it))throw TypeError(it + ' is not an object!'); return it; }; assert.inst = function(it, Constructor, name){ if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); return it; }; module.exports = assert; /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var $ = __webpack_require__(62); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = $.toObject($this) , length = $.toLength(O.length) , index = $.toIndex(fromIndex, length) , value; if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; } else for(;length > index; index++)if(IS_INCLUDES || index in O){ if(O[index] === el)return IS_INCLUDES || index; } return !IS_INCLUDES && -1; }; }; /***/ }, /* 71 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = function(regExp, replace, isStatic){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; } : replace; return function(it){ return String(isStatic ? it : this).replace(regExp, replacer); }; }; /***/ }, /* 72 */ /***/ function(module, exports, __webpack_require__) { module.exports = function(exec){ try { exec(); return false; } catch(e){ return true; } }; /***/ }, /* 73 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62); module.exports = function(object, el){ var O = $.toObject(object) , keys = $.getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; /***/ }, /* 74 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62); module.exports = function(it){ var keys = $.getKeys(it) , getDesc = $.getDesc , getSymbols = $.getSymbols; if(getSymbols)$.each.call(getSymbols(it), function(key){ if(getDesc(it, key).enumerable)keys.push(key); }); return keys; }; /***/ }, /* 75 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(62).g , store = {}; module.exports = function(name){ return store[name] || (store[name] = global.Symbol && global.Symbol[name] || __webpack_require__(68).safe('Symbol.' + name)); }; /***/ }, /* 76 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , enumKeys = __webpack_require__(74); // 19.1.2.1 Object.assign(target, source, ...) /* eslint-disable no-unused-vars */ module.exports = Object.assign || function assign(target, source){ /* eslint-enable no-unused-vars */ var T = Object($.assertDefined(target)) , l = arguments.length , i = 1; while(l > i){ var S = $.ES5Object(arguments[i++]) , keys = enumKeys(S) , length = keys.length , j = 0 , key; while(length > j)T[key = keys[j++]] = S[key]; } return T; }; /***/ }, /* 77 */ /***/ function(module, exports, __webpack_require__) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var $ = __webpack_require__(62) , assert = __webpack_require__(69); function check(O, proto){ assert.obj(O); assert(proto === null || $.isObject(proto), proto, ": can't set as prototype!"); } module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} // eslint-disable-line ? function(buggy, set){ try { set = __webpack_require__(82)(Function.call, $.getDesc(Object.prototype, '__proto__').set, 2); set({}, []); } catch(e){ buggy = true; } return function setPrototypeOf(O, proto){ check(O, proto); if(buggy)O.__proto__ = proto; else set(O, proto); return O; }; }() : undefined), check: check }; /***/ }, /* 78 */ /***/ function(module, exports, __webpack_require__) { // true -> String#at // false -> String#codePointAt var $ = __webpack_require__(62); module.exports = function(TO_STRING){ return function(that, pos){ var s = String($.assertDefined(that)) , i = $.toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }, /* 79 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , cof = __webpack_require__(64) , assertObject = __webpack_require__(69).obj , SYMBOL_ITERATOR = __webpack_require__(75)('iterator') , FF_ITERATOR = '@@iterator' , Iterators = {} , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() setIterator(IteratorPrototype, $.that); function setIterator(O, value){ $.hide(O, SYMBOL_ITERATOR, value); // Add iterator for FF iterator protocol if(FF_ITERATOR in [])$.hide(O, FF_ITERATOR, value); } module.exports = { // Safari has buggy iterators w/o `next` BUGGY: 'keys' in [] && !('next' in [].keys()), Iterators: Iterators, step: function(done, value){ return {value: value, done: !!done}; }, is: function(it){ var O = Object(it) , Symbol = $.g.Symbol , SYM = Symbol && Symbol.iterator || FF_ITERATOR; return SYM in O || SYMBOL_ITERATOR in O || $.has(Iterators, cof.classof(O)); }, get: function(it){ var Symbol = $.g.Symbol , ext = it[Symbol && Symbol.iterator || FF_ITERATOR] , getIter = ext || it[SYMBOL_ITERATOR] || Iterators[cof.classof(it)]; return assertObject(getIter.call(it)); }, set: setIterator, create: function(Constructor, NAME, next, proto){ Constructor.prototype = $.create(proto || IteratorPrototype, {next: $.desc(1, next)}); cof.set(Constructor, NAME + ' Iterator'); } }; /***/ }, /* 80 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(65) , $ = __webpack_require__(62) , cof = __webpack_require__(64) , $iter = __webpack_require__(79) , SYMBOL_ITERATOR = __webpack_require__(75)('iterator') , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values' , Iterators = $iter.Iterators; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){ $iter.create(Constructor, NAME, next); function createMethod(kind){ function $$(that){ return new Constructor(that, kind); } switch(kind){ case KEYS: return function keys(){ return $$(this); }; case VALUES: return function values(){ return $$(this); }; } return function entries(){ return $$(this); }; } var TAG = NAME + ' Iterator' , proto = Base.prototype , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , _default = _native || createMethod(DEFAULT) , methods, key; // Fix native if(_native){ var IteratorPrototype = $.getProto(_default.call(new Base)); // Set @@toStringTag to native iterators cof.set(IteratorPrototype, TAG, true); // FF fix if($.FW && $.has(proto, FF_ITERATOR))$iter.set(IteratorPrototype, $.that); } // Define iterator if($.FW)$iter.set(proto, _default); // Plug for library Iterators[NAME] = _default; Iterators[TAG] = $.that; if(DEFAULT){ methods = { keys: IS_SET ? _default : createMethod(KEYS), values: DEFAULT == VALUES ? _default : createMethod(VALUES), entries: DEFAULT != VALUES ? _default : createMethod('entries') }; if(FORCE)for(key in methods){ if(!(key in proto))$.hide(proto, key, methods[key]); } else $def($def.P + $def.F * $iter.BUGGY, NAME, methods); } }; /***/ }, /* 81 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62); module.exports = function repeat(count){ var str = String($.assertDefined(this)) , res = '' , n = $.toInteger(count); if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; /***/ }, /* 82 */ /***/ function(module, exports, __webpack_require__) { // Optional / simple context binding var assertFunction = __webpack_require__(69).fn; module.exports = function(fn, that, length){ assertFunction(fn); if(~length && that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); }; case 2: return function(a, b){ return fn.call(that, a, b); }; case 3: return function(a, b, c){ return fn.call(that, a, b, c); }; } return function(/* ...args */){ return fn.apply(that, arguments); }; }; /***/ }, /* 83 */ /***/ function(module, exports, __webpack_require__) { var assertObject = __webpack_require__(69).obj; function close(iterator){ var ret = iterator['return']; if(ret !== undefined)assertObject(ret.call(iterator)); } function call(iterator, fn, value, entries){ try { return entries ? fn(assertObject(value)[0], value[1]) : fn(value); } catch(e){ close(iterator); throw e; } } call.close = close; module.exports = call; /***/ }, /* 84 */ /***/ function(module, exports, __webpack_require__) { var SYMBOL_ITERATOR = __webpack_require__(75)('iterator') , SAFE_CLOSING = false; try { var riter = [7][SYMBOL_ITERATOR](); riter['return'] = function(){ SAFE_CLOSING = true; }; Array.from(riter, function(){ throw 2; }); } catch(e){ /* empty */ } module.exports = function(exec){ if(!SAFE_CLOSING)return false; var safe = false; try { var arr = [7] , iter = arr[SYMBOL_ITERATOR](); iter.next = function(){ safe = true; }; arr[SYMBOL_ITERATOR] = function(){ return iter; }; exec(arr); } catch(e){ /* empty */ } return safe; }; /***/ }, /* 85 */ /***/ function(module, exports, __webpack_require__) { // 22.1.3.31 Array.prototype[@@unscopables] var $ = __webpack_require__(62) , UNSCOPABLES = __webpack_require__(75)('unscopables'); if($.FW && !(UNSCOPABLES in []))$.hide(Array.prototype, UNSCOPABLES, {}); module.exports = function(key){ if($.FW)[][UNSCOPABLES][key] = true; }; /***/ }, /* 86 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , SPECIES = __webpack_require__(75)('species'); module.exports = function(C){ if($.DESC && !(SPECIES in C))$.setDesc(C, SPECIES, { configurable: true, get: $.that }); }; /***/ }, /* 87 */ /***/ function(module, exports, __webpack_require__) { var ctx = __webpack_require__(82) , get = __webpack_require__(79).get , call = __webpack_require__(83); module.exports = function(iterable, entries, fn, that){ var iterator = get(iterable) , f = ctx(fn, that, entries ? 2 : 1) , step; while(!(step = iterator.next()).done){ if(call(iterator, f, step.value, entries) === false){ return call.close(iterator); } } }; /***/ }, /* 88 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , cof = __webpack_require__(64) , invoke = __webpack_require__(66) , cel = __webpack_require__(63) , global = $.g , isFunction = $.isFunction , html = $.html , process = global.process , setTask = global.setImmediate , clearTask = global.clearImmediate , postMessage = global.postMessage , addEventListener = global.addEventListener , MessageChannel = global.MessageChannel , counter = 0 , queue = {} , ONREADYSTATECHANGE = 'onreadystatechange' , defer, channel, port; function run(){ var id = +this; if($.has(queue, id)){ var fn = queue[id]; delete queue[id]; fn(); } } function listner(event){ run.call(event.data); } // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if(!isFunction(setTask) || !isFunction(clearTask)){ setTask = function(fn){ var args = [], i = 1; while(arguments.length > i)args.push(arguments[i++]); queue[++counter] = function(){ invoke(isFunction(fn) ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function(id){ delete queue[id]; }; // Node.js 0.8- if(cof(process) == 'process'){ defer = function(id){ process.nextTick(ctx(run, id, 1)); }; // Modern browsers, skip implementation for WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is object } else if(addEventListener && isFunction(postMessage) && !global.importScripts){ defer = function(id){ postMessage(id, '*'); }; addEventListener('message', listner, false); // WebWorkers } else if(isFunction(MessageChannel)){ channel = new MessageChannel; port = channel.port2; channel.port1.onmessage = listner; defer = ctx(port.postMessage, port, 1); // IE8- } else if(ONREADYSTATECHANGE in cel('script')){ defer = function(id){ html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function(id){ setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; /***/ }, /* 89 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , ctx = __webpack_require__(82) , safe = __webpack_require__(68).safe , assert = __webpack_require__(69) , forOf = __webpack_require__(87) , step = __webpack_require__(79).step , has = $.has , set = $.set , isObject = $.isObject , hide = $.hide , isFrozen = Object.isFrozen || $.core.Object.isFrozen , ID = safe('id') , O1 = safe('O1') , LAST = safe('last') , FIRST = safe('first') , ITER = safe('iter') , SIZE = $.DESC ? safe('size') : 'size' , id = 0; function fastKey(it, create){ // return primitive with prefix if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it; // can't set id to frozen object if(isFrozen(it))return 'F'; if(!has(it, ID)){ // not necessary to add id if(!create)return 'E'; // add missing object id hide(it, ID, ++id); // return object id with prefix } return 'O' + it[ID]; } function getEntry(that, key){ // fast case var index = fastKey(key), entry; if(index != 'F')return that[O1][index]; // frozen object case for(entry = that[FIRST]; entry; entry = entry.n){ if(entry.k == key)return entry; } } module.exports = { getConstructor: function(NAME, IS_MAP, ADDER){ function C(){ var that = assert.inst(this, C, NAME) , iterable = arguments[0]; set(that, O1, $.create(null)); set(that, SIZE, 0); set(that, LAST, undefined); set(that, FIRST, undefined); if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); } $.mix(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear(){ for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){ entry.r = true; if(entry.p)entry.p = entry.p.n = undefined; delete data[entry.i]; } that[FIRST] = that[LAST] = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function(key){ var that = this , entry = getEntry(that, key); if(entry){ var next = entry.n , prev = entry.p; delete that[O1][entry.i]; entry.r = true; if(prev)prev.n = next; if(next)next.p = prev; if(that[FIRST] == entry)that[FIRST] = next; if(that[LAST] == entry)that[LAST] = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /*, that = undefined */){ var f = ctx(callbackfn, arguments[1], 3) , entry; while(entry = entry ? entry.n : this[FIRST]){ f(entry.v, entry.k, this); // revert to the last existing entry while(entry && entry.r)entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key){ return !!getEntry(this, key); } }); if($.DESC)$.setDesc(C.prototype, 'size', { get: function(){ return assert.def(this[SIZE]); } }); return C; }, def: function(that, key, value){ var entry = getEntry(that, key) , prev, index; // change existing entry if(entry){ entry.v = value; // create new entry } else { that[LAST] = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that[LAST], // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if(!that[FIRST])that[FIRST] = entry; if(prev)prev.n = entry; that[SIZE]++; // add to index if(index != 'F')that[O1][index] = entry; } return that; }, getEntry: getEntry, // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 setIter: function(C, NAME, IS_MAP){ __webpack_require__(80)(C, NAME, function(iterated, kind){ set(this, ITER, {o: iterated, k: kind}); }, function(){ var iter = this[ITER] , kind = iter.k , entry = iter.l; // revert to the last existing entry while(entry && entry.r)entry = entry.p; // get next entry if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){ // or finish the iteration iter.o = undefined; return step(1); } // return step by kind if(kind == 'keys' )return step(0, entry.k); if(kind == 'values')return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); } }; /***/ }, /* 90 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , $def = __webpack_require__(65) , BUGGY = __webpack_require__(79).BUGGY , forOf = __webpack_require__(87) , species = __webpack_require__(86) , assertInstance = __webpack_require__(69).inst; module.exports = function(NAME, methods, common, IS_MAP, IS_WEAK){ var Base = $.g[NAME] , C = Base , ADDER = IS_MAP ? 'set' : 'add' , proto = C && C.prototype , O = {}; function fixMethod(KEY, CHAIN){ var method = proto[KEY]; if($.FW)proto[KEY] = function(a, b){ var result = method.call(this, a === 0 ? 0 : a, b); return CHAIN ? this : result; }; } if(!$.isFunction(C) || !(IS_WEAK || !BUGGY && proto.forEach && proto.entries)){ // create collection constructor C = common.getConstructor(NAME, IS_MAP, ADDER); $.mix(C.prototype, methods); } else { var inst = new C , chain = inst[ADDER](IS_WEAK ? {} : -0, 1) , buggyZero; // wrap for init collections from iterable if(!__webpack_require__(84)(function(iter){ new C(iter); })){ // eslint-disable-line no-new C = function(){ assertInstance(this, C, NAME); var that = new Base , iterable = arguments[0]; if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); return that; }; C.prototype = proto; if($.FW)proto.constructor = C; } IS_WEAK || inst.forEach(function(val, key){ buggyZero = 1 / key === -Infinity; }); // fix converting -0 key to +0 if(buggyZero){ fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } // + fix .add & .set for chaining if(buggyZero || chain !== inst)fixMethod(ADDER, true); } __webpack_require__(64).set(C, NAME); O[NAME] = C; $def($def.G + $def.W + $def.F * (C != Base), O); species(C); species($.core[NAME]); // for wrapper if(!IS_WEAK)common.setIter(C, NAME, IS_MAP); return C; }; /***/ }, /* 91 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , safe = __webpack_require__(68).safe , assert = __webpack_require__(69) , forOf = __webpack_require__(87) , _has = $.has , isObject = $.isObject , hide = $.hide , isFrozen = Object.isFrozen || $.core.Object.isFrozen , id = 0 , ID = safe('id') , WEAK = safe('weak') , LEAK = safe('leak') , method = __webpack_require__(67) , find = method(5) , findIndex = method(6); function findFrozen(store, key){ return find(store.array, function(it){ return it[0] === key; }); } // fallback for frozen keys function leakStore(that){ return that[LEAK] || hide(that, LEAK, { array: [], get: function(key){ var entry = findFrozen(this, key); if(entry)return entry[1]; }, has: function(key){ return !!findFrozen(this, key); }, set: function(key, value){ var entry = findFrozen(this, key); if(entry)entry[1] = value; else this.array.push([key, value]); }, 'delete': function(key){ var index = findIndex(this.array, function(it){ return it[0] === key; }); if(~index)this.array.splice(index, 1); return !!~index; } })[LEAK]; } module.exports = { getConstructor: function(NAME, IS_MAP, ADDER){ function C(){ $.set(assert.inst(this, C, NAME), ID, id++); var iterable = arguments[0]; if(iterable != undefined)forOf(iterable, IS_MAP, this[ADDER], this); } $.mix(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this)['delete'](key); return _has(key, WEAK) && _has(key[WEAK], this[ID]) && delete key[WEAK][this[ID]]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this).has(key); return _has(key, WEAK) && _has(key[WEAK], this[ID]); } }); return C; }, def: function(that, key, value){ if(isFrozen(assert.obj(key))){ leakStore(that).set(key, value); } else { _has(key, WEAK) || hide(key, WEAK, {}); key[WEAK][that[ID]] = value; } return that; }, leakStore: leakStore, WEAK: WEAK, ID: ID }; /***/ }, /* 92 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(62) , assertObject = __webpack_require__(69).obj; module.exports = function ownKeys(it){ assertObject(it); var keys = $.getNames(it) , getSymbols = $.getSymbols; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; /***/ }, /* 93 */ /***/ function(module, exports, __webpack_require__) { // http://wiki.ecmascript.org/doku.php?id=strawman:string_padding var $ = __webpack_require__(62) , repeat = __webpack_require__(81); module.exports = function(that, minLength, fillChar, left){ // 1. Let O be CheckObjectCoercible(this value). // 2. Let S be ToString(O). var S = String($.assertDefined(that)); // 4. If intMinLength is undefined, return S. if(minLength === undefined)return S; // 4. Let intMinLength be ToInteger(minLength). var intMinLength = $.toInteger(minLength); // 5. Let fillLen be the number of characters in S minus intMinLength. var fillLen = intMinLength - S.length; // 6. If fillLen < 0, then throw a RangeError exception. // 7. If fillLen is +∞, then throw a RangeError exception. if(fillLen < 0 || fillLen === Infinity){ throw new RangeError('Cannot satisfy string length ' + minLength + ' for string: ' + S); } // 8. Let sFillStr be the string represented by fillStr. // 9. If sFillStr is undefined, let sFillStr be a space character. var sFillStr = fillChar === undefined ? ' ' : String(fillChar); // 10. Let sFillVal be a String made of sFillStr, repeated until fillLen is met. var sFillVal = repeat.call(sFillStr, Math.ceil(fillLen / sFillStr.length)); // truncate if we overflowed if(sFillVal.length > fillLen)sFillVal = left ? sFillVal.slice(sFillVal.length - fillLen) : sFillVal.slice(0, fillLen); // 11. Return a string made from sFillVal, followed by S. // 11. Return a String made from S, followed by sFillVal. return left ? sFillVal.concat(S) : S.concat(sFillVal); }; /***/ }, /* 94 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $def = __webpack_require__(65) , forOf = __webpack_require__(87); module.exports = function(NAME){ $def($def.P, NAME, { toJSON: function toJSON(){ var arr = []; forOf(this, false, arr.push, arr); return arr; } }); }; /***/ }, /* 95 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(62) , invoke = __webpack_require__(66) , assertFunction = __webpack_require__(69).fn; module.exports = function(/* ...pargs */){ var fn = assertFunction(this) , length = arguments.length , pargs = Array(length) , i = 0 , _ = $.path._ , holder = false; while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; return function(/* ...args */){ var that = this , _length = arguments.length , j = 0, k = 0, args; if(!holder && !_length)return invoke(fn, pargs, that); args = pargs.slice(); if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; while(_length > k)args.push(arguments[k++]); return invoke(fn, args, that); }; }; /***/ }, /* 96 */ /***/ function(module, exports, __webpack_require__) { module.exports = function($){ $.FW = true; $.path = $.g; return $; }; /***/ } /******/ ]); // CommonJS export if(typeof module != 'undefined' && module.exports)module.exports = __e; // RequireJS export else if(typeof define == 'function' && define.amd)define(function(){return __e}); // Export to global object else __g.core = __e; }();
SettlementWeb/src/app/pages/sheet/components/columns.js
wjwu/Settlement-React
import React from 'react'; import { Icon, Tag } from 'antd'; import numeral from 'numeral'; import * as colors from '../../../utils/colors'; export const genCostColumns = (editFuc, disabled) => { return [{ title: '名目', dataIndex: 'TypeName', key: 'name', width: '20%' }, { title: '单价', dataIndex: 'Unit', key: 'unit', width: '10%', }, { title: '数量', dataIndex: 'Amount', key: 'amount', width: '10%' }, { title: '小计', dataIndex: 'Total', key: 'total', width: '15%', render: (text) => { return <b>{numeral(text).format('0,0.00')}</b>; } }, { title: '付款状态', dataIndex: 'Status', key: 'status', width: '15%', render: (text) => { if (text === 'Paid') { return <Tag color={colors.green}>已付款</Tag>; } else if (text === 'Unpaid') { return <Tag color={colors.red}>未付款</Tag>; } } }, { title: '备注', dataIndex: 'Remark', key: 'remark', width: '20%' }, { title: '操作', key: 'operation', width: '10%', render: (text, raw) => { return ( <span> <a href='javascript:;' onClick={editFuc.bind(null, raw, 'update')} disabled={disabled}><Icon type='edit' /></a>&nbsp;&nbsp; <a href='javascript:;' onClick={editFuc.bind(null, raw, 'delete')} disabled={disabled}><Icon type='delete' /></a> </span> ); } }]; }; export const genReceivedColumns = (editFuc, disabled) => { return [{ title: '收款金额', dataIndex: 'Money', key: 'money', width: '25%', render: (text) => { return <b>{numeral(text).format('0,0.00')}</b>; } }, { title: '收款时间', dataIndex: 'Time', key: 'time', width: '25%' }, { title: '备注', dataIndex: 'Remark', key: 'remark', width: '40%' }, { title: '操作', key: 'operation', width: '10%', render: (text, raw) => { return ( <span> <a href='javascript:;' onClick={editFuc.bind(null, raw, 'update')} disabled={disabled}><Icon type='edit' /></a>&nbsp;&nbsp; <a href='javascript:;' onClick={editFuc.bind(null, raw, 'delete')} disabled={disabled}><Icon type='delete' /></a> </span> ); } }]; }; export const genLogColumns = () => { return [{ title: '时间', dataIndex: 'CreateTime', key: 'createTime', width: '20%' }, { title: '操作人', dataIndex: 'Operator', key: 'operator', width: '20%' }, { title: '操作详情', dataIndex: 'Text', key: 'text', width: '60%' }]; };
ajax/libs/react-bootstrap/0.22.4/react-bootstrap.js
hanbyul-here/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["ReactBootstrap"] = factory(require("react")); else root["ReactBootstrap"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_55__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _Accordion = __webpack_require__(2); var _Accordion2 = _interopRequireDefault(_Accordion); var _Affix = __webpack_require__(3); var _Affix2 = _interopRequireDefault(_Affix); var _AffixMixin = __webpack_require__(4); var _AffixMixin2 = _interopRequireDefault(_AffixMixin); var _Alert = __webpack_require__(5); var _Alert2 = _interopRequireDefault(_Alert); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _Badge = __webpack_require__(7); var _Badge2 = _interopRequireDefault(_Badge); var _Button = __webpack_require__(8); var _Button2 = _interopRequireDefault(_Button); var _ButtonGroup = __webpack_require__(9); var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup); var _ButtonInput = __webpack_require__(10); var _ButtonInput2 = _interopRequireDefault(_ButtonInput); var _ButtonToolbar = __webpack_require__(11); var _ButtonToolbar2 = _interopRequireDefault(_ButtonToolbar); var _CollapsableNav = __webpack_require__(12); var _CollapsableNav2 = _interopRequireDefault(_CollapsableNav); var _CollapsibleNav = __webpack_require__(13); var _CollapsibleNav2 = _interopRequireDefault(_CollapsibleNav); var _Carousel = __webpack_require__(14); var _Carousel2 = _interopRequireDefault(_Carousel); var _CarouselItem = __webpack_require__(15); var _CarouselItem2 = _interopRequireDefault(_CarouselItem); var _Col = __webpack_require__(16); var _Col2 = _interopRequireDefault(_Col); var _CollapsableMixin = __webpack_require__(17); var _CollapsableMixin2 = _interopRequireDefault(_CollapsableMixin); var _CollapsibleMixin = __webpack_require__(18); var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin); var _DropdownButton = __webpack_require__(19); var _DropdownButton2 = _interopRequireDefault(_DropdownButton); var _DropdownMenu = __webpack_require__(20); var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu); var _DropdownStateMixin = __webpack_require__(21); var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin); var _FadeMixin = __webpack_require__(22); var _FadeMixin2 = _interopRequireDefault(_FadeMixin); var _Glyphicon = __webpack_require__(23); var _Glyphicon2 = _interopRequireDefault(_Glyphicon); var _Grid = __webpack_require__(24); var _Grid2 = _interopRequireDefault(_Grid); var _Input = __webpack_require__(25); var _Input2 = _interopRequireDefault(_Input); var _Interpolate = __webpack_require__(26); var _Interpolate2 = _interopRequireDefault(_Interpolate); var _Jumbotron = __webpack_require__(27); var _Jumbotron2 = _interopRequireDefault(_Jumbotron); var _Label = __webpack_require__(28); var _Label2 = _interopRequireDefault(_Label); var _ListGroup = __webpack_require__(34); var _ListGroup2 = _interopRequireDefault(_ListGroup); var _ListGroupItem = __webpack_require__(29); var _ListGroupItem2 = _interopRequireDefault(_ListGroupItem); var _MenuItem = __webpack_require__(30); var _MenuItem2 = _interopRequireDefault(_MenuItem); var _Modal = __webpack_require__(31); var _Modal2 = _interopRequireDefault(_Modal); var _Nav = __webpack_require__(32); var _Nav2 = _interopRequireDefault(_Nav); var _Navbar = __webpack_require__(33); var _Navbar2 = _interopRequireDefault(_Navbar); var _NavItem = __webpack_require__(1); var _NavItem2 = _interopRequireDefault(_NavItem); var _ModalTrigger = __webpack_require__(35); var _ModalTrigger2 = _interopRequireDefault(_ModalTrigger); var _OverlayTrigger = __webpack_require__(36); var _OverlayTrigger2 = _interopRequireDefault(_OverlayTrigger); var _OverlayMixin = __webpack_require__(37); var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin); var _PageHeader = __webpack_require__(38); var _PageHeader2 = _interopRequireDefault(_PageHeader); var _Panel = __webpack_require__(39); var _Panel2 = _interopRequireDefault(_Panel); var _PanelGroup = __webpack_require__(40); var _PanelGroup2 = _interopRequireDefault(_PanelGroup); var _PageItem = __webpack_require__(41); var _PageItem2 = _interopRequireDefault(_PageItem); var _Pager = __webpack_require__(42); var _Pager2 = _interopRequireDefault(_Pager); var _Popover = __webpack_require__(43); var _Popover2 = _interopRequireDefault(_Popover); var _ProgressBar = __webpack_require__(44); var _ProgressBar2 = _interopRequireDefault(_ProgressBar); var _Row = __webpack_require__(45); var _Row2 = _interopRequireDefault(_Row); var _SplitButton = __webpack_require__(46); var _SplitButton2 = _interopRequireDefault(_SplitButton); var _SubNav = __webpack_require__(47); var _SubNav2 = _interopRequireDefault(_SubNav); var _TabbedArea = __webpack_require__(48); var _TabbedArea2 = _interopRequireDefault(_TabbedArea); var _Table = __webpack_require__(49); var _Table2 = _interopRequireDefault(_Table); var _TabPane = __webpack_require__(50); var _TabPane2 = _interopRequireDefault(_TabPane); var _Thumbnail = __webpack_require__(51); var _Thumbnail2 = _interopRequireDefault(_Thumbnail); var _Tooltip = __webpack_require__(52); var _Tooltip2 = _interopRequireDefault(_Tooltip); var _Well = __webpack_require__(53); var _Well2 = _interopRequireDefault(_Well); var _styleMaps = __webpack_require__(54); var _styleMaps2 = _interopRequireDefault(_styleMaps); exports['default'] = { Accordion: _Accordion2['default'], Affix: _Affix2['default'], AffixMixin: _AffixMixin2['default'], Alert: _Alert2['default'], BootstrapMixin: _BootstrapMixin2['default'], Badge: _Badge2['default'], Button: _Button2['default'], ButtonGroup: _ButtonGroup2['default'], ButtonInput: _ButtonInput2['default'], ButtonToolbar: _ButtonToolbar2['default'], CollapsableNav: _CollapsableNav2['default'], CollapsibleNav: _CollapsibleNav2['default'], Carousel: _Carousel2['default'], CarouselItem: _CarouselItem2['default'], Col: _Col2['default'], CollapsableMixin: _CollapsableMixin2['default'], CollapsibleMixin: _CollapsibleMixin2['default'], DropdownButton: _DropdownButton2['default'], DropdownMenu: _DropdownMenu2['default'], DropdownStateMixin: _DropdownStateMixin2['default'], FadeMixin: _FadeMixin2['default'], Glyphicon: _Glyphicon2['default'], Grid: _Grid2['default'], Input: _Input2['default'], Interpolate: _Interpolate2['default'], Jumbotron: _Jumbotron2['default'], Label: _Label2['default'], ListGroup: _ListGroup2['default'], ListGroupItem: _ListGroupItem2['default'], MenuItem: _MenuItem2['default'], Modal: _Modal2['default'], Nav: _Nav2['default'], Navbar: _Navbar2['default'], NavItem: _NavItem2['default'], ModalTrigger: _ModalTrigger2['default'], OverlayTrigger: _OverlayTrigger2['default'], OverlayMixin: _OverlayMixin2['default'], PageHeader: _PageHeader2['default'], Panel: _Panel2['default'], PanelGroup: _PanelGroup2['default'], PageItem: _PageItem2['default'], Pager: _Pager2['default'], Popover: _Popover2['default'], ProgressBar: _ProgressBar2['default'], Row: _Row2['default'], SplitButton: _SplitButton2['default'], SubNav: _SubNav2['default'], TabbedArea: _TabbedArea2['default'], Table: _Table2['default'], TabPane: _TabPane2['default'], Thumbnail: _Thumbnail2['default'], Tooltip: _Tooltip2['default'], Well: _Well2['default'], styleMaps: _styleMaps2['default'] }; module.exports = exports['default']; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var NavItem = _react2['default'].createClass({ displayName: 'NavItem', mixins: [_BootstrapMixin2['default']], propTypes: { onSelect: _react2['default'].PropTypes.func, active: _react2['default'].PropTypes.bool, disabled: _react2['default'].PropTypes.bool, href: _react2['default'].PropTypes.string, title: _react2['default'].PropTypes.node, eventKey: _react2['default'].PropTypes.any, target: _react2['default'].PropTypes.string }, getDefaultProps: function getDefaultProps() { return { href: '#' }; }, render: function render() { var _props = this.props; var disabled = _props.disabled; var active = _props.active; var href = _props.href; var title = _props.title; var target = _props.target; var children = _props.children; var props = _objectWithoutProperties(_props, ['disabled', 'active', 'href', 'title', 'target', 'children']); // eslint-disable-line object-shorthand var classes = { active: active, disabled: disabled }; var linkProps = { href: href, title: title, target: target, onClick: this.handleClick, ref: 'anchor' }; if (href === '#') { linkProps.role = 'button'; } return _react2['default'].createElement( 'li', _extends({}, props, { className: (0, _classnames2['default'])(props.className, classes) }), _react2['default'].createElement( 'a', linkProps, children ) ); }, handleClick: function handleClick(e) { if (this.props.onSelect) { e.preventDefault(); if (!this.props.disabled) { this.props.onSelect(this.props.eventKey, this.props.href, this.props.target); } } } }); exports['default'] = NavItem; module.exports = exports['default']; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _PanelGroup = __webpack_require__(40); var _PanelGroup2 = _interopRequireDefault(_PanelGroup); var Accordion = _react2['default'].createClass({ displayName: 'Accordion', render: function render() { return _react2['default'].createElement( _PanelGroup2['default'], _extends({}, this.props, { accordion: true }), this.props.children ); } }); exports['default'] = Accordion; module.exports = exports['default']; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _AffixMixin = __webpack_require__(4); var _AffixMixin2 = _interopRequireDefault(_AffixMixin); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var Affix = _react2['default'].createClass({ displayName: 'Affix', statics: { domUtils: _utilsDomUtils2['default'] }, mixins: [_AffixMixin2['default']], render: function render() { var holderStyle = { top: this.state.affixPositionTop }; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, this.state.affixClass), style: holderStyle }), this.props.children ); } }); exports['default'] = Affix; module.exports = exports['default']; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsEventListener = __webpack_require__(58); var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener); var AffixMixin = { propTypes: { offset: _react2['default'].PropTypes.number, offsetTop: _react2['default'].PropTypes.number, offsetBottom: _react2['default'].PropTypes.number }, getInitialState: function getInitialState() { return { affixClass: 'affix-top' }; }, getPinnedOffset: function getPinnedOffset(DOMNode) { if (this.pinnedOffset) { return this.pinnedOffset; } DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, ''); DOMNode.className += DOMNode.className.length ? ' affix' : 'affix'; this.pinnedOffset = _utilsDomUtils2['default'].getOffset(DOMNode).top - window.pageYOffset; return this.pinnedOffset; }, checkPosition: function checkPosition() { var DOMNode = undefined, scrollHeight = undefined, scrollTop = undefined, position = undefined, offsetTop = undefined, offsetBottom = undefined, affix = undefined, affixType = undefined, affixPositionTop = undefined; // TODO: or not visible if (!this.isMounted()) { return; } DOMNode = _react2['default'].findDOMNode(this); scrollHeight = document.documentElement.offsetHeight; scrollTop = window.pageYOffset; position = _utilsDomUtils2['default'].getOffset(DOMNode); if (this.affixed === 'top') { position.top += scrollTop; } offsetTop = this.props.offsetTop != null ? this.props.offsetTop : this.props.offset; offsetBottom = this.props.offsetBottom != null ? this.props.offsetBottom : this.props.offset; if (offsetTop == null && offsetBottom == null) { return; } if (offsetTop == null) { offsetTop = 0; } if (offsetBottom == null) { offsetBottom = 0; } if (this.unpin != null && scrollTop + this.unpin <= position.top) { affix = false; } else if (offsetBottom != null && position.top + DOMNode.offsetHeight >= scrollHeight - offsetBottom) { affix = 'bottom'; } else if (offsetTop != null && scrollTop <= offsetTop) { affix = 'top'; } else { affix = false; } if (this.affixed === affix) { return; } if (this.unpin != null) { DOMNode.style.top = ''; } affixType = 'affix' + (affix ? '-' + affix : ''); this.affixed = affix; this.unpin = affix === 'bottom' ? this.getPinnedOffset(DOMNode) : null; if (affix === 'bottom') { DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, 'affix-bottom'); affixPositionTop = scrollHeight - offsetBottom - DOMNode.offsetHeight - _utilsDomUtils2['default'].getOffset(DOMNode).top; } this.setState({ affixClass: affixType, affixPositionTop: affixPositionTop }); }, checkPositionWithEventLoop: function checkPositionWithEventLoop() { setTimeout(this.checkPosition, 0); }, componentDidMount: function componentDidMount() { this._onWindowScrollListener = _utilsEventListener2['default'].listen(window, 'scroll', this.checkPosition); this._onDocumentClickListener = _utilsEventListener2['default'].listen(_utilsDomUtils2['default'].ownerDocument(this), 'click', this.checkPositionWithEventLoop); }, componentWillUnmount: function componentWillUnmount() { if (this._onWindowScrollListener) { this._onWindowScrollListener.remove(); } if (this._onDocumentClickListener) { this._onDocumentClickListener.remove(); } }, componentDidUpdate: function componentDidUpdate(prevProps, prevState) { if (prevState.affixClass === this.state.affixClass) { this.checkPositionWithEventLoop(); } } }; exports['default'] = AffixMixin; module.exports = exports['default']; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var Alert = _react2['default'].createClass({ displayName: 'Alert', mixins: [_BootstrapMixin2['default']], propTypes: { onDismiss: _react2['default'].PropTypes.func, dismissAfter: _react2['default'].PropTypes.number }, getDefaultProps: function getDefaultProps() { return { bsClass: 'alert', bsStyle: 'info' }; }, renderDismissButton: function renderDismissButton() { return _react2['default'].createElement( 'button', { type: 'button', className: 'close', onClick: this.props.onDismiss, 'aria-hidden': 'true' }, '×' ); }, render: function render() { var classes = this.getBsClassSet(); var isDismissable = !!this.props.onDismiss; classes['alert-dismissable'] = isDismissable; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), isDismissable ? this.renderDismissButton() : null, this.props.children ); }, componentDidMount: function componentDidMount() { if (this.props.dismissAfter && this.props.onDismiss) { this.dismissTimer = setTimeout(this.props.onDismiss, this.props.dismissAfter); } }, componentWillUnmount: function componentWillUnmount() { clearTimeout(this.dismissTimer); } }); exports['default'] = Alert; module.exports = exports['default']; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _styleMaps = __webpack_require__(54); var _styleMaps2 = _interopRequireDefault(_styleMaps); var _utilsCustomPropTypes = __webpack_require__(59); var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes); var BootstrapMixin = { propTypes: { bsClass: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].CLASSES), bsStyle: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].STYLES), bsSize: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].SIZES) }, getBsClassSet: function getBsClassSet() { var classes = {}; var bsClass = this.props.bsClass && _styleMaps2['default'].CLASSES[this.props.bsClass]; if (bsClass) { classes[bsClass] = true; var prefix = bsClass + '-'; var bsSize = this.props.bsSize && _styleMaps2['default'].SIZES[this.props.bsSize]; if (bsSize) { classes[prefix + bsSize] = true; } var bsStyle = this.props.bsStyle && _styleMaps2['default'].STYLES[this.props.bsStyle]; if (this.props.bsStyle) { classes[prefix + bsStyle] = true; } } return classes; }, prefixClass: function prefixClass(subClass) { return _styleMaps2['default'].CLASSES[this.props.bsClass] + '-' + subClass; } }; exports['default'] = BootstrapMixin; module.exports = exports['default']; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var Badge = _react2['default'].createClass({ displayName: 'Badge', propTypes: { pullRight: _react2['default'].PropTypes.bool }, hasContent: function hasContent() { return _utilsValidComponentChildren2['default'].hasValidComponent(this.props.children) || _react2['default'].Children.count(this.props.children) > 1 || typeof this.props.children === 'string' || typeof this.props.children === 'number'; }, render: function render() { var classes = { 'pull-right': this.props.pullRight, 'badge': this.hasContent() }; return _react2['default'].createElement( 'span', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = Badge; module.exports = exports['default']; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var Button = _react2['default'].createClass({ displayName: 'Button', mixins: [_BootstrapMixin2['default']], propTypes: { active: _react2['default'].PropTypes.bool, disabled: _react2['default'].PropTypes.bool, block: _react2['default'].PropTypes.bool, navItem: _react2['default'].PropTypes.bool, navDropdown: _react2['default'].PropTypes.bool, componentClass: _react2['default'].PropTypes.node, href: _react2['default'].PropTypes.string, target: _react2['default'].PropTypes.string }, getDefaultProps: function getDefaultProps() { return { bsClass: 'button', bsStyle: 'default', type: 'button' }; }, render: function render() { var classes = this.props.navDropdown ? {} : this.getBsClassSet(); var renderFuncName = undefined; classes = _extends({ active: this.props.active, 'btn-block': this.props.block }, classes); if (this.props.navItem) { return this.renderNavItem(classes); } renderFuncName = this.props.href || this.props.target || this.props.navDropdown ? 'renderAnchor' : 'renderButton'; return this[renderFuncName](classes); }, renderAnchor: function renderAnchor(classes) { var Component = this.props.componentClass || 'a'; var href = this.props.href || '#'; classes.disabled = this.props.disabled; return _react2['default'].createElement( Component, _extends({}, this.props, { href: href, className: (0, _classnames2['default'])(this.props.className, classes), role: 'button' }), this.props.children ); }, renderButton: function renderButton(classes) { var Component = this.props.componentClass || 'button'; return _react2['default'].createElement( Component, _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); }, renderNavItem: function renderNavItem(classes) { var liClasses = { active: this.props.active }; return _react2['default'].createElement( 'li', { className: (0, _classnames2['default'])(liClasses) }, this.renderAnchor(classes) ); } }); exports['default'] = Button; module.exports = exports['default']; // eslint-disable-line object-shorthand /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var ButtonGroup = _react2['default'].createClass({ displayName: 'ButtonGroup', mixins: [_BootstrapMixin2['default']], propTypes: { vertical: _react2['default'].PropTypes.bool, justified: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { bsClass: 'button-group' }; }, render: function render() { var classes = this.getBsClassSet(); classes['btn-group'] = !this.props.vertical; classes['btn-group-vertical'] = this.props.vertical; classes['btn-group-justified'] = this.props.justified; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = ButtonGroup; module.exports = exports['default']; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _Button = __webpack_require__(8); var _Button2 = _interopRequireDefault(_Button); var _FormGroup = __webpack_require__(60); var _FormGroup2 = _interopRequireDefault(_FormGroup); var _InputBase2 = __webpack_require__(61); var _InputBase3 = _interopRequireDefault(_InputBase2); function valueValidation(_ref, propName, componentName) { var children = _ref.children; var value = _ref.value; if (children && value) { return new Error('Both value and children cannot be passed to ButtonInput'); } return _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.number]).call(null, { children: children, value: value }, propName, componentName); } var ButtonInput = (function (_InputBase) { function ButtonInput() { _classCallCheck(this, ButtonInput); if (_InputBase != null) { _InputBase.apply(this, arguments); } } _inherits(ButtonInput, _InputBase); _createClass(ButtonInput, [{ key: 'renderFormGroup', value: function renderFormGroup(children) { var _props = this.props; var bsStyle = _props.bsStyle; var value = _props.value; var other = _objectWithoutProperties(_props, ['bsStyle', 'value']); // eslint-disable-line object-shorthand, no-unused-vars return _react2['default'].createElement( _FormGroup2['default'], other, children ); } }, { key: 'renderInput', value: function renderInput() { var _props2 = this.props; var children = _props2.children; var value = _props2.value; var other = _objectWithoutProperties(_props2, ['children', 'value']); // eslint-disable-line object-shorthand var val = children ? children : value; return _react2['default'].createElement(_Button2['default'], _extends({}, other, { componentClass: 'input', ref: 'input', key: 'input', value: val })); } }]); return ButtonInput; })(_InputBase3['default']); ButtonInput.defaultProps = { type: 'button' }; ButtonInput.propTypes = { type: _react2['default'].PropTypes.oneOf(['button', 'reset', 'submit']), bsStyle: function bsStyle(props) { //defer to Button propTypes of bsStyle return null; }, children: valueValidation, value: valueValidation }; exports['default'] = ButtonInput; module.exports = exports['default']; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var ButtonToolbar = _react2['default'].createClass({ displayName: 'ButtonToolbar', mixins: [_BootstrapMixin2['default']], getDefaultProps: function getDefaultProps() { return { bsClass: 'button-toolbar' }; }, render: function render() { var classes = this.getBsClassSet(); return _react2['default'].createElement( 'div', _extends({}, this.props, { role: 'toolbar', className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = ButtonToolbar; module.exports = exports['default']; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsDeprecationWarning = __webpack_require__(62); var _utilsDeprecationWarning2 = _interopRequireDefault(_utilsDeprecationWarning); var _utilsObjectAssign = __webpack_require__(63); var _utilsObjectAssign2 = _interopRequireDefault(_utilsObjectAssign); var _CollapsibleNav = __webpack_require__(13); var specCollapsableNav = (0, _utilsObjectAssign2['default'])({}, _CollapsibleNav.specCollapsibleNav, { componentDidMount: function componentDidMount() { (0, _utilsDeprecationWarning2['default'])('CollapsableNav', 'CollapsibleNav', 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'); } }); var CollapsableNav = _react2['default'].createClass(specCollapsableNav); exports['default'] = CollapsableNav; module.exports = exports['default']; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _CollapsibleMixin = __webpack_require__(18); var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsDeprecatedProperty = __webpack_require__(64); var _utilsDeprecatedProperty2 = _interopRequireDefault(_utilsDeprecatedProperty); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var specCollapsibleNav = { mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']], propTypes: { onSelect: _react2['default'].PropTypes.func, activeHref: _react2['default'].PropTypes.string, activeKey: _react2['default'].PropTypes.any, collapsable: _utilsDeprecatedProperty2['default'], collapsible: _react2['default'].PropTypes.bool, expanded: _react2['default'].PropTypes.bool, eventKey: _react2['default'].PropTypes.any }, getCollapsibleDOMNode: function getCollapsibleDOMNode() { return this.getDOMNode(); }, getCollapsibleDimensionValue: function getCollapsibleDimensionValue() { var height = 0; var nodes = this.refs; for (var key in nodes) { if (nodes.hasOwnProperty(key)) { var n = nodes[key].getDOMNode(), h = n.offsetHeight, computedStyles = _utilsDomUtils2['default'].getComputedStyles(n); height += h + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10); } } return height; }, render: function render() { /* * this.props.collapsible is set in NavBar when a eventKey is supplied. */ var collapsible = this.props.collapsible || this.props.collapsable; var classes = collapsible ? this.getCollapsibleClassSet() : {}; /* * prevent duplicating navbar-collapse call if passed as prop. * kind of overkill... * good cadidate to have check implemented as an util that can * also be used elsewhere. */ if (this.props.className === undefined || this.props.className.split(' ').indexOf('navbar-collapse') === -2) { classes['navbar-collapse'] = collapsible; } return _react2['default'].createElement( 'div', { eventKey: this.props.eventKey, className: (0, _classnames2['default'])(this.props.className, classes) }, _utilsValidComponentChildren2['default'].map(this.props.children, collapsible ? this.renderCollapsibleNavChildren : this.renderChildren) ); }, getChildActiveProp: function getChildActiveProp(child) { if (child.props.active) { return true; } if (this.props.activeKey != null) { if (child.props.eventKey === this.props.activeKey) { return true; } } if (this.props.activeHref != null) { if (child.props.href === this.props.activeHref) { return true; } } return child.props.active; }, renderChildren: function renderChildren(child, index) { var key = child.key ? child.key : index; return (0, _react.cloneElement)(child, { activeKey: this.props.activeKey, activeHref: this.props.activeHref, ref: 'nocollapse_' + key, key: key, navItem: true }); }, renderCollapsibleNavChildren: function renderCollapsibleNavChildren(child, index) { var key = child.key ? child.key : index; return (0, _react.cloneElement)(child, { active: this.getChildActiveProp(child), activeKey: this.props.activeKey, activeHref: this.props.activeHref, onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect), ref: 'collapsible_' + key, key: key, navItem: true }); } }; var CollapsibleNav = _react2['default'].createClass(specCollapsibleNav); exports.specCollapsibleNav = specCollapsibleNav; exports['default'] = CollapsibleNav; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var Carousel = _react2['default'].createClass({ displayName: 'Carousel', mixins: [_BootstrapMixin2['default']], propTypes: { slide: _react2['default'].PropTypes.bool, indicators: _react2['default'].PropTypes.bool, interval: _react2['default'].PropTypes.number, controls: _react2['default'].PropTypes.bool, pauseOnHover: _react2['default'].PropTypes.bool, wrap: _react2['default'].PropTypes.bool, onSelect: _react2['default'].PropTypes.func, onSlideEnd: _react2['default'].PropTypes.func, activeIndex: _react2['default'].PropTypes.number, defaultActiveIndex: _react2['default'].PropTypes.number, direction: _react2['default'].PropTypes.oneOf(['prev', 'next']) }, getDefaultProps: function getDefaultProps() { return { slide: true, interval: 5000, pauseOnHover: true, wrap: true, indicators: true, controls: true }; }, getInitialState: function getInitialState() { return { activeIndex: this.props.defaultActiveIndex == null ? 0 : this.props.defaultActiveIndex, previousActiveIndex: null, direction: null }; }, getDirection: function getDirection(prevIndex, index) { if (prevIndex === index) { return null; } return prevIndex > index ? 'prev' : 'next'; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { var activeIndex = this.getActiveIndex(); if (nextProps.activeIndex != null && nextProps.activeIndex !== activeIndex) { clearTimeout(this.timeout); this.setState({ previousActiveIndex: activeIndex, direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex) }); } }, componentDidMount: function componentDidMount() { this.waitForNext(); }, componentWillUnmount: function componentWillUnmount() { clearTimeout(this.timeout); }, next: function next(e) { if (e) { e.preventDefault(); } var index = this.getActiveIndex() + 1; var count = _utilsValidComponentChildren2['default'].numberOf(this.props.children); if (index > count - 1) { if (!this.props.wrap) { return; } index = 0; } this.handleSelect(index, 'next'); }, prev: function prev(e) { if (e) { e.preventDefault(); } var index = this.getActiveIndex() - 1; if (index < 0) { if (!this.props.wrap) { return; } index = _utilsValidComponentChildren2['default'].numberOf(this.props.children) - 1; } this.handleSelect(index, 'prev'); }, pause: function pause() { this.isPaused = true; clearTimeout(this.timeout); }, play: function play() { this.isPaused = false; this.waitForNext(); }, waitForNext: function waitForNext() { if (!this.isPaused && this.props.slide && this.props.interval && this.props.activeIndex == null) { this.timeout = setTimeout(this.next, this.props.interval); } }, handleMouseOver: function handleMouseOver() { if (this.props.pauseOnHover) { this.pause(); } }, handleMouseOut: function handleMouseOut() { if (this.isPaused) { this.play(); } }, render: function render() { var classes = { carousel: true, slide: this.props.slide }; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut }), this.props.indicators ? this.renderIndicators() : null, _react2['default'].createElement( 'div', { className: 'carousel-inner', ref: 'inner' }, _utilsValidComponentChildren2['default'].map(this.props.children, this.renderItem) ), this.props.controls ? this.renderControls() : null ); }, renderPrev: function renderPrev() { return _react2['default'].createElement( 'a', { className: 'left carousel-control', href: '#prev', key: 0, onClick: this.prev }, _react2['default'].createElement('span', { className: 'glyphicon glyphicon-chevron-left' }) ); }, renderNext: function renderNext() { return _react2['default'].createElement( 'a', { className: 'right carousel-control', href: '#next', key: 1, onClick: this.next }, _react2['default'].createElement('span', { className: 'glyphicon glyphicon-chevron-right' }) ); }, renderControls: function renderControls() { if (!this.props.wrap) { var activeIndex = this.getActiveIndex(); var count = _utilsValidComponentChildren2['default'].numberOf(this.props.children); return [activeIndex !== 0 ? this.renderPrev() : null, activeIndex !== count - 1 ? this.renderNext() : null]; } return [this.renderPrev(), this.renderNext()]; }, renderIndicator: function renderIndicator(child, index) { var className = index === this.getActiveIndex() ? 'active' : null; return _react2['default'].createElement('li', { key: index, className: className, onClick: this.handleSelect.bind(this, index, null) }); }, renderIndicators: function renderIndicators() { var indicators = []; _utilsValidComponentChildren2['default'].forEach(this.props.children, function (child, index) { indicators.push(this.renderIndicator(child, index), // Force whitespace between indicator elements, bootstrap // requires this for correct spacing of elements. ' '); }, this); return _react2['default'].createElement( 'ol', { className: 'carousel-indicators' }, indicators ); }, getActiveIndex: function getActiveIndex() { return this.props.activeIndex != null ? this.props.activeIndex : this.state.activeIndex; }, handleItemAnimateOutEnd: function handleItemAnimateOutEnd() { this.setState({ previousActiveIndex: null, direction: null }, function () { this.waitForNext(); if (this.props.onSlideEnd) { this.props.onSlideEnd(); } }); }, renderItem: function renderItem(child, index) { var activeIndex = this.getActiveIndex(); var isActive = index === activeIndex; var isPreviousActive = this.state.previousActiveIndex != null && this.state.previousActiveIndex === index && this.props.slide; return (0, _react.cloneElement)(child, { active: isActive, ref: child.ref, key: child.key ? child.key : index, index: index, animateOut: isPreviousActive, animateIn: isActive && this.state.previousActiveIndex != null && this.props.slide, direction: this.state.direction, onAnimateOutEnd: isPreviousActive ? this.handleItemAnimateOutEnd : null }); }, handleSelect: function handleSelect(index, direction) { clearTimeout(this.timeout); var previousActiveIndex = this.getActiveIndex(); direction = direction || this.getDirection(previousActiveIndex, index); if (this.props.onSelect) { this.props.onSelect(index, direction); } if (this.props.activeIndex == null && index !== previousActiveIndex) { if (this.state.previousActiveIndex != null) { // If currently animating don't activate the new index. // TODO: look into queuing this canceled call and // animating after the current animation has ended. return; } this.setState({ activeIndex: index, previousActiveIndex: previousActiveIndex, direction: direction }); } } }); exports['default'] = Carousel; module.exports = exports['default']; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsTransitionEvents = __webpack_require__(66); var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents); var CarouselItem = _react2['default'].createClass({ displayName: 'CarouselItem', propTypes: { direction: _react2['default'].PropTypes.oneOf(['prev', 'next']), onAnimateOutEnd: _react2['default'].PropTypes.func, active: _react2['default'].PropTypes.bool, animateIn: _react2['default'].PropTypes.bool, animateOut: _react2['default'].PropTypes.bool, caption: _react2['default'].PropTypes.node, index: _react2['default'].PropTypes.number }, getInitialState: function getInitialState() { return { direction: null }; }, getDefaultProps: function getDefaultProps() { return { animation: true }; }, handleAnimateOutEnd: function handleAnimateOutEnd() { if (this.props.onAnimateOutEnd && this.isMounted()) { this.props.onAnimateOutEnd(this.props.index); } }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (this.props.active !== nextProps.active) { this.setState({ direction: null }); } }, componentDidUpdate: function componentDidUpdate(prevProps) { if (!this.props.active && prevProps.active) { _utilsTransitionEvents2['default'].addEndEventListener(_react2['default'].findDOMNode(this), this.handleAnimateOutEnd); } if (this.props.active !== prevProps.active) { setTimeout(this.startAnimation, 20); } }, startAnimation: function startAnimation() { if (!this.isMounted()) { return; } this.setState({ direction: this.props.direction === 'prev' ? 'right' : 'left' }); }, render: function render() { var classes = { item: true, active: this.props.active && !this.props.animateIn || this.props.animateOut, next: this.props.active && this.props.animateIn && this.props.direction === 'next', prev: this.props.active && this.props.animateIn && this.props.direction === 'prev' }; if (this.state.direction && (this.props.animateIn || this.props.animateOut)) { classes[this.state.direction] = true; } return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children, this.props.caption ? this.renderCaption() : null ); }, renderCaption: function renderCaption() { return _react2['default'].createElement( 'div', { className: 'carousel-caption' }, this.props.caption ); } }); exports['default'] = CarouselItem; module.exports = exports['default']; /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _styleMaps = __webpack_require__(54); var _styleMaps2 = _interopRequireDefault(_styleMaps); var Col = _react2['default'].createClass({ displayName: 'Col', propTypes: { xs: _react2['default'].PropTypes.number, sm: _react2['default'].PropTypes.number, md: _react2['default'].PropTypes.number, lg: _react2['default'].PropTypes.number, xsOffset: _react2['default'].PropTypes.number, smOffset: _react2['default'].PropTypes.number, mdOffset: _react2['default'].PropTypes.number, lgOffset: _react2['default'].PropTypes.number, xsPush: _react2['default'].PropTypes.number, smPush: _react2['default'].PropTypes.number, mdPush: _react2['default'].PropTypes.number, lgPush: _react2['default'].PropTypes.number, xsPull: _react2['default'].PropTypes.number, smPull: _react2['default'].PropTypes.number, mdPull: _react2['default'].PropTypes.number, lgPull: _react2['default'].PropTypes.number, componentClass: _react2['default'].PropTypes.node.isRequired }, getDefaultProps: function getDefaultProps() { return { componentClass: 'div' }; }, render: function render() { var ComponentClass = this.props.componentClass; var classes = {}; Object.keys(_styleMaps2['default'].SIZES).forEach(function (key) { var size = _styleMaps2['default'].SIZES[key]; var prop = size; var classPart = size + '-'; if (this.props[prop]) { classes['col-' + classPart + this.props[prop]] = true; } prop = size + 'Offset'; classPart = size + '-offset-'; if (this.props[prop] >= 0) { classes['col-' + classPart + this.props[prop]] = true; } prop = size + 'Push'; classPart = size + '-push-'; if (this.props[prop] >= 0) { classes['col-' + classPart + this.props[prop]] = true; } prop = size + 'Pull'; classPart = size + '-pull-'; if (this.props[prop] >= 0) { classes['col-' + classPart + this.props[prop]] = true; } }, this); return _react2['default'].createElement( ComponentClass, _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = Col; module.exports = exports['default']; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _utilsObjectAssign = __webpack_require__(63); var _utilsObjectAssign2 = _interopRequireDefault(_utilsObjectAssign); var _utilsDeprecationWarning = __webpack_require__(62); var _utilsDeprecationWarning2 = _interopRequireDefault(_utilsDeprecationWarning); var _CollapsibleMixin = __webpack_require__(18); var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin); var link = 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'; var CollapsableMixin = (0, _utilsObjectAssign2['default'])({}, _CollapsibleMixin2['default'], { getCollapsableClassSet: function getCollapsableClassSet(className) { (0, _utilsDeprecationWarning2['default'])('CollapsableMixin.getCollapsableClassSet()', 'CollapsibleMixin.getCollapsibleClassSet()', link); return _CollapsibleMixin2['default'].getCollapsibleClassSet.call(this, className); }, getCollapsibleDOMNode: function getCollapsibleDOMNode() { (0, _utilsDeprecationWarning2['default'])('CollapsableMixin.getCollapsableDOMNode()', 'CollapsibleMixin.getCollapsibleDOMNode()', link); return this.getCollapsableDOMNode(); }, getCollapsibleDimensionValue: function getCollapsibleDimensionValue() { (0, _utilsDeprecationWarning2['default'])('CollapsableMixin.getCollapsableDimensionValue()', 'CollapsibleMixin.getCollapsibleDimensionValue()', link); return this.getCollapsableDimensionValue(); }, componentDidMount: function componentDidMount() { (0, _utilsDeprecationWarning2['default'])('CollapsableMixin', 'CollapsibleMixin', link); } }); exports['default'] = CollapsableMixin; module.exports = exports['default']; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsTransitionEvents = __webpack_require__(66); var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents); var _utilsDeprecationWarning = __webpack_require__(62); var _utilsDeprecationWarning2 = _interopRequireDefault(_utilsDeprecationWarning); var CollapsibleMixin = { propTypes: { defaultExpanded: _react2['default'].PropTypes.bool, expanded: _react2['default'].PropTypes.bool }, getInitialState: function getInitialState() { var defaultExpanded = this.props.defaultExpanded != null ? this.props.defaultExpanded : this.props.expanded != null ? this.props.expanded : false; return { expanded: defaultExpanded, collapsing: false }; }, componentWillUpdate: function componentWillUpdate(nextProps, nextState) { var willExpanded = nextProps.expanded != null ? nextProps.expanded : nextState.expanded; if (willExpanded === this.isExpanded()) { return; } // if the expanded state is being toggled, ensure node has a dimension value // this is needed for the animation to work and needs to be set before // the collapsing class is applied (after collapsing is applied the in class // is removed and the node's dimension will be wrong) var node = this.getCollapsibleDOMNode(); var dimension = this.dimension(); var value = '0'; if (!willExpanded) { value = this.getCollapsibleDimensionValue(); } node.style[dimension] = value + 'px'; this._afterWillUpdate(); }, componentDidUpdate: function componentDidUpdate(prevProps, prevState) { // check if expanded is being toggled; if so, set collapsing this._checkToggleCollapsing(prevProps, prevState); // check if collapsing was turned on; if so, start animation this._checkStartAnimation(); }, // helps enable test stubs _afterWillUpdate: function _afterWillUpdate() {}, _checkStartAnimation: function _checkStartAnimation() { if (!this.state.collapsing) { return; } var node = this.getCollapsibleDOMNode(); var dimension = this.dimension(); var value = this.getCollapsibleDimensionValue(); // setting the dimension here starts the transition animation var result = undefined; if (this.isExpanded()) { result = value + 'px'; } else { result = '0px'; } node.style[dimension] = result; }, _checkToggleCollapsing: function _checkToggleCollapsing(prevProps, prevState) { var wasExpanded = prevProps.expanded != null ? prevProps.expanded : prevState.expanded; var isExpanded = this.isExpanded(); if (wasExpanded !== isExpanded) { if (wasExpanded) { this._handleCollapse(); } else { this._handleExpand(); } } }, _handleExpand: function _handleExpand() { var _this = this; var node = this.getCollapsibleDOMNode(); var dimension = this.dimension(); var complete = function complete() { _this._removeEndEventListener(node, complete); // remove dimension value - this ensures the collapsible item can grow // in dimension after initial display (such as an image loading) node.style[dimension] = ''; _this.setState({ collapsing: false }); }; this._addEndEventListener(node, complete); this.setState({ collapsing: true }); }, _handleCollapse: function _handleCollapse() { var _this2 = this; var node = this.getCollapsibleDOMNode(); var complete = function complete() { _this2._removeEndEventListener(node, complete); _this2.setState({ collapsing: false }); }; this._addEndEventListener(node, complete); this.setState({ collapsing: true }); }, // helps enable test stubs _addEndEventListener: function _addEndEventListener(node, complete) { _utilsTransitionEvents2['default'].addEndEventListener(node, complete); }, // helps enable test stubs _removeEndEventListener: function _removeEndEventListener(node, complete) { _utilsTransitionEvents2['default'].removeEndEventListener(node, complete); }, dimension: function dimension() { if (typeof this.getCollapsableDimension === 'function') { (0, _utilsDeprecationWarning2['default'])('CollapsableMixin.getCollapsableDimension()', 'CollapsibleMixin.getCollapsibleDimension()', 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'); return this.getCollapsableDimension(); } return typeof this.getCollapsibleDimension === 'function' ? this.getCollapsibleDimension() : 'height'; }, isExpanded: function isExpanded() { return this.props.expanded != null ? this.props.expanded : this.state.expanded; }, getCollapsibleClassSet: function getCollapsibleClassSet(className) { var classes = {}; if (typeof className === 'string') { className.split(' ').forEach(function (subClasses) { if (subClasses) { classes[subClasses] = true; } }); } classes.collapsing = this.state.collapsing; classes.collapse = !this.state.collapsing; classes['in'] = this.isExpanded() && !this.state.collapsing; return classes; } }; exports['default'] = CollapsibleMixin; module.exports = exports['default']; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _DropdownStateMixin = __webpack_require__(21); var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin); var _Button = __webpack_require__(8); var _Button2 = _interopRequireDefault(_Button); var _ButtonGroup = __webpack_require__(9); var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup); var _DropdownMenu = __webpack_require__(20); var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var DropdownButton = _react2['default'].createClass({ displayName: 'DropdownButton', mixins: [_BootstrapMixin2['default'], _DropdownStateMixin2['default']], propTypes: { pullRight: _react2['default'].PropTypes.bool, dropup: _react2['default'].PropTypes.bool, title: _react2['default'].PropTypes.node, href: _react2['default'].PropTypes.string, onClick: _react2['default'].PropTypes.func, onSelect: _react2['default'].PropTypes.func, navItem: _react2['default'].PropTypes.bool, noCaret: _react2['default'].PropTypes.bool, buttonClassName: _react2['default'].PropTypes.string }, render: function render() { var renderMethod = this.props.navItem ? 'renderNavItem' : 'renderButtonGroup'; var caret = this.props.noCaret ? null : _react2['default'].createElement('span', { className: 'caret' }); return this[renderMethod]([_react2['default'].createElement( _Button2['default'], _extends({}, this.props, { ref: 'dropdownButton', className: (0, _classnames2['default'])('dropdown-toggle', this.props.buttonClassName), onClick: (0, _utilsCreateChainedFunction2['default'])(this.props.onClick, this.handleDropdownClick), key: 0, navDropdown: this.props.navItem, navItem: null, title: null, pullRight: null, dropup: null }), this.props.title, ' ', caret ), _react2['default'].createElement( _DropdownMenu2['default'], { ref: 'menu', 'aria-labelledby': this.props.id, pullRight: this.props.pullRight, key: 1 }, _utilsValidComponentChildren2['default'].map(this.props.children, this.renderMenuItem) )]); }, renderButtonGroup: function renderButtonGroup(children) { var groupClasses = { 'open': this.state.open, 'dropup': this.props.dropup }; return _react2['default'].createElement( _ButtonGroup2['default'], { bsSize: this.props.bsSize, className: (0, _classnames2['default'])(this.props.className, groupClasses) }, children ); }, renderNavItem: function renderNavItem(children) { var classes = { 'dropdown': true, 'open': this.state.open, 'dropup': this.props.dropup }; return _react2['default'].createElement( 'li', { className: (0, _classnames2['default'])(this.props.className, classes) }, children ); }, renderMenuItem: function renderMenuItem(child, index) { // Only handle the option selection if an onSelect prop has been set on the // component or it's child, this allows a user not to pass an onSelect // handler and have the browser preform the default action. var handleOptionSelect = this.props.onSelect || child.props.onSelect ? this.handleOptionSelect : null; return (0, _react.cloneElement)(child, { // Capture onSelect events onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, handleOptionSelect), key: child.key ? child.key : index }); }, handleDropdownClick: function handleDropdownClick(e) { e.preventDefault(); this.setDropdownState(!this.state.open); }, handleOptionSelect: function handleOptionSelect(key) { if (this.props.onSelect) { this.props.onSelect(key); } this.setDropdownState(false); } }); exports['default'] = DropdownButton; module.exports = exports['default']; /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var DropdownMenu = _react2['default'].createClass({ displayName: 'DropdownMenu', propTypes: { pullRight: _react2['default'].PropTypes.bool, onSelect: _react2['default'].PropTypes.func }, render: function render() { var classes = { 'dropdown-menu': true, 'dropdown-menu-right': this.props.pullRight }; return _react2['default'].createElement( 'ul', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), role: 'menu' }), _utilsValidComponentChildren2['default'].map(this.props.children, this.renderMenuItem) ); }, renderMenuItem: function renderMenuItem(child, index) { return (0, _react.cloneElement)(child, { // Capture onSelect events onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect), // Force special props to be transferred key: child.key ? child.key : index }); } }); exports['default'] = DropdownMenu; module.exports = exports['default']; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsEventListener = __webpack_require__(58); var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener); /** * Checks whether a node is within * a root nodes tree * * @param {DOMElement} node * @param {DOMElement} root * @returns {boolean} */ function isNodeInRoot(node, root) { while (node) { if (node === root) { return true; } node = node.parentNode; } return false; } var DropdownStateMixin = { getInitialState: function getInitialState() { return { open: false }; }, setDropdownState: function setDropdownState(newState, onStateChangeComplete) { if (newState) { this.bindRootCloseHandlers(); } else { this.unbindRootCloseHandlers(); } this.setState({ open: newState }, onStateChangeComplete); }, handleDocumentKeyUp: function handleDocumentKeyUp(e) { if (e.keyCode === 27) { this.setDropdownState(false); } }, handleDocumentClick: function handleDocumentClick(e) { // If the click originated from within this component // don't do anything. if (isNodeInRoot(e.target, _react2['default'].findDOMNode(this))) { return; } this.setDropdownState(false); }, bindRootCloseHandlers: function bindRootCloseHandlers() { var doc = _utilsDomUtils2['default'].ownerDocument(this); this._onDocumentClickListener = _utilsEventListener2['default'].listen(doc, 'click', this.handleDocumentClick); this._onDocumentKeyupListener = _utilsEventListener2['default'].listen(doc, 'keyup', this.handleDocumentKeyUp); }, unbindRootCloseHandlers: function unbindRootCloseHandlers() { if (this._onDocumentClickListener) { this._onDocumentClickListener.remove(); } if (this._onDocumentKeyupListener) { this._onDocumentKeyupListener.remove(); } }, componentWillUnmount: function componentWillUnmount() { this.unbindRootCloseHandlers(); } }; exports['default'] = DropdownStateMixin; module.exports = exports['default']; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); // TODO: listen for onTransitionEnd to remove el function getElementsAndSelf(root, classes) { var els = root.querySelectorAll('.' + classes.join('.')); els = [].map.call(els, function (e) { return e; }); for (var i = 0; i < classes.length; i++) { if (!root.className.match(new RegExp('\\b' + classes[i] + '\\b'))) { return els; } } els.unshift(root); return els; } exports['default'] = { _fadeIn: function _fadeIn() { var els = undefined; if (this.isMounted()) { els = getElementsAndSelf(_react2['default'].findDOMNode(this), ['fade']); if (els.length) { els.forEach(function (el) { el.className += ' in'; }); } } }, _fadeOut: function _fadeOut() { var els = getElementsAndSelf(this._fadeOutEl, ['fade', 'in']); if (els.length) { els.forEach(function (el) { el.className = el.className.replace(/\bin\b/, ''); }); } setTimeout(this._handleFadeOutEnd, 300); }, _handleFadeOutEnd: function _handleFadeOutEnd() { if (this._fadeOutEl && this._fadeOutEl.parentNode) { this._fadeOutEl.parentNode.removeChild(this._fadeOutEl); } }, componentDidMount: function componentDidMount() { if (document.querySelectorAll) { // Firefox needs delay for transition to be triggered setTimeout(this._fadeIn, 20); } }, componentWillUnmount: function componentWillUnmount() { var els = getElementsAndSelf(_react2['default'].findDOMNode(this), ['fade']), container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body; if (els.length) { this._fadeOutEl = document.createElement('div'); container.appendChild(this._fadeOutEl); this._fadeOutEl.appendChild(_react2['default'].findDOMNode(this).cloneNode(true)); // Firefox needs delay for transition to be triggered setTimeout(this._fadeOut, 20); } } }; module.exports = exports['default']; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _styleMaps = __webpack_require__(54); var _styleMaps2 = _interopRequireDefault(_styleMaps); var Glyphicon = _react2['default'].createClass({ displayName: 'Glyphicon', mixins: [_BootstrapMixin2['default']], propTypes: { glyph: _react2['default'].PropTypes.oneOf(_styleMaps2['default'].GLYPHS).isRequired }, getDefaultProps: function getDefaultProps() { return { bsClass: 'glyphicon' }; }, render: function render() { var classes = this.getBsClassSet(); classes['glyphicon-' + this.props.glyph] = true; return _react2['default'].createElement( 'span', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = Glyphicon; module.exports = exports['default']; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var Grid = _react2['default'].createClass({ displayName: 'Grid', propTypes: { fluid: _react2['default'].PropTypes.bool, componentClass: _react2['default'].PropTypes.node.isRequired }, getDefaultProps: function getDefaultProps() { return { componentClass: 'div' }; }, render: function render() { var ComponentClass = this.props.componentClass; var className = this.props.fluid ? 'container-fluid' : 'container'; return _react2['default'].createElement( ComponentClass, _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, className) }), this.props.children ); } }); exports['default'] = Grid; module.exports = exports['default']; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _InputBase2 = __webpack_require__(61); var _InputBase3 = _interopRequireDefault(_InputBase2); var _ButtonInput = __webpack_require__(10); var _ButtonInput2 = _interopRequireDefault(_ButtonInput); var _utilsDeprecationWarning = __webpack_require__(62); var _utilsDeprecationWarning2 = _interopRequireDefault(_utilsDeprecationWarning); var buttonTypes = ['button', 'reset', 'submit']; var Input = (function (_InputBase) { function Input() { _classCallCheck(this, Input); if (_InputBase != null) { _InputBase.apply(this, arguments); } } _inherits(Input, _InputBase); _createClass(Input, [{ key: 'render', value: function render() { if (buttonTypes.indexOf(this.props.type) > -1) { (0, _utilsDeprecationWarning2['default'])('Input type=' + this.props.type, 'ButtonInput'); return _react2['default'].createElement(_ButtonInput2['default'], this.props); } return _get(Object.getPrototypeOf(Input.prototype), 'render', this).call(this); } }]); return Input; })(_InputBase3['default']); exports['default'] = Input; module.exports = exports['default']; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { // https://www.npmjs.org/package/react-interpolate-component // TODO: Drop this in favor of es6 string interpolation 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsObjectAssign = __webpack_require__(63); var _utilsObjectAssign2 = _interopRequireDefault(_utilsObjectAssign); var REGEXP = /\%\((.+?)\)s/; var Interpolate = _react2['default'].createClass({ displayName: 'Interpolate', propTypes: { format: _react2['default'].PropTypes.string }, getDefaultProps: function getDefaultProps() { return { component: 'span' }; }, render: function render() { var format = _utilsValidComponentChildren2['default'].hasValidComponent(this.props.children) || typeof this.props.children === 'string' ? this.props.children : this.props.format; var parent = this.props.component; var unsafe = this.props.unsafe === true; var props = (0, _utilsObjectAssign2['default'])({}, this.props); delete props.children; delete props.format; delete props.component; delete props.unsafe; if (unsafe) { var content = format.split(REGEXP).reduce(function (memo, match, index) { var html = undefined; if (index % 2 === 0) { html = match; } else { html = props[match]; delete props[match]; } if (_react2['default'].isValidElement(html)) { throw new Error('cannot interpolate a React component into unsafe text'); } memo += html; return memo; }, ''); props.dangerouslySetInnerHTML = { __html: content }; return _react2['default'].createElement(parent, props); } else { var kids = format.split(REGEXP).reduce(function (memo, match, index) { var child = undefined; if (index % 2 === 0) { if (match.length === 0) { return memo; } child = match; } else { child = props[match]; delete props[match]; } memo.push(child); return memo; }, []); return _react2['default'].createElement(parent, props, kids); } } }); exports['default'] = Interpolate; module.exports = exports['default']; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var Jumbotron = _react2['default'].createClass({ displayName: 'Jumbotron', render: function render() { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'jumbotron') }), this.props.children ); } }); exports['default'] = Jumbotron; module.exports = exports['default']; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var Label = _react2['default'].createClass({ displayName: 'Label', mixins: [_BootstrapMixin2['default']], getDefaultProps: function getDefaultProps() { return { bsClass: 'label', bsStyle: 'default' }; }, render: function render() { var classes = this.getBsClassSet(); return _react2['default'].createElement( 'span', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = Label; module.exports = exports['default']; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var ListGroupItem = _react2['default'].createClass({ displayName: 'ListGroupItem', mixins: [_BootstrapMixin2['default']], propTypes: { bsStyle: _react2['default'].PropTypes.oneOf(['danger', 'info', 'success', 'warning']), className: _react2['default'].PropTypes.string, active: _react2['default'].PropTypes.any, disabled: _react2['default'].PropTypes.any, header: _react2['default'].PropTypes.node, listItem: _react2['default'].PropTypes.bool, onClick: _react2['default'].PropTypes.func, eventKey: _react2['default'].PropTypes.any, href: _react2['default'].PropTypes.string, target: _react2['default'].PropTypes.string }, getDefaultProps: function getDefaultProps() { return { bsClass: 'list-group-item' }; }, render: function render() { var classes = this.getBsClassSet(); classes.active = this.props.active; classes.disabled = this.props.disabled; if (this.props.href || this.props.onClick) { return this.renderAnchor(classes); } else if (this.props.listItem) { return this.renderLi(classes); } else { return this.renderSpan(classes); } }, renderLi: function renderLi(classes) { return _react2['default'].createElement( 'li', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.header ? this.renderStructuredContent() : this.props.children ); }, renderAnchor: function renderAnchor(classes) { return _react2['default'].createElement( 'a', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.header ? this.renderStructuredContent() : this.props.children ); }, renderSpan: function renderSpan(classes) { return _react2['default'].createElement( 'span', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.header ? this.renderStructuredContent() : this.props.children ); }, renderStructuredContent: function renderStructuredContent() { var header = undefined; if (_react2['default'].isValidElement(this.props.header)) { header = (0, _react.cloneElement)(this.props.header, { key: 'header', className: (0, _classnames2['default'])(this.props.header.props.className, 'list-group-item-heading') }); } else { header = _react2['default'].createElement( 'h4', { key: 'header', className: 'list-group-item-heading' }, this.props.header ); } var content = _react2['default'].createElement( 'p', { key: 'content', className: 'list-group-item-text' }, this.props.children ); return [header, content]; } }); exports['default'] = ListGroupItem; module.exports = exports['default']; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var MenuItem = _react2['default'].createClass({ displayName: 'MenuItem', propTypes: { header: _react2['default'].PropTypes.bool, divider: _react2['default'].PropTypes.bool, href: _react2['default'].PropTypes.string, title: _react2['default'].PropTypes.string, target: _react2['default'].PropTypes.string, onSelect: _react2['default'].PropTypes.func, eventKey: _react2['default'].PropTypes.any, active: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { href: '#', active: false }; }, handleClick: function handleClick(e) { if (this.props.onSelect) { e.preventDefault(); this.props.onSelect(this.props.eventKey, this.props.href, this.props.target); } }, renderAnchor: function renderAnchor() { return _react2['default'].createElement( 'a', { onClick: this.handleClick, href: this.props.href, target: this.props.target, title: this.props.title, tabIndex: '-1' }, this.props.children ); }, render: function render() { var classes = { 'dropdown-header': this.props.header, 'divider': this.props.divider, 'active': this.props.active }; var children = null; if (this.props.header) { children = this.props.children; } else if (!this.props.divider) { children = this.renderAnchor(); } return _react2['default'].createElement( 'li', _extends({}, this.props, { role: 'presentation', title: null, href: null, className: (0, _classnames2['default'])(this.props.className, classes) }), children ); } }); exports['default'] = MenuItem; module.exports = exports['default']; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _FadeMixin = __webpack_require__(22); var _FadeMixin2 = _interopRequireDefault(_FadeMixin); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsEventListener = __webpack_require__(58); var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener); // TODO: // - aria-labelledby // - Add `modal-body` div if only one child passed in that doesn't already have it // - Tests var Modal = _react2['default'].createClass({ displayName: 'Modal', mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']], propTypes: { title: _react2['default'].PropTypes.node, backdrop: _react2['default'].PropTypes.oneOf(['static', true, false]), keyboard: _react2['default'].PropTypes.bool, closeButton: _react2['default'].PropTypes.bool, animation: _react2['default'].PropTypes.bool, onRequestHide: _react2['default'].PropTypes.func.isRequired }, getDefaultProps: function getDefaultProps() { return { bsClass: 'modal', backdrop: true, keyboard: true, animation: true, closeButton: true }; }, render: function render() { var modalStyle = { display: 'block' }; var dialogClasses = this.getBsClassSet(); delete dialogClasses.modal; dialogClasses['modal-dialog'] = true; var classes = { modal: true, fade: this.props.animation, 'in': !this.props.animation || !document.querySelectorAll }; var modal = _react2['default'].createElement( 'div', _extends({}, this.props, { title: null, tabIndex: '-1', role: 'dialog', style: modalStyle, className: (0, _classnames2['default'])(this.props.className, classes), onClick: this.props.backdrop === true ? this.handleBackdropClick : null, ref: 'modal' }), _react2['default'].createElement( 'div', { className: (0, _classnames2['default'])(dialogClasses) }, _react2['default'].createElement( 'div', { className: 'modal-content' }, this.props.title ? this.renderHeader() : null, this.props.children ) ) ); return this.props.backdrop ? this.renderBackdrop(modal) : modal; }, renderBackdrop: function renderBackdrop(modal) { var classes = { 'modal-backdrop': true, 'fade': this.props.animation }; classes['in'] = !this.props.animation || !document.querySelectorAll; var onClick = this.props.backdrop === true ? this.handleBackdropClick : null; return _react2['default'].createElement( 'div', null, _react2['default'].createElement('div', { className: (0, _classnames2['default'])(classes), ref: 'backdrop', onClick: onClick }), modal ); }, renderHeader: function renderHeader() { var closeButton = undefined; if (this.props.closeButton) { closeButton = _react2['default'].createElement( 'button', { type: 'button', className: 'close', 'aria-hidden': 'true', onClick: this.props.onRequestHide }, '×' ); } return _react2['default'].createElement( 'div', { className: 'modal-header' }, closeButton, this.renderTitle() ); }, renderTitle: function renderTitle() { return _react2['default'].isValidElement(this.props.title) ? this.props.title : _react2['default'].createElement( 'h4', { className: 'modal-title' }, this.props.title ); }, iosClickHack: function iosClickHack() { // IOS only allows click events to be delegated to the document on elements // it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the // DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169 _react2['default'].findDOMNode(this.refs.modal).onclick = function () {}; _react2['default'].findDOMNode(this.refs.backdrop).onclick = function () {}; }, componentDidMount: function componentDidMount() { this._onDocumentKeyupListener = _utilsEventListener2['default'].listen(_utilsDomUtils2['default'].ownerDocument(this), 'keyup', this.handleDocumentKeyUp); var container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body; container.className += container.className.length ? ' modal-open' : 'modal-open'; if (this.props.backdrop) { this.iosClickHack(); } }, componentDidUpdate: function componentDidUpdate(prevProps) { if (this.props.backdrop && this.props.backdrop !== prevProps.backdrop) { this.iosClickHack(); } }, componentWillUnmount: function componentWillUnmount() { this._onDocumentKeyupListener.remove(); var container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body; container.className = container.className.replace(/ ?modal-open/, ''); }, handleBackdropClick: function handleBackdropClick(e) { if (e.target !== e.currentTarget) { return; } this.props.onRequestHide(); }, handleDocumentKeyUp: function handleDocumentKeyUp(e) { if (this.props.keyboard && e.keyCode === 27) { this.props.onRequestHide(); } } }); exports['default'] = Modal; module.exports = exports['default']; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _CollapsibleMixin = __webpack_require__(18); var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsDeprecatedProperty = __webpack_require__(64); var _utilsDeprecatedProperty2 = _interopRequireDefault(_utilsDeprecatedProperty); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var Nav = _react2['default'].createClass({ displayName: 'Nav', mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']], propTypes: { activeHref: _react2['default'].PropTypes.string, activeKey: _react2['default'].PropTypes.any, bsStyle: _react2['default'].PropTypes.oneOf(['tabs', 'pills']), stacked: _react2['default'].PropTypes.bool, justified: _react2['default'].PropTypes.bool, onSelect: _react2['default'].PropTypes.func, collapsable: _utilsDeprecatedProperty2['default'], collapsible: _react2['default'].PropTypes.bool, expanded: _react2['default'].PropTypes.bool, navbar: _react2['default'].PropTypes.bool, eventKey: _react2['default'].PropTypes.any, pullRight: _react2['default'].PropTypes.bool, right: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { bsClass: 'nav' }; }, getCollapsibleDOMNode: function getCollapsibleDOMNode() { return _react2['default'].findDOMNode(this); }, getCollapsibleDimensionValue: function getCollapsibleDimensionValue() { var node = _react2['default'].findDOMNode(this.refs.ul), height = node.offsetHeight, computedStyles = _utilsDomUtils2['default'].getComputedStyles(node); return height + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10); }, render: function render() { var collapsible = this.props.collapsible || this.props.collapsable; var classes = collapsible ? this.getCollapsibleClassSet() : {}; classes['navbar-collapse'] = collapsible; if (this.props.navbar && !collapsible) { return this.renderUl(); } return _react2['default'].createElement( 'nav', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.renderUl() ); }, renderUl: function renderUl() { var classes = this.getBsClassSet(); classes['nav-stacked'] = this.props.stacked; classes['nav-justified'] = this.props.justified; classes['navbar-nav'] = this.props.navbar; classes['pull-right'] = this.props.pullRight; classes['navbar-right'] = this.props.right; return _react2['default'].createElement( 'ul', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), ref: 'ul' }), _utilsValidComponentChildren2['default'].map(this.props.children, this.renderNavItem) ); }, getChildActiveProp: function getChildActiveProp(child) { if (child.props.active) { return true; } if (this.props.activeKey != null) { if (child.props.eventKey === this.props.activeKey) { return true; } } if (this.props.activeHref != null) { if (child.props.href === this.props.activeHref) { return true; } } return child.props.active; }, renderNavItem: function renderNavItem(child, index) { return (0, _react.cloneElement)(child, { active: this.getChildActiveProp(child), activeKey: this.props.activeKey, activeHref: this.props.activeHref, onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect), key: child.key ? child.key : index, navItem: true }); } }); exports['default'] = Nav; module.exports = exports['default']; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var Navbar = _react2['default'].createClass({ displayName: 'Navbar', mixins: [_BootstrapMixin2['default']], propTypes: { fixedTop: _react2['default'].PropTypes.bool, fixedBottom: _react2['default'].PropTypes.bool, staticTop: _react2['default'].PropTypes.bool, inverse: _react2['default'].PropTypes.bool, fluid: _react2['default'].PropTypes.bool, role: _react2['default'].PropTypes.string, componentClass: _react2['default'].PropTypes.node.isRequired, brand: _react2['default'].PropTypes.node, toggleButton: _react2['default'].PropTypes.node, toggleNavKey: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.number]), onToggle: _react2['default'].PropTypes.func, navExpanded: _react2['default'].PropTypes.bool, defaultNavExpanded: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { bsClass: 'navbar', bsStyle: 'default', role: 'navigation', componentClass: 'nav' }; }, getInitialState: function getInitialState() { return { navExpanded: this.props.defaultNavExpanded }; }, shouldComponentUpdate: function shouldComponentUpdate() { // Defer any updates to this component during the `onSelect` handler. return !this._isChanging; }, handleToggle: function handleToggle() { if (this.props.onToggle) { this._isChanging = true; this.props.onToggle(); this._isChanging = false; } this.setState({ navExpanded: !this.state.navExpanded }); }, isNavExpanded: function isNavExpanded() { return this.props.navExpanded != null ? this.props.navExpanded : this.state.navExpanded; }, render: function render() { var classes = this.getBsClassSet(); var ComponentClass = this.props.componentClass; classes['navbar-fixed-top'] = this.props.fixedTop; classes['navbar-fixed-bottom'] = this.props.fixedBottom; classes['navbar-static-top'] = this.props.staticTop; classes['navbar-inverse'] = this.props.inverse; return _react2['default'].createElement( ComponentClass, _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement( 'div', { className: this.props.fluid ? 'container-fluid' : 'container' }, this.props.brand || this.props.toggleButton || this.props.toggleNavKey != null ? this.renderHeader() : null, _utilsValidComponentChildren2['default'].map(this.props.children, this.renderChild) ) ); }, renderChild: function renderChild(child, index) { return (0, _react.cloneElement)(child, { navbar: true, collapsible: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey, expanded: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey && this.isNavExpanded(), key: child.key ? child.key : index }); }, renderHeader: function renderHeader() { var brand = undefined; if (this.props.brand) { if (_react2['default'].isValidElement(this.props.brand)) { brand = (0, _react.cloneElement)(this.props.brand, { className: (0, _classnames2['default'])(this.props.brand.props.className, 'navbar-brand') }); } else { brand = _react2['default'].createElement( 'span', { className: 'navbar-brand' }, this.props.brand ); } } return _react2['default'].createElement( 'div', { className: 'navbar-header' }, brand, this.props.toggleButton || this.props.toggleNavKey != null ? this.renderToggleButton() : null ); }, renderToggleButton: function renderToggleButton() { var children = undefined; if (_react2['default'].isValidElement(this.props.toggleButton)) { return (0, _react.cloneElement)(this.props.toggleButton, { className: (0, _classnames2['default'])(this.props.toggleButton.props.className, 'navbar-toggle'), onClick: (0, _utilsCreateChainedFunction2['default'])(this.handleToggle, this.props.toggleButton.props.onClick) }); } children = this.props.toggleButton != null ? this.props.toggleButton : [_react2['default'].createElement( 'span', { className: 'sr-only', key: 0 }, 'Toggle navigation' ), _react2['default'].createElement('span', { className: 'icon-bar', key: 1 }), _react2['default'].createElement('span', { className: 'icon-bar', key: 2 }), _react2['default'].createElement('span', { className: 'icon-bar', key: 3 })]; return _react2['default'].createElement( 'button', { className: 'navbar-toggle', type: 'button', onClick: this.handleToggle }, children ); } }); exports['default'] = Navbar; module.exports = exports['default']; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var ListGroup = (function (_React$Component) { function ListGroup() { _classCallCheck(this, ListGroup); if (_React$Component != null) { _React$Component.apply(this, arguments); } } _inherits(ListGroup, _React$Component); _createClass(ListGroup, [{ key: 'render', value: function render() { var _this = this; var items = _utilsValidComponentChildren2['default'].map(this.props.children, function (item, index) { return (0, _react.cloneElement)(item, { key: item.key ? item.key : index }); }); var childrenAnchors = false; if (!this.props.children) { return this.renderDiv(items); } else if (_react2['default'].Children.count(this.props.children) === 1 && !Array.isArray(this.props.children)) { var child = this.props.children; childrenAnchors = this.isAnchor(child.props); } else { childrenAnchors = Array.prototype.some.call(this.props.children, function (child) { return !Array.isArray(child) ? _this.isAnchor(child.props) : Array.prototype.some.call(child, function (subChild) { return _this.isAnchor(subChild.props); }); }); } if (childrenAnchors) { return this.renderDiv(items); } else { return this.renderUL(items); } } }, { key: 'isAnchor', value: function isAnchor(props) { return props.href || props.onClick; } }, { key: 'renderUL', value: function renderUL(items) { var listItems = _utilsValidComponentChildren2['default'].map(items, function (item, index) { return (0, _react.cloneElement)(item, { listItem: true }); }); return _react2['default'].createElement( 'ul', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'list-group') }), listItems ); } }, { key: 'renderDiv', value: function renderDiv(items) { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'list-group') }), items ); } }]); return ListGroup; })(_react2['default'].Component); ListGroup.propTypes = { className: _react2['default'].PropTypes.string, id: _react2['default'].PropTypes.string }; exports['default'] = ListGroup; module.exports = exports['default']; /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _OverlayMixin = __webpack_require__(37); var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var _utilsCreateContextWrapper = __webpack_require__(67); var _utilsCreateContextWrapper2 = _interopRequireDefault(_utilsCreateContextWrapper); var ModalTrigger = _react2['default'].createClass({ displayName: 'ModalTrigger', mixins: [_OverlayMixin2['default']], propTypes: { modal: _react2['default'].PropTypes.node.isRequired }, getInitialState: function getInitialState() { return { isOverlayShown: false }; }, show: function show() { this.setState({ isOverlayShown: true }); }, hide: function hide() { this.setState({ isOverlayShown: false }); }, toggle: function toggle() { this.setState({ isOverlayShown: !this.state.isOverlayShown }); }, renderOverlay: function renderOverlay() { if (!this.state.isOverlayShown) { return _react2['default'].createElement('span', null); } return (0, _react.cloneElement)(this.props.modal, { onRequestHide: this.hide }); }, render: function render() { var child = _react2['default'].Children.only(this.props.children); var props = {}; props.onClick = (0, _utilsCreateChainedFunction2['default'])(child.props.onClick, this.toggle); props.onMouseOver = (0, _utilsCreateChainedFunction2['default'])(child.props.onMouseOver, this.props.onMouseOver); props.onMouseOut = (0, _utilsCreateChainedFunction2['default'])(child.props.onMouseOut, this.props.onMouseOut); props.onFocus = (0, _utilsCreateChainedFunction2['default'])(child.props.onFocus, this.props.onFocus); props.onBlur = (0, _utilsCreateChainedFunction2['default'])(child.props.onBlur, this.props.onBlur); return (0, _react.cloneElement)(child, props); } }); /** * Creates a new ModalTrigger class that forwards the relevant context * * This static method should only be called at the module level, instead of in * e.g. a render() method, because it's expensive to create new classes. * * For example, you would want to have: * * > export default ModalTrigger.withContext({ * > myContextKey: React.PropTypes.object * > }); * * and import this when needed. */ ModalTrigger.withContext = (0, _utilsCreateContextWrapper2['default'])(ModalTrigger, 'modal'); exports['default'] = ModalTrigger; module.exports = exports['default']; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _OverlayMixin = __webpack_require__(37); var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var _utilsObjectAssign = __webpack_require__(63); var _utilsObjectAssign2 = _interopRequireDefault(_utilsObjectAssign); var _utilsCreateContextWrapper = __webpack_require__(67); var _utilsCreateContextWrapper2 = _interopRequireDefault(_utilsCreateContextWrapper); /** * Check if value one is inside or equal to the of value * * @param {string} one * @param {string|array} of * @returns {boolean} */ function isOneOf(one, of) { if (Array.isArray(of)) { return of.indexOf(one) >= 0; } return one === of; } var OverlayTrigger = _react2['default'].createClass({ displayName: 'OverlayTrigger', mixins: [_OverlayMixin2['default']], propTypes: { trigger: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.oneOf(['manual', 'click', 'hover', 'focus']), _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.oneOf(['click', 'hover', 'focus']))]), placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']), delay: _react2['default'].PropTypes.number, delayShow: _react2['default'].PropTypes.number, delayHide: _react2['default'].PropTypes.number, defaultOverlayShown: _react2['default'].PropTypes.bool, overlay: _react2['default'].PropTypes.node.isRequired, containerPadding: _react2['default'].PropTypes.number }, getDefaultProps: function getDefaultProps() { return { placement: 'right', trigger: ['hover', 'focus'], containerPadding: 0 }; }, getInitialState: function getInitialState() { return { isOverlayShown: this.props.defaultOverlayShown == null ? false : this.props.defaultOverlayShown, overlayLeft: null, overlayTop: null, arrowOffsetLeft: null, arrowOffsetTop: null }; }, show: function show() { this.setState({ isOverlayShown: true }, function () { this.updateOverlayPosition(); }); }, hide: function hide() { this.setState({ isOverlayShown: false }); }, toggle: function toggle() { if (this.state.isOverlayShown) { this.hide(); } else { this.show(); } }, renderOverlay: function renderOverlay() { if (!this.state.isOverlayShown) { return _react2['default'].createElement('span', null); } return (0, _react.cloneElement)(this.props.overlay, { onRequestHide: this.hide, placement: this.props.placement, positionLeft: this.state.overlayLeft, positionTop: this.state.overlayTop, arrowOffsetLeft: this.state.arrowOffsetLeft, arrowOffsetTop: this.state.arrowOffsetTop }); }, render: function render() { var child = _react2['default'].Children.only(this.props.children); if (this.props.trigger === 'manual') { return child; } var props = {}; props.onClick = (0, _utilsCreateChainedFunction2['default'])(child.props.onClick, this.props.onClick); if (isOneOf('click', this.props.trigger)) { props.onClick = (0, _utilsCreateChainedFunction2['default'])(this.toggle, props.onClick); } if (isOneOf('hover', this.props.trigger)) { props.onMouseOver = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedShow, this.props.onMouseOver); props.onMouseOut = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedHide, this.props.onMouseOut); } if (isOneOf('focus', this.props.trigger)) { props.onFocus = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedShow, this.props.onFocus); props.onBlur = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedHide, this.props.onBlur); } return (0, _react.cloneElement)(child, props); }, componentWillUnmount: function componentWillUnmount() { clearTimeout(this._hoverDelay); }, componentDidMount: function componentDidMount() { if (this.props.defaultOverlayShown) { this.updateOverlayPosition(); } }, handleDelayedShow: function handleDelayedShow() { if (this._hoverDelay != null) { clearTimeout(this._hoverDelay); this._hoverDelay = null; return; } var delay = this.props.delayShow != null ? this.props.delayShow : this.props.delay; if (!delay) { this.show(); return; } this._hoverDelay = setTimeout((function () { this._hoverDelay = null; this.show(); }).bind(this), delay); }, handleDelayedHide: function handleDelayedHide() { if (this._hoverDelay != null) { clearTimeout(this._hoverDelay); this._hoverDelay = null; return; } var delay = this.props.delayHide != null ? this.props.delayHide : this.props.delay; if (!delay) { this.hide(); return; } this._hoverDelay = setTimeout((function () { this._hoverDelay = null; this.hide(); }).bind(this), delay); }, updateOverlayPosition: function updateOverlayPosition() { if (!this.isMounted()) { return; } this.setState(this.calcOverlayPosition()); }, calcOverlayPosition: function calcOverlayPosition() { var childOffset = this.getPosition(); var overlayNode = this.getOverlayDOMNode(); var overlayHeight = overlayNode.offsetHeight; var overlayWidth = overlayNode.offsetWidth; var placement = this.props.placement; var overlayLeft = undefined, overlayTop = undefined, arrowOffsetLeft = undefined, arrowOffsetTop = undefined; if (placement === 'left' || placement === 'right') { overlayTop = childOffset.top + (childOffset.height - overlayHeight) / 2; if (placement === 'left') { overlayLeft = childOffset.left - overlayWidth; } else { overlayLeft = childOffset.left + childOffset.width; } var topDelta = this._getTopDelta(overlayTop, overlayHeight); overlayTop += topDelta; arrowOffsetTop = 50 * (1 - 2 * topDelta / overlayHeight) + '%'; arrowOffsetLeft = null; } else if (placement === 'top' || placement === 'bottom') { overlayLeft = childOffset.left + (childOffset.width - overlayWidth) / 2; if (placement === 'top') { overlayTop = childOffset.top - overlayHeight; } else { overlayTop = childOffset.top + childOffset.height; } var leftDelta = this._getLeftDelta(overlayLeft, overlayWidth); overlayLeft += leftDelta; arrowOffsetLeft = 50 * (1 - 2 * leftDelta / overlayWidth) + '%'; arrowOffsetTop = null; } else { throw new Error('calcOverlayPosition(): No such placement of "' + this.props.placement + '" found.'); } return { overlayLeft: overlayLeft, overlayTop: overlayTop, arrowOffsetLeft: arrowOffsetLeft, arrowOffsetTop: arrowOffsetTop }; }, _getTopDelta: function _getTopDelta(top, overlayHeight) { var containerDimensions = this._getContainerDimensions(); var containerScroll = containerDimensions.scroll; var containerHeight = containerDimensions.height; var padding = this.props.containerPadding; var topEdgeOffset = top - padding - containerScroll; var bottomEdgeOffset = top + padding - containerScroll + overlayHeight; if (topEdgeOffset < 0) { return -topEdgeOffset; } else if (bottomEdgeOffset > containerHeight) { return containerHeight - bottomEdgeOffset; } else { return 0; } }, _getLeftDelta: function _getLeftDelta(left, overlayWidth) { var containerDimensions = this._getContainerDimensions(); var containerWidth = containerDimensions.width; var padding = this.props.containerPadding; var leftEdgeOffset = left - padding; var rightEdgeOffset = left + padding + overlayWidth; if (leftEdgeOffset < 0) { return -leftEdgeOffset; } else if (rightEdgeOffset > containerWidth) { return containerWidth - rightEdgeOffset; } else { return 0; } }, _getContainerDimensions: function _getContainerDimensions() { var containerNode = this.getContainerDOMNode(); var width = undefined, height = undefined; if (containerNode.tagName === 'BODY') { width = window.innerWidth; height = window.innerHeight; } else { width = containerNode.offsetWidth; height = containerNode.offsetHeight; } return { width: width, height: height, scroll: containerNode.scrollTop }; }, getPosition: function getPosition() { var node = _react2['default'].findDOMNode(this); var container = this.getContainerDOMNode(); var offset = container.tagName === 'BODY' ? _utilsDomUtils2['default'].getOffset(node) : _utilsDomUtils2['default'].getPosition(node, container); return (0, _utilsObjectAssign2['default'])({}, offset, { height: node.offsetHeight, width: node.offsetWidth }); } }); /** * Creates a new OverlayTrigger class that forwards the relevant context * * This static method should only be called at the module level, instead of in * e.g. a render() method, because it's expensive to create new classes. * * For example, you would want to have: * * > export default OverlayTrigger.withContext({ * > myContextKey: React.PropTypes.object * > }); * * and import this when needed. */ OverlayTrigger.withContext = (0, _utilsCreateContextWrapper2['default'])(OverlayTrigger, 'overlay'); exports['default'] = OverlayTrigger; module.exports = exports['default']; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _utilsCustomPropTypes = __webpack_require__(59); var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes); var _utilsDomUtils = __webpack_require__(57); var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils); exports['default'] = { propTypes: { container: _utilsCustomPropTypes2['default'].mountable }, componentWillUnmount: function componentWillUnmount() { this._unrenderOverlay(); if (this._overlayTarget) { this.getContainerDOMNode().removeChild(this._overlayTarget); this._overlayTarget = null; } }, componentDidUpdate: function componentDidUpdate() { this._renderOverlay(); }, componentDidMount: function componentDidMount() { this._renderOverlay(); }, _mountOverlayTarget: function _mountOverlayTarget() { this._overlayTarget = document.createElement('div'); this.getContainerDOMNode().appendChild(this._overlayTarget); }, _renderOverlay: function _renderOverlay() { if (!this._overlayTarget) { this._mountOverlayTarget(); } var overlay = this.renderOverlay(); // Save reference to help testing if (overlay !== null) { this._overlayInstance = _react2['default'].render(overlay, this._overlayTarget); } else { // Unrender if the component is null for transitions to null this._unrenderOverlay(); } }, _unrenderOverlay: function _unrenderOverlay() { _react2['default'].unmountComponentAtNode(this._overlayTarget); this._overlayInstance = null; }, getOverlayDOMNode: function getOverlayDOMNode() { if (!this.isMounted()) { throw new Error('getOverlayDOMNode(): A component must be mounted to have a DOM node.'); } if (this._overlayInstance) { return _react2['default'].findDOMNode(this._overlayInstance); } return null; }, getContainerDOMNode: function getContainerDOMNode() { return _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body; } }; module.exports = exports['default']; /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var PageHeader = _react2['default'].createClass({ displayName: 'PageHeader', render: function render() { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'page-header') }), _react2['default'].createElement( 'h1', null, this.props.children ) ); } }); exports['default'] = PageHeader; module.exports = exports['default']; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _CollapsibleMixin = __webpack_require__(18); var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin); var _utilsDeprecatedProperty = __webpack_require__(64); var _utilsDeprecatedProperty2 = _interopRequireDefault(_utilsDeprecatedProperty); var Panel = _react2['default'].createClass({ displayName: 'Panel', mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']], propTypes: { collapsable: _utilsDeprecatedProperty2['default'], collapsible: _react2['default'].PropTypes.bool, onSelect: _react2['default'].PropTypes.func, header: _react2['default'].PropTypes.node, id: _react2['default'].PropTypes.string, footer: _react2['default'].PropTypes.node, eventKey: _react2['default'].PropTypes.any }, getDefaultProps: function getDefaultProps() { return { bsClass: 'panel', bsStyle: 'default' }; }, handleSelect: function handleSelect(e) { e.selected = true; if (this.props.onSelect) { this.props.onSelect(e, this.props.eventKey); } else { e.preventDefault(); } if (e.selected) { this.handleToggle(); } }, handleToggle: function handleToggle() { this.setState({ expanded: !this.state.expanded }); }, getCollapsibleDimensionValue: function getCollapsibleDimensionValue() { return _react2['default'].findDOMNode(this.refs.panel).scrollHeight; }, getCollapsibleDOMNode: function getCollapsibleDOMNode() { if (!this.isMounted() || !this.refs || !this.refs.panel) { return null; } return _react2['default'].findDOMNode(this.refs.panel); }, render: function render() { var classes = this.getBsClassSet(); var collapsible = this.props.collapsible || this.props.collapsable; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), id: collapsible ? null : this.props.id, onSelect: null }), this.renderHeading(), collapsible ? this.renderCollapsableBody() : this.renderBody(), this.renderFooter() ); }, renderCollapsableBody: function renderCollapsableBody() { var collapseClass = this.prefixClass('collapse'); return _react2['default'].createElement( 'div', { className: (0, _classnames2['default'])(this.getCollapsibleClassSet(collapseClass)), id: this.props.id, ref: 'panel', 'aria-expanded': this.isExpanded() ? 'true' : 'false' }, this.renderBody() ); }, renderBody: function renderBody() { var allChildren = this.props.children; var bodyElements = []; var panelBodyChildren = []; var bodyClass = this.prefixClass('body'); function getProps() { return { key: bodyElements.length }; } function addPanelChild(child) { bodyElements.push((0, _react.cloneElement)(child, getProps())); } function addPanelBody(children) { bodyElements.push(_react2['default'].createElement( 'div', _extends({ className: bodyClass }, getProps()), children )); } function maybeRenderPanelBody() { if (panelBodyChildren.length === 0) { return; } addPanelBody(panelBodyChildren); panelBodyChildren = []; } // Handle edge cases where we should not iterate through children. if (!Array.isArray(allChildren) || allChildren.length === 0) { if (this.shouldRenderFill(allChildren)) { addPanelChild(allChildren); } else { addPanelBody(allChildren); } } else { allChildren.forEach((function (child) { if (this.shouldRenderFill(child)) { maybeRenderPanelBody(); // Separately add the filled element. addPanelChild(child); } else { panelBodyChildren.push(child); } }).bind(this)); maybeRenderPanelBody(); } return bodyElements; }, shouldRenderFill: function shouldRenderFill(child) { return _react2['default'].isValidElement(child) && child.props.fill != null; }, renderHeading: function renderHeading() { var header = this.props.header; var collapsible = this.props.collapsible || this.props.collapsable; if (!header) { return null; } if (!_react2['default'].isValidElement(header) || Array.isArray(header)) { header = collapsible ? this.renderCollapsableTitle(header) : header; } else { var className = (0, _classnames2['default'])(this.prefixClass('title'), header.props.className); if (collapsible) { header = (0, _react.cloneElement)(header, { className: className, children: this.renderAnchor(header.props.children) }); } else { header = (0, _react.cloneElement)(header, { className: className }); } } return _react2['default'].createElement( 'div', { className: this.prefixClass('heading') }, header ); }, renderAnchor: function renderAnchor(header) { return _react2['default'].createElement( 'a', { href: '#' + (this.props.id || ''), className: this.isExpanded() ? null : 'collapsed', 'aria-expanded': this.isExpanded() ? 'true' : 'false', onClick: this.handleSelect }, header ); }, renderCollapsableTitle: function renderCollapsableTitle(header) { return _react2['default'].createElement( 'h4', { className: this.prefixClass('title') }, this.renderAnchor(header) ); }, renderFooter: function renderFooter() { if (!this.props.footer) { return null; } return _react2['default'].createElement( 'div', { className: this.prefixClass('footer') }, this.props.footer ); } }); exports['default'] = Panel; module.exports = exports['default']; /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { /* eslint react/prop-types: [1, {ignore: ["children", "className", "bsStyle"]}]*/ /* BootstrapMixin contains `bsStyle` type validation */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var PanelGroup = _react2['default'].createClass({ displayName: 'PanelGroup', mixins: [_BootstrapMixin2['default']], propTypes: { accordion: _react2['default'].PropTypes.bool, activeKey: _react2['default'].PropTypes.any, defaultActiveKey: _react2['default'].PropTypes.any, onSelect: _react2['default'].PropTypes.func }, getDefaultProps: function getDefaultProps() { return { bsClass: 'panel-group' }; }, getInitialState: function getInitialState() { var defaultActiveKey = this.props.defaultActiveKey; return { activeKey: defaultActiveKey }; }, render: function render() { var classes = this.getBsClassSet(); return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), onSelect: null }), _utilsValidComponentChildren2['default'].map(this.props.children, this.renderPanel) ); }, renderPanel: function renderPanel(child, index) { var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey; var props = { bsStyle: child.props.bsStyle || this.props.bsStyle, key: child.key ? child.key : index, ref: child.ref }; if (this.props.accordion) { props.collapsible = true; props.expanded = child.props.eventKey === activeKey; props.onSelect = this.handleSelect; } return (0, _react.cloneElement)(child, props); }, shouldComponentUpdate: function shouldComponentUpdate() { // Defer any updates to this component during the `onSelect` handler. return !this._isChanging; }, handleSelect: function handleSelect(e, key) { e.preventDefault(); if (this.props.onSelect) { this._isChanging = true; this.props.onSelect(key); this._isChanging = false; } if (this.state.activeKey === key) { key = null; } this.setState({ activeKey: key }); } }); exports['default'] = PanelGroup; module.exports = exports['default']; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var PageItem = _react2['default'].createClass({ displayName: 'PageItem', propTypes: { href: _react2['default'].PropTypes.string, target: _react2['default'].PropTypes.string, title: _react2['default'].PropTypes.string, disabled: _react2['default'].PropTypes.bool, previous: _react2['default'].PropTypes.bool, next: _react2['default'].PropTypes.bool, onSelect: _react2['default'].PropTypes.func, eventKey: _react2['default'].PropTypes.any }, getDefaultProps: function getDefaultProps() { return { href: '#' }; }, render: function render() { var classes = { 'disabled': this.props.disabled, 'previous': this.props.previous, 'next': this.props.next }; return _react2['default'].createElement( 'li', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement( 'a', { href: this.props.href, title: this.props.title, target: this.props.target, onClick: this.handleSelect, ref: 'anchor' }, this.props.children ) ); }, handleSelect: function handleSelect(e) { if (this.props.onSelect) { e.preventDefault(); if (!this.props.disabled) { this.props.onSelect(this.props.eventKey, this.props.href, this.props.target); } } } }); exports['default'] = PageItem; module.exports = exports['default']; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var Pager = _react2['default'].createClass({ displayName: 'Pager', propTypes: { onSelect: _react2['default'].PropTypes.func }, render: function render() { return _react2['default'].createElement( 'ul', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'pager') }), _utilsValidComponentChildren2['default'].map(this.props.children, this.renderPageItem) ); }, renderPageItem: function renderPageItem(child, index) { return (0, _react.cloneElement)(child, { onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect), key: child.key ? child.key : index }); } }); exports['default'] = Pager; module.exports = exports['default']; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _FadeMixin = __webpack_require__(22); var _FadeMixin2 = _interopRequireDefault(_FadeMixin); var Popover = _react2['default'].createClass({ displayName: 'Popover', mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']], propTypes: { placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']), positionLeft: _react2['default'].PropTypes.number, positionTop: _react2['default'].PropTypes.number, arrowOffsetLeft: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]), arrowOffsetTop: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]), title: _react2['default'].PropTypes.node, animation: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { placement: 'right', animation: true }; }, render: function render() { var _classes; var classes = (_classes = { 'popover': true }, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); var style = { 'left': this.props.positionLeft, 'top': this.props.positionTop, 'display': 'block' }; var arrowStyle = { 'left': this.props.arrowOffsetLeft, 'top': this.props.arrowOffsetTop }; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), style: style, title: null }), _react2['default'].createElement('div', { className: 'arrow', style: arrowStyle }), this.props.title ? this.renderTitle() : null, _react2['default'].createElement( 'div', { className: 'popover-content' }, this.props.children ) ); }, renderTitle: function renderTitle() { return _react2['default'].createElement( 'h3', { className: 'popover-title' }, this.props.title ); } }); exports['default'] = Popover; module.exports = exports['default']; // in class will be added by the FadeMixin when the animation property is true /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _Interpolate = __webpack_require__(26); var _Interpolate2 = _interopRequireDefault(_Interpolate); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var ProgressBar = _react2['default'].createClass({ displayName: 'ProgressBar', propTypes: { min: _react2['default'].PropTypes.number, now: _react2['default'].PropTypes.number, max: _react2['default'].PropTypes.number, label: _react2['default'].PropTypes.node, srOnly: _react2['default'].PropTypes.bool, striped: _react2['default'].PropTypes.bool, active: _react2['default'].PropTypes.bool }, mixins: [_BootstrapMixin2['default']], getDefaultProps: function getDefaultProps() { return { bsClass: 'progress-bar', min: 0, max: 100 }; }, getPercentage: function getPercentage(now, min, max) { var roundPrecision = 1000; return Math.round((now - min) / (max - min) * 100 * roundPrecision) / roundPrecision; }, render: function render() { var classes = { progress: true }; if (this.props.active) { classes['progress-striped'] = true; classes.active = true; } else if (this.props.striped) { classes['progress-striped'] = true; } if (!_utilsValidComponentChildren2['default'].hasValidComponent(this.props.children)) { if (!this.props.isChild) { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.renderProgressBar() ); } else { return this.renderProgressBar(); } } else { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _utilsValidComponentChildren2['default'].map(this.props.children, this.renderChildBar) ); } }, renderChildBar: function renderChildBar(child, index) { return (0, _react.cloneElement)(child, { isChild: true, key: child.key ? child.key : index }); }, renderProgressBar: function renderProgressBar() { var percentage = this.getPercentage(this.props.now, this.props.min, this.props.max); var label = undefined; if (typeof this.props.label === 'string') { label = this.renderLabel(percentage); } else if (this.props.label) { label = this.props.label; } if (this.props.srOnly) { label = this.renderScreenReaderOnlyLabel(label); } var classes = this.getBsClassSet(); return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), role: 'progressbar', style: { width: percentage + '%' }, 'aria-valuenow': this.props.now, 'aria-valuemin': this.props.min, 'aria-valuemax': this.props.max }), label ); }, renderLabel: function renderLabel(percentage) { var InterpolateClass = this.props.interpolateClass || _Interpolate2['default']; return _react2['default'].createElement( InterpolateClass, { now: this.props.now, min: this.props.min, max: this.props.max, percent: percentage, bsStyle: this.props.bsStyle }, this.props.label ); }, renderScreenReaderOnlyLabel: function renderScreenReaderOnlyLabel(label) { return _react2['default'].createElement( 'span', { className: 'sr-only' }, label ); } }); exports['default'] = ProgressBar; module.exports = exports['default']; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var Row = _react2['default'].createClass({ displayName: 'Row', propTypes: { componentClass: _react2['default'].PropTypes.node.isRequired }, getDefaultProps: function getDefaultProps() { return { componentClass: 'div' }; }, render: function render() { var ComponentClass = this.props.componentClass; return _react2['default'].createElement( ComponentClass, _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'row') }), this.props.children ); } }); exports['default'] = Row; module.exports = exports['default']; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { /* eslint react/prop-types: [1, {ignore: ["children", "className", "bsSize"]}]*/ /* BootstrapMixin contains `bsSize` type validation */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _DropdownStateMixin = __webpack_require__(21); var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin); var _Button = __webpack_require__(8); var _Button2 = _interopRequireDefault(_Button); var _ButtonGroup = __webpack_require__(9); var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup); var _DropdownMenu = __webpack_require__(20); var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu); var SplitButton = _react2['default'].createClass({ displayName: 'SplitButton', mixins: [_BootstrapMixin2['default'], _DropdownStateMixin2['default']], propTypes: { pullRight: _react2['default'].PropTypes.bool, title: _react2['default'].PropTypes.node, href: _react2['default'].PropTypes.string, id: _react2['default'].PropTypes.string, target: _react2['default'].PropTypes.string, dropdownTitle: _react2['default'].PropTypes.node, dropup: _react2['default'].PropTypes.bool, onClick: _react2['default'].PropTypes.func, onSelect: _react2['default'].PropTypes.func, disabled: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { dropdownTitle: 'Toggle dropdown' }; }, render: function render() { var groupClasses = { 'open': this.state.open, 'dropup': this.props.dropup }; var button = _react2['default'].createElement( _Button2['default'], _extends({}, this.props, { ref: 'button', onClick: this.handleButtonClick, title: null, id: null }), this.props.title ); var dropdownButton = _react2['default'].createElement( _Button2['default'], _extends({}, this.props, { ref: 'dropdownButton', className: (0, _classnames2['default'])(this.props.className, 'dropdown-toggle'), onClick: this.handleDropdownClick, title: null, href: null, target: null, id: null }), _react2['default'].createElement( 'span', { className: 'sr-only' }, this.props.dropdownTitle ), _react2['default'].createElement('span', { className: 'caret' }), _react2['default'].createElement( 'span', { style: { letterSpacing: '-.3em' } }, ' ' ) ); return _react2['default'].createElement( _ButtonGroup2['default'], { bsSize: this.props.bsSize, className: (0, _classnames2['default'])(groupClasses), id: this.props.id }, button, dropdownButton, _react2['default'].createElement( _DropdownMenu2['default'], { ref: 'menu', onSelect: this.handleOptionSelect, 'aria-labelledby': this.props.id, pullRight: this.props.pullRight }, this.props.children ) ); }, handleButtonClick: function handleButtonClick(e) { if (this.state.open) { this.setDropdownState(false); } if (this.props.onClick) { this.props.onClick(e, this.props.href, this.props.target); } }, handleDropdownClick: function handleDropdownClick(e) { e.preventDefault(); this.setDropdownState(!this.state.open); }, handleOptionSelect: function handleOptionSelect(key) { if (this.props.onSelect) { this.props.onSelect(key); } this.setDropdownState(false); } }); exports['default'] = SplitButton; module.exports = exports['default']; /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _utilsCreateChainedFunction = __webpack_require__(65); var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var SubNav = _react2['default'].createClass({ displayName: 'SubNav', mixins: [_BootstrapMixin2['default']], propTypes: { onSelect: _react2['default'].PropTypes.func, active: _react2['default'].PropTypes.bool, activeHref: _react2['default'].PropTypes.string, activeKey: _react2['default'].PropTypes.any, disabled: _react2['default'].PropTypes.bool, eventKey: _react2['default'].PropTypes.any, href: _react2['default'].PropTypes.string, title: _react2['default'].PropTypes.string, text: _react2['default'].PropTypes.node, target: _react2['default'].PropTypes.string }, getDefaultProps: function getDefaultProps() { return { bsClass: 'nav' }; }, handleClick: function handleClick(e) { if (this.props.onSelect) { e.preventDefault(); if (!this.props.disabled) { this.props.onSelect(this.props.eventKey, this.props.href, this.props.target); } } }, isActive: function isActive() { return this.isChildActive(this); }, isChildActive: function isChildActive(child) { var _this = this; if (child.props.active) { return true; } if (this.props.activeKey != null && this.props.activeKey === child.props.eventKey) { return true; } if (this.props.activeHref != null && this.props.activeHref === child.props.href) { return true; } if (child.props.children) { var _ret = (function () { var isActive = false; _utilsValidComponentChildren2['default'].forEach(child.props.children, function (grandchild) { if (this.isChildActive(grandchild)) { isActive = true; } }, _this); return { v: isActive }; })(); if (typeof _ret === 'object') return _ret.v; } return false; }, getChildActiveProp: function getChildActiveProp(child) { if (child.props.active) { return true; } if (this.props.activeKey != null) { if (child.props.eventKey === this.props.activeKey) { return true; } } if (this.props.activeHref != null) { if (child.props.href === this.props.activeHref) { return true; } } return child.props.active; }, render: function render() { var classes = { 'active': this.isActive(), 'disabled': this.props.disabled }; return _react2['default'].createElement( 'li', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement( 'a', { href: this.props.href, title: this.props.title, target: this.props.target, onClick: this.handleClick, ref: 'anchor' }, this.props.text ), _react2['default'].createElement( 'ul', { className: 'nav' }, _utilsValidComponentChildren2['default'].map(this.props.children, this.renderNavItem) ) ); }, renderNavItem: function renderNavItem(child, index) { return (0, _react.cloneElement)(child, { active: this.getChildActiveProp(child), onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect), key: child.key ? child.key : index }); } }); exports['default'] = SubNav; module.exports = exports['default']; /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _utilsValidComponentChildren = __webpack_require__(56); var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren); var _Nav = __webpack_require__(32); var _Nav2 = _interopRequireDefault(_Nav); var _NavItem = __webpack_require__(1); var _NavItem2 = _interopRequireDefault(_NavItem); function getDefaultActiveKeyFromChildren(children) { var defaultActiveKey = undefined; _utilsValidComponentChildren2['default'].forEach(children, function (child) { if (defaultActiveKey == null) { defaultActiveKey = child.props.eventKey; } }); return defaultActiveKey; } var TabbedArea = _react2['default'].createClass({ displayName: 'TabbedArea', mixins: [_BootstrapMixin2['default']], propTypes: { activeKey: _react2['default'].PropTypes.any, defaultActiveKey: _react2['default'].PropTypes.any, bsStyle: _react2['default'].PropTypes.oneOf(['tabs', 'pills']), animation: _react2['default'].PropTypes.bool, id: _react2['default'].PropTypes.string, onSelect: _react2['default'].PropTypes.func }, getDefaultProps: function getDefaultProps() { return { bsStyle: 'tabs', animation: true }; }, getInitialState: function getInitialState() { var defaultActiveKey = this.props.defaultActiveKey != null ? this.props.defaultActiveKey : getDefaultActiveKeyFromChildren(this.props.children); return { activeKey: defaultActiveKey, previousActiveKey: null }; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (nextProps.activeKey != null && nextProps.activeKey !== this.props.activeKey) { this.setState({ previousActiveKey: this.props.activeKey }); } }, handlePaneAnimateOutEnd: function handlePaneAnimateOutEnd() { this.setState({ previousActiveKey: null }); }, render: function render() { var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey; function renderTabIfSet(child) { return child.props.tab != null ? this.renderTab(child) : null; } var nav = _react2['default'].createElement( _Nav2['default'], _extends({}, this.props, { activeKey: activeKey, onSelect: this.handleSelect, ref: 'tabs' }), _utilsValidComponentChildren2['default'].map(this.props.children, renderTabIfSet, this) ); return _react2['default'].createElement( 'div', null, nav, _react2['default'].createElement( 'div', { id: this.props.id, className: 'tab-content', ref: 'panes' }, _utilsValidComponentChildren2['default'].map(this.props.children, this.renderPane) ) ); }, getActiveKey: function getActiveKey() { return this.props.activeKey != null ? this.props.activeKey : this.state.activeKey; }, renderPane: function renderPane(child, index) { var activeKey = this.getActiveKey(); return (0, _react.cloneElement)(child, { active: child.props.eventKey === activeKey && (this.state.previousActiveKey == null || !this.props.animation), key: child.key ? child.key : index, animation: this.props.animation, onAnimateOutEnd: this.state.previousActiveKey != null && child.props.eventKey === this.state.previousActiveKey ? this.handlePaneAnimateOutEnd : null }); }, renderTab: function renderTab(child) { var _child$props = child.props; var eventKey = _child$props.eventKey; var className = _child$props.className; var tab = _child$props.tab; var disabled = _child$props.disabled; return _react2['default'].createElement( _NavItem2['default'], { ref: 'tab' + eventKey, eventKey: eventKey, className: className, disabled: disabled }, tab ); }, shouldComponentUpdate: function shouldComponentUpdate() { // Defer any updates to this component during the `onSelect` handler. return !this._isChanging; }, handleSelect: function handleSelect(key) { if (this.props.onSelect) { this._isChanging = true; this.props.onSelect(key); this._isChanging = false; } else if (key !== this.getActiveKey()) { this.setState({ activeKey: key, previousActiveKey: this.getActiveKey() }); } } }); exports['default'] = TabbedArea; module.exports = exports['default']; /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var Table = _react2['default'].createClass({ displayName: 'Table', propTypes: { striped: _react2['default'].PropTypes.bool, bordered: _react2['default'].PropTypes.bool, condensed: _react2['default'].PropTypes.bool, hover: _react2['default'].PropTypes.bool, responsive: _react2['default'].PropTypes.bool }, render: function render() { var classes = { 'table': true, 'table-striped': this.props.striped, 'table-bordered': this.props.bordered, 'table-condensed': this.props.condensed, 'table-hover': this.props.hover }; var table = _react2['default'].createElement( 'table', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); return this.props.responsive ? _react2['default'].createElement( 'div', { className: 'table-responsive' }, table ) : table; } }); exports['default'] = Table; module.exports = exports['default']; /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _utilsTransitionEvents = __webpack_require__(66); var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents); var TabPane = _react2['default'].createClass({ displayName: 'TabPane', propTypes: { active: _react2['default'].PropTypes.bool, animation: _react2['default'].PropTypes.bool, onAnimateOutEnd: _react2['default'].PropTypes.func, disabled: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { animation: true }; }, getInitialState: function getInitialState() { return { animateIn: false, animateOut: false }; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (this.props.animation) { if (!this.state.animateIn && nextProps.active && !this.props.active) { this.setState({ animateIn: true }); } else if (!this.state.animateOut && !nextProps.active && this.props.active) { this.setState({ animateOut: true }); } } }, componentDidUpdate: function componentDidUpdate() { if (this.state.animateIn) { setTimeout(this.startAnimateIn, 0); } if (this.state.animateOut) { _utilsTransitionEvents2['default'].addEndEventListener(_react2['default'].findDOMNode(this), this.stopAnimateOut); } }, startAnimateIn: function startAnimateIn() { if (this.isMounted()) { this.setState({ animateIn: false }); } }, stopAnimateOut: function stopAnimateOut() { if (this.isMounted()) { this.setState({ animateOut: false }); if (this.props.onAnimateOutEnd) { this.props.onAnimateOutEnd(); } } }, render: function render() { var classes = { 'tab-pane': true, 'fade': true, 'active': this.props.active || this.state.animateOut, 'in': this.props.active && !this.state.animateIn }; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = TabPane; module.exports = exports['default']; /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var Thumbnail = _react2['default'].createClass({ displayName: 'Thumbnail', mixins: [_BootstrapMixin2['default']], getDefaultProps: function getDefaultProps() { return { bsClass: 'thumbnail' }; }, render: function render() { var classes = this.getBsClassSet(); if (this.props.href) { return _react2['default'].createElement( 'a', _extends({}, this.props, { href: this.props.href, className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt }) ); } else { if (this.props.children) { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt }), _react2['default'].createElement( 'div', { className: 'caption' }, this.props.children ) ); } else { return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), _react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt }) ); } } } }); exports['default'] = Thumbnail; module.exports = exports['default']; /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var _FadeMixin = __webpack_require__(22); var _FadeMixin2 = _interopRequireDefault(_FadeMixin); var Tooltip = _react2['default'].createClass({ displayName: 'Tooltip', mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']], propTypes: { placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']), positionLeft: _react2['default'].PropTypes.number, positionTop: _react2['default'].PropTypes.number, arrowOffsetLeft: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]), arrowOffsetTop: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]), animation: _react2['default'].PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { placement: 'right', animation: true }; }, render: function render() { var _classes; var classes = (_classes = { 'tooltip': true }, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); var style = { 'left': this.props.positionLeft, 'top': this.props.positionTop }; var arrowStyle = { 'left': this.props.arrowOffsetLeft, 'top': this.props.arrowOffsetTop }; return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), style: style }), _react2['default'].createElement('div', { className: 'tooltip-arrow', style: arrowStyle }), _react2['default'].createElement( 'div', { className: 'tooltip-inner' }, this.props.children ) ); } }); exports['default'] = Tooltip; module.exports = exports['default']; // in class will be added by the FadeMixin when the animation property is true /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _BootstrapMixin = __webpack_require__(6); var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin); var Well = _react2['default'].createClass({ displayName: 'Well', mixins: [_BootstrapMixin2['default']], getDefaultProps: function getDefaultProps() { return { bsClass: 'well' }; }, render: function render() { var classes = this.getBsClassSet(); return _react2['default'].createElement( 'div', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), this.props.children ); } }); exports['default'] = Well; module.exports = exports['default']; /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var styleMaps = { CLASSES: { 'alert': 'alert', 'button': 'btn', 'button-group': 'btn-group', 'button-toolbar': 'btn-toolbar', 'column': 'col', 'input-group': 'input-group', 'form': 'form', 'glyphicon': 'glyphicon', 'label': 'label', 'thumbnail': 'thumbnail', 'list-group-item': 'list-group-item', 'panel': 'panel', 'panel-group': 'panel-group', 'progress-bar': 'progress-bar', 'nav': 'nav', 'navbar': 'navbar', 'modal': 'modal', 'row': 'row', 'well': 'well' }, STYLES: { 'default': 'default', 'primary': 'primary', 'success': 'success', 'info': 'info', 'warning': 'warning', 'danger': 'danger', 'link': 'link', 'inline': 'inline', 'tabs': 'tabs', 'pills': 'pills' }, addStyle: function addStyle(name) { styleMaps.STYLES[name] = name; }, SIZES: { 'large': 'lg', 'medium': 'md', 'small': 'sm', 'xsmall': 'xs' }, GLYPHS: ['asterisk', 'plus', 'euro', 'eur', 'minus', 'cloud', 'envelope', 'pencil', 'glass', 'music', 'search', 'heart', 'star', 'star-empty', 'user', 'film', 'th-large', 'th', 'th-list', 'ok', 'remove', 'zoom-in', 'zoom-out', 'off', 'signal', 'cog', 'trash', 'home', 'file', 'time', 'road', 'download-alt', 'download', 'upload', 'inbox', 'play-circle', 'repeat', 'refresh', 'list-alt', 'lock', 'flag', 'headphones', 'volume-off', 'volume-down', 'volume-up', 'qrcode', 'barcode', 'tag', 'tags', 'book', 'bookmark', 'print', 'camera', 'font', 'bold', 'italic', 'text-height', 'text-width', 'align-left', 'align-center', 'align-right', 'align-justify', 'list', 'indent-left', 'indent-right', 'facetime-video', 'picture', 'map-marker', 'adjust', 'tint', 'edit', 'share', 'check', 'move', 'step-backward', 'fast-backward', 'backward', 'play', 'pause', 'stop', 'forward', 'fast-forward', 'step-forward', 'eject', 'chevron-left', 'chevron-right', 'plus-sign', 'minus-sign', 'remove-sign', 'ok-sign', 'question-sign', 'info-sign', 'screenshot', 'remove-circle', 'ok-circle', 'ban-circle', 'arrow-left', 'arrow-right', 'arrow-up', 'arrow-down', 'share-alt', 'resize-full', 'resize-small', 'exclamation-sign', 'gift', 'leaf', 'fire', 'eye-open', 'eye-close', 'warning-sign', 'plane', 'calendar', 'random', 'comment', 'magnet', 'chevron-up', 'chevron-down', 'retweet', 'shopping-cart', 'folder-close', 'folder-open', 'resize-vertical', 'resize-horizontal', 'hdd', 'bullhorn', 'bell', 'certificate', 'thumbs-up', 'thumbs-down', 'hand-right', 'hand-left', 'hand-up', 'hand-down', 'circle-arrow-right', 'circle-arrow-left', 'circle-arrow-up', 'circle-arrow-down', 'globe', 'wrench', 'tasks', 'filter', 'briefcase', 'fullscreen', 'dashboard', 'paperclip', 'heart-empty', 'link', 'phone', 'pushpin', 'usd', 'gbp', 'sort', 'sort-by-alphabet', 'sort-by-alphabet-alt', 'sort-by-order', 'sort-by-order-alt', 'sort-by-attributes', 'sort-by-attributes-alt', 'unchecked', 'expand', 'collapse-down', 'collapse-up', 'log-in', 'flash', 'log-out', 'new-window', 'record', 'save', 'open', 'saved', 'import', 'export', 'send', 'floppy-disk', 'floppy-saved', 'floppy-remove', 'floppy-save', 'floppy-open', 'credit-card', 'transfer', 'cutlery', 'header', 'compressed', 'earphone', 'phone-alt', 'tower', 'stats', 'sd-video', 'hd-video', 'subtitles', 'sound-stereo', 'sound-dolby', 'sound-5-1', 'sound-6-1', 'sound-7-1', 'copyright-mark', 'registration-mark', 'cloud-download', 'cloud-upload', 'tree-conifer', 'tree-deciduous', 'cd', 'save-file', 'open-file', 'level-up', 'copy', 'paste', 'alert', 'equalizer', 'king', 'queen', 'pawn', 'bishop', 'knight', 'baby-formula', 'tent', 'blackboard', 'bed', 'apple', 'erase', 'hourglass', 'lamp', 'duplicate', 'piggy-bank', 'scissors', 'bitcoin', 'yen', 'ruble', 'scale', 'ice-lolly', 'ice-lolly-tasted', 'education', 'option-horizontal', 'option-vertical', 'menu-hamburger', 'modal-window', 'oil', 'grain', 'sunglasses', 'text-size', 'text-color', 'text-background', 'object-align-top', 'object-align-bottom', 'object-align-horizontal', 'object-align-left', 'object-align-vertical', 'object-align-right', 'triangle-right', 'triangle-left', 'triangle-bottom', 'triangle-top', 'console', 'superscript', 'subscript', 'menu-left', 'menu-right', 'menu-down', 'menu-up'] }; exports['default'] = styleMaps; module.exports = exports['default']; /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { module.exports = __WEBPACK_EXTERNAL_MODULE_55__; /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); /** * Maps children that are typically specified as `props.children`, * but only iterates over children that are "valid components". * * The mapFunction provided index will be normalised to the components mapped, * so an invalid component would not increase the index. * * @param {?*} children Children tree container. * @param {function(*, int)} mapFunction. * @param {*} mapContext Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapValidComponents(children, func, context) { var index = 0; return _react2['default'].Children.map(children, function (child) { if (_react2['default'].isValidElement(child)) { var lastIndex = index; index++; return func.call(context, child, lastIndex); } return child; }); } /** * Iterates through children that are typically specified as `props.children`, * but only iterates over children that are "valid components". * * The provided forEachFunc(child, index) will be called for each * leaf child with the index reflecting the position relative to "valid components". * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc. * @param {*} forEachContext Context for forEachContext. */ function forEachValidComponents(children, func, context) { var index = 0; return _react2['default'].Children.forEach(children, function (child) { if (_react2['default'].isValidElement(child)) { func.call(context, child, index); index++; } }); } /** * Count the number of "valid components" in the Children container. * * @param {?*} children Children tree container. * @returns {number} */ function numberOfValidComponents(children) { var count = 0; _react2['default'].Children.forEach(children, function (child) { if (_react2['default'].isValidElement(child)) { count++; } }); return count; } /** * Determine if the Child container has one or more "valid components". * * @param {?*} children Children tree container. * @returns {boolean} */ function hasValidComponent(children) { var hasValid = false; _react2['default'].Children.forEach(children, function (child) { if (!hasValid && _react2['default'].isValidElement(child)) { hasValid = true; } }); return hasValid; } exports['default'] = { map: mapValidComponents, forEach: forEachValidComponents, numberOf: numberOfValidComponents, hasValidComponent: hasValidComponent }; module.exports = exports['default']; /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); /** * Get elements owner document * * @param {ReactComponent|HTMLElement} componentOrElement * @returns {HTMLElement} */ function ownerDocument(componentOrElement) { var elem = _react2['default'].findDOMNode(componentOrElement); return elem && elem.ownerDocument || document; } /** * Shortcut to compute element style * * @param {HTMLElement} elem * @returns {CssStyle} */ function getComputedStyles(elem) { return ownerDocument(elem).defaultView.getComputedStyle(elem, null); } /** * Get elements offset * * TODO: REMOVE JQUERY! * * @param {HTMLElement} DOMNode * @returns {{top: number, left: number}} */ function getOffset(DOMNode) { if (window.jQuery) { return window.jQuery(DOMNode).offset(); } var docElem = ownerDocument(DOMNode).documentElement; var box = { top: 0, left: 0 }; // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if (typeof DOMNode.getBoundingClientRect !== 'undefined') { box = DOMNode.getBoundingClientRect(); } return { top: box.top + window.pageYOffset - docElem.clientTop, left: box.left + window.pageXOffset - docElem.clientLeft }; } /** * Get elements position * * TODO: REMOVE JQUERY! * * @param {HTMLElement} elem * @param {HTMLElement?} offsetParent * @returns {{top: number, left: number}} */ function getPosition(elem, offsetParent) { if (window.jQuery) { return window.jQuery(elem).position(); } var offset = undefined, parentOffset = { top: 0, left: 0 }; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent if (getComputedStyles(elem).position === 'fixed') { // We assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { if (!offsetParent) { // Get *real* offsetParent offsetParent = offsetParentFunc(elem); } // Get correct offsets offset = getOffset(elem); if (offsetParent.nodeName !== 'HTML') { parentOffset = getOffset(offsetParent); } // Add offsetParent borders parentOffset.top += parseInt(getComputedStyles(offsetParent).borderTopWidth, 10); parentOffset.left += parseInt(getComputedStyles(offsetParent).borderLeftWidth, 10); } // Subtract parent offsets and element margins return { top: offset.top - parentOffset.top - parseInt(getComputedStyles(elem).marginTop, 10), left: offset.left - parentOffset.left - parseInt(getComputedStyles(elem).marginLeft, 10) }; } /** * Get parent element * * @param {HTMLElement?} elem * @returns {HTMLElement} */ function offsetParentFunc(elem) { var docElem = ownerDocument(elem).documentElement; var offsetParent = elem.offsetParent || docElem; while (offsetParent && (offsetParent.nodeName !== 'HTML' && getComputedStyles(offsetParent).position === 'static')) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; } exports['default'] = { ownerDocument: ownerDocument, getComputedStyles: getComputedStyles, getOffset: getOffset, getPosition: getPosition, offsetParent: offsetParentFunc }; module.exports = exports['default']; /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-2014 Facebook, Inc. * * This file contains a modified version of: * https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/EventListener.js * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * TODO: remove in favour of solution provided by: * https://github.com/facebook/react/issues/285 */ /** * Does not take into account specific nature of platform. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var EventListener = { /** * Listen to DOM events during the bubble phase. * * @param {DOMEventTarget} target DOM element to register listener on. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. * @param {function} callback Callback function. * @return {object} Object with a `remove` method. */ listen: function listen(target, eventType, callback) { if (target.addEventListener) { target.addEventListener(eventType, callback, false); return { remove: function remove() { target.removeEventListener(eventType, callback, false); } }; } else if (target.attachEvent) { target.attachEvent('on' + eventType, callback); return { remove: function remove() { target.detachEvent('on' + eventType, callback); } }; } } }; exports['default'] = EventListener; module.exports = exports['default']; /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var ANONYMOUS = '<<anonymous>>'; var CustomPropTypes = { /** * Checks whether a prop provides a DOM element * * The element can be provided in two forms: * - Directly passed * - Or passed an object which has a `getDOMNode` method which will return the required DOM element * * @param props * @param propName * @param componentName * @returns {Error|undefined} */ mountable: createMountableChecker(), /** * Checks whether a prop matches a key of an associated object * * @param props * @param propName * @param componentName * @returns {Error|undefined} */ keyOf: createKeyOfChecker }; /** * Create chain-able isRequired validator * * Largely copied directly from: * https://github.com/facebook/react/blob/0.11-stable/src/core/ReactPropTypes.js#L94 */ function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName) { componentName = componentName || ANONYMOUS; if (props[propName] == null) { if (isRequired) { return new Error('Required prop `' + propName + '` was not specified in ' + '`' + componentName + '`.'); } } else { return validate(props, propName, componentName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createMountableChecker() { function validate(props, propName, componentName) { if (typeof props[propName] !== 'object' || typeof props[propName].render !== 'function' && props[propName].nodeType !== 1) { return new Error('Invalid prop `' + propName + '` supplied to ' + '`' + componentName + '`, expected a DOM element or an object that has a `render` method'); } } return createChainableTypeChecker(validate); } function createKeyOfChecker(obj) { function validate(props, propName, componentName) { var propValue = props[propName]; if (!obj.hasOwnProperty(propValue)) { var valuesString = JSON.stringify(Object.keys(obj)); return new Error('Invalid prop \'' + propName + '\' of value \'' + propValue + '\' ' + ('supplied to \'' + componentName + '\', expected one of ' + valuesString + '.')); } } return createChainableTypeChecker(validate); } exports['default'] = CustomPropTypes; module.exports = exports['default']; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var FormGroup = (function (_React$Component) { function FormGroup() { _classCallCheck(this, FormGroup); if (_React$Component != null) { _React$Component.apply(this, arguments); } } _inherits(FormGroup, _React$Component); _createClass(FormGroup, [{ key: 'render', value: function render() { var classes = { 'form-group': !this.props.standalone, 'form-group-lg': !this.props.standalone && this.props.bsSize === 'large', 'form-group-sm': !this.props.standalone && this.props.bsSize === 'small', 'has-feedback': this.props.hasFeedback, 'has-success': this.props.bsStyle === 'success', 'has-warning': this.props.bsStyle === 'warning', 'has-error': this.props.bsStyle === 'error' }; return _react2['default'].createElement( 'div', { className: (0, _classnames2['default'])(classes, this.props.groupClassName) }, this.props.children ); } }]); return FormGroup; })(_react2['default'].Component); FormGroup.defaultProps = { standalone: false }; FormGroup.propTypes = { standalone: _react2['default'].PropTypes.bool, hasFeedback: _react2['default'].PropTypes.bool, bsSize: function bsSize(props) { if (props.standalone && props.bsSize !== undefined) { return new Error('bsSize will not be used when `standalone` is set.'); } return _react2['default'].PropTypes.oneOf(['small', 'medium', 'large']).apply(null, arguments); }, bsStyle: _react2['default'].PropTypes.oneOf(['success', 'warning', 'error']), groupClassName: _react2['default'].PropTypes.string }; exports['default'] = FormGroup; module.exports = exports['default']; /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(68); var _classnames2 = _interopRequireDefault(_classnames); var _FormGroup = __webpack_require__(60); var _FormGroup2 = _interopRequireDefault(_FormGroup); var InputBase = (function (_React$Component) { function InputBase() { _classCallCheck(this, InputBase); if (_React$Component != null) { _React$Component.apply(this, arguments); } } _inherits(InputBase, _React$Component); _createClass(InputBase, [{ key: 'getInputDOMNode', value: function getInputDOMNode() { return _react2['default'].findDOMNode(this.refs.input); } }, { key: 'getValue', value: function getValue() { if (this.props.type === 'static') { return this.props.value; } else if (this.props.type) { if (this.props.type === 'select' && this.props.multiple) { return this.getSelectedOptions(); } else { return this.getInputDOMNode().value; } } else { throw 'Cannot use getValue without specifying input type.'; } } }, { key: 'getChecked', value: function getChecked() { return this.getInputDOMNode().checked; } }, { key: 'getSelectedOptions', value: function getSelectedOptions() { var values = []; Array.prototype.forEach.call(this.getInputDOMNode().getElementsByTagName('option'), function (option) { if (option.selected) { var value = option.getAttribute('value') || option.innerHtml; values.push(value); } }); return values; } }, { key: 'isCheckboxOrRadio', value: function isCheckboxOrRadio() { return this.props.type === 'checkbox' || this.props.type === 'radio'; } }, { key: 'isFile', value: function isFile() { return this.props.type === 'file'; } }, { key: 'renderInputGroup', value: function renderInputGroup(children) { var addonBefore = this.props.addonBefore ? _react2['default'].createElement( 'span', { className: 'input-group-addon', key: 'addonBefore' }, this.props.addonBefore ) : null; var addonAfter = this.props.addonAfter ? _react2['default'].createElement( 'span', { className: 'input-group-addon', key: 'addonAfter' }, this.props.addonAfter ) : null; var buttonBefore = this.props.buttonBefore ? _react2['default'].createElement( 'span', { className: 'input-group-btn' }, this.props.buttonBefore ) : null; var buttonAfter = this.props.buttonAfter ? _react2['default'].createElement( 'span', { className: 'input-group-btn' }, this.props.buttonAfter ) : null; var inputGroupClassName = undefined; switch (this.props.bsSize) { case 'small': inputGroupClassName = 'input-group-sm';break; case 'large': inputGroupClassName = 'input-group-lg';break; } return addonBefore || addonAfter || buttonBefore || buttonAfter ? _react2['default'].createElement( 'div', { className: (0, _classnames2['default'])(inputGroupClassName, 'input-group'), key: 'input-group' }, addonBefore, buttonBefore, children, addonAfter, buttonAfter ) : children; } }, { key: 'renderIcon', value: function renderIcon() { var classes = { 'glyphicon': true, 'form-control-feedback': true, 'glyphicon-ok': this.props.bsStyle === 'success', 'glyphicon-warning-sign': this.props.bsStyle === 'warning', 'glyphicon-remove': this.props.bsStyle === 'error' }; return this.props.hasFeedback ? _react2['default'].createElement('span', { className: (0, _classnames2['default'])(classes), key: 'icon' }) : null; } }, { key: 'renderHelp', value: function renderHelp() { return this.props.help ? _react2['default'].createElement( 'span', { className: 'help-block', key: 'help' }, this.props.help ) : null; } }, { key: 'renderCheckboxAndRadioWrapper', value: function renderCheckboxAndRadioWrapper(children) { var classes = { 'checkbox': this.props.type === 'checkbox', 'radio': this.props.type === 'radio' }; return _react2['default'].createElement( 'div', { className: (0, _classnames2['default'])(classes), key: 'checkboxRadioWrapper' }, children ); } }, { key: 'renderWrapper', value: function renderWrapper(children) { return this.props.wrapperClassName ? _react2['default'].createElement( 'div', { className: this.props.wrapperClassName, key: 'wrapper' }, children ) : children; } }, { key: 'renderLabel', value: function renderLabel(children) { var classes = { 'control-label': !this.isCheckboxOrRadio() }; classes[this.props.labelClassName] = this.props.labelClassName; return this.props.label ? _react2['default'].createElement( 'label', { htmlFor: this.props.id, className: (0, _classnames2['default'])(classes), key: 'label' }, children, this.props.label ) : children; } }, { key: 'renderInput', value: function renderInput() { if (!this.props.type) { return this.props.children; } switch (this.props.type) { case 'select': return _react2['default'].createElement( 'select', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control'), ref: 'input', key: 'input' }), this.props.children ); case 'textarea': return _react2['default'].createElement('textarea', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control'), ref: 'input', key: 'input' })); case 'static': return _react2['default'].createElement( 'p', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control-static'), ref: 'input', key: 'input' }), this.props.value ); } var className = this.isCheckboxOrRadio() || this.isFile() ? '' : 'form-control'; return _react2['default'].createElement('input', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, className), ref: 'input', key: 'input' })); } }, { key: 'renderFormGroup', value: function renderFormGroup(children) { return _react2['default'].createElement( _FormGroup2['default'], this.props, children ); } }, { key: 'renderChildren', value: function renderChildren() { return !this.isCheckboxOrRadio() ? [this.renderLabel(), this.renderWrapper([this.renderInputGroup(this.renderInput()), this.renderIcon(), this.renderHelp()])] : this.renderWrapper([this.renderCheckboxAndRadioWrapper(this.renderLabel(this.renderInput())), this.renderHelp()]); } }, { key: 'render', value: function render() { var children = this.renderChildren(); return this.renderFormGroup(children); } }]); return InputBase; })(_react2['default'].Component); InputBase.propTypes = { type: _react2['default'].PropTypes.string, label: _react2['default'].PropTypes.node, help: _react2['default'].PropTypes.node, addonBefore: _react2['default'].PropTypes.node, addonAfter: _react2['default'].PropTypes.node, buttonBefore: _react2['default'].PropTypes.node, buttonAfter: _react2['default'].PropTypes.node, bsSize: _react2['default'].PropTypes.oneOf(['small', 'medium', 'large']), bsStyle: _react2['default'].PropTypes.oneOf(['success', 'warning', 'error']), hasFeedback: _react2['default'].PropTypes.bool, id: _react2['default'].PropTypes.string, groupClassName: _react2['default'].PropTypes.string, wrapperClassName: _react2['default'].PropTypes.string, labelClassName: _react2['default'].PropTypes.string, multiple: _react2['default'].PropTypes.bool, disabled: _react2['default'].PropTypes.bool, value: _react2['default'].PropTypes.any }; exports['default'] = InputBase; module.exports = exports['default']; /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports['default'] = deprecationWarning; function deprecationWarning(oldname, newname, link) { if (true) { if (!window.console && typeof console.warn !== 'function') { return; } var message = '' + oldname + ' is deprecated. Use ' + newname + ' instead.'; console.warn(message); if (link) { console.warn('You can read more about it here ' + link); } } } module.exports = exports['default']; /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2014, Facebook, Inc. * All rights reserved. * * This file contains an unmodified version of: * https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/Object.assign.js * * This source code is licensed under the BSD-style license found here: * https://github.com/facebook/react/blob/v0.12.0/LICENSE * An additional grant of patent rights can be found here: * https://github.com/facebook/react/blob/v0.12.0/PATENTS */ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function assign(target, sources) { if (target == null) { throw new TypeError('Object.assign target cannot be null or undefined'); } var to = Object(target); var hasOwnProperty = Object.prototype.hasOwnProperty; for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { var nextSource = arguments[nextIndex]; if (nextSource == null) { continue; } var from = Object(nextSource); // We don't currently support accessors nor proxies. Therefore this // copy cannot throw. If we ever supported this then we must handle // exceptions and side-effects. We don't support symbols so they won't // be transferred. for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } } return to; } exports['default'] = assign; module.exports = exports['default']; /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports['default'] = collapsable; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); var _deprecationWarning = __webpack_require__(62); var _deprecationWarning2 = _interopRequireDefault(_deprecationWarning); function collapsable(props, propName, componentName) { if (props[propName] !== undefined) { (0, _deprecationWarning2['default'])('' + propName + ' in ' + componentName, 'collapsible', 'https://github.com/react-bootstrap/react-bootstrap/issues/425'); } return _react2['default'].PropTypes.bool.call(null, props, propName, componentName); } module.exports = exports['default']; /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { /** * Safe chained function * * Will only create a new function if needed, * otherwise will pass back existing functions or null. * * @param {function} one * @param {function} two * @returns {function|null} */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function createChainedFunction(one, two) { var hasOne = typeof one === 'function'; var hasTwo = typeof two === 'function'; if (!hasOne && !hasTwo) { return null; } if (!hasOne) { return two; } if (!hasTwo) { return one; } return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } exports['default'] = createChainedFunction; module.exports = exports['default']; /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This file contains a modified version of: * https://github.com/facebook/react/blob/v0.12.0/src/addons/transitions/ReactTransitionEvents.js * * This source code is licensed under the BSD-style license found here: * https://github.com/facebook/react/blob/v0.12.0/LICENSE * An additional grant of patent rights can be found here: * https://github.com/facebook/react/blob/v0.12.0/PATENTS */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); /** * EVENT_NAME_MAP is used to determine which event fired when a * transition/animation ends, based on the style property used to * define that event. */ var EVENT_NAME_MAP = { transitionend: { 'transition': 'transitionend', 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'mozTransitionEnd', 'OTransition': 'oTransitionEnd', 'msTransition': 'MSTransitionEnd' }, animationend: { 'animation': 'animationend', 'WebkitAnimation': 'webkitAnimationEnd', 'MozAnimation': 'mozAnimationEnd', 'OAnimation': 'oAnimationEnd', 'msAnimation': 'MSAnimationEnd' } }; var endEvents = []; function detectEvents() { var testEl = document.createElement('div'); var style = testEl.style; // On some platforms, in particular some releases of Android 4.x, // the un-prefixed "animation" and "transition" properties are defined on the // style object but the events that fire will still be prefixed, so we need // to check if the un-prefixed events are useable, and if not remove them // from the map if (!('AnimationEvent' in window)) { delete EVENT_NAME_MAP.animationend.animation; } if (!('TransitionEvent' in window)) { delete EVENT_NAME_MAP.transitionend.transition; } for (var baseEventName in EVENT_NAME_MAP) { var baseEvents = EVENT_NAME_MAP[baseEventName]; for (var styleName in baseEvents) { if (styleName in style) { endEvents.push(baseEvents[styleName]); break; } } } } if (canUseDOM) { detectEvents(); } // We use the raw {add|remove}EventListener() call because EventListener // does not know how to remove event listeners and we really should // clean up. Also, these events are not triggered in older browsers // so we should be A-OK here. function addEventListener(node, eventName, eventListener) { node.addEventListener(eventName, eventListener, false); } function removeEventListener(node, eventName, eventListener) { node.removeEventListener(eventName, eventListener, false); } var ReactTransitionEvents = { addEndEventListener: function addEndEventListener(node, eventListener) { if (endEvents.length === 0) { // If CSS transitions are not supported, trigger an "end animation" // event immediately. window.setTimeout(eventListener, 0); return; } endEvents.forEach(function (endEvent) { addEventListener(node, endEvent, eventListener); }); }, removeEndEventListener: function removeEndEventListener(node, eventListener) { if (endEvents.length === 0) { return; } endEvents.forEach(function (endEvent) { removeEventListener(node, endEvent, eventListener); }); } }; exports['default'] = ReactTransitionEvents; module.exports = exports['default']; /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); /** * Creates new trigger class that injects context into overlay. */ exports['default'] = createContextWrapper; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = __webpack_require__(55); var _react2 = _interopRequireDefault(_react); function createContextWrapper(Trigger, propName) { return function (contextTypes) { var ContextWrapper = (function (_React$Component) { function ContextWrapper() { _classCallCheck(this, ContextWrapper); if (_React$Component != null) { _React$Component.apply(this, arguments); } } _inherits(ContextWrapper, _React$Component); _createClass(ContextWrapper, [{ key: 'getChildContext', value: function getChildContext() { return this.props.context; } }, { key: 'render', value: function render() { // Strip injected props from below. var _props = this.props; var wrapped = _props.wrapped; var props = _objectWithoutProperties(_props, ['wrapped']); // eslint-disable-line object-shorthand delete props.context; return _react2['default'].cloneElement(wrapped, props); } }]); return ContextWrapper; })(_react2['default'].Component); ContextWrapper.childContextTypes = contextTypes; var TriggerWithContext = (function () { function TriggerWithContext() { _classCallCheck(this, TriggerWithContext); } _createClass(TriggerWithContext, [{ key: 'render', value: function render() { var props = _extends({}, this.props); props[propName] = this.getWrappedOverlay(); return _react2['default'].createElement( Trigger, props, this.props.children ); } }, { key: 'getWrappedOverlay', value: function getWrappedOverlay() { return _react2['default'].createElement(ContextWrapper, { context: this.context, wrapped: this.props[propName] }); } }]); return TriggerWithContext; })(); TriggerWithContext.contextTypes = contextTypes; return TriggerWithContext; }; } module.exports = exports['default']; /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ function classNames () { 'use strict'; var classes = ''; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if ('string' === argType || 'number' === argType) { classes += ' ' + arg; } else if (Array.isArray(arg)) { classes += ' ' + classNames.apply(null, arg); } else if ('object' === argType) { for (var key in arg) { if (arg.hasOwnProperty(key) && arg[key]) { classes += ' ' + key; } } } } return classes.substr(1); } // safely export classNames for node / browserify if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } /* global define */ // safely export classNames for RequireJS if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return classNames; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } /***/ } /******/ ]) }); ;
src/Menu/MenuAnchor.js
kradio3/react-mdc-web
import PropTypes from 'prop-types'; import React from 'react'; import classnames from 'classnames'; const propTypes = { children: PropTypes.node, className: PropTypes.string, }; const MenuAnchor = ({ children, className, ...otherProps }) => ( <div className={classnames('mdc-menu-anchor', className)} {...otherProps} > {children} </div> ); MenuAnchor.propTypes = propTypes; export default MenuAnchor;
lib/Hideo.js
halilb/react-native-textinput-effects
import React from 'react'; import PropTypes from 'prop-types'; import { Animated, TextInput, TouchableWithoutFeedback, View, StyleSheet, } from 'react-native'; import BaseInput from './BaseInput'; export default class Hideo extends BaseInput { static propTypes = { /* * this is applied as background color of icon */ iconBackgroundColor: PropTypes.string, /* * This is the icon component you are importing from react-native-vector-icons. * import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; * iconClass={FontAwesomeIcon} */ iconClass: PropTypes.func.isRequired, /* * Passed to react-native-vector-icons library as name prop */ iconName: PropTypes.string.isRequired, /* * Passed to react-native-vector-icons library as color prop */ iconColor: PropTypes.string, /* * Passed to react-native-vector-icons library as size prop. */ iconSize: PropTypes.number, }; static defaultProps = { iconColor: 'white', iconSize: 25, iconBackgroundColor: '#899dda', height: 48, animationDuration: 200, }; render() { const { iconClass, iconColor, iconSize, iconName, iconBackgroundColor, style: containerStyle, inputStyle, height: inputHeight, } = this.props; const { focusedAnim, value, } = this.state; const AnimatedIcon = Animated.createAnimatedComponent(iconClass); return ( <View style={[styles.container, containerStyle]} onLayout={this._onLayout} > <TouchableWithoutFeedback onPress={this.focus}> <Animated.View style={{ backgroundColor: iconBackgroundColor, justifyContent: 'center', alignItems: 'center', height: inputHeight, width: focusedAnim.interpolate({ inputRange: [0, 1], outputRange: [60, 40], }), }} > <AnimatedIcon name={iconName} color={iconColor} style={{ fontSize: focusedAnim.interpolate({ inputRange: [0, 1], outputRange: [iconSize, iconSize * 0.6], }), }} /> </Animated.View> </TouchableWithoutFeedback> <TextInput ref={this.input} {...this.props} style={[styles.textInput, inputStyle]} value={value} onBlur={this._onBlur} onChange={this._onChange} onFocus={this._onFocus} underlineColorAndroid={'transparent'} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'row', }, textInput: { flex: 1, paddingHorizontal: 16, paddingVertical: 0, color: 'black', backgroundColor: 'white', fontSize: 18, }, });
ajax/libs/yui/3.5.0/datatable-body/datatable-body-debug.js
FaiblUG/cdnjs
YUI.add('datatable-body', function(Y) { /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. @module datatable @submodule datatable-body @since 3.5.0 **/ var Lang = Y.Lang, isArray = Lang.isArray, isNumber = Lang.isNumber, isString = Lang.isString, fromTemplate = Lang.sub, htmlEscape = Y.Escape.html, toArray = Y.Array, bind = Y.bind, YObject = Y.Object, ClassNameManager = Y.ClassNameManager, _getClassName = ClassNameManager.getClassName; /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. Translates the provided `modelList` into a rendered `<tbody>` based on the data in the constituent Models, altered or ammended by any special column configurations. The `columns` configuration, passed to the constructor, determines which columns will be rendered. The rendering process involves constructing an HTML template for a complete row of data, built by concatenating a customized copy of the instance's `CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is then populated with values from each Model in the `modelList`, aggregating a complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @class BodyView @namespace DataTable @extends View @since 3.5.0 **/ Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], { // -- Instance properties ------------------------------------------------- /** HTML template used to create table cells. @property CELL_TEMPLATE @type {HTML} @default '<td {headers} class="{className}">{content}</td>' @since 3.5.0 **/ CELL_TEMPLATE: '<td {headers} class="{className}">{content}</td>', /** CSS class applied to even rows. This is assigned at instantiation after setting up the `_cssPrefix` for the instance. For DataTable, this will be `yui3-datatable-even`. @property CLASS_EVEN @type {String} @default 'yui3-table-even' @since 3.5.0 **/ //CLASS_EVEN: null /** CSS class applied to odd rows. This is assigned at instantiation after setting up the `_cssPrefix` for the instance. When used by DataTable instances, this will be `yui3-datatable-odd`. @property CLASS_ODD @type {String} @default 'yui3-table-odd' @since 3.5.0 **/ //CLASS_ODD: null /** HTML template used to create table rows. @property ROW_TEMPLATE @type {HTML} @default '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>' @since 3.5.0 **/ ROW_TEMPLATE : '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>', /** The object that serves as the source of truth for column and row data. This property is assigned at instantiation from the `source` property of the configuration object passed to the constructor. @property source @type {Object} @default (initially unset) @since 3.5.0 **/ //TODO: should this be protected? //source: null, // -- Public methods ------------------------------------------------------ /** Returns the `<td>` Node from the given row and column index. Alternately, the `seed` can be a Node. If so, the nearest ancestor cell is returned. If the `seed` is a cell, it is returned. If there is no cell at the given coordinates, `null` is returned. Optionally, include an offset array or string to return a cell near the cell identified by the `seed`. The offset can be an array containing the number of rows to shift followed by the number of columns to shift, or one of "above", "below", "next", or "previous". <pre><code>// Previous cell in the previous row var cell = table.getCell(e.target, [-1, -1]); // Next cell var cell = table.getCell(e.target, 'next'); var cell = table.getCell(e.taregt, [0, 1];</pre></code> @method getCell @param {Number[]|Node} seed Array of row and column indexes, or a Node that is either the cell itself or a descendant of one. @param {Number[]|String} [shift] Offset by which to identify the returned cell Node @return {Node} @since 3.5.0 **/ getCell: function (seed, shift) { var tbody = this.get('container'), row, cell, index, rowIndexOffset; if (seed && tbody) { if (isArray(seed)) { row = tbody.get('children').item(seed[0]); cell = row && row.get('children').item(seed[1]); } else if (Y.instanceOf(seed, Y.Node)) { cell = seed.ancestor('.' + this.getClassName('cell'), true); } if (cell && shift) { rowIndexOffset = tbody.get('firstChild.rowIndex'); if (isString(shift)) { // TODO this should be a static object map switch (shift) { case 'above' : shift = [-1, 0]; break; case 'below' : shift = [1, 0]; break; case 'next' : shift = [0, 1]; break; case 'previous': shift = [0, -1]; break; } } if (isArray(shift)) { index = cell.get('parentNode.rowIndex') + shift[0] - rowIndexOffset; row = tbody.get('children').item(index); index = cell.get('cellIndex') + shift[1]; cell = row && row.get('children').item(index); } } } return cell || null; }, /** Builds a CSS class name from the provided tokens. If the instance is created with `cssPrefix` or `source` in the configuration, it will use this prefix (the `_cssPrefix` of the `source` object) as the base token. This allows class instances to generate markup with class names that correspond to the parent class that is consuming them. @method getClassName @param {String} token* Any number of tokens to include in the class name @return {String} The generated class name @since 3.5.0 **/ getClassName: function () { var args = toArray(arguments); args.unshift(this._cssPrefix); args.push(true); return _getClassName.apply(ClassNameManager, args); }, /** Returns the Model associated to the row Node or id provided. Passing the Node or id for a descendant of the row also works. If no Model can be found, `null` is returned. @method getRecord @param {String|Node} seed Row Node or `id`, or one for a descendant of a row @return {Model} @since 3.5.0 **/ getRecord: function (seed) { var modelList = this.get('modelList'), tbody = this.get('container'), row = null, record; if (tbody) { if (isString(seed)) { seed = tbody.one('#' + seed); } if (Y.instanceOf(seed, Y.Node)) { row = seed.ancestor(function (node) { return node.get('parentNode').compareTo(tbody); }, true); record = row && modelList.getByClientId(row.getData('yui3-record')); } } return record || null; }, /** Returns the `<tr>` Node from the given row index, Model, or Model's `clientId`. If the rows haven't been rendered yet, or if the row can't be found by the input, `null` is returned. @method getRow @param {Number|String|Model} id Row index, Model instance, or clientId @return {Node} @since 3.5.0 **/ getRow: function (id) { var tbody = this.get('container') || null; if (id) { id = this._idMap[id.get ? id.get('clientId') : id] || id; } return tbody && Y.one(isNumber(id) ? tbody.get('children').item(id) : '#' + id); }, /** Creates the table's `<tbody>` content by assembling markup generated by populating the `ROW\_TEMPLATE`, and `CELL\_TEMPLATE` templates with content from the `columns` property and `modelList` attribute. The rendering process happens in three stages: 1. A row template is assembled from the `columns` property (see `_createRowTemplate`) 2. An HTML string is built up by concatening the application of the data in each Model in the `modelList` to the row template. For cells with `formatter`s, the function is called to generate cell content. Cells with `nodeFormatter`s are ignored. For all other cells, the data value from the Model attribute for the given column key is used. The accumulated row markup is then inserted into the container. 3. If any column is configured with a `nodeFormatter`, the `modelList` is iterated again to apply the `nodeFormatter`s. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @method render @return {BodyView} The instance @chainable @since 3.5.0 **/ render: function () { var tbody = this.get('container'), data = this.get('modelList'), columns = this.columns; // Needed for mutation this._createRowTemplate(columns); if (tbody && data) { tbody.setContent(this._createDataHTML(columns)); this._applyNodeFormatters(tbody, columns); } this.bindUI(); return this; }, // -- Protected and private methods --------------------------------------- /** Handles changes in the source's columns attribute. Redraws the table data. @method _afterColumnsChange @param {EventFacade} e The `columnsChange` event object @protected @since 3.5.0 **/ // TODO: Preserve existing DOM // This will involve parsing and comparing the old and new column configs // and reacting to four types of changes: // 1. formatter, nodeFormatter, emptyCellValue changes // 2. column deletions // 3. column additions // 4. column moves (preserve cells) _afterColumnsChange: function (e) { this.columns = this._parseColumns(e.newVal); this.render(); }, /** Handles modelList changes, including additions, deletions, and updates. Modifies the existing table DOM accordingly. @method _afterDataChange @param {EventFacade} e The `change` event from the ModelList @protected @since 3.5.0 **/ _afterDataChange: function (e) { // Baseline view will just rerender the tbody entirely this.render(); }, /** Reacts to a change in the instance's `modelList` attribute by breaking down the bubbling relationship with the previous `modelList` and setting up that relationship with the new one. @method _afterModelListChange @param {EventFacade} e The `modelListChange` event @protected @since 3.5.0 **/ _afterModelListChange: function (e) { var old = e.prevVal, now = e.newVal; if (old && old.removeTarget) { old.removeTarget(this); } if (now && now.addTarget(this)) { now.addTarget(this); } this._idMap = {}; }, /** Iterates the `modelList`, and calls any `nodeFormatter`s found in the `columns` param on the appropriate cell Nodes in the `tbody`. @method _applyNodeFormatters @param {Node} tbody The `<tbody>` Node whose columns to update @param {Object[]} columns The column configurations @protected @since 3.5.0 **/ _applyNodeFormatters: function (tbody, columns) { var source = this.source, data = this.get('modelList'), formatters = [], linerQuery = '.' + this.getClassName('liner'), rows, i, len; // Only iterate the ModelList again if there are nodeFormatters for (i = 0, len = columns.length; i < len; ++i) { if (columns[i].nodeFormatter) { formatters.push(i); } } if (data && formatters.length) { rows = tbody.get('childNodes'); data.each(function (record, index) { var formatterData = { data : record.toJSON(), record : record, rowIndex : index }, row = rows.item(index), i, len, col, key, cells, cell, keep; if (row) { cells = row.get('childNodes'); for (i = 0, len = formatters.length; i < len; ++i) { cell = cells.item(formatters[i]); if (cell) { col = formatterData.column = columns[formatters[i]]; key = col.key || col.id; formatterData.value = record.get(key); formatterData.td = cell; formatterData.cell = cell.one(linerQuery) || cell; keep = col.nodeFormatter.call(source,formatterData); if (keep === false) { // Remove from the Node cache to reduce // memory footprint. This also purges events, // which you shouldn't be scoping to a cell // anyway. You've been warned. Incidentally, // you should always return false. Just sayin. cell.destroy(true); } } } } }); } }, /** Binds event subscriptions from the UI and the source (if assigned). @method bindUI @protected @since 3.5.0 **/ bindUI: function () { var handles = this._eventHandles; if (this.source && !handles.columnsChange) { handles.columnsChange = this.source.after('columnsChange', bind('_afterColumnsChange', this)); } if (!handles.dataChange) { handles.dataChange = this.after( ['modelListChange', '*:change', '*:add', '*:remove', '*:reset'], bind('_afterDataChange', this)); } }, /** The base token for classes created with the `getClassName` method. @property _cssPrefix @type {String} @default 'yui3-table' @protected @since 3.5.0 **/ _cssPrefix: ClassNameManager.getClassName('table'), /** Iterates the `modelList` and applies each Model to the `_rowTemplate`, allowing any column `formatter` or `emptyCellValue` to override cell content for the appropriate column. The aggregated HTML string is returned. @method _createDataHTML @param {Object[]} columns The column configurations to customize the generated cell content or class names @return {HTML} The markup for all Models in the `modelList`, each applied to the `_rowTemplate` @protected @since 3.5.0 **/ _createDataHTML: function (columns) { var data = this.get('modelList'), html = ''; if (data) { data.each(function (model, index) { html += this._createRowHTML(model, index); }, this); } return html; }, /** Applies the data of a given Model, modified by any column formatters and supplemented by other template values to the instance's `_rowTemplate` (see `_createRowTemplate`). The generated string is then returned. The data from Model's attributes is fetched by `toJSON` and this data object is appended with other properties to supply values to {placeholders} in the template. For a template generated from a Model with 'foo' and 'bar' attributes, the data object would end up with the following properties before being used to populate the `_rowTemplate`: * `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute. * `foo` - The value to populate the 'foo' column cell content. This value will be the value stored in the Model's `foo` attribute, or the result of the column's `formatter` if assigned. If the value is '', `null`, or `undefined`, and the column's `emptyCellValue` is assigned, that value will be used. * `bar` - Same for the 'bar' column cell content. * `foo-className` - String of CSS classes to apply to the `<td>`. * `bar-className` - Same. * `rowClass` - String of CSS classes to apply to the `<tr>`. This will be the odd/even class per the specified index plus any additional classes assigned by column formatters (via `o.rowClass`). Because this object is available to formatters, any additional properties can be added to fill in custom {placeholders} in the `_rowTemplate`. @method _createRowHTML @param {Model} model The Model instance to apply to the row template @param {Number} index The index the row will be appearing @return {HTML} The markup for the provided Model, less any `nodeFormatter`s @protected @since 3.5.0 **/ _createRowHTML: function (model, index) { var data = model.toJSON(), clientId = model.get('clientId'), values = { rowId : this._getRowId(clientId), clientId: clientId, rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN }, source = this.source || this, columns = this.columns, i, len, col, token, value, formatterData; for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; value = data[col.key]; token = col._id; values[token + '-className'] = ''; if (col.formatter) { formatterData = { value : value, data : data, column : col, record : model, className: '', rowClass : '', rowIndex : index }; if (typeof col.formatter === 'string') { if (value !== undefined) { // TODO: look for known formatters by string name value = fromTemplate(col.formatter, formatterData); } } else { // Formatters can either return a value value = col.formatter.call(source, formatterData); // or update the value property of the data obj passed if (value === undefined) { value = formatterData.value; } values[token + '-className'] = formatterData.className; values.rowClass += ' ' + formatterData.rowClass; } } if (value === undefined || value === null || value === '') { value = col.emptyCellValue || ''; } values[token] = col.allowHTML ? value : htmlEscape(value); values.rowClass = values.rowClass.replace(/\s+/g, ' '); } return fromTemplate(this._rowTemplate, values); }, /** Creates a custom HTML template string for use in generating the markup for individual table rows with {placeholder}s to capture data from the Models in the `modelList` attribute or from column `formatter`s. Assigns the `_rowTemplate` property. @method _createRowTemplate @param {Object[]} columns Array of column configuration objects @protected @since 3.5.0 **/ _createRowTemplate: function (columns) { var html = '', cellTemplate = this.CELL_TEMPLATE, i, len, col, key, token, headers, tokenValues; for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; key = col.key; token = col._id; // Only include headers if there are more than one headers = (col._headers || []).length > 1 ? 'headers="' + col._headers.join(' ') + '"' : ''; tokenValues = { content : '{' + token + '}', headers : headers, className: this.getClassName('col', token) + ' ' + (col.className || '') + ' ' + this.getClassName('cell') + ' {' + token + '-className}' }; if (col.nodeFormatter) { // Defer all node decoration to the formatter tokenValues.content = ''; } html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues); } this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, { content: html }); }, /** Destroys the instance. @method destructor @protected @since 3.5.0 **/ destructor: function () { // will unbind the bubble relationship and clear the table if necessary this.set('modelList', null); (new Y.EventHandle(YObject.values(this._eventHandles))).detach(); }, /** Holds the event subscriptions needing to be detached when the instance is `destroy()`ed. @property _eventHandles @type {Object} @default undefined (initially unset) @protected @since 3.5.0 **/ //_eventHandles: null, /** Returns the row ID associated with a Model's clientId. @method _getRowId @param {String} clientId The Model clientId @return {String} @protected **/ _getRowId: function (clientId) { return this._idMap[clientId] || (this._idMap[clientId] = Y.guid()); }, /** Map of Model clientIds to row ids. @property _idMap @type {Object} @protected **/ //_idMap, /** Initializes the instance. Reads the following configuration properties in addition to the instance attributes: * `columns` - (REQUIRED) The initial column information * `cssPrefix` - The base string for classes generated by `getClassName` * `source` - The object to serve as source of truth for column info @method initializer @param {Object} config Configuration data @protected @since 3.5.0 **/ initializer: function (config) { var cssPrefix = config.cssPrefix || (config.source || {}).cssPrefix, modelList = this.get('modelList'); this.source = config.source; this.columns = this._parseColumns(config.columns); this._eventHandles = {}; this._idMap = {}; if (cssPrefix) { this._cssPrefix = cssPrefix; } this.CLASS_ODD = this.getClassName('odd'); this.CLASS_EVEN = this.getClassName('even'); this.after('modelListChange', bind('_afterModelListChange', this)); if (modelList && modelList.addTarget) { modelList.addTarget(this); } }, /** Flattens an array of potentially nested column configurations into a single depth array of data columns. Columns that have children are disregarded in favor of searching their child columns. The resulting array corresponds 1:1 with columns that will contain data in the `<tbody>`. @method _parseColumns @param {Object[]} data Array of unfiltered column configuration objects @param {Object[]} columns Working array of data columns. Used for recursion. @return {Object[]} Only those columns that will be rendered. @protected @since 3.5.0 **/ _parseColumns: function (data, columns) { var col, i, len; columns || (columns = []); if (isArray(data) && data.length) { for (i = 0, len = data.length; i < len; ++i) { col = data[i]; if (typeof col === 'string') { col = { key: col }; } if (col.key || col.formatter || col.nodeFormatter) { col.index = columns.length; columns.push(col); } else if (col.children) { this._parseColumns(col.children, columns); } } } return columns; } /** The HTML template used to create a full row of markup for a single Model in the `modelList` plus any customizations defined in the column configurations. @property _rowTemplate @type {HTML} @default (initially unset) @protected @since 3.5.0 **/ //_rowTemplate: null }, { ATTRS: { modelList: { setter: '_setModelList' } } }); }, '@VERSION@' ,{requires:['datatable-core', 'view', 'classnamemanager']});
docs/src/pages/components/app-bar/SearchAppBar.js
allanalexandre/material-ui
import React from 'react'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import IconButton from '@material-ui/core/IconButton'; import Typography from '@material-ui/core/Typography'; import InputBase from '@material-ui/core/InputBase'; import { fade } from '@material-ui/core/styles/colorManipulator'; import { makeStyles } from '@material-ui/core/styles'; import MenuIcon from '@material-ui/icons/Menu'; import SearchIcon from '@material-ui/icons/Search'; const useStyles = makeStyles(theme => ({ root: { flexGrow: 1, }, menuButton: { marginRight: theme.spacing(2), }, title: { flexGrow: 1, display: 'none', [theme.breakpoints.up('sm')]: { display: 'block', }, }, search: { position: 'relative', borderRadius: theme.shape.borderRadius, backgroundColor: fade(theme.palette.common.white, 0.15), '&:hover': { backgroundColor: fade(theme.palette.common.white, 0.25), }, marginLeft: 0, width: '100%', [theme.breakpoints.up('sm')]: { marginLeft: theme.spacing(1), width: 'auto', }, }, searchIcon: { width: theme.spacing(7), height: '100%', position: 'absolute', pointerEvents: 'none', display: 'flex', alignItems: 'center', justifyContent: 'center', }, inputRoot: { color: 'inherit', }, inputInput: { padding: theme.spacing(1, 1, 1, 7), transition: theme.transitions.create('width'), width: '100%', [theme.breakpoints.up('sm')]: { width: 120, '&:focus': { width: 200, }, }, }, })); function SearchAppBar() { const classes = useStyles(); return ( <div className={classes.root}> <AppBar position="static"> <Toolbar> <IconButton edge="start" className={classes.menuButton} color="inherit" aria-label="Open drawer" > <MenuIcon /> </IconButton> <Typography className={classes.title} variant="h6" noWrap> Material-UI </Typography> <div className={classes.search}> <div className={classes.searchIcon}> <SearchIcon /> </div> <InputBase placeholder="Search…" classes={{ root: classes.inputRoot, input: classes.inputInput, }} /> </div> </Toolbar> </AppBar> </div> ); } export default SearchAppBar;
packages/wix-style-react/src/MediaOverlay/docs/index.story.js
wix/wix-style-react
import React from 'react'; import { header, tabs, tab, description, importExample, title, divider, example, playground, api, testkit, } from 'wix-storybook-utils/Sections'; import basicExample from '!raw-loader!./examples/basic'; import useCaseExample1 from '!raw-loader!./examples/useCase1'; import useCaseExample2 from '!raw-loader!./examples/useCase2'; import useCaseExample3 from '!raw-loader!./examples/useCase3'; import useCaseExample4 from '!raw-loader!./examples/useCase4'; import useCaseExample5 from '!raw-loader!./examples/useCase5'; import customMediaExample from '!raw-loader!./examples/customMedia'; import placementExample from '!raw-loader!./examples/placement'; import skinExample from '!raw-loader!./examples/skin'; import hoverSkinExample from '!raw-loader!./examples/hoverSkin'; import Proportion from '../../Proportion'; import Box from '../../Box'; import { galleryItemWithHoverActions } from './examples/content'; import HeaderExample from './examples/header'; import { storySettings } from '../test/storySettings'; import MediaOverlay from '..'; export default { category: storySettings.category, storyName: 'MediaOverlay', component: MediaOverlay, componentPath: '..', componentProps: { skin: 'gradient', hoverSkin: 'dark', media: 'example.jpg', children: galleryItemWithHoverActions, hovered: false, }, exampleProps: { children: [ { label: 'Hover actions at top-end', value: galleryItemWithHoverActions, }, ], }, componentWrapper: ({ component }) => ( <Proportion aspectRatio={Proportion.PREDEFINED_RATIOS.landscape}> {component} </Proportion> ), sections: [ header({ component: ( <Box width="200px" height="110px"> <HeaderExample /> </Box> ), }), tabs([ tab({ title: 'Description', sections: [ description( 'A component used to overlay any other content on top of a media element.', ), importExample("import { MediaOverlay } from 'wix-style-react';"), divider(), title('Examples'), example({ title: 'Basic overlay', text: 'A basic example of overlaying content on a media element where some items are visible only on hover. You can control the visibility of `<MediaOverlay.Content>` elements using `visible` prop.', source: basicExample, }), example({ title: 'Skins', text: 'Use `skin` prop to set different skins.', source: skinExample, }), example({ title: 'Hover skins', text: 'Use `hoverSkin` prop to set different skins for hover state.', source: hoverSkinExample, }), example({ title: 'Content placement', text: 'The position of `<MediaOverlay.Content>` elements can be set using `placement` prop.', source: placementExample, }), example({ title: 'Custom media element', text: 'It is possible to use a custom node with `media` prop. This example uses a `<div>` element with linear gradient background as a media prop.', source: customMediaExample, }), divider(), title('Use Cases'), example({ text: 'Combination of gradient overlay and elements on the bottom can be used to display relevant information in a default state of the element. For example to display source or duration of the video.', source: useCaseExample1, }), example({ text: 'A layout of top right actions on a gradient overlay may be used for situations when there are more than two actions and imagery needs to be visible on the overlay. Actions can be supported by other components at the same time.', source: useCaseExample2, }), example({ text: "A counter type layout can be used to indicate a number of contained images that can't be shown because of insufficient space. It can be used in galleries as the default state of the last image. It should always be used with color overlay.", source: useCaseExample3, }), example({ text: 'The center placement of the actions on a color overlay is used when one or few prominent actions are needed.', source: useCaseExample4, }), example({ text: 'Top right placement of the actions with color overlay should be used for reorderable components. The function should always be supported by the use of compound `<MediaOverlay.DragHandle />` component on the hover state.', source: useCaseExample5, }), ], }), ...[ { title: 'API', sections: [api()] }, { title: 'Testkit', sections: [testkit()] }, { title: 'Playground', sections: [playground()] }, ].map(tab), ]), ], };
src/components/Main.js
genmmao/douyu-react
/* * 文件名: Main * 所属:主页 */ require('styles/App.css'); require('styles/Login.scss'); import React from 'react'; import axios from 'axios'; import DY from '../actions/AppMethods'; import Row from './lib/Row'; import Swiper from './lib/Swiper'; import Header from './lib/Header'; import Live from './lib/Live'; import More from './lib/More'; import BottomTip from './lib/BottomTip'; import AppConstants from '../actions/AppConstants' const BASE_URL = AppConstants.BASE_URL export default class Main extends React.Component { constructor(props, context) { super(props, context) this.state = { roomData: [], // 房间数据 } } componentWillMount() { } componentDidMount() { let that = this; axios.get(BASE_URL + '/index', { }) .then( (res) => { that.setState({ roomData: res.data.data }) }) .catch( (err) => { console.log(err); }) } render() { return ( <div > <div id="js-app-container"> <Header /> <div className='m-slider'> <Swiper /> </div> { this.state.roomData.map((item, key) => ( <Row title={item.title} link={ key === 0 ? '全部 >' :''} key={key}> { item.roomData.map((item2, key2) => ( <Live imgUrl={item2.img} title={item2.typeName} dyname={item2.title} popu={item2.popu} key={key2}/> )) } </Row> )) } <More /> <BottomTip /> </div> </div> ); } }
vendor/htmlburger/carbon-fields/assets/js/fields/components/sidebar/index.js
FolsomCreative/storynav
/** * The external dependencies. */ import React from 'react'; import PropTypes from 'prop-types'; import { compose, withHandlers, setStatic } from 'recompose'; import { trim, find, kebabCase } from 'lodash'; /** * The internal dependencies. */ import { addSidebar } from 'sidebars/actions'; import Field from 'fields/components/field'; import withStore from 'fields/decorators/with-store'; import withSetup from 'fields/decorators/with-setup'; import { makeGetSidebarFieldOptions } from 'fields/selectors'; import { TYPE_SIDEBAR, VALIDATION_BASE } from 'fields/constants'; /** * Render a dropdown field that lists existing sidebars and * provides the ability to add new sidebars to the site. * * @param {Object} props * @param {String} props.name * @param {Object} props.field * @param {Object[]} props.options * @param {Function} props.handleChange * @return {React.Element} */ export const SidebarField = ({ name, field, options, handleChange }) => { return <Field field={field}> <select id={field.id} name={name} value={field.value} disabled={!field.ui.is_visible} onChange={handleChange} > { options.map(({ name, value }, index) => ( <option key={index} value={value}> {name} </option> )) } </select> </Field>; }; /** * Validate the props. * * @type {Object} */ SidebarField.propTypes = { name: PropTypes.string, field: PropTypes.shape({ id: PropTypes.string, value: PropTypes.string, ui: PropTypes.shape({ is_visible: PropTypes.bool, }), }), options: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), })), handleChange: PropTypes.func, }; /** * The enhancer. * * @type {Function} */ export const enhance = compose( /** * Connect to the Redux store. */ withStore( () => { const getSidebarFieldOptions = makeGetSidebarFieldOptions(); return (state, props) => ({ options: getSidebarFieldOptions(state, props.id), }); }, { addSidebar, } ), /** * Attach setup hooks. */ withSetup({ componentDidMount() { const { field, ui, options, setupField, setupValidation, setFieldValue, } = this.props; setupField(field.id, field.type, ui); if (field.required) { setupValidation(field.id, VALIDATION_BASE); } // If the field doesn't have a value, // use the first option as fallback. if (!field.value) { setFieldValue(field.id, options[0].value, 'set', false); } }, }), /** * The handlers passed to the component. */ withHandlers({ handleChange: ({ field, options, setFieldValue, addSidebar }) => ({ target: { value } }) => { if (value === 'new') { value = trim(window.prompt(carbonFieldsL10n.field.enterNameOfNewSidebar)); if (!value) { return; } if (!find(options, { name: value })) { addSidebar(value); } } value = kebabCase(value); setFieldValue(field.id, value); }, }) ); export default setStatic('type', [ TYPE_SIDEBAR, ])(enhance(SidebarField));
ajax/libs/react-router/0.12.3/ReactRouter.js
alexmojaki/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["ReactRouter"] = factory(require("react")); else root["ReactRouter"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_21__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; exports.DefaultRoute = __webpack_require__(1); exports.Link = __webpack_require__(2); exports.NotFoundRoute = __webpack_require__(3); exports.Redirect = __webpack_require__(4); exports.Route = __webpack_require__(5); exports.RouteHandler = __webpack_require__(6); exports.HashLocation = __webpack_require__(7); exports.HistoryLocation = __webpack_require__(8); exports.RefreshLocation = __webpack_require__(9); exports.StaticLocation = __webpack_require__(10); exports.ImitateBrowserBehavior = __webpack_require__(11); exports.ScrollToTopBehavior = __webpack_require__(12); exports.History = __webpack_require__(13); exports.Navigation = __webpack_require__(14); exports.RouteHandlerMixin = __webpack_require__(15); exports.State = __webpack_require__(16); exports.createRoute = __webpack_require__(17).createRoute; exports.createDefaultRoute = __webpack_require__(17).createDefaultRoute; exports.createNotFoundRoute = __webpack_require__(17).createNotFoundRoute; exports.createRedirect = __webpack_require__(17).createRedirect; exports.createRoutesFromReactChildren = __webpack_require__(18); exports.create = __webpack_require__(19); exports.run = __webpack_require__(20); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <DefaultRoute> component is a special kind of <Route> that * renders when its parent matches but none of its siblings do. * Only one such route may be used at any given level in the * route hierarchy. */ var DefaultRoute = React.createClass({ displayName: "DefaultRoute", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.falsy, children: PropTypes.falsy, handler: PropTypes.func.isRequired } }); module.exports = DefaultRoute; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var classSet = __webpack_require__(35); var assign = __webpack_require__(36); var Navigation = __webpack_require__(14); var State = __webpack_require__(16); var PropTypes = __webpack_require__(23); var Route = __webpack_require__(17); function isLeftClickEvent(event) { return event.button === 0; } function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); } /** * <Link> components are used to create an <a> element that links to a route. * When that route is active, the link gets an "active" class name (or the * value of its `activeClassName` prop). * * For example, assuming you have the following route: * * <Route name="showPost" path="/posts/:postID" handler={Post}/> * * You could use the following component to link to that route: * * <Link to="showPost" params={{ postID: "123" }} /> * * In addition to params, links may pass along query string parameters * using the `query` prop. * * <Link to="showPost" params={{ postID: "123" }} query={{ show:true }}/> */ var Link = React.createClass({ displayName: "Link", mixins: [Navigation, State], propTypes: { activeClassName: PropTypes.string.isRequired, to: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Route)]), params: PropTypes.object, query: PropTypes.object, activeStyle: PropTypes.object, onClick: PropTypes.func }, getDefaultProps: function getDefaultProps() { return { activeClassName: "active" }; }, handleClick: function handleClick(event) { var allowTransition = true; var clickResult; if (this.props.onClick) clickResult = this.props.onClick(event); if (isModifiedEvent(event) || !isLeftClickEvent(event)) { return; }if (clickResult === false || event.defaultPrevented === true) allowTransition = false; event.preventDefault(); if (allowTransition) this.transitionTo(this.props.to, this.props.params, this.props.query); }, /** * Returns the value of the "href" attribute to use on the DOM element. */ getHref: function getHref() { return this.makeHref(this.props.to, this.props.params, this.props.query); }, /** * Returns the value of the "class" attribute to use on the DOM element, which contains * the value of the activeClassName property when this <Link> is active. */ getClassName: function getClassName() { var classNames = {}; if (this.props.className) classNames[this.props.className] = true; if (this.getActiveState()) classNames[this.props.activeClassName] = true; return classSet(classNames); }, getActiveState: function getActiveState() { return this.isActive(this.props.to, this.props.params, this.props.query); }, render: function render() { var props = assign({}, this.props, { href: this.getHref(), className: this.getClassName(), onClick: this.handleClick }); if (props.activeStyle && this.getActiveState()) props.style = props.activeStyle; return React.DOM.a(props, this.props.children); } }); module.exports = Link; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <NotFoundRoute> is a special kind of <Route> that * renders when the beginning of its parent's path matches * but none of its siblings do, including any <DefaultRoute>. * Only one such route may be used at any given level in the * route hierarchy. */ var NotFoundRoute = React.createClass({ displayName: "NotFoundRoute", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.falsy, children: PropTypes.falsy, handler: PropTypes.func.isRequired } }); module.exports = NotFoundRoute; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <Redirect> component is a special kind of <Route> that always * redirects to another route when it matches. */ var Redirect = React.createClass({ displayName: "Redirect", mixins: [Configuration], propTypes: { path: PropTypes.string, from: PropTypes.string, // Alias for path. to: PropTypes.string, handler: PropTypes.falsy } }); module.exports = Redirect; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); var RouteHandler = __webpack_require__(6); /** * <Route> components specify components that are rendered to the page when the * URL matches a given pattern. * * Routes are arranged in a nested tree structure. When a new URL is requested, * the tree is searched depth-first to find a route whose path matches the URL. * When one is found, all routes in the tree that lead to it are considered * "active" and their components are rendered into the DOM, nested in the same * order as they are in the tree. * * The preferred way to configure a router is using JSX. The XML-like syntax is * a great way to visualize how routes are laid out in an application. * * var routes = [ * <Route handler={App}> * <Route name="login" handler={Login}/> * <Route name="logout" handler={Logout}/> * <Route name="about" handler={About}/> * </Route> * ]; * * Router.run(routes, function (Handler) { * React.render(<Handler/>, document.body); * }); * * Handlers for Route components that contain children can render their active * child route using a <RouteHandler> element. * * var App = React.createClass({ * render: function () { * return ( * <div class="application"> * <RouteHandler/> * </div> * ); * } * }); * * If no handler is provided for the route, it will render a matched child route. */ var Route = React.createClass({ displayName: "Route", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.string, handler: PropTypes.func, ignoreScrollBehavior: PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { handler: RouteHandler }; } }); module.exports = Route; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var RouteHandlerMixin = __webpack_require__(15); /** * A <RouteHandler> component renders the active child route handler * when routes are nested. */ var RouteHandler = React.createClass({ displayName: "RouteHandler", mixins: [RouteHandlerMixin], render: function render() { return this.createChildRouteHandler(); } }); module.exports = RouteHandler; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); var History = __webpack_require__(13); /** * Returns the current URL path from the `hash` portion of the URL, including * query string. */ function getHashPath() { return decodeURI( // We can't use window.location.hash here because it's not // consistent across browsers - Firefox will pre-decode it! window.location.href.split("#")[1] || ""); } var _actionType; function ensureSlash() { var path = getHashPath(); if (path.charAt(0) === "/") { return true; }HashLocation.replace("/" + path); return false; } var _changeListeners = []; function notifyChange(type) { if (type === LocationActions.PUSH) History.length += 1; var change = { path: getHashPath(), type: type }; _changeListeners.forEach(function (listener) { listener(change); }); } var _isListening = false; function onHashChange() { if (ensureSlash()) { // If we don't have an _actionType then all we know is the hash // changed. It was probably caused by the user clicking the Back // button, but may have also been the Forward button or manual // manipulation. So just guess 'pop'. notifyChange(_actionType || LocationActions.POP); _actionType = null; } } /** * A Location that uses `window.location.hash`. */ var HashLocation = { addChangeListener: function addChangeListener(listener) { _changeListeners.push(listener); // Do this BEFORE listening for hashchange. ensureSlash(); if (!_isListening) { if (window.addEventListener) { window.addEventListener("hashchange", onHashChange, false); } else { window.attachEvent("onhashchange", onHashChange); } _isListening = true; } }, removeChangeListener: function removeChangeListener(listener) { _changeListeners = _changeListeners.filter(function (l) { return l !== listener; }); if (_changeListeners.length === 0) { if (window.removeEventListener) { window.removeEventListener("hashchange", onHashChange, false); } else { window.removeEvent("onhashchange", onHashChange); } _isListening = false; } }, push: function push(path) { _actionType = LocationActions.PUSH; window.location.hash = path; }, replace: function replace(path) { _actionType = LocationActions.REPLACE; window.location.replace(window.location.pathname + window.location.search + "#" + path); }, pop: function pop() { _actionType = LocationActions.POP; History.back(); }, getCurrentPath: getHashPath, toString: function toString() { return "<HashLocation>"; } }; module.exports = HashLocation; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); var History = __webpack_require__(13); /** * Returns the current URL path from `window.location`, including query string. */ function getWindowPath() { return decodeURI(window.location.pathname + window.location.search); } var _changeListeners = []; function notifyChange(type) { var change = { path: getWindowPath(), type: type }; _changeListeners.forEach(function (listener) { listener(change); }); } var _isListening = false; function onPopState(event) { if (event.state === undefined) { return; } // Ignore extraneous popstate events in WebKit. notifyChange(LocationActions.POP); } /** * A Location that uses HTML5 history. */ var HistoryLocation = { addChangeListener: function addChangeListener(listener) { _changeListeners.push(listener); if (!_isListening) { if (window.addEventListener) { window.addEventListener("popstate", onPopState, false); } else { window.attachEvent("onpopstate", onPopState); } _isListening = true; } }, removeChangeListener: function removeChangeListener(listener) { _changeListeners = _changeListeners.filter(function (l) { return l !== listener; }); if (_changeListeners.length === 0) { if (window.addEventListener) { window.removeEventListener("popstate", onPopState, false); } else { window.removeEvent("onpopstate", onPopState); } _isListening = false; } }, push: function push(path) { window.history.pushState({ path: path }, "", path); History.length += 1; notifyChange(LocationActions.PUSH); }, replace: function replace(path) { window.history.replaceState({ path: path }, "", path); notifyChange(LocationActions.REPLACE); }, pop: History.back, getCurrentPath: getWindowPath, toString: function toString() { return "<HistoryLocation>"; } }; module.exports = HistoryLocation; /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var HistoryLocation = __webpack_require__(8); var History = __webpack_require__(13); /** * A Location that uses full page refreshes. This is used as * the fallback for HistoryLocation in browsers that do not * support the HTML5 history API. */ var RefreshLocation = { push: function push(path) { window.location = path; }, replace: function replace(path) { window.location.replace(path); }, pop: History.back, getCurrentPath: HistoryLocation.getCurrentPath, toString: function toString() { return "<RefreshLocation>"; } }; module.exports = RefreshLocation; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var invariant = __webpack_require__(37); function throwCannotModify() { invariant(false, "You cannot modify a static location"); } /** * A location that only ever contains a single path. Useful in * stateless environments like servers where there is no path history, * only the path that was used in the request. */ var StaticLocation = (function () { function StaticLocation(path) { _classCallCheck(this, StaticLocation); this.path = path; } _prototypeProperties(StaticLocation, null, { getCurrentPath: { value: function getCurrentPath() { return this.path; }, writable: true, configurable: true }, toString: { value: function toString() { return "<StaticLocation path=\"" + this.path + "\">"; }, writable: true, configurable: true } }); return StaticLocation; })(); // TODO: Include these in the above class definition // once we can use ES7 property initializers. StaticLocation.prototype.push = throwCannotModify; StaticLocation.prototype.replace = throwCannotModify; StaticLocation.prototype.pop = throwCannotModify; module.exports = StaticLocation; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); /** * A scroll behavior that attempts to imitate the default behavior * of modern browsers. */ var ImitateBrowserBehavior = { updateScrollPosition: function updateScrollPosition(position, actionType) { switch (actionType) { case LocationActions.PUSH: case LocationActions.REPLACE: window.scrollTo(0, 0); break; case LocationActions.POP: if (position) { window.scrollTo(position.x, position.y); } else { window.scrollTo(0, 0); } break; } } }; module.exports = ImitateBrowserBehavior; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * A scroll behavior that always scrolls to the top of the page * after a transition. */ var ScrollToTopBehavior = { updateScrollPosition: function updateScrollPosition() { window.scrollTo(0, 0); } }; module.exports = ScrollToTopBehavior; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var History = { /** * The current number of entries in the history. * * Note: This property is read-only. */ length: 1, /** * Sends the browser back one entry in the history. */ back: function back() { invariant(canUseDOM, "Cannot use History.back without a DOM"); // Do this first so that History.length will // be accurate in location change listeners. History.length -= 1; window.history.back(); } }; module.exports = History; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * A mixin for components that modify the URL. * * Example: * * var MyLink = React.createClass({ * mixins: [ Router.Navigation ], * handleClick: function (event) { * event.preventDefault(); * this.transitionTo('aRoute', { the: 'params' }, { the: 'query' }); * }, * render: function () { * return ( * <a onClick={this.handleClick}>Click me!</a> * ); * } * }); */ var Navigation = { contextTypes: { makePath: PropTypes.func.isRequired, makeHref: PropTypes.func.isRequired, transitionTo: PropTypes.func.isRequired, replaceWith: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired }, /** * Returns an absolute URL path created from the given route * name, URL parameters, and query values. */ makePath: function makePath(to, params, query) { return this.context.makePath(to, params, query); }, /** * Returns a string that may safely be used as the href of a * link to the route with the given name. */ makeHref: function makeHref(to, params, query) { return this.context.makeHref(to, params, query); }, /** * Transitions to the URL specified in the arguments by pushing * a new URL onto the history stack. */ transitionTo: function transitionTo(to, params, query) { this.context.transitionTo(to, params, query); }, /** * Transitions to the URL specified in the arguments by replacing * the current URL in the history stack. */ replaceWith: function replaceWith(to, params, query) { this.context.replaceWith(to, params, query); }, /** * Transitions to the previous URL. */ goBack: function goBack() { return this.context.goBack(); } }; module.exports = Navigation; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var assign = __webpack_require__(36); var PropTypes = __webpack_require__(23); var REF_NAME = "__routeHandler__"; var RouteHandlerMixin = { contextTypes: { getRouteAtDepth: PropTypes.func.isRequired, setRouteComponentAtDepth: PropTypes.func.isRequired, routeHandlers: PropTypes.array.isRequired }, childContextTypes: { routeHandlers: PropTypes.array.isRequired }, getChildContext: function getChildContext() { return { routeHandlers: this.context.routeHandlers.concat([this]) }; }, componentDidMount: function componentDidMount() { this._updateRouteComponent(this.refs[REF_NAME]); }, componentDidUpdate: function componentDidUpdate() { this._updateRouteComponent(this.refs[REF_NAME]); }, componentWillUnmount: function componentWillUnmount() { this._updateRouteComponent(null); }, _updateRouteComponent: function _updateRouteComponent(component) { this.context.setRouteComponentAtDepth(this.getRouteDepth(), component); }, getRouteDepth: function getRouteDepth() { return this.context.routeHandlers.length; }, createChildRouteHandler: function createChildRouteHandler(props) { var route = this.context.getRouteAtDepth(this.getRouteDepth()); return route ? React.createElement(route.handler, assign({}, props || this.props, { ref: REF_NAME })) : null; } }; module.exports = RouteHandlerMixin; /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * A mixin for components that need to know the path, routes, URL * params and query that are currently active. * * Example: * * var AboutLink = React.createClass({ * mixins: [ Router.State ], * render: function () { * var className = this.props.className; * * if (this.isActive('about')) * className += ' is-active'; * * return React.DOM.a({ className: className }, this.props.children); * } * }); */ var State = { contextTypes: { getCurrentPath: PropTypes.func.isRequired, getCurrentRoutes: PropTypes.func.isRequired, getCurrentPathname: PropTypes.func.isRequired, getCurrentParams: PropTypes.func.isRequired, getCurrentQuery: PropTypes.func.isRequired, isActive: PropTypes.func.isRequired }, /** * Returns the current URL path. */ getPath: function getPath() { return this.context.getCurrentPath(); }, /** * Returns an array of the routes that are currently active. */ getRoutes: function getRoutes() { return this.context.getCurrentRoutes(); }, /** * Returns the current URL path without the query string. */ getPathname: function getPathname() { return this.context.getCurrentPathname(); }, /** * Returns an object of the URL params that are currently active. */ getParams: function getParams() { return this.context.getCurrentParams(); }, /** * Returns an object of the query params that are currently active. */ getQuery: function getQuery() { return this.context.getCurrentQuery(); }, /** * A helper method to determine if a given route, params, and query * are active. */ isActive: function isActive(to, params, query) { return this.context.isActive(to, params, query); } }; module.exports = State; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var assign = __webpack_require__(36); var invariant = __webpack_require__(37); var warning = __webpack_require__(39); var PathUtils = __webpack_require__(25); var _currentRoute; var Route = (function () { function Route(name, path, ignoreScrollBehavior, isDefault, isNotFound, onEnter, onLeave, handler) { _classCallCheck(this, Route); this.name = name; this.path = path; this.paramNames = PathUtils.extractParamNames(this.path); this.ignoreScrollBehavior = !!ignoreScrollBehavior; this.isDefault = !!isDefault; this.isNotFound = !!isNotFound; this.onEnter = onEnter; this.onLeave = onLeave; this.handler = handler; } _prototypeProperties(Route, { createRoute: { /** * Creates and returns a new route. Options may be a URL pathname string * with placeholders for named params or an object with any of the following * properties: * * - name The name of the route. This is used to lookup a * route relative to its parent route and should be * unique among all child routes of the same parent * - path A URL pathname string with optional placeholders * that specify the names of params to extract from * the URL when the path matches. Defaults to `/${name}` * when there is a name given, or the path of the parent * route, or / * - ignoreScrollBehavior True to make this route (and all descendants) ignore * the scroll behavior of the router * - isDefault True to make this route the default route among all * its siblings * - isNotFound True to make this route the "not found" route among * all its siblings * - onEnter A transition hook that will be called when the * router is going to enter this route * - onLeave A transition hook that will be called when the * router is going to leave this route * - handler A React component that will be rendered when * this route is active * - parentRoute The parent route to use for this route. This option * is automatically supplied when creating routes inside * the callback to another invocation of createRoute. You * only ever need to use this when declaring routes * independently of one another to manually piece together * the route hierarchy * * The callback may be used to structure your route hierarchy. Any call to * createRoute, createDefaultRoute, createNotFoundRoute, or createRedirect * inside the callback automatically uses this route as its parent. */ value: function createRoute(options, callback) { options = options || {}; if (typeof options === "string") options = { path: options }; var parentRoute = _currentRoute; if (parentRoute) { warning(options.parentRoute == null || options.parentRoute === parentRoute, "You should not use parentRoute with createRoute inside another route's child callback; it is ignored"); } else { parentRoute = options.parentRoute; } var name = options.name; var path = options.path || name; if (path && !(options.isDefault || options.isNotFound)) { if (PathUtils.isAbsolute(path)) { if (parentRoute) { invariant(parentRoute.paramNames.length === 0, "You cannot nest path \"%s\" inside \"%s\"; the parent requires URL parameters", path, parentRoute.path); } } else if (parentRoute) { // Relative paths extend their parent. path = PathUtils.join(parentRoute.path, path); } else { path = "/" + path; } } else { path = parentRoute ? parentRoute.path : "/"; } if (options.isNotFound && !/\*$/.test(path)) path += "*"; // Auto-append * to the path of not found routes. var route = new Route(name, path, options.ignoreScrollBehavior, options.isDefault, options.isNotFound, options.onEnter, options.onLeave, options.handler); if (parentRoute) { if (route.isDefault) { invariant(parentRoute.defaultRoute == null, "%s may not have more than one default route", parentRoute); parentRoute.defaultRoute = route; } else if (route.isNotFound) { invariant(parentRoute.notFoundRoute == null, "%s may not have more than one not found route", parentRoute); parentRoute.notFoundRoute = route; } parentRoute.appendChild(route); } // Any routes created in the callback // use this route as their parent. if (typeof callback === "function") { var currentRoute = _currentRoute; _currentRoute = route; callback.call(route, route); _currentRoute = currentRoute; } return route; }, writable: true, configurable: true }, createDefaultRoute: { /** * Creates and returns a route that is rendered when its parent matches * the current URL. */ value: function createDefaultRoute(options) { return Route.createRoute(assign({}, options, { isDefault: true })); }, writable: true, configurable: true }, createNotFoundRoute: { /** * Creates and returns a route that is rendered when its parent matches * the current URL but none of its siblings do. */ value: function createNotFoundRoute(options) { return Route.createRoute(assign({}, options, { isNotFound: true })); }, writable: true, configurable: true }, createRedirect: { /** * Creates and returns a route that automatically redirects the transition * to another route. In addition to the normal options to createRoute, this * function accepts the following options: * * - from An alias for the `path` option. Defaults to * * - to The path/route/route name to redirect to * - params The params to use in the redirect URL. Defaults * to using the current params * - query The query to use in the redirect URL. Defaults * to using the current query */ value: function createRedirect(options) { return Route.createRoute(assign({}, options, { path: options.path || options.from || "*", onEnter: function onEnter(transition, params, query) { transition.redirect(options.to, options.params || params, options.query || query); } })); }, writable: true, configurable: true } }, { appendChild: { /** * Appends the given route to this route's child routes. */ value: function appendChild(route) { invariant(route instanceof Route, "route.appendChild must use a valid Route"); if (!this.childRoutes) this.childRoutes = []; this.childRoutes.push(route); }, writable: true, configurable: true }, toString: { value: function toString() { var string = "<Route"; if (this.name) string += " name=\"" + this.name + "\""; string += " path=\"" + this.path + "\">"; return string; }, writable: true, configurable: true } }); return Route; })(); module.exports = Route; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W084 */ var React = __webpack_require__(21); var assign = __webpack_require__(36); var warning = __webpack_require__(39); var DefaultRouteType = __webpack_require__(1).type; var NotFoundRouteType = __webpack_require__(3).type; var RedirectType = __webpack_require__(4).type; var Route = __webpack_require__(17); function checkPropTypes(componentName, propTypes, props) { componentName = componentName || "UnknownComponent"; for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error = propTypes[propName](props, propName, componentName); if (error instanceof Error) warning(false, error.message); } } } function createRouteOptions(props) { var options = assign({}, props); var handler = options.handler; if (handler) { options.onEnter = handler.willTransitionTo; options.onLeave = handler.willTransitionFrom; } return options; } function createRouteFromReactElement(element) { if (!React.isValidElement(element)) { return; }var type = element.type; var props = element.props; if (type.propTypes) checkPropTypes(type.displayName, type.propTypes, props); if (type === DefaultRouteType) { return Route.createDefaultRoute(createRouteOptions(props)); }if (type === NotFoundRouteType) { return Route.createNotFoundRoute(createRouteOptions(props)); }if (type === RedirectType) { return Route.createRedirect(createRouteOptions(props)); }return Route.createRoute(createRouteOptions(props), function () { if (props.children) createRoutesFromReactChildren(props.children); }); } /** * Creates and returns an array of routes created from the given * ReactChildren, all of which should be one of <Route>, <DefaultRoute>, * <NotFoundRoute>, or <Redirect>, e.g.: * * var { createRoutesFromReactChildren, Route, Redirect } = require('react-router'); * * var routes = createRoutesFromReactChildren( * <Route path="/" handler={App}> * <Route name="user" path="/user/:userId" handler={User}> * <Route name="task" path="tasks/:taskId" handler={Task}/> * <Redirect from="todos/:taskId" to="task"/> * </Route> * </Route> * ); */ function createRoutesFromReactChildren(children) { var routes = []; React.Children.forEach(children, function (child) { if (child = createRouteFromReactElement(child)) routes.push(child); }); return routes; } module.exports = createRoutesFromReactChildren; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W058 */ var React = __webpack_require__(21); var warning = __webpack_require__(39); var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var LocationActions = __webpack_require__(24); var ImitateBrowserBehavior = __webpack_require__(11); var HashLocation = __webpack_require__(7); var HistoryLocation = __webpack_require__(8); var RefreshLocation = __webpack_require__(9); var StaticLocation = __webpack_require__(10); var NavigationContext = __webpack_require__(26); var ScrollHistory = __webpack_require__(27); var StateContext = __webpack_require__(28); var createRoutesFromReactChildren = __webpack_require__(18); var isReactChildren = __webpack_require__(29); var Transition = __webpack_require__(30); var PropTypes = __webpack_require__(23); var Redirect = __webpack_require__(31); var History = __webpack_require__(13); var Cancellation = __webpack_require__(32); var Match = __webpack_require__(33); var Route = __webpack_require__(17); var supportsHistory = __webpack_require__(34); var PathUtils = __webpack_require__(25); /** * The default location for new routers. */ var DEFAULT_LOCATION = canUseDOM ? HashLocation : "/"; /** * The default scroll behavior for new routers. */ var DEFAULT_SCROLL_BEHAVIOR = canUseDOM ? ImitateBrowserBehavior : null; function hasProperties(object, properties) { for (var propertyName in properties) if (properties.hasOwnProperty(propertyName) && object[propertyName] !== properties[propertyName]) { return false; }return true; } function hasMatch(routes, route, prevParams, nextParams, prevQuery, nextQuery) { return routes.some(function (r) { if (r !== route) return false; var paramNames = route.paramNames; var paramName; // Ensure that all params the route cares about did not change. for (var i = 0, len = paramNames.length; i < len; ++i) { paramName = paramNames[i]; if (nextParams[paramName] !== prevParams[paramName]) return false; } // Ensure the query hasn't changed. return hasProperties(prevQuery, nextQuery) && hasProperties(nextQuery, prevQuery); }); } function addRoutesToNamedRoutes(routes, namedRoutes) { var route; for (var i = 0, len = routes.length; i < len; ++i) { route = routes[i]; if (route.name) { invariant(namedRoutes[route.name] == null, "You may not have more than one route named \"%s\"", route.name); namedRoutes[route.name] = route; } if (route.childRoutes) addRoutesToNamedRoutes(route.childRoutes, namedRoutes); } } /** * Creates and returns a new router using the given options. A router * is a ReactComponent class that knows how to react to changes in the * URL and keep the contents of the page in sync. * * Options may be any of the following: * * - routes (required) The route config * - location The location to use. Defaults to HashLocation when * the DOM is available, "/" otherwise * - scrollBehavior The scroll behavior to use. Defaults to ImitateBrowserBehavior * when the DOM is available, null otherwise * - onError A function that is used to handle errors * - onAbort A function that is used to handle aborted transitions * * When rendering in a server-side environment, the location should simply * be the URL path that was used in the request, including the query string. */ function createRouter(options) { options = options || {}; if (isReactChildren(options)) options = { routes: options }; var mountedComponents = []; var location = options.location || DEFAULT_LOCATION; var scrollBehavior = options.scrollBehavior || DEFAULT_SCROLL_BEHAVIOR; var state = {}; var nextState = {}; var pendingTransition = null; var dispatchHandler = null; if (typeof location === "string") location = new StaticLocation(location); if (location instanceof StaticLocation) { warning(!canUseDOM || ("production") === "test", "You should not use a static location in a DOM environment because " + "the router will not be kept in sync with the current URL"); } else { invariant(canUseDOM || location.needsDOM === false, "You cannot use %s without a DOM", location); } // Automatically fall back to full page refreshes in // browsers that don't support the HTML history API. if (location === HistoryLocation && !supportsHistory()) location = RefreshLocation; var Router = React.createClass({ displayName: "Router", statics: { isRunning: false, cancelPendingTransition: function cancelPendingTransition() { if (pendingTransition) { pendingTransition.cancel(); pendingTransition = null; } }, clearAllRoutes: function clearAllRoutes() { this.cancelPendingTransition(); this.namedRoutes = {}; this.routes = []; }, /** * Adds routes to this router from the given children object (see ReactChildren). */ addRoutes: function addRoutes(routes) { if (isReactChildren(routes)) routes = createRoutesFromReactChildren(routes); addRoutesToNamedRoutes(routes, this.namedRoutes); this.routes.push.apply(this.routes, routes); }, /** * Replaces routes of this router from the given children object (see ReactChildren). */ replaceRoutes: function replaceRoutes(routes) { this.clearAllRoutes(); this.addRoutes(routes); this.refresh(); }, /** * Performs a match of the given path against this router and returns an object * with the { routes, params, pathname, query } that match. Returns null if no * match can be made. */ match: function match(path) { return Match.findMatchForPath(this.routes, path); }, /** * Returns an absolute URL path created from the given route * name, URL parameters, and query. */ makePath: function makePath(to, params, query) { var path; if (PathUtils.isAbsolute(to)) { path = to; } else { var route = to instanceof Route ? to : this.namedRoutes[to]; invariant(route instanceof Route, "Cannot find a route named \"%s\"", to); path = route.path; } return PathUtils.withQuery(PathUtils.injectParams(path, params), query); }, /** * Returns a string that may safely be used as the href of a link * to the route with the given name, URL parameters, and query. */ makeHref: function makeHref(to, params, query) { var path = this.makePath(to, params, query); return location === HashLocation ? "#" + path : path; }, /** * Transitions to the URL specified in the arguments by pushing * a new URL onto the history stack. */ transitionTo: function transitionTo(to, params, query) { var path = this.makePath(to, params, query); if (pendingTransition) { // Replace so pending location does not stay in history. location.replace(path); } else { location.push(path); } }, /** * Transitions to the URL specified in the arguments by replacing * the current URL in the history stack. */ replaceWith: function replaceWith(to, params, query) { location.replace(this.makePath(to, params, query)); }, /** * Transitions to the previous URL if one is available. Returns true if the * router was able to go back, false otherwise. * * Note: The router only tracks history entries in your application, not the * current browser session, so you can safely call this function without guarding * against sending the user back to some other site. However, when using * RefreshLocation (which is the fallback for HistoryLocation in browsers that * don't support HTML5 history) this method will *always* send the client back * because we cannot reliably track history length. */ goBack: function goBack() { if (History.length > 1 || location === RefreshLocation) { location.pop(); return true; } warning(false, "goBack() was ignored because there is no router history"); return false; }, handleAbort: options.onAbort || function (abortReason) { if (location instanceof StaticLocation) throw new Error("Unhandled aborted transition! Reason: " + abortReason); if (abortReason instanceof Cancellation) { return; } else if (abortReason instanceof Redirect) { location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query)); } else { location.pop(); } }, handleError: options.onError || function (error) { // Throw so we don't silently swallow async errors. throw error; // This error probably originated in a transition hook. }, handleLocationChange: function handleLocationChange(change) { this.dispatch(change.path, change.type); }, /** * Performs a transition to the given path and calls callback(error, abortReason) * when the transition is finished. If both arguments are null the router's state * was updated. Otherwise the transition did not complete. * * In a transition, a router first determines which routes are involved by beginning * with the current route, up the route tree to the first parent route that is shared * with the destination route, and back down the tree to the destination route. The * willTransitionFrom hook is invoked on all route handlers we're transitioning away * from, in reverse nesting order. Likewise, the willTransitionTo hook is invoked on * all route handlers we're transitioning to. * * Both willTransitionFrom and willTransitionTo hooks may either abort or redirect the * transition. To resolve asynchronously, they may use the callback argument. If no * hooks wait, the transition is fully synchronous. */ dispatch: function dispatch(path, action) { this.cancelPendingTransition(); var prevPath = state.path; var isRefreshing = action == null; if (prevPath === path && !isRefreshing) { return; } // Nothing to do! // Record the scroll position as early as possible to // get it before browsers try update it automatically. if (prevPath && action === LocationActions.PUSH) this.recordScrollPosition(prevPath); var match = this.match(path); warning(match != null, "No route matches path \"%s\". Make sure you have <Route path=\"%s\"> somewhere in your routes", path, path); if (match == null) match = {}; var prevRoutes = state.routes || []; var prevParams = state.params || {}; var prevQuery = state.query || {}; var nextRoutes = match.routes || []; var nextParams = match.params || {}; var nextQuery = match.query || {}; var fromRoutes, toRoutes; if (prevRoutes.length) { fromRoutes = prevRoutes.filter(function (route) { return !hasMatch(nextRoutes, route, prevParams, nextParams, prevQuery, nextQuery); }); toRoutes = nextRoutes.filter(function (route) { return !hasMatch(prevRoutes, route, prevParams, nextParams, prevQuery, nextQuery); }); } else { fromRoutes = []; toRoutes = nextRoutes; } var transition = new Transition(path, this.replaceWith.bind(this, path)); pendingTransition = transition; var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length); Transition.from(transition, fromRoutes, fromComponents, function (error) { if (error || transition.abortReason) return dispatchHandler.call(Router, error, transition); // No need to continue. Transition.to(transition, toRoutes, nextParams, nextQuery, function (error) { dispatchHandler.call(Router, error, transition, { path: path, action: action, pathname: match.pathname, routes: nextRoutes, params: nextParams, query: nextQuery }); }); }); }, /** * Starts this router and calls callback(router, state) when the route changes. * * If the router's location is static (i.e. a URL path in a server environment) * the callback is called only once. Otherwise, the location should be one of the * Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation). */ run: function run(callback) { invariant(!this.isRunning, "Router is already running"); dispatchHandler = function (error, transition, newState) { if (error) Router.handleError(error); if (pendingTransition !== transition) return; pendingTransition = null; if (transition.abortReason) { Router.handleAbort(transition.abortReason); } else { callback.call(this, this, nextState = newState); } }; if (!(location instanceof StaticLocation)) { if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange); this.isRunning = true; } // Bootstrap using the current path. this.refresh(); }, refresh: function refresh() { Router.dispatch(location.getCurrentPath(), null); }, stop: function stop() { this.cancelPendingTransition(); if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange); this.isRunning = false; }, getScrollBehavior: function getScrollBehavior() { return scrollBehavior; } }, mixins: [NavigationContext, StateContext, ScrollHistory], propTypes: { children: PropTypes.falsy }, childContextTypes: { getRouteAtDepth: React.PropTypes.func.isRequired, setRouteComponentAtDepth: React.PropTypes.func.isRequired, routeHandlers: React.PropTypes.array.isRequired }, getChildContext: function getChildContext() { return { getRouteAtDepth: this.getRouteAtDepth, setRouteComponentAtDepth: this.setRouteComponentAtDepth, routeHandlers: [this] }; }, getInitialState: function getInitialState() { return state = nextState; }, componentWillReceiveProps: function componentWillReceiveProps() { this.setState(state = nextState); }, componentWillUnmount: function componentWillUnmount() { Router.stop(); }, getLocation: function getLocation() { return location; }, getRouteAtDepth: function getRouteAtDepth(depth) { var routes = this.state.routes; return routes && routes[depth]; }, setRouteComponentAtDepth: function setRouteComponentAtDepth(depth, component) { mountedComponents[depth] = component; }, render: function render() { var route = this.getRouteAtDepth(0); return route ? React.createElement(route.handler, this.props) : null; } }); Router.clearAllRoutes(); if (options.routes) Router.addRoutes(options.routes); return Router; } module.exports = createRouter; /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var createRouter = __webpack_require__(19); /** * A high-level convenience method that creates, configures, and * runs a router in one shot. The method signature is: * * Router.run(routes[, location ], callback); * * Using `window.location.hash` to manage the URL, you could do: * * Router.run(routes, function (Handler) { * React.render(<Handler/>, document.body); * }); * * Using HTML5 history and a custom "cursor" prop: * * Router.run(routes, Router.HistoryLocation, function (Handler) { * React.render(<Handler cursor={cursor}/>, document.body); * }); * * Returns the newly created router. * * Note: If you need to specify further options for your router such * as error/abort handling or custom scroll behavior, use Router.create * instead. * * var router = Router.create(options); * router.run(function (Handler) { * // ... * }); */ function runRouter(routes, location, callback) { if (typeof location === "function") { callback = location; location = null; } var router = createRouter({ routes: routes, location: location }); router.run(callback); return router; } module.exports = runRouter; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { module.exports = __WEBPACK_EXTERNAL_MODULE_21__; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var warning = __webpack_require__(39); var invariant = __webpack_require__(37); function checkPropTypes(componentName, propTypes, props) { for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error = propTypes[propName](props, propName, componentName); if (error instanceof Error) warning(false, error.message); } } } var Configuration = { statics: { validateProps: function validateProps(props) { checkPropTypes(this.displayName, this.propTypes, props); } }, render: function render() { invariant(false, "%s elements are for router configuration only and should not be rendered", this.constructor.displayName); } }; module.exports = Configuration; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var assign = __webpack_require__(36); var ReactPropTypes = __webpack_require__(21).PropTypes; var PropTypes = assign({ /** * Requires that the value of a prop be falsy. */ falsy: function falsy(props, propName, componentName) { if (props[propName]) { return new Error("<" + componentName + "> may not have a \"" + propName + "\" prop"); } } }, ReactPropTypes); module.exports = PropTypes; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Actions that modify the URL. */ var LocationActions = { /** * Indicates a new location is being pushed to the history stack. */ PUSH: "push", /** * Indicates the current location should be replaced. */ REPLACE: "replace", /** * Indicates the most recent entry should be removed from the history stack. */ POP: "pop" }; module.exports = LocationActions; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var merge = __webpack_require__(42).merge; var qs = __webpack_require__(41); var paramCompileMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g; var paramInjectMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g; var paramInjectTrailingSlashMatcher = /\/\/\?|\/\?\/|\/\?/g; var queryMatcher = /\?(.+)/; var _compiledPatterns = {}; function compilePattern(pattern) { if (!(pattern in _compiledPatterns)) { var paramNames = []; var source = pattern.replace(paramCompileMatcher, function (match, paramName) { if (paramName) { paramNames.push(paramName); return "([^/?#]+)"; } else if (match === "*") { paramNames.push("splat"); return "(.*?)"; } else { return "\\" + match; } }); _compiledPatterns[pattern] = { matcher: new RegExp("^" + source + "$", "i"), paramNames: paramNames }; } return _compiledPatterns[pattern]; } var PathUtils = { /** * Returns true if the given path is absolute. */ isAbsolute: function isAbsolute(path) { return path.charAt(0) === "/"; }, /** * Joins two URL paths together. */ join: function join(a, b) { return a.replace(/\/*$/, "/") + b; }, /** * Returns an array of the names of all parameters in the given pattern. */ extractParamNames: function extractParamNames(pattern) { return compilePattern(pattern).paramNames; }, /** * Extracts the portions of the given URL path that match the given pattern * and returns an object of param name => value pairs. Returns null if the * pattern does not match the given path. */ extractParams: function extractParams(pattern, path) { var _compilePattern = compilePattern(pattern); var matcher = _compilePattern.matcher; var paramNames = _compilePattern.paramNames; var match = path.match(matcher); if (!match) { return null; }var params = {}; paramNames.forEach(function (paramName, index) { params[paramName] = match[index + 1]; }); return params; }, /** * Returns a version of the given route path with params interpolated. Throws * if there is a dynamic segment of the route path for which there is no param. */ injectParams: function injectParams(pattern, params) { params = params || {}; var splatIndex = 0; return pattern.replace(paramInjectMatcher, function (match, paramName) { paramName = paramName || "splat"; // If param is optional don't check for existence if (paramName.slice(-1) === "?") { paramName = paramName.slice(0, -1); if (params[paramName] == null) return ""; } else { invariant(params[paramName] != null, "Missing \"%s\" parameter for path \"%s\"", paramName, pattern); } var segment; if (paramName === "splat" && Array.isArray(params[paramName])) { segment = params[paramName][splatIndex++]; invariant(segment != null, "Missing splat # %s for path \"%s\"", splatIndex, pattern); } else { segment = params[paramName]; } return segment; }).replace(paramInjectTrailingSlashMatcher, "/"); }, /** * Returns an object that is the result of parsing any query string contained * in the given path, null if the path contains no query string. */ extractQuery: function extractQuery(path) { var match = path.match(queryMatcher); return match && qs.parse(match[1]); }, /** * Returns a version of the given path without the query string. */ withoutQuery: function withoutQuery(path) { return path.replace(queryMatcher, ""); }, /** * Returns a version of the given path with the parameters in the given * query merged into the query string. */ withQuery: function withQuery(path, query) { var existingQuery = PathUtils.extractQuery(path); if (existingQuery) query = query ? merge(existingQuery, query) : existingQuery; var queryString = qs.stringify(query, { indices: false }); if (queryString) { return PathUtils.withoutQuery(path) + "?" + queryString; }return path; } }; module.exports = PathUtils; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * Provides the router with context for Router.Navigation. */ var NavigationContext = { childContextTypes: { makePath: PropTypes.func.isRequired, makeHref: PropTypes.func.isRequired, transitionTo: PropTypes.func.isRequired, replaceWith: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired }, getChildContext: function getChildContext() { return { makePath: this.constructor.makePath.bind(this.constructor), makeHref: this.constructor.makeHref.bind(this.constructor), transitionTo: this.constructor.transitionTo.bind(this.constructor), replaceWith: this.constructor.replaceWith.bind(this.constructor), goBack: this.constructor.goBack.bind(this.constructor) }; } }; module.exports = NavigationContext; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var getWindowScrollPosition = __webpack_require__(40); function shouldUpdateScroll(state, prevState) { if (!prevState) { return true; } // Don't update scroll position when only the query has changed. if (state.pathname === prevState.pathname) { return false; }var routes = state.routes; var prevRoutes = prevState.routes; var sharedAncestorRoutes = routes.filter(function (route) { return prevRoutes.indexOf(route) !== -1; }); return !sharedAncestorRoutes.some(function (route) { return route.ignoreScrollBehavior; }); } /** * Provides the router with the ability to manage window scroll position * according to its scroll behavior. */ var ScrollHistory = { statics: { /** * Records curent scroll position as the last known position for the given URL path. */ recordScrollPosition: function recordScrollPosition(path) { if (!this.scrollHistory) this.scrollHistory = {}; this.scrollHistory[path] = getWindowScrollPosition(); }, /** * Returns the last known scroll position for the given URL path. */ getScrollPosition: function getScrollPosition(path) { if (!this.scrollHistory) this.scrollHistory = {}; return this.scrollHistory[path] || null; } }, componentWillMount: function componentWillMount() { invariant(this.constructor.getScrollBehavior() == null || canUseDOM, "Cannot use scroll behavior without a DOM"); }, componentDidMount: function componentDidMount() { this._updateScroll(); }, componentDidUpdate: function componentDidUpdate(prevProps, prevState) { this._updateScroll(prevState); }, _updateScroll: function _updateScroll(prevState) { if (!shouldUpdateScroll(this.state, prevState)) { return; }var scrollBehavior = this.constructor.getScrollBehavior(); if (scrollBehavior) scrollBehavior.updateScrollPosition(this.constructor.getScrollPosition(this.state.path), this.state.action); } }; module.exports = ScrollHistory; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var assign = __webpack_require__(36); var PropTypes = __webpack_require__(23); var PathUtils = __webpack_require__(25); function routeIsActive(activeRoutes, routeName) { return activeRoutes.some(function (route) { return route.name === routeName; }); } function paramsAreActive(activeParams, params) { for (var property in params) if (String(activeParams[property]) !== String(params[property])) { return false; }return true; } function queryIsActive(activeQuery, query) { for (var property in query) if (String(activeQuery[property]) !== String(query[property])) { return false; }return true; } /** * Provides the router with context for Router.State. */ var StateContext = { /** * Returns the current URL path + query string. */ getCurrentPath: function getCurrentPath() { return this.state.path; }, /** * Returns a read-only array of the currently active routes. */ getCurrentRoutes: function getCurrentRoutes() { return this.state.routes.slice(0); }, /** * Returns the current URL path without the query string. */ getCurrentPathname: function getCurrentPathname() { return this.state.pathname; }, /** * Returns a read-only object of the currently active URL parameters. */ getCurrentParams: function getCurrentParams() { return assign({}, this.state.params); }, /** * Returns a read-only object of the currently active query parameters. */ getCurrentQuery: function getCurrentQuery() { return assign({}, this.state.query); }, /** * Returns true if the given route, params, and query are active. */ isActive: function isActive(to, params, query) { if (PathUtils.isAbsolute(to)) { return to === this.state.path; }return routeIsActive(this.state.routes, to) && paramsAreActive(this.state.params, params) && (query == null || queryIsActive(this.state.query, query)); }, childContextTypes: { getCurrentPath: PropTypes.func.isRequired, getCurrentRoutes: PropTypes.func.isRequired, getCurrentPathname: PropTypes.func.isRequired, getCurrentParams: PropTypes.func.isRequired, getCurrentQuery: PropTypes.func.isRequired, isActive: PropTypes.func.isRequired }, getChildContext: function getChildContext() { return { getCurrentPath: this.getCurrentPath, getCurrentRoutes: this.getCurrentRoutes, getCurrentPathname: this.getCurrentPathname, getCurrentParams: this.getCurrentParams, getCurrentQuery: this.getCurrentQuery, isActive: this.isActive }; } }; module.exports = StateContext; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); function isValidChild(object) { return object == null || React.isValidElement(object); } function isReactChildren(object) { return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); } module.exports = isReactChildren; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W058 */ var Cancellation = __webpack_require__(32); var Redirect = __webpack_require__(31); /** * Encapsulates a transition to a given path. * * The willTransitionTo and willTransitionFrom handlers receive * an instance of this class as their first argument. */ function Transition(path, retry) { this.path = path; this.abortReason = null; // TODO: Change this to router.retryTransition(transition) this.retry = retry.bind(this); } Transition.prototype.abort = function (reason) { if (this.abortReason == null) this.abortReason = reason || "ABORT"; }; Transition.prototype.redirect = function (to, params, query) { this.abort(new Redirect(to, params, query)); }; Transition.prototype.cancel = function () { this.abort(new Cancellation()); }; Transition.from = function (transition, routes, components, callback) { routes.reduce(function (callback, route, index) { return function (error) { if (error || transition.abortReason) { callback(error); } else if (route.onLeave) { try { route.onLeave(transition, components[index], callback); // If there is no callback in the argument list, call it automatically. if (route.onLeave.length < 3) callback(); } catch (e) { callback(e); } } else { callback(); } }; }, callback)(); }; Transition.to = function (transition, routes, params, query, callback) { routes.reduceRight(function (callback, route) { return function (error) { if (error || transition.abortReason) { callback(error); } else if (route.onEnter) { try { route.onEnter(transition, params, query, callback); // If there is no callback in the argument list, call it automatically. if (route.onEnter.length < 4) callback(); } catch (e) { callback(e); } } else { callback(); } }; }, callback)(); }; module.exports = Transition; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Encapsulates a redirect to the given route. */ function Redirect(to, params, query) { this.to = to; this.params = params; this.query = query; } module.exports = Redirect; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Represents a cancellation caused by navigating away * before the previous transition has fully resolved. */ function Cancellation() {} module.exports = Cancellation; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; /* jshint -W084 */ var PathUtils = __webpack_require__(25); var Match = function Match(pathname, params, query, routes) { _classCallCheck(this, Match); this.pathname = pathname; this.params = params; this.query = query; this.routes = routes; }; function deepSearch(route, pathname, query) { // Check the subtree first to find the most deeply-nested match. var childRoutes = route.childRoutes; if (childRoutes) { var match, childRoute; for (var i = 0, len = childRoutes.length; i < len; ++i) { childRoute = childRoutes[i]; if (childRoute.isDefault || childRoute.isNotFound) continue; // Check these in order later. if (match = deepSearch(childRoute, pathname, query)) { // A route in the subtree matched! Add this route and we're done. match.routes.unshift(route); return match; } } } // No child routes matched; try the default route. var defaultRoute = route.defaultRoute; if (defaultRoute && (params = PathUtils.extractParams(defaultRoute.path, pathname))) { return new Match(pathname, params, query, [route, defaultRoute]); } // Does the "not found" route match? var notFoundRoute = route.notFoundRoute; if (notFoundRoute && (params = PathUtils.extractParams(notFoundRoute.path, pathname))) { return new Match(pathname, params, query, [route, notFoundRoute]); } // Last attempt: check this route. var params = PathUtils.extractParams(route.path, pathname); if (params) { return new Match(pathname, params, query, [route]); }return null; } /** * Attempts to match depth-first a route in the given route's * subtree against the given path and returns the match if it * succeeds, null if no match can be made. */ Match.findMatchForPath = function (routes, path) { var pathname = PathUtils.withoutQuery(path); var query = PathUtils.extractQuery(path); var match = null; for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query); return match; }; module.exports = Match; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function supportsHistory() { /*! taken from modernizr * https://github.com/Modernizr/Modernizr/blob/master/LICENSE * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 */ var ua = navigator.userAgent; if ((ua.indexOf("Android 2.") !== -1 || ua.indexOf("Android 4.0") !== -1) && ua.indexOf("Mobile Safari") !== -1 && ua.indexOf("Chrome") === -1 && ua.indexOf("Windows Phone") === -1) { return false; } return window.history && "pushState" in window.history; } module.exports = supportsHistory; /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule cx */ /** * This function is used to mark string literals representing CSS class names * so that they can be transformed statically. This allows for modularization * and minification of CSS class names. * * In static_upstream, this function is actually implemented, but it should * eventually be replaced with something more descriptive, and the transform * that is used in the main stack should be ported for use elsewhere. * * @param string|object className to modularize, or an object of key/values. * In the object case, the values are conditions that * determine if the className keys should be included. * @param [string ...] Variable list of classNames in the string case. * @return string Renderable space-separated CSS className. */ function cx(classNames) { if (typeof classNames == "object") { return Object.keys(classNames).filter(function (className) { return classNames[className]; }).join(" "); } else { return Array.prototype.join.call(arguments, " "); } } module.exports = cx; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Object.assign */ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign function assign(target, sources) { if (target == null) { throw new TypeError("Object.assign target cannot be null or undefined"); } var to = Object(target); var hasOwnProperty = Object.prototype.hasOwnProperty; for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { var nextSource = arguments[nextIndex]; if (nextSource == null) { continue; } var from = Object(nextSource); // We don't currently support accessors nor proxies. Therefore this // copy cannot throw. If we ever supported this then we must handle // exceptions and side-effects. We don't support symbols so they won't // be transferred. for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } } return to; }; module.exports = assign; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var invariant = function invariant(condition, format, a, b, c, d, e, f) { if (false) { if (format === undefined) { throw new Error("invariant requires an error message argument"); } } if (!condition) { var error; if (format === undefined) { error = new Error("Minified exception occurred; use the non-minified dev environment " + "for the full error message and additional helpful warnings."); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error("Invariant Violation: " + format.replace(/%s/g, function () { return args[argIndex++]; })); } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule invariant */ /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== "undefined", canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ExecutionEnvironment */ /*jslint evil: true */ /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(43); /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction; if (false) { warning = function (condition, format) { for (var args = [], $__0 = 2, $__1 = arguments.length; $__0 < $__1; $__0++) args.push(arguments[$__0]); if (format === undefined) { throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); } if (!condition) { var argIndex = 0; console.warn("Warning: " + format.replace(/%s/g, function () { return args[argIndex++]; })); } }; } module.exports = warning; /** * Copyright 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule warning */ /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; /** * Returns the current scroll position of the window as { x, y }. */ function getWindowScrollPosition() { invariant(canUseDOM, "Cannot get current scroll position without a DOM"); return { x: window.pageXOffset || document.documentElement.scrollLeft, y: window.pageYOffset || document.documentElement.scrollTop }; } module.exports = getWindowScrollPosition; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(44); /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules // Declare internals var internals = {}; exports.arrayToObject = function (source) { var obj = {}; for (var i = 0, il = source.length; i < il; ++i) { if (typeof source[i] !== "undefined") { obj[i] = source[i]; } } return obj; }; exports.merge = function (target, source) { if (!source) { return target; } if (typeof source !== "object") { if (Array.isArray(target)) { target.push(source); } else { target[source] = true; } return target; } if (typeof target !== "object") { target = [target].concat(source); return target; } if (Array.isArray(target) && !Array.isArray(source)) { target = exports.arrayToObject(target); } var keys = Object.keys(source); for (var k = 0, kl = keys.length; k < kl; ++k) { var key = keys[k]; var value = source[key]; if (!target[key]) { target[key] = value; } else { target[key] = exports.merge(target[key], value); } } return target; }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, " ")); } catch (e) { return str; } }; exports.compact = function (obj, refs) { if (typeof obj !== "object" || obj === null) { return obj; } refs = refs || []; var lookup = refs.indexOf(obj); if (lookup !== -1) { return refs[lookup]; } refs.push(obj); if (Array.isArray(obj)) { var compacted = []; for (var i = 0, il = obj.length; i < il; ++i) { if (typeof obj[i] !== "undefined") { compacted.push(obj[i]); } } return compacted; } var keys = Object.keys(obj); for (i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; obj[key] = exports.compact(obj[key], refs); } return obj; }; exports.isRegExp = function (obj) { return Object.prototype.toString.call(obj) === "[object RegExp]"; }; exports.isBuffer = function (obj) { if (obj === null || typeof obj === "undefined") { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule emptyFunction */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ function emptyFunction() {} emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Stringify = __webpack_require__(45); var Parse = __webpack_require__(46); // Declare internals var internals = {}; module.exports = { stringify: Stringify, parse: Parse }; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Utils = __webpack_require__(42); // Declare internals var internals = { delimiter: "&", indices: true }; internals.stringify = function (obj, prefix, options) { if (Utils.isBuffer(obj)) { obj = obj.toString(); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { obj = ""; } if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean") { return [encodeURIComponent(prefix) + "=" + encodeURIComponent(obj)]; } var values = []; if (typeof obj === "undefined") { return values; } var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; if (!options.indices && Array.isArray(obj)) { values = values.concat(internals.stringify(obj[key], prefix, options)); } else { values = values.concat(internals.stringify(obj[key], prefix + "[" + key + "]", options)); } } return values; }; module.exports = function (obj, options) { options = options || {}; var delimiter = typeof options.delimiter === "undefined" ? internals.delimiter : options.delimiter; options.indices = typeof options.indices === "boolean" ? options.indices : internals.indices; var keys = []; if (typeof obj !== "object" || obj === null) { return ""; } var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; keys = keys.concat(internals.stringify(obj[key], key, options)); } return keys.join(delimiter); }; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Utils = __webpack_require__(42); // Declare internals var internals = { delimiter: "&", depth: 5, arrayLimit: 20, parameterLimit: 1000 }; internals.parseValues = function (str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); for (var i = 0, il = parts.length; i < il; ++i) { var part = parts[i]; var pos = part.indexOf("]=") === -1 ? part.indexOf("=") : part.indexOf("]=") + 1; if (pos === -1) { obj[Utils.decode(part)] = ""; } else { var key = Utils.decode(part.slice(0, pos)); var val = Utils.decode(part.slice(pos + 1)); if (!obj.hasOwnProperty(key)) { obj[key] = val; } else { obj[key] = [].concat(obj[key]).concat(val); } } } return obj; }; internals.parseObject = function (chain, val, options) { if (!chain.length) { return val; } var root = chain.shift(); var obj = {}; if (root === "[]") { obj = []; obj = obj.concat(internals.parseObject(chain, val, options)); } else { var cleanRoot = root[0] === "[" && root[root.length - 1] === "]" ? root.slice(1, root.length - 1) : root; var index = parseInt(cleanRoot, 10); var indexString = "" + index; if (!isNaN(index) && root !== cleanRoot && indexString === cleanRoot && index >= 0 && index <= options.arrayLimit) { obj = []; obj[index] = internals.parseObject(chain, val, options); } else { obj[cleanRoot] = internals.parseObject(chain, val, options); } } return obj; }; internals.parseKeys = function (key, val, options) { if (!key) { return; } // The regex chunks var parent = /^([^\[\]]*)/; var child = /(\[[^\[\]]*\])/g; // Get the parent var segment = parent.exec(key); // Don't allow them to overwrite object prototype properties if (Object.prototype.hasOwnProperty(segment[1])) { return; } // Stash the parent if it exists var keys = []; if (segment[1]) { keys.push(segment[1]); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { ++i; if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ""))) { keys.push(segment[1]); } } // If there's a remainder, just add whatever is left if (segment) { keys.push("[" + key.slice(segment.index) + "]"); } return internals.parseObject(keys, val, options); }; module.exports = function (str, options) { if (str === "" || str === null || typeof str === "undefined") { return {}; } options = options || {}; options.delimiter = typeof options.delimiter === "string" || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; options.depth = typeof options.depth === "number" ? options.depth : internals.depth; options.arrayLimit = typeof options.arrayLimit === "number" ? options.arrayLimit : internals.arrayLimit; options.parameterLimit = typeof options.parameterLimit === "number" ? options.parameterLimit : internals.parameterLimit; var tempObj = typeof str === "string" ? internals.parseValues(str, options) : str; var obj = {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; var newObj = internals.parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj); } return Utils.compact(obj); }; /***/ } /******/ ]) });
app/components/AddUser/FranchiseSelect/index.js
prudhvisays/newsb
import React from 'react'; import Select, { Option } from 'rc-select'; import 'rc-select/assets/index.css'; function onDeselect() { console.log(arguments); } export default class FranchiseSelect extends React.Component { //eslint-disable-line constructor(props) { super(props); this.state = { useAnim: 0, value: [], } this.onChange = this.onChange.bind(this); this.useAnim = this.useAnim.bind(this); this.emitChanges = this.emitChanges.bind(this); this.onSelect = this.onSelect.bind(this); } componentDidMount() { this.props.getFranchise(); } onSelect(arg) { console.log(arguments); } onChange(value) { const { userInfo } = this.props; this.emitChanges({ ...userInfo, franchise: value }); } emitChanges(data) { this.props.onUserFormChange(data); } useAnim(e) { this.setState({ useAnim: e.target.checked, }); } render() { const { stateFranchiseList } = this.props; const { franchise } = this.props.userInfo; const dropdownMenuStyle = { maxHeight: 200, overflow: 'auto', borderRadius: 0, fontSize: '0.8rem', }; const franchiseList = stateFranchiseList && stateFranchiseList.map((list) => ( <Option key={list._id} title={list.name}>{list.name}</Option> )); console.log(franchiseList); return ( <Select value={franchise} allowClear placeholder="Select Franchise" dropdownMenuStyle={dropdownMenuStyle} style={{ width: '100%' }} animation="slide-up" showSearch={false} optionLabelProp="children" optionFilterProp="text" onChange={this.onChange} > {franchiseList} </Select> ); } }
src/DetailsSection/CardList/Layout.js
conferenceradar/list
import React from 'react'; import { GriddleWrapper, Left, Right, TopWrapper, CenteredPagination } from './styles'; const Layout = ({ Table, Pagination, Filter }) => ( <GriddleWrapper> <TopWrapper> <Left> <Filter /> </Left> <Right> <Pagination /> </Right> </TopWrapper> <Table /> <CenteredPagination> <Pagination /> </CenteredPagination> </GriddleWrapper> ); export default Layout;
v8/development/node_modules/eslint-config-airbnb/test/test-react-order.js
BigBoss424/portfolio
import test from 'tape'; import { CLIEngine } from 'eslint'; import eslintrc from '..'; import reactRules from '../rules/react'; import reactA11yRules from '../rules/react-a11y'; const cli = new CLIEngine({ useEslintrc: false, baseConfig: eslintrc, rules: { // It is okay to import devDependencies in tests. 'import/no-extraneous-dependencies': [2, { devDependencies: true }], // this doesn't matter for tests 'lines-between-class-members': 0, }, }); function lint(text) { // @see https://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles // @see https://eslint.org/docs/developer-guide/nodejs-api.html#executeontext const linter = cli.executeOnText(text); return linter.results[0]; } function wrapComponent(body) { return ` import React from 'react'; export default class MyComponent extends React.Component { /* eslint no-empty-function: 0, class-methods-use-this: 0 */ ${body} } `; } test('validate react prop order', (t) => { t.test('make sure our eslintrc has React and JSX linting dependencies', (t) => { t.plan(2); t.deepEqual(reactRules.plugins, ['react']); t.deepEqual(reactA11yRules.plugins, ['jsx-a11y', 'react']); }); t.test('passes a good component', (t) => { t.plan(3); const result = lint(wrapComponent(` componentWillMount() {} componentDidMount() {} setFoo() {} getFoo() {} setBar() {} someMethod() {} renderDogs() {} render() { return <div />; }`)); t.notOk(result.warningCount, 'no warnings'); t.notOk(result.errorCount, 'no errors'); t.deepEquals(result.messages, [], 'no messages in results'); }); t.test('order: when random method is first', (t) => { t.plan(2); const result = lint(wrapComponent(` someMethod() {} componentWillMount() {} componentDidMount() {} setFoo() {} getFoo() {} setBar() {} renderDogs() {} render() { return <div />; } `)); t.ok(result.errorCount, 'fails'); t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort'); }); t.test('order: when random method after lifecycle methods', (t) => { t.plan(2); const result = lint(wrapComponent(` componentWillMount() {} componentDidMount() {} someMethod() {} setFoo() {} getFoo() {} setBar() {} renderDogs() {} render() { return <div />; } `)); t.ok(result.errorCount, 'fails'); t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort'); }); });
src/components/home/HomePage.js
compumike08/GitHub_Status_API_GUI
import React from 'react'; import OAuthSignInButton from '../oauth/OAuthSignInButton'; import ReposContainer from '../repos/ReposContainer'; class HomePage extends React.Component { constructor(props, context) { super(props, context); } render() { return ( <div> <div className="row"> <div className="col-sm-3"> <OAuthSignInButton/> </div> </div> <ReposContainer/> </div> ); } } export default HomePage;
client/app/scripts/charts/node-shape-stack.js
alban/scope
import React from 'react'; import { NODE_BASE_SIZE } from '../constants/styles'; export default function NodeShapeStack(props) { const verticalDistance = NODE_BASE_SIZE * (props.contrastMode ? 0.12 : 0.1); const verticalTranslate = t => `translate(0, ${t * verticalDistance})`; const Shape = props.shape; // Stack three shapes on top of one another pretending they are never highlighted. // Instead, fake the highlight of the whole stack with a vertically stretched shape // drawn in the background. This seems to give a good approximation of the stack // highlight and prevents us from needing to do some render-heavy SVG clipping magic. return ( <g transform={verticalTranslate(-2.5)} className="stack"> <g transform={`${verticalTranslate(1)} scale(1, 1.14)`}> <Shape className="highlight-only" {...props} /> </g> <g transform={verticalTranslate(2)}><Shape {...props} highlighted={false} /></g> <g transform={verticalTranslate(1)}><Shape {...props} highlighted={false} /></g> <g transform={verticalTranslate(0)}><Shape {...props} highlighted={false} /></g> </g> ); }
docs/app/components/logo/index.js
react-toolbox/react-toolbox
import React from 'react'; import PropTypes from 'prop-types'; import style from './style.css'; const Logo = (props) => { let className = style.logo; if (props.className) className += ` ${props.className}`; return ( <svg className={className} viewBox="0 0 144 131"> <g> <path d="M118.954,87.235 C117.784,80.465 115.755,73.277 112.881,65.938 C115.756,58.592 117.784,51.398 118.952,44.624 C130.693,50.324 137.999,57.982 138,65.909 C138,73.901 130.708,81.552 118.954,87.235 L118.954,87.235 Z M105,123.11 C102.829,124.364 100.281,125 97.428,125 C91.361,125 84.259,122.231 76.981,117.308 C82.313,112.871 87.579,107.457 92.545,101.223 C100.313,100.042 107.527,98.206 113.955,95.844 C114.897,108.916 111.902,119.125 105,123.11 L105,123.11 Z M46.568,124.997 C43.717,124.997 41.171,124.362 39.001,123.108 C32.104,119.127 29.109,108.918 30.052,95.846 C36.472,98.205 43.677,100.037 51.435,101.218 C56.402,107.454 61.671,112.871 67.005,117.309 C59.731,122.23 52.633,124.997 46.568,124.997 L46.568,124.997 Z M6,65.909 C6,57.957 13.296,50.305 25.036,44.612 C26.204,51.397 28.236,58.604 31.117,65.963 C28.25,73.288 26.224,80.464 25.055,87.221 C13.301,81.532 6,73.877 6,65.909 L6,65.909 Z M46.881,37.496 C34.717,58.616 46.806,37.626 34.785,58.498 C32.879,52.829 31.528,47.322 30.729,42.143 C35.601,40.255 41.033,38.677 46.881,37.496 L46.881,37.496 Z M72.005,18.28 C76.117,21.584 80.221,25.531 84.168,30.008 C60.223,29.96 84.478,30.009 59.886,29.959 C63.82,25.502 67.909,21.571 72.005,18.28 L72.005,18.28 Z M109.214,58.468 C97.071,37.445 109.179,58.408 97.101,37.496 C102.949,38.678 108.383,40.259 113.26,42.152 C112.461,47.319 111.113,52.813 109.214,58.468 L109.214,58.468 Z M109.235,73.475 C111.119,79.096 112.457,84.56 113.251,89.702 C108.396,91.576 102.987,93.144 97.16,94.319 C109.053,73.79 96.994,94.605 109.235,73.475 L109.235,73.475 Z M34.764,73.5 C47.04,94.67 34.992,73.892 46.834,94.313 C41.014,93.136 35.61,91.567 30.758,89.691 C31.551,84.56 32.886,79.107 34.764,73.5 L34.764,73.5 Z M84.108,101.947 C80.175,106.402 76.088,110.332 71.993,113.623 C67.883,110.321 63.78,106.375 59.835,101.902 C83.777,101.946 59.54,101.901 84.108,101.947 L84.108,101.947 Z M86.649,95.951 L71.75,95.924 L56.853,95.896 C56.122,95.812 55.399,95.718 54.677,95.622 C54.474,95.357 54.27,95.096 54.068,94.829 L38.235,67.525 C38.011,67.004 37.8,66.484 37.584,65.963 C37.731,65.609 37.871,65.255 38.022,64.9 L53.936,37.268 C54.21,36.903 54.487,36.545 54.764,36.185 C55.365,36.105 55.965,36.024 56.572,35.953 L72.262,35.984 L87.951,36.016 C88.387,36.069 88.816,36.131 89.248,36.188 C89.475,36.483 89.702,36.775 89.927,37.073 L105.949,64.813 C106.109,65.189 106.259,65.564 106.414,65.939 C106.2,66.457 105.989,66.975 105.766,67.494 L89.983,94.737 C89.757,95.038 89.529,95.331 89.301,95.628 C88.424,95.744 87.54,95.853 86.649,95.951 L86.649,95.951 Z M144,65.909 C143.999,54.951 134.647,45.112 119.808,38.364 C121.377,22.123 117.514,9.088 108.001,3.596 C104.843,1.774 101.279,0.905 97.437,0.905 L97.438,6.905 C100.286,6.905 102.831,7.54 105.001,8.793 C111.904,12.778 114.898,22.945 113.965,35.978 C107.519,33.608 100.279,31.77 92.485,30.588 C87.54,24.392 82.299,19.008 76.992,14.593 C84.266,9.672 91.365,6.906 97.435,6.905 L97.437,0.905 L97.434,0.905 C89.71,0.906 80.873,4.42 72.008,10.742 C63.141,4.418 54.301,0.904 46.573,0.904 L46.573,6.904 C52.639,6.904 59.74,9.672 67.017,14.594 C61.711,19.009 56.47,24.391 51.525,30.586 C43.724,31.768 36.477,33.608 30.026,35.981 C29.095,22.949 32.093,12.782 39,8.794 C41.172,7.54 43.72,6.904 46.573,6.904 L46.573,0.904 C42.729,0.904 39.16,1.773 36,3.597 C26.486,9.091 22.619,22.126 24.184,38.366 C9.349,45.114 0,54.953 0,65.909 C0,76.869 9.357,86.709 24.202,93.457 C22.615,109.734 26.472,122.804 36.001,128.304 C39.16,130.128 42.725,130.997 46.568,130.997 C54.292,130.997 63.128,127.484 71.992,121.162 C80.859,127.486 89.7,131 97.428,131 C101.271,131 104.84,130.131 108,128.306 C117.53,122.803 121.391,109.73 119.804,93.451 C134.643,86.702 144,76.866 144,65.909 L144,65.909 Z" /> <path d="M71.5482968,65.9688173 C69.154234,70.0775221 66.7769144,74.1965782 64.47,78.356 C63.271,80.497 62.097,82.654 60.931,84.815 C59.794,86.993 58.615,89.146 57.518,91.348 C58.905,89.316 60.21,87.237 61.558,85.183 C62.876,83.111 64.187,81.035 65.472,78.944 C67.9377029,74.9691498 70.3353266,70.9543598 72.7167607,66.929899 L99.741,65.952 L72.7137677,64.9739927 C70.3372065,60.9888441 67.9401733,57.0159615 65.476,53.083 C64.19,51.014 62.88,48.96 61.562,46.909 C60.212,44.879 58.907,42.821 57.518,40.813 C58.613,42.995 59.792,45.128 60.926,47.286 C62.093,49.426 63.268,51.561 64.466,53.682 C66.7739163,57.7980908 69.150305,61.8738486 71.5470195,65.9374346 L71.5387573,65.952 L71.5482968,65.9688173 Z M56.341,93.07 L40.684,65.952 L56.344,38.834 L87.657,38.831 L103.315,65.952 L87.659,93.073 L56.341,93.07 Z" /> </g> </svg> ); }; Logo.propTypes = { className: PropTypes.string }; export default Logo;
src/svg-icons/image/straighten.js
jacklam718/react-svg-iconx
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageStraighten = (props) => ( <SvgIcon {...props}> <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h2v4h2V8h2v4h2V8h2v4h2V8h2v4h2V8h2v8z"/> </SvgIcon> ); ImageStraighten = pure(ImageStraighten); ImageStraighten.displayName = 'ImageStraighten'; ImageStraighten.muiName = 'SvgIcon'; export default ImageStraighten;
frontend/src/components/CameraSegmentBuilderCarousel.js
WildflowerSchools/sensei
import React from 'react'; import _ from 'lodash'; import { Carousel } from 'react-bootstrap'; import {getSenseiToken, baseUrl, vantagePoints} from './../constants'; import { Preload } from 'react-preload'; import moment from 'moment'; import { parsePhotoSegmentTimestamp } from './../utils'; import momentTimezoneSetup from 'moment-timezone'; import KeyHandler, {KEYDOWN} from 'react-key-handler'; momentTimezoneSetup(moment); class CameraSegmentBuilderCarousel extends React.Component { constructor(props) { super(props); this.state = { index: props.page > 0 ? 15 : (props.index || 0), direction: null } } handleSelect = (selectedIndex, e) => { let delta = selectedIndex - this.state.index; this.props.onCarouselChange(delta, selectedIndex); this.setState({ index: selectedIndex, direction: e.direction }); } shouldComponentUpdate(nextProps, nextState) { let index = this.state.index; if (!_.isEqual(nextProps.page, this.props.page)) { index = (nextProps.page > this.props.page ? 15 : 34); index = index === this.state.index ? index+1 : index; } else if (!_.isEqual(nextProps.index, this.props.index)) { index = nextProps.index; } this.setState({index}); return true; } moveCarousel = (event) => { event.preventDefault(); let index = this.state.index; let delta = (event.key === 'ArrowLeft' ? -1 : 1) * (event.shiftKey ? 10 : 1); index += delta; if (index < (_.size(this.props.photos[this.props.camera])-1) && index >= 0 ) { let result = this.props.onCarouselChange(delta, index, this.props.photos[this.props.camera][index]); if (result) { result === 'forward' ? index = 15 : index = 34; } this.setState({index}) } } render() { let loadingIndicator = (<div>Loading...</div>) if (_.isEmpty(this.props.photos) || !this.props.camera) return null let carouselItems = _.map(this.props.photos[this.props.camera], (key, index) => { let delta = this.state.index - index; let content = _.reduce(_.keys(this.props.photos), (current, camera) => { _.each(this.props.vantagePoints, (vantagePoint, i) => { let url = this.props.photos[camera][index]; let maxDelta = camera === 'video' ? 1 : 5; if (url && delta === 0 || ((Math.abs(delta) < maxDelta && this.props.vantagePoint === vantagePoint && this.props.camera === camera))) { url = url.replace('camera01', vantagePoint).replace('/camera/', `/${camera === 'overlays' ? 'overlays' : 'camera'}/`).replace('still', camera === 'video' ? 'video' : 'still').replace('.jpg', camera === 'camera' ? '.jpg' : (camera === 'video' ? '.mp4' : '_rendered.png') ); let subItemClass = `sub-item camera-${camera} vantage-point-${vantagePoint}`; if (camera === 'video') { current.images.push(<video key={`image-${camera}-${vantagePoint}`} className={subItemClass} controls autoPlay> <source src={`${baseUrl()}/api/v1/camera_data/signed_url/${url}`} type="video/mp4"/> </video> ) } else { current.images.push(<img key={`image-${camera}-${vantagePoint}`} className={subItemClass} src={`${baseUrl()}/api/v1/camera_data/signed_url/${url}`}/>) } current.captions.push(<Carousel.Caption key={`image-${camera}-${vantagePoint}`} className={subItemClass}> <h3>{moment(parsePhotoSegmentTimestamp(url)).tz(this.props.timezone).format("h:mm:ss A z")}</h3> </Carousel.Caption>) } else { return ''; } }) return current; }, {images: [], captions: []}); let order = delta < 0 ? 'future' : 'past'; let siblingClass = delta !== 0 && Math.abs(delta) < 5 ? `${order} ${order}-${Math.abs(delta)}` : ''; return ( <Carousel.Item key={index} className={`camera-${this.props.camera} vantage-point-${this.props.vantagePoint} ${ siblingClass }`}> { content.images } { content.captions } </Carousel.Item> ); }) return ( <div> <KeyHandler keyEventName={KEYDOWN} keyValue="ArrowRight" onKeyHandle={this.moveCarousel} /> <KeyHandler keyEventName={KEYDOWN} keyValue="ArrowLeft" onKeyHandle={this.moveCarousel} /> <Carousel className={this.props.camera === 'video' ? 'video' : ''} slide={false} wrap={false} activeIndex={this.state.index} indicators={false} direction={this.state.direction} onSelect={this.handleSelect}> {carouselItems} </Carousel> </div> ) } } export default CameraSegmentBuilderCarousel;
ajax/libs/qooxdoo/2.1/q.js
the-destro/cdnjs
/** qooxdoo v.2.1 | (c) 2012 1&1 Internet AG 1und1.de | qooxdoo.org/license */ (function(){ if (!window.qx) window.qx = {}; var qx = window.qx; if (!qx.$$environment) qx.$$environment = {}; var envinfo = {"json":true,"qx.application":"library.Application","qx.debug":false,"qx.debug.databinding":false,"qx.debug.dispose":false,"qx.debug.ui.queue":false,"qx.optimization.variants":true,"qx.revision":"","qx.theme":"qx.theme.Modern","qx.version":"2.1"}; for (var k in envinfo) qx.$$environment[k] = envinfo[k]; qx.$$packageData = {}; /** qooxdoo v.2.1 | (c) 2012 1&1 Internet AG 1und1.de | qooxdoo.org/license */ qx.$$packageData['0']={"locales":{},"resources":{},"translations":{"C":{},"en":{}}}; /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) * Martin Wittemann (martinwittemann) ************************************************************************ */ /* ************************************************************************ #ignore(qx.data) #ignore(qx.data.IListData) #ignore(qx.util.OOUtil) ************************************************************************ */ /** * Create namespace */ if(!window.qx){ window.qx = { }; }; /** * Bootstrap qx.Bootstrap to create myself later * This is needed for the API browser etc. to let them detect me */ qx.Bootstrap = { genericToString : function(){ return "[Class " + this.classname + "]"; }, createNamespace : function(name, object){ var splits = name.split("."); var parent = window; var part = splits[0]; for(var i = 0,len = splits.length - 1;i < len;i++,part = splits[i]){ if(!parent[part]){ parent = parent[part] = { }; } else { parent = parent[part]; }; }; // store object parent[part] = object; // return last part name (e.g. classname) return part; }, setDisplayName : function(fcn, classname, name){ fcn.displayName = classname + "." + name + "()"; }, setDisplayNames : function(functionMap, classname){ for(var name in functionMap){ var value = functionMap[name]; if(value instanceof Function){ value.displayName = classname + "." + name + "()"; }; }; }, define : function(name, config){ if(!config){ var config = { statics : { } }; }; var clazz; var proto = null; qx.Bootstrap.setDisplayNames(config.statics, name); if(config.members || config.extend){ qx.Bootstrap.setDisplayNames(config.members, name + ".prototype"); clazz = config.construct || new Function; if(config.extend){ this.extendClass(clazz, clazz, config.extend, name, basename); }; var statics = config.statics || { }; // use keys to include the shadowed in IE for(var i = 0,keys = qx.Bootstrap.keys(statics),l = keys.length;i < l;i++){ var key = keys[i]; clazz[key] = statics[key]; }; proto = clazz.prototype; var members = config.members || { }; // use keys to include the shadowed in IE for(var i = 0,keys = qx.Bootstrap.keys(members),l = keys.length;i < l;i++){ var key = keys[i]; proto[key] = members[key]; }; } else { clazz = config.statics || { }; }; // Create namespace var basename = name ? this.createNamespace(name, clazz) : ""; // Store names in constructor/object clazz.name = clazz.classname = name; clazz.basename = basename; // Store type info clazz.$$type = "Class"; // Attach toString if(!clazz.hasOwnProperty("toString")){ clazz.toString = this.genericToString; }; // Execute defer section if(config.defer){ config.defer(clazz, proto); }; // Store class reference in global class registry qx.Bootstrap.$$registry[name] = clazz; return clazz; } }; /** * Internal class that is responsible for bootstrapping the qooxdoo * framework at load time. * * Does support: * * * Construct * * Statics * * Members * * Extend * * Defer * * Does not support: * * * Super class calls * * Mixins, Interfaces, Properties, ... */ qx.Bootstrap.define("qx.Bootstrap", { statics : { /** Timestamp of qooxdoo based application startup */ LOADSTART : qx.$$start || new Date(), /** * Mapping for early use of the qx.debug environment setting. */ DEBUG : (function(){ // make sure to reflect all changes here to the environment class! var debug = true; if(qx.$$environment && qx.$$environment["qx.debug"] === false){ debug = false; }; return debug; })(), /** * Minimal accessor API for the environment settings given from the * generator. * * WARNING: This method only should be used if the * {@link qx.core.Environment} class is not loaded! * * @param key {String} The key to get the value from. * @return {var} The value of the setting or <code>undefined</code>. */ getEnvironmentSetting : function(key){ if(qx.$$environment){ return qx.$$environment[key]; }; }, /** * Minimal mutator for the environment settings given from the generator. * It checks for the existance of the environment settings and sets the * key if its not given from the generator. If a setting is available from * the generator, the setting will be ignored. * * WARNING: This method only should be used if the * {@link qx.core.Environment} class is not loaded! * * @param key {String} The key of the setting. * @param value {var} The value for the setting. */ setEnvironmentSetting : function(key, value){ if(!qx.$$environment){ qx.$$environment = { }; }; if(qx.$$environment[key] === undefined){ qx.$$environment[key] = value; }; }, /** * Creates a namespace and assigns the given object to it. * * @internal * @param name {String} The complete namespace to create. Typically, the last part is the class name itself * @param object {Object} The object to attach to the namespace * @return {Object} last part of the namespace (typically the class name) * @throws {Error} when the given object already exists. */ createNamespace : qx.Bootstrap.createNamespace, /** * Define a new class using the qooxdoo class system. * Lightweight version of {@link qx.Class#define} only used during bootstrap phase. * * @internal * @signature function(name, config) * @param name {String?} Name of the class. If null, the class will not be * attached to a namespace. * @param config {Map ? null} Class definition structure. * @return {Class} The defined class */ define : qx.Bootstrap.define, /** * Sets the display name of the given function * * @signature function(fcn, classname, name) * @param fcn {Function} the function to set the display name for * @param classname {String} the name of the class the function is defined in * @param name {String} the function name */ setDisplayName : qx.Bootstrap.setDisplayName, /** * Set the names of all functions defined in the given map * * @signature function(functionMap, classname) * @param functionMap {Object} a map with functions as values * @param classname {String} the name of the class, the functions are * defined in */ setDisplayNames : qx.Bootstrap.setDisplayNames, /** * This method will be attached to all classes to return * a nice identifier for them. * * @internal * @signature function() * @return {String} The class identifier */ genericToString : qx.Bootstrap.genericToString, /** * Inherit a clazz from a super class. * * This function differentiates between class and constructor because the * constructor written by the user might be wrapped and the <code>base</code> * property has to be attached to the constructor, while the <code>superclass</code> * property has to be attached to the wrapped constructor. * * @param clazz {Function} The class's wrapped constructor * @param construct {Function} The unwrapped constructor * @param superClass {Function} The super class * @param name {Function} fully qualified class name * @param basename {Function} the base name */ extendClass : function(clazz, construct, superClass, name, basename){ var superproto = superClass.prototype; // Use helper function/class to save the unnecessary constructor call while // setting up inheritance. var helper = new Function(); helper.prototype = superproto; var proto = new helper(); // Apply prototype to new helper instance clazz.prototype = proto; // Store names in prototype proto.name = proto.classname = name; proto.basename = basename; /* - Store base constructor to constructor- - Store reference to extend class */ construct.base = superClass; clazz.superclass = superClass; /* - Store statics/constructor onto constructor/prototype - Store correct constructor - Store statics onto prototype */ construct.self = clazz.constructor = proto.constructor = clazz; }, /** * Find a class by its name * * @param name {String} class name to resolve * @return {Class} the class */ getByName : function(name){ return qx.Bootstrap.$$registry[name]; }, /** {Map} Stores all defined classes */ $$registry : { }, /* --------------------------------------------------------------------------- OBJECT UTILITY FUNCTIONS --------------------------------------------------------------------------- */ /** * Get the number of own properties in the object. * * @param map {Object} the map * @return {Integer} number of objects in the map * @lint ignoreUnused(key) */ objectGetLength : function(map){ return qx.Bootstrap.keys(map).length; }, /** * Inserts all keys of the source object into the * target objects. Attention: The target map gets modified. * * @param target {Object} target object * @param source {Object} object to be merged * @param overwrite {Boolean ? true} If enabled existing keys will be overwritten * @return {Object} Target with merged values from the source object */ objectMergeWith : function(target, source, overwrite){ if(overwrite === undefined){ overwrite = true; }; for(var key in source){ if(overwrite || target[key] === undefined){ target[key] = source[key]; }; }; return target; }, /** * IE does not return "shadowed" keys even if they are defined directly * in the object. * * @internal */ __shadowedKeys : ["isPrototypeOf", "hasOwnProperty", "toLocaleString", "toString", "valueOf", "propertyIsEnumerable", "constructor"], /** * Get the keys of a map as array as returned by a "for ... in" statement. * * @deprecated {2.1.} Please use Object.keys instead. * @param map {Object} the map * @return {Array} array of the keys of the map */ getKeys : function(map){ if(qx.Bootstrap.DEBUG){ qx.Bootstrap.warn("'qx.Bootstrap.getKeys' is deprecated. " + "Please use the native 'Object.keys()' instead."); }; return qx.Bootstrap.keys(map); }, /** * Get the keys of a map as array as returned by a "for ... in" statement. * * @signature function(map) * @internal * @param map {Object} the map * @return {Array} array of the keys of the map */ keys : ({ "ES5" : Object.keys, "BROKEN_IE" : function(map){ if(map === null || (typeof map != "object" && typeof map != "function")){ throw new TypeError("Object.keys requires an object as argument."); }; var arr = []; var hasOwnProperty = Object.prototype.hasOwnProperty; for(var key in map){ if(hasOwnProperty.call(map, key)){ arr.push(key); }; }; // IE does not return "shadowed" keys even if they are defined directly // in the object. This is incompatible with the ECMA standard!! // This is why this checks are needed. var shadowedKeys = qx.Bootstrap.__shadowedKeys; for(var i = 0,a = shadowedKeys,l = a.length;i < l;i++){ if(hasOwnProperty.call(map, a[i])){ arr.push(a[i]); }; }; return arr; }, "default" : function(map){ if(map === null || (typeof map != "object" && typeof map != "function")){ throw new TypeError("Object.keys requires an object as argument."); }; var arr = []; var hasOwnProperty = Object.prototype.hasOwnProperty; for(var key in map){ if(hasOwnProperty.call(map, key)){ arr.push(key); }; }; return arr; } })[typeof (Object.keys) == "function" ? "ES5" : (function(){ for(var key in { toString : 1 }){ return key; }; })() !== "toString" ? "BROKEN_IE" : "default"], /** * Get the keys of a map as string * * @param map {Object} the map * @deprecated {2.1} Object.keys(map).join('\", "'). * @return {String} String of the keys of the map * The keys are separated by ", " */ getKeysAsString : function(map){ { }; var keys = qx.Bootstrap.keys(map); if(keys.length == 0){ return ""; }; return '"' + keys.join('\", "') + '"'; }, /** * Mapping from JavaScript string representation of objects to names * @internal */ __classToTypeMap : { "[object String]" : "String", "[object Array]" : "Array", "[object Object]" : "Object", "[object RegExp]" : "RegExp", "[object Number]" : "Number", "[object Boolean]" : "Boolean", "[object Date]" : "Date", "[object Function]" : "Function", "[object Error]" : "Error" }, /* --------------------------------------------------------------------------- FUNCTION UTILITY FUNCTIONS --------------------------------------------------------------------------- */ /** * Returns a function whose "this" is altered. * * *Syntax* * * <pre class='javascript'>qx.Bootstrap.bind(myFunction, [self, [varargs...]]);</pre> * * *Example* * * <pre class='javascript'> * function myFunction() * { * this.setStyle('color', 'red'); * // note that 'this' here refers to myFunction, not an element * // we'll need to bind this function to the element we want to alter * }; * * var myBoundFunction = qx.Bootstrap.bind(myFunction, myElement); * myBoundFunction(); // this will make the element myElement red. * </pre> * * @param func {Function} Original function to wrap * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {Function} The bound function. */ bind : function(func, self, varargs){ var fixedArgs = Array.prototype.slice.call(arguments, 2, arguments.length); return function(){ var args = Array.prototype.slice.call(arguments, 0, arguments.length); return func.apply(self, fixedArgs.concat(args)); }; }, /* --------------------------------------------------------------------------- STRING UTILITY FUNCTIONS --------------------------------------------------------------------------- */ /** * Convert the first character of the string to upper case. * * @param str {String} the string * @return {String} the string with an upper case first character */ firstUp : function(str){ return str.charAt(0).toUpperCase() + str.substr(1); }, /** * Convert the first character of the string to lower case. * * @param str {String} the string * @return {String} the string with a lower case first character */ firstLow : function(str){ return str.charAt(0).toLowerCase() + str.substr(1); }, /* --------------------------------------------------------------------------- TYPE UTILITY FUNCTIONS --------------------------------------------------------------------------- */ /** * Get the internal class of the value. See * http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ * for details. * * @param value {var} value to get the class for * @return {String} the internal class of the value */ getClass : function(value){ var classString = Object.prototype.toString.call(value); return (qx.Bootstrap.__classToTypeMap[classString] || classString.slice(8, -1)); }, /** * Whether the value is a string. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a string. */ isString : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof String" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (typeof value === "string" || qx.Bootstrap.getClass(value) == "String" || value instanceof String || (!!value && !!value.$$isString))); }, /** * Whether the value is an array. * * @param value {var} Value to check. * @return {Boolean} Whether the value is an array. */ isArray : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Array" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (value instanceof Array || (value && qx.data && qx.data.IListData && qx.util.OOUtil.hasInterface(value.constructor, qx.data.IListData)) || qx.Bootstrap.getClass(value) == "Array" || (!!value && !!value.$$isArray))); }, /** * Whether the value is an object. Note that built-in types like Window are * not reported to be objects. * * @param value {var} Value to check. * @return {Boolean} Whether the value is an object. */ isObject : function(value){ return (value !== undefined && value !== null && qx.Bootstrap.getClass(value) == "Object"); }, /** * Whether the value is a function. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a function. */ isFunction : function(value){ return qx.Bootstrap.getClass(value) == "Function"; }, /* --------------------------------------------------------------------------- LOGGING UTILITY FUNCTIONS --------------------------------------------------------------------------- */ $$logs : [], /** * Sending a message at level "debug" to the logger. * * @param object {Object} Contextual object (either instance or static class) * @param message {var} Any number of arguments supported. An argument may * have any JavaScript data type. All data is serialized immediately and * does not keep references to other objects. */ debug : function(object, message){ qx.Bootstrap.$$logs.push(["debug", arguments]); }, /** * Sending a message at level "info" to the logger. * * @param object {Object} Contextual object (either instance or static class) * @param message {var} Any number of arguments supported. An argument may * have any JavaScript data type. All data is serialized immediately and * does not keep references to other objects. */ info : function(object, message){ qx.Bootstrap.$$logs.push(["info", arguments]); }, /** * Sending a message at level "warn" to the logger. * * @param object {Object} Contextual object (either instance or static class) * @param message {var} Any number of arguments supported. An argument may * have any JavaScript data type. All data is serialized immediately and * does not keep references to other objects. */ warn : function(object, message){ qx.Bootstrap.$$logs.push(["warn", arguments]); }, /** * Sending a message at level "error" to the logger. * * @param object {Object} Contextual object (either instance or static class) * @param message {var} Any number of arguments supported. An argument may * have any JavaScript data type. All data is serialized immediately and * does not keep references to other objects. */ error : function(object, message){ qx.Bootstrap.$$logs.push(["error", arguments]); }, /** * Prints the current stack trace at level "info" * * @param object {Object} Contextual object (either instance or static class) */ trace : function(object){ } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2005-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * This class is the single point to access all settings that may be different * in different environments. This contains e.g. the browser name, engine * version but also qooxdoo or application specific settings. * * Its public API can be found in its four main methods. One pair of methods * is used to check the synchronous values of the environment. The other pair * of methods is used for asynchronous checks. * * The most often used method should be {@link #get}, which returns the * current value for a given environment check. * * All qooxdoo settings can be changed via the generator's config. See the manual * for more details about the environment key in the config. As you can see * from the methods API, there is no way to override an existing key. So if you * need to change a qooxdoo setting, you have to use the generator to do so. * * The following table shows the available checks. If you are * interested in more details, check the reference to the implementation of * each check. Please do not use those check implementations directly, as the * Environment class comes with a smart caching feature. * * <table border="0" cellspacing="10"> * <tbody> * <tr> * <td colspan="4"><h2>Synchronous checks</h2> * </td> * </tr> * <tr> * <th><h3>Key</h3></th> * <th><h3>Type</h3></th> * <th><h3>Example</h3></th> * <th><h3>Details</h3></th> * </tr> * <tr> * <td colspan="4"><b>browser</b></td> * </tr> * <tr> * <td>browser.documentmode</td><td><i>Integer</i></td><td><code>0</code></td> * <td>{@link qx.bom.client.Browser#getDocumentMode}</td> * </tr> * <tr> * <td>browser.name</td><td><i>String</i></td><td><code> chrome </code></td> * <td>{@link qx.bom.client.Browser#getName}</td> * </tr> * <tr> * <td>browser.quirksmode</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Browser#getQuirksMode}</td> * </tr> * <tr> * <td>browser.version</td><td><i>String</i></td><td><code>11.0</code></td> * <td>{@link qx.bom.client.Browser#getVersion}</td> * </tr> * <tr> * <td colspan="4"><b>runtime</b></td> * </tr> * <tr> * <td>runtime.name</td><td><i> String </i></td><td><code> node.js </code></td> * <td>{@link qx.bom.client.Runtime#getName}</td> * </tr> * <tr> * <td colspan="4"><b>css</b></td> * </tr> * <tr> * <td>css.borderradius</td><td><i>String</i> or <i>null</i></td><td><code>borderRadius</code></td> * <td>{@link qx.bom.client.Css#getBorderRadius}</td> * </tr> * <tr> * <td>css.borderimage</td><td><i>String</i> or <i>null</i></td><td><code>WebkitBorderImage</code></td> * <td>{@link qx.bom.client.Css#getBorderImage}</td> * </tr> * <tr> * <td>css.borderimage.standardsyntax</td><td><i>Boolean</i> or <i>null</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getBorderImageSyntax}</td> * </tr> * <tr> * <td>css.boxmodel</td><td><i>String</i></td><td><code>content</code></td> * <td>{@link qx.bom.client.Css#getBoxModel}</td> * </tr> * <tr> * <td>css.boxshadow</td><td><i>String</i> or <i>null</i></td><td><code>boxShadow</code></td> * <td>{@link qx.bom.client.Css#getBoxShadow}</td> * </tr> * <tr> * <td>css.gradient.linear</td><td><i>String</i> or <i>null</i></td><td><code>-moz-linear-gradient</code></td> * <td>{@link qx.bom.client.Css#getLinearGradient}</td> * </tr> * <tr> * <td>css.gradient.filter</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getFilterGradient}</td> * </tr> * <tr> * <td>css.gradient.radial</td><td><i>String</i> or <i>null</i></td><td><code>-moz-radial-gradient</code></td> * <td>{@link qx.bom.client.Css#getRadialGradient}</td> * </tr> * <tr> * <td>css.gradient.legacywebkit</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Css#getLegacyWebkitGradient}</td> * </tr> * <tr> * <td>css.placeholder</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getPlaceholder}</td> * </tr> * <tr> * <td>css.textoverflow</td><td><i>String</i> or <i>null</i></td><td><code>textOverflow</code></td> * <td>{@link qx.bom.client.Css#getTextOverflow}</td> * </tr> * <tr> * <td>css.rgba</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getRgba}</td> * </tr> * <tr> * <td>css.usermodify</td><td><i>String</i> or <i>null</i></td><td><code>WebkitUserModify</code></td> * <td>{@link qx.bom.client.Css#getUserModify}</td> * </tr> * <tr> * <td>css.appearance</td><td><i>String</i> or <i>null</i></td><td><code>WebkitAppearance</code></td> * <td>{@link qx.bom.client.Css#getAppearance}</td> * </tr> * <tr> * <td>css.float</td><td><i>String</i> or <i>null</i></td><td><code>cssFloat</code></td> * <td>{@link qx.bom.client.Css#getFloat}</td> * </tr> * <tr> * <td>css.userselect</td><td><i>String</i> or <i>null</i></td><td><code>WebkitUserSelect</code></td> * <td>{@link qx.bom.client.Css#getUserSelect}</td> * </tr> * <tr> * <td>css.userselect.none</td><td><i>String</i> or <i>null</i></td><td><code>-moz-none</code></td> * <td>{@link qx.bom.client.Css#getUserSelectNone}</td> * </tr> * <tr> * <td>css.boxsizing</td><td><i>String</i> or <i>null</i></td><td><code>boxSizing</code></td> * <td>{@link qx.bom.client.Css#getBoxSizing}</td> * </tr> * <tr> * <td>css.animation</td><td><i>Object</i> or <i>null</i></td><td><code>{end-event: "webkitAnimationEnd", keyframes: "@-webkit-keyframes", play-state: null, name: "WebkitAnimation"}</code></td> * <td>{@link qx.bom.client.CssAnimation#getSupport}</td> * </tr> * <tr> * <td>css.animation.requestframe</td><td><i>String</i> or <i>null</i></td><td><code>mozRequestAnimationFrame</code></td> * <td>{@link qx.bom.client.CssAnimation#getRequestAnimationFrame}</td> * </tr> * <tr> * <td>css.transform</td><td><i>Object</i> or <i>null</i></td><td><code>{3d: true, origin: "WebkitTransformOrigin", name: "WebkitTransform", style: "WebkitTransformStyle", perspective: "WebkitPerspective", perspective-origin: "WebkitPerspectiveOrigin", backface-visibility: "WebkitBackfaceVisibility"}</code></td> * <td>{@link qx.bom.client.CssTransform#getSupport}</td> * </tr> * <tr> * <td>css.transform.3d</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.CssTransform#get3D}</td> * </tr> * <tr> * <td>css.inlineblock</td><td><i>String</i> or <i>null</i></td><td><code>inline-block</code></td> * <td>{@link qx.bom.client.Css#getInlineBlock}</td> * </tr> * <tr> * <td>css.opacity</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getOpacity}</td> * </tr> * <tr> * <td>deprecated since 2.1: css.overflowxy</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getOverflowXY}</td> * </tr> * <tr> * <td>css.textShadow</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getTextShadow}</td> * </tr> * <tr> * <td>css.textShadow.filter</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Css#getFilterTextShadow}</td> * </tr> * <tr> * <td colspan="4"><b>device</b></td> * </tr> * <tr> * <td>device.name</td><td><i>String</i></td><td><code>pc</code></td> * <td>{@link qx.bom.client.Device#getName}</td> * </tr> * <tr> * <td>device.type</td><td><i>String</i></td><td><code>mobile</code></td> * <td>{@link qx.bom.client.Device#getType}</td> * </tr> * <tr> * <td colspan="4"><b>ecmascript</b></td> * </tr> * <tr> * <td>ecmascript.error.stacktrace</td><td><i>String</i> or <i>null</i></td><td><code>stack</code></td> * <td>{@link qx.bom.client.EcmaScript#getStackTrace}</td> * </tr> * <tr> * <td>ecmascript.array.indexof<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayIndexOf}</td> * </tr> * <tr> * <td>ecmascript.array.lastindexof<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayLastIndexOf}</td> * </tr> * <tr> * <td>ecmascript.array.foreach<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayForEach}</td> * </tr> * <tr> * <td>ecmascript.array.filter<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayFilter}</td> * </tr> * <tr> * <td>ecmascript.array.map<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayMap}</td> * </tr> * <tr> * <td>ecmascript.array.some<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArraySome}</td> * </tr> * <tr> * <td>ecmascript.array.every<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayEvery}</td> * </tr> * <tr> * <td>ecmascript.array.reduce<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayReduce}</td> * </tr> * <tr> * <td>ecmascript.array.reduceright<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getArrayReduceRight}</td> * </tr> * <tr> * <td>ecmascript.function.bind<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getFunctionBind}</td> * </tr> * <tr> * <td>ecmascript.object.keys<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getObjectKeys}</td> * </tr> * <tr> * <td>ecmascript.date.now<td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getDateNow}</td> * </tr> * <tr> * <td>ecmascript.error.toString</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getErrorToString}</td> * </tr> * <tr> * <td>ecmascript.string.trim</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.EcmaScript#getStringTrim}</td> * </tr> * <tr> * <td colspan="4"><b>engine</b></td> * </tr> * <tr> * <td>engine.name</td><td><i>String</i></td><td><code>webkit</code></td> * <td>{@link qx.bom.client.Engine#getName}</td> * </tr> * <tr> * <td>engine.version</td><td><i>String</i></td><td><code>534.24</code></td> * <td>{@link qx.bom.client.Engine#getVersion}</td> * </tr> * <tr> * <td colspan="4"><b>event</b></td> * </tr> * <tr> * <td>event.pointer</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Event#getPointer}</td> * </tr> * <tr> * <td>event.mspointer</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Event#getMsPointer}</td> * </tr> * <tr> * <td>event.touch</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Event#getTouch}</td> * </tr> * <tr> * <td>event.help</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Event#getHelp}</td> * </tr> * <tr> * <td>event.hashchange</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Event#getHashChange}</td> * </tr> * <tr> * <td colspan="4"><b>html</b></td> * </tr> * <tr> * <td>html.audio</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getAudio}</td> * </tr> * <tr> * <td>html.audio.mp3</td><td><i>String</i></td><td><code>""</code></td> * <td>{@link qx.bom.client.Html#getAudioMp3}</td> * </tr> * <tr> * <td>html.audio.ogg</td><td><i>String</i></td><td><code>"maybe"</code></td> * <td>{@link qx.bom.client.Html#getAudioOgg}</td> * </tr> * <tr> * <td>html.audio.wav</td><td><i>String</i></td><td><code>"probably"</code></td> * <td>{@link qx.bom.client.Html#getAudioWav}</td> * </tr> * <tr> * <td>html.audio.au</td><td><i>String</i></td><td><code>"maybe"</code></td> * <td>{@link qx.bom.client.Html#getAudioAu}</td> * </tr> * <tr> * <td>html.audio.aif</td><td><i>String</i></td><td><code>"probably"</code></td> * <td>{@link qx.bom.client.Html#getAudioAif}</td> * </tr> * <tr> * <td>html.canvas</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getCanvas}</td> * </tr> * <tr> * <td>html.classlist</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getClassList}</td> * </tr> * <tr> * <td>html.geolocation</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getGeoLocation}</td> * </tr> * <tr> * <td>html.storage.local</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getLocalStorage}</td> * </tr> * <tr> * <td>html.storage.session</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getSessionStorage}</td> * </tr> * <tr> * <td>html.storage.userdata</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getUserDataStorage}</td> * </tr> * <tr> * <td>html.svg</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getSvg}</td> * </tr> * <tr> * <td>html.video</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getVideo}</td> * </tr> * <tr> * <td>html.video.h264</td><td><i>String</i></td><td><code>"probably"</code></td> * <td>{@link qx.bom.client.Html#getVideoH264}</td> * </tr> * <tr> * <td>html.video.ogg</td><td><i>String</i></td><td><code>""</code></td> * <td>{@link qx.bom.client.Html#getVideoOgg}</td> * </tr> * <tr> * <td>html.video.webm</td><td><i>String</i></td><td><code>"maybe"</code></td> * <td>{@link qx.bom.client.Html#getVideoWebm}</td> * </tr> * <tr> * <td>html.vml</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Html#getVml}</td> * </tr> * <tr> * <td>html.webworker</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getWebWorker}</td> * <tr> * <td>html.filereader</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getFileReader}</td> * </tr> * <tr> * <td>html.xpath</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getXPath}</td> * </tr> * <tr> * <td>html.xul</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getXul}</td> * </tr> * <tr> * <td>html.console</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getConsole}</td> * </tr> * <tr> * <td>html.element.contains</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getContains}</td> * </tr> * <tr> * <td>html.element.compareDocumentPosition</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getCompareDocumentPosition}</td> * </tr> * <tr> * <td>html.element.textContent</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getTextContent}</td> * </tr> * <tr> * <td>html.image.naturaldimensions</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getNaturalDimensions}</td> * </tr> * <tr> * <td>html.history.state</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getHistoryState}</td> * </tr> * <tr> * <td colspan="4"><b>XML</b></td> * </tr> * <tr> * <td>xml.implementation</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Xml#getImplementation}</td> * </tr> * <tr> * <td>xml.domparser</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Xml#getDomParser}</td> * </tr> * <tr> * <td>xml.selectsinglenode</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Xml#getSelectSingleNode}</td> * </tr> * <tr> * <td>xml.selectnodes</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Xml#getSelectNodes}</td> * </tr> * <tr> * <td>xml.getelementsbytagnamens</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Xml#getElementsByTagNameNS}</td> * </tr> * <tr> * <td>xml.domproperties</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Xml#getDomProperties}</td> * </tr> * <tr> * <td>xml.attributens</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Xml#getAttributeNS}</td> * </tr> * <tr> * <td>xml.createelementns</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Xml#getCreateElementNS}</td> * </tr> * <tr> * <td>xml.createnode</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Xml#getCreateNode}</td> * </tr> * <tr> * <td>xml.getqualifieditem</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Xml#getQualifiedItem}</td> * </tr> * <tr> * <td colspan="4"><b>Stylesheets</b></td> * </tr> * <tr> * <td>html.stylesheet.createstylesheet</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Stylesheet#getCreateStyleSheet}</td> * </tr> * <tr> * <td>html.stylesheet.insertrule</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Stylesheet#getInsertRule}</td> * </tr> * <tr> * <td>html.stylesheet.deleterule</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Stylesheet#getDeleteRule}</td> * </tr> * <tr> * <td>html.stylesheet.addimport</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Stylesheet#getAddImport}</td> * </tr> * <tr> * <td>html.stylesheet.removeimport</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Stylesheet#getRemoveImport}</td> * </tr> * <tr> * <td colspan="4"><b>io</b></td> * </tr> * <tr> * <td>io.maxrequests</td><td><i>Integer</i></td><td><code>4</code></td> * <td>{@link qx.bom.client.Transport#getMaxConcurrentRequestCount}</td> * </tr> * <tr> * <td>io.ssl</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Transport#getSsl}</td> * </tr> * <tr> * <td>io.xhr</td><td><i>String</i></td><td><code>xhr</code></td> * <td>{@link qx.bom.client.Transport#getXmlHttpRequest}</td> * </tr> * <tr> * <td colspan="4"><b>locale</b></td> * </tr> * <tr> * <td>locale</td><td><i>String</i></td><td><code>de</code></td> * <td>{@link qx.bom.client.Locale#getLocale}</td> * </tr> * <tr> * <td>locale.variant</td><td><i>String</i></td><td><code>de</code></td> * <td>{@link qx.bom.client.Locale#getVariant}</td> * </tr> * <tr> * <td colspan="4"><b>os</b></td> * </tr> * <tr> * <td>os.name</td><td><i>String</i></td><td><code>osx</code></td> * <td>{@link qx.bom.client.OperatingSystem#getName}</td> * </tr> * <tr> * <td>os.version</td><td><i>String</i></td><td><code>10.6</code></td> * <td>{@link qx.bom.client.OperatingSystem#getVersion}</td> * </tr> * <tr> * <td>os.scrollBarOverlayed</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Scroll#scrollBarOverlayed}</td> * </tr> * <tr> * <td colspan="4"><b>phonegap</b></td> * </tr> * <tr> * <td>phonegap</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.PhoneGap#getPhoneGap}</td> * </tr> * <tr> * <td>phonegap.notification</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.PhoneGap#getNotification}</td> * </tr> * <tr> * <td colspan="4"><b>plugin</b></td> * </tr> * <tr> * <td>plugin.divx</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getDivX}</td> * </tr> * <tr> * <td>plugin.divx.version</td><td><i>String</i></td><td></td> * <td>{@link qx.bom.client.Plugin#getDivXVersion}</td> * </tr> * <tr> * <td>plugin.flash</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Flash#isAvailable}</td> * </tr> * <tr> * <td>plugin.flash.express</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Flash#getExpressInstall}</td> * </tr> * <tr> * <td>plugin.flash.strictsecurity</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Flash#getStrictSecurityModel}</td> * </tr> * <tr> * <td>plugin.flash.version</td><td><i>String</i></td><td><code>10.2.154</code></td> * <td>{@link qx.bom.client.Flash#getVersion}</td> * </tr> * <tr> * <td>plugin.gears</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getGears}</td> * </tr> * <tr> * <td>plugin.activex</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getActiveX}</td> * </tr> * <tr> * <td>plugin.skype</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getSkype}</td> * </tr> * <tr> * <td>plugin.pdf</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getPdf}</td> * </tr> * <tr> * <td>plugin.pdf.version</td><td><i>String</i></td><td></td> * <td>{@link qx.bom.client.Plugin#getPdfVersion}</td> * </tr> * <tr> * <td>plugin.quicktime</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Plugin#getQuicktime}</td> * </tr> * <tr> * <td>plugin.quicktime.version</td><td><i>String</i></td><td><code>7.6</code></td> * <td>{@link qx.bom.client.Plugin#getQuicktimeVersion}</td> * </tr> * <tr> * <td>plugin.silverlight</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getSilverlight}</td> * </tr> * <tr> * <td>plugin.silverlight.version</td><td><i>String</i></td><td></td> * <td>{@link qx.bom.client.Plugin#getSilverlightVersion}</td> * </tr> * <tr> * <td>plugin.windowsmedia</td><td><i>Boolean</i></td><td><code>false</code></td> * <td>{@link qx.bom.client.Plugin#getWindowsMedia}</td> * </tr> * <tr> * <td>plugin.windowsmedia.version</td><td><i>String</i></td><td></td> * <td>{@link qx.bom.client.Plugin#getWindowsMediaVersion}</td> * </tr> * <tr> * <td colspan="4"><b>qx</b></td> * </tr> * <tr> * <td>qx.allowUrlSettings</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.allowUrlVariants</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.application</td><td><i>String</i></td><td><code>name.space</code></td> * <td><i>default:</i> <code>&lt;&lt;application name&gt;&gt;</code></td> * </tr> * <tr> * <td>qx.aspects</td><td><i>Boolean</i></td><td><code>false</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.debug</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>qx.debug.databinding</td><td><i>Boolean</i></td><td><code>false</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.debug.dispose</td><td><i>Boolean</i></td><td><code>false</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.debug.dispose.level</td><td><i>Integer</i></td><td><code>0</code></td> * <td><i>default:</i> <code>0</code></td> * </tr> * <tr> * <td>qx.debug.io</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <tr> * <td>qx.debug.io.remote</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <tr> * <td>qx.debug.io.remote.data</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.debug.property.level</td><td><i>Integer</i></td><td><code>0</code></td> * <td><i>default:</i> <code>0</code></td> * </tr> * <tr> * <td>qx.debug.ui.queue</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>qx.dynamicmousewheel</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>qx.dynlocale</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>qx.globalErrorHandling</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>qx.mobile.emulatetouch</td><td><i>Boolean</i></td><td><code>false</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.mobile.nativescroll</td><td><i>Boolean</i></td><td><code>false</code></td> * <td><i>default:</i> <code>false</code></td> * </tr> * <tr> * <td>qx.optimization.basecalls</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.optimization.comments</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.optimization.privates</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.optimization.strings</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.optimization.variables</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.optimization.variants</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>true if the corresp. <i>optimize</i> key is set in the config</td> * </tr> * <tr> * <td>qx.revision</td><td><i>String</i></td><td><code>27348</code></td> * </tr> * <tr> * <td>qx.theme</td><td><i>String</i></td><td><code>qx.theme.Modern</code></td> * <td><i>default:</i> <code>&lt;&lt;initial theme name&gt;&gt;</code></td> * </tr> * <tr> * <td>qx.version</td><td><i>String</i></td><td><code>${qxversion}</code></td> * </tr> * <tr> * <td>qx.blankpage</td><td><i>String</i></td><td><code>URI to blank.html page</code></td> * </tr> * <tr> * <td colspan="4"><b>module</b></td> * </tr> * <tr> * <td>module.databinding</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>module.logger</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>module.property</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td>module.events</td><td><i>Boolean</i></td><td><code>true</code></td> * <td><i>default:</i> <code>true</code></td> * </tr> * <tr> * <td colspan="4"><h3>Asynchronous checks</h3> * </td> * </tr> * <tr> * <td>html.dataurl</td><td><i>Boolean</i></td><td><code>true</code></td> * <td>{@link qx.bom.client.Html#getDataUrl}</td> * </tr> * </tbody> * </table> * */ qx.Bootstrap.define("qx.core.Environment", { statics : { /** Map containing the synchronous check functions. */ _checks : { }, /** Map containing the asynchronous check functions. */ _asyncChecks : { }, /** Internal cache for all checks. */ __cache : { }, /** Internal map for environment keys to check methods. */ _checksMap : { "engine.version" : "qx.bom.client.Engine.getVersion", "engine.name" : "qx.bom.client.Engine.getName", "browser.name" : "qx.bom.client.Browser.getName", "browser.version" : "qx.bom.client.Browser.getVersion", "browser.documentmode" : "qx.bom.client.Browser.getDocumentMode", "browser.quirksmode" : "qx.bom.client.Browser.getQuirksMode", "runtime.name" : "qx.bom.client.Runtime.getName", "device.name" : "qx.bom.client.Device.getName", "device.type" : "qx.bom.client.Device.getType", "locale" : "qx.bom.client.Locale.getLocale", "locale.variant" : "qx.bom.client.Locale.getVariant", "os.name" : "qx.bom.client.OperatingSystem.getName", "os.version" : "qx.bom.client.OperatingSystem.getVersion", "os.scrollBarOverlayed" : "qx.bom.client.Scroll.scrollBarOverlayed", "plugin.gears" : "qx.bom.client.Plugin.getGears", "plugin.activex" : "qx.bom.client.Plugin.getActiveX", "plugin.skype" : "qx.bom.client.Plugin.getSkype", "plugin.quicktime" : "qx.bom.client.Plugin.getQuicktime", "plugin.quicktime.version" : "qx.bom.client.Plugin.getQuicktimeVersion", "plugin.windowsmedia" : "qx.bom.client.Plugin.getWindowsMedia", "plugin.windowsmedia.version" : "qx.bom.client.Plugin.getWindowsMediaVersion", "plugin.divx" : "qx.bom.client.Plugin.getDivX", "plugin.divx.version" : "qx.bom.client.Plugin.getDivXVersion", "plugin.silverlight" : "qx.bom.client.Plugin.getSilverlight", "plugin.silverlight.version" : "qx.bom.client.Plugin.getSilverlightVersion", "plugin.flash" : "qx.bom.client.Flash.isAvailable", "plugin.flash.version" : "qx.bom.client.Flash.getVersion", "plugin.flash.express" : "qx.bom.client.Flash.getExpressInstall", "plugin.flash.strictsecurity" : "qx.bom.client.Flash.getStrictSecurityModel", "plugin.pdf" : "qx.bom.client.Plugin.getPdf", "plugin.pdf.version" : "qx.bom.client.Plugin.getPdfVersion", "io.maxrequests" : "qx.bom.client.Transport.getMaxConcurrentRequestCount", "io.ssl" : "qx.bom.client.Transport.getSsl", "io.xhr" : "qx.bom.client.Transport.getXmlHttpRequest", "event.touch" : "qx.bom.client.Event.getTouch", "event.pointer" : "qx.bom.client.Event.getPointer", "event.help" : "qx.bom.client.Event.getHelp", "event.hashchange" : "qx.bom.client.Event.getHashChange", "ecmascript.stacktrace" : "qx.bom.client.EcmaScript.getStackTrace", // @deprecated {2.1} "ecmascript.error.stacktrace" : "qx.bom.client.EcmaScript.getStackTrace", "ecmascript.array.indexof" : "qx.bom.client.EcmaScript.getArrayIndexOf", "ecmascript.array.lastindexof" : "qx.bom.client.EcmaScript.getArrayLastIndexOf", "ecmascript.array.foreach" : "qx.bom.client.EcmaScript.getArrayForEach", "ecmascript.array.filter" : "qx.bom.client.EcmaScript.getArrayFilter", "ecmascript.array.map" : "qx.bom.client.EcmaScript.getArrayMap", "ecmascript.array.some" : "qx.bom.client.EcmaScript.getArraySome", "ecmascript.array.every" : "qx.bom.client.EcmaScript.getArrayEvery", "ecmascript.array.reduce" : "qx.bom.client.EcmaScript.getArrayReduce", "ecmascript.array.reduceright" : "qx.bom.client.EcmaScript.getArrayReduceRight", "ecmascript.function.bind" : "qx.bom.client.EcmaScript.getFunctionBind", "ecmascript.object.keys" : "qx.bom.client.EcmaScript.getObjectKeys", "ecmascript.date.now" : "qx.bom.client.EcmaScript.getDateNow", "ecmascript.error.toString" : "qx.bom.client.EcmaScript.getErrorToString", "ecmascript.string.trim" : "qx.bom.client.EcmaScript.getStringTrim", "html.webworker" : "qx.bom.client.Html.getWebWorker", "html.filereader" : "qx.bom.client.Html.getFileReader", "html.geolocation" : "qx.bom.client.Html.getGeoLocation", "html.audio" : "qx.bom.client.Html.getAudio", "html.audio.ogg" : "qx.bom.client.Html.getAudioOgg", "html.audio.mp3" : "qx.bom.client.Html.getAudioMp3", "html.audio.wav" : "qx.bom.client.Html.getAudioWav", "html.audio.au" : "qx.bom.client.Html.getAudioAu", "html.audio.aif" : "qx.bom.client.Html.getAudioAif", "html.video" : "qx.bom.client.Html.getVideo", "html.video.ogg" : "qx.bom.client.Html.getVideoOgg", "html.video.h264" : "qx.bom.client.Html.getVideoH264", "html.video.webm" : "qx.bom.client.Html.getVideoWebm", "html.storage.local" : "qx.bom.client.Html.getLocalStorage", "html.storage.session" : "qx.bom.client.Html.getSessionStorage", "html.storage.userdata" : "qx.bom.client.Html.getUserDataStorage", "html.classlist" : "qx.bom.client.Html.getClassList", "html.xpath" : "qx.bom.client.Html.getXPath", "html.xul" : "qx.bom.client.Html.getXul", "html.canvas" : "qx.bom.client.Html.getCanvas", "html.svg" : "qx.bom.client.Html.getSvg", "html.vml" : "qx.bom.client.Html.getVml", "html.dataset" : "qx.bom.client.Html.getDataset", "html.dataurl" : "qx.bom.client.Html.getDataUrl", "html.console" : "qx.bom.client.Html.getConsole", "html.stylesheet.createstylesheet" : "qx.bom.client.Stylesheet.getCreateStyleSheet", "html.stylesheet.insertrule" : "qx.bom.client.Stylesheet.getInsertRule", "html.stylesheet.deleterule" : "qx.bom.client.Stylesheet.getDeleteRule", "html.stylesheet.addimport" : "qx.bom.client.Stylesheet.getAddImport", "html.stylesheet.removeimport" : "qx.bom.client.Stylesheet.getRemoveImport", "html.element.contains" : "qx.bom.client.Html.getContains", "html.element.compareDocumentPosition" : "qx.bom.client.Html.getCompareDocumentPosition", "html.element.textcontent" : "qx.bom.client.Html.getTextContent", "html.image.naturaldimensions" : "qx.bom.client.Html.getNaturalDimensions", "html.history.state" : "qx.bom.client.Html.getHistoryState", "json" : "qx.bom.client.Json.getJson", "css.textoverflow" : "qx.bom.client.Css.getTextOverflow", "css.placeholder" : "qx.bom.client.Css.getPlaceholder", "css.borderradius" : "qx.bom.client.Css.getBorderRadius", "css.borderimage" : "qx.bom.client.Css.getBorderImage", "css.borderimage.standardsyntax" : "qx.bom.client.Css.getBorderImageSyntax", "css.boxshadow" : "qx.bom.client.Css.getBoxShadow", "css.gradient.linear" : "qx.bom.client.Css.getLinearGradient", "css.gradient.filter" : "qx.bom.client.Css.getFilterGradient", "css.gradient.radial" : "qx.bom.client.Css.getRadialGradient", "css.gradient.legacywebkit" : "qx.bom.client.Css.getLegacyWebkitGradient", "css.boxmodel" : "qx.bom.client.Css.getBoxModel", "css.rgba" : "qx.bom.client.Css.getRgba", "css.userselect" : "qx.bom.client.Css.getUserSelect", "css.userselect.none" : "qx.bom.client.Css.getUserSelectNone", "css.usermodify" : "qx.bom.client.Css.getUserModify", "css.appearance" : "qx.bom.client.Css.getAppearance", "css.float" : "qx.bom.client.Css.getFloat", "css.boxsizing" : "qx.bom.client.Css.getBoxSizing", "css.animation" : "qx.bom.client.CssAnimation.getSupport", "css.animation.requestframe" : "qx.bom.client.CssAnimation.getRequestAnimationFrame", "css.transform" : "qx.bom.client.CssTransform.getSupport", "css.transform.3d" : "qx.bom.client.CssTransform.get3D", "css.inlineblock" : "qx.bom.client.Css.getInlineBlock", "css.opacity" : "qx.bom.client.Css.getOpacity", "css.overflowxy" : "qx.bom.client.Css.getOverflowXY", // @deprecated {2.1} "css.textShadow" : "qx.bom.client.Css.getTextShadow", "css.textShadow.filter" : "qx.bom.client.Css.getFilterTextShadow", "phonegap" : "qx.bom.client.PhoneGap.getPhoneGap", "phonegap.notification" : "qx.bom.client.PhoneGap.getNotification", "xml.implementation" : "qx.bom.client.Xml.getImplementation", "xml.domparser" : "qx.bom.client.Xml.getDomParser", "xml.selectsinglenode" : "qx.bom.client.Xml.getSelectSingleNode", "xml.selectnodes" : "qx.bom.client.Xml.getSelectNodes", "xml.getelementsbytagnamens" : "qx.bom.client.Xml.getElementsByTagNameNS", "xml.domproperties" : "qx.bom.client.Xml.getDomProperties", "xml.attributens" : "qx.bom.client.Xml.getAttributeNS", "xml.createnode" : "qx.bom.client.Xml.getCreateNode", "xml.getqualifieditem" : "qx.bom.client.Xml.getQualifiedItem", "xml.createelementns" : "qx.bom.client.Xml.getCreateElementNS" }, /** * The default accessor for the checks. It returns the value the current * environment has for the given key. The key could be something like * "qx.debug", "css.textoverflow" or "io.ssl". A complete list of * checks can be found in the class comment of this class. * * Please keep in mind that the result is cached. If you want to run the * check function again in case something could have been changed, take a * look at the {@link #invalidateCacheKey} function. * * @param key {String} The name of the check you want to query. * @return {var} The stored value depending on the given key. * (Details in the class doc) */ get : function(key){ if(qx.Bootstrap.DEBUG){ // @deprecated {2.1} if(key == "css.overflowxy"){ qx.Bootstrap.warn("The environment key 'css.overflowxy' is deprecated."); }; // @deprecated {2.1} if(key == "ecmascript.stacktrace"){ qx.Bootstrap.warn("The environment key 'ecmascript.stacktrace' is now 'ecmascript.error.stacktrace'."); key = "ecmascript.error.stacktrace"; }; }; // check the cache if(this.__cache[key] != undefined){ return this.__cache[key]; }; // search for a matching check var check = this._checks[key]; if(check){ // execute the check and write the result in the cache var value = check(); this.__cache[key] = value; return value; }; // try class lookup var classAndMethod = this._getClassNameFromEnvKey(key); if(classAndMethod[0] != undefined){ var clazz = classAndMethod[0]; var method = classAndMethod[1]; var value = clazz[method](); // call the check method this.__cache[key] = value; return value; }; // debug flag if(qx.Bootstrap.DEBUG){ qx.Bootstrap.warn(key + " is not a valid key. Please see the API-doc of " + "qx.core.Environment for a list of predefined keys."); qx.Bootstrap.trace(this); }; }, /** * Maps an environment key to a check class and method name. * * @param key {String} The name of the check you want to query. * @return {Array} [className, methodName] of * the corresponding implementation. */ _getClassNameFromEnvKey : function(key){ var envmappings = this._checksMap; if(envmappings[key] != undefined){ var implementation = envmappings[key]; // separate class from method var lastdot = implementation.lastIndexOf("."); if(lastdot > -1){ var classname = implementation.slice(0, lastdot); var methodname = implementation.slice(lastdot + 1); var clazz = qx.Bootstrap.getByName(classname); if(clazz != undefined){ return [clazz, methodname]; }; }; }; return [undefined, undefined]; }, /** * Invokes the callback as soon as the check has been done. If no check * could be found, a warning will be printed. * * @param key {String} The key of the asynchronous check. * @param callback {Function} The function to call as soon as the check is * done. The function should have one argument which is the result of the * check. * @param self {var} The context to use when invoking the callback. */ getAsync : function(key, callback, self){ // check the cache var env = this; if(this.__cache[key] != undefined){ // force async behavior window.setTimeout(function(){ callback.call(self, env.__cache[key]); }, 0); return; }; var check = this._asyncChecks[key]; if(check){ check(function(result){ env.__cache[key] = result; callback.call(self, result); }); return; }; // try class lookup var classAndMethod = this._getClassNameFromEnvKey(key); if(classAndMethod[0] != undefined){ var clazz = classAndMethod[0]; var method = classAndMethod[1]; clazz[method](function(result){ // call the check method env.__cache[key] = result; callback.call(self, result); }); return; }; // debug flag if(qx.Bootstrap.DEBUG){ qx.Bootstrap.warn(key + " is not a valid key. Please see the API-doc of " + "qx.core.Environment for a list of predefined keys."); qx.Bootstrap.trace(this); }; }, /** * Returns the proper value dependent on the check for the given key. * * @param key {String} The name of the check the select depends on. * @param values {Map} A map containing the values which should be returned * in any case. The "default" key could be used as a catch all statement. * @return {var} The value which is stored in the map for the given * check of the key. */ select : function(key, values){ return this.__pickFromValues(this.get(key), values); }, /** * Selects the proper function dependent on the asynchronous check. * * @param key {String} The key for the async check. * @param values {Map} A map containing functions. The map keys should * contain all possibilities which could be returned by the given check * key. The "default" key could be used as a catch all statement. * The called function will get one parameter, the result of the query. * @param self {var} The context which should be used when calling the * method in the values map. */ selectAsync : function(key, values, self){ this.getAsync(key, function(result){ var value = this.__pickFromValues(key, values); value.call(self, result); }, this); }, /** * Internal helper which tries to pick the given key from the given values * map. If that key is not found, it tries to use a key named "default". * If there is also no default key, it prints out a warning and returns * undefined. * * @param key {String} The key to search for in the values. * @param values {Map} A map containing some keys. * @return {var} The value stored as values[key] usually. */ __pickFromValues : function(key, values){ var value = values[key]; if(values.hasOwnProperty(key)){ return value; }; // check for piped values for(var id in values){ if(id.indexOf("|") != -1){ var ids = id.split("|"); for(var i = 0;i < ids.length;i++){ if(ids[i] == key){ return values[id]; }; }; }; }; if(values["default"] !== undefined){ return values["default"]; }; if(qx.Bootstrap.DEBUG){ throw new Error('No match for variant "' + key + '" (' + (typeof key) + ' type)' + ' in variants [' + qx.Bootstrap.keys(values) + '] found, and no default ("default") given'); }; }, /** * Takes a given map containing the check names as keys and converts * the map to an array only containing the values for check evaluating * to <code>true</code>. This is especially handy for conditional * includes of mixins. * @param map {Map} A map containing check names as keys and values. * @return {Array} An array containing the values. */ filter : function(map){ var returnArray = []; for(var check in map){ if(this.get(check)){ returnArray.push(map[check]); }; }; return returnArray; }, /** * Invalidates the cache for the given key. * * @param key {String} The key of the check. */ invalidateCacheKey : function(key){ delete this.__cache[key]; }, /** * Add a check to the environment class. If there is already a check * added for the given key, the add will be ignored. * * @param key {String} The key for the check e.g. html.featurexyz. * @param check {var} It could be either a function or a simple value. * The function should be responsible for the check and should return the * result of the check. */ add : function(key, check){ // ignore already added checks. if(this._checks[key] == undefined){ // add functions directly if(check instanceof Function){ this._checks[key] = check; } else { this._checks[key] = this.__createCheck(check); }; }; }, /** * Adds an asynchronous check to the environment. If there is already a check * added for the given key, the add will be ignored. * * @param key {String} The key of the check e.g. html.featureabc * @param check {Function} A function which should check for a specific * environment setting in an asynchronous way. The method should take two * arguments. First one is the callback and the second one is the context. */ addAsync : function(key, check){ if(this._checks[key] == undefined){ this._asyncChecks[key] = check; }; }, /** * Returns all currently defined synchronous checks. * * @internal * @return {Map} The map of synchronous checks */ getChecks : function(){ return this._checks; }, /** * Returns all currently defined asynchronous checks. * * @internal * @return {Map} The map of asynchronous checks */ getAsyncChecks : function(){ return this._asyncChecks; }, /** * Initializer for the default values of the framework settings. */ _initDefaultQxValues : function(){ // an always-true key (e.g. for use in qx.core.Environment.filter() calls) this.add("true", function(){ return true; }); // old settings this.add("qx.allowUrlSettings", function(){ return false; }); this.add("qx.allowUrlVariants", function(){ return false; }); this.add("qx.debug.property.level", function(){ return 0; }); // old variants // make sure to reflect all changes to qx.debug here in the bootstrap class! this.add("qx.debug", function(){ return true; }); this.add("qx.debug.ui.queue", function(){ return true; }); this.add("qx.aspects", function(){ return false; }); this.add("qx.dynlocale", function(){ return true; }); this.add("qx.mobile.emulatetouch", function(){ return false; }); this.add("qx.mobile.nativescroll", function(){ return false; }); this.add("qx.blankpage", function(){ return "qx/static/blank.html"; }); this.add("qx.dynamicmousewheel", function(){ return true; }); this.add("qx.debug.databinding", function(){ return false; }); this.add("qx.debug.dispose", function(){ return false; }); // generator optimization vectors this.add("qx.optimization.basecalls", function(){ return false; }); this.add("qx.optimization.comments", function(){ return false; }); this.add("qx.optimization.privates", function(){ return false; }); this.add("qx.optimization.strings", function(){ return false; }); this.add("qx.optimization.variables", function(){ return false; }); this.add("qx.optimization.variants", function(){ return false; }); // qooxdoo modules this.add("module.databinding", function(){ return true; }); this.add("module.logger", function(){ return true; }); this.add("module.property", function(){ return true; }); this.add("module.events", function(){ return true; }); }, /** * Import checks from global qx.$$environment into the Environment class. */ __importFromGenerator : function(){ // import the environment map if(qx && qx.$$environment){ for(var key in qx.$$environment){ var value = qx.$$environment[key]; this._checks[key] = this.__createCheck(value); }; }; }, /** * Checks the URL for environment settings and imports these into the * Environment class. */ __importFromUrl : function(){ if(window.document && window.document.location){ var urlChecks = window.document.location.search.slice(1).split("&"); for(var i = 0;i < urlChecks.length;i++){ var check = urlChecks[i].split(":"); if(check.length != 3 || check[0] != "qxenv"){ continue; }; var key = check[1]; var value = decodeURIComponent(check[2]); // implicit type conversion if(value == "true"){ value = true; } else if(value == "false"){ value = false; } else if(/^(\d|\.)+$/.test(value)){ value = parseFloat(value); };; this._checks[key] = this.__createCheck(value); }; }; }, /** * Internal helper which creates a function returning the given value. * * @param value {var} The value which should be returned. * @return {Function} A function which could be used by a test. */ __createCheck : function(value){ return qx.Bootstrap.bind(function(value){ return value; }, null, value); } }, defer : function(statics){ // create default values for the environment class statics._initDefaultQxValues(); // load the checks from the generator statics.__importFromGenerator(); // load the checks from the url if(statics.get("qx.allowUrlSettings") === true){ statics.__importFromUrl(); }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Martin Wittemann (martinwittemann) ====================================================================== This class contains code from: Copyright: 2011 Pocket Widget S.L., Spain, http://www.pocketwidget.com License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php Authors: * Javier Martinez Villacampa ************************************************************************ */ /** * This class comes with all relevant information regarding * the client's engine. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.Engine", { // General: http://en.wikipedia.org/wiki/Browser_timeline // Webkit: http://developer.apple.com/internet/safari/uamatrix.html // Firefox: http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox // Maple: http://www.scribd.com/doc/46675822/2011-SDK2-0-Maple-Browser-Specification-V1-00 statics : { /** * Returns the version of the engine. * * @return {String} The version number of the current engine. * @internal */ getVersion : function(){ var agent = window.navigator.userAgent; var version = ""; if(qx.bom.client.Engine.__isOpera()){ // Opera has a special versioning scheme, where the second part is combined // e.g. 8.54 which should be handled like 8.5.4 to be compatible to the // common versioning system used by other browsers if(/Opera[\s\/]([0-9]+)\.([0-9])([0-9]*)/.test(agent)){ // opera >= 10 has as a first verison 9.80 and adds the proper version // in a separate "Version/" postfix // http://my.opera.com/chooseopera/blog/2009/05/29/changes-in-operas-user-agent-string-format if(agent.indexOf("Version/") != -1){ var match = agent.match(/Version\/(\d+)\.(\d+)/); // ignore the first match, its the whole version string version = match[1] + "." + match[2].charAt(0) + "." + match[2].substring(1, match[2].length); } else { version = RegExp.$1 + "." + RegExp.$2; if(RegExp.$3 != ""){ version += "." + RegExp.$3; }; }; }; } else if(qx.bom.client.Engine.__isWebkit()){ if(/AppleWebKit\/([^ ]+)/.test(agent)){ version = RegExp.$1; // We need to filter these invalid characters var invalidCharacter = RegExp("[^\\.0-9]").exec(version); if(invalidCharacter){ version = version.slice(0, invalidCharacter.index); }; }; } else if(qx.bom.client.Engine.__isGecko() || qx.bom.client.Engine.__isMaple()){ // Parse "rv" section in user agent string if(/rv\:([^\);]+)(\)|;)/.test(agent)){ version = RegExp.$1; }; } else if(qx.bom.client.Engine.__isMshtml()){ if(/MSIE\s+([^\);]+)(\)|;)/.test(agent)){ version = RegExp.$1; // If the IE8 or IE9 is running in the compatibility mode, the MSIE value // is set to an older version, but we need the correct version. The only // way is to compare the trident version. if(version < 8 && /Trident\/([^\);]+)(\)|;)/.test(agent)){ if(RegExp.$1 == "4.0"){ version = "8.0"; } else if(RegExp.$1 == "5.0"){ version = "9.0"; }; }; }; } else { var failFunction = window.qxFail; if(failFunction && typeof failFunction === "function"){ version = failFunction().FULLVERSION; } else { version = "1.9.0.0"; qx.Bootstrap.warn("Unsupported client: " + agent + "! Assumed gecko version 1.9.0.0 (Firefox 3.0)."); }; };;; return version; }, /** * Returns the name of the engine. * * @return {String} The name of the current engine. * @internal */ getName : function(){ var name; if(qx.bom.client.Engine.__isOpera()){ name = "opera"; } else if(qx.bom.client.Engine.__isWebkit()){ name = "webkit"; } else if(qx.bom.client.Engine.__isGecko() || qx.bom.client.Engine.__isMaple()){ name = "gecko"; } else if(qx.bom.client.Engine.__isMshtml()){ name = "mshtml"; } else { // check for the fallback var failFunction = window.qxFail; if(failFunction && typeof failFunction === "function"){ name = failFunction().NAME; } else { name = "gecko"; qx.Bootstrap.warn("Unsupported client: " + window.navigator.userAgent + "! Assumed gecko version 1.9.0.0 (Firefox 3.0)."); }; };;; return name; }, /** * Internal helper for checking for opera. * @return {Boolean} true, if its opera. */ __isOpera : function(){ return window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; }, /** * Internal helper for checking for webkit. * @return {Boolean} true, if its webkit. */ __isWebkit : function(){ return window.navigator.userAgent.indexOf("AppleWebKit/") != -1; }, /** * Internal helper for checking for Maple . * Maple is used in Samsung SMART TV 2010-2011 models. It's based on Gecko * engine 1.8.1.11. * @return {Boolean} true, if its maple. */ __isMaple : function(){ return window.navigator.userAgent.indexOf("Maple") != -1; }, /** * Internal helper for checking for gecko. * @return {Boolean} true, if its gecko. */ __isGecko : function(){ return window.controllers && window.navigator.product === "Gecko" && window.navigator.userAgent.indexOf("Maple") == -1; }, /** * Internal helper to check for MSHTML. * @return {Boolean} true, if its MSHTML. */ __isMshtml : function(){ return window.navigator.cpuClass && /MSIE\s+([^\);]+)(\)|;)/.test(window.navigator.userAgent); } }, defer : function(statics){ qx.core.Environment.add("engine.version", statics.getVersion); qx.core.Environment.add("engine.name", statics.getName); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * The main purpose of this class to hold all checks about ECMAScript. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.EcmaScript", { statics : { /** * Returns the name of the Error object property that holds stack trace * information or null if the client does not provide any. * * @internal * @return {String|null} <code>stack</code>, <code>stacktrace</code> or * <code>null</code> */ getStackTrace : function(){ var propName; var e = new Error("e"); propName = e.stack ? "stack" : e.stacktrace ? "stacktrace" : null; // only thrown errors have the stack property in IE10 and PhantomJS if(!propName){ try{ throw e; } catch(ex) { e = ex; }; }; return e.stacktrace ? "stacktrace" : e.stack ? "stack" : null; }, /** * Checks if 'indexOf' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayIndexOf : function(){ return !!Array.prototype.indexOf; }, /** * Checks if 'lastIndexOf' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayLastIndexOf : function(){ return !!Array.prototype.lastIndexOf; }, /** * Checks if 'forEach' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayForEach : function(){ return !!Array.prototype.forEach; }, /** * Checks if 'filter' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayFilter : function(){ return !!Array.prototype.filter; }, /** * Checks if 'map' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayMap : function(){ return !!Array.prototype.map; }, /** * Checks if 'some' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArraySome : function(){ return !!Array.prototype.some; }, /** * Checks if 'every' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayEvery : function(){ return !!Array.prototype.every; }, /** * Checks if 'reduce' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayReduce : function(){ return !!Array.prototype.reduce; }, /** * Checks if 'reduceRight' is supported on the Array object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getArrayReduceRight : function(){ return !!Array.prototype.reduceRight; }, /** * Checks if 'toString' is supported on the Error object and * its working as expected. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getErrorToString : function(){ return typeof Error.prototype.toString == "function" && Error.prototype.toString() !== "[object Error]"; }, /** * Checks if 'bind' is supported on the Function object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getFunctionBind : function(){ return typeof Function.prototype.bind === "function"; }, /** * Checks if 'keys' is supported on the Object object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getObjectKeys : function(){ return !!Object.keys; }, /** * Checks if 'now' is supported on the Date object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getDateNow : function(){ return !!Date.now; }, /** * Checks if 'trim' is supported on the String object. * @internal * @return {Boolean} <code>true</code>, if the method is available. */ getStringTrim : function(){ return typeof String.prototype.trim === "function"; } }, defer : function(statics){ // array polyfill qx.core.Environment.add("ecmascript.array.indexof", statics.getArrayIndexOf); qx.core.Environment.add("ecmascript.array.lastindexof", statics.getArrayLastIndexOf); qx.core.Environment.add("ecmascript.array.foreach", statics.getArrayForEach); qx.core.Environment.add("ecmascript.array.filter", statics.getArrayFilter); qx.core.Environment.add("ecmascript.array.map", statics.getArrayMap); qx.core.Environment.add("ecmascript.array.some", statics.getArraySome); qx.core.Environment.add("ecmascript.array.every", statics.getArrayEvery); qx.core.Environment.add("ecmascript.array.reduce", statics.getArrayReduce); qx.core.Environment.add("ecmascript.array.reduceright", statics.getArrayReduceRight); // date polyfill qx.core.Environment.add("ecmascript.date.now", statics.getDateNow); // error bugfix qx.core.Environment.add("ecmascript.error.toString", statics.getErrorToString); qx.core.Environment.add("ecmascript.error.stacktrace", statics.getStackTrace); // function polyfill qx.core.Environment.add("ecmascript.function.bind", statics.getFunctionBind); // object polyfill qx.core.Environment.add("ecmascript.object.keys", statics.getObjectKeys); // string polyfill qx.core.Environment.add("ecmascript.string.trim", statics.getStringTrim); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class takes care of the normalization of the native 'Array' object. * Therefore it checks the availability of the following methods and appends * it, if not available. This means you can use the methods during * development in every browser. For usage samples, check out the attached links. * * *indexOf*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.14">Annotated ES5 Spec</a> * * *lastIndexOf*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.15">Annotated ES5 Spec</a> * * *forEach*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.18">Annotated ES5 Spec</a> * * *filter*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.20">Annotated ES5 Spec</a> * * *map*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.19">Annotated ES5 Spec</a> * * *some*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.17">Annotated ES5 Spec</a> * * *every*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.16">Annotated ES5 Spec</a> * * *reduce*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.21">Annotated ES5 Spec</a> * * *reduceRight*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduceRight">MDN documentation</a> | * <a href="http://es5.github.com/#x15.4.4.22">Annotated ES5 Spec</a> * * Here is a little sample of how to use <code>indexOf</code> e.g. * <pre class="javascript">var a = ["a", "b", "c"]; * a.indexOf("b"); // returns 1</pre> */ qx.Bootstrap.define("qx.lang.normalize.Array", { defer : function(){ // fix indexOf if(!qx.core.Environment.get("ecmascript.array.indexof")){ Array.prototype.indexOf = function(searchElement, fromIndex){ if(fromIndex == null){ fromIndex = 0; } else if(fromIndex < 0){ fromIndex = Math.max(0, this.length + fromIndex); }; for(var i = fromIndex;i < this.length;i++){ if(this[i] === searchElement){ return i; }; }; return -1; }; }; // lastIndexOf if(!qx.core.Environment.get("ecmascript.array.lastindexof")){ Array.prototype.lastIndexOf = function(searchElement, fromIndex){ if(fromIndex == null){ fromIndex = this.length - 1; } else if(fromIndex < 0){ fromIndex = Math.max(0, this.length + fromIndex); }; for(var i = fromIndex;i >= 0;i--){ if(this[i] === searchElement){ return i; }; }; return -1; }; }; // forEach if(!qx.core.Environment.get("ecmascript.array.foreach")){ Array.prototype.forEach = function(callback, obj){ var l = this.length; for(var i = 0;i < l;i++){ var value = this[i]; if(value !== undefined){ callback.call(obj || window, value, i, this); }; }; }; }; // filter if(!qx.core.Environment.get("ecmascript.array.filter")){ Array.prototype.filter = function(callback, obj){ var res = []; var l = this.length; for(var i = 0;i < l;i++){ var value = this[i]; if(value !== undefined){ if(callback.call(obj || window, value, i, this)){ res.push(this[i]); }; }; }; return res; }; }; // map if(!qx.core.Environment.get("ecmascript.array.map")){ Array.prototype.map = function(callback, obj){ var res = []; var l = this.length; for(var i = 0;i < l;i++){ var value = this[i]; if(value !== undefined){ res[i] = callback.call(obj || window, value, i, this); }; }; return res; }; }; // some if(!qx.core.Environment.get("ecmascript.array.some")){ Array.prototype.some = function(callback, obj){ var l = this.length; for(var i = 0;i < l;i++){ var value = this[i]; if(value !== undefined){ if(callback.call(obj || window, value, i, this)){ return true; }; }; }; return false; }; }; // every if(!qx.core.Environment.get("ecmascript.array.every")){ Array.prototype.every = function(callback, obj){ var l = this.length; for(var i = 0;i < l;i++){ var value = this[i]; if(value !== undefined){ if(!callback.call(obj || window, value, i, this)){ return false; }; }; }; return true; }; }; // reduce if(!qx.core.Environment.get("ecmascript.array.reduce")){ Array.prototype.reduce = function(callback, init){ if(typeof callback !== "function"){ throw new TypeError("First argument is not callable"); }; if(init === undefined && this.length === 0){ throw new TypeError("Length is 0 and no second argument given"); }; var ret = init === undefined ? this[0] : init; for(var i = init === undefined ? 1 : 0;i < this.length;i++){ if(i in this){ ret = callback.call(undefined, ret, this[i], i, this); }; }; return ret; }; }; // reduceRight if(!qx.core.Environment.get("ecmascript.array.reduceright")){ Array.prototype.reduceRight = function(callback, init){ if(typeof callback !== "function"){ throw new TypeError("First argument is not callable"); }; if(init === undefined && this.length === 0){ throw new TypeError("Length is 0 and no second argument given"); }; var ret = init === undefined ? this[this.length - 1] : init; for(var i = init === undefined ? this.length - 2 : this.length - 1;i >= 0;i--){ if(i in this){ ret = callback.call(undefined, ret, this[i], i, this); }; }; return ret; }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2007-2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Fabian Jakobs (fjakobs) ====================================================================== This class uses ideas and code snipplets presented at http://webreflection.blogspot.com/2008/05/habemus-array-unlocked-length-in-ie8.html http://webreflection.blogspot.com/2008/05/stack-and-arrayobject-how-to-create.html Author: Andrea Giammarchi License: MIT: http://www.opensource.org/licenses/mit-license.php ====================================================================== This class uses documentation of the native Array methods from the MDC documentation of Mozilla. License: CC Attribution-Sharealike License: http://creativecommons.org/licenses/by-sa/2.5/ ************************************************************************ */ /* ************************************************************************ #require(qx.bom.client.Engine) #require(qx.lang.normalize.Array) ************************************************************************ */ /** * This class is the common superclass for most array classes in * qooxdoo. It supports all of the shiny 1.6 JavaScript array features * like <code>forEach</code> and <code>map</code>. * * This class may be instantiated instead of the native Array if * one wants to work with a feature-unified Array instead of the native * one. This class uses native features whereever possible but fills * all missing implementations with custom ones. * * Through the ability to extend from this class one could add even * more utility features on top of it. */ qx.Bootstrap.define("qx.type.BaseArray", { extend : Array, /* ***************************************************************************** CONSTRUCTOR ***************************************************************************** */ /** * Creates a new Array with the given length or the listed elements. * * <pre class="javascript"> * var arr1 = new qx.type.BaseArray(arrayLength); * var arr2 = new qx.type.BaseArray(item0, item1, ..., itemN); * </pre> * * * <code>arrayLength</code>: The initial length of the array. You can access * this value using the length property. If the value specified is not a * number, an array of length 1 is created, with the first element having * the specified value. The maximum length allowed for an * array is 2^32-1, i.e. 4,294,967,295. * * <code>itemN</code>: A value for the element in that position in the * array. When this form is used, the array is initialized with the specified * values as its elements, and the array's length property is set to the * number of arguments. * * @param length_or_items {Integer|var?null} The initial length of the array * OR an argument list of values. */ construct : function(length_or_items){ }, /* ***************************************************************************** MEMBERS ***************************************************************************** */ members : { /** * Converts a base array to a native Array * * @signature function() * @return {Array} The native array */ toArray : null, /** * Returns the current number of items stored in the Array * * @signature function() * @return {Integer} number of items */ valueOf : null, /** * Removes the last element from an array and returns that element. * * This method modifies the array. * * @signature function() * @return {var} The last element of the array. */ pop : null, /** * Adds one or more elements to the end of an array and returns the new length of the array. * * This method modifies the array. * * @signature function(varargs) * @param varargs {var} The elements to add to the end of the array. * @return {Integer} The new array's length */ push : null, /** * Reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first. * * This method modifies the array. * * @signature function() * @return {Array} Returns the modified array (works in place) */ reverse : null, /** * Removes the first element from an array and returns that element. * * This method modifies the array. * * @signature function() * @return {var} The first element of the array. */ shift : null, /** * Sorts the elements of an array. * * This method modifies the array. * * @signature function(compareFunction) * @param compareFunction {Function?null} Specifies a function that defines the sort order. If omitted, * the array is sorted lexicographically (in dictionary order) according to the string conversion of each element. * @return {Array} Returns the modified array (works in place) */ sort : null, /** * Adds and/or removes elements from an array. * * @signature function(index, howMany, varargs) * @param index {Integer} Index at which to start changing the array. If negative, will begin * that many elements from the end. * @param howMany {Integer} An integer indicating the number of old array elements to remove. * If <code>howMany</code> is 0, no elements are removed. In this case, you should specify * at least one new element. * @param varargs {var?null} The elements to add to the array. If you don't specify any elements, * splice simply removes elements from the array. * @return {BaseArray} New array with the removed elements. */ splice : null, /** * Adds one or more elements to the front of an array and returns the new length of the array. * * This method modifies the array. * * @signature function(varargs) * @param varargs {var} The elements to add to the front of the array. * @return {Integer} The new array's length */ unshift : null, /** * Returns a new array comprised of this array joined with other array(s) and/or value(s). * * This method does not modify the array and returns a modified copy of the original. * * @signature function(varargs) * @param varargs {Array|var} Arrays and/or values to concatenate to the resulting array. * @return {qx.type.BaseArray} New array built of the given arrays or values. */ concat : null, /** * Joins all elements of an array into a string. * * @signature function(separator) * @param separator {String} Specifies a string to separate each element of the array. The separator is * converted to a string if necessary. If omitted, the array elements are separated with a comma. * @return {String} The stringified values of all elements divided by the given separator. */ join : null, /** * Extracts a section of an array and returns a new array. * * @signature function(begin, end) * @param begin {Integer} Zero-based index at which to begin extraction. As a negative index, start indicates * an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element * in the sequence. * @param end {Integer?length} Zero-based index at which to end extraction. slice extracts up to but not including end. * <code>slice(1,4)</code> extracts the second element through the fourth element (elements indexed 1, 2, and 3). * As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. * If end is omitted, slice extracts to the end of the sequence. * @return {BaseArray} An new array which contains a copy of the given region. */ slice : null, /** * Returns a string representing the array and its elements. Overrides the Object.prototype.toString method. * * @signature function() * @return {String} The string representation of the array. */ toString : null, /** * Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found. * * @signature function(searchElement, fromIndex) * @param searchElement {var} Element to locate in the array. * @param fromIndex {Integer?0} The index at which to begin the search. Defaults to 0, i.e. the * whole array will be searched. If the index is greater than or equal to the length of the * array, -1 is returned, i.e. the array will not be searched. If negative, it is taken as * the offset from the end of the array. Note that even when the index is negative, the array * is still searched from front to back. If the calculated index is less than 0, the whole * array will be searched. * @return {Integer} The index of the given element */ indexOf : null, /** * Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found. * * @signature function(searchElement, fromIndex) * @param searchElement {var} Element to locate in the array. * @param fromIndex {Integer?length} The index at which to start searching backwards. Defaults to * the array's length, i.e. the whole array will be searched. If the index is greater than * or equal to the length of the array, the whole array will be searched. If negative, it * is taken as the offset from the end of the array. Note that even when the index is * negative, the array is still searched from back to front. If the calculated index is * less than 0, -1 is returned, i.e. the array will not be searched. * @return {Integer} The index of the given element */ lastIndexOf : null, /** * Executes a provided function once per array element. * * <code>forEach</code> executes the provided function (<code>callback</code>) once for each * element present in the array. <code>callback</code> is invoked only for indexes of the array * which have assigned values; it is not invoked for indexes which have been deleted or which * have never been assigned values. * * <code>callback</code> is invoked with three arguments: the value of the element, the index * of the element, and the Array object being traversed. * * If a <code>obj</code> parameter is provided to <code>forEach</code>, it will be used * as the <code>this</code> for each invocation of the <code>callback</code>. If it is not * provided, or is <code>null</code>, the global object associated with <code>callback</code> * is used instead. * * <code>forEach</code> does not mutate the array on which it is called. * * The range of elements processed by <code>forEach</code> is set before the first invocation of * <code>callback</code>. Elements which are appended to the array after the call to * <code>forEach</code> begins will not be visited by <code>callback</code>. If existing elements * of the array are changed, or deleted, their value as passed to <code>callback</code> will be * the value at the time <code>forEach</code> visits them; elements that are deleted are not visited. * * @signature function(callback, obj) * @param callback {Function} Function to execute for each element. * @param obj {Object} Object to use as this when executing callback. */ forEach : null, /** * Creates a new array with all elements that pass the test implemented by the provided * function. * * <code>filter</code> calls a provided <code>callback</code> function once for each * element in an array, and constructs a new array of all the values for which * <code>callback</code> returns a true value. <code>callback</code> is invoked only * for indexes of the array which have assigned values; it is not invoked for indexes * which have been deleted or which have never been assigned values. Array elements which * do not pass the <code>callback</code> test are simply skipped, and are not included * in the new array. * * <code>callback</code> is invoked with three arguments: the value of the element, the * index of the element, and the Array object being traversed. * * If a <code>obj</code> parameter is provided to <code>filter</code>, it will * be used as the <code>this</code> for each invocation of the <code>callback</code>. * If it is not provided, or is <code>null</code>, the global object associated with * <code>callback</code> is used instead. * * <code>filter</code> does not mutate the array on which it is called. The range of * elements processed by <code>filter</code> is set before the first invocation of * <code>callback</code>. Elements which are appended to the array after the call to * <code>filter</code> begins will not be visited by <code>callback</code>. If existing * elements of the array are changed, or deleted, their value as passed to <code>callback</code> * will be the value at the time <code>filter</code> visits them; elements that are deleted * are not visited. * * @signature function(callback, obj) * @param callback {Function} Function to test each element of the array. * @param obj {Object} Object to use as <code>this</code> when executing <code>callback</code>. * @return {BaseArray} The newly created array with all matching elements */ filter : null, /** * Creates a new array with the results of calling a provided function on every element in this array. * * <code>map</code> calls a provided <code>callback</code> function once for each element in an array, * in order, and constructs a new array from the results. <code>callback</code> is invoked only for * indexes of the array which have assigned values; it is not invoked for indexes which have been * deleted or which have never been assigned values. * * <code>callback</code> is invoked with three arguments: the value of the element, the index of the * element, and the Array object being traversed. * * If a <code>obj</code> parameter is provided to <code>map</code>, it will be used as the * <code>this</code> for each invocation of the <code>callback</code>. If it is not provided, or is * <code>null</code>, the global object associated with <code>callback</code> is used instead. * * <code>map</code> does not mutate the array on which it is called. * * The range of elements processed by <code>map</code> is set before the first invocation of * <code>callback</code>. Elements which are appended to the array after the call to <code>map</code> * begins will not be visited by <code>callback</code>. If existing elements of the array are changed, * or deleted, their value as passed to <code>callback</code> will be the value at the time * <code>map</code> visits them; elements that are deleted are not visited. * * @signature function(callback, obj) * @param callback {Function} Function produce an element of the new Array from an element of the current one. * @param obj {Object} Object to use as <code>this</code> when executing <code>callback</code>. * @return {BaseArray} A new array which contains the return values of every item executed through the given function */ map : null, /** * Tests whether some element in the array passes the test implemented by the provided function. * * <code>some</code> executes the <code>callback</code> function once for each element present in * the array until it finds one where <code>callback</code> returns a true value. If such an element * is found, <code>some</code> immediately returns <code>true</code>. Otherwise, <code>some</code> * returns <code>false</code>. <code>callback</code> is invoked only for indexes of the array which * have assigned values; it is not invoked for indexes which have been deleted or which have never * been assigned values. * * <code>callback</code> is invoked with three arguments: the value of the element, the index of the * element, and the Array object being traversed. * * If a <code>obj</code> parameter is provided to <code>some</code>, it will be used as the * <code>this</code> for each invocation of the <code>callback</code>. If it is not provided, or is * <code>null</code>, the global object associated with <code>callback</code> is used instead. * * <code>some</code> does not mutate the array on which it is called. * * The range of elements processed by <code>some</code> is set before the first invocation of * <code>callback</code>. Elements that are appended to the array after the call to <code>some</code> * begins will not be visited by <code>callback</code>. If an existing, unvisited element of the array * is changed by <code>callback</code>, its value passed to the visiting <code>callback</code> will * be the value at the time that <code>some</code> visits that element's index; elements that are * deleted are not visited. * * @signature function(callback, obj) * @param callback {Function} Function to test for each element. * @param obj {Object} Object to use as <code>this</code> when executing <code>callback</code>. * @return {Boolean} Whether at least one elements passed the test */ some : null, /** * Tests whether all elements in the array pass the test implemented by the provided function. * * <code>every</code> executes the provided <code>callback</code> function once for each element * present in the array until it finds one where <code>callback</code> returns a false value. If * such an element is found, the <code>every</code> method immediately returns <code>false</code>. * Otherwise, if <code>callback</code> returned a true value for all elements, <code>every</code> * will return <code>true</code>. <code>callback</code> is invoked only for indexes of the array * which have assigned values; it is not invoked for indexes which have been deleted or which have * never been assigned values. * * <code>callback</code> is invoked with three arguments: the value of the element, the index of * the element, and the Array object being traversed. * * If a <code>obj</code> parameter is provided to <code>every</code>, it will be used as * the <code>this</code> for each invocation of the <code>callback</code>. If it is not provided, * or is <code>null</code>, the global object associated with <code>callback</code> is used instead. * * <code>every</code> does not mutate the array on which it is called. The range of elements processed * by <code>every</code> is set before the first invocation of <code>callback</code>. Elements which * are appended to the array after the call to <code>every</code> begins will not be visited by * <code>callback</code>. If existing elements of the array are changed, their value as passed * to <code>callback</code> will be the value at the time <code>every</code> visits them; elements * that are deleted are not visited. * * @signature function(callback, obj) * @param callback {Function} Function to test for each element. * @param obj {Object} Object to use as <code>this</code> when executing <code>callback</code>. * @return {Boolean} Whether all elements passed the test */ every : null } }); (function(){ function createStackConstructor(stack){ // In IE don't inherit from Array but use an empty object as prototype // and copy the methods from Array if((qx.core.Environment.get("engine.name") == "mshtml")){ Stack.prototype = { length : 0, $$isArray : true }; var args = "pop.push.reverse.shift.sort.splice.unshift.join.slice".split("."); for(var length = args.length;length;){ Stack.prototype[args[--length]] = Array.prototype[args[length]]; }; }; // Remember Array's slice method var slice = Array.prototype.slice; // Fix "concat" method Stack.prototype.concat = function(){ var constructor = this.slice(0); for(var i = 0,length = arguments.length;i < length;i++){ var copy; if(arguments[i] instanceof Stack){ copy = slice.call(arguments[i], 0); } else if(arguments[i] instanceof Array){ copy = arguments[i]; } else { copy = [arguments[i]]; }; constructor.push.apply(constructor, copy); }; return constructor; }; // Fix "toString" method Stack.prototype.toString = function(){ return slice.call(this, 0).toString(); }; // Fix "toLocaleString" Stack.prototype.toLocaleString = function(){ return slice.call(this, 0).toLocaleString(); }; // Fix constructor Stack.prototype.constructor = Stack; // Add JS 1.6 Array features Stack.prototype.indexOf = Array.prototype.indexOf; Stack.prototype.lastIndexOf = Array.prototype.lastIndexOf; Stack.prototype.forEach = Array.prototype.forEach; Stack.prototype.some = Array.prototype.some; Stack.prototype.every = Array.prototype.every; var filter = Array.prototype.filter; var map = Array.prototype.map; // Fix methods which generates a new instance // to return an instance of the same class Stack.prototype.filter = function(){ var ret = new this.constructor; ret.push.apply(ret, filter.apply(this, arguments)); return ret; }; Stack.prototype.map = function(){ var ret = new this.constructor; ret.push.apply(ret, map.apply(this, arguments)); return ret; }; Stack.prototype.slice = function(){ var ret = new this.constructor; ret.push.apply(ret, Array.prototype.slice.apply(this, arguments)); return ret; }; Stack.prototype.splice = function(){ var ret = new this.constructor; ret.push.apply(ret, Array.prototype.splice.apply(this, arguments)); return ret; }; // Add new "toArray" method for convert a base array to a native Array Stack.prototype.toArray = function(){ return Array.prototype.slice.call(this, 0); }; // Add valueOf() to return the length Stack.prototype.valueOf = function(){ return this.length; }; // Return final class return Stack; }; function Stack(length){ if(arguments.length === 1 && typeof length === "number"){ this.length = -1 < length && length === length >> .5 ? length : this.push(length); } else if(arguments.length){ this.push.apply(this, arguments); }; }; function PseudoArray(){ }; PseudoArray.prototype = []; Stack.prototype = new PseudoArray; Stack.prototype.length = 0; qx.type.BaseArray = createStackConstructor(Stack); })(); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #ignore(q) ************************************************************************ */ /** * The Core module's responsibility is to query the DOM for elements and offer * these elements as a collection. The Core module itself does not offer any methods to * work with the collection. These methods are added by the other included modules, * such as Manipulating or Attributes. * * Core also provides the plugin API which allows modules to attach either * static functions to the global <code>q</code> object or define methods on the * collection it returns. * * By default, the core module is assigned to a global module named <code>q</code>. * In case <code>q</code> is already defined, the name <code>qxWeb</code> * is used instead. * * For further details, take a look at the documentation in the * <a href='http://manual.qooxdoo.org/${qxversion}/pages/website.html' target='_blank'>user manual</a>. */ qx.Bootstrap.define("qxWeb", { extend : qx.type.BaseArray, statics : { // internal storage for all initializers __init : [], // internal reference to the used qx namespace $$qx : qx, /** * Internal helper to initialize collections. * * @param arg {var} An array of Elements which will * be initialized as {@link q}. All items in the array which are not * either a window object or a node object will be ignored. * @return {q} A new initialized collection. */ $init : function(arg){ var clean = []; for(var i = 0;i < arg.length;i++){ var isNode = !!(arg[i] && arg[i].nodeType != null); if(isNode){ clean.push(arg[i]); continue; }; var isWindow = !!(arg[i] && arg[i].history && arg[i].location && arg[i].document); if(isWindow){ clean.push(arg[i]); }; }; // check for node or window object var col = qx.lang.Array.cast(clean, qxWeb); for(var i = 0;i < qxWeb.__init.length;i++){ qxWeb.__init[i].call(col); }; return col; }, /** * This is an API for module development and can be used to attach new methods * to {@link q}. * * @param module {Map} A map containing the methods to attach. */ $attach : function(module){ for(var name in module){ { }; qxWeb.prototype[name] = module[name]; }; }, /** * This is an API for module development and can be used to attach new methods * to {@link q}. * * @param module {Map} A map containing the methods to attach. */ $attachStatic : function(module){ for(var name in module){ { }; qxWeb[name] = module[name]; }; }, /** * This is an API for module development and can be used to attach new initialization * methods to {@link q} which will be called when a new collection is * created. * * @param init {Function} The initialization method for a module. */ $attachInit : function(init){ this.__init.push(init); }, /** * Define a new class using the qooxdoo class system. * * @signature function(name, config) * @param name {String?} Name of the class. If null, the class will not be * attached to a namespace. * @param config {Map} Class definition structure. * @return {Function} The defined class. */ define : function(name, config){ if(config == undefined){ config = name; name = null; }; return qx.Bootstrap.define.call(qx.Bootstrap, name, config); } }, /** * Accepts a selector string and returns a set of found items. The optional context * element can be used to reduce the amount of found elements to children of the * context element. * * <a href="http://sizzlejs.com/" target="_blank">Sizzle</a> is used as selector engine. * Check out the <a href="https://github.com/jquery/sizzle/wiki/Sizzle-Home" target="_blank">documentation</a> * for more details. * * @param selector {String|Element|Array} Valid selector (CSS3 + extensions) * or DOM element or Array of DOM Elements. * @param context {Element} Only the children of this element are considered. * @return {q} A collection of DOM elements. */ construct : function(selector, context){ if(!selector && this instanceof qxWeb){ return this; }; if(qx.Bootstrap.isString(selector)){ selector = qx.bom.Selector.query(selector, context); } else if(!(qx.Bootstrap.isArray(selector))){ selector = [selector]; }; return qxWeb.$init(selector); }, members : { /** * Gets a new collection containing only those elements that passed the * given filter. This can be either a selector expression or a filter * function. * * @param selector {String|Function} Selector expression or filter function * @return {q} New collection containing the elements that passed the filter */ filter : function(selector){ if(qx.lang.Type.isFunction(selector)){ return qxWeb.$init(Array.prototype.filter.call(this, selector)); }; return qxWeb.$init(qx.bom.Selector.matches(selector, this)); }, /** * Returns a copy of the collection within the given range. * * @param begin {Number} The index to begin. * @param end {Number?} The index to end. * @return {q} A new collection containing a slice of the original collection. */ slice : function(begin, end){ // Old IEs return an empty array if the second argument is undefined if(end){ return qxWeb.$init(Array.prototype.slice.call(this, begin, end)); } else { return qxWeb.$init(Array.prototype.slice.call(this, begin)); }; }, /** * Removes the given number of items and returns the removed items as a new collection. * This method can also add items. Take a look at the * <a href='https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice' target='_blank'>documentation of MDN</a> for more details. * * @param index {Number} The index to begin. * @param howMany {Number} the amount of items to remove. * @param varargs {var} As many items as you want to add. * @return {q} A new collection containing the removed items. */ splice : function(index, howMany, varargs){ return qxWeb.$init(Array.prototype.splice.apply(this, arguments)); }, /** * Returns a new collection containing the modified elements. For more details, check out the * <a href='https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map' target='_blank'>MDN documentation</a>. * * @param callback {Function} Function which produces the new element. * @param thisarg {var} Context of the callback. * @return {q} New collection containing the elements that passed the filter */ map : function(callback, thisarg){ return qxWeb.$init(Array.prototype.map.apply(this, arguments)); }, /** * Returns a copy of the collection including the given elements. * * @param varargs {var} As many items as you want to add. * @return {q} A new collection containing all items. */ concat : function(varargs){ var clone = Array.prototype.slice.call(this, 0); for(var i = 0;i < arguments.length;i++){ if(arguments[i] instanceof qxWeb){ clone = clone.concat(Array.prototype.slice.call(arguments[i], 0)); } else { clone.push(arguments[i]); }; }; return qxWeb.$init(clone); } }, /** * @lint ignoreUndefined(q) */ defer : function(statics){ if(window.q == undefined){ q = statics; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class takes care of the normalization of the native 'Date' object. * Therefore it checks the availability of the following methods and appends * it, if not available. This means you can use the methods during * development in every browser. For usage samples, check out the attached links. * * *now*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/now">MDN documentation</a> | * <a href="http://es5.github.com/#x15.9.4.4">Annotated ES5 Spec</a> */ qx.Bootstrap.define("qx.lang.normalize.Date", { defer : function(){ // Date.now if(!qx.core.Environment.get("ecmascript.date.now")){ Date.now = function(){ return +new Date(); }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ====================================================================== This class contains code based on the following work: * jQuery http://jquery.com Version 1.3.1 Copyright: 2009 John Resig License: MIT: http://www.opensource.org/licenses/mit-license.php ************************************************************************ */ /* ************************************************************************ #ignore(qx.data.IListData) #ignore(qx.Class) #require(qx.lang.normalize.Date) ************************************************************************ */ /** * Static helper functions for arrays with a lot of often used convenience * methods like <code>remove</code> or <code>contains</code>. * * The native JavaScript Array is not modified by this class. However, * there are modifications to the native Array in {@link qx.lang.normalize.Array} for * browsers that do not support certain JavaScript features natively . */ qx.Bootstrap.define("qx.lang.Array", { statics : { /** * Converts array like constructions like the <code>argument</code> object, * node collections like the ones returned by <code>getElementsByTagName</code> * or extended array objects like <code>qx.type.BaseArray</code> to an * native Array instance. * * @deprecated {2.1} Please use cast with 'Array' as constructor. * @param object {var} any array like object * @param offset {Integer?0} position to start from * @return {Array} New array with the content of the incoming object */ toArray : function(object, offset){ { }; return this.cast(object, Array, offset); }, /** * Converts an array like object to any other array like * object. * * Attention: The returned array may be same * instance as the incoming one if the constructor is identical! * * @param object {var} any array-like object * @param constructor {Function} constructor of the new instance * @param offset {Integer?0} position to start from * @return {Array} the converted array */ cast : function(object, constructor, offset){ if(object.constructor === constructor){ return object; }; if(qx.data && qx.data.IListData){ if(qx.Class && qx.Class.hasInterface(object, qx.data.IListData)){ var object = object.toArray(); }; }; // Create from given constructor var ret = new constructor; // Some collections in mshtml are not able to be sliced. // These lines are a special workaround for this client. if((qx.core.Environment.get("engine.name") == "mshtml")){ if(object.item){ for(var i = offset || 0,l = object.length;i < l;i++){ ret.push(object[i]); }; return ret; }; }; // Copy over items if(Object.prototype.toString.call(object) === "[object Array]" && offset == null){ ret.push.apply(ret, object); } else { ret.push.apply(ret, Array.prototype.slice.call(object, offset || 0)); }; return ret; }, /** * Convert an arguments object into an array. * * @param args {arguments} arguments object * @param offset {Integer?0} position to start from * @return {Array} a newly created array (copy) with the content of the arguments object. */ fromArguments : function(args, offset){ return Array.prototype.slice.call(args, offset || 0); }, /** * Convert a (node) collection into an array * * @param coll {var} node collection * @return {Array} a newly created array (copy) with the content of the node collection. */ fromCollection : function(coll){ // The native Array.slice cannot be used with some Array-like objects // including NodeLists in older IEs if((qx.core.Environment.get("engine.name") == "mshtml")){ if(coll.item){ var arr = []; for(var i = 0,l = coll.length;i < l;i++){ arr[i] = coll[i]; }; return arr; }; }; return Array.prototype.slice.call(coll, 0); }, /** * Expand shorthand definition to a four element list. * This is an utility function for padding/margin and all other shorthand handling. * * @param input {Array} arr with one to four elements * @return {Array} an arr with four elements */ fromShortHand : function(input){ var len = input.length; var result = qx.lang.Array.clone(input); // Copy Values (according to the length) switch(len){case 1: result[1] = result[2] = result[3] = result[0]; break;case 2: result[2] = result[0];// no break here case 3: result[3] = result[1];}; // Return list with 4 items return result; }, /** * Return a copy of the given array * * @param arr {Array} the array to copy * @return {Array} copy of the array */ clone : function(arr){ return arr.concat(); }, /** * Insert an element at a given position into the array * * @param arr {Array} the array * @param obj {var} the element to insert * @param i {Integer} position where to insert the element into the array * @return {Array} the array */ insertAt : function(arr, obj, i){ arr.splice(i, 0, obj); return arr; }, /** * Insert an element into the array before a given second element. * * @param arr {Array} the array * @param obj {var} object to be inserted * @param obj2 {var} insert obj1 before this object * @return {Array} the array */ insertBefore : function(arr, obj, obj2){ var i = arr.indexOf(obj2); if(i == -1){ arr.push(obj); } else { arr.splice(i, 0, obj); }; return arr; }, /** * Insert an element into the array after a given second element. * * @param arr {Array} the array * @param obj {var} object to be inserted * @param obj2 {var} insert obj1 after this object * @return {Array} the array */ insertAfter : function(arr, obj, obj2){ var i = arr.indexOf(obj2); if(i == -1 || i == (arr.length - 1)){ arr.push(obj); } else { arr.splice(i + 1, 0, obj); }; return arr; }, /** * Remove an element from the array at the given index * * @param arr {Array} the array * @param i {Integer} index of the element to be removed * @return {var} The removed element. */ removeAt : function(arr, i){ return arr.splice(i, 1)[0]; }, /** * Remove all elements from the array * * @param arr {Array} the array * @return {Array} empty array */ removeAll : function(arr){ arr.length = 0; return this; }, /** * Append the elements of an array to the array * * @param arr1 {Array} the array * @param arr2 {Array} the elements of this array will be appended to other one * @return {Array} The modified array. * @throws {Error} if one of the arguments is not an array */ append : function(arr1, arr2){ { }; Array.prototype.push.apply(arr1, arr2); return arr1; }, /** * Modifies the first array as it removes all elements * which are listed in the second array as well. * * @param arr1 {Array} the array * @param arr2 {Array} the elements of this array will be excluded from the other one * @return {Array} The modified array. * @throws {Error} if one of the arguments is not an array */ exclude : function(arr1, arr2){ { }; for(var i = 0,il = arr2.length,index;i < il;i++){ index = arr1.indexOf(arr2[i]); if(index != -1){ arr1.splice(index, 1); }; }; return arr1; }, /** * Remove an element from the array. * * @param arr {Array} the array * @param obj {var} element to be removed from the array * @return {var} the removed element */ remove : function(arr, obj){ var i = arr.indexOf(obj); if(i != -1){ arr.splice(i, 1); return obj; }; }, /** * Whether the array contains the given element * * @param arr {Array} the array * @param obj {var} object to look for * @return {Boolean} whether the arr contains the element */ contains : function(arr, obj){ return arr.indexOf(obj) !== -1; }, /** * Check whether the two arrays have the same content. Checks only the * equality of the arrays' content. * * @param arr1 {Array} first array * @param arr2 {Array} second array * @return {Boolean} Whether the two arrays are equal */ equals : function(arr1, arr2){ var length = arr1.length; if(length !== arr2.length){ return false; }; for(var i = 0;i < length;i++){ if(arr1[i] !== arr2[i]){ return false; }; }; return true; }, /** * Returns the sum of all values in the given array. Supports * numeric values only. * * @param arr {Number[]} Array to process * @return {Number} The sum of all values. */ sum : function(arr){ var result = 0; for(var i = 0,l = arr.length;i < l;i++){ result += arr[i]; }; return result; }, /** * Returns the highest value in the given array. Supports * numeric values only. * * @param arr {Number[]} Array to process * @return {Number | null} The highest of all values or undefined if array is empty. */ max : function(arr){ { }; var i,len = arr.length,result = arr[0]; for(i = 1;i < len;i++){ if(arr[i] > result){ result = arr[i]; }; }; return result === undefined ? null : result; }, /** * Returns the lowest value in the given array. Supports * numeric values only. * * @param arr {Number[]} Array to process * @return {Number | null} The lowest of all values or undefined if array is empty. */ min : function(arr){ { }; var i,len = arr.length,result = arr[0]; for(i = 1;i < len;i++){ if(arr[i] < result){ result = arr[i]; }; }; return result === undefined ? null : result; }, /** * Recreates an array which is free of all duplicate elements from the original. * * This method do not modifies the original array! * * Keep in mind that this methods deletes undefined indexes. * * @param arr {Array} Incoming array * @return {Array} Returns a copy with no duplicates or the original array if no duplicates were found */ unique : function(arr){ var ret = [],doneStrings = { },doneNumbers = { },doneObjects = { }; var value,count = 0; var key = "qx" + Date.now(); var hasNull = false,hasFalse = false,hasTrue = false; // Rebuild array and omit duplicates for(var i = 0,len = arr.length;i < len;i++){ value = arr[i]; // Differ between null, primitives and reference types if(value === null){ if(!hasNull){ hasNull = true; ret.push(value); }; } else if(value === undefined){ } else if(value === false){ if(!hasFalse){ hasFalse = true; ret.push(value); }; } else if(value === true){ if(!hasTrue){ hasTrue = true; ret.push(value); }; } else if(typeof value === "string"){ if(!doneStrings[value]){ doneStrings[value] = 1; ret.push(value); }; } else if(typeof value === "number"){ if(!doneNumbers[value]){ doneNumbers[value] = 1; ret.push(value); }; } else { var hash = value[key]; if(hash == null){ hash = value[key] = count++; }; if(!doneObjects[hash]){ doneObjects[hash] = value; ret.push(value); }; };;;;; }; // Clear object hashs for(var hash in doneObjects){ try{ // TODO: The following delete seems to fail in IE7 delete doneObjects[hash][key]; } catch(ex) { try{ doneObjects[hash][key] = null; } catch(ex1) { throw new Error("Cannot clean-up map entry doneObjects[" + hash + "][" + key + "]"); }; }; }; return ret; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2008-2010 Sebastian Werner, http://sebastian-werner.net License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Fabian Jakobs (fjakobs) * Andreas Ecker (ecker) ====================================================================== This class contains code based on the following work: * Sizzle CSS Selector Engine - v1.8.2 Homepage: http://sizzlejs.com/ Documentation: http://wiki.github.com/jeresig/sizzle Discussion: http://groups.google.com/group/sizzlejs Code: http://github.com/jeresig/sizzle/tree Copyright: (c) 2009, The Dojo Foundation License: MIT: http://www.opensource.org/licenses/mit-license.php ---------------------------------------------------------------------- Copyright (c) 2009 John Resig 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. ---------------------------------------------------------------------- Version: Snapshot taken on 2012-10-02, latest Sizzle commit on 2012-09-20: commit 41a7c2ce9be6c66e0c9b8b15e0a29c8e3ca6fb31 ************************************************************************ */ /** * The selector engine supports virtually all CSS 3 Selectors – this even * includes some parts that are infrequently implemented such as escaped * selectors (<code>.foo\\+bar</code>), Unicode selectors, and results returned * in document order. There are a few notable exceptions to the CSS 3 selector * support: * * * <code>:root</code> * * <code>:target</code> * * <code>:nth-last-child</code> * * <code>:nth-of-type</code> * * <code>:nth-last-of-type</code> * * <code>:first-of-type</code> * * <code>:last-of-type</code> * * <code>:only-of-type</code> * * <code>:lang()</code> * * In addition to the CSS 3 Selectors the engine supports the following * additional selectors or conventions. * * *Changes* * * * <code>:not(a.b)</code>: Supports non-simple selectors in <code>:not()</code> (most browsers only support <code>:not(a)</code>, for example). * * <code>:not(div > p)</code>: Supports full selectors in <code>:not()</code>. * * <code>:not(div, p)</code>: Supports multiple selectors in <code>:not()</code>. * * <code>[NAME=VALUE]</code>: Doesn't require quotes around the specified value in an attribute selector. * * *Additions* * * * <code>[NAME!=VALUE]</code>: Finds all elements whose <code>NAME</code> attribute doesn't match the specified value. Is equivalent to doing <code>:not([NAME=VALUE])</code>. * * <code>:contains(TEXT)</code>: Finds all elements whose textual context contains the word <code>TEXT</code> (case sensitive). * * <code>:header</code>: Finds all elements that are a header element (h1, h2, h3, h4, h5, h6). * * <code>:parent</code>: Finds all elements that contains another element. * * *Positional Selector Additions* * * * <code>:first</code>/</code>:last</code>: Finds the first or last matching element on the page. (e.g. <code>div:first</code> would find the first div on the page, in document order) * * <code>:even</code>/<code>:odd</code>: Finds every other element on the page (counting begins at 0, so <code>:even</code> would match the first element). * * <code>:eq</code>/<code>:nth</code>: Finds the Nth element on the page (e.g. <code>:eq(5)</code> finds the 6th element on the page). * * <code>:lt</code>/<code>:gt</code>: Finds all elements at positions less than or greater than the specified positions. * * *Form Selector Additions* * * * <code>:input</code>: Finds all input elements (includes textareas, selects, and buttons). * * <code>:text</code>, <code>:checkbox</code>, <code>:file</code>, <code>:password</code>, <code>:submit</code>, <code>:image</code>, <code>:reset</code>, <code>:button</code>: Finds the input element with the specified input type (<code>:button</code> also finds button elements). * * Based on Sizzle by John Resig, see: * * * http://sizzlejs.com/ * * For further usage details also have a look at the wiki page at: * * * https://github.com/jquery/sizzle/wiki/Sizzle-Home */ qx.Bootstrap.define("qx.bom.Selector", { statics : { /** * Queries the document for the given selector. Supports all CSS3 selectors * plus some extensions as mentioned in the class description. * * @signature function(selector, context) * @param selector {String} Valid selector (CSS3 + extensions) * @param context {Element} Context element (result elements must be children of this element) * @return {Array} Matching elements */ query : null, /** * Returns an reduced array which only contains the elements from the given * array which matches the given selector * * @signature function(selector, set) * @param selector {String} Selector to filter given set * @param set {Array} List to filter according to given selector * @return {Array} New array containing matching elements */ matches : null } }); /** * Below is the original Sizzle code. Snapshot date is mentioned in the head of * this file. * @lint ignoreUnused(j, rnot, rendsWithNot) */ /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function(window, undefined){ var cachedruns,assertGetIdNotName,Expr,getText,isXML,contains,compile,sortOrder,hasDuplicate,outermostContext,baseHasDuplicate = true,strundefined = "undefined",expando = ("sizcache" + Math.random()).replace(".", ""),Token = String,document = window.document,docElem = document.documentElement,dirruns = 0,done = 0,pop = [].pop,push = [].push,slice = [].slice,// Use a stripped-down indexOf if a native one is unavailable indexOf = [].indexOf || function(elem){ var i = 0,len = this.length; for(;i < len;i++){ if(this[i] === elem){ return i; }; }; return -1; },// Augment a function for special use by Sizzle markFunction = function(fn, value){ fn[expando] = value == null || value; return fn; },createCache = function(){ var cache = { },keys = []; return markFunction(function(key, value){ // Only keep the most recent entries if(keys.push(key) > Expr.cacheLength){ delete cache[keys.shift()]; }; return (cache[key] = value); }, cache); },classCache = createCache(),tokenCache = createCache(),compilerCache = createCache(),// Regex // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]",// http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",// Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace("w", "w#"),// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors operators = "([*^$|!~]?=)",attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",// Prefer arguments not in parens/brackets, // then attribute selectors and non-pseudos (denoted by :), // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",// For matchExpr.POS and matchExpr.needsContext pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),rcombinators = new RegExp("^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*"),rpseudo = new RegExp(pseudos),// Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rnot = /^:not/,rsibling = /[\x20\t\r\n\f]*[+~]/,rendsWithNot = /:not\($/,rheader = /h\d/i,rinputs = /input|select|textarea|button/i,rbackslash = /\\(?!\\)/g,matchExpr = { "ID" : new RegExp("^#(" + characterEncoding + ")"), "CLASS" : new RegExp("^\\.(" + characterEncoding + ")"), "NAME" : new RegExp("^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]"), "TAG" : new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"), "ATTR" : new RegExp("^" + attributes), "PSEUDO" : new RegExp("^" + pseudos), "POS" : new RegExp(pos, "i"), "CHILD" : new RegExp("^:(only|nth|first|last)-child(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), // For use in libraries implementing .is() "needsContext" : new RegExp("^" + whitespace + "*[>+~]|" + pos, "i") },// Support // Used for testing something on an element assert = function(fn){ var div = document.createElement("div"); try{ return fn(div); } catch(e) { return false; }finally{ // release memory in IE div = null; }; },// Check if getElementsByTagName("*") returns only elements assertTagNameNoComments = assert(function(div){ div.appendChild(document.createComment("")); return !div.getElementsByTagName("*").length; }),// Check if getAttribute returns normalized href attributes assertHrefNotNormalized = assert(function(div){ div.innerHTML = "<a href='#'></a>"; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div.firstChild.getAttribute("href") === "#"; }),// Check if attributes should be retrieved by attribute nodes assertAttributes = assert(function(div){ div.innerHTML = "<select></select>"; var type = typeof div.lastChild.getAttribute("multiple"); // IE8 returns a string for some attributes even when not present return type !== "boolean" && type !== "string"; }),// Check if getElementsByClassName can be trusted assertUsableClassName = assert(function(div){ // Opera can't find a second classname (in 9.6) div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; if(!div.getElementsByClassName || !div.getElementsByClassName("e").length){ return false; }; // Safari 3.2 caches class attributes and doesn't catch changes div.lastChild.className = "e"; return div.getElementsByClassName("e").length === 2; }),// Check if getElementById returns elements by name // Check if getElementsByName privileges form controls or returns elements by ID assertUsableName = assert(function(div){ // Inject content div.id = expando + 0; div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; docElem.insertBefore(div, docElem.firstChild); // Test var pass = document.getElementsByName && // buggy browsers will return fewer than the correct 2 document.getElementsByName(expando).length === 2 + // buggy browsers will return more than the correct 0 document.getElementsByName(expando + 0).length; assertGetIdNotName = !document.getElementById(expando); // Cleanup docElem.removeChild(div); return pass; }); // If slice is not available, provide a backup try{ slice.call(docElem.childNodes, 0)[0].nodeType; } catch(e) { slice = function(i){ var elem,results = []; for(;(elem = this[i]);i++){ results.push(elem); }; return results; }; }; function Sizzle(selector, context, results, seed){ results = results || []; context = context || document; var match,elem,xml,m,nodeType = context.nodeType; if(!selector || typeof selector !== "string"){ return results; }; if(nodeType !== 1 && nodeType !== 9){ return []; }; xml = isXML(context); if(!xml && !seed){ if((match = rquickExpr.exec(selector))){ // Speed-up: Sizzle("#ID") if((m = match[1])){ if(nodeType === 9){ elem = context.getElementById(m); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if(elem && elem.parentNode){ // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if(elem.id === m){ results.push(elem); return results; }; } else { return results; }; } else { // Context is not a document if(context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m){ results.push(elem); return results; }; }; } else if(match[2]){ push.apply(results, slice.call(context.getElementsByTagName(selector), 0)); return results; } else if((m = match[3]) && assertUsableClassName && context.getElementsByClassName){ push.apply(results, slice.call(context.getElementsByClassName(m), 0)); return results; };; }; }; // All others return select(selector.replace(rtrim, "$1"), context, results, seed, xml); }; Sizzle.matches = function(expr, elements){ return Sizzle(expr, null, null, elements); }; Sizzle.matchesSelector = function(elem, expr){ return Sizzle(expr, null, null, [elem]).length > 0; }; // Returns a function to use in pseudos for input types function createInputPseudo(type){ return function(elem){ var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; }; // Returns a function to use in pseudos for buttons function createButtonPseudo(type){ return function(elem){ var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; }; // Returns a function to use in pseudos for positionals function createPositionalPseudo(fn){ return markFunction(function(argument){ argument = +argument; return markFunction(function(seed, matches){ var j,matchIndexes = fn([], seed.length, argument),i = matchIndexes.length; // Match elements found at the specified indexes while(i--){ if(seed[(j = matchIndexes[i])]){ seed[j] = !(matches[j] = seed[j]); }; }; }); }); }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function(elem){ var node,ret = "",i = 0,nodeType = elem.nodeType; if(nodeType){ if(nodeType === 1 || nodeType === 9 || nodeType === 11){ // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if(typeof elem.textContent === "string"){ return elem.textContent; } else { // Traverse its children for(elem = elem.firstChild;elem;elem = elem.nextSibling){ ret += getText(elem); }; }; } else if(nodeType === 3 || nodeType === 4){ return elem.nodeValue; }; } else { // If no nodeType, this is expected to be an array for(;(node = elem[i]);i++){ // Do not traverse comment nodes ret += getText(node); }; }; return ret; }; isXML = Sizzle.isXML = function(elem){ // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Element contains another contains = Sizzle.contains = docElem.contains ? function(a, b){ var adown = a.nodeType === 9 ? a.documentElement : a,bup = b && b.parentNode; return a === bup || !!(bup && bup.nodeType === 1 && adown.contains && adown.contains(bup)); } : docElem.compareDocumentPosition ? function(a, b){ return b && !!(a.compareDocumentPosition(b) & 16); } : function(a, b){ while((b = b.parentNode)){ if(b === a){ return true; }; }; return false; }; Sizzle.attr = function(elem, name){ var val,xml = isXML(elem); if(!xml){ name = name.toLowerCase(); }; if((val = Expr.attrHandle[name])){ return val(elem); }; if(xml || assertAttributes){ return elem.getAttribute(name); }; val = elem.getAttributeNode(name); return val ? typeof elem[name] === "boolean" ? elem[name] ? name : null : val.specified ? val.value : null : null; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength : 50, createPseudo : markFunction, match : matchExpr, // IE6/7 return a modified href attrHandle : assertHrefNotNormalized ? { } : { "href" : function(elem){ return elem.getAttribute("href", 2); }, "type" : function(elem){ return elem.getAttribute("type"); } }, find : { "ID" : assertGetIdNotName ? function(id, context, xml){ if(typeof context.getElementById !== strundefined && !xml){ var m = context.getElementById(id); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; }; } : function(id, context, xml){ if(typeof context.getElementById !== strundefined && !xml){ var m = context.getElementById(id); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []; }; }, "TAG" : assertTagNameNoComments ? function(tag, context){ if(typeof context.getElementsByTagName !== strundefined){ return context.getElementsByTagName(tag); }; } : function(tag, context){ var results = context.getElementsByTagName(tag); // Filter out possible comments if(tag === "*"){ var elem,tmp = [],i = 0; for(;(elem = results[i]);i++){ if(elem.nodeType === 1){ tmp.push(elem); }; }; return tmp; }; return results; }, "NAME" : assertUsableName && function(tag, context){ if(typeof context.getElementsByName !== strundefined){ return context.getElementsByName(name); }; }, "CLASS" : assertUsableClassName && function(className, context, xml){ if(typeof context.getElementsByClassName !== strundefined && !xml){ return context.getElementsByClassName(className); }; } }, relative : { ">" : { dir : "parentNode", first : true }, " " : { dir : "parentNode" }, "+" : { dir : "previousSibling", first : true }, "~" : { dir : "previousSibling" } }, preFilter : { "ATTR" : function(match){ match[1] = match[1].replace(rbackslash, ""); // Move the given value to match[3] whether quoted or unquoted match[3] = (match[4] || match[5] || "").replace(rbackslash, ""); if(match[2] === "~="){ match[3] = " " + match[3] + " "; }; return match.slice(0, 4); }, "CHILD" : function(match){ /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 3 xn-component of xn+y argument ([+-]?\d*n|) 4 sign of xn-component 5 x of xn-component 6 sign of y-component 7 y of y-component */ match[1] = match[1].toLowerCase(); if(match[1] === "nth"){ // nth-child requires argument if(!match[2]){ Sizzle.error(match[0]); }; // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[3] = +(match[3] ? match[4] + (match[5] || 1) : 2 * (match[2] === "even" || match[2] === "odd")); match[4] = +((match[6] + match[7]) || match[2] === "odd"); } else if(match[2]){ Sizzle.error(match[0]); }; return match; }, "PSEUDO" : function(match){ var unquoted,excess; if(matchExpr["CHILD"].test(match[0])){ return null; }; if(match[3]){ match[2] = match[3]; } else if((unquoted = match[4])){ // Only check arguments that contain a pseudo if(rpseudo.test(unquoted) && // Get excess from tokenize (recursively) (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)){ // excess is a negative index unquoted = unquoted.slice(0, excess); match[0] = match[0].slice(0, excess); }; match[2] = unquoted; }; // Return only captures needed by the pseudo filter method (type and argument) return match.slice(0, 3); } }, filter : { "ID" : assertGetIdNotName ? function(id){ id = id.replace(rbackslash, ""); return function(elem){ return elem.getAttribute("id") === id; }; } : function(id){ id = id.replace(rbackslash, ""); return function(elem){ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === id; }; }, "TAG" : function(nodeName){ if(nodeName === "*"){ return function(){ return true; }; }; nodeName = nodeName.replace(rbackslash, "").toLowerCase(); return function(elem){ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS" : function(className){ var pattern = classCache[expando][className]; if(!pattern){ pattern = classCache(className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")); }; return function(elem){ return pattern.test(elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || ""); }; }, "ATTR" : function(name, operator, check){ return function(elem, context){ var result = Sizzle.attr(elem, name); if(result == null){ return operator === "!="; }; if(!operator){ return true; }; result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.substr(result.length - check.length) === check : operator === "~=" ? (" " + result + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.substr(0, check.length + 1) === check + "-" : false; }; }, "CHILD" : function(type, argument, first, last){ if(type === "nth"){ return function(elem){ var node,diff,parent = elem.parentNode; if(first === 1 && last === 0){ return true; }; if(parent){ diff = 0; for(node = parent.firstChild;node;node = node.nextSibling){ if(node.nodeType === 1){ diff++; if(elem === node){ break; }; }; }; }; // Incorporate the offset (or cast to NaN), then check against cycle size diff -= last; return diff === first || (diff % first === 0 && diff / first >= 0); }; }; return function(elem){ var node = elem; switch(type){case "only":case "first": while((node = node.previousSibling)){ if(node.nodeType === 1){ return false; }; }; if(type === "first"){ return true; }; node = elem;/* falls through */ case "last": while((node = node.nextSibling)){ if(node.nodeType === 1){ return false; }; }; return true;}; }; }, "PSEUDO" : function(pseudo, argument){ // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args,fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if(fn[expando]){ return fn(argument); }; // But maintain support for old signatures if(fn.length > 1){ args = [pseudo, pseudo, "", argument]; return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches){ var idx,matched = fn(seed, argument),i = matched.length; while(i--){ idx = indexOf.call(seed, matched[i]); seed[idx] = !(matches[idx] = matched[i]); }; }) : function(elem){ return fn(elem, 0, args); }; }; return fn; } }, pseudos : { "not" : markFunction(function(selector){ // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [],results = [],matcher = compile(selector.replace(rtrim, "$1")); return matcher[expando] ? markFunction(function(seed, matches, context, xml){ var elem,unmatched = matcher(seed, null, xml, []),i = seed.length; // Match elements unmatched by `matcher` while(i--){ if((elem = unmatched[i])){ seed[i] = !(matches[i] = elem); }; }; }) : function(elem, context, xml){ input[0] = elem; matcher(input, null, xml, results); return !results.pop(); }; }), "has" : markFunction(function(selector){ return function(elem){ return Sizzle(selector, elem).length > 0; }; }), "contains" : markFunction(function(text){ return function(elem){ return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1; }; }), "enabled" : function(elem){ return elem.disabled === false; }, "disabled" : function(elem){ return elem.disabled === true; }, "checked" : function(elem){ // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected" : function(elem){ // Accessing this property makes selected-by-default // options in Safari work properly if(elem.parentNode){ elem.parentNode.selectedIndex; }; return elem.selected === true; }, "parent" : function(elem){ return !Expr.pseudos["empty"](elem); }, "empty" : function(elem){ // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") var nodeType; elem = elem.firstChild; while(elem){ if(elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4){ return false; }; elem = elem.nextSibling; }; return true; }, "header" : function(elem){ return rheader.test(elem.nodeName); }, "text" : function(elem){ var type,attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && (type = elem.type) === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type); }, // Input types "radio" : createInputPseudo("radio"), "checkbox" : createInputPseudo("checkbox"), "file" : createInputPseudo("file"), "password" : createInputPseudo("password"), "image" : createInputPseudo("image"), "submit" : createButtonPseudo("submit"), "reset" : createButtonPseudo("reset"), "button" : function(elem){ var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "input" : function(elem){ return rinputs.test(elem.nodeName); }, "focus" : function(elem){ var doc = elem.ownerDocument; return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href); }, "active" : function(elem){ return elem === elem.ownerDocument.activeElement; }, // Positional types "first" : createPositionalPseudo(function(matchIndexes, length, argument){ return [0]; }), "last" : createPositionalPseudo(function(matchIndexes, length, argument){ return [length - 1]; }), "eq" : createPositionalPseudo(function(matchIndexes, length, argument){ return [argument < 0 ? argument + length : argument]; }), "even" : createPositionalPseudo(function(matchIndexes, length, argument){ for(var i = 0;i < length;i += 2){ matchIndexes.push(i); }; return matchIndexes; }), "odd" : createPositionalPseudo(function(matchIndexes, length, argument){ for(var i = 1;i < length;i += 2){ matchIndexes.push(i); }; return matchIndexes; }), "lt" : createPositionalPseudo(function(matchIndexes, length, argument){ for(var i = argument < 0 ? argument + length : argument;--i >= 0;){ matchIndexes.push(i); }; return matchIndexes; }), "gt" : createPositionalPseudo(function(matchIndexes, length, argument){ for(var i = argument < 0 ? argument + length : argument;++i < length;){ matchIndexes.push(i); }; return matchIndexes; }) } }; function siblingCheck(a, b, ret){ if(a === b){ return ret; }; var cur = a.nextSibling; while(cur){ if(cur === b){ return -1; }; cur = cur.nextSibling; }; return 1; }; sortOrder = docElem.compareDocumentPosition ? function(a, b){ if(a === b){ hasDuplicate = true; return 0; }; return (!a.compareDocumentPosition || !b.compareDocumentPosition ? a.compareDocumentPosition : a.compareDocumentPosition(b) & 4) ? -1 : 1; } : function(a, b){ // The nodes are identical, we can exit early if(a === b){ hasDuplicate = true; return 0; } else if(a.sourceIndex && b.sourceIndex){ return a.sourceIndex - b.sourceIndex; }; var al,bl,ap = [],bp = [],aup = a.parentNode,bup = b.parentNode,cur = aup; // If the nodes are siblings (or identical) we can do a quick check if(aup === bup){ return siblingCheck(a, b); } else if(!aup){ return -1; } else if(!bup){ return 1; };; // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for comparison while(cur){ ap.unshift(cur); cur = cur.parentNode; }; cur = bup; while(cur){ bp.unshift(cur); cur = cur.parentNode; }; al = ap.length; bl = bp.length; // Start walking down the tree looking for a discrepancy for(var i = 0;i < al && i < bl;i++){ if(ap[i] !== bp[i]){ return siblingCheck(ap[i], bp[i]); }; }; // We ended someplace up the tree so do a sibling check return i === al ? siblingCheck(a, bp[i], -1) : siblingCheck(ap[i], b, 1); }; // Always assume the presence of duplicates if sort doesn't // pass them to our comparison function (as in Google Chrome). [0, 0].sort(sortOrder); baseHasDuplicate = !hasDuplicate; // Document sorting and removing duplicates Sizzle.uniqueSort = function(results){ var elem,i = 1; hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if(hasDuplicate){ for(;(elem = results[i]);i++){ if(elem === results[i - 1]){ results.splice(i--, 1); }; }; }; return results; }; Sizzle.error = function(msg){ throw new Error("Syntax error, unrecognized expression: " + msg); }; function tokenize(selector, parseOnly){ var matched,match,tokens,type,soFar,groups,preFilters,cached = tokenCache[expando][selector]; if(cached){ return parseOnly ? 0 : cached.slice(0); }; soFar = selector; groups = []; preFilters = Expr.preFilter; while(soFar){ // Comma and first run if(!matched || (match = rcomma.exec(soFar))){ if(match){ soFar = soFar.slice(match[0].length); }; groups.push(tokens = []); }; matched = false; // Combinators if((match = rcombinators.exec(soFar))){ tokens.push(matched = new Token(match.shift())); soFar = soFar.slice(matched.length); // Cast descendant combinators to space matched.type = match[0].replace(rtrim, " "); }; // Filters for(type in Expr.filter){ if((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || // The last two arguments here are (context, xml) for backCompat (match = preFilters[type](match, document, true)))){ tokens.push(matched = new Token(match.shift())); soFar = soFar.slice(matched.length); matched.type = type; matched.matches = match; }; }; if(!matched){ break; }; }; // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : // Cache the tokens tokenCache(selector, groups).slice(0); }; function addCombinator(matcher, combinator, base){ var dir = combinator.dir,checkNonElements = base && combinator.dir === "parentNode",doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function(elem, context, xml){ while((elem = elem[dir])){ if(checkNonElements || elem.nodeType === 1){ return matcher(elem, context, xml); }; }; } : // Check against all ancestor/preceding elements function(elem, context, xml){ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if(!xml){ var cache,dirkey = dirruns + " " + doneName + " ",cachedkey = dirkey + cachedruns; while((elem = elem[dir])){ if(checkNonElements || elem.nodeType === 1){ if((cache = elem[expando]) === cachedkey){ return elem.sizset; } else if(typeof cache === "string" && cache.indexOf(dirkey) === 0){ if(elem.sizset){ return elem; }; } else { elem[expando] = cachedkey; if(matcher(elem, context, xml)){ elem.sizset = true; return elem; }; elem.sizset = false; }; }; }; } else { while((elem = elem[dir])){ if(checkNonElements || elem.nodeType === 1){ if(matcher(elem, context, xml)){ return elem; }; }; }; }; }; }; function elementMatcher(matchers){ return matchers.length > 1 ? function(elem, context, xml){ var i = matchers.length; while(i--){ if(!matchers[i](elem, context, xml)){ return false; }; }; return true; } : matchers[0]; }; function condense(unmatched, map, filter, context, xml){ var elem,newUnmatched = [],i = 0,len = unmatched.length,mapped = map != null; for(;i < len;i++){ if((elem = unmatched[i])){ if(!filter || filter(elem, context, xml)){ newUnmatched.push(elem); if(mapped){ map.push(i); }; }; }; }; return newUnmatched; }; function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector){ if(postFilter && !postFilter[expando]){ postFilter = setMatcher(postFilter); }; if(postFinder && !postFinder[expando]){ postFinder = setMatcher(postFinder, postSelector); }; return markFunction(function(seed, results, context, xml){ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones if(seed && postFinder){ return; }; var i,elem,postFilterIn,preMap = [],postMap = [],preexisting = results.length,// Get initial elements from seed or context elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, [], seed),// Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems,matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || (seed ? preFilter : preexisting || postFilter) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if(matcher){ matcher(matcherIn, matcherOut, context, xml); }; // Apply postFilter if(postFilter){ postFilterIn = condense(matcherOut, postMap); postFilter(postFilterIn, [], context, xml); // Un-match failing elements by moving them back to matcherIn i = postFilterIn.length; while(i--){ if((elem = postFilterIn[i])){ matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); }; }; }; // Keep seed and results synchronized if(seed){ // Ignore postFinder because it can't coexist with seed i = preFilter && matcherOut.length; while(i--){ if((elem = matcherOut[i])){ seed[preMap[i]] = !(results[preMap[i]] = elem); }; }; } else { matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); if(postFinder){ postFinder(null, results, matcherOut, xml); } else { push.apply(results, matcherOut); }; }; }); }; function matcherFromTokens(tokens){ var checkContext,matcher,j,len = tokens.length,leadingRelative = Expr.relative[tokens[0].type],implicitRelative = leadingRelative || Expr.relative[" "],i = leadingRelative ? 1 : 0,// The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator(function(elem){ return elem === checkContext; }, implicitRelative, true),matchAnyContext = addCombinator(function(elem){ return indexOf.call(checkContext, elem) > -1; }, implicitRelative, true),matchers = [function(elem, context, xml){ return (!leadingRelative && (xml || context !== outermostContext)) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); }]; for(;i < len;i++){ if((matcher = Expr.relative[tokens[i].type])){ matchers = [addCombinator(elementMatcher(matchers), matcher)]; } else { // The concatenated values are (context, xml) for backCompat matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); // Return special upon seeing a positional matcher if(matcher[expando]){ // Find the next relative operator (if any) for proper handling j = ++i; for(;j < len;j++){ if(Expr.relative[tokens[j].type]){ break; }; }; return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && tokens.slice(0, i - 1).join("").replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && tokens.join("")); }; matchers.push(matcher); }; }; return elementMatcher(matchers); }; function matcherFromGroupMatchers(elementMatchers, setMatchers){ var bySet = setMatchers.length > 0,byElement = elementMatchers.length > 0,superMatcher = function(seed, context, xml, results, expandContext){ var elem,j,matcher,setMatched = [],matchedCount = 0,i = "0",unmatched = seed && [],outermost = expandContext != null,contextBackup = outermostContext,// We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context),// Nested matchers should use non-integer dirruns dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); if(outermost){ outermostContext = context !== document && context; cachedruns = superMatcher.el; }; // Add elements passing elementMatchers directly to results for(;(elem = elems[i]) != null;i++){ if(byElement && elem){ for(j = 0;(matcher = elementMatchers[j]);j++){ if(matcher(elem, context, xml)){ results.push(elem); break; }; }; if(outermost){ dirruns = dirrunsUnique; cachedruns = ++superMatcher.el; }; }; // Track unmatched elements for set filters if(bySet){ // They will have gone through all possible matchers if((elem = !matcher && elem)){ matchedCount--; }; // Lengthen the array for every element, matched or not if(seed){ unmatched.push(elem); }; }; }; // Apply set filters to unmatched elements matchedCount += i; if(bySet && i !== matchedCount){ for(j = 0;(matcher = setMatchers[j]);j++){ matcher(unmatched, setMatched, context, xml); }; if(seed){ // Reintegrate element matches to eliminate the need for sorting if(matchedCount > 0){ while(i--){ if(!(unmatched[i] || setMatched[i])){ setMatched[i] = pop.call(results); }; }; }; // Discard index placeholder values to get only actual matches setMatched = condense(setMatched); }; // Add matches to results push.apply(results, setMatched); // Seedless set matches succeeding multiple successful matchers stipulate sorting if(outermost && !seed && setMatched.length > 0 && (matchedCount + setMatchers.length) > 1){ Sizzle.uniqueSort(results); }; }; // Override manipulation of globals by nested matchers if(outermost){ dirruns = dirrunsUnique; outermostContext = contextBackup; }; return unmatched; }; superMatcher.el = 0; return bySet ? markFunction(superMatcher) : superMatcher; }; compile = Sizzle.compile = function(selector, group){ var i,setMatchers = [],elementMatchers = [],cached = compilerCache[expando][selector]; if(!cached){ // Generate a function of recursive functions that can be used to check each element if(!group){ group = tokenize(selector); }; i = group.length; while(i--){ cached = matcherFromTokens(group[i]); if(cached[expando]){ setMatchers.push(cached); } else { elementMatchers.push(cached); }; }; // Cache the compiled function cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); }; return cached; }; function multipleContexts(selector, contexts, results, seed){ var i = 0,len = contexts.length; for(;i < len;i++){ Sizzle(selector, contexts[i], results, seed); }; return results; }; function select(selector, context, results, seed, xml){ var i,tokens,token,type,find,match = tokenize(selector),j = match.length; if(!seed){ // Try to minimize operations if there is only one group if(match.length === 1){ // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice(0); if(tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !xml && Expr.relative[tokens[1].type]){ context = Expr.find["ID"](token.matches[0].replace(rbackslash, ""), context, xml)[0]; if(!context){ return results; }; selector = selector.slice(tokens.shift().length); }; // Fetch a seed set for right-to-left matching for(i = matchExpr["POS"].test(selector) ? -1 : tokens.length - 1;i >= 0;i--){ token = tokens[i]; // Abort if we hit a combinator if(Expr.relative[(type = token.type)]){ break; }; if((find = Expr.find[type])){ // Search, expanding context for leading sibling combinators if((seed = find(token.matches[0].replace(rbackslash, ""), rsibling.test(tokens[0].type) && context.parentNode || context, xml))){ // If seed is empty or no tokens remain, we can return early tokens.splice(i, 1); selector = seed.length && tokens.join(""); if(!selector){ push.apply(results, slice.call(seed, 0)); return results; }; break; }; }; }; }; }; // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile(selector, match)(seed, context, xml, results, rsibling.test(selector)); return results; }; if(document.querySelectorAll){ (function(){ var disconnectedMatch,oldSelect = select,rescape = /'|\\/g,rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,// qSa(:focus) reports false when true (Chrome 21), // A support test would require too much code (would include document ready) rbuggyQSA = [":focus"],// matchesSelector(:focus) reports false when true (Chrome 21), // matchesSelector(:active) reports false when true (IE9/Opera 11.5) // A support test would require too much code (would include document ready) // just skip matchesSelector for :active rbuggyMatches = [":active", ":focus"],matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector; // Build QSA regex // Regex strategy adopted from Diego Perini assert(function(div){ // Select is set to empty string on purpose // This is to test IE's treatment of not explictly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // IE8 - Some boolean attributes are not treated correctly if(!div.querySelectorAll("[selected]").length){ rbuggyQSA.push("\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"); }; // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here (do not put tests after this one) if(!div.querySelectorAll(":checked").length){ rbuggyQSA.push(":checked"); }; }); assert(function(div){ // Opera 10-12/IE9 - ^= $= *= and empty values // Should not select anything div.innerHTML = "<p test=''></p>"; if(div.querySelectorAll("[test^='']").length){ rbuggyQSA.push("[*^$]=" + whitespace + "*(?:\"\"|'')"); }; // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here (do not put tests after this one) div.innerHTML = "<input type='hidden'/>"; if(!div.querySelectorAll(":enabled").length){ rbuggyQSA.push(":enabled", ":disabled"); }; }); // rbuggyQSA always contains :focus, so no need for a length check rbuggyQSA = /* rbuggyQSA.length && */ new RegExp(rbuggyQSA.join("|")); select = function(selector, context, results, seed, xml){ // Only use querySelectorAll when not filtering, // when this is not xml, // and when no QSA bugs apply if(!seed && !xml && (!rbuggyQSA || !rbuggyQSA.test(selector))){ var groups,i,old = true,nid = expando,newContext = context,newSelector = context.nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if(context.nodeType === 1 && context.nodeName.toLowerCase() !== "object"){ groups = tokenize(selector); if((old = context.getAttribute("id"))){ nid = old.replace(rescape, "\\$&"); } else { context.setAttribute("id", nid); }; nid = "[id='" + nid + "'] "; i = groups.length; while(i--){ groups[i] = nid + groups[i].join(""); }; newContext = rsibling.test(selector) && context.parentNode || context; newSelector = groups.join(","); }; if(newSelector){ try{ push.apply(results, slice.call(newContext.querySelectorAll(newSelector), 0)); return results; } catch(qsaError) { }finally{ if(!old){ context.removeAttribute("id"); }; }; }; }; return oldSelect(selector, context, results, seed, xml); }; if(matches){ assert(function(div){ // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) disconnectedMatch = matches.call(div, "div"); // This should fail with an exception // Gecko does not error, returns false instead try{ matches.call(div, "[test!='']:sizzle"); rbuggyMatches.push("!=", pseudos); } catch(e) { }; }); // rbuggyMatches always contains :active and :focus, so no need for a length check rbuggyMatches = /* rbuggyMatches.length && */ new RegExp(rbuggyMatches.join("|")); Sizzle.matchesSelector = function(elem, expr){ // Make sure that attribute selectors are quoted expr = expr.replace(rattributeQuotes, "='$1']"); // rbuggyMatches always contains :active, so no need for an existence check if(!isXML(elem) && !rbuggyMatches.test(expr) && (!rbuggyQSA || !rbuggyQSA.test(expr))){ try{ var ret = matches.call(elem, expr); // IE 9's matchesSelector returns false on disconnected nodes if(ret || disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11){ return ret; }; } catch(e) { }; }; return Sizzle(expr, null, null, [elem]).length > 0; }; }; })(); }; // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Back-compat function setFilters(){ }; Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); // EXPOSE qooxdoo variant qx.bom.Selector.query = function(selector, context){ return Sizzle(selector, context); }; qx.bom.Selector.matches = function(selector, set){ return Sizzle(selector, null, null, set); }; })(window); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2007-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) ************************************************************************ */ /** * Utility class with type check for all native JavaScript data types. */ qx.Bootstrap.define("qx.lang.Type", { statics : { /** * Get the internal class of the value. See * http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ * for details. * * @signature function(value) * @param value {var} value to get the class for * @return {String} the internal class of the value */ getClass : qx.Bootstrap.getClass, /** * Whether the value is a string. * * @signature function(value) * @param value {var} Value to check. * @return {Boolean} Whether the value is a string. */ isString : qx.Bootstrap.isString, /** * Whether the value is an array. * * @signature function(value) * @param value {var} Value to check. * @return {Boolean} Whether the value is an array. */ isArray : qx.Bootstrap.isArray, /** * Whether the value is an object. Note that built-in types like Window are * not reported to be objects. * * @signature function(value) * @param value {var} Value to check. * @return {Boolean} Whether the value is an object. */ isObject : qx.Bootstrap.isObject, /** * Whether the value is a function. * * @signature function(value) * @param value {var} Value to check. * @return {Boolean} Whether the value is a function. */ isFunction : qx.Bootstrap.isFunction, /** * Whether the value is a regular expression. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a regular expression. */ isRegExp : function(value){ return this.getClass(value) == "RegExp"; }, /** * Whether the value is a number. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a number. */ isNumber : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Number" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (this.getClass(value) == "Number" || value instanceof Number)); }, /** * Whether the value is a boolean. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a boolean. */ isBoolean : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Boolean" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (this.getClass(value) == "Boolean" || value instanceof Boolean)); }, /** * Whether the value is a date. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a date. */ isDate : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Date" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (this.getClass(value) == "Date" || value instanceof Date)); }, /** * Whether the value is a Error. * * @param value {var} Value to check. * @return {Boolean} Whether the value is a Error. */ isError : function(value){ // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Error" if value is a DOM element that // doesn't exist. It seems that there is an internal different between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return (value !== null && (this.getClass(value) == "Error" || value instanceof Error)); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This module offers a cross browser storage implementation. The API is aligned * with the API of the HTML web storage (http://www.w3.org/TR/webstorage/) which is * also the preferred implementation used. As fallback for IE < 8, we use user data. * If both techniques are unsupported, we supply a in memory storage, which is * of course, not persistent. */ qx.Bootstrap.define("qx.module.Storage", { statics : { /** * Store an item in the storage. * * @attachStatic {qxWeb, localStorage.setItem} * @param key {String} The identifier key. * @param value {var} The data, which will be stored as JSON. */ setLocalItem : function(key, value){ qx.bom.Storage.getLocal().setItem(key, value); }, /** * Returns the stored item. * * @attachStatic {qxWeb, localStorage.getItem} * @param key {String} The identifier to get the data. * @return {var} The stored data. */ getLocalItem : function(key){ return qx.bom.Storage.getLocal().getItem(key); }, /** * Removes an item form the storage. * @attachStatic {qxWeb, localStorage.removeItem} * @param key {String} The identifier. */ removeLocalItem : function(key){ qx.bom.Storage.getLocal().removeItem(key); }, /** * Returns the amount of key-value pairs stored. * @attachStatic {qxWeb, localStorage.getLength} * @return {Number} The length of the storage. */ getLocalLength : function(){ return qx.bom.Storage.getLocal().getLength(); }, /** * Returns the named key at the given index. * @attachStatic {qxWeb, localStorage.getKey} * @param index {Number} The index in the storage. * @return {String} The key stored at the given index. */ getLocalKey : function(index){ return qx.bom.Storage.getLocal().getKey(index); }, /** * Deletes every stored item in the storage. * @attachStatic {qxWeb, localStorage.clear} */ clearLocal : function(){ qx.bom.Storage.getLocal().clear(); }, /** * Helper to access every stored item. * * @attachStatic {qxWeb, localStorage.forEach} * @param callback {Function} A function which will be called for every item. * The function will have two arguments, first the key and second the value * of the stored data. * @param scope {var} The scope of the function. */ forEachLocal : function(callback, scope){ qx.bom.Storage.getLocal().forEach(callback, scope); }, /** * Store an item in the storage. * * @attachStatic {qxWeb, sessionStorage.setItem} * @param key {String} The identifier key. * @param value {var} The data, which will be stored as JSON. */ setSessionItem : function(key, value){ qx.bom.Storage.getSession().setItem(key, value); }, /** * Returns the stored item. * * @attachStatic {qxWeb, sessionStorage.getItem} * @param key {String} The identifier to get the data. * @return {var} The stored data. */ getSessionItem : function(key){ return qx.bom.Storage.getSession().getItem(key); }, /** * Removes an item form the storage. * @attachStatic {qxWeb, sessionStorage.removeItem} * @param key {String} The identifier. */ removeSessionItem : function(key){ qx.bom.Storage.getSession().removeItem(key); }, /** * Returns the amount of key-value pairs stored. * @attachStatic {qxWeb, sessionStorage.getLength} * @return {Number} The length of the storage. */ getSessionLength : function(){ return qx.bom.Storage.getSession().getLength(); }, /** * Returns the named key at the given index. * @attachStatic {qxWeb, sessionStorage.getKey} * @param index {Number} The index in the storage. * @return {String} The key stored at the given index. */ getSessionKey : function(index){ return qx.bom.Storage.getSession().getKey(index); }, /** * Deletes every stored item in the storage. * @attachStatic {qxWeb, sessionStorage.clear} */ clearSession : function(){ qx.bom.Storage.getSession().clear(); }, /** * Helper to access every stored item. * * @attachStatic {qxWeb, sessionStorage.forEach} * @param callback {Function} A function which will be called for every item. * The function will have two arguments, first the key and second the value * of the stored data. * @param scope {var} The scope of the function. */ forEachSession : function(callback, scope){ qx.bom.Storage.getSession().forEach(callback, scope); } }, defer : function(statics){ qxWeb.$attachStatic({ "localStorage" : { setItem : statics.setLocalItem, getItem : statics.getLocalItem, removeItem : statics.removeLocalItem, getLength : statics.getLocalLength, getKey : statics.getLocalKey, clear : statics.clearLocal, forEach : statics.forEachLocal }, "sessionStorage" : { setItem : statics.setSessionItem, getItem : statics.getSessionItem, removeItem : statics.removeSessionItem, getLength : statics.getSessionLength, getKey : statics.getSessionKey, clear : statics.clearSession, forEach : statics.forEachSession } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This is a cross browser storage implementation. The API is aligned with the * API of the HTML web storage (http://www.w3.org/TR/webstorage/) which is also * the preferred implementation used. As fallback for IE < 8, we use user data. * If both techniques are unsupported, we supply a in memory storage, which is * of course, not persistent. */ qx.Bootstrap.define("qx.bom.Storage", { statics : { __impl : null, /** * Get an instance of a local storage. * @return {qx.bom.storage.Web|qx.bom.storage.UserData|qx.bom.storage.Memory} * An instance of a storage implementation. */ getLocal : function(){ // always use HTML5 web storage if available if(qx.core.Environment.get("html.storage.local")){ return qx.bom.storage.Web.getLocal(); } else if(qx.core.Environment.get("html.storage.userdata")){ // IE <8 fallback // as fallback,use the userdata storage for IE5.5 - 8 return qx.bom.storage.UserData.getLocal(); }; // as last fallback, use a in memory storage (this one is not persistent) return qx.bom.storage.Memory.getLocal(); }, /** * Get an instance of a session storage. * @return {qx.bom.storage.Web|qx.bom.storage.UserData|qx.bom.storage.Memory} * An instance of a storage implementation. */ getSession : function(){ // always use HTML5 web storage if available if(qx.core.Environment.get("html.storage.local")){ return qx.bom.storage.Web.getSession(); } else if(qx.core.Environment.get("html.storage.userdata")){ // IE <8 fallback // as fallback,use the userdata storage for IE5.5 - 8 return qx.bom.storage.UserData.getSession(); }; // as last fallback, use a in memory storage (this one is not persistent) return qx.bom.storage.Memory.getSession(); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * Internal class which contains the checks used by {@link qx.core.Environment}. * All checks in here are marked as internal which means you should never use * them directly. * * This class should contain all checks about HTML. * * @internal */ qx.Bootstrap.define("qx.bom.client.Html", { statics : { /** * Whether the client supports Web Workers. * * @internal * @return {Boolean} <code>true</code> if webworkers are supported */ getWebWorker : function(){ return window.Worker != null; }, /** * Whether the client supports File Readers * * @internal * @return {Boolean} <code>true</code> if FileReaders are supported */ getFileReader : function(){ return window.FileReader != null; }, /** * Whether the client supports Geo Location. * * @internal * @return {Boolean} <code>true</code> if geolocation supported */ getGeoLocation : function(){ return navigator.geolocation != null; }, /** * Whether the client supports audio. * * @internal * @return {Boolean} <code>true</code> if audio is supported */ getAudio : function(){ return !!document.createElement('audio').canPlayType; }, /** * Whether the client can play ogg audio format. * * @internal * @return {String} "" or "maybe" or "probably" */ getAudioOgg : function(){ if(!qx.bom.client.Html.getAudio()){ return ""; }; var a = document.createElement("audio"); return a.canPlayType("audio/ogg"); }, /** * Whether the client can play mp3 audio format. * * @internal * @return {String} "" or "maybe" or "probably" */ getAudioMp3 : function(){ if(!qx.bom.client.Html.getAudio()){ return ""; }; var a = document.createElement("audio"); return a.canPlayType("audio/mpeg"); }, /** * Whether the client can play wave audio wave format. * * @internal * @return {String} "" or "maybe" or "probably" */ getAudioWav : function(){ if(!qx.bom.client.Html.getAudio()){ return ""; }; var a = document.createElement("audio"); return a.canPlayType("audio/x-wav"); }, /** * Whether the client can play au audio format. * * @internal * @return {String} "" or "maybe" or "probably" */ getAudioAu : function(){ if(!qx.bom.client.Html.getAudio()){ return ""; }; var a = document.createElement("audio"); return a.canPlayType("audio/basic"); }, /** * Whether the client can play aif audio format. * * @internal * @return {String} "" or "maybe" or "probably" */ getAudioAif : function(){ if(!qx.bom.client.Html.getAudio()){ return ""; }; var a = document.createElement("audio"); return a.canPlayType("audio/x-aiff"); }, /** * Whether the client supports video. * * @internal * @return {Boolean} <code>true</code> if video is supported */ getVideo : function(){ return !!document.createElement('video').canPlayType; }, /** * Whether the client supports ogg video. * * @internal * @return {String} "" or "maybe" or "probably" */ getVideoOgg : function(){ if(!qx.bom.client.Html.getVideo()){ return ""; }; var v = document.createElement("video"); return v.canPlayType('video/ogg; codecs="theora, vorbis"'); }, /** * Whether the client supports mp4 video. * * @internal * @return {String} "" or "maybe" or "probably" */ getVideoH264 : function(){ if(!qx.bom.client.Html.getVideo()){ return ""; }; var v = document.createElement("video"); return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'); }, /** * Whether the client supports webm video. * * @internal * @return {String} "" or "maybe" or "probably" */ getVideoWebm : function(){ if(!qx.bom.client.Html.getVideo()){ return ""; }; var v = document.createElement("video"); return v.canPlayType('video/webm; codecs="vp8, vorbis"'); }, /** * Whether the client supports local storage. * * @internal * @return {Boolean} <code>true</code> if local storage is supported */ getLocalStorage : function(){ try{ return window.localStorage != null; } catch(exc) { // Firefox Bug: Local execution of window.sessionStorage throws error // see https://bugzilla.mozilla.org/show_bug.cgi?id=357323 return false; }; }, /** * Whether the client supports session storage. * * @internal * @return {Boolean} <code>true</code> if session storage is supported */ getSessionStorage : function(){ try{ return window.sessionStorage != null; } catch(exc) { // Firefox Bug: Local execution of window.sessionStorage throws error // see https://bugzilla.mozilla.org/show_bug.cgi?id=357323 return false; }; }, /** * Whether the client supports user data to persist data. This is only * relevant for IE < 8. * * @internal * @return {Boolean} <code>true</code> if the user data is supported. */ getUserDataStorage : function(){ var el = document.createElement("div"); el.style["display"] = "none"; document.getElementsByTagName("head")[0].appendChild(el); var supported = false; try{ el.addBehavior("#default#userdata"); el.load("qxtest"); supported = true; } catch(e) { }; document.getElementsByTagName("head")[0].removeChild(el); return supported; }, /** * Whether the browser supports CSS class lists. * https://developer.mozilla.org/en/DOM/element.classList * * @internal * @return {Boolean} <code>true</code> if class list is supported. */ getClassList : function(){ return !!(document.documentElement.classList && qx.Bootstrap.getClass(document.documentElement.classList) === "DOMTokenList"); }, /** * Checks if XPath could be used. * * @internal * @return {Boolean} <code>true</code> if xpath is supported. */ getXPath : function(){ return !!document.evaluate; }, /** * Checks if XUL could be used. * * @internal * @return {Boolean} <code>true</code> if XUL is supported. */ getXul : function(){ try{ document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "label"); return true; } catch(e) { return false; }; }, /** * Checks if SVG could be used * * @internal * @return {Boolean} <code>true</code> if SVG is supported. */ getSvg : function(){ return document.implementation && document.implementation.hasFeature && (document.implementation.hasFeature("org.w3c.dom.svg", "1.0") || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); }, /** * Checks if VML is supported * * @internal * @return {Boolean} <code>true</code> if VML is supported. */ getVml : function(){ var el = document.createElement("div"); document.body.appendChild(el); el.innerHTML = '<v:shape id="vml_flag1" adj="1" />'; el.firstChild.style.behavior = "url(#default#VML)"; var hasVml = typeof el.firstChild.adj == "object"; document.body.removeChild(el); return hasVml; }, /** * Checks if canvas could be used * * @internal * @return {Boolean} <code>true</code> if canvas is supported. */ getCanvas : function(){ return !!window.CanvasRenderingContext2D; }, /** * Asynchronous check for using data urls. * * @internal * @param callback {Function} The function which should be executed as * soon as the check is done. */ getDataUrl : function(callback){ var data = new Image(); data.onload = data.onerror = function(){ // wrap that into a timeout because IE might execute it synchronously window.setTimeout(function(){ callback.call(null, (data.width == 1 && data.height == 1)); }, 0); }; data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="; }, /** * Checks if dataset could be used * * @internal * @return {Boolean} <code>true</code> if dataset is supported. */ getDataset : function(){ return !!document.documentElement.dataset; }, /** * Check for element.contains * * @internal * @return {Boolean} <code>true</code> if element.contains is supported */ getContains : function(){ // "object" in IE6/7/8, "function" in IE9 return (typeof document.documentElement.contains !== "undefined"); }, /** * Check for element.compareDocumentPosition * * @internal * @return {Boolean} <code>true</code> if element.compareDocumentPosition is supported */ getCompareDocumentPosition : function(){ return (typeof document.documentElement.compareDocumentPosition === "function"); }, /** * Check for element.textContent. Legacy IEs do not support this, use * innerText instead. * * @internal * @return {Boolean} <code>true</code> if textContent is supported */ getTextContent : function(){ var el = document.createElement("span"); return (typeof el.textContent !== "undefined"); }, /** * Check for a console object. * * @internal * @return {Boolean} <code>true</code> if a console is available. */ getConsole : function(){ return typeof window.console !== "undefined"; }, /** * Check for the <code>naturalHeight</code> and <code>naturalWidth</code> * image element attributes. * * @internal * @return {Boolean} <code>true</code> if both attributes are supported */ getNaturalDimensions : function(){ var img = document.createElement("img"); return typeof img.naturalHeight === "number" && typeof img.naturalWidth === "number"; }, /** * Check for HTML5 history manipulation support. * @internal * @return {Boolean} <code>true</code> if the HTML5 history API is supported */ getHistoryState : function(){ return (typeof window.onpopstate !== "undefined" && typeof window.history.replaceState !== "undefined" && typeof window.history.pushState !== "undefined"); } }, defer : function(statics){ qx.core.Environment.add("html.webworker", statics.getWebWorker); qx.core.Environment.add("html.filereader", statics.getFileReader); qx.core.Environment.add("html.geolocation", statics.getGeoLocation); qx.core.Environment.add("html.audio", statics.getAudio); qx.core.Environment.add("html.audio.ogg", statics.getAudioOgg); qx.core.Environment.add("html.audio.mp3", statics.getAudioMp3); qx.core.Environment.add("html.audio.wav", statics.getAudioWav); qx.core.Environment.add("html.audio.au", statics.getAudioAu); qx.core.Environment.add("html.audio.aif", statics.getAudioAif); qx.core.Environment.add("html.video", statics.getVideo); qx.core.Environment.add("html.video.ogg", statics.getVideoOgg); qx.core.Environment.add("html.video.h264", statics.getVideoH264); qx.core.Environment.add("html.video.webm", statics.getVideoWebm); qx.core.Environment.add("html.storage.local", statics.getLocalStorage); qx.core.Environment.add("html.storage.session", statics.getSessionStorage); qx.core.Environment.add("html.storage.userdata", statics.getUserDataStorage); qx.core.Environment.add("html.classlist", statics.getClassList); qx.core.Environment.add("html.xpath", statics.getXPath); qx.core.Environment.add("html.xul", statics.getXul); qx.core.Environment.add("html.canvas", statics.getCanvas); qx.core.Environment.add("html.svg", statics.getSvg); qx.core.Environment.add("html.vml", statics.getVml); qx.core.Environment.add("html.dataset", statics.getDataset); qx.core.Environment.addAsync("html.dataurl", statics.getDataUrl); qx.core.Environment.add("html.element.contains", statics.getContains); qx.core.Environment.add("html.element.compareDocumentPosition", statics.getCompareDocumentPosition); qx.core.Environment.add("html.element.textcontent", statics.getTextContent); qx.core.Environment.add("html.console", statics.getConsole); qx.core.Environment.add("html.image.naturaldimensions", statics.getNaturalDimensions); qx.core.Environment.add("html.history.state", statics.getHistoryState); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.storage.Web#getLength) #require(qx.bom.storage.Web#setItem) #require(qx.bom.storage.Web#getItem) #require(qx.bom.storage.Web#removeItem) #require(qx.bom.storage.Web#clear) #require(qx.bom.storage.Web#getKey) #require(qx.bom.storage.Web#forEach) ************************************************************************ */ /** * Storage implementation using HTML web storage: * http://www.w3.org/TR/webstorage/ */ qx.Bootstrap.define("qx.bom.storage.Web", { statics : { __local : null, __session : null, /** * Static accessor for the local storage. * @return {qx.bom.storage.Web} An instance of a local storage. */ getLocal : function(){ if(this.__local){ return this.__local; }; return this.__local = new qx.bom.storage.Web("local"); }, /** * Static accessor for the session storage. * @return {qx.bom.storage.Web} An instance of a session storage. */ getSession : function(){ if(this.__session){ return this.__session; }; return this.__session = new qx.bom.storage.Web("session"); } }, /** * Create a new instance. Usually, you should take the static * accessors to get your instance. * * @param type {String} type of storage, either * <code>local</code> or <code>session</code>. */ construct : function(type){ this.__type = type; }, members : { __type : null, /** * Returns the internal used storage (the native object). * * @internal * @return {Storage} The native storage implementation. */ getStorage : function(){ return window[this.__type + "Storage"]; }, /** * Returns the amount of key-value pairs stored. * @return {Integer} The length of the storage. */ getLength : function(){ return this.getStorage(this.__type).length; }, /** * Store an item in the storage. * * @param key {String} The identifier key. * @param value {var} The data, which will be stored as JSON. */ setItem : function(key, value){ value = qx.lang.Json.stringify(value); try{ this.getStorage(this.__type).setItem(key, value); } catch(e) { throw new Error("Storage full."); }; }, /** * Returns the stored item. * * @param key {String} The identifier to get the data. * @return {var} The stored data. */ getItem : function(key){ var item = this.getStorage(this.__type).getItem(key); if(qx.lang.Type.isString(item)){ item = qx.lang.Json.parse(item); } else if(item && item.value && qx.lang.Type.isString(item.value)){ item = qx.lang.Json.parse(item.value); }; return item; }, /** * Removes an item form the storage. * @param key {String} The identifier. */ removeItem : function(key){ this.getStorage(this.__type).removeItem(key); }, /** * Deletes every stored item in the storage. */ clear : function(){ var storage = this.getStorage(this.__type); if(!storage.clear){ for(var i = storage.length - 1;i >= 0;i--){ storage.removeItem(storage.key(i)); }; } else { storage.clear(); }; }, /** * Returns the named key at the given index. * @param index {Integer} The index in the storage. * @return {String} The key stored at the given index. */ getKey : function(index){ return this.getStorage(this.__type).key(index); }, /** * Helper to access every stored item. * * @param callback {Function} A function which will be called for every item. * The function will have two arguments, first the key and second the value * of the stored data. * @param scope {var} The scope of the function. */ forEach : function(callback, scope){ var length = this.getLength(); for(var i = 0;i < length;i++){ var key = this.getKey(i); callback.call(scope, key, this.getItem(key)); }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) ________________________________________________________________________ This class contains code based on the following work: http://www.JSON.org/json2.js 2009-06-29 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html ************************************************************************ */ /** * Pure JavaScript implementation of the EcmaScript 3.1 JSON object. This class * is used, if the browser does not support it natively. * * @internal */ qx.Bootstrap.define("qx.lang.JsonImpl", { extend : Object, construct : function(){ // bind parse and stringify so they can be called without a context. this.stringify = qx.lang.Function.bind(this.stringify, this); this.parse = qx.lang.Function.bind(this.parse, this); }, members : { __gap : null, __indent : null, __rep : null, __stack : null, /** * This method produces a JSON text from a JavaScript value. * * @param value {var} any JavaScript value, usually an object or array. * * @param replacer {Function?} an optional parameter that determines how * object values are stringified for objects. It can be a function or an * array of strings. * * @param space {String?} an optional parameter that specifies the * indentation of nested structures. If it is omitted, the text will * be packed without extra whitespace. If it is a number, it will specify * the number of spaces to indent at each level. If it is a string * (such as '\t' or '&nbsp;'), it contains the characters used to indent * at each level. * * @return {String} The JSON string of the value */ stringify : function(value, replacer, space){ this.__gap = ''; this.__indent = ''; this.__stack = []; if(qx.lang.Type.isNumber(space)){ // If the space parameter is a number, make an indent string containing that // many spaces. var space = Math.min(10, Math.floor(space)); for(var i = 0;i < space;i += 1){ this.__indent += ' '; }; } else if(qx.lang.Type.isString(space)){ if(space.length > 10){ space = space.slice(0, 10); }; // If the space parameter is a string, it will be used as the indent string. this.__indent = space; }; // If there is a replacer, it must be a function or an array. // Otherwise, ignore it. if(replacer && (qx.lang.Type.isFunction(replacer) || qx.lang.Type.isArray(replacer))){ this.__rep = replacer; } else { this.__rep = null; }; // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return this.__str('', { '' : value }); }, /** * Produce a string from holder[key]. * * @param key {String} the map key * @param holder {Object} an object with the given key * @return {String} The string representation of holder[key] */ __str : function(key, holder){ var mind = this.__gap,partial,value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value. if(value && qx.lang.Type.isFunction(value.toJSON)){ value = value.toJSON(key); } else if(qx.lang.Type.isDate(value)){ value = this.dateToJSON(value); }; // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if(typeof this.__rep === 'function'){ value = this.__rep.call(holder, key, value); }; if(value === null){ return 'null'; }; if(value === undefined){ return undefined; }; // What happens next depends on the value's type. switch(qx.lang.Type.getClass(value)){case 'String': return this.__quote(value);case 'Number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null';case 'Boolean': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value);case 'Array': // Make an array to hold the partial results of stringifying this array value. this.__gap += this.__indent; partial = []; if(this.__stack.indexOf(value) !== -1){ throw new TypeError("Cannot stringify a recursive object."); }; this.__stack.push(value); // The value is an array. Stringify every element. Use null as a placeholder // for non-JSON values. var length = value.length; for(var i = 0;i < length;i += 1){ partial[i] = this.__str(i, value) || 'null'; }; this.__stack.pop(); // Join all of the elements together, separated with commas, and wrap them in // brackets. if(partial.length === 0){ var string = '[]'; } else if(this.__gap){ string = '[\n' + this.__gap + partial.join(',\n' + this.__gap) + '\n' + mind + ']'; } else { string = '[' + partial.join(',') + ']'; }; this.__gap = mind; return string;case 'Object': // Make an array to hold the partial results of stringifying this object value. this.__gap += this.__indent; partial = []; if(this.__stack.indexOf(value) !== -1){ throw new TypeError("Cannot stringify a recursive object."); }; this.__stack.push(value); // If the replacer is an array, use it to select the members to be stringified. if(this.__rep && typeof this.__rep === 'object'){ var length = this.__rep.length; for(var i = 0;i < length;i += 1){ var k = this.__rep[i]; if(typeof k === 'string'){ var v = this.__str(k, value); if(v){ partial.push(this.__quote(k) + (this.__gap ? ': ' : ':') + v); }; }; }; } else { // Otherwise, iterate through all of the keys in the object. for(var k in value){ if(Object.hasOwnProperty.call(value, k)){ var v = this.__str(k, value); if(v){ partial.push(this.__quote(k) + (this.__gap ? ': ' : ':') + v); }; }; }; }; this.__stack.pop(); // Join all of the member texts together, separated with commas, // and wrap them in braces. if(partial.length === 0){ var string = '{}'; } else if(this.__gap){ string = '{\n' + this.__gap + partial.join(',\n' + this.__gap) + '\n' + mind + '}'; } else { string = '{' + partial.join(',') + '}'; }; this.__gap = mind; return string;}; }, /** * Convert a date to JSON * * @param date {Date} The date to convert * @return {String} The JSON representation of the date */ dateToJSON : function(date){ // Format integers to have at least two digits. var f2 = function(n){ return n < 10 ? '0' + n : n; }; var f3 = function(n){ var value = f2(n); return n < 100 ? '0' + value : value; }; return isFinite(date.valueOf()) ? date.getUTCFullYear() + '-' + f2(date.getUTCMonth() + 1) + '-' + f2(date.getUTCDate()) + 'T' + f2(date.getUTCHours()) + ':' + f2(date.getUTCMinutes()) + ':' + f2(date.getUTCSeconds()) + '.' + f3(date.getUTCMilliseconds()) + 'Z' : null; }, /** * If the string contains no control characters, no quote characters, and no * backslash characters, then we can safely slap some quotes around it. * Otherwise we must also replace the offending characters with safe escape * sequences. * * @param string {String} The string to quote * @return {String} The quoted string */ __quote : function(string){ var meta = { // table of character substitutions '\b' : '\\b', '\t' : '\\t', '\n' : '\\n', '\f' : '\\f', '\r' : '\\r', '"' : '\\"', '\\' : '\\\\' }; var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; escapable.lastIndex = 0; if(escapable.test(string)){ return '"' + string.replace(escapable, function(a){ var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"'; } else { return '"' + string + '"'; }; }, /** * This method parses a JSON text to produce an object or array. * It can throw a SyntaxError exception. * * @param text {String} JSON string to parse * * @param reviver {Function?} Optional reviver function to filter and * transform the results * * @return {Object} The parsed JSON object * * @lint ignoreDeprecated(eval) */ parse : function(text, reviver){ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; cx.lastIndex = 0; // Parsing happens in four stages. In the first stage, we replace certain // Unicode characters with escape sequences. JavaScript handles many characters // incorrectly, either silently deleting them, or treating them as line endings. if(cx.test(text)){ text = text.replace(cx, function(a){ return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); }; // In the second stage, we run the text against regular expressions that look // for non-JSON patterns. We are especially concerned with '()' and 'new' // because they can cause invocation, and '=' because it can cause mutation. // But just to be safe, we want to reject all unexpected forms. // We split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in IE's and Safari's regexp engines. First we // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we // replace all simple value tokens with ']' characters. Third, we delete all // open brackets that follow a colon or comma or that begin the text. Finally, // we look to see that the remaining characters are only whitespace or ']' or // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))){ // In the third stage we use the eval function to compile the text into a // JavaScript structure. The '{' operator is subject to a syntactic ambiguity // in JavaScript: it can begin a block or an object literal. We wrap the text // in parens to eliminate the ambiguity. var j = eval('(' + text + ')'); // In the optional fourth stage, we recursively walk the new structure, passing // each name/value pair to a reviver function for possible transformation. return typeof reviver === 'function' ? this.__walk({ '' : j }, '', reviver) : j; }; // If the text is not JSON parseable, then a SyntaxError is thrown. throw new SyntaxError('JSON.parse'); }, /** * The walk method is used to recursively walk the resulting structure so * that modifications can be made. * * @param holder {Object} the root object * @param key {String} walk holder[key] * @param reviver {Function} callback, which is called on every node. * @return {var} The reviver's return value */ __walk : function(holder, key, reviver){ var value = holder[key]; if(value && typeof value === 'object'){ for(var k in value){ if(Object.hasOwnProperty.call(value, k)){ var v = this.__walk(value, k, reviver); if(v !== undefined){ value[k] = v; } else { delete value[k]; }; }; }; }; return reviver.call(holder, key, value); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ====================================================================== This class contains code based on the following work: * Mootools http://mootools.net Version 1.1.1 Copyright: 2007 Valerio Proietti License: MIT: http://www.opensource.org/licenses/mit-license.php ************************************************************************ */ /* ************************************************************************ #require(qx.lang.Array) #ignore(qx.core.Object) #ignore(qx.event.GlobalError) ************************************************************************ */ /** * Collection of helper methods operating on functions. */ qx.Bootstrap.define("qx.lang.Function", { statics : { /** * Extract the caller of a function from the arguments variable. * This will not work in Opera < 9.6. * * @param args {arguments} The local arguments variable * @return {Function} A reference to the calling function or "undefined" if caller is not supported. */ getCaller : function(args){ return args.caller ? args.caller.callee : args.callee.caller; }, /** * Try to get a sensible textual description of a function object. * This may be the class/mixin and method name of a function * or at least the signature of the function. * * @param fcn {Function} function the get the name for. * @return {String} Name of the function. */ getName : function(fcn){ if(fcn.displayName){ return fcn.displayName; }; if(fcn.$$original || fcn.wrapper || fcn.classname){ return fcn.classname + ".constructor()"; }; if(fcn.$$mixin){ //members for(var key in fcn.$$mixin.$$members){ if(fcn.$$mixin.$$members[key] == fcn){ return fcn.$$mixin.name + ".prototype." + key + "()"; }; }; // statics for(var key in fcn.$$mixin){ if(fcn.$$mixin[key] == fcn){ return fcn.$$mixin.name + "." + key + "()"; }; }; }; if(fcn.self){ var clazz = fcn.self.constructor; if(clazz){ // members for(var key in clazz.prototype){ if(clazz.prototype[key] == fcn){ return clazz.classname + ".prototype." + key + "()"; }; }; // statics for(var key in clazz){ if(clazz[key] == fcn){ return clazz.classname + "." + key + "()"; }; }; }; }; var fcnReResult = fcn.toString().match(/function\s*(\w*)\s*\(.*/); if(fcnReResult && fcnReResult.length >= 1 && fcnReResult[1]){ return fcnReResult[1] + "()"; }; return 'anonymous()'; }, /** * Evaluates JavaScript code globally * * @lint ignoreDeprecated(eval) * * @param data {String} JavaScript commands * @return {var} Result of the execution */ globalEval : function(data){ if(window.execScript){ return window.execScript(data); } else { return eval.call(window, data); }; }, /** * empty function * @deprecated {2.1} Please use a new empty function. */ empty : function(){ }, /** * Simply return true. * @deprecated {2.1} Please use a custom function. * @return {Boolean} Always returns true. */ returnTrue : function(){ return true; }, /** * Simply return false. * @deprecated {2.1} Please use a custom function. * @return {Boolean} Always returns false. */ returnFalse : function(){ return false; }, /** * Simply return null. * @deprecated {2.1} Please use a custom function. * @return {var} Always returns null. */ returnNull : function(){ return null; }, /** * Return "this". * @deprecated {2.1} Please use a custom function. * @return {Object} Always returns "this". */ returnThis : function(){ return this; }, /** * Simply return 0. * @deprecated {2.1} Please use a custom function. * @return {Number} Always returns 0. */ returnZero : function(){ return 0; }, /** * Base function for creating functional closures which is used by most other methods here. * * *Syntax* * * <pre class='javascript'>var createdFunction = qx.lang.Function.create(myFunction, [options]);</pre> * * @param func {Function} Original function to wrap * @param options {Map?} Map of options * <ul> * <li><strong>self</strong>: The object that the "this" of the function will refer to. Default is the same as the wrapper function is called.</li> * <li><strong>args</strong>: An array of arguments that will be passed as arguments to the function when called. * Default is no custom arguments; the function will receive the standard arguments when called.</li> * <li><strong>delay</strong>: If set, the returned function will delay the actual execution by this amount of milliseconds and return a timer handle when called. * Default is no delay.</li> * <li><strong>periodical</strong>: If set the returned function will periodically perform the actual execution with this specified interval * and return a timer handle when called. Default is no periodical execution.</li> * <li><strong>attempt</strong>: If set to true, the returned function will try to execute and return either the results or false on error. Default is false.</li> * </ul> * * @return {Function} Wrapped function */ create : function(func, options){ { }; // Nothing to be done when there are no options. if(!options){ return func; }; // Check for at least one attribute. if(!(options.self || options.args || options.delay != null || options.periodical != null || options.attempt)){ return func; }; return function(event){ { }; // Convert (and copy) incoming arguments var args = qx.lang.Array.fromArguments(arguments); // Prepend static arguments if(options.args){ args = options.args.concat(args); }; if(options.delay || options.periodical){ var returns = function(){ return func.apply(options.self || this, args); }; if(qx.core.Environment.get("qx.globalErrorHandling")){ returns = qx.event.GlobalError.observeMethod(returns); }; if(options.delay){ return window.setTimeout(returns, options.delay); }; if(options.periodical){ return window.setInterval(returns, options.periodical); }; } else if(options.attempt){ var ret = false; try{ ret = func.apply(options.self || this, args); } catch(ex) { }; return ret; } else { return func.apply(options.self || this, args); }; }; }, /** * Returns a function whose "this" is altered. * * * *Native way* * * This is also a feature of JavaScript 1.8.5 and will be supplied * by modern browsers. Including {@link qx.lang.normalize.Function} * will supply a cross browser normalization of the native * implementation. We like to encourage you to use the native function! * * * *Syntax* * * <pre class='javascript'>qx.lang.Function.bind(myFunction, [self, [varargs...]]);</pre> * * *Example* * * <pre class='javascript'> * function myFunction() * { * this.setStyle('color', 'red'); * // note that 'this' here refers to myFunction, not an element * // we'll need to bind this function to the element we want to alter * }; * * var myBoundFunction = qx.lang.Function.bind(myFunction, myElement); * myBoundFunction(); // this will make the element myElement red. * </pre> * * If you find yourself using this static method a lot, you may be * interested in the bindTo() method in the mixin qx.core.MBindTo. * * @see qx.core.MBindTo * * @param func {Function} Original function to wrap * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {Function} The bound function. */ bind : function(func, self, varargs){ return this.create(func, { self : self, args : arguments.length > 2 ? qx.lang.Array.fromArguments(arguments, 2) : null }); }, /** * Returns a function whose arguments are pre-configured. * * *Syntax* * * <pre class='javascript'>qx.lang.Function.curry(myFunction, [varargs...]);</pre> * * *Example* * * <pre class='javascript'> * function myFunction(elem) { * elem.setStyle('color', 'red'); * }; * * var myBoundFunction = qx.lang.Function.curry(myFunction, myElement); * myBoundFunction(); // this will make the element myElement red. * </pre> * * @param func {Function} Original function to wrap * @param varargs {arguments} The arguments to pass to the function. * @return {var} The pre-configured function. */ curry : function(func, varargs){ return this.create(func, { args : arguments.length > 1 ? qx.lang.Array.fromArguments(arguments, 1) : null }); }, /** * Returns a function which could be used as a listener for a native event callback. * * *Syntax* * * <pre class='javascript'>qx.lang.Function.listener(myFunction, [self, [varargs...]]);</pre> * * @param func {Function} Original function to wrap * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {var} The bound function. */ listener : function(func, self, varargs){ if(arguments.length < 3){ return function(event){ // Directly execute, but force first parameter to be the event object. return func.call(self || this, event || window.event); }; } else { var optargs = qx.lang.Array.fromArguments(arguments, 2); return function(event){ var args = [event || window.event]; // Append static arguments args.push.apply(args, optargs); // Finally execute original method func.apply(self || this, args); }; }; }, /** * Tries to execute the function. * * *Syntax* * * <pre class='javascript'>var result = qx.lang.Function.attempt(myFunction, [self, [varargs...]]);</pre> * * *Example* * * <pre class='javascript'> * var myObject = { * 'cow': 'moo!' * }; * * var myFunction = function() * { * for(var i = 0; i < arguments.length; i++) { * if(!this[arguments[i]]) throw('doh!'); * } * }; * * var result = qx.lang.Function.attempt(myFunction, myObject, 'pig', 'cow'); // false * </pre> * * @param func {Function} Original function to wrap * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {Boolean|var} <code>false</code> if an exception is thrown, else the function's return. */ attempt : function(func, self, varargs){ return this.create(func, { self : self, attempt : true, args : arguments.length > 2 ? qx.lang.Array.fromArguments(arguments, 2) : null })(); }, /** * Delays the execution of a function by a specified duration. * * *Syntax* * * <pre class='javascript'>var timeoutID = qx.lang.Function.delay(myFunction, [delay, [self, [varargs...]]]);</pre> * * *Example* * * <pre class='javascript'> * var myFunction = function(){ alert('moo! Element id is: ' + this.id); }; * //wait 50 milliseconds, then call myFunction and bind myElement to it * qx.lang.Function.delay(myFunction, 50, myElement); // alerts: 'moo! Element id is: ... ' * * // An anonymous function, example * qx.lang.Function.delay(function(){ alert('one second later...'); }, 1000); //wait a second and alert * </pre> * * @param func {Function} Original function to wrap * @param delay {Integer} The duration to wait (in milliseconds). * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {Integer} The JavaScript Timeout ID (useful for clearing delays). */ delay : function(func, delay, self, varargs){ return this.create(func, { delay : delay, self : self, args : arguments.length > 3 ? qx.lang.Array.fromArguments(arguments, 3) : null })(); }, /** * Executes a function in the specified intervals of time * * *Syntax* * * <pre class='javascript'>var intervalID = qx.lang.Function.periodical(myFunction, [period, [self, [varargs...]]]);</pre> * * *Example* * * <pre class='javascript'> * var Site = { counter: 0 }; * var addCount = function(){ this.counter++; }; * qx.lang.Function.periodical(addCount, 1000, Site); // will add the number of seconds at the Site * </pre> * * @param func {Function} Original function to wrap * @param interval {Integer} The duration of the intervals between executions. * @param self {Object ? null} The object that the "this" of the function will refer to. * @param varargs {arguments ? null} The arguments to pass to the function. * @return {Integer} The Interval ID (useful for clearing a periodical). */ periodical : function(func, interval, self, varargs){ return this.create(func, { periodical : interval, self : self, args : arguments.length > 3 ? qx.lang.Array.fromArguments(arguments, 3) : null })(); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) ________________________________________________________________________ This class contains code based on the following work: http://www.JSON.org/json2.js 2009-06-29 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html ************************************************************************ */ /** * JSON (JavaScript Object Notation) parser, serializer for qooxdoo * * This class implements EcmaScript 3.1 JSON support. * * http://wiki.ecmascript.org/doku.php?id=es3.1:json_support * * If the browser supports native JSON the browser implementation is used. */ qx.Bootstrap.define("qx.lang.Json", { statics : { /** * {JSON} The JSON object to use. If the browser has native JSON support * this member points to <code>window.JSON</code>. Otherwise it points to * the qooxdoo implementation {@link JsonImpl}. */ JSON : true ? window.JSON : new qx.lang.JsonImpl(), /** * This method produces a JSON text from a JavaScript value. * * When an object value is found, if the object contains a toJSON * method, its toJSON method will be called and the result will be * stringified. A toJSON method does not serialize: it returns the * value represented by the name/value pair that should be serialized, * or undefined if nothing should be serialized. The toJSON method * will be passed the key associated with the value, and this will be * bound to the object holding the key. * * For example, this would serialize Dates as ISO strings. * * <pre class="javascript"> * Date.prototype.toJSON = function (key) { * function f(n) { * // Format integers to have at least two digits. * return n < 10 ? '0' + n : n; * } * * return this.getUTCFullYear() + '-' + * f(this.getUTCMonth() + 1) + '-' + * f(this.getUTCDate()) + 'T' + * f(this.getUTCHours()) + ':' + * f(this.getUTCMinutes()) + ':' + * f(this.getUTCSeconds()) + 'Z'; * }; * </pre> * * You can provide an optional replacer method. It will be passed the * key and value of each member, with this bound to the containing * object. The value that is returned from your method will be * serialized. If your method returns undefined, then the member will * be excluded from the serialization. * * If the replacer parameter is an array of strings, then it will be * used to select the members to be serialized. It filters the results * such that only members with keys listed in the replacer array are * stringified. * * Values that do not have JSON representations, such as undefined or * functions, will not be serialized. Such values in objects will be * dropped; in arrays they will be replaced with null. You can use * a replacer function to replace those with JSON values. * JSON.stringify(undefined) returns undefined. * * The optional space parameter produces a stringification of the * value that is filled with line breaks and indentation to make it * easier to read. * * If the space parameter is a non-empty string, then that string will * be used for indentation. If the space parameter is a number, then * the indentation will be that many spaces. * * Example: * * <pre class="javascript"> * text = JSON.stringify(['e', {pluribus: 'unum'}]); * // text is '["e",{"pluribus":"unum"}]' * * * text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); * // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' * * text = JSON.stringify([new Date()], function (key, value) { * return this[key] instanceof Date ? * 'Date(' + this[key] + ')' : value; * }); * // text is '["Date(---current time---)"]' * </pre> * * @signature function(value, replacer, space) * * @param value {var} any JavaScript value, usually an object or array. * * @param replacer {Function?} an optional parameter that determines how * object values are stringified for objects. It can be a function or an * array of strings. * * @param space {String?} an optional parameter that specifies the * indentation of nested structures. If it is omitted, the text will * be packed without extra whitespace. If it is a number, it will specify * the number of spaces to indent at each level. If it is a string * (such as '\t' or '&nbsp;'), it contains the characters used to indent * at each level. * * @return {String} The JSON string of the value */ stringify : null, // will be set in the defer block /** * This method parses a JSON text to produce an object or array. * It can throw a SyntaxError exception. * * The optional reviver parameter is a function that can filter and * transform the results. It receives each of the keys and values, * and its return value is used instead of the original value. * If it returns what it received, then the structure is not modified. * If it returns undefined then the member is deleted. * * Example: * * <pre class="javascript"> * // Parse the text. Values that look like ISO date strings will * // be converted to Date objects. * * myData = JSON.parse(text, function (key, value) * { * if (typeof value === 'string') * { * var a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); * if (a) { * return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); * } * } * return value; * }); * * myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { * var d; * if (typeof value === 'string' && * value.slice(0, 5) === 'Date(' && * value.slice(-1) === ')') { * d = new Date(value.slice(5, -1)); * if (d) { * return d; * } * } * return value; * }); * </pre> * * @signature function(text, reviver) * * @param text {String} JSON string to parse * * @param reviver {Function?} Optional reviver function to filter and * transform the results * * @return {Object} The parsed JSON object */ parse : null }, defer : function(statics){ statics.stringify = statics.JSON.stringify; statics.parse = statics.JSON.parse; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.storage.UserData#getLength) #require(qx.bom.storage.UserData#setItem) #require(qx.bom.storage.UserData#getItem) #require(qx.bom.storage.UserData#removeItem) #require(qx.bom.storage.UserData#clear) #require(qx.bom.storage.UserData#getKey) #require(qx.bom.storage.UserData#forEach) ************************************************************************ */ /** * Fallback storage implementation usable in IE browsers. It is recommended to use * these implementation only in IE < 8 because IE >= 8 supports * {@link qx.bom.storage.Web}. */ qx.Bootstrap.define("qx.bom.storage.UserData", { statics : { __local : null, __session : null, // global id used as key for the storage __id : 0, /** * Returns an instance of {@link qx.bom.storage.UserData} used to store * data persistent. * @return {qx.bom.storage.UserData} A storage instance. */ getLocal : function(){ if(this.__local){ return this.__local; }; return this.__local = new qx.bom.storage.UserData("local"); }, /** * Returns an instance of {@link qx.bom.storage.UserData} used to store * data persistent. * @return {qx.bom.storage.UserData} A storage instance. */ getSession : function(){ if(this.__session){ return this.__session; }; return this.__session = new qx.bom.storage.UserData("session"); } }, /** * Create a new instance. Usually, you should take the static * accessors to get your instance. * * @param storeName {String} type of storage. */ construct : function(storeName){ // create a dummy DOM element used for storage this.__el = document.createElement("div"); this.__el.style["display"] = "none"; document.getElementsByTagName("head")[0].appendChild(this.__el); this.__el.addBehavior("#default#userdata"); this.__storeName = storeName; // load the inital data which might be stored this.__el.load(this.__storeName); // set up the internal reference maps this.__storage = { }; this.__reference = { }; // initialize var value = this.__el.getAttribute("qx" + qx.bom.storage.UserData.__id); while(value != undefined){ value = qx.lang.Json.parse(value); // save the data in the internal storage this.__storage[value.key] = value.value; // save the reference this.__reference[value.key] = "qx" + qx.bom.storage.UserData.__id; qx.bom.storage.UserData.__id++; value = this.__el.getAttribute("qx" + qx.bom.storage.UserData.__id); }; }, members : { __el : null, __storeName : "qxtest", // storage which holds the key and the value __storage : null, // reference store which holds the key and the key used to store __reference : null, /** * Returns the map used to keep a in memory copy of the stored data. * @return {Map} The stored data. * @internal */ getStorage : function(){ return this.__storage; }, /** * Returns the amount of key-value pairs stored. * @return {Integer} The length of the storage. */ getLength : function(){ return Object.keys(this.__storage).length; }, /** * Store an item in the storage. * * @param key {String} The identifier key. * @param value {var} The data, which will be stored as JSON. */ setItem : function(key, value){ // override case if(this.__reference[key]){ var storageKey = this.__reference[key]; } else { var storageKey = "qx" + qx.bom.storage.UserData.__id; qx.bom.storage.UserData.__id++; }; // build and save the data used to store both, key and value var storageValue = qx.lang.Json.stringify({ key : key, value : value }); this.__el.setAttribute(storageKey, storageValue); this.__el.save(this.__storeName); // also update the internal mappings this.__storage[key] = value; this.__reference[key] = storageKey; }, /** * Returns the stored item. * * @param key {String} The identifier to get the data. * @return {var} The stored data. */ getItem : function(key){ return this.__storage[key] || null; }, /** * Removes an item form the storage. * @param key {String} The identifier. */ removeItem : function(key){ // check if the item is availabel var storageName = this.__reference[key]; if(storageName == undefined){ return; }; // remove the item this.__el.removeAttribute(storageName); // decrease the id because we removed one item qx.bom.storage.UserData.__id--; // update the internal maps delete this.__storage[key]; delete this.__reference[key]; // check if we have deleted the last item var lastStoreName = "qx" + qx.bom.storage.UserData.__id; if(this.__el.getAttribute(lastStoreName)){ // if not, move the last item to the deleted spot var lastItem = this.__el.getAttribute("qx" + qx.bom.storage.UserData.__id); this.__el.removeAttribute(lastStoreName); this.__el.setAttribute(storageName, lastItem); // update the reference map var lastKey = qx.lang.Json.parse(lastItem).key; this.__reference[lastKey] = storageName; }; this.__el.save(this.__storeName); }, /** * Deletes every stored item in the storage. */ clear : function(){ // delete all entries from the storage for(var key in this.__reference){ this.__el.removeAttribute(this.__reference[key]); }; this.__el.save(this.__storeName); // reset the internal maps this.__storage = { }; this.__reference = { }; }, /** * Returns the named key at the given index. * @param index {Integer} The index in the storage. * @return {String} The key stored at the given index. */ getKey : function(index){ return Object.keys(this.__storage)[index]; }, /** * Helper to access every stored item. * * @param callback {Function} A function which will be called for every item. * The function will have two arguments, first the key and second the value * of the stored data. * @param scope {var} The scope of the function. */ forEach : function(callback, scope){ var length = this.getLength(); for(var i = 0;i < length;i++){ var key = this.getKey(i); callback.call(scope, key, this.getItem(key)); }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.storage.Memory#getLength) #require(qx.bom.storage.Memory#setItem) #require(qx.bom.storage.Memory#getItem) #require(qx.bom.storage.Memory#removeItem) #require(qx.bom.storage.Memory#clear) #require(qx.bom.storage.Memory#getKey) #require(qx.bom.storage.Memory#forEach) ************************************************************************ */ /** * Fallback storage implementation which offers the same API as every other storage * but is not persistent. Basically, its just a storage API on a JavaScript map. */ qx.Bootstrap.define("qx.bom.storage.Memory", { statics : { __local : null, __session : null, /** * Returns an instance of {@link qx.bom.storage.Memory} which is of course * not persisted on reload. * @return {qx.bom.storage.Memory} A memory storage. */ getLocal : function(){ if(this.__local){ return this.__local; }; return this.__local = new qx.bom.storage.Memory(); }, /** * Returns an instance of {@link qx.bom.storage.Memory} which is of course * not persisted on reload. * @return {qx.bom.storage.Memory} A memory storage. */ getSession : function(){ if(this.__session){ return this.__session; }; return this.__session = new qx.bom.storage.Memory(); } }, construct : function(){ this.__storage = { }; }, members : { __storage : null, /** * Returns the internal used map. * @return {Map} The storage. * @internal */ getStorage : function(){ return this.__storage; }, /** * Returns the amount of key-value pairs stored. * @return {Integer} The length of the storage. */ getLength : function(){ return Object.keys(this.__storage).length; }, /** * Store an item in the storage. * * @param key {String} The identifier key. * @param value {var} The data, which will be stored as JSON. */ setItem : function(key, value){ value = qx.lang.Json.stringify(value); this.__storage[key] = value; }, /** * Returns the stored item. * * @param key {String} The identifier to get the data. * @return {var} The stored data. */ getItem : function(key){ var item = this.__storage[key]; if(qx.lang.Type.isString(item)){ item = qx.lang.Json.parse(item); }; return item; }, /** * Removes an item form the storage. * @param key {String} The identifier. */ removeItem : function(key){ delete this.__storage[key]; }, /** * Deletes every stored item in the storage. */ clear : function(){ this.__storage = { }; }, /** * Returns the named key at the given index. * @param index {Integer} The index in the storage. * @return {String} The key stored at the given index. */ getKey : function(index){ var keys = Object.keys(this.__storage); return keys[index]; }, /** * Helper to access every stored item. * * @param callback {Function} A function which will be called for every item. * The function will have two arguments, first the key and second the value * of the stored data. * @param scope {var} The scope of the function. */ forEach : function(callback, scope){ var length = this.getLength(); for(var i = 0;i < length;i++){ var key = this.getKey(i); callback.call(scope, key, this.getItem(key)); }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /** * CSS/Style property manipulation module */ qx.Bootstrap.define("qx.module.Css", { statics : { /** * Modifies the given style property on all elements in the collection. * * @attach {qxWeb} * @param name {String} Name of the style property to modify * @param value {var} The value to apply * @return {qxWeb} The collection for chaining */ setStyle : function(name, value){ if(/\w-\w/.test(name)){ name = qx.lang.String.camelCase(name); }; for(var i = 0;i < this.length;i++){ qx.bom.element.Style.set(this[i], name, value); }; return this; }, /** * Returns the value of the given style property for the first item in the * collection. * * @attach {qxWeb} * @param name {String} Style property name * @return {var} Style property value */ getStyle : function(name){ if(this[0]){ if(/\w-\w/.test(name)){ name = qx.lang.String.camelCase(name); }; return qx.bom.element.Style.get(this[0], name); }; return null; }, /** * Sets multiple style properties for each item in the collection. * * @attach {qxWeb} * @param styles {Map} A map of style property name/value pairs * @return {qxWeb} The collection for chaining */ setStyles : function(styles){ for(var name in styles){ this.setStyle(name, styles[name]); }; return this; }, /** * Returns the values of multiple style properties for each item in the * collection * * @attach {qxWeb} * @param names {String[]} List of style property names * @return {Map} Map of style property name/value pairs */ getStyles : function(names){ var styles = { }; for(var i = 0;i < names.length;i++){ styles[names[i]] = this.getStyle(names[i]); }; return styles; }, /** * Adds a class name to each element in the collection * * @attach {qxWeb} * @param name {String} Class name * @return {qxWeb} The collection for chaining */ addClass : function(name){ for(var i = 0;i < this.length;i++){ qx.bom.element.Class.add(this[i], name); }; return this; }, /** * Adds multiple class names to each element in the collection * * @attach {qxWeb} * @param names {String[]} List of class names to add * @return {qxWeb} The collection for chaining */ addClasses : function(names){ for(var i = 0;i < this.length;i++){ qx.bom.element.Class.addClasses(this[i], names); }; return this; }, /** * Removes a class name from each element in the collection * * @attach {qxWeb} * @param name {String} The class name to remove * @return {qxWeb} The collection for chaining */ removeClass : function(name){ for(var i = 0;i < this.length;i++){ qx.bom.element.Class.remove(this[i], name); }; return this; }, /** * Removes multiple class names from each element in the collection * * @attach {qxWeb} * @param names {String[]} List of class names to remove * @return {qxWeb} The collection for chaining */ removeClasses : function(names){ for(var i = 0;i < this.length;i++){ qx.bom.element.Class.removeClasses(this[i], names); }; return this; }, /** * Checks if the first element in the collection has the given class name * * @attach {qxWeb} * @param name {String} Class name to check for * @return {Boolean} <code>true</code> if the first item has the given class name */ hasClass : function(name){ if(!this[0]){ return false; }; return qx.bom.element.Class.has(this[0], name); }, /** * Returns the class name of the first element in the collection * * @attach {qxWeb} * @return {String} Class name */ getClass : function(){ if(!this[0]){ return ""; }; return qx.bom.element.Class.get(this[0]); }, /** * Toggles the given class name on each item in the collection * * @attach {qxWeb} * @param name {String} Class name * @return {qxWeb} The collection for chaining */ toggleClass : function(name){ var bCls = qx.bom.element.Class; for(var i = 0,l = this.length;i < l;i++){ bCls.has(this[i], name) ? bCls.remove(this[i], name) : bCls.add(this[i], name); }; return this; }, /** * Toggles the given list of class names on each item in the collection * * @attach {qxWeb} * @param names {String[]} Class names * @return {qxWeb} The collection for chaining */ toggleClasses : function(names){ for(var i = 0,l = names.length;i < l;i++){ this.toggleClass(names[i]); }; return this; }, /** * Replaces a class name on each element in the collection * * @attach {qxWeb} * @param oldName {String} Class name to remove * @param newName {String} Class name to add * @return {qxWeb} The collection for chaining */ replaceClass : function(oldName, newName){ for(var i = 0,l = this.length;i < l;i++){ qx.bom.element.Class.replace(this[i], oldName, newName); }; return this; }, /** * Returns the rendered height of the first element in the collection. * @attach {qxWeb} * @return {Number} The first item's rendered height */ getHeight : function(){ var elem = this[0]; if(elem){ if(qx.dom.Node.isElement(elem)){ return qx.bom.element.Dimension.getHeight(elem); } else if(qx.dom.Node.isDocument(elem)){ return qx.bom.Document.getHeight(qx.dom.Node.getWindow(elem)); } else if(qx.dom.Node.isWindow(elem)){ return qx.bom.Viewport.getHeight(elem); };; }; return null; }, /** * Returns the rendered width of the first element in the collection * @attach {qxWeb} * @return {Number} The first item's rendered width */ getWidth : function(){ var elem = this[0]; if(elem){ if(qx.dom.Node.isElement(elem)){ return qx.bom.element.Dimension.getWidth(elem); } else if(qx.dom.Node.isDocument(elem)){ return qx.bom.Document.getWidth(qx.dom.Node.getWindow(elem)); } else if(qx.dom.Node.isWindow(elem)){ return qx.bom.Viewport.getWidth(elem); };; }; return null; }, /** * Returns the computed location of the given element in the context of the * document dimensions. * * @attach {qxWeb} * @return {Map} A map with the keys <code>left<code/>, <code>top<code/>, * <code>right<code/> and <code>bottom<code/> which contains the distance * of the element relative to the document. */ getOffset : function(){ var elem = this[0]; if(elem){ return qx.bom.element.Location.get(elem); }; return null; }, /** * Returns the content height of the first element in the collection. * This is the maximum height the element can use, excluding borders, * margins, padding or scroll bars. * @attach {qxWeb} * @return {Number} Computed content height */ getContentHeight : function(){ var obj = this[0]; if(qx.dom.Node.isElement(obj)){ return qx.bom.element.Dimension.getContentHeight(obj); }; return null; }, /** * Returns the content width of the first element in the collection. * This is the maximum width the element can use, excluding borders, * margins, padding or scroll bars. * @attach {qxWeb} * @return {Number} Computed content width */ getContentWidth : function(){ var obj = this[0]; if(qx.dom.Node.isElement(obj)){ return qx.bom.element.Dimension.getContentWidth(obj); }; return null; }, /** * Returns the distance between the first element in the collection and its * offset parent * * @attach {qxWeb} * @return {Map} a map with the keys <code>left</code> and <code>top</code> * containing the distance between the elements */ getPosition : function(){ var obj = this[0]; if(qx.dom.Node.isElement(obj)){ return qx.bom.element.Location.getPosition(obj); }; return null; }, /** * Includes a Stylesheet file * * @attachStatic {qxWeb} * @param uri {String} The stylesheet's URI * @param doc {Document?} Document to modify */ includeStylesheet : function(uri, doc){ qx.bom.Stylesheet.includeFile(uri, doc); }, /** * Hides all elements in the collection by setting their "display" * style to "none". The previous value is stored so it can be re-applied * when {@link #show} is called. * * @attach {qxWeb} * @return {qxWeb} The collection for chaining */ hide : function(){ for(var i = 0,l = this.length;i < l;i++){ var item = this.slice(i, i + 1); var prevStyle = item.getStyle("display"); if(prevStyle !== "none"){ item[0].$$qPrevDisp = prevStyle; item.setStyle("display", "none"); }; }; return this; }, /** * Shows any elements with "display: none" in the collection. If an element * was hidden by using the {@link #hide} method, its previous * "display" style value will be re-applied. Otherwise, the * default "display" value for the element type will be applied. * * @attach {qxWeb} * @return {qxWeb} The collection for chaining */ show : function(){ for(var i = 0,l = this.length;i < l;i++){ var item = this.slice(i, i + 1); var currentVal = item.getStyle("display"); var prevVal = item[0].$$qPrevDisp; var newVal; if(currentVal == "none"){ if(prevVal && prevVal != "none"){ newVal = prevVal; } else { var doc = qxWeb.getDocument(item[0]); newVal = qx.module.Css.__getDisplayDefault(item[0].tagName, doc); }; item.setStyle("display", newVal); item[0].$$qPrevDisp = "none"; }; }; return this; }, /** * Maps HTML elements to their default "display" style values. */ __displayDefaults : { }, /** * Attempts tp determine the default "display" style value for * elements with the given tag name. * * @param tagName {String} Tag name * @param doc {Document?} Document element. Default: The current document * @return {String} The default "display" value, e.g. <code>inline</code> * or <code>block</code> */ __getDisplayDefault : function(tagName, doc){ var defaults = qx.module.Css.__displayDefaults; if(!defaults[tagName]){ var docu = doc || document; var tempEl = qxWeb(docu.createElement(tagName)).appendTo(doc.body); defaults[tagName] = tempEl.getStyle("display"); tempEl.remove(); }; return defaults[tagName] || ""; } }, defer : function(statics){ qxWeb.$attach({ "setStyle" : statics.setStyle, "getStyle" : statics.getStyle, "setStyles" : statics.setStyles, "getStyles" : statics.getStyles, "addClass" : statics.addClass, "addClasses" : statics.addClasses, "removeClass" : statics.removeClass, "removeClasses" : statics.removeClasses, "hasClass" : statics.hasClass, "getClass" : statics.getClass, "toggleClass" : statics.toggleClass, "toggleClasses" : statics.toggleClasses, "replaceClass" : statics.replaceClass, "getHeight" : statics.getHeight, "getWidth" : statics.getWidth, "getOffset" : statics.getOffset, "getContentHeight" : statics.getContentHeight, "getContentWidth" : statics.getContentWidth, "getPosition" : statics.getPosition, "hide" : statics.hide, "show" : statics.show }); qxWeb.$attachStatic({ "includeStylesheet" : statics.includeStylesheet }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class takes care of the normalization of the native 'String' object. * Therefore it checks the availability of the following methods and appends * it, if not available. This means you can use the methods during * development in every browser. For usage samples, check out the attached links. * * *trim*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim">MDN documentation</a> | * <a href="http://es5.github.com/#x15.5.4.20">Annotated ES5 Spec</a> */ qx.Bootstrap.define("qx.lang.normalize.String", { defer : function(){ // trim if(!qx.core.Environment.get("ecmascript.string.trim")){ String.prototype.trim = function(context){ return this.replace(/^\s+|\s+$/g, ''); }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ====================================================================== This class contains code based on the following work: * Mootools http://mootools.net/ Version 1.1.1 Copyright: (c) 2007 Valerio Proietti License: MIT: http://www.opensource.org/licenses/mit-license.php and * XRegExp http://xregexp.com/ Version 1.5 Copyright: (c) 2006-2007, Steven Levithan <http://stevenlevithan.com> License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Steven Levithan ************************************************************************ */ /* ************************************************************************ #require(qx.lang.normalize.String) ************************************************************************ */ /** * String helper functions * * The native JavaScript String is not modified by this class. However, * there are modifications to the native String in {@link qx.lang.normalize.String} for * browsers that do not support certain features. */ qx.Bootstrap.define("qx.lang.String", { statics : { /** * Unicode letters. they are taken from Steve Levithan's excellent XRegExp library [http://xregexp.com/plugins/xregexp-unicode-base.js] */ __unicodeLetters : "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", /** * A RegExp that matches the first letter in a word - unicode aware */ __unicodeFirstLetterInWordRegexp : null, /** * {Map} Cache for often used string operations [camelCasing and hyphenation] * e.g. marginTop => margin-top */ __stringsMap : { }, /** * Converts a hyphenated string (separated by '-') to camel case. * * Example: * <pre class='javascript'>qx.lang.String.camelCase("I-like-cookies"); //returns "ILikeCookies"</pre> * The implementation does not force a lowerCamelCase or upperCamelCase version. * (think java variables that start with lower case versus classnames that start with capital letter) * The first letter of the parameter keeps its case. * * @param str {String} hyphenated string * @return {String} camelcase string */ camelCase : function(str){ var result = this.__stringsMap[str]; if(!result){ result = str.replace(/\-([a-z])/g, function(match, chr){ return chr.toUpperCase(); }); this.__stringsMap[str] = result; }; return result; }, /** * Converts a camelcased string to a hyphenated (separated by '-') string. * * Example: * <pre class='javascript'>qx.lang.String.hyphenate("ILikeCookies"); //returns "I-like-cookies"</pre> * The implementation does not force a lowerCamelCase or upperCamelCase version. * (think java variables that start with lower case versus classnames that start with capital letter) * The first letter of the parameter keeps its case. * * @param str {String} camelcased string * @return {String} hyphenated string */ hyphenate : function(str){ var result = this.__stringsMap[str]; if(!result){ result = str.replace(/[A-Z]/g, function(match){ return ('-' + match.charAt(0).toLowerCase()); }); this.__stringsMap[str] = result; }; return result; }, /** * Converts a string to camel case. * * Example: * <pre class='javascript'>qx.lang.String.camelCase("i like cookies"); //returns "I Like Cookies"</pre> * * @param str {String} any string * @return {String} capitalized string */ capitalize : function(str){ if(this.__unicodeFirstLetterInWordRegexp === null){ var unicodeEscapePrefix = '\\u'; this.__unicodeFirstLetterInWordRegexp = new RegExp("(^|[^" + this.__unicodeLetters.replace(/[0-9A-F]{4}/g, function(match){ return unicodeEscapePrefix + match; }) + "])[" + this.__unicodeLetters.replace(/[0-9A-F]{4}/g, function(match){ return unicodeEscapePrefix + match; }) + "]", "g"); }; return str.replace(this.__unicodeFirstLetterInWordRegexp, function(match){ return match.toUpperCase(); }); }, /** * Removes all extraneous whitespace from a string and trims it * * Example: * * <code> * qx.lang.String.clean(" i like cookies \n\n"); * </code> * * Returns "i like cookies" * * @param str {String} the string to clean up * @return {String} Cleaned up string */ clean : function(str){ return str.replace(/\s+/g, ' ').trim(); }, /** * removes white space from the left side of a string * * @param str {String} the string to trim * @return {String} the trimmed string */ trimLeft : function(str){ return str.replace(/^\s+/, ""); }, /** * removes white space from the right side of a string * * @param str {String} the string to trim * @return {String} the trimmed string */ trimRight : function(str){ return str.replace(/\s+$/, ""); }, /** * removes white space from the left and the right side of a string * * @deprecated {2.1} please use the native trim method. * @param str {String} the string to trim * @return {String} the trimmed string */ trim : function(str){ { }; return str.replace(/^\s+|\s+$/g, ""); }, /** * Check whether the string starts with the given substring * * @param fullstr {String} the string to search in * @param substr {String} the substring to look for * @return {Boolean} whether the string starts with the given substring */ startsWith : function(fullstr, substr){ return fullstr.indexOf(substr) === 0; }, /** * Check whether the string ends with the given substring * * @param fullstr {String} the string to search in * @param substr {String} the substring to look for * @return {Boolean} whether the string ends with the given substring */ endsWith : function(fullstr, substr){ return fullstr.substring(fullstr.length - substr.length, fullstr.length) === substr; }, /** * Returns a string, which repeats a string 'length' times * * @param str {String} string used to repeat * @param times {Integer} the number of repetitions * @return {String} repeated string */ repeat : function(str, times){ return str.length > 0 ? new Array(times + 1).join(str) : ""; }, /** * Pad a string up to a given length. Padding characters are added to the left of the string. * * @param str {String} the string to pad * @param length {Integer} the final length of the string * @param ch {String} character used to fill up the string * @return {String} padded string */ pad : function(str, length, ch){ var padLength = length - str.length; if(padLength > 0){ if(typeof ch === "undefined"){ ch = "0"; }; return this.repeat(ch, padLength) + str; } else { return str; }; }, /** * Convert the first character of the string to upper case. * * @signature function(str) * @param str {String} the string * @return {String} the string with an upper case first character */ firstUp : qx.Bootstrap.firstUp, /** * Convert the first character of the string to lower case. * * @signature function(str) * @param str {String} the string * @return {String} the string with a lower case first character */ firstLow : qx.Bootstrap.firstLow, /** * Check whether the string contains a given substring * * @param str {String} the string * @param substring {String} substring to search for * @return {Boolean} whether the string contains the substring */ contains : function(str, substring){ return str.indexOf(substring) != -1; }, /** * Print a list of arguments using a format string * In the format string occurrences of %n are replaced by the n'th element of the args list. * Example: * <pre class='javascript'>qx.lang.String.format("Hello %1, my name is %2", ["Egon", "Franz"]) == "Hello Egon, my name is Franz"</pre> * * @param pattern {String} format string * @param args {Array} array of arguments to insert into the format string * @return {String} the formatted string */ format : function(pattern, args){ var str = pattern; var i = args.length; while(i--){ // be sure to always use a string for replacement. str = str.replace(new RegExp("%" + (i + 1), "g"), args[i] + ""); }; return str; }, /** * Escapes all chars that have a special meaning in regular expressions * * @param str {String} the string where to escape the chars. * @return {String} the string with the escaped chars. */ escapeRegexpChars : function(str){ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }, /** * Converts a string to an array of characters. * <pre>"hello" => [ "h", "e", "l", "l", "o" ];</pre> * * @param str {String} the string which should be split * @return {Array} the result array of characters */ toArray : function(str){ return str.split(/\B|\b/g); }, /** * Remove HTML/XML tags from a string * Example: * <pre class='javascript'>qx.lang.String.stripTags("&lt;h1>Hello&lt;/h1>") == "Hello"</pre> * * @param str {String} string containing tags * @return {String} the string with stripped tags */ stripTags : function(str){ return str.replace(/<\/?[^>]+>/gi, ""); }, /** * Strips <script> tags including its content from the given string. * * @param str {String} string containing tags * @param exec {Boolean?false} Whether the filtered code should be executed * @return {String} The filtered string */ stripScripts : function(str, exec){ var scripts = ""; var text = str.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){ scripts += arguments[1] + '\n'; return ""; }); if(exec === true){ qx.lang.Function.globalEval(scripts); }; return text; }, /** * Quotes the given string. * @param str {String} String to quote. * @return {String} The quoted string. */ quote : function(str){ return '"' + str.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"") + '"'; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /* ************************************************************************ #ignore(WebKitCSSMatrix) ************************************************************************ */ /** * The purpose of this class is to contain all checks about css. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.Css", { statics : { __WEBKIT_LEGACY_GRADIENT : null, /** * Checks what box model is used in the current environemnt. * @return {String} It either returns "content" or "border". * @internal */ getBoxModel : function(){ var content = qx.bom.client.Engine.getName() !== "mshtml" || !qx.bom.client.Browser.getQuirksMode(); return content ? "content" : "border"; }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>textOverflow</code> style property. * * @return {String|null} textOverflow property name or <code>null</code> if * textOverflow is not supported. * @internal */ getTextOverflow : function(){ return qx.bom.Style.getPropertyName("textOverflow"); }, /** * Checks if a placeholder could be used. * @return {Boolean} <code>true</code>, if it could be used. * @internal */ getPlaceholder : function(){ var i = document.createElement("input"); return "placeholder" in i; }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>appearance</code> style property. * * @return {String|null} appearance property name or <code>null</code> if * appearance is not supported. * @internal */ getAppearance : function(){ return qx.bom.Style.getPropertyName("appearance"); }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>borderRadius</code> style property. * * @return {String|null} borderRadius property name or <code>null</code> if * borderRadius is not supported. * @internal */ getBorderRadius : function(){ return qx.bom.Style.getPropertyName("borderRadius"); }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>boxShadow</code> style property. * * @return {String|null} boxShadow property name or <code>null</code> if * boxShadow is not supported. * @internal */ getBoxShadow : function(){ return qx.bom.Style.getPropertyName("boxShadow"); }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>borderImage</code> style property. * * @return {String|null} borderImage property name or <code>null</code> if * borderImage is not supported. * @internal */ getBorderImage : function(){ return qx.bom.Style.getPropertyName("borderImage"); }, /** * Returns the type of syntax this client supports for its CSS border-image * implementation. Some browsers do not support the "fill" keyword defined * in the W3C draft (http://www.w3.org/TR/css3-background/) and will not * show the border image if it's set. Others follow the standard closely and * will omit the center image if "fill" is not set. * * @return {Boolean|null} <code>true</code> if the standard syntax is supported. * <code>null</code> if the supported syntax could not be detected. * @internal */ getBorderImageSyntax : function(){ var styleName = qx.bom.client.Css.getBorderImage(); if(!styleName){ return null; }; var el = document.createElement("div"); if(styleName === "borderImage"){ // unprefixed implementation: check individual properties el.style[styleName] = 'url("foo.png") 4 4 4 4 fill stretch'; if(el.style.borderImageSource.indexOf("foo.png") >= 0 && el.style.borderImageSlice.indexOf("4 fill") >= 0 && el.style.borderImageRepeat.indexOf("stretch") >= 0){ return true; }; } else { // prefixed implementation, assume no support for "fill" el.style[styleName] = 'url("foo.png") 4 4 4 4 stretch'; // serialized value is unreliable, so just a simple check if(el.style[styleName].indexOf("foo.png") >= 0){ return false; }; }; // unable to determine syntax return null; }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>userSelect</code> style property. * * @return {String|null} userSelect property name or <code>null</code> if * userSelect is not supported. * @internal */ getUserSelect : function(){ return qx.bom.Style.getPropertyName("userSelect"); }, /** * Returns the (possibly vendor-prefixed) value for the * <code>userSelect</code> style property that disables selection. For Gecko, * "-moz-none" is returned since "none" only makes the target element appear * as if its text could not be selected * * @internal * @return {String|null} the userSelect property value that disables * selection or <code>null</code> if userSelect is not supported */ getUserSelectNone : function(){ var styleProperty = qx.bom.client.Css.getUserSelect(); if(styleProperty){ var el = document.createElement("span"); el.style[styleProperty] = "-moz-none"; return el.style[styleProperty] === "-moz-none" ? "-moz-none" : "none"; }; return null; }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>userModify</code> style property. * * @return {String|null} userModify property name or <code>null</code> if * userModify is not supported. * @internal */ getUserModify : function(){ return qx.bom.Style.getPropertyName("userModify"); }, /** * Returns the vendor-specific name of the <code>float</code> style property * * @return {String|null} <code>cssFloat</code> for standards-compliant * browsers, <code>styleFloat</code> for legacy IEs, <code>null</code> if * the client supports neither property. * @internal */ getFloat : function(){ var style = document.documentElement.style; return style.cssFloat !== undefined ? "cssFloat" : style.styleFloat !== undefined ? "styleFloat" : null; }, /** * Checks if translate3d can be used. * @return {Boolean} <code>true</code>, if it could be used. * @internal * @lint ignoreUndefined(WebKitCSSMatrix) */ getTranslate3d : function(){ return 'WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix(); }, /** * Returns the (possibly vendor-prefixed) name this client uses for * <code>linear-gradient</code>. * http://dev.w3.org/csswg/css3-images/#linear-gradients * * @return {String|null} Prefixed linear-gradient name or <code>null</code> * if linear gradients are not supported * @internal */ getLinearGradient : function(){ qx.bom.client.Css.__WEBKIT_LEGACY_GRADIENT = false; var value = "linear-gradient(0deg, #fff, #000)"; var el = document.createElement("div"); var style = qx.bom.Style.getAppliedStyle(el, "backgroundImage", value); if(!style){ //try old WebKit syntax (versions 528 - 534.16) value = "-webkit-gradient(linear,0% 0%,100% 100%,from(white), to(red))"; var style = qx.bom.Style.getAppliedStyle(el, "backgroundImage", value, false); if(style){ qx.bom.client.Css.__WEBKIT_LEGACY_GRADIENT = true; }; }; // not supported if(!style){ return null; }; var match = /(.*?)\(/.exec(style); return match ? match[1] : null; }, /** * Returns <code>true</code> if the browser supports setting gradients * using the filter style. This usually only applies for IE browsers * starting from IE5.5. * http://msdn.microsoft.com/en-us/library/ms532997(v=vs.85).aspx * * @return {Boolean} <code>true</code> if supported. * @internal */ getFilterGradient : function(){ return qx.bom.client.Css.__isFilterSupported("DXImageTransform.Microsoft.Gradient", "startColorStr=#550000FF, endColorStr=#55FFFF00"); }, /** * Returns the (possibly vendor-prefixed) name this client uses for * <code>radial-gradient</code>. * * @return {String|null} Prefixed radial-gradient name or <code>null</code> * if radial gradients are not supported * @internal */ getRadialGradient : function(){ var value = "radial-gradient(0px 0px, cover, red 50%, blue 100%)"; var el = document.createElement("div"); var style = qx.bom.Style.getAppliedStyle(el, "backgroundImage", value); if(!style){ return null; }; var match = /(.*?)\(/.exec(style); return match ? match[1] : null; }, /** * Checks if **only** the old WebKit (version < 534.16) syntax for * linear gradients is supported, e.g. * <code>linear-gradient(0deg, #fff, #000)</code> * * @return {Boolean} <code>true</code> if the legacy syntax must be used * @internal */ getLegacyWebkitGradient : function(){ if(qx.bom.client.Css.__WEBKIT_LEGACY_GRADIENT === null){ qx.bom.client.Css.getLinearGradient(); }; return qx.bom.client.Css.__WEBKIT_LEGACY_GRADIENT; }, /** * Checks if rgba colors can be used: * http://www.w3.org/TR/2010/PR-css3-color-20101028/#rgba-color * * @return {Boolean} <code>true</code>, if rgba colors are supported. * @internal */ getRgba : function(){ var el; try{ el = document.createElement("div"); } catch(ex) { el = document.createElement(); }; // try catch for IE try{ el.style["color"] = "rgba(1, 2, 3, 0.5)"; if(el.style["color"].indexOf("rgba") != -1){ return true; }; } catch(ex) { }; return false; }, /** * Returns the (possibly vendor-prefixed) name the browser uses for the * <code>boxSizing</code> style property. * * @return {String|null} boxSizing property name or <code>null</code> if * boxSizing is not supported. * @internal */ getBoxSizing : function(){ return qx.bom.Style.getPropertyName("boxSizing"); }, /** * Returns the browser-specific name used for the <code>display</code> style * property's <code>inline-block</code> value. * * @internal * @return {String|null} */ getInlineBlock : function(){ var el = document.createElement("span"); el.style.display = "inline-block"; if(el.style.display == "inline-block"){ return "inline-block"; }; el.style.display = "-moz-inline-box"; if(el.style.display !== "-moz-inline-box"){ return "-moz-inline-box"; }; return null; }, /** * Checks if CSS opacity is supported * * @internal * @return {Boolean} <code>true</code> if opacity is supported */ getOpacity : function(){ return (typeof document.documentElement.style.opacity == "string"); }, /** * Checks if the overflowX and overflowY style properties are supported * * @internal * @return {Boolean} <code>true</code> if overflow-x and overflow-y can be * used * @deprecated {2.1} */ getOverflowXY : function(){ return (typeof document.documentElement.style.overflowX == "string") && (typeof document.documentElement.style.overflowY == "string"); }, /** * Checks if CSS texShadow is supported * * @internal * @return {Boolean} <code>true</code> if textShadow is supported */ getTextShadow : function(){ var value = "red 1px 1px 3px"; var el = document.createElement("div"); var style = qx.bom.Style.getAppliedStyle(el, "textShadow", value); return !style; }, /** * Returns <code>true</code> if the browser supports setting text shadow * using the filter style. This usually only applies for IE browsers * starting from IE5.5. * * @internal * @return {Boolean} <code>true</code> if textShadow is supported */ getFilterTextShadow : function(){ return qx.bom.client.Css.__isFilterSupported("DXImageTransform.Microsoft.Shadow", "color=#666666,direction=45"); }, /** * Checks if the given filter is supported. * * @param filterClass {String} The name of the filter class * @param initParams {String} Init values for the filter * @return {Boolean} <code>true</code> if the given filter is supported */ __isFilterSupported : function(filterClass, initParams){ var supported = false; var value = "progid:" + filterClass + "(" + initParams + ");"; var el = document.createElement("div"); document.body.appendChild(el); el.style.filter = value; if(el.filters && el.filters.length > 0 && el.filters.item(filterClass).enabled == true){ supported = true; }; document.body.removeChild(el); return supported; } }, defer : function(statics){ qx.core.Environment.add("css.textoverflow", statics.getTextOverflow); qx.core.Environment.add("css.placeholder", statics.getPlaceholder); qx.core.Environment.add("css.borderradius", statics.getBorderRadius); qx.core.Environment.add("css.boxshadow", statics.getBoxShadow); qx.core.Environment.add("css.gradient.linear", statics.getLinearGradient); qx.core.Environment.add("css.gradient.filter", statics.getFilterGradient); qx.core.Environment.add("css.gradient.radial", statics.getRadialGradient); qx.core.Environment.add("css.gradient.legacywebkit", statics.getLegacyWebkitGradient); qx.core.Environment.add("css.boxmodel", statics.getBoxModel); qx.core.Environment.add("css.rgba", statics.getRgba); qx.core.Environment.add("css.borderimage", statics.getBorderImage); qx.core.Environment.add("css.borderimage.standardsyntax", statics.getBorderImageSyntax); qx.core.Environment.add("css.usermodify", statics.getUserModify); qx.core.Environment.add("css.userselect", statics.getUserSelect); qx.core.Environment.add("css.userselect.none", statics.getUserSelectNone); qx.core.Environment.add("css.appearance", statics.getAppearance); qx.core.Environment.add("css.float", statics.getFloat); qx.core.Environment.add("css.boxsizing", statics.getBoxSizing); qx.core.Environment.add("css.inlineblock", statics.getInlineBlock); qx.core.Environment.add("css.opacity", statics.getOpacity); qx.core.Environment.add("css.overflowxy", statics.getOverflowXY); qx.core.Environment.add("css.textShadow", statics.getTextShadow); qx.core.Environment.add("css.textShadow.filter", statics.getFilterTextShadow); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) * Sebastian Fastner (fastner) ************************************************************************ */ /** * This class is responsible for checking the operating systems name. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.OperatingSystem", { statics : { /** * Checks for the name of the operating system. * @return {String} The name of the operating system. * @internal */ getName : function(){ if(!navigator){ return ""; }; var input = navigator.platform || ""; var agent = navigator.userAgent || ""; if(input.indexOf("Windows") != -1 || input.indexOf("Win32") != -1 || input.indexOf("Win64") != -1){ return "win"; } else if(input.indexOf("Macintosh") != -1 || input.indexOf("MacPPC") != -1 || input.indexOf("MacIntel") != -1 || input.indexOf("Mac OS X") != -1){ return "osx"; } else if(agent.indexOf("RIM Tablet OS") != -1){ return "rim_tabletos"; } else if(agent.indexOf("webOS") != -1){ return "webos"; } else if(input.indexOf("iPod") != -1 || input.indexOf("iPhone") != -1 || input.indexOf("iPad") != -1){ return "ios"; } else if(agent.indexOf("Android") != -1){ return "android"; } else if(input.indexOf("Linux") != -1){ return "linux"; } else if(input.indexOf("X11") != -1 || input.indexOf("BSD") != -1 || input.indexOf("Darwin") != -1){ return "unix"; } else if(input.indexOf("SymbianOS") != -1){ return "symbian"; } else if(input.indexOf("BlackBerry") != -1){ return "blackberry"; };;;;;;;;; // don't know return ""; }, /** Maps user agent names to system IDs */ __ids : { // Windows "Windows NT 6.2" : "8", "Windows NT 6.1" : "7", "Windows NT 6.0" : "vista", "Windows NT 5.2" : "2003", "Windows NT 5.1" : "xp", "Windows NT 5.0" : "2000", "Windows 2000" : "2000", "Windows NT 4.0" : "nt4", "Win 9x 4.90" : "me", "Windows CE" : "ce", "Windows 98" : "98", "Win98" : "98", "Windows 95" : "95", "Win95" : "95", // OS X "Mac OS X 10_7" : "10.7", "Mac OS X 10.7" : "10.7", "Mac OS X 10_6" : "10.6", "Mac OS X 10.6" : "10.6", "Mac OS X 10_5" : "10.5", "Mac OS X 10.5" : "10.5", "Mac OS X 10_4" : "10.4", "Mac OS X 10.4" : "10.4", "Mac OS X 10_3" : "10.3", "Mac OS X 10.3" : "10.3", "Mac OS X 10_2" : "10.2", "Mac OS X 10.2" : "10.2", "Mac OS X 10_1" : "10.1", "Mac OS X 10.1" : "10.1", "Mac OS X 10_0" : "10.0", "Mac OS X 10.0" : "10.0" }, /** * Checks for the version of the operating system using the internal map. * * @internal * @return {String} The version as strin or an empty string if the version * could not be detected. */ getVersion : function(){ var version = qx.bom.client.OperatingSystem.__getVersionForDesktopOs(navigator.userAgent); if(version == null){ version = qx.bom.client.OperatingSystem.__getVersionForMobileOs(navigator.userAgent); }; if(version != null){ return version; } else { return ""; }; }, /** * Detect OS version for desktop devices * @param userAgent {String} userAgent parameter, needed for detection. * @return {String} version number as string or null. */ __getVersionForDesktopOs : function(userAgent){ var str = []; for(var key in qx.bom.client.OperatingSystem.__ids){ str.push(key); }; var reg = new RegExp("(" + str.join("|").replace(/\./g, "\.") + ")", "g"); var match = reg.exec(userAgent); if(match && match[1]){ return qx.bom.client.OperatingSystem.__ids[match[1]]; }; return null; }, /** * Detect OS version for mobile devices * @param userAgent {String} userAgent parameter, needed for detection. * @return {String} version number as string or null. */ __getVersionForMobileOs : function(userAgent){ var android = userAgent.indexOf("Android") != -1; var iOs = userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false; if(android){ var androidVersionRegExp = new RegExp(/ Android (\d+(?:\.\d+)+)/i); var androidMatch = androidVersionRegExp.exec(userAgent); if(androidMatch && androidMatch[1]){ return androidMatch[1]; }; } else if(iOs){ var iOsVersionRegExp = new RegExp(/(CPU|iPhone|iPod) OS (\d+)_(\d+)\s+/); var iOsMatch = iOsVersionRegExp.exec(userAgent); if(iOsMatch && iOsMatch[2] && iOsMatch[3]){ return iOsMatch[2] + "." + iOsMatch[3]; }; }; return null; } }, defer : function(statics){ qx.core.Environment.add("os.name", statics.getName); qx.core.Environment.add("os.version", statics.getVersion); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Christian Hagendorn (chris_schmidt) * Martin Wittemann (martinwittemann) ====================================================================== This class contains code from: Copyright: 2009 Deutsche Telekom AG, Germany, http://telekom.com License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code from: Copyright: 2011 Pocket Widget S.L., Spain, http://www.pocketwidget.com License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php Authors: * Javier Martinez Villacampa ************************************************************************ */ /** #require(qx.bom.client.OperatingSystem#getVersion) */ /** * Basic browser detection for qooxdoo. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.Browser", { statics : { /** * Checks for the name of the browser and returns it. * @return {String} The name of the current browser. * @internal */ getName : function(){ var agent = navigator.userAgent; var reg = new RegExp("(" + qx.bom.client.Browser.__agents + ")(/| )([0-9]+\.[0-9])"); var match = agent.match(reg); if(!match){ return ""; }; var name = match[1].toLowerCase(); var engine = qx.bom.client.Engine.getName(); if(engine === "webkit"){ if(name === "android"){ // Fix Chrome name (for instance wrongly defined in user agent on Android 1.6) name = "mobile chrome"; } else if(agent.indexOf("Mobile Safari") !== -1 || agent.indexOf("Mobile/") !== -1){ // Fix Safari name name = "mobile safari"; }; } else if(engine === "mshtml"){ if(name === "msie"){ name = "ie"; // Fix IE mobile before Microsoft added IEMobile string if(qx.bom.client.OperatingSystem.getVersion() === "ce"){ name = "iemobile"; }; }; } else if(engine === "opera"){ if(name === "opera mobi"){ name = "operamobile"; } else if(name === "opera mini"){ name = "operamini"; }; } else if(engine === "gecko"){ if(agent.indexOf("Maple") !== -1){ name = "maple"; }; };;; return name; }, /** * Determines the version of the current browser. * @return {String} The name of the current browser. * @internal */ getVersion : function(){ var agent = navigator.userAgent; var reg = new RegExp("(" + qx.bom.client.Browser.__agents + ")(/| )([0-9]+\.[0-9])"); var match = agent.match(reg); if(!match){ return ""; }; var name = match[1].toLowerCase(); var version = match[3]; // Support new style version string used by Opera and Safari if(agent.match(/Version(\/| )([0-9]+\.[0-9])/)){ version = RegExp.$2; }; if(qx.bom.client.Engine.getName() == "mshtml"){ // Use the Engine version, because IE8 and higher change the user agent // string to an older version in compatibility mode version = qx.bom.client.Engine.getVersion(); if(name === "msie" && qx.bom.client.OperatingSystem.getVersion() == "ce"){ // Fix IE mobile before Microsoft added IEMobile string version = "5.0"; }; }; if(qx.bom.client.Browser.getName() == "maple"){ // Fix version detection for Samsung Smart TVs Maple browser from 2010 and 2011 models reg = new RegExp("(Maple )([0-9]+\.[0-9]+\.[0-9]*)"); match = agent.match(reg); if(!match){ return ""; }; version = match[2]; }; return version; }, /** * Returns in which document mode the current document is (only for IE). * * @internal * @return {Number} The mode in which the browser is. */ getDocumentMode : function(){ if(document.documentMode){ return document.documentMode; }; return 0; }, /** * Check if in quirks mode. * * @internal * @return {Boolean} <code>true</code>, if the environment is in quirks mode */ getQuirksMode : function(){ if(qx.bom.client.Engine.getName() == "mshtml" && parseFloat(qx.bom.client.Engine.getVersion()) >= 8){ return qx.bom.client.Engine.DOCUMENT_MODE === 5; } else { return document.compatMode !== "CSS1Compat"; }; }, /** * Internal helper map for picking the right browser names to check. */ __agents : { // Safari should be the last one to check, because some other Webkit-based browsers // use this identifier together with their own one. // "Version" is used in Safari 4 to define the Safari version. After "Safari" they place the // Webkit version instead. Silly. // Palm Pre uses both Safari (contains Webkit version) and "Version" contains the "Pre" version. But // as "Version" is not Safari here, we better detect this as the Pre-Browser version. So place // "Pre" in front of both "Version" and "Safari". "webkit" : "AdobeAIR|Titanium|Fluid|Chrome|Android|Epiphany|Konqueror|iCab|OmniWeb|Maxthon|Pre|Mobile Safari|Safari", // Better security by keeping Firefox the last one to match "gecko" : "prism|Fennec|Camino|Kmeleon|Galeon|Netscape|SeaMonkey|Namoroka|Firefox", // No idea what other browsers based on IE's engine "mshtml" : "IEMobile|Maxthon|MSIE", // Keep "Opera" the last one to correctly prefer/match the mobile clients "opera" : "Opera Mini|Opera Mobi|Opera" }[qx.bom.client.Engine.getName()] }, defer : function(statics){ qx.core.Environment.add("browser.name", statics.getName),qx.core.Environment.add("browser.version", statics.getVersion),qx.core.Environment.add("browser.documentmode", statics.getDocumentMode),qx.core.Environment.add("browser.quirksmode", statics.getQuirksMode); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /** * Responsible class for everything concerning styles without the need of * an element. * * If you want to query or modify styles of HTML elements, * take a look at {@see qx.bom.element.Style}. */ qx.Bootstrap.define("qx.bom.Style", { statics : { /** Vendor-specific style property prefixes **/ VENDOR_PREFIXES : ["Webkit", "Moz", "O", "ms", "Khtml"], /** * Takes the name of a style property and returns the name the browser uses * for its implementation, which might include a vendor prefix. * * @param propertyName {String} Style property name to check * @return {String|null} The supported property name or <code>null</code> if * not supported */ getPropertyName : function(propertyName){ var style = document.documentElement.style; if(style[propertyName] !== undefined){ return propertyName; }; for(var i = 0,l = this.VENDOR_PREFIXES.length;i < l;i++){ var prefixedProp = this.VENDOR_PREFIXES[i] + qx.lang.String.firstUp(propertyName); if(style[prefixedProp] !== undefined){ return prefixedProp; }; }; return null; }, /** * Detects CSS support by applying a style to a DOM element of the given type * and verifying the result. Also checks for vendor-prefixed variants of the * value, e.g. "linear-gradient" -> "-webkit-linear-gradient". Returns the * (possibly vendor-prefixed) value if successful or <code>null</code> if * the property and/or value are not supported. * * @param element {Element} element to be used for the detection * @param propertyName {String} the style property to be tested * @param value {String} style property value to be tested * @param prefixed {Boolean?} try to determine the appropriate vendor prefix * for the value. Default: <code>true</code> * @return {String|null} prefixed style value or <code>null</code> if not supported * @internal */ getAppliedStyle : function(element, propertyName, value, prefixed){ var vendorPrefixes = (prefixed !== false) ? [null].concat(this.VENDOR_PREFIXES) : [null]; for(var i = 0,l = vendorPrefixes.length;i < l;i++){ var prefixedVal = vendorPrefixes[i] ? "-" + vendorPrefixes[i].toLowerCase() + "-" + value : value; // IE might throw an exception try{ element.style[propertyName] = prefixedVal; if(typeof element.style[propertyName] == "string" && element.style[propertyName] !== ""){ return prefixedVal; }; } catch(ex) { }; }; return null; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Christian Hagendorn (chris_schmidt) ====================================================================== This class contains code based on the following work: * Prototype JS http://www.prototypejs.org/ Version 1.5 Copyright: (c) 2006-2007, Prototype Core Team License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Prototype Core Team ---------------------------------------------------------------------- Copyright (c) 2005-2008 Sam Stephenson 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 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. ************************************************************************ */ /** * Cross-browser opacity support. * * Optimized for animations (contains workarounds for typical flickering * in some browsers). Reduced class dependencies for optimal size and * performance. */ qx.Bootstrap.define("qx.bom.element.Opacity", { statics : { /** * {Boolean} <code>true</code> when the style attribute "opacity" is supported, * <code>false</code> otherwise. * @deprecated {2.1} Please use qx.core.Environment.get("css.opacity") instead. */ SUPPORT_CSS3_OPACITY : false, /** * Compiles the given opacity value into a cross-browser CSS string. * Accepts numbers between zero and one * where "0" means transparent, "1" means opaque. * * @signature function(opacity) * @param opacity {Float} A float number between 0 and 1 * @return {String} CSS compatible string */ compile : qx.core.Environment.select("engine.name", { "mshtml" : function(opacity){ if(opacity >= 1){ opacity = 1; }; if(opacity < 0.00001){ opacity = 0; }; if(qx.core.Environment.get("css.opacity")){ return "opacity:" + opacity + ";"; } else { return "zoom:1;filter:alpha(opacity=" + (opacity * 100) + ");"; }; }, "default" : function(opacity){ if(opacity >= 1){ return ""; }; return "opacity:" + opacity + ";"; } }), /** * Sets opacity of given element. Accepts numbers between zero and one * where "0" means transparent, "1" means opaque. * * @param element {Element} DOM element to modify * @param opacity {Float} A float number between 0 and 1 * @signature function(element, opacity) */ set : qx.core.Environment.select("engine.name", { "mshtml" : function(element, opacity){ if(qx.core.Environment.get("css.opacity")){ if(opacity >= 1){ opacity = ""; }; element.style.opacity = opacity; } else { // Read in computed filter var filter = qx.bom.element.Style.get(element, "filter", qx.bom.element.Style.COMPUTED_MODE, false); if(opacity >= 1){ opacity = 1; }; if(opacity < 0.00001){ opacity = 0; }; // IE has trouble with opacity if it does not have layout (hasLayout) // Force it by setting the zoom level if(!element.currentStyle || !element.currentStyle.hasLayout){ element.style.zoom = 1; }; // Remove old alpha filter and add new one element.style.filter = filter.replace(/alpha\([^\)]*\)/gi, "") + "alpha(opacity=" + opacity * 100 + ")"; }; }, "default" : function(element, opacity){ if(opacity >= 1){ opacity = ""; }; element.style.opacity = opacity; } }), /** * Resets opacity of given element. * * @param element {Element} DOM element to modify * @signature function(element) */ reset : qx.core.Environment.select("engine.name", { "mshtml" : function(element){ if(qx.core.Environment.get("css.opacity")){ element.style.opacity = ""; } else { // Read in computed filter var filter = qx.bom.element.Style.get(element, "filter", qx.bom.element.Style.COMPUTED_MODE, false); // Remove old alpha filter element.style.filter = filter.replace(/alpha\([^\)]*\)/gi, ""); }; }, "default" : function(element){ element.style.opacity = ""; } }), /** * Gets computed opacity of given element. Accepts numbers between zero and one * where "0" means transparent, "1" means opaque. * * @param element {Element} DOM element to modify * @param mode {Number} Choose one of the modes {@link qx.bom.element.Style#COMPUTED_MODE}, * {@link qx.bom.element.Style#CASCADED_MODE}, {@link qx.bom.element.Style#LOCAL_MODE}. * The computed mode is the default one. * @return {Float} A float number between 0 and 1 * @signature function(element, mode) */ get : qx.core.Environment.select("engine.name", { "mshtml" : function(element, mode){ if(qx.core.Environment.get("css.opacity")){ var opacity = qx.bom.element.Style.get(element, "opacity", mode, false); if(opacity != null){ return parseFloat(opacity); }; return 1.0; } else { var filter = qx.bom.element.Style.get(element, "filter", mode, false); if(filter){ var opacity = filter.match(/alpha\(opacity=(.*)\)/); if(opacity && opacity[1]){ return parseFloat(opacity[1]) / 100; }; }; return 1.0; }; }, "default" : function(element, mode){ var opacity = qx.bom.element.Style.get(element, "opacity", mode, false); if(opacity != null){ return parseFloat(opacity); }; return 1.0; } }) }, // @deprecated {2.1} defer : function(statics){ statics.SUPPORT_CSS3_OPACITY = qx.core.Environment.get("css.opacity"); } }); { }; /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ************************************************************************ */ /* ************************************************************************ #require(qx.lang.normalize.String) ************************************************************************ */ /** * Contains methods to control and query the element's clip property */ qx.Bootstrap.define("qx.bom.element.Clip", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** * Compiles the given clipping into a CSS compatible string. This * is a simple square which describes the visible area of an DOM element. * Changing the clipping does not change the dimensions of * an element. * * @param map {Map} Map which contains <code>left</code>, <code>top</code> * <code>width</code> and <code>height</code> of the clipped area. * @return {String} CSS compatible string */ compile : function(map){ if(!map){ return "clip:auto;"; }; var left = map.left; var top = map.top; var width = map.width; var height = map.height; var right,bottom; if(left == null){ right = (width == null ? "auto" : width + "px"); left = "auto"; } else { right = (width == null ? "auto" : left + width + "px"); left = left + "px"; }; if(top == null){ bottom = (height == null ? "auto" : height + "px"); top = "auto"; } else { bottom = (height == null ? "auto" : top + height + "px"); top = top + "px"; }; return "clip:rect(" + top + "," + right + "," + bottom + "," + left + ");"; }, /** * Gets the clipping of the given element. * * @param element {Element} DOM element to query * @param mode {Number} Choose one of the modes {@link qx.bom.element.Style#COMPUTED_MODE}, * {@link qx.bom.element.Style#CASCADED_MODE}, {@link qx.bom.element.Style#LOCAL_MODE}. * The computed mode is the default one. * @return {Map} Map which contains <code>left</code>, <code>top</code> * <code>width</code> and <code>height</code> of the clipped area. * Each one could be null or any integer value. */ get : function(element, mode){ var clip = qx.bom.element.Style.get(element, "clip", mode, false); var left,top,width,height; var right,bottom; if(typeof clip === "string" && clip !== "auto" && clip !== ""){ clip = clip.trim(); // Do not use "global" here. This will break Firefox because of // an issue that the lastIndex will not be resetted on separate calls. if(/\((.*)\)/.test(clip)){ var result = RegExp.$1; // Process result // Some browsers store values space-separated, others comma-separated. // Handle both cases by means of feature-detection. if(/,/.test(result)){ var split = result.split(","); } else { var split = result.split(" "); }; top = split[0].trim(); right = split[1].trim(); bottom = split[2].trim(); left = split[3].trim(); // Normalize "auto" to null if(left === "auto"){ left = null; }; if(top === "auto"){ top = null; }; if(right === "auto"){ right = null; }; if(bottom === "auto"){ bottom = null; }; // Convert to integer values if(top != null){ top = parseInt(top, 10); }; if(right != null){ right = parseInt(right, 10); }; if(bottom != null){ bottom = parseInt(bottom, 10); }; if(left != null){ left = parseInt(left, 10); }; // Compute width and height if(right != null && left != null){ width = right - left; } else if(right != null){ width = right; }; if(bottom != null && top != null){ height = bottom - top; } else if(bottom != null){ height = bottom; }; } else { throw new Error("Could not parse clip string: " + clip); }; }; // Return map when any value is available. return { left : left || null, top : top || null, width : width || null, height : height || null }; }, /** * Sets the clipping of the given element. This is a simple * square which describes the visible area of an DOM element. * Changing the clipping does not change the dimensions of * an element. * * @param element {Element} DOM element to modify * @param map {Map} A map with one or more of these available keys: * <code>left</code>, <code>top</code>, <code>width</code>, <code>height</code>. */ set : function(element, map){ if(!map){ element.style.clip = "rect(auto,auto,auto,auto)"; return; }; var left = map.left; var top = map.top; var width = map.width; var height = map.height; var right,bottom; if(left == null){ right = (width == null ? "auto" : width + "px"); left = "auto"; } else { right = (width == null ? "auto" : left + width + "px"); left = left + "px"; }; if(top == null){ bottom = (height == null ? "auto" : height + "px"); top = "auto"; } else { bottom = (height == null ? "auto" : top + height + "px"); top = top + "px"; }; element.style.clip = "rect(" + top + "," + right + "," + bottom + "," + left + ")"; }, /** * Resets the clipping of the given DOM element. * * @param element {Element} DOM element to modify */ reset : function(element){ element.style.clip = "rect(auto, auto, auto, auto)"; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ************************************************************************ */ /** * Contains methods to control and query the element's cursor property */ qx.Bootstrap.define("qx.bom.element.Cursor", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** Internal helper structure to map cursor values to supported ones */ __map : { }, /** * Compiles the given cursor into a CSS compatible string. * * @param cursor {String} Valid CSS cursor name * @return {String} CSS string */ compile : function(cursor){ return "cursor:" + (this.__map[cursor] || cursor) + ";"; }, /** * Returns the computed cursor style for the given element. * * @param element {Element} The element to query * @param mode {Number} Choose one of the modes {@link qx.bom.element.Style#COMPUTED_MODE}, * {@link qx.bom.element.Style#CASCADED_MODE}, {@link qx.bom.element.Style#LOCAL_MODE}. * The computed mode is the default one. * @return {String} Computed cursor value of the given element. */ get : function(element, mode){ return qx.bom.element.Style.get(element, "cursor", mode, false); }, /** * Applies a new cursor style to the given element * * @param element {Element} The element to modify * @param value {String} New cursor value to set */ set : function(element, value){ element.style.cursor = this.__map[value] || value; }, /** * Removes the local cursor style applied to the element * * @param element {Element} The element to modify */ reset : function(element){ element.style.cursor = ""; } }, defer : function(statics){ // < IE 9 if(qx.core.Environment.get("engine.name") == "mshtml" && ((parseFloat(qx.core.Environment.get("engine.version")) < 9 || qx.core.Environment.get("browser.documentmode") < 9) && !qx.core.Environment.get("browser.quirksmode"))){ statics.__map["nesw-resize"] = "ne-resize"; statics.__map["nwse-resize"] = "nw-resize"; // < IE 8 if(((parseFloat(qx.core.Environment.get("engine.version")) < 8 || qx.core.Environment.get("browser.documentmode") < 8) && !qx.core.Environment.get("browser.quirksmode"))){ statics.__map["ew-resize"] = "e-resize"; statics.__map["ns-resize"] = "n-resize"; }; } else if(qx.core.Environment.get("engine.name") == "opera" && parseInt(qx.core.Environment.get("engine.version")) < 12){ statics.__map["nesw-resize"] = "ne-resize"; statics.__map["nwse-resize"] = "nw-resize"; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class takes care of the normalization of the native 'Object' object. * Therefore it checks the availability of the following methods and appends * it, if not available. This means you can use the methods during * development in every browser. For usage samples, check out the attached links. * * *keys*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys">MDN documentation</a> | * <a href="http://es5.github.com/#x15.2.3.14">Annotated ES5 Spec</a> */ qx.Bootstrap.define("qx.lang.normalize.Object", { defer : function(){ // keys if(!qx.core.Environment.get("ecmascript.object.keys")){ Object.keys = qx.Bootstrap.keys; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ************************************************************************ */ /* ************************************************************************ #require(qx.lang.normalize.Object) ************************************************************************ */ /** * Helper functions to handle Object as a Hash map. */ qx.Bootstrap.define("qx.lang.Object", { statics : { /** * Clears the map from all values * * @param map {Object} the map to clear */ empty : function(map){ { }; for(var key in map){ if(map.hasOwnProperty(key)){ delete map[key]; }; }; }, /** * Check if the hash has any keys * * @signature function(map) * @param map {Object} the map to check * @return {Boolean} whether the map has any keys * @lint ignoreUnused(key) */ isEmpty : function(map){ { }; for(var key in map){ return false; }; return true; }, /** * Check whether the number of objects in the maps is at least "length" * * @signature function(map, minLength) * @param map {Object} the map to check * @param minLength {Integer} minimum number of objects in the map * @deprecated {2.1} Please use a check and 'qx.lang.Object.getLength'. * @return {Boolean} whether the map contains at least "length" objects. * @lint ignoreUnused(key) */ hasMinLength : function(map, minLength){ { }; if(minLength <= 0){ return true; }; var length = 0; for(var key in map){ if((++length) >= minLength){ return true; }; }; return false; }, /** * Get the number of objects in the map * * @signature function(map) * @param map {Object} the map * @return {Integer} number of objects in the map */ getLength : qx.Bootstrap.objectGetLength, /** * Get the keys of a map as array as returned by a "for ... in" statement. * * @deprecated {2.1.} Please use Object.keys instead. * @signature function(map) * @param map {Object} the map * @return {Array} array of the keys of the map */ getKeys : qx.Bootstrap.getKeys, /** * Get the keys of a map as string * * @signature function(map) * @param map {Object} the map * @deprecated {2.1} Object.keys(map).join(). * @return {String} String of the keys of the map * The keys are separated by ", " */ getKeysAsString : qx.Bootstrap.getKeysAsString, /** * Get the values of a map as array * * @param map {Object} the map * @return {Array} array of the values of the map */ getValues : function(map){ { }; var arr = []; var keys = Object.keys(map); for(var i = 0,l = keys.length;i < l;i++){ arr.push(map[keys[i]]); }; return arr; }, /** * Inserts all keys of the source object into the * target objects. Attention: The target map gets modified. * * @signature function(target, source, overwrite) * @param target {Object} target object * @param source {Object} object to be merged * @param overwrite {Boolean ? true} If enabled existing keys will be overwritten * @return {Object} Target with merged values from the source object */ mergeWith : qx.Bootstrap.objectMergeWith, /** * Inserts all key/value pairs of the source object into the * target object but doesn't override existing keys * * @param target {Object} target object * @param source {Object} object to be merged * @return {Object} target with merged values from source * @deprecated {2.1} please use mergeWith instead with override set to false */ carefullyMergeWith : function(target, source){ { }; return qx.lang.Object.mergeWith(target, source, false); }, /** * Merge a number of objects. * * @param target {Object} target object * @param varargs {Object} variable number of objects to merged with target * @return {Object} target with merged values from the other objects * @deprecated {2.1} Please use mergeWith instead. */ merge : function(target, varargs){ { }; var len = arguments.length; for(var i = 1;i < len;i++){ qx.lang.Object.mergeWith(target, arguments[i]); }; return target; }, /** * Return a copy of an Object * * @param source {Object} Object to copy * @param deep {Boolean} If the clone should be a deep clone. * @return {Object} A copy of the object */ clone : function(source, deep){ if(qx.lang.Type.isObject(source)){ var clone = { }; for(var key in source){ if(deep){ clone[key] = qx.lang.Object.clone(source[key], deep); } else { clone[key] = source[key]; }; }; return clone; } else if(qx.lang.Type.isArray(source)){ var clone = []; for(var i = 0;i < source.length;i++){ if(deep){ clone[i] = qx.lang.Object.clone(source[i]); } else { clone[i] = source[i]; }; }; return clone; }; return source; }, /** * Inverts a map by exchanging the keys with the values. * * If the map has the same values for different keys, information will get lost. * The values will be converted to strings using the toString methods. * * @param map {Object} Map to invert * @return {Object} inverted Map */ invert : function(map){ { }; var result = { }; for(var key in map){ result[map[key].toString()] = key; }; return result; }, /** * Get the key of the given value from a map. * If the map has more than one key matching the value, the first match is returned. * If the map does not contain the value, <code>null</code> is returned. * * @param map {Object} Map to search for the key * @param value {var} Value to look for * @return {String|null} Name of the key (null if not found). */ getKeyFromValue : function(map, value){ { }; for(var key in map){ if(map.hasOwnProperty(key) && map[key] === value){ return key; }; }; return null; }, /** * Whether the map contains the given value. * * @param map {Object} Map to search for the value * @param value {var} Value to look for * @return {Boolean} Whether the value was found in the map. */ contains : function(map, value){ { }; return this.getKeyFromValue(map, value) !== null; }, /** * Selects the value with the given key from the map. * * @param key {String} name of the key to get the value from * @param map {Object} map to get the value from * @return {var} value for the given key from the map * @deprecated {2.1} */ select : function(key, map){ { }; { }; return map[key]; }, /** * Convert an array into a map. * * All elements of the array become keys of the returned map by * calling <code>toString</code> on the array elements. The values of the * map are set to <code>true</code> * * @param array {Array} array to convert * @return {Map} the array converted to a map. */ fromArray : function(array){ { }; var obj = { }; for(var i = 0,l = array.length;i < l;i++){ { }; obj[array[i].toString()] = true; }; return obj; }, /** * Serializes an object to URI parameters (also known as query string). * * Escapes characters that have a special meaning in URIs as well as * umlauts. Uses the global function encodeURIComponent, see * https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent * * Note: For URI parameters that are to be sent as * application/x-www-form-urlencoded (POST), spaces should be encoded * with "+". * * @param obj {Object} Object to serialize. * @param post {Boolean} Whether spaces should be encoded with "+". * @return {String} Serialized object. Safe to append to URIs or send as * URL encoded string. * @deprecated {2.1} Please use qx.util.Uri.toParameter instead. */ toUriParameter : function(obj, post){ { }; return qx.util.Uri.toParameter(obj, post); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tristan Koch (tristankoch) ************************************************************************ */ /** * Static helpers for parsing and modifying URIs. */ qx.Bootstrap.define("qx.util.Uri", { statics : { /** * Split URL * * Code taken from: * parseUri 1.2.2 * (c) Steven Levithan <stevenlevithan.com> * MIT License * * * @param str {String} String to parse as URI * @param strict {Boolean} Whether to parse strictly by the rules * @return {Object} Map with parts of URI as properties */ parseUri : function(str, strict){ var options = { key : ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], q : { name : "queryKey", parser : /(?:^|&)([^&=]*)=?([^&]*)/g }, parser : { strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } }; var o = options,m = options.parser[strict ? "strict" : "loose"].exec(str),uri = { },i = 14; while(i--){ uri[o.key[i]] = m[i] || ""; }; uri[o.q.name] = { }; uri[o.key[12]].replace(o.q.parser, function($0, $1, $2){ if($1){ uri[o.q.name][$1] = $2; }; }); return uri; }, /** * Append string to query part of URL. Respects existing query. * * @param url {String} URL to append string to. * @param params {String} Parameters to append to URL. * @return {String} URL with string appended in query part. */ appendParamsToUrl : function(url, params){ if(params === undefined){ return url; }; { }; if(qx.lang.Type.isObject(params)){ params = qx.util.Uri.toParameter(params); }; if(!params){ return url; }; return url += (/\?/).test(url) ? "&" + params : "?" + params; }, /** * Serializes an object to URI parameters (also known as query string). * * Escapes characters that have a special meaning in URIs as well as * umlauts. Uses the global function encodeURIComponent, see * https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent * * Note: For URI parameters that are to be sent as * application/x-www-form-urlencoded (POST), spaces should be encoded * with "+". * * @param obj {Object} Object to serialize. * @param post {Boolean} Whether spaces should be encoded with "+". * @return {String} Serialized object. Safe to append to URIs or send as * URL encoded string. */ toParameter : function(obj, post){ var key,parts = []; for(key in obj){ if(obj.hasOwnProperty(key)){ var value = obj[key]; if(value instanceof Array){ for(var i = 0;i < value.length;i++){ this.__toParameterPair(key, value[i], parts, post); }; } else { this.__toParameterPair(key, value, parts, post); }; }; }; return parts.join("&"); }, /** * Encodes key/value to URI safe string and pushes to given array. * * @param key {String} Key. * @param value {String} Value. * @param parts {Array} Array to push to. * @param post {Boolean} Whether spaces should be encoded with "+". */ __toParameterPair : function(key, value, parts, post){ var encode = window.encodeURIComponent; if(post){ parts.push(encode(key).replace(/%20/g, "+") + "=" + encode(value).replace(/%20/g, "+")); } else { parts.push(encode(key) + "=" + encode(value)); }; }, /** * Takes a relative URI and returns an absolute one. * * @param uri {String} relative URI * @return {String} absolute URI */ getAbsolute : function(uri){ var div = document.createElement("div"); div.innerHTML = '<a href="' + uri + '">0</a>'; return div.firstChild.href; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ************************************************************************ */ /** * Contains methods to control and query the element's box-sizing property. * * Supported values: * * * "content-box" = W3C model (dimensions are content specific) * * "border-box" = Microsoft model (dimensions are box specific incl. border and padding) */ qx.Bootstrap.define("qx.bom.element.BoxSizing", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** {Map} Internal data structure for __usesNativeBorderBox() */ __nativeBorderBox : { tags : { button : true, select : true }, types : { search : true, button : true, submit : true, reset : true, checkbox : true, radio : true } }, /** * Whether the given elements defaults to the "border-box" Microsoft model in all cases. * * @param element {Element} DOM element to query * @return {Boolean} true when the element uses "border-box" independently from the doctype */ __usesNativeBorderBox : function(element){ var map = this.__nativeBorderBox; return map.tags[element.tagName.toLowerCase()] || map.types[element.type]; }, /** * Compiles the given box sizing into a CSS compatible string. * * @param value {String} Valid CSS box-sizing value * @return {String} CSS string */ compile : function(value){ if(qx.core.Environment.get("css.boxsizing")){ var prop = qx.lang.String.hyphenate(qx.core.Environment.get("css.boxsizing")); return prop + ":" + value + ";"; } else { { }; }; }, /** * Returns the box sizing for the given element. * * @param element {Element} The element to query * @return {String} Box sizing value of the given element. */ get : function(element){ if(qx.core.Environment.get("css.boxsizing")){ return qx.bom.element.Style.get(element, "boxSizing", null, false) || ""; }; if(qx.bom.Document.isStandardMode(qx.dom.Node.getWindow(element))){ if(!this.__usesNativeBorderBox(element)){ return "content-box"; }; }; return "border-box"; }, /** * Applies a new box sizing to the given element * * @param element {Element} The element to modify * @param value {String} New box sizing value to set */ set : function(element, value){ if(qx.core.Environment.get("css.boxsizing")){ // IE8 bombs when trying to apply an unsupported value try{ element.style[qx.core.Environment.get("css.boxsizing")] = value; } catch(ex) { { }; }; } else { { }; }; }, /** * Removes the local box sizing applied to the element * * @param element {Element} The element to modify */ reset : function(element){ this.set(element, ""); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * Prototype JS http://www.prototypejs.org/ Version 1.5 Copyright: (c) 2006-2007, Prototype Core Team License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Prototype Core Team ---------------------------------------------------------------------- Copyright (c) 2005-2008 Sam Stephenson 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 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. ************************************************************************ */ /* ************************************************************************ #require(qx.lang.String) #require(qx.bom.client.Css) #require(qx.bom.element.Clip#set) #require(qx.bom.element.Cursor#set) #require(qx.bom.element.Opacity#set) #require(qx.bom.element.BoxSizing#set) #require(qx.bom.element.Clip#get) #require(qx.bom.element.Cursor#get) #require(qx.bom.element.Opacity#get) #require(qx.bom.element.BoxSizing#get) #require(qx.bom.element.Clip#reset) #require(qx.bom.element.Cursor#reset) #require(qx.bom.element.Opacity#reset) #require(qx.bom.element.BoxSizing#reset) #require(qx.bom.element.Clip#compile) #require(qx.bom.element.Cursor#compile) #require(qx.bom.element.Opacity#compile) #require(qx.bom.element.BoxSizing#compile) ************************************************************************ */ /** * Style querying and modification of HTML elements. * * Automatically normalizes cross-browser differences for setting and reading * CSS attributes. Optimized for performance. */ qx.Bootstrap.define("qx.bom.element.Style", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { __styleNames : null, __cssNames : null, /** * Detect vendor specific properties. */ __detectVendorProperties : function(){ var styleNames = { "appearance" : qx.core.Environment.get("css.appearance"), "userSelect" : qx.core.Environment.get("css.userselect"), "textOverflow" : qx.core.Environment.get("css.textoverflow"), "borderImage" : qx.core.Environment.get("css.borderimage"), "float" : qx.core.Environment.get("css.float"), "userModify" : qx.core.Environment.get("css.usermodify"), "boxSizing" : qx.core.Environment.get("css.boxsizing") }; this.__cssNames = { }; for(var key in qx.lang.Object.clone(styleNames)){ if(!styleNames[key]){ delete styleNames[key]; } else { this.__cssNames[key] = key == "float" ? "float" : qx.lang.String.hyphenate(styleNames[key]); }; }; this.__styleNames = styleNames; }, /** * Gets the (possibly vendor-prefixed) name of a style property and stores * it to avoid multiple checks. * * @param name {String} Style property name to check * @return {String|null} The client-specific name of the property, or * <code>null</code> if it's not supported. */ __getStyleName : function(name){ var styleName = qx.bom.Style.getPropertyName(name); if(styleName){ this.__styleNames[name] = styleName; }; return styleName; }, /** * Mshtml has proprietary pixel* properties for locations and dimensions * which return the pixel value. Used by getComputed() in mshtml variant. * * @internal */ __mshtmlPixel : { width : "pixelWidth", height : "pixelHeight", left : "pixelLeft", right : "pixelRight", top : "pixelTop", bottom : "pixelBottom" }, /** * Whether a special class is available for the processing of this style. * * @internal */ __special : { clip : qx.bom.element.Clip, cursor : qx.bom.element.Cursor, opacity : qx.bom.element.Opacity, boxSizing : qx.bom.element.BoxSizing }, /* --------------------------------------------------------------------------- COMPILE SUPPORT --------------------------------------------------------------------------- */ /** * Compiles the given styles into a string which can be used to * concat a HTML string for innerHTML usage. * * @param map {Map} Map of style properties to compile * @return {String} Compiled string of given style properties. */ compile : function(map){ var html = []; var special = this.__special; var cssNames = this.__cssNames; var name,value; for(name in map){ // read value value = map[name]; if(value == null){ continue; }; // normalize name name = this.__styleNames[name] || this.__getStyleName(name) || name; // process special properties if(special[name]){ html.push(special[name].compile(value)); } else { if(!cssNames[name]){ cssNames[name] = qx.lang.String.hyphenate(name); }; html.push(cssNames[name], ":", value, ";"); }; }; return html.join(""); }, /* --------------------------------------------------------------------------- CSS TEXT SUPPORT --------------------------------------------------------------------------- */ /** * Set the full CSS content of the style attribute * * @param element {Element} The DOM element to modify * @param value {String} The full CSS string */ setCss : function(element, value){ if(qx.core.Environment.get("engine.name") === "mshtml" && parseInt(qx.core.Environment.get("browser.documentmode"), 10) < 8){ element.style.cssText = value; } else { element.setAttribute("style", value); }; }, /** * Returns the full content of the style attribute. * * @param element {Element} The DOM element to query * @return {String} the full CSS string * @signature function(element) */ getCss : function(element){ if(qx.core.Environment.get("engine.name") === "mshtml" && parseInt(qx.core.Environment.get("browser.documentmode"), 10) < 8){ return element.style.cssText.toLowerCase(); } else { return element.getAttribute("style"); }; }, /* --------------------------------------------------------------------------- STYLE ATTRIBUTE SUPPORT --------------------------------------------------------------------------- */ /** * Checks whether the browser supports the given CSS property. * * @param propertyName {String} The name of the property * @return {Boolean} Whether the property id supported */ isPropertySupported : function(propertyName){ return (this.__special[propertyName] || this.__styleNames[propertyName] || propertyName in document.documentElement.style); }, /** {Integer} Computed value of a style property. Compared to the cascaded style, * this one also interprets the values e.g. translates <code>em</code> units to * <code>px</code>. */ COMPUTED_MODE : 1, /** {Integer} Cascaded value of a style property. */ CASCADED_MODE : 2, /** * {Integer} Local value of a style property. Ignores inheritance cascade. * Does not interpret values. */ LOCAL_MODE : 3, /** * Sets the value of a style property * * @param element {Element} The DOM element to modify * @param name {String} Name of the style attribute (js variant e.g. marginTop, wordSpacing) * @param value {var} The value for the given style * @param smart {Boolean?true} Whether the implementation should automatically use * special implementations for some properties */ set : function(element, name, value, smart){ { }; // normalize name name = this.__styleNames[name] || this.__getStyleName(name) || name; // special handling for specific properties // through this good working switch this part costs nothing when // processing non-smart properties if(smart !== false && this.__special[name]){ this.__special[name].set(element, value); } else { element.style[name] = value !== null ? value : ""; }; }, /** * Convenience method to modify a set of styles at once. * * @param element {Element} The DOM element to modify * @param styles {Map} a map where the key is the name of the property * and the value is the value to use. * @param smart {Boolean?true} Whether the implementation should automatically use * special implementations for some properties */ setStyles : function(element, styles, smart){ { }; // inline calls to "set" and "reset" because this method is very // performance critical! var styleNames = this.__styleNames; var special = this.__special; var style = element.style; for(var key in styles){ var value = styles[key]; var name = styleNames[key] || this.__getStyleName(key) || key; if(value === undefined){ if(smart !== false && special[name]){ special[name].reset(element); } else { style[name] = ""; }; } else { if(smart !== false && special[name]){ special[name].set(element, value); } else { style[name] = value !== null ? value : ""; }; }; }; }, /** * Resets the value of a style property * * @param element {Element} The DOM element to modify * @param name {String} Name of the style attribute (js variant e.g. marginTop, wordSpacing) * @param smart {Boolean?true} Whether the implementation should automatically use * special implementations for some properties */ reset : function(element, name, smart){ // normalize name name = this.__styleNames[name] || this.__getStyleName(name) || name; // special handling for specific properties if(smart !== false && this.__special[name]){ this.__special[name].reset(element); } else { element.style[name] = ""; }; }, /** * Gets the value of a style property. * * *Computed* * * Returns the computed value of a style property. Compared to the cascaded style, * this one also interprets the values e.g. translates <code>em</code> units to * <code>px</code>. * * *Cascaded* * * Returns the cascaded value of a style property. * * *Local* * * Ignores inheritance cascade. Does not interpret values. * * @signature function(element, name, mode, smart) * @param element {Element} The DOM element to modify * @param name {String} Name of the style attribute (js variant e.g. marginTop, wordSpacing) * @param mode {Number} Choose one of the modes {@link #COMPUTED_MODE}, {@link #CASCADED_MODE}, * {@link #LOCAL_MODE}. The computed mode is the default one. * @param smart {Boolean?true} Whether the implementation should automatically use * special implementations for some properties * @return {var} The value of the property */ get : qx.core.Environment.select("engine.name", { "mshtml" : function(element, name, mode, smart){ // normalize name name = this.__styleNames[name] || this.__getStyleName(name) || name; // special handling if(smart !== false && this.__special[name]){ return this.__special[name].get(element, mode); }; // if the element is not inserted into the document "currentStyle" // may be undefined. In this case always return the local style. if(!element.currentStyle){ return element.style[name] || ""; }; // switch to right mode switch(mode){case this.LOCAL_MODE: return element.style[name] || "";case this.CASCADED_MODE: return element.currentStyle[name] || "";default: // Read cascaded style var currentStyle = element.currentStyle[name] || ""; // Pixel values are always OK if(/^-?[\.\d]+(px)?$/i.test(currentStyle)){ return currentStyle; }; // Try to convert non-pixel values var pixel = this.__mshtmlPixel[name]; if(pixel){ // Backup local and runtime style var localStyle = element.style[name]; // Overwrite local value with cascaded value // This is needed to have the pixel value setupped element.style[name] = currentStyle || 0; // Read pixel value and add "px" var value = element.style[pixel] + "px"; // Recover old local value element.style[name] = localStyle; // Return value return value; }; // Just the current style return currentStyle;}; }, "default" : function(element, name, mode, smart){ // normalize name name = this.__styleNames[name] || this.__getStyleName(name) || name; // special handling if(smart !== false && this.__special[name]){ return this.__special[name].get(element, mode); }; // switch to right mode switch(mode){case this.LOCAL_MODE: return element.style[name] || "";case this.CASCADED_MODE: // Currently only supported by Opera and Internet Explorer if(element.currentStyle){ return element.currentStyle[name] || ""; }; throw new Error("Cascaded styles are not supported in this browser!");// Support for the DOM2 getComputedStyle method // // Safari >= 3 & Gecko > 1.4 expose all properties to the returned // CSSStyleDeclaration object. In older browsers the function // "getPropertyValue" is needed to access the values. // // On a computed style object all properties are read-only which is // identical to the behavior of MSHTML's "currentStyle". default: // Opera, Mozilla and Safari 3+ also have a global getComputedStyle which is identical // to the one found under document.defaultView. // The problem with this is however that this does not work correctly // when working with frames and access an element of another frame. // Then we must use the <code>getComputedStyle</code> of the document // where the element is defined. var doc = qx.dom.Node.getDocument(element); var computed = doc.defaultView.getComputedStyle(element, null); // All relevant browsers expose the configured style properties to // the CSSStyleDeclaration objects return computed ? computed[name] : "";}; } }) }, defer : function(statics){ statics.__detectVendorProperties(); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ************************************************************************ */ /** * Basic node creation and type detection */ qx.Bootstrap.define("qx.dom.Node", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /* --------------------------------------------------------------------------- NODE TYPES --------------------------------------------------------------------------- */ /** * {Map} Node type: * * * ELEMENT * * ATTRIBUTE * * TEXT * * CDATA_SECTION * * ENTITY_REFERENCE * * ENTITY * * PROCESSING_INSTRUCTION * * COMMENT * * DOCUMENT * * DOCUMENT_TYPE * * DOCUMENT_FRAGMENT * * NOTATION */ ELEMENT : 1, ATTRIBUTE : 2, TEXT : 3, CDATA_SECTION : 4, ENTITY_REFERENCE : 5, ENTITY : 6, PROCESSING_INSTRUCTION : 7, COMMENT : 8, DOCUMENT : 9, DOCUMENT_TYPE : 10, DOCUMENT_FRAGMENT : 11, NOTATION : 12, /* --------------------------------------------------------------------------- DOCUMENT ACCESS --------------------------------------------------------------------------- */ /** * Returns the owner document of the given node * * @param node {Node|Document|Window} the node which should be tested * @return {Document|null} The document of the given DOM node */ getDocument : function(node){ return node.nodeType === this.DOCUMENT ? node : // is document already node.ownerDocument || // is DOM node node.document; }, /** * Returns the DOM2 <code>defaultView</code> (window). * * @param node {Node|Document|Window} node to inspect * @return {Window} the <code>defaultView</code> of the given node */ getWindow : function(node){ // is a window already if(node.nodeType == null){ return node; }; // jump to document if(node.nodeType !== this.DOCUMENT){ node = node.ownerDocument; }; // jump to window return node.defaultView || node.parentWindow; }, /** * Returns the document element. (Logical root node) * * This is a convenience attribute that allows direct access to the child * node that is the root element of the document. For HTML documents, * this is the element with the tagName "HTML". * * @param node {Node|Document|Window} node to inspect * @return {Element} document element of the given node */ getDocumentElement : function(node){ return this.getDocument(node).documentElement; }, /** * Returns the body element. (Visual root node) * * This normally only makes sense for HTML documents. It returns * the content area of the HTML document. * * @param node {Node|Document|Window} node to inspect * @return {Element} document body of the given node */ getBodyElement : function(node){ return this.getDocument(node).body; }, /* --------------------------------------------------------------------------- TYPE TESTS --------------------------------------------------------------------------- */ /** * Whether the given object is a DOM node * * @param node {Node} the node which should be tested * @return {Boolean} true if the node is a DOM node */ isNode : function(node){ return !!(node && node.nodeType != null); }, /** * Whether the given object is a DOM element node * * @param node {Node} the node which should be tested * @return {Boolean} true if the node is a DOM element */ isElement : function(node){ return !!(node && node.nodeType === this.ELEMENT); }, /** * Whether the given object is a DOM document node * * @param node {Node} the node which should be tested * @return {Boolean} true when the node is a DOM document */ isDocument : function(node){ return !!(node && node.nodeType === this.DOCUMENT); }, /** * Whether the given object is a DOM text node * * @param node {Node} the node which should be tested * @return {Boolean} true if the node is a DOM text node */ isText : function(node){ return !!(node && node.nodeType === this.TEXT); }, /** * Check whether the given object is a browser window object. * * @param obj {Object} the object which should be tested * @return {Boolean} true if the object is a window object */ isWindow : function(obj){ return !!(obj && obj.history && obj.location && obj.document); }, /** * Whether the node has the given node name * * @param node {Node} the node * @param nodeName {String} the node name to check for * @return {Boolean} Whether the node has the given node name */ isNodeName : function(node, nodeName){ if(!nodeName || !node || !node.nodeName){ return false; }; return nodeName.toLowerCase() == qx.dom.Node.getName(node); }, /* --------------------------------------------------------------------------- UTILITIES --------------------------------------------------------------------------- */ /** * Get the node name as lower case string * * @param node {Node} the node * @return {String} the node name */ getName : function(node){ if(!node || !node.nodeName){ return null; }; return node.nodeName.toLowerCase(); }, /** * Returns the text content of an node where the node may be of node type * NODE_ELEMENT, NODE_ATTRIBUTE, NODE_TEXT or NODE_CDATA * * @param node {Node} the node from where the search should start. * If the node has subnodes the text contents are recursively retreived and joined. * @return {String} the joined text content of the given node or null if not appropriate. * @signature function(node) */ getText : function(node){ if(!node || !node.nodeType){ return null; }; switch(node.nodeType){case 1: // NODE_ELEMENT var i,a = [],nodes = node.childNodes,length = nodes.length; for(i = 0;i < length;i++){ a[i] = this.getText(nodes[i]); }; return a.join("");case 2:// NODE_ATTRIBUTE case 3:// NODE_TEXT case 4: // CDATA return node.nodeValue;}; return null; }, /** * Checks if the given node is a block node * * @param node {Node} Node * @return {Boolean} whether it is a block node */ isBlockNode : function(node){ if(!qx.dom.Node.isElement(node)){ return false; }; node = qx.dom.Node.getName(node); return /^(body|form|textarea|fieldset|ul|ol|dl|dt|dd|li|div|hr|p|h[1-6]|quote|pre|table|thead|tbody|tfoot|tr|td|th|iframe|address|blockquote)$/.test(node); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * Yahoo! UI Library http://developer.yahoo.com/yui Version 2.2.0 Copyright: (c) 2007, Yahoo! Inc. License: BSD: http://developer.yahoo.com/yui/license.txt ---------------------------------------------------------------------- http://developer.yahoo.com/yui/license.html Copyright (c) 2009, Yahoo! Inc. All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc. 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. ************************************************************************ */ /** * Includes library functions to work with the current document. */ qx.Bootstrap.define("qx.bom.Document", { statics : { /** * Whether the document is in quirks mode (e.g. non XHTML, HTML4 Strict or missing doctype) * * @signature function(win) * @param win {Window?window} The window to query * @return {Boolean} true when containing document is in quirks mode */ isQuirksMode : qx.core.Environment.select("engine.name", { "mshtml" : function(win){ if(qx.core.Environment.get("engine.version") >= 8){ return (win || window).document.documentMode === 5; } else { return (win || window).document.compatMode !== "CSS1Compat"; }; }, "webkit" : function(win){ if(document.compatMode === undefined){ var el = (win || window).document.createElement("div"); el.style.cssText = "position:absolute;width:0;height:0;width:1"; return el.style.width === "1px" ? true : false; } else { return (win || window).document.compatMode !== "CSS1Compat"; }; }, "default" : function(win){ return (win || window).document.compatMode !== "CSS1Compat"; } }), /** * Whether the document is in standard mode (e.g. XHTML, HTML4 Strict or doctype defined) * * @param win {Window?window} The window to query * @return {Boolean} true when containing document is in standard mode */ isStandardMode : function(win){ return !this.isQuirksMode(win); }, /** * Returns the width of the document. * * Internet Explorer in standard mode stores the proprietary <code>scrollWidth</code> property * on the <code>documentElement</code>, but in quirks mode on the body element. All * other known browsers simply store the correct value on the <code>documentElement</code>. * * If the viewport is wider than the document the viewport width is returned. * * As the html element has no visual appearance it also can not scroll. This * means that we must use the body <code>scrollWidth</code> in all non mshtml clients. * * Verified to correctly work with: * * * Mozilla Firefox 2.0.0.4 * * Opera 9.2.1 * * Safari 3.0 beta (3.0.2) * * Internet Explorer 7.0 * * @param win {Window?window} The window to query * @return {Integer} The width of the actual document (which includes the body and its margin). * * NOTE: Opera 9.5x and 9.6x have wrong value for the scrollWidth property, * if an element use negative value for top and left to be outside the viewport! * See: http://bugzilla.qooxdoo.org/show_bug.cgi?id=2869 */ getWidth : function(win){ var doc = (win || window).document; var view = qx.bom.Viewport.getWidth(win); var scroll = this.isStandardMode(win) ? doc.documentElement.scrollWidth : doc.body.scrollWidth; return Math.max(scroll, view); }, /** * Returns the height of the document. * * Internet Explorer in standard mode stores the proprietary <code>scrollHeight</code> property * on the <code>documentElement</code>, but in quirks mode on the body element. All * other known browsers simply store the correct value on the <code>documentElement</code>. * * If the viewport is higher than the document the viewport height is returned. * * As the html element has no visual appearance it also can not scroll. This * means that we must use the body <code>scrollHeight</code> in all non mshtml clients. * * Verified to correctly work with: * * * Mozilla Firefox 2.0.0.4 * * Opera 9.2.1 * * Safari 3.0 beta (3.0.2) * * Internet Explorer 7.0 * * @param win {Window?window} The window to query * @return {Integer} The height of the actual document (which includes the body and its margin). * * NOTE: Opera 9.5x and 9.6x have wrong value for the scrollWidth property, * if an element use negative value for top and left to be outside the viewport! * See: http://bugzilla.qooxdoo.org/show_bug.cgi?id=2869 */ getHeight : function(win){ var doc = (win || window).document; var view = qx.bom.Viewport.getHeight(win); var scroll = this.isStandardMode(win) ? doc.documentElement.scrollHeight : doc.body.scrollHeight; return Math.max(scroll, view); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Sebastian Fastner (fastner) * Tino Butz (tbtz) ====================================================================== This class contains code based on the following work: * Unify Project Homepage: http://unify-project.org Copyright: 2009-2010 Deutsche Telekom AG, Germany, http://telekom.com License: MIT: http://www.opensource.org/licenses/mit-license.php * Yahoo! UI Library http://developer.yahoo.com/yui Version 2.2.0 Copyright: (c) 2007, Yahoo! Inc. License: BSD: http://developer.yahoo.com/yui/license.txt ---------------------------------------------------------------------- http://developer.yahoo.com/yui/license.html Copyright (c) 2009, Yahoo! Inc. All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc. 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. ************************************************************************ */ /** * Includes library functions to work with the client's viewport (window). * Orientation related functions are point to window.top as default. */ qx.Bootstrap.define("qx.bom.Viewport", { statics : { /** * Returns the current width of the viewport (excluding the vertical scrollbar * if present). * * @param win {Window?window} The window to query * @return {Integer} The width of the viewable area of the page (excluding scrollbars). */ getWidth : function(win){ var win = win || window; var doc = win.document; return qx.bom.Document.isStandardMode(win) ? doc.documentElement.clientWidth : doc.body.clientWidth; }, /** * Returns the current height of the viewport (excluding the horizontal scrollbar * if present). * * @param win {Window?window} The window to query * @return {Integer} The Height of the viewable area of the page (excluding scrollbars). */ getHeight : function(win){ var win = win || window; var doc = win.document; return qx.bom.Document.isStandardMode(win) ? doc.documentElement.clientHeight : doc.body.clientHeight; }, /** * Returns the scroll position of the viewport * * All clients except IE < 9 support the non-standard property <code>pageXOffset</code>. * As this is easier to evaluate we prefer this property over <code>scrollLeft</code>. * Since the window could differ from the one the application is running in, we can't * use a one-time environment check to decide which property to use. * * @param win {Window?window} The window to query * @return {Integer} Scroll position in pixels from left edge, always a positive integer or zero */ getScrollLeft : function(win){ var win = win ? win : window; if(typeof win.pageXOffset !== "undefined"){ return win.pageXOffset; }; // Firefox is using 'documentElement.scrollLeft' and Chrome is using // 'document.body.scrollLeft'. For the other value each browser is returning // 0, so we can use this check to get the positive value without using specific // browser checks. var doc = win.document; return doc.documentElement.scrollLeft || doc.body.scrollLeft; }, /** * Returns the scroll position of the viewport * * All clients except MSHTML support the non-standard property <code>pageYOffset</code>. * As this is easier to evaluate we prefer this property over <code>scrollTop</code>. * Since the window could differ from the one the application is running in, we can't * use a one-time environment check to decide which property to use. * * @param win {Window?window} The window to query * @return {Integer} Scroll position in pixels from top edge, always a positive integer or zero */ getScrollTop : function(win){ var win = win ? win : window; if(typeof win.pageYOffeset !== "undefined"){ return win.pageYOffset; }; // Firefox is using 'documentElement.scrollTop' and Chrome is using // 'document.body.scrollTop'. For the other value each browser is returning // 0, so we can use this check to get the positive value without using specific // browser checks. var doc = win.document; return doc.documentElement.scrollTop || doc.body.scrollTop; }, /** * Returns an orientation normalizer value that should be added to device orientation * to normalize behaviour on different devices. * * @param win {Window} The window to query * @return {Map} Orientation normalizing value */ __getOrientationNormalizer : function(win){ // Calculate own understanding of orientation (0 = portrait, 90 = landscape) var currentOrientation = this.getWidth(win) > this.getHeight(win) ? 90 : 0; var deviceOrientation = win.orientation; if(deviceOrientation == null || Math.abs(deviceOrientation % 180) == currentOrientation){ // No device orientation available or device orientation equals own understanding of orientation return { "-270" : 90, "-180" : 180, "-90" : -90, "0" : 0, "90" : 90, "180" : 180, "270" : -90 }; } else { // Device orientation is not equal to own understanding of orientation return { "-270" : 180, "-180" : -90, "-90" : 0, "0" : 90, "90" : 180, "180" : -90, "270" : 0 }; }; }, // Cache orientation normalizer map on start __orientationNormalizer : null, /** * Returns the current orientation of the viewport in degree. * * All possible values and their meaning: * * * <code>-90</code>: "Landscape" * * <code>0</code>: "Portrait" * * <code>90</code>: "Landscape" * * <code>180</code>: "Portrait" * * @param win {Window?window.top} The window to query. (Default = top window) * @return {Integer} The current orientation in degree */ getOrientation : function(win){ // Set window.top as default, because orientationChange event is only fired top window var win = win || window.top; // The orientation property of window does not have the same behaviour over all devices // iPad has 0degrees = Portrait, Playbook has 90degrees = Portrait, same for Android Honeycomb // // To fix this an orientationNormalizer map is calculated on application start // // The calculation of getWidth and getHeight returns wrong values if you are in an input field // on iPad and rotate your device! var orientation = win.orientation; if(orientation == null){ // Calculate orientation from window width and window height orientation = this.getWidth(win) > this.getHeight(win) ? 90 : 0; } else { if(this.__orientationNormalizer == null){ this.__orientationNormalizer = this.__getOrientationNormalizer(win); }; // Normalize orientation value orientation = this.__orientationNormalizer[orientation]; }; return orientation; }, /** * Whether the viewport orientation is currently in landscape mode. * * @param win {Window?window} The window to query * @return {Boolean} <code>true</code> when the viewport orientation * is currently in landscape mode. */ isLandscape : function(win){ return this.getWidth(win) >= this.getHeight(win); }, /** * Whether the viewport orientation is currently in portrait mode. * * @param win {Window?window} The window to query * @return {Boolean} <code>true</code> when the viewport orientation * is currently in portrait mode. */ isPortrait : function(win){ return this.getWidth(win) < this.getHeight(win); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * Base2 http://code.google.com/p/base2/ Version 0.9 Copyright: (c) 2006-2007, Dean Edwards License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Dean Edwards ************************************************************************ */ /** * CSS class name support for HTML elements. Supports multiple class names * for each element. Can query and apply class names to HTML elements. */ qx.Bootstrap.define("qx.bom.element.Class", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** {RegExp} Regular expressions to split class names */ __splitter : /\s+/g, /** {RegExp} String trim regular expression. */ __trim : /^\s+|\s+$/g, /** * Adds a className to the given element * If successfully added the given className will be returned * * @signature function(element, name) * @param element {Element} The element to modify * @param name {String} The class name to add * @return {String} The added classname (if so) */ add : { "native" : function(element, name){ element.classList.add(name); return name; }, "default" : function(element, name){ if(!this.has(element, name)){ element.className += (element.className ? " " : "") + name; }; return name; } }[qx.core.Environment.get("html.classlist") ? "native" : "default"], /** * Adds multiple classes to the given element * * @signature function(element, classes) * @param element {Element} DOM element to modify * @param classes {String[]} List of classes to add. * @return {String} The resulting class name which was applied */ addClasses : { "native" : function(element, classes){ for(var i = 0;i < classes.length;i++){ element.classList.add(classes[i]); }; return element.className; }, "default" : function(element, classes){ var keys = { }; var result; var old = element.className; if(old){ result = old.split(this.__splitter); for(var i = 0,l = result.length;i < l;i++){ keys[result[i]] = true; }; for(var i = 0,l = classes.length;i < l;i++){ if(!keys[classes[i]]){ result.push(classes[i]); }; }; } else { result = classes; }; return element.className = result.join(" "); } }[qx.core.Environment.get("html.classlist") ? "native" : "default"], /** * Gets the classname of the given element * * @param element {Element} The element to query * @return {String} The retrieved classname */ get : function(element){ var className = element.className; if(typeof className.split !== 'function'){ if(typeof className === 'object'){ if(qx.Bootstrap.getClass(className) == 'SVGAnimatedString'){ className = className.baseVal; } else { { }; className = ''; }; }; if(typeof className === 'undefined'){ { }; className = ''; }; }; return className; }, /** * Whether the given element has the given className. * * @signature function(element, name) * @param element {Element} The DOM element to check * @param name {String} The class name to check for * @return {Boolean} true when the element has the given classname */ has : { "native" : function(element, name){ return element.classList.contains(name); }, "default" : function(element, name){ var regexp = new RegExp("(^|\\s)" + name + "(\\s|$)"); return regexp.test(element.className); } }[qx.core.Environment.get("html.classlist") ? "native" : "default"], /** * Removes a className from the given element * * @signature function(element, name) * @param element {Element} The DOM element to modify * @param name {String} The class name to remove * @return {String} The removed class name */ remove : { "native" : function(element, name){ element.classList.remove(name); return name; }, "default" : function(element, name){ var regexp = new RegExp("(^|\\s)" + name + "(\\s|$)"); element.className = element.className.replace(regexp, "$2"); return name; } }[qx.core.Environment.get("html.classlist") ? "native" : "default"], /** * Removes multiple classes from the given element * * @signature function(element, classes) * @param element {Element} DOM element to modify * @param classes {String[]} List of classes to remove. * @return {String} The resulting class name which was applied */ removeClasses : { "native" : function(element, classes){ for(var i = 0;i < classes.length;i++){ element.classList.remove(classes[i]); }; return element.className; }, "default" : function(element, classes){ var reg = new RegExp("\\b" + classes.join("\\b|\\b") + "\\b", "g"); return element.className = element.className.replace(reg, "").replace(this.__trim, "").replace(this.__splitter, " "); } }[qx.core.Environment.get("html.classlist") ? "native" : "default"], /** * Replaces the first given class name with the second one * * @param element {Element} The DOM element to modify * @param oldName {String} The class name to remove * @param newName {String} The class name to add * @return {String} The added class name */ replace : function(element, oldName, newName){ this.remove(element, oldName); return this.add(element, newName); }, /** * Toggles a className of the given element * * @signature function(element, name, toggle) * @param element {Element} The DOM element to modify * @param name {String} The class name to toggle * @param toggle {Boolean?null} Whether to switch class on/off. Without * the parameter an automatic toggling would happen. * @return {String} The class name */ toggle : { "native" : function(element, name, toggle){ if(toggle === undefined){ element.classList.toggle(name); } else { toggle ? this.add(element, name) : this.remove(element, name); }; return name; }, "default" : function(element, name, toggle){ if(toggle == null){ toggle = !this.has(element, name); }; toggle ? this.add(element, name) : this.remove(element, name); return name; } }[qx.core.Environment.get("html.classlist") ? "native" : "default"] } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Fabian Jakobs (fjakobs) ************************************************************************ */ /** * Contains support for calculating dimensions of HTML elements. * * We differ between the box (or border) size which is available via * {@link #getWidth} and {@link #getHeight} and the content or scroll * sizes which are available via {@link #getContentWidth} and * {@link #getContentHeight}. */ qx.Bootstrap.define("qx.bom.element.Dimension", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** * Returns the rendered width of the given element. * * This is the visible width of the object, which need not to be identical * to the width configured via CSS. This highly depends on the current * box-sizing for the document and maybe even for the element. * * @signature function(element) * @param element {Element} element to query * @return {Integer} width of the element */ getWidth : qx.core.Environment.select("engine.name", { "gecko" : function(element){ // offsetWidth in Firefox does not always return the rendered pixel size // of an element. // Starting with Firefox 3 the rendered size can be determined by using // getBoundingClientRect // https://bugzilla.mozilla.org/show_bug.cgi?id=450422 if(element.getBoundingClientRect){ var rect = element.getBoundingClientRect(); return Math.round(rect.right) - Math.round(rect.left); } else { return element.offsetWidth; }; }, "default" : function(element){ return element.offsetWidth; } }), /** * Returns the rendered height of the given element. * * This is the visible height of the object, which need not to be identical * to the height configured via CSS. This highly depends on the current * box-sizing for the document and maybe even for the element. * * @signature function(element) * @param element {Element} element to query * @return {Integer} height of the element */ getHeight : qx.core.Environment.select("engine.name", { "gecko" : function(element){ if(element.getBoundingClientRect){ var rect = element.getBoundingClientRect(); return Math.round(rect.bottom) - Math.round(rect.top); } else { return element.offsetHeight; }; }, "default" : function(element){ return element.offsetHeight; } }), /** * Returns the rendered size of the given element. * * @param element {Element} element to query * @return {Map} map containing the width and height of the element */ getSize : function(element){ return { width : this.getWidth(element), height : this.getHeight(element) }; }, /** {Map} Contains all overflow values where scrollbars are invisible */ __hiddenScrollbars : { visible : true, hidden : true }, /** * Returns the content width. * * The content width is basically the maximum * width used or the maximum width which can be used by the content. This * excludes all kind of styles of the element like borders, paddings, margins, * and even scrollbars. * * Please note that with visible scrollbars the content width returned * may be larger than the box width returned via {@link #getWidth}. * * @param element {Element} element to query * @return {Integer} Computed content width */ getContentWidth : function(element){ var Style = qx.bom.element.Style; var overflowX = qx.bom.element.Style.get(element, "overflowX"); var paddingLeft = parseInt(Style.get(element, "paddingLeft") || "0px", 10); var paddingRight = parseInt(Style.get(element, "paddingRight") || "0px", 10); if(this.__hiddenScrollbars[overflowX]){ var contentWidth = element.clientWidth; if((qx.core.Environment.get("engine.name") == "opera") || qx.dom.Node.isBlockNode(element)){ contentWidth = contentWidth - paddingLeft - paddingRight; }; return contentWidth; } else { if(element.clientWidth >= element.scrollWidth){ // Scrollbars visible, but not needed? We need to substract both paddings return Math.max(element.clientWidth, element.scrollWidth) - paddingLeft - paddingRight; } else { // Scrollbars visible and needed. We just remove the left padding, // as the right padding is not respected in rendering. var width = element.scrollWidth - paddingLeft; // IE renders the paddingRight as well with scrollbars on if(qx.core.Environment.get("engine.name") == "mshtml" && qx.core.Environment.get("engine.version") >= 6){ width -= paddingRight; }; return width; }; }; }, /** * Returns the content height. * * The content height is basically the maximum * height used or the maximum height which can be used by the content. This * excludes all kind of styles of the element like borders, paddings, margins, * and even scrollbars. * * Please note that with visible scrollbars the content height returned * may be larger than the box height returned via {@link #getHeight}. * * @param element {Element} element to query * @return {Integer} Computed content height */ getContentHeight : function(element){ var Style = qx.bom.element.Style; var overflowY = qx.bom.element.Style.get(element, "overflowY"); var paddingTop = parseInt(Style.get(element, "paddingTop") || "0px", 10); var paddingBottom = parseInt(Style.get(element, "paddingBottom") || "0px", 10); if(this.__hiddenScrollbars[overflowY]){ return element.clientHeight - paddingTop - paddingBottom; } else { if(element.clientHeight >= element.scrollHeight){ // Scrollbars visible, but not needed? We need to substract both paddings return Math.max(element.clientHeight, element.scrollHeight) - paddingTop - paddingBottom; } else { // Scrollbars visible and needed. We just remove the top padding, // as the bottom padding is not respected in rendering. var height = element.scrollHeight - paddingTop; // IE renders the paddingBottom as well with scrollbars on if(qx.core.Environment.get("engine.name") == "mshtml" && qx.core.Environment.get("engine.version") == 6){ height -= paddingBottom; }; return height; }; }; }, /** * Returns the rendered content size of the given element. * * @param element {Element} element to query * @return {Map} map containing the content width and height of the element */ getContentSize : function(element){ return { width : this.getContentWidth(element), height : this.getContentHeight(element) }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * jQuery Dimension Plugin http://jquery.com/ Version 1.1.3 Copyright: (c) 2007, Paul Bakaus & Brandon Aaron License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: Paul Bakaus Brandon Aaron ************************************************************************ */ /** * Query the location of an arbitrary DOM element in relation to its top * level body element. Works in all major browsers: * * * Mozilla 1.5 + 2.0 * * Internet Explorer 6.0 + 7.0 (both standard & quirks mode) * * Opera 9.2 * * Safari 3.0 beta */ qx.Bootstrap.define("qx.bom.element.Location", { statics : { /** * Queries a style property for the given element * * @param elem {Element} DOM element to query * @param style {String} Style property * @return {String} Value of given style property */ __style : function(elem, style){ return qx.bom.element.Style.get(elem, style, qx.bom.element.Style.COMPUTED_MODE, false); }, /** * Queries a style property for the given element and parses it to an integer value * * @param elem {Element} DOM element to query * @param style {String} Style property * @return {Integer} Value of given style property */ __num : function(elem, style){ return parseInt(qx.bom.element.Style.get(elem, style, qx.bom.element.Style.COMPUTED_MODE, false), 10) || 0; }, /** * Computes the scroll offset of the given element relative to the document * <code>body</code>. * * @param elem {Element} DOM element to query * @return {Map} Map which contains the <code>left</code> and <code>top</code> scroll offsets */ __computeScroll : function(elem){ var left = 0,top = 0; // Find window var win = qx.dom.Node.getWindow(elem); left -= qx.bom.Viewport.getScrollLeft(win); top -= qx.bom.Viewport.getScrollTop(win); return { left : left, top : top }; }, /** * Computes the offset of the given element relative to the document * <code>body</code>. * * @param elem {Element} DOM element to query * @return {Map} Map which contains the <code>left</code> and <code>top</code> offsets */ __computeBody : qx.core.Environment.select("engine.name", { "mshtml" : function(elem){ // Find body element var doc = qx.dom.Node.getDocument(elem); var body = doc.body; var left = 0; var top = 0; left -= body.clientLeft + doc.documentElement.clientLeft; top -= body.clientTop + doc.documentElement.clientTop; if(!qx.core.Environment.get("browser.quirksmode")){ left += this.__num(body, "borderLeftWidth"); top += this.__num(body, "borderTopWidth"); }; return { left : left, top : top }; }, "webkit" : function(elem){ // Find body element var doc = qx.dom.Node.getDocument(elem); var body = doc.body; // Start with the offset var left = body.offsetLeft; var top = body.offsetTop; // only for safari < version 4.0 if(parseFloat(qx.core.Environment.get("engine.version")) < 530.17){ left += this.__num(body, "borderLeftWidth"); top += this.__num(body, "borderTopWidth"); }; return { left : left, top : top }; }, "gecko" : function(elem){ // Find body element var body = qx.dom.Node.getDocument(elem).body; // Start with the offset var left = body.offsetLeft; var top = body.offsetTop; // add the body margin for firefox 3.0 and below if(parseFloat(qx.core.Environment.get("engine.version")) < 1.9){ left += this.__num(body, "marginLeft"); top += this.__num(body, "marginTop"); }; // Correct substracted border (only in content-box mode) if(qx.bom.element.BoxSizing.get(body) !== "border-box"){ left += this.__num(body, "borderLeftWidth"); top += this.__num(body, "borderTopWidth"); }; return { left : left, top : top }; }, // At the moment only correctly supported by Opera "default" : function(elem){ // Find body element var body = qx.dom.Node.getDocument(elem).body; // Start with the offset var left = body.offsetLeft; var top = body.offsetTop; return { left : left, top : top }; } }), /** * Computes the sum of all offsets of the given element node. * * Traditionally this is a loop which goes up the whole parent tree * and sums up all found offsets. * * But both <code>mshtml</code> and <code>gecko >= 1.9</code> support * <code>getBoundingClientRect</code> which allows a * much faster access to the offset position. * * Please note: When gecko 1.9 does not use the <code>getBoundingClientRect</code> * implementation, and therefore use the traditional offset calculation * the gecko 1.9 fix in <code>__computeBody</code> must not be applied. * * @signature function(elem) * @param elem {Element} DOM element to query * @return {Map} Map which contains the <code>left</code> and <code>top</code> offsets */ __computeOffset : qx.core.Environment.select("engine.name", { "gecko" : function(elem){ // Use faster getBoundingClientRect() if available (gecko >= 1.9) if(elem.getBoundingClientRect){ var rect = elem.getBoundingClientRect(); // Firefox 3.0 alpha 6 (gecko 1.9) returns floating point numbers // use Math.round() to round them to style compatible numbers // MSHTML returns integer numbers var left = Math.round(rect.left); var top = Math.round(rect.top); } else { var left = 0; var top = 0; // Stop at the body var body = qx.dom.Node.getDocument(elem).body; var box = qx.bom.element.BoxSizing; if(box.get(elem) !== "border-box"){ left -= this.__num(elem, "borderLeftWidth"); top -= this.__num(elem, "borderTopWidth"); }; while(elem && elem !== body){ // Add node offsets left += elem.offsetLeft; top += elem.offsetTop; // Mozilla does not add the borders to the offset // when using box-sizing=content-box if(box.get(elem) !== "border-box"){ left += this.__num(elem, "borderLeftWidth"); top += this.__num(elem, "borderTopWidth"); }; // Mozilla does not add the border for a parent that has // overflow set to anything but visible if(elem.parentNode && this.__style(elem.parentNode, "overflow") != "visible"){ left += this.__num(elem.parentNode, "borderLeftWidth"); top += this.__num(elem.parentNode, "borderTopWidth"); }; // One level up (offset hierarchy) elem = elem.offsetParent; }; }; return { left : left, top : top }; }, "default" : function(elem){ var doc = qx.dom.Node.getDocument(elem); // Use faster getBoundingClientRect() if available if(elem.getBoundingClientRect){ var rect = elem.getBoundingClientRect(); var left = Math.round(rect.left); var top = Math.round(rect.top); } else { // Offset of the incoming element var left = elem.offsetLeft; var top = elem.offsetTop; // Start with the first offset parent elem = elem.offsetParent; // Stop at the body var body = doc.body; // Border correction is only needed for each parent // not for the incoming element itself while(elem && elem != body){ // Add node offsets left += elem.offsetLeft; top += elem.offsetTop; // Fix missing border left += this.__num(elem, "borderLeftWidth"); top += this.__num(elem, "borderTopWidth"); // One level up (offset hierarchy) elem = elem.offsetParent; }; }; return { left : left, top : top }; } }), /** * Computes the location of the given element in context of * the document dimensions. * * Supported modes: * * * <code>margin</code>: Calculate from the margin box of the element (bigger than the visual appearance: including margins of given element) * * <code>box</code>: Calculates the offset box of the element (default, uses the same size as visible) * * <code>border</code>: Calculate the border box (useful to align to border edges of two elements). * * <code>scroll</code>: Calculate the scroll box (relevant for absolute positioned content). * * <code>padding</code>: Calculate the padding box (relevant for static/relative positioned content). * * @param elem {Element} DOM element to query * @param mode {String?box} A supported option. See comment above. * @return {Map} Returns a map with <code>left</code>, <code>top</code>, * <code>right</code> and <code>bottom</code> which contains the distance * of the element relative to the document. */ get : function(elem, mode){ if(elem.tagName == "BODY"){ var location = this.__getBodyLocation(elem); var left = location.left; var top = location.top; } else { var body = this.__computeBody(elem); var offset = this.__computeOffset(elem); // Reduce by viewport scrolling. // Hint: getBoundingClientRect returns the location of the // element in relation to the viewport which includes // the scrolling var scroll = this.__computeScroll(elem); var left = offset.left + body.left - scroll.left; var top = offset.top + body.top - scroll.top; }; var right = left + elem.offsetWidth; var bottom = top + elem.offsetHeight; if(mode){ // In this modes we want the size as seen from a child what means that we want the full width/height // which may be higher than the outer width/height when the element has scrollbars. if(mode == "padding" || mode == "scroll"){ var overX = qx.bom.element.Style.get(elem, "overflowX"); if(overX == "scroll" || overX == "auto"){ right += elem.scrollWidth - elem.offsetWidth + this.__num(elem, "borderLeftWidth") + this.__num(elem, "borderRightWidth"); }; var overY = qx.bom.element.Style.get(elem, "overflowY"); if(overY == "scroll" || overY == "auto"){ bottom += elem.scrollHeight - elem.offsetHeight + this.__num(elem, "borderTopWidth") + this.__num(elem, "borderBottomWidth"); }; }; switch(mode){case "padding": left += this.__num(elem, "paddingLeft"); top += this.__num(elem, "paddingTop"); right -= this.__num(elem, "paddingRight"); bottom -= this.__num(elem, "paddingBottom");// no break here case "scroll": left -= elem.scrollLeft; top -= elem.scrollTop; right -= elem.scrollLeft; bottom -= elem.scrollTop;// no break here case "border": left += this.__num(elem, "borderLeftWidth"); top += this.__num(elem, "borderTopWidth"); right -= this.__num(elem, "borderRightWidth"); bottom -= this.__num(elem, "borderBottomWidth"); break;case "margin": left -= this.__num(elem, "marginLeft"); top -= this.__num(elem, "marginTop"); right += this.__num(elem, "marginRight"); bottom += this.__num(elem, "marginBottom"); break;}; }; return { left : left, top : top, right : right, bottom : bottom }; }, /** * Get the location of the body element relative to the document. * @param body {Element} The body element. * @return {Map} map with the keys <code>left</code> and <code>top</code> */ __getBodyLocation : function(body){ var top = body.offsetTop; var left = body.offsetLeft; if(qx.core.Environment.get("engine.name") !== "mshtml" || !((parseFloat(qx.core.Environment.get("engine.version")) < 8 || qx.core.Environment.get("browser.documentmode") < 8) && !qx.core.Environment.get("browser.quirksmode"))){ top += this.__num(body, "marginTop"); left += this.__num(body, "marginLeft"); }; if(qx.core.Environment.get("engine.name") === "gecko"){ top += this.__num(body, "borderLeftWidth"); left += this.__num(body, "borderTopWidth"); }; return { left : left, top : top }; }, /** * Computes the location of the given element in context of * the document dimensions. For supported modes please * have a look at the {@link qx.bom.element.Location#get} method. * * @param elem {Element} DOM element to query * @param mode {String} A supported option. See comment above. * @return {Integer} The left distance * of the element relative to the document. */ getLeft : function(elem, mode){ return this.get(elem, mode).left; }, /** * Computes the location of the given element in context of * the document dimensions. For supported modes please * have a look at the {@link qx.bom.element.Location#get} method. * * @param elem {Element} DOM element to query * @param mode {String} A supported option. See comment above. * @return {Integer} The top distance * of the element relative to the document. */ getTop : function(elem, mode){ return this.get(elem, mode).top; }, /** * Computes the location of the given element in context of * the document dimensions. For supported modes please * have a look at the {@link qx.bom.element.Location#get} method. * * @param elem {Element} DOM element to query * @param mode {String} A supported option. See comment above. * @return {Integer} The right distance * of the element relative to the document. */ getRight : function(elem, mode){ return this.get(elem, mode).right; }, /** * Computes the location of the given element in context of * the document dimensions. For supported modes please * have a look at the {@link qx.bom.element.Location#get} method. * * @param elem {Element} DOM element to query * @param mode {String} A supported option. See comment above. * @return {Integer} The bottom distance * of the element relative to the document. */ getBottom : function(elem, mode){ return this.get(elem, mode).bottom; }, /** * Returns the distance between two DOM elements. For supported modes please * have a look at the {@link qx.bom.element.Location#get} method. * * @param elem1 {Element} First element * @param elem2 {Element} Second element * @param mode1 {String?null} Mode for first element * @param mode2 {String?null} Mode for second element * @return {Map} Returns a map with <code>left</code> and <code>top</code> * which contains the distance of the elements from each other. */ getRelative : function(elem1, elem2, mode1, mode2){ var loc1 = this.get(elem1, mode1); var loc2 = this.get(elem2, mode2); return { left : loc1.left - loc2.left, top : loc1.top - loc2.top, right : loc1.right - loc2.right, bottom : loc1.bottom - loc2.bottom }; }, /** * Returns the distance between the given element to its offset parent. * * @param elem {Element} DOM element to query * @return {Map} Returns a map with <code>left</code> and <code>top</code> * which contains the distance of the elements from each other. */ getPosition : function(elem){ return this.getRelative(elem, this.getOffsetParent(elem)); }, /** * Detects the offset parent of the given element * * @param element {Element} Element to query for offset parent * @return {Element} Detected offset parent */ getOffsetParent : function(element){ var offsetParent = element.offsetParent || document.body; var Style = qx.bom.element.Style; while(offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && Style.get(offsetParent, "position") === "static")){ offsetParent = offsetParent.offsetParent; }; return offsetParent; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de 2006 STZ-IDA, Germany, http://www.stz-ida.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) * Andreas Junghans (lucidcake) ************************************************************************ */ /** * Cross-browser wrapper to work with CSS stylesheets. */ qx.Bootstrap.define("qx.bom.Stylesheet", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** * Include a CSS file * * <em>Note:</em> Using a resource ID as the <code>href</code> parameter * will no longer be supported. Call * <code>qx.util.ResourceManager.getInstance().toUri(href)</code> to get * valid URI to be used with this method. * * @param href {String} Href value * @param doc {Document?} Document to modify */ includeFile : function(href, doc){ if(!doc){ doc = document; }; var el = doc.createElement("link"); el.type = "text/css"; el.rel = "stylesheet"; el.href = href; var head = doc.getElementsByTagName("head")[0]; head.appendChild(el); }, /** * Create a new Stylesheet node and append it to the document * * @param text {String?} optional string of css rules * @return {Stylesheet} the generates stylesheet element */ createElement : function(text){ if(qx.core.Environment.get("html.stylesheet.createstylesheet")){ var sheet = document.createStyleSheet(); if(text){ sheet.cssText = text; }; return sheet; } else { var elem = document.createElement("style"); elem.type = "text/css"; if(text){ elem.appendChild(document.createTextNode(text)); }; document.getElementsByTagName("head")[0].appendChild(elem); return elem.sheet; }; }, /** * Insert a new CSS rule into a given Stylesheet * * @param sheet {Object} the target Stylesheet object * @param selector {String} the selector * @param entry {String} style rule */ addRule : function(sheet, selector, entry){ if(qx.core.Environment.get("html.stylesheet.insertrule")){ sheet.insertRule(selector + "{" + entry + "}", sheet.cssRules.length); } else { sheet.addRule(selector, entry); }; }, /** * Remove a CSS rule from a stylesheet * * @param sheet {Object} the Stylesheet * @param selector {String} the Selector of the rule to remove */ removeRule : function(sheet, selector){ if(qx.core.Environment.get("html.stylesheet.deleterule")){ var rules = sheet.cssRules; var len = rules.length; for(var i = len - 1;i >= 0;--i){ if(rules[i].selectorText == selector){ sheet.deleteRule(i); }; }; } else { var rules = sheet.rules; var len = rules.length; for(var i = len - 1;i >= 0;--i){ if(rules[i].selectorText == selector){ sheet.removeRule(i); }; }; }; }, /** * Remove the given sheet from its owner. * @param sheet {Object} the stylesheet object */ removeSheet : function(sheet){ var owner = sheet.ownerNode ? sheet.ownerNode : sheet.owningElement; qx.dom.Element.removeChild(owner, owner.parentNode); }, /** * Remove all CSS rules from a stylesheet * * @param sheet {Object} the stylesheet object */ removeAllRules : function(sheet){ if(qx.core.Environment.get("html.stylesheet.deleterule")){ var rules = sheet.cssRules; var len = rules.length; for(var i = len - 1;i >= 0;i--){ sheet.deleteRule(i); }; } else { var rules = sheet.rules; var len = rules.length; for(var i = len - 1;i >= 0;i--){ sheet.removeRule(i); }; }; }, /** * Add an import of an external CSS file to a stylesheet * * @param sheet {Object} the stylesheet object * @param url {String} URL of the external stylesheet file */ addImport : function(sheet, url){ if(qx.core.Environment.get("html.stylesheet.addimport")){ sheet.addImport(url); } else { sheet.insertRule('@import "' + url + '";', sheet.cssRules.length); }; }, /** * Removes an import from a stylesheet * * @param sheet {Object} the stylesheet object * @param url {String} URL of the imported CSS file */ removeImport : function(sheet, url){ if(qx.core.Environment.get("html.stylesheet.removeimport")){ var imports = sheet.imports; var len = imports.length; for(var i = len - 1;i >= 0;i--){ if(imports[i].href == url || imports[i].href == qx.util.Uri.getAbsolute(url)){ sheet.removeImport(i); }; }; } else { var rules = sheet.cssRules; var len = rules.length; for(var i = len - 1;i >= 0;i--){ if(rules[i].href == url){ sheet.deleteRule(i); }; }; }; }, /** * Remove all imports from a stylesheet * * @param sheet {Object} the stylesheet object */ removeAllImports : function(sheet){ if(qx.core.Environment.get("html.stylesheet.removeimport")){ var imports = sheet.imports; var len = imports.length; for(var i = len - 1;i >= 0;i--){ sheet.removeImport(i); }; } else { var rules = sheet.cssRules; var len = rules.length; for(var i = len - 1;i >= 0;i--){ if(rules[i].type == rules[i].IMPORT_RULE){ sheet.deleteRule(i); }; }; }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (d_wagner) ************************************************************************ */ /** * Internal class which contains the checks used by {@link qx.core.Environment}. * All checks in here are marked as internal which means you should never use * them directly. * * This class contains checks related to Stylesheet objects. * * @internal */ qx.Bootstrap.define("qx.bom.client.Stylesheet", { statics : { /** * Returns a stylesheet to be used for feature checks * * @return {Stylesheet} Stylesheet element */ __getStylesheet : function(){ if(!qx.bom.client.Stylesheet.__stylesheet){ qx.bom.client.Stylesheet.__stylesheet = qx.bom.Stylesheet.createElement(); }; return qx.bom.client.Stylesheet.__stylesheet; }, /** * Check for IE's non-standard document.createStyleSheet function. * In IE9 (standards mode), the typeof check returns "function" so false is * returned. This is intended since IE9 supports the DOM-standard * createElement("style") which should be used instead. * * @internal * @return {Boolean} <code>true</code> if the browser supports * document.createStyleSheet */ getCreateStyleSheet : function(){ return typeof document.createStyleSheet === "object"; }, /** * Check for stylesheet.insertRule. Legacy IEs do not support this. * * @internal * @return {Boolean} <code>true</code> if insertRule is supported */ getInsertRule : function(){ return typeof qx.bom.client.Stylesheet.__getStylesheet().insertRule === "function"; }, /** * Check for stylesheet.deleteRule. Legacy IEs do not support this. * * @internal * @return {Boolean} <code>true</code> if deleteRule is supported */ getDeleteRule : function(){ return typeof qx.bom.client.Stylesheet.__getStylesheet().deleteRule === "function"; }, /** * Decides whether to use the legacy IE-only stylesheet.addImport or the * DOM-standard stylesheet.insertRule('@import [...]') * * @internal * @return {Boolean} <code>true</code> if stylesheet.addImport is supported */ getAddImport : function(){ return (typeof qx.bom.client.Stylesheet.__getStylesheet().addImport === "object"); }, /** * Decides whether to use the legacy IE-only stylesheet.removeImport or the * DOM-standard stylesheet.deleteRule('@import [...]') * * @internal * @return {Boolean} <code>true</code> if stylesheet.removeImport is supported */ getRemoveImport : function(){ return (typeof qx.bom.client.Stylesheet.__getStylesheet().removeImport === "object"); } }, defer : function(statics){ qx.core.Environment.add("html.stylesheet.createstylesheet", statics.getCreateStyleSheet); qx.core.Environment.add("html.stylesheet.insertrule", statics.getInsertRule); qx.core.Environment.add("html.stylesheet.deleterule", statics.getDeleteRule); qx.core.Environment.add("html.stylesheet.addimport", statics.getAddImport); qx.core.Environment.add("html.stylesheet.removeimport", statics.getRemoveImport); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ************************************************************************ */ /** * Manages children structures of an element. Easy and convenient APIs * to insert, remove and replace children. */ qx.Bootstrap.define("qx.dom.Element", { statics : { /** * {Map} A list of all attributes which needs to be part of the initial element to work correctly * * @internal */ __initialAttributes : { "onload" : true, "onpropertychange" : true, "oninput" : true, "onchange" : true, "name" : true, "type" : true, "checked" : true, "disabled" : true }, /** * Whether the given <code>child</code> is a child of <code>parent</code> * * @param parent {Element} parent element * @param child {Node} child node * @return {Boolean} true when the given <code>child</code> is a child of <code>parent</code> */ hasChild : function(parent, child){ return child.parentNode === parent; }, /** * Whether the given <code>element</code> has children. * * @param element {Element} element to test * @return {Boolean} true when the given <code>element</code> has at least one child node */ hasChildren : function(element){ return !!element.firstChild; }, /** * Whether the given <code>element</code> has any child elements. * * @param element {Element} element to test * @return {Boolean} true when the given <code>element</code> has at least one child element */ hasChildElements : function(element){ element = element.firstChild; while(element){ if(element.nodeType === 1){ return true; }; element = element.nextSibling; }; return false; }, /** * Returns the parent element of the given element. * * @param element {Element} Element to find the parent for * @return {Element} The parent element */ getParentElement : function(element){ return element.parentNode; }, /** * Checks if the <code>element</code> is in the DOM, but note that * the method is very expensive! * * @param element {Element} The DOM element to check. * @param win {Window} The window to check for. * @return {Boolean} <code>true</code> if the <code>element</code> is in * the DOM, <code>false</code> otherwise. */ isInDom : function(element, win){ if(!win){ win = window; }; var domElements = win.document.getElementsByTagName(element.nodeName); for(var i = 0,l = domElements.length;i < l;i++){ if(domElements[i] === element){ return true; }; }; return false; }, /* --------------------------------------------------------------------------- INSERTION --------------------------------------------------------------------------- */ /** * Inserts <code>node</code> at the given <code>index</code> * inside <code>parent</code>. * * @param node {Node} node to insert * @param parent {Element} parent element node * @param index {Integer} where to insert * @return {Boolean} returns true (successful) */ insertAt : function(node, parent, index){ var ref = parent.childNodes[index]; if(ref){ parent.insertBefore(node, ref); } else { parent.appendChild(node); }; return true; }, /** * Insert <code>node</code> into <code>parent</code> as first child. * Indexes of other children will be incremented by one. * * @param node {Node} Node to insert * @param parent {Element} parent element node * @return {Boolean} returns true (successful) */ insertBegin : function(node, parent){ if(parent.firstChild){ this.insertBefore(node, parent.firstChild); } else { parent.appendChild(node); }; return true; }, /** * Insert <code>node</code> into <code>parent</code> as last child. * * @param node {Node} Node to insert * @param parent {Element} parent element node * @return {Boolean} returns true (successful) */ insertEnd : function(node, parent){ parent.appendChild(node); return true; }, /** * Inserts <code>node</code> before <code>ref</code> in the same parent. * * @param node {Node} Node to insert * @param ref {Node} Node which will be used as reference for insertion * @return {Boolean} returns true (successful) */ insertBefore : function(node, ref){ ref.parentNode.insertBefore(node, ref); return true; }, /** * Inserts <code>node</code> after <code>ref</code> in the same parent. * * @param node {Node} Node to insert * @param ref {Node} Node which will be used as reference for insertion * @return {Boolean} returns true (successful) */ insertAfter : function(node, ref){ var parent = ref.parentNode; if(ref == parent.lastChild){ parent.appendChild(node); } else { return this.insertBefore(node, ref.nextSibling); }; return true; }, /* --------------------------------------------------------------------------- REMOVAL --------------------------------------------------------------------------- */ /** * Removes the given <code>node</code> from its parent element. * * @param node {Node} Node to remove * @return {Boolean} <code>true</code> when node was successfully removed, * otherwise <code>false</code> */ remove : function(node){ if(!node.parentNode){ return false; }; node.parentNode.removeChild(node); return true; }, /** * Removes the given <code>node</code> from the <code>parent</code>. * * @param node {Node} Node to remove * @param parent {Element} parent element which contains the <code>node</code> * @return {Boolean} <code>true</code> when node was successfully removed, * otherwise <code>false</code> */ removeChild : function(node, parent){ if(node.parentNode !== parent){ return false; }; parent.removeChild(node); return true; }, /** * Removes the node at the given <code>index</code> * from the <code>parent</code>. * * @param index {Integer} position of the node which should be removed * @param parent {Element} parent DOM element * @return {Boolean} <code>true</code> when node was successfully removed, * otherwise <code>false</code> */ removeChildAt : function(index, parent){ var child = parent.childNodes[index]; if(!child){ return false; }; parent.removeChild(child); return true; }, /* --------------------------------------------------------------------------- REPLACE --------------------------------------------------------------------------- */ /** * Replaces <code>oldNode</code> with <code>newNode</code> in the current * parent of <code>oldNode</code>. * * @param newNode {Node} DOM node to insert * @param oldNode {Node} DOM node to remove * @return {Boolean} <code>true</code> when node was successfully replaced */ replaceChild : function(newNode, oldNode){ if(!oldNode.parentNode){ return false; }; oldNode.parentNode.replaceChild(newNode, oldNode); return true; }, /** * Replaces the node at <code>index</code> with <code>newNode</code> in * the given parent. * * @param newNode {Node} DOM node to insert * @param index {Integer} position of old DOM node * @param parent {Element} parent DOM element * @return {Boolean} <code>true</code> when node was successfully replaced */ replaceAt : function(newNode, index, parent){ var oldNode = parent.childNodes[index]; if(!oldNode){ return false; }; parent.replaceChild(newNode, oldNode); return true; }, /** * Stores helper element for element creation in WebKit * * @internal */ __helperElement : { }, /** * Saves whether a helper element is needed for each window. * * @internal */ __allowMarkup : { }, /** * Detects if the DOM support a <code>document.createElement</code> call with a * <code>String</code> as markup like: * * <pre class="javascript"> * document.createElement("<INPUT TYPE='RADIO' NAME='RADIOTEST' VALUE='Second Choice'>"); * </pre> * * Element creation with markup is not standard compatible with Document Object Model (Core) Level 1, but * Internet Explorer supports it. With an exception that IE9 in IE9 standard mode is standard compatible and * doesn't support element creation with markup. * * @param win {Window?} Window to check for * @return {Boolean} <code>true</code> if the DOM supports it, <code>false</code> otherwise. */ _allowCreationWithMarkup : function(win){ if(!win){ win = window; }; // key is needed to allow using different windows var key = win.location.href; if(qx.dom.Element.__allowMarkup[key] == undefined){ try{ win.document.createElement("<INPUT TYPE='RADIO' NAME='RADIOTEST' VALUE='Second Choice'>"); qx.dom.Element.__allowMarkup[key] = true; } catch(e) { qx.dom.Element.__allowMarkup[key] = false; }; }; return qx.dom.Element.__allowMarkup[key]; }, /** * Creates and returns a DOM helper element. * * @param win {Window?} Window to create the element for * @return {Element} The created element node */ getHelperElement : function(win){ if(!win){ win = window; }; // key is needed to allow using different windows var key = win.location.href; if(!qx.dom.Element.__helperElement[key]){ var helper = qx.dom.Element.__helperElement[key] = win.document.createElement("div"); // innerHTML will only parsed correctly if element is appended to document if(qx.core.Environment.get("engine.name") == "webkit"){ helper.style.display = "none"; win.document.body.appendChild(helper); }; }; return qx.dom.Element.__helperElement[key]; }, /** * Creates a DOM element. * * Attributes may be given directly with this call. This is critical * for some attributes e.g. name, type, ... in many clients. * * Depending on the kind of attributes passed, <code>innerHTML</code> may be * used internally to assemble the element. Please make sure you understand * the security implications. See {@link qx.bom.Html#clean}. * * @param name {String} Tag name of the element * @param attributes {Map?} Map of attributes to apply * @param win {Window?} Window to create the element for * @return {Element} The created element node */ create : function(name, attributes, win){ if(!win){ win = window; }; if(!name){ throw new Error("The tag name is missing!"); }; var initial = this.__initialAttributes; var attributesHtml = ""; for(var key in attributes){ if(initial[key]){ attributesHtml += key + "='" + attributes[key] + "' "; }; }; var element; // If specific attributes are defined we need to process // the element creation in a more complex way. if(attributesHtml != ""){ if(qx.dom.Element._allowCreationWithMarkup(win)){ element = win.document.createElement("<" + name + " " + attributesHtml + ">"); } else { var helper = qx.dom.Element.getHelperElement(win); helper.innerHTML = "<" + name + " " + attributesHtml + "></" + name + ">"; element = helper.firstChild; }; } else { element = win.document.createElement(name); }; for(var key in attributes){ if(!initial[key]){ qx.bom.element.Attribute.set(element, key, attributes[key]); }; }; return element; }, /** * Removes all content from the given element * * @param element {Element} element to clean * @return {String} empty string (new HTML content) */ empty : function(element){ return element.innerHTML = ""; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2010 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Alexander Steitz (aback) ====================================================================== This class contains code based on the following work: * Prototype JS http://www.prototypejs.org/ Version 1.5 Copyright: (c) 2006-2007, Prototype Core Team License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Prototype Core Team ---------------------------------------------------------------------- Copyright (c) 2005-2008 Sam Stephenson 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 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. ************************************************************************ */ /** * Attribute/Property handling for DOM HTML elements. * * Also includes support for HTML properties like <code>checked</code> * or <code>value</code>. This feature set is supported cross-browser * through one common interface and is independent of the differences between * the multiple implementations. * * Supports applying text and HTML content using the attribute names * <code>text</code> and <code>html</code>. */ qx.Bootstrap.define("qx.bom.element.Attribute", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** Internal map of attribute conversions */ __hints : { // Name translation table (camelcase is important for some attributes) names : { "class" : "className", "for" : "htmlFor", html : "innerHTML", text : qx.core.Environment.get("html.element.textcontent") ? "textContent" : "innerText", colspan : "colSpan", rowspan : "rowSpan", valign : "vAlign", datetime : "dateTime", accesskey : "accessKey", tabindex : "tabIndex", maxlength : "maxLength", readonly : "readOnly", longdesc : "longDesc", cellpadding : "cellPadding", cellspacing : "cellSpacing", frameborder : "frameBorder", usemap : "useMap" }, // Attributes which are only applyable on a DOM element (not using compile()) runtime : { "html" : 1, "text" : 1 }, // Attributes which are (forced) boolean bools : { compact : 1, nowrap : 1, ismap : 1, declare : 1, noshade : 1, checked : 1, disabled : 1, readOnly : 1, multiple : 1, selected : 1, noresize : 1, defer : 1, allowTransparency : 1 }, // Interpreted as property (element.property) property : { // Used by qx.html.Element $$html : 1, // Used by qx.ui.core.Widget $$widget : 1, // Native properties disabled : 1, checked : 1, readOnly : 1, multiple : 1, selected : 1, value : 1, maxLength : 1, className : 1, innerHTML : 1, innerText : 1, textContent : 1, htmlFor : 1, tabIndex : 1 }, qxProperties : { $$widget : 1, $$html : 1 }, // Default values when "null" is given to a property propertyDefault : { disabled : false, checked : false, readOnly : false, multiple : false, selected : false, value : "", className : "", innerHTML : "", innerText : "", textContent : "", htmlFor : "", tabIndex : 0, maxLength : qx.core.Environment.select("engine.name", { "mshtml" : 2147483647, "webkit" : 524288, "default" : -1 }) }, // Properties which can be removed to reset them removeableProperties : { disabled : 1, multiple : 1, maxLength : 1 }, // Use getAttribute(name, 2) for these to query for the real value, not // the interpreted one. original : { href : 1, src : 1, type : 1 } }, /** * Compiles an incoming attribute map to a string which * could be used when building HTML blocks using innerHTML. * * This method silently ignores runtime attributes like * <code>html</code> or <code>text</code>. * * @param map {Map} Map of attributes. The key is the name of the attribute. * @return {String} Returns a compiled string ready for usage. */ compile : function(map){ var html = []; var runtime = this.__hints.runtime; for(var key in map){ if(!runtime[key]){ html.push(key, "='", map[key], "'"); }; }; return html.join(""); }, /** * Returns the value of the given HTML attribute * * @param element {Element} The DOM element to query * @param name {String} Name of the attribute * @return {var} The value of the attribute */ get : function(element, name){ var hints = this.__hints; var value; // normalize name name = hints.names[name] || name; // respect original values // http://msdn2.microsoft.com/en-us/library/ms536429.aspx if(qx.core.Environment.get("engine.name") == "mshtml" && parseInt(qx.core.Environment.get("browser.documentmode"), 10) < 8 && hints.original[name]){ value = element.getAttribute(name, 2); } else if(hints.property[name]){ value = element[name]; if(typeof hints.propertyDefault[name] !== "undefined" && value == hints.propertyDefault[name]){ // only return null for all non-boolean properties if(typeof hints.bools[name] === "undefined"){ return null; } else { return value; }; }; } else { // fallback to attribute value = element.getAttribute(name); }; if(hints.bools[name]){ return !!value; }; return value; }, /** * Sets an HTML attribute on the given DOM element * * @param element {Element} The DOM element to modify * @param name {String} Name of the attribute * @param value {var} New value of the attribute */ set : function(element, name, value){ if(typeof value === "undefined"){ return; }; var hints = this.__hints; // normalize name name = hints.names[name] || name; // respect booleans if(hints.bools[name]){ value = !!value; }; // apply attribute // only properties which can be applied by the browser or qxProperties // otherwise use the attribute methods if(hints.property[name] && (!(element[name] === undefined) || hints.qxProperties[name])){ // resetting the attribute/property if(value == null){ // for properties which need to be removed for a correct reset if(hints.removeableProperties[name]){ element.removeAttribute(name); return; } else if(typeof hints.propertyDefault[name] !== "undefined"){ value = hints.propertyDefault[name]; }; }; element[name] = value; } else { if(value === true){ element.setAttribute(name, name); } else if(value === false || value === null){ element.removeAttribute(name); } else { element.setAttribute(name, value); }; }; }, /** * Resets an HTML attribute on the given DOM element * * @param element {Element} The DOM element to modify * @param name {String} Name of the attribute */ reset : function(element, name){ this.set(element, name, null); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * Utility for checking the type of a variable. * It adds a <code>type</code> key static to q and offers the given method. * * <pre class="javascript"> * q.type.get("abc"); // return "String" e.g. * </pre> */ qx.Bootstrap.define("qx.module.util.Type", { statics : { /** * Get the internal class of the value. The following classes are possible: * <code>"String"</code>, * <code>"Array"</code>, * <code>"Object"</code>, * <code>"RegExp"</code>, * <code>"Number"</code>, * <code>"Boolean"</code>, * <code>"Date"</code>, * <code>"Function"</code>, * <code>"Error"</code> * </pre> * @attachStatic {qxWeb, type.get} * @signature function(value) * @param value {var} Value to get the class for. * @return {String} The internal class of the value. */ get : qx.Bootstrap.getClass }, defer : function(statics){ qxWeb.$attachStatic({ type : { get : statics.get } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ====================================================================== This class contains code based on the following work: * es5-shim Code: https://github.com/kriskowal/es5-shim/ Copyright: (c) 2009, 2010 Kristopher Michael Kowal License: https://github.com/kriskowal/es5-shim/blob/master/LICENSE ---------------------------------------------------------------------- Copyright 2009, 2010 Kristopher Michael Kowal. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 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. ---------------------------------------------------------------------- Version: Snapshot taken on 2012-07-25,: commit 9f539abd9aa9950e1d907077a4be7f5133a00e52 ************************************************************************ */ /** * This class takes care of the normalization of the native 'Function' object. * Therefore it checks the availability of the following methods and appends * it, if not available. This means you can use the methods during * development in every browser. For usage samples, check out the attached links. * * *bind*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind">MDN documentation</a> | * <a href="http://es5.github.com/#x15.3.4.5">Annotated ES5 Spec</a> */ qx.Bootstrap.define("qx.lang.normalize.Function", { defer : function(){ // bind if(!qx.core.Environment.get("ecmascript.function.bind")){ var slice = Array.prototype.slice; Function.prototype.bind = function(that){ // .length is 1 // 1. Let Target be the this value. var target = this; // 2. If IsCallable(Target) is false, throw a TypeError exception. if(typeof target != "function"){ throw new TypeError("Function.prototype.bind called on incompatible " + target); }; // 3. Let A be a new (possibly empty) internal list of all of the // argument values provided after thisArg (arg1, arg2 etc), in order. // XXX slicedArgs will stand in for "A" if used var args = slice.call(arguments, 1); // for normal call // 4. Let F be a new native ECMAScript object. // 11. Set the [[Prototype]] internal property of F to the standard // built-in Function prototype object as specified in 15.3.3.1. // 12. Set the [[Call]] internal property of F as described in // 15.3.4.5.1. // 13. Set the [[Construct]] internal property of F as described in // 15.3.4.5.2. // 14. Set the [[HasInstance]] internal property of F as described in // 15.3.4.5.3. var bound = function(){ if(this instanceof bound){ // 15.3.4.5.2 [[Construct]] // When the [[Construct]] internal method of a function object, // F that was created using the bind function is called with a // list of arguments ExtraArgs, the following steps are taken: // 1. Let target be the value of F's [[TargetFunction]] // internal property. // 2. If target has no [[Construct]] internal method, a // TypeError exception is thrown. // 3. Let boundArgs be the value of F's [[BoundArgs]] internal // property. // 4. Let args be a new list containing the same values as the // list boundArgs in the same order followed by the same // values as the list ExtraArgs in the same order. // 5. Return the result of calling the [[Construct]] internal // method of target providing args as the arguments. var F = function(){ }; F.prototype = target.prototype; var self = new F; var result = target.apply(self, args.concat(slice.call(arguments))); if(Object(result) === result){ return result; }; return self; } else { // 15.3.4.5.1 [[Call]] // When the [[Call]] internal method of a function object, F, // which was created using the bind function is called with a // this value and a list of arguments ExtraArgs, the following // steps are taken: // 1. Let boundArgs be the value of F's [[BoundArgs]] internal // property. // 2. Let boundThis be the value of F's [[BoundThis]] internal // property. // 3. Let target be the value of F's [[TargetFunction]] internal // property. // 4. Let args be a new list containing the same values as the // list boundArgs in the same order followed by the same // values as the list ExtraArgs in the same order. // 5. Return the result of calling the [[Call]] internal method // of target providing boundThis as the this value and // providing args as the arguments. // equiv: target.call(this, ...boundArgs, ...args) return target.apply(that, args.concat(slice.call(arguments))); }; }; // XXX bound.length is never writable, so don't even try // // 15. If the [[Class]] internal property of Target is "Function", then // a. Let L be the length property of Target minus the length of A. // b. Set the length own property of F to either 0 or L, whichever is // larger. // 16. Else set the length own property of F to 0. // 17. Set the attributes of the length own property of F to the values // specified in 15.3.5.1. // TODO // 18. Set the [[Extensible]] internal property of F to true. // TODO // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). // 20. Call the [[DefineOwnProperty]] internal method of F with // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and // false. // 21. Call the [[DefineOwnProperty]] internal method of F with // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, // and false. // NOTE Function objects created using Function.prototype.bind do not // have a prototype property or the [[Code]], [[FormalParameters]], and // [[Scope]] internal properties. // XXX can't delete prototype in pure-js. // 22. Return F. return bound; }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class takes care of the normalization of the native 'Error' object. * It contains a simple bugfix for toString which might not print out the proper * error message. * * *toString*: * <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/toString">MDN documentation</a> | * <a href="http://es5.github.com/#x15.11.4.4">Annotated ES5 Spec</a> */ qx.Bootstrap.define("qx.lang.normalize.Error", { defer : function(){ // toString if(!qx.core.Environment.get("ecmascript.error.toString")){ Error.prototype.toString = function(){ var name = this.name || "Error"; var message = this.message || ""; if(name === "" && message === ""){ return "Error"; }; if(name === ""){ return message; }; if(message === ""){ return name; }; return name + ": " + message; }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.lang.normalize.Function) #require(qx.lang.normalize.String) #require(qx.lang.normalize.Date) #require(qx.lang.normalize.Array) #require(qx.lang.normalize.Error) #require(qx.lang.normalize.Object) ************************************************************************ */ /** * Adds JavaScript features that may not be supported by all clients. */ qx.Bootstrap.define("qx.module.Polyfill", { }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Polyfill) ************************************************************************ */ /** * Support for native and custom events. */ qx.Bootstrap.define("qx.module.Event", { statics : { /** * Event normalization registry * * @type {Map} * @internal */ __normalizations : { }, /** * Registry of event hooks * @internal */ __hooks : { on : { }, off : { } }, /** * Registers a listener for the given event type on each item in the * collection. This can be either native or custom events. * * @attach {qxWeb} * @param type {String} Type of the event to listen for * @param listener {Function} Listener callback * @param context {Object?} Context the callback function will be executed in. * Default: The element on which the listener was registered * @return {qxWeb} The collection for chaining */ on : function(type, listener, context){ for(var i = 0;i < this.length;i++){ var el = this[i]; var ctx = context || qxWeb(el); // call hooks var hooks = qx.module.Event.__hooks.on; // generic var typeHooks = hooks["*"] || []; // type specific if(hooks[type]){ typeHooks = typeHooks.concat(hooks[type]); }; for(var j = 0,m = typeHooks.length;j < m;j++){ typeHooks[j](el, type, listener, context); }; var bound = function(event){ // apply normalizations var registry = qx.module.Event.__normalizations; // generic var normalizations = registry["*"] || []; // type specific if(registry[type]){ normalizations = normalizations.concat(registry[type]); }; for(var x = 0,y = normalizations.length;x < y;x++){ event = normalizations[x](event, el, type); }; // call original listener with normalized event listener.apply(this, [event]); }.bind(ctx); bound.original = listener; // add native listener if(qx.bom.Event.supportsEvent(el, type)){ qx.bom.Event.addNativeListener(el, type, bound); }; // create an emitter if necessary if(!el.__emitter){ el.__emitter = new qx.event.Emitter(); }; var id = el.__emitter.on(type, bound, ctx); if(!el.__listener){ el.__listener = { }; }; if(!el.__listener[type]){ el.__listener[type] = { }; }; el.__listener[type][id] = bound; if(!context){ // store a reference to the dynamically created context so we know // what to check for when removing the listener if(!el.__ctx){ el.__ctx = { }; }; el.__ctx[id] = ctx; }; }; return this; }, /** * Unregisters event listeners for the given type from each element in the * collection. * * @attach {qxWeb} * @param type {String} Type of the event * @param listener {Function} Listener callback * @param context {Object?} Listener callback context * @return {qxWeb} The collection for chaining */ off : function(type, listener, context){ for(var j = 0;j < this.length;j++){ var el = this[j]; // continue if no listener are available if(!el.__listener){ continue; }; for(var id in el.__listener[type]){ var storedListener = el.__listener[type][id]; if(storedListener == listener || storedListener.original == listener){ // get the stored context var hasStoredContext = typeof el.__ctx !== "undefined" && el.__ctx[id]; if(!context && hasStoredContext){ var storedContext = el.__ctx[id]; }; // remove the listener from the emitter el.__emitter.off(type, storedListener, storedContext || context); // check if it's a bound listener which means it was a native event if(storedListener.original == listener){ // remove the native listener qx.bom.Event.removeNativeListener(el, type, storedListener); }; delete el.__listener[type][id]; if(hasStoredContext){ delete el.__ctx[id]; }; }; }; // call hooks var hooks = qx.module.Event.__hooks.off; // generic var typeHooks = hooks["*"] || []; // type specific if(hooks[type]){ typeHooks = typeHooks.concat(hooks[type]); }; for(var i = 0,m = typeHooks.length;i < m;i++){ typeHooks[i](el, type, listener, context); }; }; return this; }, /** * Fire an event of the given type. * * @attach {qxWeb} * @param type {String} Event type * @param data {var?} Optional data that will be passed to the listener * callback function. * @return {qxWeb} The collection for chaining */ emit : function(type, data){ for(var j = 0;j < this.length;j++){ var el = this[j]; if(el.__emitter){ el.__emitter.emit(type, data); }; }; return this; }, /** * Attaches a listener for the given event that will be executed only once. * * @attach {qxWeb} * @param type {String} Type of the event to listen for * @param listener {Function} Listener callback * @param context {Object?} Context the callback function will be executed in. * Default: The element on which the listener was registered * @return {qxWeb} The collection for chaining */ once : function(type, listener, context){ var self = this; var wrappedListener = function(data){ self.off(type, wrappedListener, context); listener.call(this, data); }; this.on(type, wrappedListener, context); return this; }, /** * Checks if one or more listeners for the given event type are attached to * the first element in the collection * * @attach {qxWeb} * @param type {String} Event type, e.g. <code>mousedown</code> * @return {Boolean} <code>true</code> if one or more listeners are attached */ hasListener : function(type){ if(!this[0] || !this[0].__emitter || !this[0].__emitter.getListeners()[type]){ return false; }; return this[0].__emitter.getListeners()[type].length > 0; }, /** * Copies any event listeners that are attached to the elements in the * collection to the provided target element * * @internal * @param target {Element} Element to attach the copied listeners to */ copyEventsTo : function(target){ var source = this.concat(); // get all children of source and target for(var i = source.length - 1;i >= 0;i--){ var descendants = source[i].getElementsByTagName("*"); for(var j = 0;j < descendants.length;j++){ source.push(descendants[j]); }; }; for(var i = target.length - 1;i >= 0;i--){ var descendants = target[i].getElementsByTagName("*"); for(var j = 0;j < descendants.length;j++){ target.push(descendants[j]); }; }; // make sure no emitter object has been copied target.forEach(function(el){ el.__emitter = null; }); for(var i = 0;i < source.length;i++){ var el = source[i]; if(!el.__emitter){ continue; }; var storage = el.__emitter.getListeners(); for(var name in storage){ for(var j = storage[name].length - 1;j >= 0;j--){ var listener = storage[name][j].listener; if(listener.original){ listener = listener.original; }; qxWeb(target[i]).on(name, listener, storage[name][j].ctx); }; }; }; }, __isReady : false, /** * Executes the given function once the document is ready. * * @attachStatic {qxWeb} * @param callback {Function} callback function */ ready : function(callback){ // DOM is already ready if(document.readyState === "complete"){ window.setTimeout(callback, 1); return; }; // listen for the load event so the callback is executed no matter what var onWindowLoad = function(){ qx.module.Event.__isReady = true; callback(); }; qxWeb(window).on("load", onWindowLoad); var wrappedCallback = function(){ qxWeb(window).off("load", onWindowLoad); callback(); }; // Listen for DOMContentLoaded event if available (no way to reliably detect // support) if(qxWeb.env.get("engine.name") !== "mshtml" || qxWeb.env.get("browser.documentmode") > 8){ qx.bom.Event.addNativeListener(document, "DOMContentLoaded", wrappedCallback); } else { // Continually check to see if the document is ready var timer = function(){ // onWindowLoad already executed if(qx.module.Event.__isReady){ return; }; try{ // If DOMContentLoaded is unavailable, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); if(document.body){ wrappedCallback(); }; } catch(error) { window.setTimeout(timer, 100); }; }; timer(); }; }, /** * Registers a normalization function for the given event types. Listener * callbacks for these types will be called with the return value of the * normalization function instead of the regular event object. * * The normalizer will be called with two arguments: The original event * object and the element on which the event was triggered * * @attachStatic {qxWeb, $registerEventNormalization} * @param types {String[]} List of event types to be normalized. Use an * asterisk (<code>*</code>) to normalize all event types * @param normalizer {Function} Normalizer function */ $registerNormalization : function(types, normalizer){ if(!qx.lang.Type.isArray(types)){ types = [types]; }; var registry = qx.module.Event.__normalizations; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(qx.lang.Type.isFunction(normalizer)){ if(!registry[type]){ registry[type] = []; }; registry[type].push(normalizer); }; }; }, /** * Unregisters a normalization function from the given event types. * * @attachStatic {qxWeb, $unregisterEventNormalization} * @param types {String[]} List of event types * @param normalizer {Function} Normalizer function */ $unregisterNormalization : function(types, normalizer){ if(!qx.lang.Type.isArray(types)){ types = [types]; }; var registry = qx.module.Event.__normalizations; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(registry[type]){ qx.lang.Array.remove(registry[type], normalizer); }; }; }, /** * Returns all registered event normalizers * * @attachStatic {qxWeb, $getEventNormalizationRegistry} * @return {Map} Map of event types/normalizer functions */ $getRegistry : function(){ return qx.module.Event.__normalizations; }, /** * Registers an event hook for the given event types. * * @attachStatic {qxWeb, $registerEventHook} * @param types {String[]} List of event types * @param registerHook {Function} Hook function to be called on event registration * @param unregisterHook {Function?} Hook function to be called on event deregistration * @internal */ $registerEventHook : function(types, registerHook, unregisterHook){ if(!qx.lang.Type.isArray(types)){ types = [types]; }; var onHooks = qx.module.Event.__hooks.on; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(qx.lang.Type.isFunction(registerHook)){ if(!onHooks[type]){ onHooks[type] = []; }; onHooks[type].push(registerHook); }; }; if(!unregisterHook){ return; }; var offHooks = qx.module.Event.__hooks.off; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(qx.lang.Type.isFunction(unregisterHook)){ if(!offHooks[type]){ offHooks[type] = []; }; offHooks[type].push(unregisterHook); }; }; }, /** * Unregisters a hook from the given event types. * * @attachStatic {qxWeb, $unregisterEventHooks} * @param types {String[]} List of event types * @param registerHook {Function} Hook function to be called on event registration * @param unregisterHook {Function?} Hook function to be called on event deregistration * @internal */ $unregisterEventHook : function(types, registerHook, unregisterHook){ if(!qx.lang.Type.isArray(types)){ types = [types]; }; var onHooks = qx.module.Event.__hooks.on; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(onHooks[type]){ qx.lang.Array.remove(onHooks[type], registerHook); }; }; if(!unregisterHook){ return; }; var offHooks = qx.module.Event.__hooks.off; for(var i = 0,l = types.length;i < l;i++){ var type = types[i]; if(offHooks[type]){ qx.lang.Array.remove(offHooks[type], unregisterHook); }; }; }, /** * Returns all registered event hooks * * @attachStatic {qxWeb, $getEventHookRegistry} * @return {Map} Map of event types/registration hook functions * @internal */ $getHookRegistry : function(){ return qx.module.Event.__hooks; } }, defer : function(statics){ qxWeb.$attach({ "on" : statics.on, "off" : statics.off, "once" : statics.once, "emit" : statics.emit, "hasListener" : statics.hasListener, "copyEventsTo" : statics.copyEventsTo }); qxWeb.$attachStatic({ "ready" : statics.ready, "$registerEventNormalization" : statics.$registerNormalization, "$unregisterEventNormalization" : statics.$unregisterNormalization, "$getEventNormalizationRegistry" : statics.$getRegistry, "$registerEventHook" : statics.$registerEventHook, "$unregisterEventHook" : statics.$unregisterEventHook, "$getEventHookRegistry" : statics.$getHookRegistry }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2007-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) * Sebastian Werner (wpbasti) * Alexander Steitz (aback) * Christian Hagendorn (chris_schmidt) ====================================================================== This class contains code based on the following work: * Juriy Zaytsev http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ Copyright (c) 2009 Juriy Zaytsev Licence: BSD: http://github.com/kangax/iseventsupported/blob/master/LICENSE ---------------------------------------------------------------------- http://github.com/kangax/iseventsupported/blob/master/LICENSE Copyright (c) 2009 Juriy Zaytsev 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. ************************************************************************ */ /** * Wrapper around native event management capabilities of the browser. * This class should not be used directly normally. It's better * to use {@link qx.event.Registration} instead. */ qx.Bootstrap.define("qx.bom.Event", { statics : { /** * Use the low level browser functionality to attach event listeners * to DOM nodes. * * Use this with caution. This is only thought for event handlers and * qualified developers. These are not mem-leak protected! * * @param target {Object} Any valid native event target * @param type {String} Name of the event * @param listener {Function} The pointer to the function to assign * @param useCapture {Boolean ? false} A Boolean value that specifies the event phase to add * the event handler for the capturing phase or the bubbling phase. */ addNativeListener : function(target, type, listener, useCapture){ if(target.addEventListener){ target.addEventListener(type, listener, !!useCapture); } else if(target.attachEvent){ target.attachEvent("on" + type, listener); } else if(typeof target["on" + type] != "undefined"){ target["on" + type] = listener; } else { { }; };; }, /** * Use the low level browser functionality to remove event listeners * from DOM nodes. * * @param target {Object} Any valid native event target * @param type {String} Name of the event * @param listener {Function} The pointer to the function to assign * @param useCapture {Boolean ? false} A Boolean value that specifies the event phase to remove * the event handler for the capturing phase or the bubbling phase. */ removeNativeListener : function(target, type, listener, useCapture){ if(target.removeEventListener){ target.removeEventListener(type, listener, !!useCapture); } else if(target.detachEvent){ try{ target.detachEvent("on" + type, listener); } catch(e) { // IE7 sometimes dispatches "unload" events on protected windows // Ignore the "permission denied" errors. if(e.number !== -2146828218){ throw e; }; }; } else if(typeof target["on" + type] != "undefined"){ target["on" + type] = null; } else { { }; };; }, /** * Returns the target of the event. * * @param e {Event} Native event object * @return {Object} Any valid native event target */ getTarget : function(e){ return e.target || e.srcElement; }, /** * Computes the related target from the native DOM event * * @param e {Event} Native DOM event object * @return {Element} The related target */ getRelatedTarget : function(e){ if(e.relatedTarget !== undefined){ // In Firefox the related target of mouse events is sometimes an // anonymous div inside of a text area, which raises an exception if // the nodeType is read. This is why the try/catch block is needed. if((qx.core.Environment.get("engine.name") == "gecko")){ try{ e.relatedTarget && e.relatedTarget.nodeType; } catch(ex) { return null; }; }; return e.relatedTarget; } else if(e.fromElement !== undefined && e.type === "mouseover"){ return e.fromElement; } else if(e.toElement !== undefined){ return e.toElement; } else { return null; };; }, /** * Prevent the native default of the event to be processed. * * This is useful to stop native keybindings, native selection * and other native functionality behind events. * * @param e {Event} Native event object */ preventDefault : function(e){ if(e.preventDefault){ e.preventDefault(); } else { try{ // this allows us to prevent some key press events in IE. // See bug #1049 e.keyCode = 0; } catch(ex) { }; e.returnValue = false; }; }, /** * Stops the propagation of the given event to the parent element. * * Only useful for events which bubble e.g. mousedown. * * @param e {Event} Native event object */ stopPropagation : function(e){ if(e.stopPropagation){ e.stopPropagation(); } else { e.cancelBubble = true; }; }, /** * Fires a synthetic native event on the given element. * * @param target {Element} DOM element to fire event on * @param type {String} Name of the event to fire * @return {Boolean} A value that indicates whether any of the event handlers called {@link #preventDefault}. * <code>true</code> The default action is permitted, <code>false</code> the caller should prevent the default action. */ fire : function(target, type){ // dispatch for standard first if(document.createEvent){ var evt = document.createEvent("HTMLEvents"); evt.initEvent(type, true, true); return !target.dispatchEvent(evt); } else { var evt = document.createEventObject(); return target.fireEvent("on" + type, evt); }; }, /** * Whether the given target supports the given event type. * * Useful for testing for support of new features like * touch events, gesture events, orientation change, on/offline, etc. * * @signature function(target, type) * @param target {var} Any valid target e.g. window, dom node, etc. * @param type {String} Type of the event e.g. click, mousedown * @return {Boolean} Whether the given event is supported */ supportsEvent : function(target, type){ var eventName = "on" + type; var supportsEvent = (eventName in target); if(!supportsEvent){ supportsEvent = typeof target[eventName] == "function"; if(!supportsEvent && target.setAttribute){ target.setAttribute(eventName, "return;"); supportsEvent = typeof target[eventName] == "function"; target.removeAttribute(eventName); }; }; return supportsEvent; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * EXPERIMENTAL - NOT READY FOR PRODUCTION * * Basic implementation for an event emitter. This supplies a basic and * minimalistic event mechanism. */ qx.Bootstrap.define("qx.event.Emitter", { extend : Object, statics : { /** Static storage for all event listener */ __storage : [] }, members : { __listener : null, __any : null, /** * Attach a listener to the event emitter. The given <code>name</code> * will define the type of event. Handing in a <code>'*'</code> will * listen to all events emitted by the event emitter. * * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. * @return {Integer} An unique <code>id</code> for the attached listener. */ on : function(name, listener, ctx){ var id = qx.event.Emitter.__storage.length; this.__getStorage(name).push({ listener : listener, ctx : ctx, id : id }); qx.event.Emitter.__storage.push({ name : name, listener : listener, ctx : ctx }); return id; }, /** * Attach a listener to the event emitter which will be executed only once. * The given <code>name</code> will define the type of event. Handing in a * <code>'*'</code> will listen to all events emitted by the event emitter. * * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. * @return {Integer} An unique <code>id</code> for the attached listener. */ once : function(name, listener, ctx){ var id = qx.event.Emitter.__storage.length; this.__getStorage(name).push({ listener : listener, ctx : ctx, once : true, id : id }); qx.event.Emitter.__storage.push({ name : name, listener : listener, ctx : ctx }); return id; }, /** * Remove a listener from the event emitter. The given <code>name</code> * will define the type of event. * * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. * @return {Integer|null} The listener's id if it was removed or * <code>null</code> if it wasn't found */ off : function(name, listener, ctx){ var storage = this.__getStorage(name); for(var i = storage.length - 1;i >= 0;i--){ var entry = storage[i]; if(entry.listener == listener && entry.ctx == ctx){ storage.splice(i, 1); qx.event.Emitter.__storage[entry.id] = null; return entry.id; }; }; return null; }, /** * Removes the listener identified by the given <code>id</code>. The id * will be return on attaching the listener and can be stored for removing. * * @param id {Integer} The id of the listener. */ offById : function(id){ var entry = qx.event.Emitter.__storage[id]; this.off(entry.name, entry.listener, entry.ctx); }, /** * Alternative for {@link #on}. * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. * @return {Integer} An unique <code>id</code> for the attached listener. */ addListener : function(name, listener, ctx){ return this.on(name, listener, ctx); }, /** * Alternative for {@link #once}. * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. * @return {Integer} An unique <code>id</code> for the attached listener. */ addListenerOnce : function(name, listener, ctx){ return this.once(name, listener, ctx); }, /** * Alternative for {@link #off}. * @param name {String} The name of the event to listen to. * @param listener {Function} The function execute on {@link #emit}. * @param ctx {var?Window} The context of the listener. */ removeListener : function(name, listener, ctx){ this.off(name, listener, ctx); }, /** * Alternative for {@link #offById}. * @param id {Integer} The id of the listener. */ removeListenerById : function(id){ this.offById(id); }, /** * Emits an event with the given name. The data will be passed * to the listener. * @param name {String} The name of the event to emit. * @param data {var?undefined} The data which should be passed to the listener. */ emit : function(name, data){ var storage = this.__getStorage(name); for(var i = 0;i < storage.length;i++){ var entry = storage[i]; entry.listener.call(entry.ctx, data); if(entry.once){ storage.splice(i, 1); i--; }; }; // call on any storage = this.__getStorage("*"); for(var i = storage.length - 1;i >= 0;i--){ var entry = storage[i]; entry.listener.call(entry.ctx, data); }; }, /** * Returns the internal attached listener. * @internal * @return {Map} A map which has the event name as key. The values are * arrays containing a map with 'listener' and 'ctx'. */ getListeners : function(){ return this.__listener; }, /** * Internal helper which will return the storage for the given name. * @param name {String} The name of the event. * @return {Array} An array which is the storage for the listener and * the given event name. */ __getStorage : function(name){ if(this.__listener == null){ this.__listener = { }; }; if(this.__listener[name] == null){ this.__listener[name] = []; }; return this.__listener[name]; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) ************************************************************************ */ /** * Normalization for touch events */ qx.Bootstrap.define("qx.module.event.Touch", { statics : { /** * List of event types to be normalized * @type {Array} */ TYPES : ["tap", "swipe"], /** * Manipulates the native event object, adding methods if they're not * already present * * @param event {Event} Native event object * @param element {Element} DOM element the listener was attached to * @param type {String} Event type * @return {Event} Normalized event object * @internal */ normalize : function(event, element, type){ if(!event){ return event; }; event._type = type; return event; } }, defer : function(statics){ qxWeb.$registerEventNormalization(statics.TYPES, statics.normalize); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * The class is responsible for device detection. This is specially usefull * if you are on a mobile device. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.Device", { statics : { /** Maps user agent names to device IDs */ __ids : { "iPod" : "ipod", "iPad" : "ipad", "iPhone" : "iPhone", "PSP" : "psp", "PLAYSTATION 3" : "ps3", "Nintendo Wii" : "wii", "Nintendo DS" : "ds", "XBOX" : "xbox", "Xbox" : "xbox" }, /** * Returns the name of the current device if detectable. It falls back to * <code>pc</code> if the detection for other devices fails. * * @internal * @return {String} The string of the device found. */ getName : function(){ var str = []; for(var key in this.__ids){ str.push(key); }; var reg = new RegExp("(" + str.join("|").replace(/\./g, "\.") + ")", "g"); var match = reg.exec(navigator.userAgent); if(match && match[1]){ return qx.bom.client.Device.__ids[match[1]]; }; return "pc"; }, /** * Determines on what type of device the application is running. * Valid values are: "mobile", "tablet" or "desktop". * @return {String} The device type name of determined device. */ getType : function(){ return qx.bom.client.Device.detectDeviceType(navigator.userAgent); }, /** * Detects the device type, based on given userAgentString. * * @param userAgentString {String} userAgent parameter, needed for decision. * @return {String} The device type name of determined device: "mobile","desktop","tablet" */ detectDeviceType : function(userAgentString){ if(qx.bom.client.Device.detectTabletDevice(userAgentString)){ return "tablet"; } else if(qx.bom.client.Device.detectMobileDevice(userAgentString)){ return "mobile"; }; return "desktop"; }, /** * Detects if a device is a mobile phone. (Tablets excluded.) * @param userAgentString {String} userAgent parameter, needed for decision. * @return {Boolean} Flag which indicates whether it is a mobile device. */ detectMobileDevice : function(userAgentString){ return /android.+mobile|ip(hone|od)|bada\/|blackberry|maemo|opera m(ob|in)i|fennec|NetFront|phone|psp|symbian|windows (ce|phone)|xda/i.test(userAgentString); }, /** * Detects if a device is a tablet device. * @param userAgentString {String} userAgent parameter, needed for decision. * @return {Boolean} Flag which indicates whether it is a tablet device. */ detectTabletDevice : function(userAgentString){ return !(/Fennec|HTC.Magic|Nexus|android.+mobile/i.test(userAgentString)) && (/Android|ipad|tablet|playbook|silk|kindle|psp/i.test(userAgentString)); } }, defer : function(statics){ qx.core.Environment.add("device.name", statics.getName); qx.core.Environment.add("device.type", statics.getType); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * Module for querying information about the environment / runtime. * It adds a static key <code>env</code> to qxWeb and offers the given methods. * * <pre class="javascript"> * q.env.get("engine.name"); // return "webkit" e.g. * </pre> * * The following values are predefined: * * * <code>browser.name</code> : The name of the browser * * <code>browser.version</code> : The version of the browser * * <code>browser.quirksmode</code> : <code>true</code> if the browser is in quirksmode * * <code>browser.documentmode</code> : The document mode of the browser * * * <code>device.name</code> : The name of the device e.g. <code>iPad</code>. * * <code>device.type</code> : Either <code>desktop</code>, <code>tablet</code> or <code>mobile</code>. * * * <code>engine.name</code> : The name of the browser engine * * <code>engine.version</code> : The version of the browser engine */ qx.Bootstrap.define("qx.module.Environment", { statics : { /** * Get the value stored for the given key. * * @attachStatic {qxWeb, env.get} * @param key {String} The key to check for. * @return {var} The value stored for the given key. * @lint environmentNonLiteralKey(key) */ get : function(key){ return qx.core.Environment.get(key); }, /** * Adds a new environment setting which can be queried via {@link #get}. * @param key {String} The key to store the value for. * * @attachStatic {qxWeb, env.add} * @param value {var} The value to store. * @return {qxWeb} The collection for chaining. */ add : function(key, value){ qx.core.Environment.add(key, value); return this; } }, defer : function(statics){ // make sure the desired keys are available (browser.* and engine.*) qx.core.Environment.get("browser.name"); qx.core.Environment.get("browser.version"); qx.core.Environment.get("browser.quirksmode"); qx.core.Environment.get("browser.documentmode"); qx.core.Environment.get("engine.name"); qx.core.Environment.get("engine.version"); qx.core.Environment.get("device.type"); qxWeb.$attachStatic({ "env" : { get : statics.get, add : statics.add } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Environment) #require(qx.module.Event) ************************************************************************ */ /** * Normalization for native mouse events */ qx.Bootstrap.define("qx.module.event.Mouse", { statics : { /** * List of event types to be normalized */ TYPES : ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout"], /** * List qx.module.event.Mouse methods to be attached to native mouse event * objects * @internal */ BIND_METHODS : ["getButton", "getViewportLeft", "getViewportTop", "getDocumentLeft", "getDocumentTop", "getScreenLeft", "getScreenTop"], /** * Standard mouse button mapping */ BUTTONS_DOM2 : { '0' : "left", '2' : "right", '1' : "middle" }, /** * Legacy Internet Explorer mouse button mapping */ BUTTONS_MSHTML : { '1' : "left", '2' : "right", '4' : "middle" }, /** * Returns the identifier of the mouse button that change state when the * event was triggered * * @return {String} One of <code>left</code>, <code>right</code> or * <code>middle</code> */ getButton : function(){ switch(this.type){case "contextmenu": return "right";case "click": // IE does not support buttons on click --> assume left button if(qxWeb.env.get("browser.name") === "ie" && qxWeb.env.get("browser.documentmode") < 9){ return "left"; };default: if(this.target !== undefined){ return qx.module.event.Mouse.BUTTONS_DOM2[this.button] || "none"; } else { return qx.module.event.Mouse.BUTTONS_MSHTML[this.button] || "none"; };}; }, /** * Get the horizontal coordinate at which the event occurred relative * to the viewport. * * @return {Number} The horizontal mouse position */ getViewportLeft : function(){ return this.clientX; }, /** * Get the vertical coordinate at which the event occurred relative * to the viewport. * * @return {Number} The vertical mouse position * @signature function() */ getViewportTop : function(){ return this.clientY; }, /** * Get the horizontal position at which the event occurred relative to the * left of the document. This property takes into account any scrolling of * the page. * * @return {Number} The horizontal mouse position in the document. */ getDocumentLeft : function(){ if(this.pageX !== undefined){ return this.pageX; } else { var win = qx.dom.Node.getWindow(this.srcElement); return this.clientX + qx.bom.Viewport.getScrollLeft(win); }; }, /** * Get the vertical position at which the event occurred relative to the * top of the document. This property takes into account any scrolling of * the page. * * @return {Number} The vertical mouse position in the document. */ getDocumentTop : function(){ if(this.pageY !== undefined){ return this.pageY; } else { var win = qx.dom.Node.getWindow(this.srcElement); return this.clientY + qx.bom.Viewport.getScrollTop(win); }; }, /** * Get the horizontal coordinate at which the event occurred relative to * the origin of the screen coordinate system. * * Note: This value is usually not very useful unless you want to * position a native popup window at this coordinate. * * @return {Number} The horizontal mouse position on the screen. */ getScreenLeft : function(){ return this.screenX; }, /** * Get the vertical coordinate at which the event occurred relative to * the origin of the screen coordinate system. * * Note: This value is usually not very useful unless you want to * position a native popup window at this coordinate. * * @return {Number} The vertical mouse position on the screen. */ getScreenTop : function(){ return this.screenY; }, /** * Manipulates the native event object, adding methods if they're not * already present * * @param event {Event} Native event object * @param element {Element} DOM element the listener was attached to * @return {Event} Normalized event object * @internal */ normalize : function(event, element){ if(!event){ return event; }; var bindMethods = qx.module.event.Mouse.BIND_METHODS; for(var i = 0,l = bindMethods.length;i < l;i++){ if(typeof event[bindMethods[i]] != "function"){ event[bindMethods[i]] = qx.module.event.Mouse[bindMethods[i]].bind(event); }; }; return event; } }, defer : function(statics){ qxWeb.$registerEventNormalization(qx.module.event.Mouse.TYPES, statics.normalize); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tino Butz (tbtz) * Martin Wittemann (wittemann) ************************************************************************ */ /** * Define messages to react on certain channels. * * The channel names will be used in the {@link #on} method to define handlers which will * be called on certain channels and routes. The {@link #emit} method can be used * to execute a given route on a channel. {@link #onAny} defines a handler on any channel. * * *Example* * * Here is a little example of how to use the messaging. * * <pre class='javascript'> * var m = new qx.event.Messaging(); * * m.on("get", "/address/{id}", function(data) { * var id = data.params.id; // 1234 * // do something with the id... * },this); * * m.emit("get", "/address/1234"); * </pre> */ qx.Bootstrap.define("qx.event.Messaging", { construct : function(){ this._listener = { },this.__listenerIdCount = 0; this.__channelToIdMapping = { }; }, members : { _listener : null, __listenerIdCount : null, __channelToIdMapping : null, /** * Adds a route handler for the given channel. The route is called * if the {@link #emit} method finds a match. * * @param channel {String} The channel of the message. * @param type {String|RegExp} The type, used for checking if the executed path matches. * @param handler {Function} The handler to call if the route matches the executed path. * @param scope {var ? null} The scope of the handler. * @return {String} The id of the route used to remove the route. */ on : function(channel, type, handler, scope){ return this._addListener(channel, type, handler, scope); }, /** * Adds a handler for the "any" channel. The "any" channel is called * before all other channels. * * @param type {String|RegExp} The route, used for checking if the executed path matches * @param handler {Function} The handler to call if the route matches the executed path * @param scope {var ? null} The scope of the handler. * @return {String} The id of the route used to remove the route. */ onAny : function(type, handler, scope){ return this._addListener("any", type, handler, scope); }, /** * Adds a listener for a certain channel. * * @param channel {String} The channel the route should be registered for * @param type {String|RegExp} The type, used for checking if the executed path matches * @param handler {Function} The handler to call if the route matches the executed path * @param scope {var ? null} The scope of the handler. * @return {String} The id of the route used to remove the route. */ _addListener : function(channel, type, handler, scope){ var listeners = this._listener[channel] = this._listener[channel] || { }; var id = this.__listenerIdCount++; var params = []; var param = null; // Convert the route to a regular expression. if(qx.lang.Type.isString(type)){ var paramsRegexp = /\{([\w\d]+)\}/g; while((param = paramsRegexp.exec(type)) !== null){ params.push(param[1]); }; type = new RegExp("^" + type.replace(paramsRegexp, "([^\/]+)") + "$"); }; listeners[id] = { regExp : type, params : params, handler : handler, scope : scope }; this.__channelToIdMapping[id] = channel; return id; }, /** * Removes a registered listener by the given id. * * @param id {String} The id of the registered listener. */ remove : function(id){ var channel = this.__channelToIdMapping[id]; var listener = this._listener[channel]; delete listener[id]; delete this.__channelToIdMapping[id]; }, /** * Sends a message on the given channel and informs all matching route handlers. * * @param channel {String} The channel of the message. * @param path {String} The path to execute * @param params {Map} The given parameters that should be propagated * @param customData {var} The given custom data that should be propagated */ emit : function(channel, path, params, customData){ this._emit(channel, path, params, customData); }, /** * Executes a certain channel with a given path. Informs all * route handlers that match with the path. * * @param channel {String} The channel to execute. * @param path {String} The path to check * @param params {Map} The given parameters that should be propagated * @param customData {var} The given custom data that should be propagated */ _emit : function(channel, path, params, customData){ var listenerMatchedAny = false; var listener = this._listener["any"]; listenerMatchedAny = this._emitListeners(channel, path, listener, params, customData); var listenerMatched = false; listener = this._listener[channel]; listenerMatched = this._emitListeners(channel, path, listener, params, customData); if(!listenerMatched && !listenerMatchedAny){ qx.Bootstrap.info("No listener found for " + path); }; }, /** * Executes all given listener for a certain channel. Checks all listeners if they match * with the given path and executes the stored handler of the matching route. * * @param channel {String} The channel to execute. * @param path {String} The path to check * @param listeners {Map[]} All routes to test and execute. * @param params {Map} The given parameters that should be propagated * @param customData {var} The given custom data that should be propagated * * @return {Boolean} Whether the route has been executed */ _emitListeners : function(channel, path, listeners, params, customData){ if(!listeners || qx.lang.Object.isEmpty(listeners)){ return false; }; var listenerMatched = false; for(var id in listeners){ var listener = listeners[id]; listenerMatched |= this._emitRoute(channel, path, listener, params, customData); }; return listenerMatched; }, /** * Executes a certain listener. Checks if the listener matches the given path and * executes the stored handler of the route. * * @param channel {String} The channel to execute. * @param path {String} The path to check * @param listener {Map} The route data. * @param params {Map} The given parameters that should be propagated * @param customData {var} The given custom data that should be propagated * * @return {Boolean} Whether the route has been executed */ _emitRoute : function(channel, path, listener, params, customData){ var match = listener.regExp.exec(path); if(match){ var params = params || { }; var param = null; var value = null; match.shift(); // first match is the whole path for(var i = 0;i < match.length;i++){ value = match[i]; param = listener.params[i]; if(param){ params[param] = value; } else { params[i] = value; }; }; listener.handler.call(listener.scope, { path : path, params : params, customData : customData }); }; return match != undefined; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.event.Messaging#on) #require(qx.event.Messaging#onAny) #require(qx.event.Messaging#remove) #require(qx.event.Messaging#emit) ************************************************************************ */ /** * Define messages to react on certain channels. * * The channel names will be used in the q.messaging.on method to define handlers which will * be called on certain channels and routes. The q.messaging.emit method can be used * to execute a given route on a channel. q.messaging.onAny defines a handler on any channel. */ qx.Bootstrap.define("qx.module.Messaging", { statics : { /** * Adds a route handler for the given channel. The route is called * if the {@link #emit} method finds a match. * * @attachStatic{qxWeb, messaging.on} * @param channel {String} The channel of the message. * @param type {String|RegExp} The type, used for checking if the executed path matches. * @param handler {Function} The handler to call if the route matches the executed path. * @param scope {var ? null} The scope of the handler. * @return {String} The id of the route used to remove the route. * @signature function(channel, type, handler, scope) */ on : null, /** * Adds a handler for the "any" channel. The "any" channel is called * before all other channels. * * @attachStatic{qxWeb, messaging.onAny} * @param type {String|RegExp} The route, used for checking if the executed path matches * @param handler {Function} The handler to call if the route matches the executed path * @param scope {var ? null} The scope of the handler. * @return {String} The id of the route used to remove the route. * @signature function(type, handler, scope) */ onAny : null, /** * Removes a registered listener by the given id. * * @attachStatic{qxWeb, messaging.remove} * @param id {String} The id of the registered listener. * @signature function(id) */ remove : null, /** * Sends a message on the given channel and informs all matching route handlers. * * @attachStatic{qxWeb, messaging.emit} * @param channel {String} The channel of the message. * @param path {String} The path to execute * @param params {Map} The given parameters that should be propagated * @param customData {var} The given custom data that should be propagated * @signature function(channel, path, params, customData) */ emit : null }, defer : function(statics){ qxWeb.$attachStatic({ "messaging" : new qx.event.Messaging() }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * Utility module to give some support to work with arrays. */ qx.Bootstrap.define("qx.module.util.Array", { statics : { /** * Converts an array like object to any other array like * object. * * Attention: The returned array may be same * instance as the incoming one if the constructor is identical! * * @signature function(object, constructor, offset) * @attachStatic {qxWeb, array.cast} * * @param object {var} any array-like object * @param constructor {Function} constructor of the new instance * @param offset {Number?0} position to start from * @return {Array} the converted array */ cast : qx.lang.Array.cast, /** * Check whether the two arrays have the same content. Checks only the * equality of the arrays' content. * * @signature function(arr1, arr2) * @attachStatic {qxWeb, array.equals} * * @param arr1 {Array} first array * @param arr2 {Array} second array * @return {Boolean} Whether the two arrays are equal */ equals : qx.lang.Array.equals, /** * Modifies the first array as it removes all elements * which are listed in the second array as well. * * @signature function(arr1, arr2) * @attachStatic {qxWeb, array.exclude} * * @param arr1 {Array} the array * @param arr2 {Array} the elements of this array will be excluded from the other one * @return {Array} The modified array. */ exclude : qx.lang.Array.exclude, /** * Convert an arguments object into an array. * * @signature function(args, offset) * @attachStatic {qxWeb, array.fromArguments} * * @param args {arguments} arguments object * @param offset {Number?0} position to start from * @return {Array} a newly created array (copy) with the content of the arguments object. */ fromArguments : qx.lang.Array.fromArguments, /** * Insert an element into the array after a given second element. * * @signature function(arr, obj, obj2) * @attachStatic {qxWeb, array.insertAfter} * * @param arr {Array} the array * @param obj {var} object to be inserted * @param obj2 {var} insert obj1 after this object * @return {Array} The given array. */ insertAfter : qx.lang.Array.insertAfter, /** * Insert an element into the array before a given second element. * * @signature function(arr, obj, obj2) * @attachStatic {qxWeb, array.insertBefore} * * @param arr {Array} the array * @param obj {var} object to be inserted * @param obj2 {var} insert obj1 before this object * @return {Array} The given array. */ insertBefore : qx.lang.Array.insertBefore, /** * Returns the highest value in the given array. Supports * numeric values only. * * @signature function(arr) * @attachStatic {qxWeb, array.max} * * @param arr {Array} Array to process. * @return {Number | undefined} The highest of all values or undefined if array is empty. */ max : qx.lang.Array.max, /** * Returns the lowest value in the given array. Supports * numeric values only. * * @signature function(arr) * @attachStatic {qxWeb, array.min} * * @param arr {Array} Array to process. * @return {Number | undefined} The lowest of all values or undefined if array is empty. */ min : qx.lang.Array.min, /** * Remove an element from the array. * * @signature function(arr, obj) * @attachStatic {qxWeb, array.remove} * * @param arr {Array} the array * @param obj {var} element to be removed from the array * @return {var} the removed element */ remove : qx.lang.Array.remove, /** * Remove all elements from the array * * @signature function(arr) * @attachStatic {qxWeb, array.removeAll} * * @param arr {Array} the array * @return {Array} empty array */ removeAll : qx.lang.Array.removeAll, /** * Recreates an array which is free of all duplicate elements from the original. * This method do not modifies the original array! * Keep in mind that this methods deletes undefined indexes. * * @signature function(arr) * @attachStatic {qxWeb, array.unique} * * @param arr {Array} Incoming array * @return {Array} Returns a copy with no duplicates * or the original array if no duplicates were found. */ unique : qx.lang.Array.unique }, defer : function(statics){ qxWeb.$attachStatic({ array : { cast : statics.cast, equals : statics.equals, exclude : statics.exclude, fromArguments : statics.fromArguments, insertAfter : statics.insertAfter, insertBefore : statics.insertBefore, max : statics.max, min : statics.min, remove : statics.remove, removeAll : statics.removeAll, unique : statics.unique } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * Utility module to give some support to work with strings. */ qx.Bootstrap.define("qx.module.util.String", { statics : { /** * Converts a hyphenated string (separated by '-') to camel case. * * Example: * <pre class='javascript'>q.string.camelCase("I-like-cookies"); //returns "ILikeCookies"</pre> * The implementation does not force a lowerCamelCase or upperCamelCase version. * The first letter of the parameter keeps its case. * * @attachStatic {qxWeb, string.camelCase} * @param str {String} hyphenated string * @return {String} camelcase string */ camelCase : function(str){ return qx.lang.String.camelCase.call(qx.lang.String, str); }, /** * Converts a camelcased string to a hyphenated (separated by '-') string. * * Example: * <pre class='javascript'>q.string.hyphenate("ILikeCookies"); //returns "I-like-cookies"</pre> * The implementation does not force a lowerCamelCase or upperCamelCase version. * The first letter of the parameter keeps its case. * * @attachStatic {qxWeb, string.hyphenate} * @param str {String} camelcased string * @return {String} hyphenated string */ hyphenate : function(str){ return qx.lang.String.hyphenate.call(qx.lang.String, str); }, /** * Convert the first character of the string to upper case. * * @attachStatic {qxWeb, string.firstUp} * @signature function(str) * @param str {String} the string * @return {String} the string with an upper case first character */ firstUp : qx.lang.String.firstUp, /** * Convert the first character of the string to lower case. * * @attachStatic {qxWeb, string.firstLow} * @signature function(str) * @param str {String} the string * @return {String} the string with a lower case first character */ firstLow : qx.lang.String.firstLow, /** * Check whether the string starts with the given substring. * * @attachStatic {qxWeb, string.startsWith} * @signature function(fullstr, substr) * @param fullstr {String} the string to search in * @param substr {String} the substring to look for * @return {Boolean} whether the string starts with the given substring */ startsWith : qx.lang.String.startsWith, /** * Check whether the string ends with the given substring. * * @attachStatic {qxWeb, string.endsWith} * @signature function(fullstr, substr) * @param fullstr {String} the string to search in * @param substr {String} the substring to look for * @return {Boolean} whether the string ends with the given substring */ endsWith : qx.lang.String.endsWith, /** * Escapes all chars that have a special meaning in regular expressions. * * @attachStatic {qxWeb, string.escapeRegexpChars} * @signature function(str) * @param str {String} the string where to escape the chars. * @return {String} the string with the escaped chars. */ escapeRegexpChars : qx.lang.String.escapeRegexpChars }, defer : function(statics){ qxWeb.$attachStatic({ string : { camelCase : statics.camelCase, hyphenate : statics.hyphenate, firstUp : statics.firstUp, firstLow : statics.firstLow, startsWith : statics.startsWith, endsWith : statics.endsWith, escapeRegexpChars : statics.escapeRegexpChars } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class is responsible for applying CSS3 transforms to the collection. * The implementation is mostly a cross browser wrapper for applying the * transforms. * The API is keep to the spec as close as possible. * * http://www.w3.org/TR/css3-3d-transforms/ */ qx.Bootstrap.define("qx.module.Transform", { statics : { /** * Method to apply multiple transforms at once to the given element. It * takes a map containing the transforms you want to apply plus the values * e.g.<code>{scale: 2, rotate: "5deg"}</code>. * The values can be either singular, which means a single value will * be added to the CSS. If you give an array, the values will be split up * and each array entry will be used for the X, Y or Z dimension in that * order e.g. <code>{scale: [2, 0.5]}</code> will result in a element * double the size in X direction and half the size in Y direction. * Make sure your browser supports all transformations you apply. * * @attach {qxWeb} * @param transforms {Map} The map containing the transforms and value. * @return {qxWeb} This reference for chaining. */ transform : function(transforms){ this.forEach(function(el){ qx.bom.element.Transform.transform(el, transforms); }); return this; }, /** * Translates by the given value. For further details, take * a look at the {@link #transform} method. * * @attach {qxWeb} * @param value {String|Array} The value to translate e.g. <code>"10px"</code>. * @return {qxWeb} This reference for chaining. */ translate : function(value){ return this.transform({ translate : value }); }, /** * Scales by the given value. For further details, take * a look at the {@link #transform} method. * * @attach {qxWeb} * @param value {Number|Array} The value to scale. * @return {qxWeb} This reference for chaining. */ scale : function(value){ return this.transform({ scale : value }); }, /** * Rotates by the given value. For further details, take * a look at the {@link #transform} method. * @param value {String|Array} The value to rotate e.g. <code>"90deg"</code>. * @return {qxWeb} This reference for chaining. */ rotate : function(value){ return this.transform({ rotate : value }); }, /** * Skews by the given value. For further details, take * a look at the {@link #transform} method. * * @attach {qxWeb} * @param value {String|Array} The value to skew e.g. <code>"90deg"</code>. * @return {qxWeb} This reference for chaining. */ skew : function(value){ return this.transform({ skew : value }); }, /** * Sets the transform-origin property. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-origin-property * * @attach {qxWeb} * @param value {String} CSS position values like <code>50% 50%</code> or * <code>left top</code>. * @return {qxWeb} This reference for chaining. */ setTransformOrigin : function(value){ this.forEach(function(el){ qx.bom.element.Transform.setOrigin(el, value); }); return this; }, /** * Returns the transform-origin property of the first element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-origin-property * * @attach {qxWeb} * @return {String} The set property, e.g. <code>50% 50%</code> or null, * of the collection is empty. */ getTransformOrigin : function(){ if(this[0]){ return qx.bom.element.Transform.getOrigin(this[0]); }; return ""; }, /** * Sets the transform-style property. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-style-property * * @attach {qxWeb} * @param value {String} Either <code>flat</code> or <code>preserve-3d</code>. * @return {qxWeb} This reference for chaining. */ setTransformStyle : function(value){ this.forEach(function(el){ qx.bom.element.Transform.setStyle(el, value); }); return this; }, /** * Returns the transform-style property of the first element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-style-property * * @attach {qxWeb} * @return {String} The set property, either <code>flat</code> or * <code>preserve-3d</code>. */ getTransformStyle : function(){ if(this[0]){ return qx.bom.element.Transform.getStyle(this[0]); }; return ""; }, /** * Sets the perspective property. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-property * * @attach {qxWeb} * @param value {Number} The perspective layer. Numbers between 100 * and 5000 give the best results. * @return {qxWeb} This reference for chaining. */ setTransformPerspective : function(value){ this.forEach(function(el){ qx.bom.element.Transform.setPerspective(el, value); }); return this; }, /** * Returns the perspective property of the first element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-property * * @attach {qxWeb} * @return {String} The set property, e.g. <code>500</code> */ getTransformPerspective : function(){ if(this[0]){ return qx.bom.element.Transform.getPerspective(this[0]); }; return ""; }, /** * Sets the perspective-origin property. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-origin-property * * @attach {qxWeb} * @param value {String} CSS position values like <code>50% 50%</code> or * <code>left top</code>. * @return {qxWeb} This reference for chaining. */ setTransformPerspectiveOrigin : function(value){ this.forEach(function(el){ qx.bom.element.Transform.setPerspectiveOrigin(el, value); }); return this; }, /** * Returns the perspective-origin property of the first element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-origin-property * * @attach {qxWeb} * @return {String} The set property, e.g. <code>50% 50%</code> */ getTransformPerspectiveOrigin : function(){ if(this[0]){ return qx.bom.element.Transform.getPerspectiveOrigin(this[0]); }; return ""; }, /** * Sets the backface-visibility property. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#backface-visibility-property * * @attach {qxWeb} * @param value {Boolean} <code>true</code> if the backface should be visible. * @return {qxWeb} This reference for chaining. */ setTransformBackfaceVisibility : function(value){ this.forEach(function(el){ qx.bom.element.Transform.setBackfaceVisibility(el, value); }); return this; }, /** * Returns the backface-visibility property of the first element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#backface-visibility-property * * @attach {qxWeb} * @return {Boolean} <code>true</code>, if the backface is visible. */ getTransformBackfaceVisibility : function(){ if(this[0]){ return qx.bom.element.Transform.getBackfaceVisibility(this[0]); }; return ""; } }, defer : function(statics){ qxWeb.$attach({ "transform" : statics.transform, "translate" : statics.translate, "rotate" : statics.rotate, "skew" : statics.skew, "scale" : statics.scale, "setTransformStyle" : statics.setTransformStyle, "getTransformStyle" : statics.getTransformStyle, "setTransformOrigin" : statics.setTransformOrigin, "getTransformOrigin" : statics.getTransformOrigin, "setTransformPerspective" : statics.setTransformPerspective, "getTransformPerspective" : statics.getTransformPerspective, "setTransformPerspectiveOrigin" : statics.setTransformPerspectiveOrigin, "getTransformPerspectiveOrigin" : statics.getTransformPerspectiveOrigin, "setTransformBackfaceVisibility" : statics.setTransformBackfaceVisibility, "getTransformBackfaceVisibility" : statics.getTransformBackfaceVisibility }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * Responsible for checking all relevant CSS transform properties. * * Specs: * http://www.w3.org/TR/css3-2d-transforms/ * http://www.w3.org/TR/css3-3d-transforms/ * * @internal */ qx.Bootstrap.define("qx.bom.client.CssTransform", { statics : { /** * Main check method which returns an object if CSS animations are * supported. This object contains all necessary keys to work with CSS * animations. * <ul> * <li><code>name</code> The name of the css transform style</li> * <li><code>style</code> The name of the css transform-style style</li> * <li><code>origin</code> The name of the transform-origin style</li> * <li><code>3d</code> Whether 3d transforms are supported</li> * <li><code>perspective</code> The name of the perspective style</li> * <li><code>perspective-origin</code> The name of the perspective-origin style</li> * <li><code>backface-visibility</code> The name of the backface-visibility style</li> * </ul> * * @internal * @return {Object|null} The described object or null, if animations are * not supported. */ getSupport : function(){ var name = qx.bom.client.CssTransform.getName(); if(name != null){ return { "name" : name, "style" : qx.bom.client.CssTransform.getStyle(), "origin" : qx.bom.client.CssTransform.getOrigin(), "3d" : qx.bom.client.CssTransform.get3D(), "perspective" : qx.bom.client.CssTransform.getPerspective(), "perspective-origin" : qx.bom.client.CssTransform.getPerspectiveOrigin(), "backface-visibility" : qx.bom.client.CssTransform.getBackFaceVisibility() }; }; return null; }, /** * Checks for the style name used to set the transform origin. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getStyle : function(){ return qx.bom.Style.getPropertyName("transformStyle"); }, /** * Checks for the style name used to set the transform origin. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getPerspective : function(){ return qx.bom.Style.getPropertyName("perspective"); }, /** * Checks for the style name used to set the perspective origin. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getPerspectiveOrigin : function(){ return qx.bom.Style.getPropertyName("perspectiveOrigin"); }, /** * Checks for the style name used to set the backface visibility. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getBackFaceVisibility : function(){ return qx.bom.Style.getPropertyName("backfaceVisibility"); }, /** * Checks for the style name used to set the transform origin. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getOrigin : function(){ return qx.bom.Style.getPropertyName("transformOrigin"); }, /** * Checks for the style name used for transforms. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getName : function(){ return qx.bom.Style.getPropertyName("transform"); }, /** * Checks if 3D transforms are supported. * @internal * @return {Boolean} <code>true</code>, if 3D transformations are supported */ get3D : function(){ return qx.bom.client.CssTransform.getPerspective() != null; } }, defer : function(statics){ qx.core.Environment.add("css.transform", statics.getSupport); qx.core.Environment.add("css.transform.3d", statics.get3D); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This class is responsible for applying CSS3 transforms to plain DOM elements. * The implementation is mostly a cross browser wrapper for applying the * transforms. * The API is keep to the spec as close as possible. * * http://www.w3.org/TR/css3-3d-transforms/ */ qx.Bootstrap.define("qx.bom.element.Transform", { statics : { /** The dimensions of the transforms */ __dimensions : ["X", "Y", "Z"], /** Internal storage of the CSS names */ __cssKeys : qx.core.Environment.get("css.transform"), /** * Method to apply multiple transforms at once to the given element. It * takes a map containing the transforms you want to apply plus the values * e.g.<code>{scale: 2, rotate: "5deg"}</code>. * The values can be either singular, which means a single value will * be added to the CSS. If you give an array, the values will be split up * and each array entry will be used for the X, Y or Z dimension in that * order e.g. <code>{scale: [2, 0.5]}</code> will result in a element * double the size in X direction and half the size in Y direction. * Make sure your browser supports all transformations you apply. * @param el {Element} The element to apply the transformation. * @param transforms {Map} The map containing the transforms and value. */ transform : function(el, transforms){ var transformCss = this.__mapToCss(transforms); if(this.__cssKeys != null){ var style = this.__cssKeys["name"]; el.style[style] = transformCss; }; }, /** * Translates the given element by the given value. For further details, take * a look at the {@link #transform} method. * @param el {Element} The element to apply the transformation. * @param value {String|Array} The value to translate e.g. <code>"10px"</code>. */ translate : function(el, value){ this.transform(el, { translate : value }); }, /** * Scales the given element by the given value. For further details, take * a look at the {@link #transform} method. * @param el {Element} The element to apply the transformation. * @param value {Number|Array} The value to scale. */ scale : function(el, value){ this.transform(el, { scale : value }); }, /** * Rotates the given element by the given value. For further details, take * a look at the {@link #transform} method. * @param el {Element} The element to apply the transformation. * @param value {String|Array} The value to rotate e.g. <code>"90deg"</code>. */ rotate : function(el, value){ this.transform(el, { rotate : value }); }, /** * Skews the given element by the given value. For further details, take * a look at the {@link #transform} method. * @param el {Element} The element to apply the transformation. * @param value {String|Array} The value to skew e.g. <code>"90deg"</code>. */ skew : function(el, value){ this.transform(el, { skew : value }); }, /** * Converts the given map to a string which chould ba added to a css * stylesheet. * @param transforms {Map} The transforms map. For a detailed description, * take a look at the {@link #transform} method. * @return {String} The CSS value. */ getCss : function(transforms){ var transformCss = this.__mapToCss(transforms); if(this.__cssKeys != null){ var style = this.__cssKeys["name"]; return qx.lang.String.hyphenate(style) + ":" + transformCss + ";"; }; return ""; }, /** * Sets the transform-origin property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-origin-property * @param el {Element} The dom element to set the property. * @param value {String} CSS position values like <code>50% 50%</code> or * <code>left top</code>. */ setOrigin : function(el, value){ if(this.__cssKeys != null){ el.style[this.__cssKeys["origin"]] = value; }; }, /** * Returns the transform-origin property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-origin-property * @param el {Element} The dom element to read the property. * @return {String} The set property, e.g. <code>50% 50%</code> */ getOrigin : function(el){ if(this.__cssKeys != null){ return el.style[this.__cssKeys["origin"]]; }; return ""; }, /** * Sets the transform-style property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-style-property * @param el {Element} The dom element to set the property. * @param value {String} Either <code>flat</code> or <code>preserve-3d</code>. */ setStyle : function(el, value){ if(this.__cssKeys != null){ el.style[this.__cssKeys["style"]] = value; }; }, /** * Returns the transform-style property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#transform-style-property * @param el {Element} The dom element to read the property. * @return {String} The set property, either <code>flat</code> or * <code>preserve-3d</code>. */ getStyle : function(el){ if(this.__cssKeys != null){ return el.style[this.__cssKeys["style"]]; }; return ""; }, /** * Sets the perspective property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-property * @param el {Element} The dom element to set the property. * @param value {Number} The perspective layer. Numbers between 100 * and 5000 give the best results. */ setPerspective : function(el, value){ if(this.__cssKeys != null){ el.style[this.__cssKeys["perspective"]] = value + "px"; }; }, /** * Returns the perspective property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-property * @param el {Element} The dom element to read the property. * @return {String} The set property, e.g. <code>500</code> */ getPerspective : function(el){ if(this.__cssKeys != null){ return el.style[this.__cssKeys["perspective"]]; }; return ""; }, /** * Sets the perspective-origin property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-origin-property * @param el {Element} The dom element to set the property. * @param value {String} CSS position values like <code>50% 50%</code> or * <code>left top</code>. */ setPerspectiveOrigin : function(el, value){ if(this.__cssKeys != null){ el.style[this.__cssKeys["perspective-origin"]] = value; }; }, /** * Returns the perspective-origin property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#perspective-origin-property * @param el {Element} The dom element to read the property. * @return {String} The set property, e.g. <code>50% 50%</code> */ getPerspectiveOrigin : function(el){ if(this.__cssKeys != null){ var value = el.style[this.__cssKeys["perspective-origin"]]; if(value != ""){ return value; } else { var valueX = el.style[this.__cssKeys["perspective-origin"] + "X"]; var valueY = el.style[this.__cssKeys["perspective-origin"] + "Y"]; if(valueX != ""){ return valueX + " " + valueY; }; }; }; return ""; }, /** * Sets the backface-visibility property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#backface-visibility-property * @param el {Element} The dom element to set the property. * @param value {Boolean} <code>true</code> if the backface should be visible. */ setBackfaceVisibility : function(el, value){ if(this.__cssKeys != null){ el.style[this.__cssKeys["backface-visibility"]] = value ? "visible" : "hidden"; }; }, /** * Returns the backface-visibility property of the given element. * * Spec: http://www.w3.org/TR/css3-3d-transforms/#backface-visibility-property * @param el {Element} The dom element to read the property. * @return {Boolean} <code>true</code>, if the backface is visible. */ getBackfaceVisibility : function(el){ if(this.__cssKeys != null){ return el.style[this.__cssKeys["backface-visibility"]] == "visible"; }; return true; }, /** * Internal helper which converts the given transforms map to a valid CSS * string. * @param transforms {Map} A map containing the transforms. * @return {String} The CSS transforms. */ __mapToCss : function(transforms){ var value = ""; for(var func in transforms){ var params = transforms[func]; // if an array is given if(qx.Bootstrap.isArray(params)){ for(var i = 0;i < params.length;i++){ if(params[i] == undefined){ continue; }; value += func + this.__dimensions[i] + "("; value += params[i]; value += ") "; }; } else { // single value case value += func + "(" + transforms[func] + ") "; }; }; return value; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) #require(qx.bom.Event#getTarget) #require(qx.bom.Event#getRelatedTarget) ************************************************************************ */ /** * Common normalizations for native events */ qx.Bootstrap.define("qx.module.event.Native", { statics : { /** * List of event types to be normalized */ TYPES : ["*"], /** * List of qx.bom.Event methods to be attached to native event objects * @internal */ FORWARD_METHODS : ["getTarget", "getRelatedTarget"], /** * List of qx.module.event.Native methods to be attached to native event objects * @internal */ BIND_METHODS : ["preventDefault", "stopPropagation", "getType"], /** * Prevent the native default behavior of the event. */ preventDefault : function(){ try{ // this allows us to prevent some key press events in IE. // See bug #1049 this.keyCode = 0; } catch(ex) { }; this.returnValue = false; }, /** * Stops the event's propagation to the element's parent */ stopPropagation : function(){ this.cancelBubble = true; }, /** * Returns the event's type * * @return {String} event type */ getType : function(){ return this._type || this.type; }, /** * Manipulates the native event object, adding methods if they're not * already present * * @param event {Event} Native event object * @param element {Element} DOM element the listener was attached to * @return {Event} Normalized event object * @internal */ normalize : function(event, element){ if(!event){ return event; }; var fwdMethods = qx.module.event.Native.FORWARD_METHODS; for(var i = 0,l = fwdMethods.length;i < l;i++){ event[fwdMethods[i]] = qx.lang.Function.curry(qx.bom.Event[fwdMethods[i]], event); }; var bindMethods = qx.module.event.Native.BIND_METHODS; for(var i = 0,l = bindMethods.length;i < l;i++){ if(typeof event[bindMethods[i]] != "function"){ event[bindMethods[i]] = qx.module.event.Native[bindMethods[i]].bind(event); }; }; event.getCurrentTarget = function(){ return event.currentTarget || element; }; return event; } }, defer : function(statics){ qxWeb.$registerEventNormalization(statics.TYPES, statics.normalize); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * Prototype JS http://www.prototypejs.org/ Version 1.5 Copyright: (c) 2006-2007, Prototype Core Team License: MIT: http://www.opensource.org/licenses/mit-license.php Authors: * Prototype Core Team ---------------------------------------------------------------------- Copyright (c) 2005-2008 Sam Stephenson 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 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. ************************************************************************ */ /** * Methods to operate on nodes and elements on a DOM tree. This contains * special getters to query for child nodes, siblings, etc. This class also * supports to operate on one element and reorganize the content with * the insertion of new HTML or nodes. */ qx.Bootstrap.define("qx.dom.Hierarchy", { statics : { /** * Returns the DOM index of the given node * * @param node {Node} Node to look for * @return {Integer} The DOM index */ getNodeIndex : function(node){ var index = 0; while(node && (node = node.previousSibling)){ index++; }; return index; }, /** * Returns the DOM index of the given element (ignoring non-elements) * * @param element {Element} Element to look for * @return {Integer} The DOM index */ getElementIndex : function(element){ var index = 0; var type = qx.dom.Node.ELEMENT; while(element && (element = element.previousSibling)){ if(element.nodeType == type){ index++; }; }; return index; }, /** * Return the next element to the supplied element * * "nextSibling" is not good enough as it might return a text or comment element * * @param element {Element} Starting element node * @return {Element | null} Next element node */ getNextElementSibling : function(element){ while(element && (element = element.nextSibling) && !qx.dom.Node.isElement(element)){ continue; }; return element || null; }, /** * Return the previous element to the supplied element * * "previousSibling" is not good enough as it might return a text or comment element * * @param element {Element} Starting element node * @return {Element | null} Previous element node */ getPreviousElementSibling : function(element){ while(element && (element = element.previousSibling) && !qx.dom.Node.isElement(element)){ continue; }; return element || null; }, /** * Whether the first element contains the second one * * Uses native non-standard contains() in Internet Explorer, * Opera and Webkit (supported since Safari 3.0 beta) * * @param element {Element} Parent element * @param target {Node} Child node * @return {Boolean} */ contains : function(element, target){ if(qx.core.Environment.get("html.element.contains")){ if(qx.dom.Node.isDocument(element)){ var doc = qx.dom.Node.getDocument(target); return element && doc == element; } else if(qx.dom.Node.isDocument(target)){ return false; } else { return element.contains(target); }; } else if(qx.core.Environment.get("html.element.compareDocumentPosition")){ // http://developer.mozilla.org/en/docs/DOM:Node.compareDocumentPosition return !!(element.compareDocumentPosition(target) & 16); } else { while(target){ if(element == target){ return true; }; target = target.parentNode; }; return false; }; }, /** * Whether the element is inserted into the document * for which it was created. * * @param element {Element} DOM element to check * @return {Boolean} <code>true</code> when the element is inserted * into the document. */ isRendered : function(element){ var doc = element.ownerDocument || element.document; if(qx.core.Environment.get("html.element.contains")){ // Fast check for all elements which are not in the DOM if(!element.parentNode || !element.offsetParent){ return false; }; return doc.body.contains(element); } else if(qx.core.Environment.get("html.element.compareDocumentPosition")){ // Gecko way, DOM3 method return !!(doc.compareDocumentPosition(element) & 16); } else { while(element){ if(element == doc.body){ return true; }; element = element.parentNode; }; return false; }; }, /** * Checks if <code>element</code> is a descendant of <code>ancestor</code>. * * @param element {Element} first element * @param ancestor {Element} second element * @return {Boolean} Element is a descendant of ancestor */ isDescendantOf : function(element, ancestor){ return this.contains(ancestor, element); }, /** * Get the common parent element of two given elements. Returns * <code>null</code> when no common element has been found. * * Uses native non-standard contains() in Opera and Internet Explorer * * @param element1 {Element} First element * @param element2 {Element} Second element * @return {Element} the found parent, if none was found <code>null</code> */ getCommonParent : function(element1, element2){ if(element1 === element2){ return element1; }; if(qx.core.Environment.get("html.element.contains")){ while(element1 && qx.dom.Node.isElement(element1)){ if(element1.contains(element2)){ return element1; }; element1 = element1.parentNode; }; return null; } else { var known = []; while(element1 || element2){ if(element1){ if(qx.lang.Array.contains(known, element1)){ return element1; }; known.push(element1); element1 = element1.parentNode; }; if(element2){ if(qx.lang.Array.contains(known, element2)){ return element2; }; known.push(element2); element2 = element2.parentNode; }; }; return null; }; }, /** * Collects all of element's ancestors and returns them as an array of * elements. * * @param element {Element} DOM element to query for ancestors * @return {Array} list of all parents */ getAncestors : function(element){ return this._recursivelyCollect(element, "parentNode"); }, /** * Returns element's children. * * @param element {Element} DOM element to query for child elements * @return {Array} list of all child elements */ getChildElements : function(element){ element = element.firstChild; if(!element){ return []; }; var arr = this.getNextSiblings(element); if(element.nodeType === 1){ arr.unshift(element); }; return arr; }, /** * Collects all of element's descendants (deep) and returns them as an array * of elements. * * @param element {Element} DOM element to query for child elements * @return {Array} list of all found elements */ getDescendants : function(element){ return qx.lang.Array.fromCollection(element.getElementsByTagName("*")); }, /** * Returns the first child that is an element. This is opposed to firstChild DOM * property which will return any node (whitespace in most usual cases). * * @param element {Element} DOM element to query for first descendant * @return {Element} the first descendant */ getFirstDescendant : function(element){ element = element.firstChild; while(element && element.nodeType != 1){ element = element.nextSibling; }; return element; }, /** * Returns the last child that is an element. This is opposed to lastChild DOM * property which will return any node (whitespace in most usual cases). * * @param element {Element} DOM element to query for last descendant * @return {Element} the last descendant */ getLastDescendant : function(element){ element = element.lastChild; while(element && element.nodeType != 1){ element = element.previousSibling; }; return element; }, /** * Collects all of element's previous siblings and returns them as an array of elements. * * @param element {Element} DOM element to query for previous siblings * @return {Array} list of found DOM elements */ getPreviousSiblings : function(element){ return this._recursivelyCollect(element, "previousSibling"); }, /** * Collects all of element's next siblings and returns them as an array of * elements. * * @param element {Element} DOM element to query for next siblings * @return {Array} list of found DOM elements */ getNextSiblings : function(element){ return this._recursivelyCollect(element, "nextSibling"); }, /** * Recursively collects elements whose relationship is specified by * property. <code>property</code> has to be a property (a method won't * do!) of element that points to a single DOM node. Returns an array of * elements. * * @param element {Element} DOM element to start with * @param property {String} property to look for * @return {Array} result list */ _recursivelyCollect : function(element, property){ var list = []; while(element = element[property]){ if(element.nodeType == 1){ list.push(element); }; }; return list; }, /** * Collects all of element's siblings and returns them as an array of elements. * * @param element {var} DOM element to start with * @return {Array} list of all found siblings */ getSiblings : function(element){ return this.getPreviousSiblings(element).reverse().concat(this.getNextSiblings(element)); }, /** * Whether the given element is empty. * Inspired by Base2 (Dean Edwards) * * @param element {Element} The element to check * @return {Boolean} true when the element is empty */ isEmpty : function(element){ element = element.firstChild; while(element){ if(element.nodeType === qx.dom.Node.ELEMENT || element.nodeType === qx.dom.Node.TEXT){ return false; }; element = element.nextSibling; }; return true; }, /** * Removes all of element's text nodes which contain only whitespace * * @param element {Element} Element to cleanup */ cleanWhitespace : function(element){ var node = element.firstChild; while(node){ var nextNode = node.nextSibling; if(node.nodeType == 3 && !/\S/.test(node.nodeValue)){ element.removeChild(node); }; node = nextNode; }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.dom.Hierarchy#getSiblings) #require(qx.dom.Hierarchy#getNextSiblings) #require(qx.dom.Hierarchy#getPreviousSiblings) ************************************************************************ */ /** * DOM traversal module */ qx.Bootstrap.define("qx.module.Traversing", { statics : { /** * Adds an element to the collection * * @attach {qxWeb} * @param el {Element} DOM element to add to the collection * @return {qxWeb} The collection for chaining */ add : function(el){ this.push(el); return this; }, /** * Gets a set of elements containing all of the unique immediate children of * each of the matched set of elements. * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?null} Optional selector to match * @return {qxWeb} Collection containing the child elements */ getChildren : function(selector){ var children = []; for(var i = 0;i < this.length;i++){ var found = qx.dom.Hierarchy.getChildElements(this[i]); if(selector){ found = qx.bom.Selector.matches(selector, found); }; children = children.concat(found); }; return qxWeb.$init(children); }, /** * Executes the provided callback function once for each item in the * collection. * * @attach {qxWeb} * @param fn {Function} Callback function * @param ctx {Object} Context object * @return {qxWeb} The collection for chaining */ forEach : function(fn, ctx){ for(var i = 0;i < this.length;i++){ fn.call(ctx, this[i], i, this); }; return this; }, /** * Gets a set of elements containing the parent of each element in the * collection. * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?null} Optional selector to match * @return {qxWeb} Collection containing the parent elements */ getParents : function(selector){ var parents = []; for(var i = 0;i < this.length;i++){ var found = qx.dom.Element.getParentElement(this[i]); if(selector){ found = qx.bom.Selector.matches(selector, [found]); }; parents = parents.concat(found); }; return qxWeb.$init(parents); }, /** * Gets a set of elements containing all ancestors of each element in the * collection. * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param filter {String?null} Optional selector to match * @return {qxWeb} Collection containing the ancestor elements */ getAncestors : function(filter){ return this.__getAncestors(null, filter); }, /** * Gets a set of elements containing all ancestors of each element in the * collection, up to (but not including) the element matched by the provided * selector. * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String} Selector that indicates where to stop including * ancestor elements * @param filter {String?null} Optional selector to match * @return {qxWeb} Collection containing the ancestor elements */ getAncestorsUntil : function(selector, filter){ return this.__getAncestors(selector, filter); }, /** * Internal helper for getAncestors and getAncestorsUntil * * @attach {qxWeb} * @param selector {String} Selector that indicates where to stop including * ancestor elements * @param filter {String?null} Optional selector to match * @return {qxWeb} Collection containing the ancestor elements * @internal */ __getAncestors : function(selector, filter){ var ancestors = []; for(var i = 0;i < this.length;i++){ var parent = qx.dom.Element.getParentElement(this[i]); while(parent){ var found = [parent]; if(selector && qx.bom.Selector.matches(selector, found).length > 0){ break; }; if(filter){ found = qx.bom.Selector.matches(filter, found); }; ancestors = ancestors.concat(found); parent = qx.dom.Element.getParentElement(parent); }; }; return qxWeb.$init(ancestors); }, /** * Gets a set containing the closest matching ancestor for each item in * the collection. * If the item itself matches, it is added to the new set. Otherwise, the * item's parent chain will be traversed until a match is found. * * @attach {qxWeb} * @param selector {String} Selector expression to match * @return {qxWeb} New collection containing the closest matching ancestors */ getClosest : function(selector){ var closest = []; var findClosest = function findClosest(current){ var found = qx.bom.Selector.matches(selector, current); if(found.length){ closest.push(found[0]); } else { current = current.getParents(); // One up if(current[0] && current[0].parentNode){ findClosest(current); }; }; }; for(var i = 0;i < this.length;i++){ findClosest(qxWeb(this[i])); }; return qxWeb.$init(closest); }, /** * Searches the child elements of each item in the collection and returns * a new collection containing the children that match the provided selector * * @attach {qxWeb} * @param selector {String} Selector expression to match the child elements * against * @return {qxWeb} New collection containing the matching child elements */ find : function(selector){ var found = []; for(var i = 0;i < this.length;i++){ found = found.concat(qx.bom.Selector.query(selector, this[i])); }; return qxWeb.$init(found); }, /** * Gets a new set of elements containing the child nodes of each item in the * current set. * * @attach {qxWeb} * @return {qxWeb} New collection containing the child nodes */ getContents : function(){ var found = []; for(var i = 0;i < this.length;i++){ found = found.concat(qx.lang.Array.fromCollection(this[i].childNodes)); }; return qxWeb.$init(found); }, /** * Checks if at least one element in the collection passes the provided * filter. This can be either a selector expression or a filter * function * * @attach {qxWeb} * @param selector {String|Function} Selector expression or filter function * @return {Boolean} <code>true</code> if at least one element matches */ is : function(selector){ if(qx.lang.Type.isFunction(selector)){ return this.filter(selector).length > 0; }; return !!selector && qx.bom.Selector.matches(selector, this).length > 0; }, /** * Reduce the set of matched elements to a single element. * * @attach {qxWeb} * @param index {Number} The position of the element in the collection * @return {qxWeb} A new collection containing one element */ eq : function(index){ return this.slice(index, +index + 1); }, /** * Reduces the collection to the first element. * * @attach {qxWeb} * @return {qxWeb} A new collection containing one element */ getFirst : function(){ return this.slice(0, 1); }, /** * Reduces the collection to the last element. * * @attach {qxWeb} * @return {qxWeb} A new collection containing one element */ getLast : function(){ return this.slice(this.length - 1); }, /** * Gets a collection containing only the elements that have descendants * matching the given selector * * @attach {qxWeb} * @param selector {String} Selector expression * @return {qxWeb} a new collection containing only elements with matching descendants */ has : function(selector){ var found = []; for(var i = 0;i < this.length;i++){ var descendants = qx.bom.Selector.matches(selector, this.eq(i).getContents()); if(descendants.length > 0){ found.push(this[i]); }; }; return qxWeb.$init(found); }, /** * Gets a collection containing the next sibling element of each item in * the current set (ignoring text and comment nodes). * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing next siblings */ getNext : function(selector){ var found = this.map(qx.dom.Hierarchy.getNextElementSibling, qx.dom.Hierarchy); if(selector){ found = qx.bom.Selector.matches(selector, found); }; return found; }, /** * Gets a collection containing all following sibling elements of each * item in the current set (ignoring text and comment nodes). * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing following siblings */ getNextAll : function(selector){ var ret = qx.module.Traversing.__hierarchyHelper(this, "getNextSiblings", selector); return qxWeb.$init(ret); }, /** * Gets a collection containing the following sibling elements of each * item in the current set (ignoring text and comment nodes) up to but not * including any element that matches the given selector. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing following siblings */ getNextUntil : function(selector){ var found = []; this.forEach(function(item, index){ var nextSiblings = qx.dom.Hierarchy.getNextSiblings(item); for(var i = 0,l = nextSiblings.length;i < l;i++){ if(qx.bom.Selector.matches(selector, [nextSiblings[i]]).length > 0){ break; }; found.push(nextSiblings[i]); }; }); return qxWeb.$init(found); }, /** * Gets a collection containing the previous sibling element of each item in * the current set (ignoring text and comment nodes). * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing previous siblings */ getPrev : function(selector){ var found = this.map(qx.dom.Hierarchy.getPreviousElementSibling, qx.dom.Hierarchy); if(selector){ found = qx.bom.Selector.matches(selector, found); }; return found; }, /** * Gets a collection containing all preceding sibling elements of each * item in the current set (ignoring text and comment nodes). * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing preceding siblings */ getPrevAll : function(selector){ var ret = qx.module.Traversing.__hierarchyHelper(this, "getPreviousSiblings", selector); return qxWeb.$init(ret); }, /** * Gets a collection containing the preceding sibling elements of each * item in the current set (ignoring text and comment nodes) up to but not * including any element that matches the given selector. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing preceding siblings */ getPrevUntil : function(selector){ var found = []; this.forEach(function(item, index){ var previousSiblings = qx.dom.Hierarchy.getPreviousSiblings(item); for(var i = 0,l = previousSiblings.length;i < l;i++){ if(qx.bom.Selector.matches(selector, [previousSiblings[i]]).length > 0){ break; }; found.push(previousSiblings[i]); }; }); return qxWeb.$init(found); }, /** * Gets a collection containing all sibling elements of the items in the * current set. * This set can be filtered with an optional expression that will cause only * elements matching the selector to be collected. * * @attach {qxWeb} * @param selector {String?} Optional selector expression * @return {qxWeb} New set containing sibling elements */ getSiblings : function(selector){ var ret = qx.module.Traversing.__hierarchyHelper(this, "getSiblings", selector); return qxWeb.$init(ret); }, /** * Remove elements from the collection that do not pass the given filter. * This can be either a selector expression or a filter function * * @attach {qxWeb} * @param selector {String|Function} Selector or filter function * @return {qxWeb} Reduced collection */ not : function(selector){ if(qx.lang.Type.isFunction(selector)){ return this.filter(function(item, index, obj){ return !selector(item, index, obj); }); }; var res = qx.bom.Selector.matches(selector, this); return this.filter(function(value){ return res.indexOf(value) === -1; }); }, /** * Gets a new collection containing the offset parent of each item in the * current set. * * @attach {qxWeb} * @return {qxWeb} New collection containing offset parents */ getOffsetParent : function(){ return this.map(qx.bom.element.Location.getOffsetParent); }, /** * Whether the first element in the collection is inserted into * the document for which it was created. * * @return {Boolean} <code>true</code> when the element is inserted * into the document. */ isRendered : function(){ if(!this[0]){ return false; }; return qx.dom.Hierarchy.isRendered(this[0]); }, /** * Checks if the given object is a DOM element * * @attachStatic{qxWeb} * @param element {Object} Object to check * @return {Boolean} <code>true</code> if the object is a DOM element */ isElement : function(element){ return qx.dom.Node.isElement(element); }, /** * Checks if the given object is a DOM node * * @attachStatic{qxWeb} * @param node {Object} Object to check * @return {Boolean} <code>true</code> if the object is a DOM node */ isNode : function(node){ return qx.dom.Node.isNode(node); }, /** * Checks if the given object is a DOM document object * * @attachStatic{qxWeb} * @param node {Object} Object to check * @return {Boolean} <code>true</code> if the object is a DOM document */ isDocument : function(node){ return qx.dom.Node.isDocument(node); }, /** * Returns the DOM2 <code>defaultView</code> (window) for the given node. * * @attachStatic{qxWeb} * @param node {Node|Document|Window} Node to inspect * @return {Window} the <code>defaultView</code> for the given node */ getWindow : function(node){ return qx.dom.Node.getWindow(node); }, /** * Returns the owner document of the given node * * @attachStatic{qxWeb} * @param node {Node } Node to get the document for * @return {Document|null} The document of the given DOM node */ getDocument : function(node){ return qx.dom.Node.getDocument(node); }, /** * Helper function that iterates over a set of items and applies the given * qx.dom.Hierarchy method to each entry, storing the results in a new Array. * Duplicates are removed and the items are filtered if a selector is * provided. * * @attach{qxWeb} * @param collection {Array} Collection to iterate over (any Array-like object) * @param method {String} Name of the qx.dom.Hierarchy method to apply * @param selector {String?} Optional selector that elements to be included * must match * @return {Array} Result array * @internal */ __hierarchyHelper : function(collection, method, selector){ // Iterate ourself, as we want to directly combine the result var all = []; var Hierarchy = qx.dom.Hierarchy; for(var i = 0,l = collection.length;i < l;i++){ all.push.apply(all, Hierarchy[method](collection[i])); }; // Remove duplicates var ret = qx.lang.Array.unique(all); // Post reduce result by selector if(selector){ ret = qx.bom.Selector.matches(selector, ret); }; return ret; } }, defer : function(statics){ qxWeb.$attach({ "add" : statics.add, "getChildren" : statics.getChildren, "forEach" : statics.forEach, "getParents" : statics.getParents, "getAncestors" : statics.getAncestors, "getAncestorsUntil" : statics.getAncestorsUntil, "__getAncestors" : statics.__getAncestors, "getClosest" : statics.getClosest, "find" : statics.find, "getContents" : statics.getContents, "is" : statics.is, "eq" : statics.eq, "getFirst" : statics.getFirst, "getLast" : statics.getLast, "has" : statics.has, "getNext" : statics.getNext, "getNextAll" : statics.getNextAll, "getNextUntil" : statics.getNextUntil, "getPrev" : statics.getPrev, "getPrevAll" : statics.getPrevAll, "getPrevUntil" : statics.getPrevUntil, "getSiblings" : statics.getSiblings, "not" : statics.not, "getOffsetParent" : statics.getOffsetParent, "isRendered" : statics.isRendered }); qxWeb.$attachStatic({ "isElement" : statics.isElement, "isNode" : statics.isNode, "isDocument" : statics.isDocument, "getDocument" : statics.getDocument, "getWindow" : statics.getWindow }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /** * Attribute/Property handling for DOM elements. */ qx.Bootstrap.define("qx.module.Attribute", { statics : { /** * Returns the HTML content of the first item in the collection * @attach {qxWeb} * @return {String|null} HTML content or null if the collection is empty */ getHtml : function(){ if(this[0]){ return qx.bom.element.Attribute.get(this[0], "html"); }; return null; }, /** * Sets the HTML content of each item in the collection * * @attach {qxWeb} * @param html {String} HTML string * @return {qxWeb} The collection for chaining */ setHtml : function(html){ for(var i = 0;i < this.length;i++){ qx.bom.element.Attribute.set(this[i], "html", html); }; return this; }, /** * Sets an HTML attribute on each item in the collection * * @attach {qxWeb} * @param name {String} Attribute name * @param value {var} Attribute value * @return {qxWeb} The collection for chaining */ setAttribute : function(name, value){ for(var i = 0;i < this.length;i++){ qx.bom.element.Attribute.set(this[i], name, value); }; return this; }, /** * Returns the value of the given attribute for the first item in the * collection. * * @attach {qxWeb} * @param name {String} Attribute name * @return {var} Attribute value */ getAttribute : function(name){ if(this[0]){ return qx.bom.element.Attribute.get(this[0], name); }; return null; }, /** * Removes the given attribute from all elements in the collection * * @attach {qxWeb} * @param name {String} Attribute name * @return {qxWeb} The collection for chaining */ removeAttribute : function(name){ for(var i = 0;i < this.length;i++){ qx.bom.element.Attribute.set(this[i], name, null); }; return this; }, /** * Sets multiple attributes for each item in the collection. * * @attach {qxWeb} * @param attributes {Map} A map of attribute name/value pairs * @return {qxWeb} The collection for chaining */ setAttributes : function(attributes){ for(var name in attributes){ this.setAttribute(name, attributes[name]); }; return this; }, /** * Returns the values of multiple attributes for the first item in the collection * * @attach {qxWeb} * @param names {String[]} List of attribute names * @return {Map} Map of attribute name/value pairs */ getAttributes : function(names){ var attributes = { }; for(var i = 0;i < names.length;i++){ attributes[names[i]] = this.getAttribute(names[i]); }; return attributes; }, /** * Removes multiple attributes from each item in the collection. * * @attach {qxWeb} * @param attributes {String[]} List of attribute names * @return {qxWeb} The collection for chaining */ removeAttributes : function(attributes){ for(var i = 0,l = attributes.length;i < l;i++){ this.removeAttribute(attributes[i]); }; return this; }, /** * Sets a property on each item in the collection * * @attach {qxWeb} * @param name {String} Property name * @param value {var} Property value * @return {qxWeb} The collection for chaining */ setProperty : function(name, value){ for(var i = 0;i < this.length;i++){ this[i][name] = value; }; return this; }, /** * Returns the value of the given property for the first item in the * collection * * @attach {qxWeb} * @param name {String} Property name * @return {var} Property value */ getProperty : function(name){ if(this[0]){ return this[0][name]; }; return null; }, /** * Sets multiple properties for each item in the collection. * * @attach {qxWeb} * @param properties {Map} A map of property name/value pairs * @return {qxWeb} The collection for chaining */ setProperties : function(properties){ for(var name in properties){ this.setProperty(name, properties[name]); }; return this; }, /** * Returns the values of multiple properties for the first item in the collection * * @attach {qxWeb} * @param names {String[]} List of property names * @return {Map} Map of property name/value pairs */ getProperties : function(names){ var properties = { }; for(var i = 0;i < names.length;i++){ properties[names[i]] = this.getProperty(names[i]); }; return properties; }, /** * Returns the currently configured value for the first item in the collection. * Works with simple input fields as well as with select boxes or option * elements. Returns an array for select boxes with multi selection. In all * other cases, a string is returned. * * @attach {qxWeb} * @return {String|Array} */ getValue : function(){ if(this[0]){ return qx.bom.Input.getValue(this[0]); }; return null; }, /** * Applies the given value to each element in the collection. * Normally the value is given as a string/number value and applied to the * field content (textfield, textarea) or used to detect whether the field * is checked (checkbox, radiobutton). * Supports array values for selectboxes (multiple selection) and checkboxes * or radiobuttons (for convenience). * Please note: To modify the value attribute of a checkbox or radiobutton * use @link{#set} instead. * * @attach {qxWeb} * @param value {String|Number|Array} The value to apply * @return {qxWeb} The collection for chaining */ setValue : function(value){ for(var i = 0,l = this.length;i < l;i++){ qx.bom.Input.setValue(this[i], value); }; return this; } }, defer : function(statics){ qxWeb.$attach({ "getHtml" : statics.getHtml, "setHtml" : statics.setHtml, "getAttribute" : statics.getAttribute, "setAttribute" : statics.setAttribute, "removeAttribute" : statics.removeAttribute, "getAttributes" : statics.getAttributes, "setAttributes" : statics.setAttributes, "removeAttributes" : statics.removeAttributes, "getProperty" : statics.getProperty, "setProperty" : statics.setProperty, "getProperties" : statics.getProperties, "setProperties" : statics.setProperties, "getValue" : statics.getValue, "setValue" : statics.setValue }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ====================================================================== This class contains code based on the following work: * jQuery http://jquery.com Version 1.3.1 Copyright: 2009 John Resig License: MIT: http://www.opensource.org/licenses/mit-license.php ************************************************************************ */ /* ************************************************************************ #require(qx.lang.Array#contains) ************************************************************************ */ /** * Cross browser abstractions to work with input elements. */ qx.Bootstrap.define("qx.bom.Input", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** {Map} Internal data structures with all supported input types */ __types : { text : 1, textarea : 1, select : 1, checkbox : 1, radio : 1, password : 1, hidden : 1, submit : 1, image : 1, file : 1, search : 1, reset : 1, button : 1 }, /** * Creates an DOM input/textarea/select element. * * Attributes may be given directly with this call. This is critical * for some attributes e.g. name, type, ... in many clients. * * Note: <code>select</code> and <code>textarea</code> elements are created * using the identically named <code>type</code>. * * @param type {String} Any valid type for HTML, <code>select</code> * and <code>textarea</code> * @param attributes {Map} Map of attributes to apply * @param win {Window} Window to create the element for * @return {Element} The created input node */ create : function(type, attributes, win){ { }; // Work on a copy to not modify given attributes map var attributes = attributes ? qx.lang.Object.clone(attributes) : { }; var tag; if(type === "textarea" || type === "select"){ tag = type; } else { tag = "input"; attributes.type = type; }; return qx.dom.Element.create(tag, attributes, win); }, /** * Applies the given value to the element. * * Normally the value is given as a string/number value and applied * to the field content (textfield, textarea) or used to * detect whether the field is checked (checkbox, radiobutton). * * Supports array values for selectboxes (multiple-selection) * and checkboxes or radiobuttons (for convenience). * * Please note: To modify the value attribute of a checkbox or * radiobutton use {@link qx.bom.element.Attribute#set} instead. * * @param element {Element} element to update * @param value {String|Number|Array} the value to apply */ setValue : function(element, value){ var tag = element.nodeName.toLowerCase(); var type = element.type; var Array = qx.lang.Array; var Type = qx.lang.Type; if(typeof value === "number"){ value += ""; }; if((type === "checkbox" || type === "radio")){ if(Type.isArray(value)){ element.checked = Array.contains(value, element.value); } else { element.checked = element.value == value; }; } else if(tag === "select"){ var isArray = Type.isArray(value); var options = element.options; var subel,subval; for(var i = 0,l = options.length;i < l;i++){ subel = options[i]; subval = subel.getAttribute("value"); if(subval == null){ subval = subel.text; }; subel.selected = isArray ? Array.contains(value, subval) : value == subval; }; if(isArray && value.length == 0){ element.selectedIndex = -1; }; } else if((type === "text" || type === "textarea") && (qx.core.Environment.get("engine.name") == "mshtml")){ // These flags are required to detect self-made property-change // events during value modification. They are used by the Input // event handler to filter events. element.$$inValueSet = true; element.value = value; element.$$inValueSet = null; } else { element.value = value; };; }, /** * Returns the currently configured value. * * Works with simple input fields as well as with * select boxes or option elements. * * Returns an array in cases of multi-selection in * select boxes but in all other cases a string. * * @param element {Element} DOM element to query * @return {String|Array} The value of the given element */ getValue : function(element){ var tag = element.nodeName.toLowerCase(); if(tag === "option"){ return (element.attributes.value || { }).specified ? element.value : element.text; }; if(tag === "select"){ var index = element.selectedIndex; // Nothing was selected if(index < 0){ return null; }; var values = []; var options = element.options; var one = element.type == "select-one"; var clazz = qx.bom.Input; var value; // Loop through all the selected options for(var i = one ? index : 0,max = one ? index + 1 : options.length;i < max;i++){ var option = options[i]; if(option.selected){ // Get the specifc value for the option value = clazz.getValue(option); // We don't need an array for one selects if(one){ return value; }; // Multi-Selects return an array values.push(value); }; }; return values; } else { return (element.value || "").replace(/\r/g, ""); }; }, /** * Sets the text wrap behaviour of a text area element. * This property uses the attribute "wrap" respectively * the style property "whiteSpace" * * @signature function(element, wrap) * @param element {Element} DOM element to modify * @param wrap {Boolean} Whether to turn text wrap on or off. */ setWrap : qx.core.Environment.select("engine.name", { "mshtml" : function(element, wrap){ var wrapValue = wrap ? "soft" : "off"; // Explicitly set overflow-y CSS property to auto when wrapped, // allowing the vertical scroll-bar to appear if necessary var styleValue = wrap ? "auto" : ""; element.wrap = wrapValue; element.style.overflowY = styleValue; }, "gecko|webkit" : function(element, wrap){ var wrapValue = wrap ? "soft" : "off"; var styleValue = wrap ? "" : "auto"; element.setAttribute("wrap", wrapValue); element.style.overflow = styleValue; }, "default" : function(element, wrap){ element.style.whiteSpace = wrap ? "normal" : "nowrap"; } }) } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #ignore(qx.bom.element.AnimationJs) ************************************************************************ */ /** * DOM manipulation module */ qx.Bootstrap.define("qx.module.Manipulating", { statics : { /** * Creates a new collection from the given argument. This can either be an * HTML string, a single DOM element or an array of elements * * @attachStatic{qxWeb} * @param html {String|Element[]} HTML string or DOM element(s) * @return {qxWeb} Collection of elements */ create : function(html){ return qxWeb.$init(qx.bom.Html.clean([html])); }, /** * Clones the items in the current collection and returns them in a new set. * Event listeners can also be cloned. * * @attach{qxWeb} * @param events {Boolean} clone event listeners. Default: <pre>false</pre> * @return {qxWeb} New collection with clones */ clone : function(events){ var clones = []; for(var i = 0;i < this.length;i++){ clones[i] = this[i].cloneNode(true); }; if(events === true && this.copyEventsTo){ this.copyEventsTo(clones); }; return qxWeb(clones); }, /** * Appends content to each element in the current set. Accepts an HTML string, * a single DOM element or an array of elements * * @attach{qxWeb} * @param html {String|Element[]} HTML string or DOM element(s) to append * @return {qxWeb} The collection for chaining */ append : function(html){ var arr = qx.bom.Html.clean([html]); var children = qxWeb.$init(arr); for(var i = 0,l = this.length;i < l;i++){ for(var j = 0,m = children.length;j < m;j++){ if(i == 0){ // first parent: move the target node(s) qx.dom.Element.insertEnd(children[j], this[i]); } else { qx.dom.Element.insertEnd(children.eq(j).clone(true)[0], this[i]); }; }; }; return this; }, /** * Appends all items in the collection to the specified parents. If multiple * parents are given, the items will be moved to the first parent, while * clones of the items will be appended to subsequent parents. * * @attach{qxWeb} * @param parent {String|Element[]} Parent selector expression or list of * parent elements * @return {qxWeb} The collection for chaining */ appendTo : function(parent){ parent = qx.module.Manipulating.__getElementArray(parent); for(var i = 0,l = parent.length;i < l;i++){ for(var j = 0,m = this.length;j < m;j++){ if(i == 0){ // first parent: move the target node(s) qx.dom.Element.insertEnd(this[j], parent[i]); } else { // further parents: clone the target node(s) qx.dom.Element.insertEnd(this.eq(j).clone(true)[0], parent[i]); }; }; }; return this; }, /** * Inserts the current collection before each target item. The collection * items are moved before the first target. For subsequent targets, * clones of the collection items are created and inserted. * * @attach{qxWeb} * @param target {String|Element} Selector expression or DOM element * @return {qxWeb} The collection for chaining */ insertBefore : function(target){ target = qx.module.Manipulating.__getElementArray(target); for(var i = 0,l = target.length;i < l;i++){ for(var j = 0,m = this.length;j < m;j++){ if(i == 0){ // first target: move the target node(s) qx.dom.Element.insertBefore(this[j], target[i]); } else { // further targets: clone the target node(s) qx.dom.Element.insertBefore(this.eq(j).clone(true)[0], target[i]); }; }; }; return this; }, /** * Inserts the current collection after each target item. The collection * items are moved after the first target. For subsequent targets, * clones of the collection items are created and inserted. * * @attach{qxWeb} * @param target {String|Element} Selector expression or DOM element * @return {qxWeb} The collection for chaining */ insertAfter : function(target){ target = qx.module.Manipulating.__getElementArray(target); for(var i = 0,l = target.length;i < l;i++){ for(var j = this.length - 1;j >= 0;j--){ if(i == 0){ // first target: move the target node(s) qx.dom.Element.insertAfter(this[j], target[i]); } else { // further targets: clone the target node(s) qx.dom.Element.insertAfter(this.eq(j).clone(true)[0], target[i]); }; }; }; return this; }, /** * Returns an array from a selector expression or a single element * * @attach{qxWeb} * @param arg {String|Element} Selector expression or DOM element * @return {Element[]} Array of elements * @internal */ __getElementArray : function(arg){ if(!qx.lang.Type.isArray(arg)){ var fromSelector = qxWeb(arg); arg = fromSelector.length > 0 ? fromSelector : [arg]; }; return arg; }, /** * Wraps each element in the collection in a copy of an HTML structure. * Elements will be appended to the deepest nested element in the structure * as determined by a depth-first search. * * @attach{qxWeb} * @param wrapper {var} Selector expression, HTML string, DOM element or * list of DOM elements * @return {qxWeb} The collection for chaining */ wrap : function(wrapper){ var wrapper = qx.module.Manipulating.__getCollectionFromArgument(wrapper); if(wrapper.length == 0 || !qx.dom.Node.isElement(wrapper[0])){ return this; }; for(var i = 0,l = this.length;i < l;i++){ var clonedwrapper = wrapper.eq(0).clone(true); qx.dom.Element.insertAfter(clonedwrapper[0], this[i]); var innermost = qx.module.Manipulating.__getInnermostElement(clonedwrapper[0]); qx.dom.Element.insertEnd(this[i], innermost); }; return this; }, /** * Creates a new collection from the given argument * @param arg {var} Selector expression, HTML string, DOM element or list of * DOM elements * @return {qxWeb} Collection * @internal */ __getCollectionFromArgument : function(arg){ var coll; // Collection/array of DOM elements if(qx.lang.Type.isArray(arg)){ coll = qxWeb(arg); } else { var arr = qx.bom.Html.clean([arg]); if(arr.length > 0 && qx.dom.Node.isElement(arr[0])){ coll = qxWeb(arr); } else { coll = qxWeb(arg); }; }; return coll; }, /** * Returns the innermost element of a DOM tree as determined by a simple * depth-first search. * * @param element {Element} Root element * @return {Element} innermost element * @internal */ __getInnermostElement : function(element){ if(element.childNodes.length == 0){ return element; }; for(var i = 0,l = element.childNodes.length;i < l;i++){ if(element.childNodes[i].nodeType === 1){ return this.__getInnermostElement(element.childNodes[i]); }; }; return element; }, /** * Removes each element in the current collection from the DOM * * @attach{qxWeb} * @return {qxWeb} The collection for chaining */ remove : function(){ for(var i = 0;i < this.length;i++){ qx.dom.Element.remove(this[i]); }; return this; }, /** * Removes all content from the elements in the collection * * @attach{qxWeb} * @return {qxWeb} The collection for chaining */ empty : function(){ for(var i = 0;i < this.length;i++){ this[i].innerHTML = ""; }; return this; }, /** * Inserts content before each element in the collection. This can either * be an HTML string, an array of HTML strings, a single DOM element or an * array of elements. * * @attach{qxWeb} * @param args {String[]|Element[]} HTML string(s) or DOM element(s) * @return {qxWeb} The collection for chaining */ before : function(args){ if(!qx.lang.Type.isArray(args)){ args = [args]; }; var fragment = document.createDocumentFragment(); qx.bom.Html.clean(args, document, fragment); this.forEach(function(item, index){ var kids = qx.lang.Array.cast(fragment.childNodes, Array); for(var i = 0,l = kids.length;i < l;i++){ var child; if(index < this.length - 1){ child = kids[i].cloneNode(true); } else { child = kids[i]; }; item.parentNode.insertBefore(child, item); }; }, this); return this; }, /** * Inserts content after each element in the collection. This can either * be an HTML string, an array of HTML strings, a single DOM element or an * array of elements. * * @attach{qxWeb} * @param args {String[]|Element[]} HTML string(s) or DOM element(s) * @return {qxWeb} The collection for chaining */ after : function(args){ if(!qx.lang.Type.isArray(args)){ args = [args]; }; var fragment = document.createDocumentFragment(); qx.bom.Html.clean(args, document, fragment); this.forEach(function(item, index){ var kids = qx.lang.Array.cast(fragment.childNodes, Array); for(var i = kids.length - 1;i >= 0;i--){ var child; if(index < this.length - 1){ child = kids[i].cloneNode(true); } else { child = kids[i]; }; item.parentNode.insertBefore(child, item.nextSibling); }; }, this); return this; }, /** * Returns the left scroll position of the first element in the collection. * * @attach{qxWeb} * @return {Number} Current left scroll position */ getScrollLeft : function(){ var obj = this[0]; if(!obj){ return null; }; var Node = qx.dom.Node; if(Node.isWindow(obj) || Node.isDocument(obj)){ return qx.bom.Viewport.getScrollLeft(); }; return obj.scrollLeft; }, /** * Returns the top scroll position of the first element in the collection. * * @attach{qxWeb} * @return {Number} Current top scroll position */ getScrollTop : function(){ var obj = this[0]; if(!obj){ return null; }; var Node = qx.dom.Node; if(Node.isWindow(obj) || Node.isDocument(obj)){ return qx.bom.Viewport.getScrollTop(); }; return obj.scrollTop; }, /** Default animation descriptions for animated scrolling **/ _animationDescription : { scrollLeft : { duration : 700, timing : "ease-in", keep : 100, keyFrames : { '0' : { }, '100' : { scrollLeft : 1 } } }, scrollTop : { duration : 700, timing : "ease-in", keep : 100, keyFrames : { '0' : { }, '100' : { scrollTop : 1 } } } }, /** * Performs animated scrolling * * @param property {String} Element property to animate: <code>scrollLeft</code> * or <code>scrollTop</code> * @param value {Number} Final scroll position * @param duration {Number} The animation's duration in ms * @return {q} The collection for chaining. */ __animateScroll : function(property, value, duration){ var desc = qx.lang.Object.clone(qx.module.Manipulating._animationDescription[property], true); desc.keyFrames[100][property] = value; return this.animate(desc, duration); }, /** * Scrolls the elements of the collection to the given coordinate. * * @attach{qxWeb} * @param value {Number} Left scroll position * @param duration {Number?} Optional: Duration in ms for animated scrolling * @return {qxWeb} The collection for chaining */ setScrollLeft : function(value, duration){ var Node = qx.dom.Node; if(duration && qx.bom.element && qx.bom.element.AnimationJs){ qx.module.Manipulating.__animateScroll.bind(this, "scrollLeft", value, duration)(); }; for(var i = 0,l = this.length,obj;i < l;i++){ obj = this[i]; if(Node.isElement(obj)){ if(!(duration && qx.bom.element && qx.bom.element.AnimationJs)){ obj.scrollLeft = value; }; } else if(Node.isWindow(obj)){ obj.scrollTo(value, this.getScrollTop(obj)); } else if(Node.isDocument(obj)){ Node.getWindow(obj).scrollTo(value, this.getScrollTop(obj)); };; }; return this; }, /** * Scrolls the elements of the collection to the given coordinate. * * @attach{qxWeb} * @param value {Number} Top scroll position * @param duration {Number?} Optional: Duration in ms for animated scrolling * @return {qxWeb} The collection for chaining */ setScrollTop : function(value, duration){ var Node = qx.dom.Node; if(duration && qx.bom.element && qx.bom.element.AnimationJs){ qx.module.Manipulating.__animateScroll.bind(this, "scrollTop", value, duration)(); }; for(var i = 0,l = this.length,obj;i < l;i++){ obj = this[i]; if(Node.isElement(obj)){ if(!(duration && qx.bom.element && qx.bom.element.AnimationJs)){ obj.scrollTop = value; }; } else if(Node.isWindow(obj)){ obj.scrollTo(this.getScrollLeft(obj), value); } else if(Node.isDocument(obj)){ Node.getWindow(obj).scrollTo(this.getScrollLeft(obj), value); };; }; return this; }, /** * Focuses the first element in the collection * * @attach{qxWeb} * @return {qxWeb} The collection for chaining */ focus : function(){ try{ this[0].focus(); } catch(ex) { }; return this; }, /** * Blurs each element in the collection * * @attach{qxWeb} * @return {qxWeb} The collection for chaining */ blur : function(){ this.forEach(function(item, index){ try{ item.blur(); } catch(ex) { }; }); return this; } }, defer : function(statics){ qxWeb.$attachStatic({ "create" : statics.create }); qxWeb.$attach({ "append" : statics.append, "appendTo" : statics.appendTo, "remove" : statics.remove, "empty" : statics.empty, "before" : statics.before, "insertBefore" : statics.insertBefore, "after" : statics.after, "insertAfter" : statics.insertAfter, "wrap" : statics.wrap, "clone" : statics.clone, "getScrollLeft" : statics.getScrollLeft, "setScrollLeft" : statics.setScrollLeft, "getScrollTop" : statics.getScrollTop, "setScrollTop" : statics.setScrollTop, "focus" : statics.focus, "blur" : statics.blur }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2009 Sebastian Werner, http://sebastian-werner.net License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) ====================================================================== This class contains code based on the following work: * jQuery http://jquery.com Version 1.3.1 Copyright: 2009 John Resig License: MIT: http://www.opensource.org/licenses/mit-license.php ************************************************************************ */ /* ************************************************************************ #ignore(qxWeb) ************************************************************************ */ /** * This class is mainly a convenience wrapper for DOM elements to * qooxdoo's event system. */ qx.Bootstrap.define("qx.bom.Html", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** * Helper method for XHTML replacement. * * @param all {String} Complete string * @param front {String} Front of the match * @param tag {String} Tag name * @return {String} XHTML corrected tag */ __fixNonDirectlyClosableHelper : function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"; }, /** {Map} Contains wrap fragments for specific HTML matches */ __convertMap : { opt : [1, "<select multiple='multiple'>", "</select>"], // option or optgroup leg : [1, "<fieldset>", "</fieldset>"], table : [1, "<table>", "</table>"], tr : [2, "<table><tbody>", "</tbody></table>"], td : [3, "<table><tbody><tr>", "</tr></tbody></table>"], col : [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], def : qx.core.Environment.select("engine.name", { "mshtml" : [1, "div<div>", "</div>"], "default" : null }) }, /** * Translates a HTML string into an array of elements. * * @param html {String} HTML string * @param context {Document} Context document in which (helper) elements should be created * @return {Array} List of resulting elements */ __convertHtmlString : function(html, context){ var div = context.createElement("div"); // Fix "XHTML"-style tags in all browsers // Replaces tags which are not allowed to be directly closed like // <code>div</code> or <code>p</code>. They are patched to use an // open and close tag instead e.g. <p> => <p></p> html = html.replace(/(<(\w+)[^>]*?)\/>/g, this.__fixNonDirectlyClosableHelper); // Trim whitespace, otherwise indexOf won't work as expected var tags = html.replace(/^\s+/, "").substring(0, 5).toLowerCase(); // Auto-wrap content into required DOM structure var wrap,map = this.__convertMap; if(!tags.indexOf("<opt")){ wrap = map.opt; } else if(!tags.indexOf("<leg")){ wrap = map.leg; } else if(tags.match(/^<(thead|tbody|tfoot|colg|cap)/)){ wrap = map.table; } else if(!tags.indexOf("<tr")){ wrap = map.tr; } else if(!tags.indexOf("<td") || !tags.indexOf("<th")){ wrap = map.td; } else if(!tags.indexOf("<col")){ wrap = map.col; } else { wrap = map.def; };;;;; // Omit string concat when no wrapping is needed if(wrap){ // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + html + wrap[2]; // Move to the right depth var depth = wrap[0]; while(depth--){ div = div.lastChild; }; } else { div.innerHTML = html; }; // Fix IE specific bugs if((qx.core.Environment.get("engine.name") == "mshtml")){ // Remove IE's autoinserted <tbody> from table fragments // String was a <table>, *may* have spurious <tbody> var hasBody = /<tbody/i.test(html); // String was a bare <thead> or <tfoot> var tbody = !tags.indexOf("<table") && !hasBody ? div.firstChild && div.firstChild.childNodes : wrap[1] == "<table>" && !hasBody ? div.childNodes : []; for(var j = tbody.length - 1;j >= 0;--j){ if(tbody[j].tagName.toLowerCase() === "tbody" && !tbody[j].childNodes.length){ tbody[j].parentNode.removeChild(tbody[j]); }; }; // IE completely kills leading whitespace when innerHTML is used if(/^\s/.test(html)){ div.insertBefore(context.createTextNode(html.match(/^\s*/)[0]), div.firstChild); }; }; return qx.lang.Array.fromCollection(div.childNodes); }, /** * Cleans-up the given HTML and append it to a fragment * * When no <code>context</code> is given the global document is used to * create new DOM elements. * * When a <code>fragment</code> is given the nodes are appended to this * fragment except the script tags. These are returned in a separate Array. * * Please note: HTML coming from user input must be validated prior * to passing it to this method. HTML is temporarily inserted to the DOM * using <code>innerHTML</code>. As a consequence, scripts included in * attribute event handlers may be executed. * * @param objs {Element[]|String[]} Array of DOM elements or HTML strings * @param context {Document?document} Context in which the elements should be created * @param fragment {Element?null} Document fragment to appends elements to * @return {Element[]} Array of elements (when a fragment is given it only contains script elements) */ clean : function(objs, context, fragment){ context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if(typeof context.createElement === "undefined"){ context = context.ownerDocument || context[0] && context[0].ownerDocument || document; }; // Fast-Path: // If a single string is passed in and it's a single tag // just do a createElement and skip the rest if(!fragment && objs.length === 1 && typeof objs[0] === "string"){ var match = /^<(\w+)\s*\/?>$/.exec(objs[0]); if(match){ return [context.createElement(match[1])]; }; }; // Interate through items in incoming array var obj,ret = []; for(var i = 0,l = objs.length;i < l;i++){ obj = objs[i]; // Convert HTML string into DOM nodes if(typeof obj === "string"){ obj = this.__convertHtmlString(obj, context); }; // Append or merge depending on type if(obj.nodeType){ ret.push(obj); } else if(obj instanceof qx.type.BaseArray || (typeof qxWeb !== "undefined" && obj instanceof qxWeb)){ ret.push.apply(ret, Array.prototype.slice.call(obj, 0)); } else if(obj.toElement){ ret.push(obj.toElement()); } else { ret.push.apply(ret, obj); };; }; // Append to fragment and filter out scripts... or... if(fragment){ var scripts = [],elem; for(var i = 0;ret[i];i++){ elem = ret[i]; if(elem.nodeType == 1 && elem.tagName.toLowerCase() === "script" && (!elem.type || elem.type.toLowerCase() === "text/javascript")){ // Trying to remove the element from DOM if(elem.parentNode){ elem.parentNode.removeChild(ret[i]); }; // Store in script list scripts.push(elem); } else { if(elem.nodeType === 1){ // Recursively search for scripts and append them to the list of elements to process var scriptList = qx.lang.Array.fromCollection(elem.getElementsByTagName("script")); ret.splice.apply(ret, [i + 1, 0].concat(scriptList)); }; // Finally append element to fragment fragment.appendChild(elem); }; }; return scripts; }; // Otherwise return the array of all elements return ret; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Manipulating) #require(qx.module.Css) #require(qx.module.Attribute) #require(qx.module.Event) #require(qx.module.Environment) #require(qx.module.Polyfill) #require(qx.module.Traversing) ************************************************************************ */ /** * The module supplies a fallback implementation for placeholders, which is * used on input and textarea elements. If the browser supports native placeholders * the API silently ignores all calls. If not, an element will be created for every * given input element and acts as placeholder. Most modern browsers support * placeholders which makes the fallback only relevant for IE < 10 and FF < 4. * * * <a href="http://dev.w3.org/html5/spec/single-page.html#the-placeholder-attribute">HTML Spec</a> * * * <a href="http://caniuse.com/#feat=input-placeholder">Browser Support</a> */ qx.Bootstrap.define("qx.module.Placeholder", { statics : { /** * String holding the property name which holds the placeholder * element for each input. */ PLACEHOLDER_NAME : "$qx_placeholder", /** * Queries for all input and textarea elements on the page and updates * their placeholder. * @attachStatic{qxWeb, placeholder.update} */ update : function(){ // ignore if native placeholder are supported if(!qxWeb.env.get("css.placeholder")){ qxWeb("input[placeholder], textarea[placeholder]").updatePlaceholder(); }; }, /** * Updates the placeholders for input's and textarea's in the collection. * This includes positioning, styles and DOM positioning. * In case the browser supports native placeholders, this methods simply * does nothing. * * @attach {qxWeb} * @return {qxWeb} The collection for chaining */ updatePlaceholder : function(){ // ignore everything if native placeholder are supported if(!qxWeb.env.get("css.placeholder")){ for(var i = 0;i < this.length;i++){ var item = qxWeb(this[i]); // ignore all not fitting items in the collection var placeholder = item.getAttribute("placeholder"); var tagName = item.getProperty("tagName"); if(!placeholder || (tagName != "TEXTAREA" && tagName != "INPUT")){ continue; }; // create the element if necessary var placeholderEl = item.getProperty(qx.module.Placeholder.PLACEHOLDER_NAME); if(!placeholderEl){ placeholderEl = qx.module.Placeholder.__createPlaceholderElement(item); }; // remove and add handling var itemInBody = item.isRendered(); var placeholderElInBody = placeholderEl.isRendered(); if(itemInBody && !placeholderElInBody){ item.before(placeholderEl); } else if(!itemInBody && placeholderElInBody){ placeholderEl.remove(); return this; }; qx.module.Placeholder.__syncStyles(item); }; }; return this; }, /** * Internal helper method to update the styles for a given input element. * @param item {qxWeb} The input element to update. */ __syncStyles : function(item){ var placeholder = item.getAttribute("placeholder"); var placeholderEl = item.getProperty(qx.module.Placeholder.PLACEHOLDER_NAME); var zIndex = item.getStyle("z-index"); var paddingHor = parseInt(item.getStyle("padding-left")) + 2 * parseInt(item.getStyle("padding-right")); var paddingVer = parseInt(item.getStyle("padding-top")) + 2 * parseInt(item.getStyle("padding-bottom")); placeholderEl.setHtml(placeholder).setStyles({ display : item.getValue() == "" ? "inline" : "none", zIndex : zIndex == "auto" ? 1 : zIndex + 1, textAlign : item.getStyle("text-align"), width : (item.getWidth() - paddingHor - 4) + "px", height : (item.getHeight() - paddingVer - 4) + "px", left : item.getOffset().left + "px", top : item.getOffset().top + "px", fontFamily : item.getStyle("font-family"), fontStyle : item.getStyle("font-style"), fontVariant : item.getStyle("font-variant"), fontWeight : item.getStyle("font-weight"), fontSize : item.getStyle("font-size"), paddingTop : (parseInt(item.getStyle("padding-top")) + 2) + "px", paddingRight : (parseInt(item.getStyle("padding-right")) + 2) + "px", paddingBottom : (parseInt(item.getStyle("padding-bottom")) + 2) + "px", paddingLeft : (parseInt(item.getStyle("padding-left")) + 2) + "px" }); }, /** * Creates a placeholder element based on the given input element. * @param item {qxWeb} The input element. * @return {qxWeb} The placeholder element. */ __createPlaceholderElement : function(item){ // create the label with initial styles var placeholderEl = qxWeb.create("<label>").setStyles({ position : "absolute", color : "#989898", overflow : "hidden", pointerEvents : "none" }); // store the label at the input field item.setProperty(qx.module.Placeholder.PLACEHOLDER_NAME, placeholderEl); // update the placeholders visibility on keyUp item.on("keyup", function(item){ var el = item.getProperty(qx.module.Placeholder.PLACEHOLDER_NAME); el.setStyle("display", item.getValue() == "" ? "inline" : "none"); }.bind(this, item)); // for browsers not supporting pointer events if(!qxWeb.env.get("event.pointer")){ placeholderEl.setStyle("cursor", "text").on("click", function(item){ item.focus(); }.bind(this, item)); }; return placeholderEl; } }, defer : function(statics){ qxWeb.$attachStatic({ "placeholder" : { update : statics.update } }); qxWeb.$attach({ "updatePlaceholder" : statics.updatePlaceholder }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * HTML templating module. This is a wrapper for mustache.js which is a * "framework-agnostic way to render logic-free views". * * Here is a basic example how to use it: * <pre class="javascript"> * var template = "Hi, my name is {{name}}!"; * var view = {name: "qooxdoo"}; * q.template.render(template, view); * // return "Hi, my name is qooxdoo!" * </pre> * * For further details, please visit the mustache.js documentation here: * https://github.com/janl/mustache.js/blob/master/README.md */ qx.Bootstrap.define("qx.module.Template", { statics : { /** * Helper method which provides direct access to templates stored as HTML in * the DOM. The DOM node with the given ID will be treated as a template, * parsed and a new DOM node will be returned containing the parsed data. * Keep in mind that templates can only have one root element. * Additionally, you should not put the template into a regular, hidden * DOM element because the template may not be valid HTML due to the containing * mustache tags. We suggest to put it into a script tag with the type * <code>text/template</code>. * * @attachStatic{qxWeb, template.get} * @param id {String} The id of the HTML template in the DOM. * @param view {Object} The object holding the data to render. * @param partials {Object} Object holding parts of a template. * @return {qxWeb} Collection containing a single DOM element with the parsed * template data. */ get : function(id, view, partials){ var el = qx.bom.Template.get(id, view, partials); return qxWeb.$init([el]); }, /** * Original and only template method of mustache.js. For further * documentation, please visit https://github.com/janl/mustache.js * * @attachStatic{qxWeb, template.render} * @param template {String} The String containing the template. * @param view {Object} The object holding the data to render. * @param partials {Object} Object holding parts of a template. * @return {String} The parsed template. */ render : function(template, view, partials){ return qx.bom.Template.render(template, view, partials); } }, defer : function(statics){ qxWeb.$attachStatic({ "template" : { get : statics.get, render : statics.render } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ====================================================================== This class contains code based on the following work: * Mustache.js version 0.7.0 Code: https://github.com/janl/mustache.js Copyright: (c) 2009 Chris Wanstrath (Ruby) (c) 2010 Jan Lehnardt (JavaScript) License: MIT: http://www.opensource.org/licenses/mit-license.php ---------------------------------------------------------------------- Copyright (c) 2009 Chris Wanstrath (Ruby) Copyright (c) 2010 Jan Lehnardt (JavaScript) 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. ************************************************************************ */ /* ************************************************************************ #ignore(module) ************************************************************************ */ /** * The is a template class which can be used for HTML templating. In fact, * this is a wrapper for mustache.js which is a "framework-agnostic way to * render logic-free views". * * Here is a basic example how to use it: * Template: * <pre class="javascript"> * var template = "Hi, my name is {{name}}!"; * var view = {name: "qooxdoo"}; * qx.bom.Template.render(template, view); * // return "Hi, my name is qooxdoo!" * </pre> * * For further details, please visit the mustache.js documentation here: * https://github.com/janl/mustache.js/blob/master/README.md * */ qx.Bootstrap.define("qx.bom.Template", { statics : { /** Contains the mustache.js version. */ version : null, /** * Original and only template method of mustache.js. For further * documentation, please visit https://github.com/janl/mustache.js * * @signature function(template, view, partials) * @param template {String} The String containing the template. * @param view {Object} The object holding the data to render. * @param partials {Object} Object holding parts of a template. * @return {String} The parsed template. */ render : null, /** * Helper method which provides you with a direct access to templates * stored as HTML in the DOM. The DOM node with the given ID will be used * as a template, parsed and a new DOM node will be returned containing the * parsed data. Keep in mind to have only one root DOM element in the the * template. * Additionally, you should not put the template into a regular, hidden * DOM element because the template may not be valid HTML due to the containing * mustache tags. We suggest to put it into a script tag with the type * <code>text/template</code>. * * @param id {String} The id of the HTML template in the DOM. * @param view {Object} The object holding the data to render. * @param partials {Object} Object holding parts of a template. * @return {Element} A DOM element holding the parsed template data. */ get : function(id, view, partials){ // get the content stored in the DOM var template = document.getElementById(id); var inner = template.innerHTML; // apply the view inner = this.render(inner, view, partials); // special case for text only conversion if(inner.search(/<|>/) === -1){ return document.createTextNode(inner); }; // create a helper to convert the string into DOM nodes var helper = qx.dom.Element.create("div"); helper.innerHTML = inner; return helper.children[0]; } } }); (function(){ /** * Below is the original mustache.js code. Snapshot date is mentioned in * the head of this file. * @lint ignoreUndefined(module) */ /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ /*global define: false*/ var Mustache; /** * @lint ignoreUndefined(module,define) */ (function(exports){ Mustache = exports; }((function(){ var exports = { }; exports.name = "mustache.js"; exports.version = "0.7.0"; exports.tags = ["{{", "}}"]; exports.Scanner = Scanner; exports.Context = Context; exports.Writer = Writer; var whiteRe = /\s*/; var spaceRe = /\s+/; var nonSpaceRe = /\S/; var eqRe = /\s*=/; var curlyRe = /\s*\}/; var tagRe = /#|\^|\/|>|\{|&|=|!/; // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577 // See https://github.com/janl/mustache.js/issues/189 function testRe(re, string){ return RegExp.prototype.test.call(re, string); }; function isWhitespace(string){ return !testRe(nonSpaceRe, string); }; var isArray = Array.isArray || function(obj){ return Object.prototype.toString.call(obj) === "[object Array]"; }; function escapeRe(string){ return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); }; var entityMap = { "&" : "&amp;", "<" : "&lt;", ">" : "&gt;", '"' : '&quot;', "'" : '&#39;', "/" : '&#x2F;' }; function escapeHtml(string){ return String(string).replace(/[&<>"'\/]/g, function(s){ return entityMap[s]; }); }; // Export the escaping function so that the user may override it. // See https://github.com/janl/mustache.js/issues/244 exports.escape = escapeHtml; function Scanner(string){ this.string = string; this.tail = string; this.pos = 0; }; /** * Returns `true` if the tail is empty (end of string). */ Scanner.prototype.eos = function(){ return this.tail === ""; }; /** * Tries to match the given regular expression at the current position. * Returns the matched text if it can match, the empty string otherwise. */ Scanner.prototype.scan = function(re){ var match = this.tail.match(re); if(match && match.index === 0){ this.tail = this.tail.substring(match[0].length); this.pos += match[0].length; return match[0]; }; return ""; }; /** * Skips all text until the given regular expression can be matched. Returns * the skipped string, which is the entire tail if no match can be made. */ Scanner.prototype.scanUntil = function(re){ var match,pos = this.tail.search(re); switch(pos){case -1: match = this.tail; this.pos += this.tail.length; this.tail = ""; break;case 0: match = ""; break;default: match = this.tail.substring(0, pos); this.tail = this.tail.substring(pos); this.pos += pos;}; return match; }; function Context(view, parent){ this.view = view; this.parent = parent; this.clearCache(); }; Context.make = function(view){ return (view instanceof Context) ? view : new Context(view); }; Context.prototype.clearCache = function(){ this._cache = { }; }; Context.prototype.push = function(view){ return new Context(view, this); }; Context.prototype.lookup = function(name){ var value = this._cache[name]; if(!value){ if(name === "."){ value = this.view; } else { var context = this; while(context){ if(name.indexOf(".") > 0){ var names = name.split("."),i = 0; value = context.view; while(value && i < names.length){ value = value[names[i++]]; }; } else { value = context.view[name]; }; if(value != null){ break; }; context = context.parent; }; }; this._cache[name] = value; }; if(typeof value === "function"){ value = value.call(this.view); }; return value; }; function Writer(){ this.clearCache(); }; Writer.prototype.clearCache = function(){ this._cache = { }; this._partialCache = { }; }; Writer.prototype.compile = function(template, tags){ var fn = this._cache[template]; if(!fn){ var tokens = exports.parse(template, tags); fn = this._cache[template] = this.compileTokens(tokens, template); }; return fn; }; Writer.prototype.compilePartial = function(name, template, tags){ var fn = this.compile(template, tags); this._partialCache[name] = fn; return fn; }; Writer.prototype.compileTokens = function(tokens, template){ var fn = compileTokens(tokens); var self = this; return function(view, partials){ if(partials){ if(typeof partials === "function"){ self._loadPartial = partials; } else { for(var name in partials){ self.compilePartial(name, partials[name]); }; }; }; return fn(self, Context.make(view), template); }; }; Writer.prototype.render = function(template, view, partials){ return this.compile(template)(view, partials); }; Writer.prototype._section = function(name, context, text, callback){ var value = context.lookup(name); switch(typeof value){case "object": if(isArray(value)){ var buffer = ""; for(var i = 0,len = value.length;i < len;++i){ buffer += callback(this, context.push(value[i])); }; return buffer; }; return value ? callback(this, context.push(value)) : "";case "function": var self = this; var scopedRender = function(template){ return self.render(template, context); }; return value.call(context.view, text, scopedRender) || "";default: if(value){ return callback(this, context); };}; return ""; }; Writer.prototype._inverted = function(name, context, callback){ var value = context.lookup(name); // Use JavaScript's definition of falsy. Include empty arrays. // See https://github.com/janl/mustache.js/issues/186 if(!value || (isArray(value) && value.length === 0)){ return callback(this, context); }; return ""; }; Writer.prototype._partial = function(name, context){ if(!(name in this._partialCache) && this._loadPartial){ this.compilePartial(name, this._loadPartial(name)); }; var fn = this._partialCache[name]; return fn ? fn(context) : ""; }; Writer.prototype._name = function(name, context){ var value = context.lookup(name); if(typeof value === "function"){ value = value.call(context.view); }; return (value == null) ? "" : String(value); }; Writer.prototype._escaped = function(name, context){ return exports.escape(this._name(name, context)); }; /** * Calculates the bounds of the section represented by the given `token` in * the original template by drilling down into nested sections to find the * last token that is part of that section. Returns an array of [start, end]. */ function sectionBounds(token){ var start = token[3]; var end = start; var tokens; while((tokens = token[4]) && tokens.length){ token = tokens[tokens.length - 1]; end = token[3]; }; return [start, end]; }; /** * Low-level function that compiles the given `tokens` into a function * that accepts three arguments: a Writer, a Context, and the template. */ function compileTokens(tokens){ var subRenders = { }; function subRender(i, tokens, template){ if(!subRenders[i]){ var fn = compileTokens(tokens); subRenders[i] = function(writer, context){ return fn(writer, context, template); }; }; return subRenders[i]; }; return function(writer, context, template){ var buffer = ""; var token,sectionText; for(var i = 0,len = tokens.length;i < len;++i){ token = tokens[i]; switch(token[0]){case "#": sectionText = template.slice.apply(template, sectionBounds(token)); buffer += writer._section(token[1], context, sectionText, subRender(i, token[4], template)); break;case "^": buffer += writer._inverted(token[1], context, subRender(i, token[4], template)); break;case ">": buffer += writer._partial(token[1], context); break;case "&": buffer += writer._name(token[1], context); break;case "name": buffer += writer._escaped(token[1], context); break;case "text": buffer += token[1]; break;}; }; return buffer; }; }; /** * Forms the given array of `tokens` into a nested tree structure where * tokens that represent a section have a fifth item: an array that contains * all tokens in that section. */ function nestTokens(tokens){ var tree = []; var collector = tree; var sections = []; var token,section; for(var i = 0;i < tokens.length;++i){ token = tokens[i]; switch(token[0]){case "#":case "^": token[4] = []; sections.push(token); collector.push(token); collector = token[4]; break;case "/": if(sections.length === 0){ throw new Error("Unopened section: " + token[1]); }; section = sections.pop(); if(section[1] !== token[1]){ throw new Error("Unclosed section: " + section[1]); }; if(sections.length > 0){ collector = sections[sections.length - 1][4]; } else { collector = tree; }; break;default: collector.push(token);}; }; // Make sure there were no open sections when we're done. section = sections.pop(); if(section){ throw new Error("Unclosed section: " + section[1]); }; return tree; }; /** * Combines the values of consecutive text tokens in the given `tokens` array * to a single token. */ function squashTokens(tokens){ var token,lastToken; for(var i = 0;i < tokens.length;++i){ token = tokens[i]; if(lastToken && lastToken[0] === "text" && token[0] === "text"){ lastToken[1] += token[1]; lastToken[3] = token[3]; tokens.splice(i--, 1); } else { lastToken = token; }; }; }; function escapeTags(tags){ if(tags.length !== 2){ throw new Error("Invalid tags: " + tags.join(" ")); }; return [new RegExp(escapeRe(tags[0]) + "\\s*"), new RegExp("\\s*" + escapeRe(tags[1]))]; }; /** * Breaks up the given `template` string into a tree of token objects. If * `tags` is given here it must be an array with two string values: the * opening and closing tags used in the template (e.g. ["<%", "%>"]). Of * course, the default is to use mustaches (i.e. Mustache.tags). */ exports.parse = function(template, tags){ tags = tags || exports.tags; var tagRes = escapeTags(tags); var scanner = new Scanner(template); var tokens = [],// Buffer to hold the tokens spaces = [],// Indices of whitespace tokens on the current line hasTag = false,// Is there a {{tag}} on the current line? nonSpace = false; // Is there a non-space char on the current line? // Strips all whitespace tokens array for the current line // if there was a {{#tag}} on it and otherwise only space. function stripSpace(){ if(hasTag && !nonSpace){ while(spaces.length){ tokens.splice(spaces.pop(), 1); }; } else { spaces = []; }; hasTag = false; nonSpace = false; }; var start,type,value,chr; while(!scanner.eos()){ start = scanner.pos; value = scanner.scanUntil(tagRes[0]); if(value){ for(var i = 0,len = value.length;i < len;++i){ chr = value.charAt(i); if(isWhitespace(chr)){ spaces.push(tokens.length); } else { nonSpace = true; }; tokens.push(["text", chr, start, start + 1]); start += 1; if(chr === "\n"){ stripSpace(); }; }; }; start = scanner.pos; // Match the opening tag. if(!scanner.scan(tagRes[0])){ break; }; hasTag = true; type = scanner.scan(tagRe) || "name"; // Skip any whitespace between tag and value. scanner.scan(whiteRe); // Extract the tag value. if(type === "="){ value = scanner.scanUntil(eqRe); scanner.scan(eqRe); scanner.scanUntil(tagRes[1]); } else if(type === "{"){ var closeRe = new RegExp("\\s*" + escapeRe("}" + tags[1])); value = scanner.scanUntil(closeRe); scanner.scan(curlyRe); scanner.scanUntil(tagRes[1]); type = "&"; } else { value = scanner.scanUntil(tagRes[1]); }; // Match the closing tag. if(!scanner.scan(tagRes[1])){ throw new Error("Unclosed tag at " + scanner.pos); }; tokens.push([type, value, start, scanner.pos]); if(type === "name" || type === "{" || type === "&"){ nonSpace = true; }; // Set the tags for the next time around. if(type === "="){ tags = value.split(spaceRe); tagRes = escapeTags(tags); }; }; squashTokens(tokens); return nestTokens(tokens); }; // The high-level clearCache, compile, compilePartial, and render functions // use this default writer. var _writer = new Writer(); /** * Clears all cached templates and partials in the default writer. */ exports.clearCache = function(){ return _writer.clearCache(); }; /** * Compiles the given `template` to a reusable function using the default * writer. */ exports.compile = function(template, tags){ return _writer.compile(template, tags); }; /** * Compiles the partial with the given `name` and `template` to a reusable * function using the default writer. */ exports.compilePartial = function(name, template, tags){ return _writer.compilePartial(name, template, tags); }; /** * Compiles the given array of tokens (the output of a parse) to a reusable * function using the default writer. */ exports.compileTokens = function(tokens, template){ return _writer.compileTokens(tokens, template); }; /** * Renders the `template` with the given `view` and `partials` using the * default writer. */ exports.render = function(template, view, partials){ return _writer.render(template, view, partials); }; // This is here for backwards compatibility with 0.4.x. exports.to_html = function(template, view, partials, send){ var result = exports.render(template, view, partials); if(typeof send === "function"){ send(result); } else { return result; }; }; return exports; }()))); /** * Above is the original mustache code. */ // EXPOSE qooxdoo variant qx.bom.Template.version = Mustache.version; qx.bom.Template.render = Mustache.render; })(); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) ************************************************************************ */ /** * Orientation handler which is responsible for registering and unregistering a * {@link qx.event.handler.OrientationCore} handler for each given element. */ qx.Bootstrap.define("qx.module.event.OrientationHandler", { statics : { /** * List of events that require an orientation handler * @type {Array} */ TYPES : ["orientationchange"], /** * Creates an orientation handler for the given window when an * orientationchange event listener is attached to it * * @param element {Window} DOM Window */ register : function(element){ if(!qx.dom.Node.isWindow(element)){ throw new Error("The 'orientationchange' event is only available on window objects!"); }; if(!element.__orientationHandler){ if(!element.__emitter){ element.__emitter = new qx.event.Emitter(); }; element.__orientationHandler = new qx.event.handler.OrientationCore(element, element.__emitter); }; }, /** * Removes the orientation event handler from the element if there are no more * orientationchange event listeners attached to it * @param element {Element} DOM element */ unregister : function(element){ if(element.__orientationHandler){ if(!element.__emitter){ element.__orientationHandler = null; } else { var hasListener = false; var listeners = element.__emitter.getListeners(); qx.module.event.OrientationHandler.TYPES.forEach(function(type){ if(type in listeners && listeners[type].length > 0){ hasListener = true; }; }); if(!hasListener){ element.__orientationHandler = null; }; }; }; } }, defer : function(statics){ qxWeb.$registerEventHook(statics.TYPES, statics.register, statics.unregister); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tino Butz (tbtz) * Daniel Wagner (danielwagner) ====================================================================== This class contains code based on the following work: * Unify Project Homepage: http://unify-project.org Copyright: 2009-2010 Deutsche Telekom AG, Germany, http://telekom.com License: MIT: http://www.opensource.org/licenses/mit-license.php ************************************************************************ */ /** * Listens for native orientation change events */ qx.Bootstrap.define("qx.event.handler.OrientationCore", { extend : Object, /** * * @param targetWindow {Window} DOM window object * @param emitter {qx.event.Emitter} Event emitter object */ construct : function(targetWindow, emitter){ this._window = targetWindow || window; this.__emitter = emitter; this._initObserver(); }, members : { __emitter : null, _window : null, _currentOrientation : null, __onNativeWrapper : null, __nativeEventType : null, /* --------------------------------------------------------------------------- OBSERVER INIT --------------------------------------------------------------------------- */ /** * Initializes the native orientation change event listeners. */ _initObserver : function(){ this.__onNativeWrapper = qx.lang.Function.listener(this._onNative, this); // Handle orientation change event for Android devices by the resize event. // See http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript // for more information. this.__nativeEventType = qx.bom.Event.supportsEvent(this._window, "orientationchange") ? "orientationchange" : "resize"; qx.bom.Event.addNativeListener(this._window, this.__nativeEventType, this.__onNativeWrapper); }, /* --------------------------------------------------------------------------- OBSERVER STOP --------------------------------------------------------------------------- */ /** * Disconnects the native orientation change event listeners. */ _stopObserver : function(){ qx.bom.Event.removeNativeListener(this._window, this.__nativeEventType, this.__onNativeWrapper); }, /* --------------------------------------------------------------------------- NATIVE EVENT OBSERVERS --------------------------------------------------------------------------- */ /** * Handler for the native orientation change event. * * @signature function(domEvent) * @param domEvent {Event} The touch event from the browser. */ _onNative : function(domEvent){ var orientation = qx.bom.Viewport.getOrientation(); if(this._currentOrientation != orientation){ this._currentOrientation = orientation; var mode = qx.bom.Viewport.isLandscape() ? "landscape" : "portrait"; domEvent._orientation = orientation; domEvent._mode = mode; if(this.__emitter){ this.__emitter.emit("orientationchange", domEvent); }; }; } }, /* ***************************************************************************** DESTRUCTOR ***************************************************************************** */ destruct : function(){ this._stopObserver(); this.__manager = this.__emitter = null; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tristan Koch (tristankoch) ************************************************************************ */ /* ************************************************************************ #ignore(XDomainRequest) #require(qx.bom.request.Xhr#open) #require(qx.bom.request.Xhr#send) #require(qx.bom.request.Xhr#on) #require(qx.bom.request.Xhr#onreadystatechange) #require(qx.bom.request.Xhr#onload) #require(qx.bom.request.Xhr#onloadend) #require(qx.bom.request.Xhr#onerror) #require(qx.bom.request.Xhr#onabort) #require(qx.bom.request.Xhr#ontimeout) #require(qx.bom.request.Xhr#setRequestHeader) #require(qx.bom.request.Xhr#getAllResponseHeaders) #require(qx.bom.request.Xhr#getRequest) ************************************************************************ */ /** * A wrapper of the XMLHttpRequest host object (or equivalent). The interface is * similar to <a href="http://www.w3.org/TR/XMLHttpRequest/">XmlHttpRequest</a>. * * Hides browser inconsistencies and works around bugs found in popular * implementations. * * <div class="desktop"> * Example: * * <pre class="javascript"> * var req = new qx.bom.request.Xhr(); * req.onload = function() { * // Handle data received * req.responseText; * } * * req.open("GET", url); * req.send(); * </pre> * </div> */ qx.Bootstrap.define("qx.bom.request.Xhr", { construct : function(){ this.__onNativeReadyStateChangeBound = qx.Bootstrap.bind(this.__onNativeReadyStateChange, this); this.__onNativeAbortBound = qx.Bootstrap.bind(this.__onNativeAbort, this); this.__onTimeoutBound = qx.Bootstrap.bind(this.__onTimeout, this); this.__initNativeXhr(); this._emitter = new qx.event.Emitter(); // BUGFIX: IE // IE keeps connections alive unless aborted on unload if(window.attachEvent){ this.__onUnloadBound = qx.Bootstrap.bind(this.__onUnload, this); window.attachEvent("onunload", this.__onUnloadBound); }; }, statics : { UNSENT : 0, OPENED : 1, HEADERS_RECEIVED : 2, LOADING : 3, DONE : 4 }, events : { /** Fired at ready state changes. */ "readystatechange" : "qx.bom.request.Xhr", /** Fired on error. */ "error" : "qx.bom.request.Xhr", /** Fired at loadend. */ "loadend" : "qx.bom.request.Xhr", /** Fired on timeouts. */ "timeout" : "qx.bom.request.Xhr", /** Fired when the request is aborted. */ "abort" : "qx.bom.request.Xhr", /** Fired on successful retrieval. */ "load" : "qx.bom.request.Xhr" }, members : { /* --------------------------------------------------------------------------- PUBLIC --------------------------------------------------------------------------- */ /** * {Number} Ready state. * * States can be: * UNSENT: 0, * OPENED: 1, * HEADERS_RECEIVED: 2, * LOADING: 3, * DONE: 4 */ readyState : 0, /** * {String} The response of the request as text. */ responseText : "", /** * {Object} The response of the request as a Document object. */ responseXML : null, /** * {Number} The HTTP status code. */ status : 0, /** * {String} The HTTP status text. */ statusText : "", /** * {Number} Timeout limit in milliseconds. * * 0 (default) means no timeout. Not supported for synchronous requests. */ timeout : 0, /** * Initializes (prepares) request. * * @lint ignoreUndefined(XDomainRequest) * * @param method {String?"GET"} * The HTTP method to use. * @param url {String} * The URL to which to send the request. * @param async {Boolean?true} * Whether or not to perform the operation asynchronously. * @param user {String?null} * Optional user name to use for authentication purposes. * @param password {String?null} * Optional password to use for authentication purposes. */ open : function(method, url, async, user, password){ this.__checkDisposed(); // Mimick native behavior if(typeof url === "undefined"){ throw new Error("Not enough arguments"); } else if(typeof method === "undefined"){ method = "GET"; }; // Reset flags that may have been set on previous request this.__abort = false; this.__send = false; this.__conditional = false; // Store URL for later checks this.__url = url; if(typeof async == "undefined"){ async = true; }; this.__async = async; // BUGFIX // IE < 9 and FF < 3.5 cannot reuse the native XHR to issue many requests if(!this.__supportsManyRequests() && this.readyState > qx.bom.request.Xhr.UNSENT){ // XmlHttpRequest Level 1 requires open() to abort any pending requests // associated to the object. Since we're dealing with a new object here, // we have to emulate this behavior. Moreover, allow old native XHR to be garbage collected // // Dispose and abort. // this.dispose(); // Replace the underlying native XHR with a new one that can // be used to issue new requests. this.__initNativeXhr(); }; // Restore handler in case it was removed before this.__nativeXhr.onreadystatechange = this.__onNativeReadyStateChangeBound; try{ if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Xhr, "Open native request with method: " + method + ", url: " + url + ", async: " + async); }; this.__nativeXhr.open(method, url, async, user, password); } catch(OpenError) { // Only work around exceptions caused by cross domain request attempts if(!qx.util.Request.isCrossDomain(url)){ // Is same origin throw OpenError; }; if(!this.__async){ this.__openError = OpenError; }; if(this.__async){ // Try again with XDomainRequest // (Success case not handled on purpose) // - IE 9 if(window.XDomainRequest){ this.readyState = 4; this.__nativeXhr = new XDomainRequest(); this.__nativeXhr.onerror = qx.Bootstrap.bind(function(){ this._emit("readystatechange"); this._emit("error"); this._emit("loadend"); }, this); if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Xhr, "Retry open native request with method: " + method + ", url: " + url + ", async: " + async); }; this.__nativeXhr.open(method, url, async, user, password); return; }; // Access denied // - IE 6: -2146828218 // - IE 7: -2147024891 // - Legacy Firefox window.setTimeout(qx.Bootstrap.bind(function(){ if(this.__disposed){ return; }; this.readyState = 4; this._emit("readystatechange"); this._emit("error"); this._emit("loadend"); }, this)); }; }; // BUGFIX: IE < 9 // IE < 9 tends to cache overly agressive. This may result in stale // representations. Force validating freshness of cached representation. if(qx.core.Environment.get("engine.name") === "mshtml" && qx.core.Environment.get("browser.documentmode") < 9 && this.__nativeXhr.readyState > 0){ this.__nativeXhr.setRequestHeader("If-Modified-Since", "-1"); }; // BUGFIX: Firefox // Firefox < 4 fails to trigger onreadystatechange OPENED for sync requests if(qx.core.Environment.get("engine.name") === "gecko" && parseInt(qx.core.Environment.get("engine.version"), 10) < 2 && !this.__async){ // Native XHR is already set to readyState DONE. Fake readyState // and call onreadystatechange manually. this.readyState = qx.bom.request.Xhr.OPENED; this._emit("readystatechange"); }; }, /** * Sets an HTTP request header to be used by the request. * * Note: The request must be initialized before using this method. * * @param key {String} * The name of the header whose value is to be set. * @param value {String} * The value to set as the body of the header. * @return {qx.bom.request.Xhr} Self for chaining. */ setRequestHeader : function(key, value){ this.__checkDisposed(); // Detect conditional requests if(key == "If-Match" || key == "If-Modified-Since" || key == "If-None-Match" || key == "If-Range"){ this.__conditional = true; }; this.__nativeXhr.setRequestHeader(key, value); return this; }, /** * Sends request. * * @param data {String|Document?null} * Optional data to send. * @return {qx.bom.request.Xhr} Self for chaining. */ send : function(data){ this.__checkDisposed(); // BUGFIX: IE & Firefox < 3.5 // For sync requests, some browsers throw error on open() // while it should be on send() // if(!this.__async && this.__openError){ throw this.__openError; }; // BUGFIX: Opera // On network error, Opera stalls at readyState HEADERS_RECEIVED // This violates the spec. See here http://www.w3.org/TR/XMLHttpRequest2/#send // (Section: If there is a network error) // // To fix, assume a default timeout of 10 seconds. Note: The "error" // event will be fired correctly, because the error flag is inferred // from the statusText property. Of course, compared to other // browsers there is an additional call to ontimeout(), but this call // should not harm. // if(qx.core.Environment.get("engine.name") === "opera" && this.timeout === 0){ this.timeout = 10000; }; // Timeout if(this.timeout > 0){ this.__timerId = window.setTimeout(this.__onTimeoutBound, this.timeout); }; // BUGFIX: Firefox 2 // "NS_ERROR_XPC_NOT_ENOUGH_ARGS" when calling send() without arguments data = typeof data == "undefined" ? null : data; // Some browsers may throw an error when sending of async request fails. // This violates the spec which states only sync requests should. try{ if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Xhr, "Send native request"); }; this.__nativeXhr.send(data); } catch(SendError) { if(!this.__async){ throw SendError; }; // BUGFIX // Some browsers throws error when file not found via file:// protocol. // Synthesize readyState changes. if(this._getProtocol() === "file:"){ this.readyState = 2; this.__readyStateChange(); var that = this; window.setTimeout(function(){ if(that.__disposed){ return; }; that.readyState = 3; that.__readyStateChange(); that.readyState = 4; that.__readyStateChange(); }); }; }; // BUGFIX: Firefox // Firefox fails to trigger onreadystatechange DONE for sync requests if(qx.core.Environment.get("engine.name") === "gecko" && !this.__async){ // Properties all set, only missing native readystatechange event this.__onNativeReadyStateChange(); }; // Set send flag this.__send = true; return this; }, /** * Abort request. * * Cancels any network activity. * @return {qx.bom.request.Xhr} Self for chaining. */ abort : function(){ this.__checkDisposed(); this.__abort = true; this.__nativeXhr.abort(); if(this.__nativeXhr){ this.readyState = this.__nativeXhr.readyState; }; return this; }, /** * Helper to emit events and call the callback methods. * @param event {String} The name of the event. */ _emit : function(event){ this["on" + event](); this._emitter.emit(event, this); }, /** * Event handler for XHR event that fires at every state change. * * Replace with custom method to get informed about the communication progress. */ onreadystatechange : function(){ }, /** * Event handler for XHR event "load" that is fired on successful retrieval. * * Note: This handler is called even when the HTTP status indicates an error. * * Replace with custom method to listen to the "load" event. */ onload : function(){ }, /** * Event handler for XHR event "loadend" that is fired on retrieval. * * Note: This handler is called even when a network error (or similar) * occurred. * * Replace with custom method to listen to the "loadend" event. */ onloadend : function(){ }, /** * Event handler for XHR event "error" that is fired on a network error. * * Replace with custom method to listen to the "error" event. */ onerror : function(){ }, /** * Event handler for XHR event "abort" that is fired when request * is aborted. * * Replace with custom method to listen to the "abort" event. */ onabort : function(){ }, /** * Event handler for XHR event "timeout" that is fired when timeout * interval has passed. * * Replace with custom method to listen to the "timeout" event. */ ontimeout : function(){ }, /** * Add an event listener for the given event name. * * @param name {String} The name of the event to listen to. * @param listener {Function} The function to execute when the event is fired * @param ctx {var?} The context of the listener. * @return {qx.bom.request.Xhr} Self for chaining. */ on : function(name, listener, ctx){ this._emitter.on(name, listener, ctx); return this; }, /** * Get a single response header from response. * * @param header {String} * Key of the header to get the value from. * @return {String} * Response header. */ getResponseHeader : function(header){ this.__checkDisposed(); return this.__nativeXhr.getResponseHeader(header); }, /** * Get all response headers from response. * * @return {String} All response headers. */ getAllResponseHeaders : function(){ this.__checkDisposed(); return this.__nativeXhr.getAllResponseHeaders(); }, /** * Get wrapped native XMLHttpRequest (or equivalent). * * Can be XMLHttpRequest or ActiveX. * * @return {Object} XMLHttpRequest or equivalent. */ getRequest : function(){ return this.__nativeXhr; }, /* --------------------------------------------------------------------------- HELPER --------------------------------------------------------------------------- */ /** * Dispose object and wrapped native XHR. * @return {Boolean} <code>true</code> if the object was successfully disposed */ dispose : function(){ if(this.__disposed){ return false; }; window.clearTimeout(this.__timerId); // Remove unload listener in IE. Aborting on unload is no longer required // for this instance. if(window.detachEvent){ window.detachEvent("onunload", this.__onUnloadBound); }; // May fail in IE try{ this.__nativeXhr.onreadystatechange; } catch(PropertiesNotAccessable) { return false; }; // Clear out listeners var noop = function(){ }; this.__nativeXhr.onreadystatechange = noop; this.__nativeXhr.onload = noop; this.__nativeXhr.onerror = noop; // Abort any network activity this.abort(); // Remove reference to native XHR this.__nativeXhr = null; this.__disposed = true; return true; }, /* --------------------------------------------------------------------------- PROTECTED --------------------------------------------------------------------------- */ /** * Create XMLHttpRequest (or equivalent). * * @return {Object} XMLHttpRequest or equivalent. */ _createNativeXhr : function(){ var xhr = qx.core.Environment.get("io.xhr"); if(xhr === "xhr"){ return new XMLHttpRequest(); }; if(xhr == "activex"){ return new window.ActiveXObject("Microsoft.XMLHTTP"); }; qx.Bootstrap.error(this, "No XHR support available."); }, /** * Get protocol of requested URL. * * @return {String} The used protocol. */ _getProtocol : function(){ var url = this.__url; var protocolRe = /^(\w+:)\/\//; // Could be http:// from file:// if(url !== null && url.match){ var match = url.match(protocolRe); if(match && match[1]){ return match[1]; }; }; return window.location.protocol; }, /* --------------------------------------------------------------------------- PRIVATE --------------------------------------------------------------------------- */ /** * {Object} XMLHttpRequest or equivalent. */ __nativeXhr : null, /** * {Boolean} Whether request is async. */ __async : null, /** * {Function} Bound __onNativeReadyStateChange handler. */ __onNativeReadyStateChangeBound : null, /** * {Function} Bound __onNativeAbort handler. */ __onNativeAbortBound : null, /** * {Function} Bound __onUnload handler. */ __onUnloadBound : null, /** * {Function} Bound __onTimeout handler. */ __onTimeoutBound : null, /** * {Boolean} Send flag */ __send : null, /** * {String} Requested URL */ __url : null, /** * {Boolean} Abort flag */ __abort : null, /** * {Boolean} Timeout flag */ __timeout : null, /** * {Boolean} Whether object has been disposed. */ __disposed : null, /** * {Number} ID of timeout timer. */ __timerId : null, /** * {Error} Error thrown on open, if any. */ __openError : null, /** * {Boolean} Conditional get flag */ __conditional : null, /** * Init native XHR. */ __initNativeXhr : function(){ // Create native XHR or equivalent and hold reference this.__nativeXhr = this._createNativeXhr(); // Track native ready state changes this.__nativeXhr.onreadystatechange = this.__onNativeReadyStateChangeBound; // Track native abort, when supported if(this.__nativeXhr.onabort){ this.__nativeXhr.onabort = this.__onNativeAbortBound; }; // Reset flags this.__disposed = this.__send = this.__abort = false; }, /** * Track native abort. * * In case the end user cancels the request by other * means than calling abort(). */ __onNativeAbort : function(){ // When the abort that triggered this method was not a result from // calling abort() if(!this.__abort){ this.abort(); }; }, /** * Handle native onreadystatechange. * * Calls user-defined function onreadystatechange on each * state change and syncs the XHR status properties. */ __onNativeReadyStateChange : function(){ var nxhr = this.__nativeXhr,propertiesReadable = true; if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Xhr, "Received native readyState: " + nxhr.readyState); }; // BUGFIX: IE, Firefox // onreadystatechange() is called twice for readyState OPENED. // // Call onreadystatechange only when readyState has changed. if(this.readyState == nxhr.readyState){ return; }; // Sync current readyState this.readyState = nxhr.readyState; // BUGFIX: IE // Superfluous onreadystatechange DONE when aborting OPENED // without send flag if(this.readyState === qx.bom.request.Xhr.DONE && this.__abort && !this.__send){ return; }; // BUGFIX: IE // IE fires onreadystatechange HEADERS_RECEIVED and LOADING when sync // // According to spec, only onreadystatechange OPENED and DONE should // be fired. if(!this.__async && (nxhr.readyState == 2 || nxhr.readyState == 3)){ return; }; // Default values according to spec. this.status = 0; this.statusText = this.responseText = ""; this.responseXML = null; if(this.readyState >= qx.bom.request.Xhr.HEADERS_RECEIVED){ // In some browsers, XHR properties are not readable // while request is in progress. try{ this.status = nxhr.status; this.statusText = nxhr.statusText; this.responseText = nxhr.responseText; this.responseXML = nxhr.responseXML; } catch(XhrPropertiesNotReadable) { propertiesReadable = false; }; if(propertiesReadable){ this.__normalizeStatus(); this.__normalizeResponseXML(); }; }; this.__readyStateChange(); // BUGFIX: IE // Memory leak in XMLHttpRequest (on-page) if(this.readyState == qx.bom.request.Xhr.DONE){ // Allow garbage collecting of native XHR if(nxhr){ nxhr.onreadystatechange = function(){ }; }; }; }, /** * Handle readystatechange. Called internally when readyState is changed. */ __readyStateChange : function(){ var that = this; // Cancel timeout before invoking handlers because they may throw if(this.readyState === qx.bom.request.Xhr.DONE){ // Request determined DONE. Cancel timeout. window.clearTimeout(this.__timerId); }; // BUGFIX: IE // IE < 8 fires LOADING and DONE on open() - before send() - when from cache if(qx.core.Environment.get("engine.name") == "mshtml" && qx.core.Environment.get("browser.documentmode") < 8){ // Detect premature events when async. LOADING and DONE is // illogical to happen before request was sent. if(this.__async && !this.__send && this.readyState >= qx.bom.request.Xhr.LOADING){ if(this.readyState == qx.bom.request.Xhr.LOADING){ // To early to fire, skip. return; }; if(this.readyState == qx.bom.request.Xhr.DONE){ window.setTimeout(function(){ if(that.__disposed){ return; }; // Replay previously skipped that.readyState = 3; that._emit("readystatechange"); that.readyState = 4; that._emit("readystatechange"); that.__readyStateChangeDone(); }); return; }; }; }; // Always fire "readystatechange" this._emit("readystatechange"); if(this.readyState === qx.bom.request.Xhr.DONE){ this.__readyStateChangeDone(); }; }, /** * Handle readystatechange. Called internally by * {@link #__readyStateChange} when readyState is DONE. */ __readyStateChangeDone : function(){ // Fire "timeout" if timeout flag is set if(this.__timeout){ this._emit("timeout"); // BUGFIX: Opera // Since Opera does not fire "error" on network error, fire additional // "error" on timeout (may well be related to network error) if(qx.core.Environment.get("engine.name") === "opera"){ this._emit("error"); }; this.__timeout = false; } else { if(this.__abort){ this._emit("abort"); } else { if(this.__isNetworkError()){ this._emit("error"); } else { this._emit("load"); }; }; }; // Always fire "onloadend" when DONE this._emit("loadend"); }, /** * Check for network error. * * @return {Boolean} Whether a network error occured. */ __isNetworkError : function(){ var error; // Infer the XHR internal error flag from statusText when not aborted. // See http://www.w3.org/TR/XMLHttpRequest2/#error-flag and // http://www.w3.org/TR/XMLHttpRequest2/#the-statustext-attribute // // With file://, statusText is always falsy. Assume network error when // response is empty. if(this._getProtocol() === "file:"){ error = !this.responseText; } else { error = !this.statusText; }; return error; }, /** * Handle faked timeout. */ __onTimeout : function(){ // Basically, mimick http://www.w3.org/TR/XMLHttpRequest2/#timeout-error var nxhr = this.__nativeXhr; this.readyState = qx.bom.request.Xhr.DONE; // Set timeout flag this.__timeout = true; // No longer consider request. Abort. nxhr.abort(); this.responseText = ""; this.responseXML = null; // Signal readystatechange this.__readyStateChange(); }, /** * Normalize status property across browsers. */ __normalizeStatus : function(){ var isDone = this.readyState === qx.bom.request.Xhr.DONE; // BUGFIX: Most browsers // Most browsers tell status 0 when it should be 200 for local files if(this._getProtocol() === "file:" && this.status === 0 && isDone){ if(!this.__isNetworkError()){ this.status = 200; }; }; // BUGFIX: IE // IE sometimes tells 1223 when it should be 204 if(this.status === 1223){ this.status = 204; }; // BUGFIX: Opera // Opera tells 0 for conditional requests when it should be 304 // // Detect response to conditional request that signals fresh cache. if(qx.core.Environment.get("engine.name") === "opera"){ if(isDone && // Done this.__conditional && // Conditional request !this.__abort && // Not aborted this.status === 0){ this.status = 304; }; }; }, /** * Normalize responseXML property across browsers. */ __normalizeResponseXML : function(){ // BUGFIX: IE // IE does not recognize +xml extension, resulting in empty responseXML. // // Check if Content-Type is +xml, verify missing responseXML then parse // responseText as XML. if(qx.core.Environment.get("engine.name") == "mshtml" && (this.getResponseHeader("Content-Type") || "").match(/[^\/]+\/[^\+]+\+xml/) && this.responseXML && !this.responseXML.documentElement){ var dom = new window.ActiveXObject("Microsoft.XMLDOM"); dom.async = false; dom.validateOnParse = false; dom.loadXML(this.responseText); this.responseXML = dom; }; }, /** * Handler for native unload event. */ __onUnload : function(){ try{ // Abort and dispose if(this){ this.dispose(); }; } catch(e) { }; }, /** * Helper method to determine whether browser supports reusing the * same native XHR to send more requests. * @return {Boolean} <code>true</code> if request object reuse is supported */ __supportsManyRequests : function(){ var name = qx.core.Environment.get("engine.name"); var version = qx.core.Environment.get("browser.version"); return !(name == "mshtml" && version < 9 || name == "gecko" && version < 3.5); }, /** * Throw when already disposed. */ __checkDisposed : function(){ if(this.__disposed){ throw new Error("Already disposed"); }; } }, defer : function(){ qx.core.Environment.add("qx.debug.io", false); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tristan Koch (tristankoch) ************************************************************************ */ /** * Static helpers for handling requests. */ qx.Bootstrap.define("qx.util.Request", { statics : { /** * Whether URL given points to resource that is cross-domain, * i.e. not of same origin. * * @param url {String} URL. * @return {Boolean} Whether URL is cross domain. */ isCrossDomain : function(url){ var result = qx.util.Uri.parseUri(url),location = window.location; if(!location){ return false; }; var protocol = location.protocol; // URL is relative in the sence that it points to origin host if(!(url.indexOf("//") !== -1)){ return false; }; if(protocol.substr(0, protocol.length - 1) == result.protocol && location.host === result.host && location.port === result.port){ return false; }; return true; }, /** * Determine if given HTTP status is considered successful. * * @param status {Number} HTTP status. * @return {Boolean} Whether status is considered successful. */ isSuccessful : function(status){ return (status >= 200 && status < 300 || status === 304); }, /** * Request body is ignored for HTTP method GET and HEAD. * * See http://www.w3.org/TR/XMLHttpRequest2/#the-send-method. * * @param method {String} The HTTP method. * @return {Boolean} Whether request may contain body. */ methodAllowsRequestBody : function(method){ return !((/^(GET)|(HEAD)$/).test(method)); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Carsten Lergenmueller (carstenl) * Fabian Jakobs (fbjakobs) * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * Determines browser-dependent information about the transport layer. * * This class is used by {@link qx.core.Environment} and should not be used * directly. Please check its class comment for details how to use it. * * @internal */ qx.Bootstrap.define("qx.bom.client.Transport", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /** * Returns the maximum number of parallel requests the current browser * supports per host addressed. * * Note that this assumes one connection can support one request at a time * only. Technically, this is not correct when pipelining is enabled (which * it currently is only for IE 8 and Opera). In this case, the number * returned will be too low, as one connection supports multiple pipelined * requests. This is accepted for now because pipelining cannot be * detected from JavaScript and because modern browsers have enough * parallel connections already - it's unlikely an app will require more * than 4 parallel XMLHttpRequests to one server at a time. * * @internal * @return {Integer} Maximum number of parallel requests */ getMaxConcurrentRequestCount : function(){ var maxConcurrentRequestCount; // Parse version numbers. var versionParts = qx.bom.client.Engine.getVersion().split("."); var versionMain = 0; var versionMajor = 0; var versionMinor = 0; // Main number if(versionParts[0]){ versionMain = versionParts[0]; }; // Major number if(versionParts[1]){ versionMajor = versionParts[1]; }; // Minor number if(versionParts[2]){ versionMinor = versionParts[2]; }; // IE 8 gives the max number of connections in a property // see http://msdn.microsoft.com/en-us/library/cc197013(VS.85).aspx if(window.maxConnectionsPerServer){ maxConcurrentRequestCount = window.maxConnectionsPerServer; } else if(qx.bom.client.Engine.getName() == "opera"){ // Opera: 8 total // see http://operawiki.info/HttpProtocol maxConcurrentRequestCount = 8; } else if(qx.bom.client.Engine.getName() == "webkit"){ // Safari: 4 // http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/ // Bug #6917: Distinguish Chrome from Safari, Chrome has 6 connections // according to // http://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browser maxConcurrentRequestCount = 4; } else if(qx.bom.client.Engine.getName() == "gecko" && ((versionMain > 1) || ((versionMain == 1) && (versionMajor > 9)) || ((versionMain == 1) && (versionMajor == 9) && (versionMinor >= 1)))){ // FF 3.5 (== Gecko 1.9.1): 6 Connections. // see http://gemal.dk/blog/2008/03/18/firefox_3_beta_5_will_have_improved_connection_parallelism/ maxConcurrentRequestCount = 6; } else { // Default is 2, as demanded by RFC 2616 // see http://blogs.msdn.com/ie/archive/2005/04/11/407189.aspx maxConcurrentRequestCount = 2; };;; return maxConcurrentRequestCount; }, /** * Checks whether the app is loaded with SSL enabled which means via https. * * @internal * @return {Boolean} <code>true</code>, if the app runs on https */ getSsl : function(){ return window.location.protocol === "https:"; }, /** * Checks what kind of XMLHttpRequest object the browser supports * for the current protocol, if any. * * The standard XMLHttpRequest is preferred over ActiveX XMLHTTP. * * @internal * @return {String} * <code>"xhr"</code>, if the browser provides standard XMLHttpRequest.<br/> * <code>"activex"</code>, if the browser provides ActiveX XMLHTTP.<br/> * <code>""</code>, if there is not XHR support at all. */ getXmlHttpRequest : function(){ // Standard XHR can be disabled in IE's security settings, // therefore provide ActiveX as fallback. Additionaly, // standard XHR in IE7 is broken for file protocol. var supports = window.ActiveXObject ? (function(){ if(window.location.protocol !== "file:"){ try{ new window.XMLHttpRequest(); return "xhr"; } catch(noXhr) { }; }; try{ new window.ActiveXObject("Microsoft.XMLHTTP"); return "activex"; } catch(noActiveX) { }; })() : (function(){ try{ new window.XMLHttpRequest(); return "xhr"; } catch(noXhr) { }; })(); return supports || ""; } }, defer : function(statics){ qx.core.Environment.add("io.maxrequests", statics.getMaxConcurrentRequestCount); qx.core.Environment.add("io.ssl", statics.getSsl); qx.core.Environment.add("io.xhr", statics.getXmlHttpRequest); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.request.Xhr#open) ************************************************************************ */ /** * This module provides basic IO functionality. It contains three ways to load * data: * * * XMLHttpRequest: {@link #xhr} * * Script tag: {@link #script} * * Script tag using JSONP: {@link #jsonp} */ qx.Bootstrap.define("qx.module.Io", { statics : { /** * Returns a configured XMLHttpRequest object. Using the send method will * finally send the request. * * @param url {String} Mandatory URL to load the data from. * @param settings {Map?} Optional settings map which may contain one of * the following settings: * * * <code>method</code> The method of the request. Default: <pre>GET</pre> * * <code>async</code> flag to mark the request as asynchronous. Default: <pre>true</pre> * * <code>header</code> A map of request headers. * * @attachStatic {qxWeb, io.xhr} * @return {qx.bom.request.Xhr} The request object. */ xhr : function(url, settings){ if(!settings){ settings = { }; }; var xhr = new qx.bom.request.Xhr(); xhr.open(settings.method, url, settings.async); if(settings.header){ var header = settings.header; for(var key in header){ xhr.setRequestHeader(key, header[key]); }; }; return xhr; }, /** * Returns a predefined script tag wrapper which can be used to load data * from cross-domain origins. * * @param url {String} Mandatory URL to load the data from. * @attachStatic {qxWeb, io.script} * @return {qx.bom.request.Script} The request object. */ script : function(url){ var script = new qx.bom.request.Script(); script.open("get", url); return script; }, /** * Returns a predefined script tag wrapper which can be used to load data * from cross-domain origins via JSONP. * * @param url {String} Mandatory URL to load the data from. * @param settings {Map?} Optional settings map which may contain one of * the following settings: * * * <code>callbackName</code>: The name of the callback which will * be called by the loaded script. * * <code>callbackParam</code>: The name of the callback expected by the server * @attachStatic {qxWeb, io.jsonp} * @return {qx.bom.request.Jsonp} The request object. */ jsonp : function(url, settings){ var script = new qx.bom.request.Jsonp(); if(settings && settings.callbackName){ script.setCallbackName(settings.callbackName); }; if(settings && settings.callbackParam){ script.setCallbackParam(settings.callbackParam); }; script.setPrefix("qxWeb.$$"); // needed in case no callback name is given script.open("get", url); return script; } }, defer : function(statics){ qxWeb.$attachStatic({ io : { xhr : statics.xhr, script : statics.script, jsonp : statics.jsonp } }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tristan Koch (tristankoch) ************************************************************************ */ /** * Script loader with interface similar to * <a href="http://www.w3.org/TR/XMLHttpRequest/">XmlHttpRequest</a>. * * The script loader can be used to load scripts from arbitrary sources. * <span class="desktop"> * For JSONP requests, consider the {@link qx.bom.request.Jsonp} transport * that derives from the script loader. * </span> * * <div class="desktop"> * Example: * * <pre class="javascript"> * var req = new qx.bom.request.Script(); * req.onload = function() { * // Script is loaded and parsed and * // globals set are available * } * * req.open("GET", url); * req.send(); * </pre> * </div> */ /* ************************************************************************ #ignore(qx.core.Environment) #require(qx.bom.request.Script#_success) #require(qx.bom.request.Script#abort) #require(qx.bom.request.Script#dispose) #require(qx.bom.request.Script#getAllResponseHeaders) #require(qx.bom.request.Script#getResponseHeader) #require(qx.bom.request.Script#setDetermineSuccess) #require(qx.bom.request.Script#setRequestHeader) ************************************************************************ */ qx.Bootstrap.define("qx.bom.request.Script", { construct : function(){ this.__initXhrProperties(); this.__onNativeLoadBound = qx.Bootstrap.bind(this._onNativeLoad, this); this.__onNativeErrorBound = qx.Bootstrap.bind(this._onNativeError, this); this.__onTimeoutBound = qx.Bootstrap.bind(this._onTimeout, this); this.__headElement = document.head || document.getElementsByTagName("head")[0] || document.documentElement; this._emitter = new qx.event.Emitter(); // BUGFIX: Browsers not supporting error handler // Set default timeout to capture network errors // // Note: The script is parsed and executed, before a "load" is fired. this.timeout = this.__supportsErrorHandler() ? 0 : 15000; }, events : { /** Fired at ready state changes. */ "readystatechange" : "qx.bom.request.Script", /** Fired on error. */ "error" : "qx.bom.request.Script", /** Fired at loadend. */ "loadend" : "qx.bom.request.Script", /** Fired on timeouts. */ "timeout" : "qx.bom.request.Script", /** Fired when the request is aborted. */ "abort" : "qx.bom.request.Script", /** Fired on successful retrieval. */ "load" : "qx.bom.request.Script" }, members : { /** * {Number} Ready state. * * States can be: * UNSENT: 0, * OPENED: 1, * LOADING: 2, * LOADING: 3, * DONE: 4 * * Contrary to {@link qx.bom.request.Xhr#readyState}, the script transport * does not receive response headers. For compatibility, another LOADING * state is implemented that replaces the HEADERS_RECEIVED state. */ readyState : null, /** * {Number} The status code. * * Note: The script transport cannot determine the HTTP status code. */ status : null, /** * {String} The status text. * * The script transport does not receive response headers. For compatibility, * the statusText property is set to the status casted to string. */ statusText : null, /** * {Number} Timeout limit in milliseconds. * * 0 (default) means no timeout. */ timeout : null, /** * {Function} Function that is executed once the script was loaded. */ __determineSuccess : null, /** * Add an event listener for the given event name. * * @param name {String} The name of the event to listen to. * @param listener {Function} The function to execute when the event is fired * @param ctx {var?} The context of the listener. * @return {qx.bom.request.Script} Self for chaining. */ on : function(name, listener, ctx){ this._emitter.on(name, listener, ctx); return this; }, /** * Initializes (prepares) request. * * @param method {String} * The HTTP method to use. * This parameter exists for compatibility reasons. The script transport * does not support methods other than GET. * @param url {String} * The URL to which to send the request. */ open : function(method, url){ if(this.__disposed){ return; }; // Reset XHR properties that may have been set by previous request this.__initXhrProperties(); this.__abort = null; this.__url = url; if(this.__environmentGet("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Script, "Open native request with " + "url: " + url); }; this._readyStateChange(1); }, /** * Appends a query parameter to URL. * * This method exists for compatibility reasons. The script transport * does not support request headers. However, many services parse query * parameters like request headers. * * Note: The request must be initialized before using this method. * * @param key {String} * The name of the header whose value is to be set. * @param value {String} * The value to set as the body of the header. * @return {qx.bom.request.Script} Self for chaining. */ setRequestHeader : function(key, value){ if(this.__disposed){ return null; }; var param = { }; if(this.readyState !== 1){ throw new Error("Invalid state"); }; param[key] = value; this.__url = qx.util.Uri.appendParamsToUrl(this.__url, param); return this; }, /** * Sends request. * @return {qx.bom.request.Script} Self for chaining. */ send : function(){ if(this.__disposed){ return null; }; var script = this.__createScriptElement(),head = this.__headElement,that = this; if(this.timeout > 0){ this.__timeoutId = window.setTimeout(this.__onTimeoutBound, this.timeout); }; if(this.__environmentGet("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Script, "Send native request"); }; // Attach script to DOM head.insertBefore(script, head.firstChild); // The resource is loaded once the script is in DOM. // Assume HEADERS_RECEIVED and LOADING and dispatch async. window.setTimeout(function(){ that._readyStateChange(2); that._readyStateChange(3); }); return this; }, /** * Aborts request. * @return {qx.bom.request.Script} Self for chaining. */ abort : function(){ if(this.__disposed){ return null; }; this.__abort = true; this.__disposeScriptElement(); this._emit("abort"); return this; }, /** * Helper to emit events and call the callback methods. * @param event {String} The name of the event. */ _emit : function(event){ this["on" + event](); this._emitter.emit(event, this); }, /** * Event handler for an event that fires at every state change. * * Replace with custom method to get informed about the communication progress. */ onreadystatechange : function(){ }, /** * Event handler for XHR event "load" that is fired on successful retrieval. * * Note: This handler is called even when an invalid script is returned. * * Warning: Internet Explorer < 9 receives a false "load" for invalid URLs. * This "load" is fired about 2 seconds after sending the request. To * distinguish from a real "load", consider defining a custom check * function using {@link #setDetermineSuccess} and query the status * property. However, the script loaded needs to have a known impact on * the global namespace. If this does not work for you, you may be able * to set a timeout lower than 2 seconds, depending on script size, * complexity and execution time. * * Replace with custom method to listen to the "load" event. */ onload : function(){ }, /** * Event handler for XHR event "loadend" that is fired on retrieval. * * Note: This handler is called even when a network error (or similar) * occurred. * * Replace with custom method to listen to the "loadend" event. */ onloadend : function(){ }, /** * Event handler for XHR event "error" that is fired on a network error. * * Note: Some browsers do not support the "error" event. * * Replace with custom method to listen to the "error" event. */ onerror : function(){ }, /** * Event handler for XHR event "abort" that is fired when request * is aborted. * * Replace with custom method to listen to the "abort" event. */ onabort : function(){ }, /** * Event handler for XHR event "timeout" that is fired when timeout * interval has passed. * * Replace with custom method to listen to the "timeout" event. */ ontimeout : function(){ }, /** * Get a single response header from response. * * Note: This method exists for compatibility reasons. The script * transport does not receive response headers. * * @param key {String} * Key of the header to get the value from. * @return {String|null} Warning message or <code>null</code> if the request * is disposed */ getResponseHeader : function(key){ if(this.__disposed){ return null; }; if(this.__environmentGet("qx.debug")){ qx.Bootstrap.debug("Response header cannot be determined for " + "requests made with script transport."); }; return "unknown"; }, /** * Get all response headers from response. * * Note: This method exists for compatibility reasons. The script * transport does not receive response headers. * @return {String|null} Warning message or <code>null</code> if the request * is disposed */ getAllResponseHeaders : function(){ if(this.__disposed){ return null; }; if(this.__environmentGet("qx.debug")){ qx.Bootstrap.debug("Response headers cannot be determined for" + "requests made with script transport."); }; return "Unknown response headers"; }, /** * Determine if loaded script has expected impact on global namespace. * * The function is called once the script was loaded and must return a * boolean indicating if the response is to be considered successful. * * @param check {Function} Function executed once the script was loaded. * */ setDetermineSuccess : function(check){ this.__determineSuccess = check; }, /** * Dispose object. */ dispose : function(){ var script = this.__scriptElement; if(!this.__disposed){ // Prevent memory leaks if(script){ script.onload = script.onreadystatechange = null; this.__disposeScriptElement(); }; if(this.__timeoutId){ window.clearTimeout(this.__timeoutId); }; this.__disposed = true; }; }, /* --------------------------------------------------------------------------- PROTECTED --------------------------------------------------------------------------- */ /** * Get URL of request. * * @return {String} URL of request. */ _getUrl : function(){ return this.__url; }, /** * Get script element used for request. * * @return {Element} Script element. */ _getScriptElement : function(){ return this.__scriptElement; }, /** * Handle timeout. */ _onTimeout : function(){ this.__failure(); if(!this.__supportsErrorHandler()){ this._emit("error"); }; this._emit("timeout"); if(!this.__supportsErrorHandler()){ this._emit("loadend"); }; }, /** * Handle native load. */ _onNativeLoad : function(){ var script = this.__scriptElement,determineSuccess = this.__determineSuccess,that = this; // Aborted request must not fire load if(this.__abort){ return; }; // BUGFIX: IE < 9 // When handling "readystatechange" event, skip if readyState // does not signal loaded script if(this.__environmentGet("engine.name") === "mshtml" && this.__environmentGet("browser.documentmode") < 9){ if(!(/loaded|complete/).test(script.readyState)){ return; } else { if(this.__environmentGet("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Script, "Received native readyState: loaded"); }; }; }; if(this.__environmentGet("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Script, "Received native load"); }; // Determine status by calling user-provided check function if(determineSuccess){ // Status set before has higher precedence if(!this.status){ this.status = determineSuccess() ? 200 : 500; }; }; if(this.status === 500){ if(this.__environmentGet("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Script, "Detected error"); }; }; if(this.__timeoutId){ window.clearTimeout(this.__timeoutId); }; window.setTimeout(function(){ that._success(); that._readyStateChange(4); that._emit("load"); that._emit("loadend"); }); }, /** * Handle native error. */ _onNativeError : function(){ this.__failure(); this._emit("error"); this._emit("loadend"); }, /* --------------------------------------------------------------------------- PRIVATE --------------------------------------------------------------------------- */ /** * {Element} Script element */ __scriptElement : null, /** * {Element} Head element */ __headElement : null, /** * {String} URL */ __url : "", /** * {Function} Bound _onNativeLoad handler. */ __onNativeLoadBound : null, /** * {Function} Bound _onNativeError handler. */ __onNativeErrorBound : null, /** * {Function} Bound _onTimeout handler. */ __onTimeoutBound : null, /** * {Number} Timeout timer iD. */ __timeoutId : null, /** * {Boolean} Whether request was aborted. */ __abort : null, /** * {Boolean} Whether request was disposed. */ __disposed : null, /* --------------------------------------------------------------------------- HELPER --------------------------------------------------------------------------- */ /** * Initialize properties. */ __initXhrProperties : function(){ this.readyState = 0; this.status = 0; this.statusText = ""; }, /** * Change readyState. * * @param readyState {Number} The desired readyState */ _readyStateChange : function(readyState){ this.readyState = readyState; this._emit("readystatechange"); }, /** * Handle success. */ _success : function(){ this.__disposeScriptElement(); this.readyState = 4; // By default, load is considered successful if(!this.status){ this.status = 200; }; this.statusText = "" + this.status; }, /** * Handle failure. */ __failure : function(){ this.__disposeScriptElement(); this.readyState = 4; this.status = 0; this.statusText = null; }, /** * Looks up whether browser supports error handler. * * @return {Boolean} Whether browser supports error handler. */ __supportsErrorHandler : function(){ var isLegacyIe = this.__environmentGet("engine.name") === "mshtml" && this.__environmentGet("browser.documentmode") < 9; var isOpera = this.__environmentGet("engine.name") === "opera"; return !(isLegacyIe || isOpera); }, /** * Create and configure script element. * * @return {Element} Configured script element. */ __createScriptElement : function(){ var script = this.__scriptElement = document.createElement("script"); script.src = this.__url; script.onerror = this.__onNativeErrorBound; script.onload = this.__onNativeLoadBound; // BUGFIX: IE < 9 // Legacy IEs do not fire the "load" event for script elements. // Instead, they support the "readystatechange" event if(this.__environmentGet("engine.name") === "mshtml" && this.__environmentGet("browser.documentmode") < 9){ script.onreadystatechange = this.__onNativeLoadBound; }; return script; }, /** * Remove script element from DOM. */ __disposeScriptElement : function(){ var script = this.__scriptElement; if(script && script.parentNode){ this.__headElement.removeChild(script); }; }, /** * Proxy Environment.get to guard against env not being present yet. * * @param key {String} Environment key. * @return {var} Value of the queried environment key * @lint environmentNonLiteralKey(key) */ __environmentGet : function(key){ if(qx && qx.core && qx.core.Environment){ return qx.core.Environment.get(key); } else { if(key === "engine.name"){ return qx.bom.client.Engine.getName(); }; if(key === "browser.documentmode"){ return qx.bom.client.Browser.getDocumentMode(); }; if(key == "qx.debug.io"){ return false; }; throw new Error("Unknown environment key at this phase"); }; } }, defer : function(){ if(qx && qx.core && qx.core.Environment){ qx.core.Environment.add("qx.debug.io", false); }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Tristan Koch (tristankoch) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.request.Script#open) #require(qx.bom.request.Script#on) #require(qx.bom.request.Script#onreadystatechange) #require(qx.bom.request.Script#onload) #require(qx.bom.request.Script#onloadend) #require(qx.bom.request.Script#onerror) #require(qx.bom.request.Script#onabort) #require(qx.bom.request.Script#ontimeout) #require(qx.bom.request.Script#send) ************************************************************************ */ /** * A special script loader handling JSONP responses. Automatically * provides callbacks and populates responseJson property. * * Example: * * <pre class="javascript"> * var req = new qx.bom.request.Jsonp(); * * // Some services have a fixed callback name * // req.setCallbackName("callback"); * * req.onload = function() { * // Handle data received * req.responseJson; * } * * req.open("GET", url); * req.send(); * </pre> */ qx.Bootstrap.define("qx.bom.request.Jsonp", { extend : qx.bom.request.Script, construct : function(){ // Borrow super-class constructor qx.bom.request.Script.apply(this); this.__generateId(); }, members : { /** * {Object} Parsed JSON response. */ responseJson : null, /** * {Number} Identifier of this instance. */ __id : null, /** * {String} Callback parameter. */ __callbackParam : null, /** * {String} Callback name. */ __callbackName : null, /** * {Boolean} Whether callback was called. */ __callbackCalled : null, /** * {Boolean} Whether a custom callback was created automatically. */ __customCallbackCreated : null, /** * {Boolean} Whether request was disposed. */ __disposed : null, /** Prefix used for the internal callback name. */ __prefix : "", /** * Initializes (prepares) request. * * @param method {String} * The HTTP method to use. * This parameter exists for compatibility reasons. The script transport * does not support methods other than GET. * @param url {String} * The URL to which to send the request. */ open : function(method, url){ if(this.__disposed){ return; }; var query = { },callbackParam,callbackName,that = this; // Reset properties that may have been set by previous request this.responseJson = null; this.__callbackCalled = false; callbackParam = this.__callbackParam || "callback"; callbackName = this.__callbackName || this.__prefix + "qx.bom.request.Jsonp[" + this.__id + "].callback"; // Default callback if(!this.__callbackName){ // Store globally available reference to this object this.constructor[this.__id] = this; } else { // Dynamically create globally available callback (if it does not // exist yet) with user defined name. Delegate to this object’s // callback method. if(!window[this.__callbackName]){ this.__customCallbackCreated = true; window[this.__callbackName] = function(data){ that.callback(data); }; } else { if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Jsonp, "Callback " + this.__callbackName + " already exists"); }; }; }; if(qx.core.Environment.get("qx.debug.io")){ qx.Bootstrap.debug(qx.bom.request.Jsonp, "Expecting JavaScript response to call: " + callbackName); }; query[callbackParam] = callbackName; url = qx.util.Uri.appendParamsToUrl(url, query); this.__callBase("open", [method, url]); }, /** * Callback provided for JSONP response to pass data. * * Called internally to populate responseJson property * and indicate successful status. * * Note: If you write a custom callback you’ll need to call * this method in order to notify the request about the data * loaded. Writing a custom callback should not be necessary * in most cases. * * @param data {Object} JSON */ callback : function(data){ if(this.__disposed){ return; }; // Signal callback was called this.__callbackCalled = true; { }; // Set response this.responseJson = data; // Delete global reference to this this.constructor[this.__id] = undefined; this.__deleteCustomCallback(); }, /** * Set callback parameter. * * Some JSONP services expect the callback name to be passed labeled with a * special URL parameter key, e.g. "jsonp" in "?jsonp=myCallback". The * default is "callback". * * @param param {String} Name of the callback parameter. * @return {qx.bom.request.Jsonp} Self reference for chaining. */ setCallbackParam : function(param){ this.__callbackParam = param; return this; }, /** * Set callback name. * * Must be set to the name of the callback function that is called by the * script returned from the JSONP service. By default, the callback name * references this instance’s {@link #callback} method, allowing to connect * multiple JSONP responses to different requests. * * If the JSONP service allows to set custom callback names, it should not * be necessary to change the default. However, some services use a fixed * callback name. This is when setting the callbackName is useful. A * function is created and made available globally under the given name. * The function receives the JSON data and dispatches it to this instance’s * {@link #callback} method. Please note that this function is only created * if it does not exist before. * * @param name {String} Name of the callback function. * @return {qx.bom.request.Jsonp} Self reference for chaining. */ setCallbackName : function(name){ this.__callbackName = name; return this; }, /** * Set the prefix used in front of 'qx.' in case 'qx' is not available * (for qx.Website e.g.) * @internal * @param prefix {String} The prefix to put in front of 'qx' */ setPrefix : function(prefix){ this.__prefix = prefix; }, dispose : function(){ // In case callback was not called this.__deleteCustomCallback(); this.__callBase("dispose"); }, /** * Handle native load. */ _onNativeLoad : function(){ // Indicate erroneous status (500) if callback was not called. // // Why 500? 5xx belongs to the range of server errors. If the callback was // not called, it is assumed the server failed to provide an appropriate // response. Since the exact reason of the error is unknown, the most // generic message ("500 Internal Server Error") is chosen. this.status = this.__callbackCalled ? 200 : 500; this.__callBase("_onNativeLoad"); }, /** * Delete custom callback if dynamically created before. */ __deleteCustomCallback : function(){ if(this.__customCallbackCreated && window[this.__callbackName]){ window[this.__callbackName] = undefined; this.__customCallbackCreated = false; }; }, /** * Call overriden method. * * @param method {String} Name of the overriden method. * @param args {Array} Arguments. */ __callBase : function(method, args){ qx.bom.request.Script.prototype[method].apply(this, args || []); }, /** * Generate ID. */ __generateId : function(){ // Add random digits to date to allow immediately following requests // that may be send at the same time this.__id = (new Date().valueOf()) + ("" + Math.random()).substring(2, 5); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Environment) #require(qx.module.Manipulating) #require(qx.module.Traversing) #require(qx.module.Css) #require(qx.module.Attribute) ************************************************************************ */ /** * Provides a way to block elements so they will no longer receive (native) * events by overlaying them with a div. * For Internet Explorer, an additional Iframe element will be overlayed since * native form controls cannot be blocked otherwise. * * The blocker can also be applied to the entire document, e.g.: * * <pre class="javascript"> * q(document).block(); * </pre> */ qxWeb.define("qx.module.Blocker", { statics : { /** * Attaches a blocker div (and additionally a blocker Iframe for IE) to the * given element. * * @param item {Element|Document} The element to be overlaid with the blocker * @param color {String} The color for the blocker element (any CSS color value) * @param opacity {Number} The CSS opacity value for the blocker * @param zIndex {Number} The zIndex value for the blocker */ __attachBlocker : function(item, color, opacity, zIndex){ var win = qxWeb.getWindow(item); var isDocument = qxWeb.isDocument(item); if(!item.__blocker){ item.__blocker = { div : qxWeb.create("<div/>") }; if((qxWeb.env.get("engine.name") == "mshtml")){ item.__blocker.iframe = qx.module.Blocker.__getIframeElement(win); }; }; qx.module.Blocker.__styleBlocker(item, color, opacity, zIndex, isDocument); item.__blocker.div.appendTo(win.document.body); if(item.__blocker.iframe){ item.__blocker.iframe.appendTo(win.document.body); }; if(isDocument){ qxWeb(win).on("resize", qx.module.Blocker.__onWindowResize); }; }, /** * Styles the blocker element(s) * * @param item {Element|Document} The element to be overlaid with the blocker * @param color {String} The color for the blocker element (any CSS color value) * @param opacity {Number} The CSS opacity value for the blocker * @param zIndex {Number} The zIndex value for the blocker * @param isDocument {Boolean} Whether the item is a document node */ __styleBlocker : function(item, color, opacity, zIndex, isDocument){ var qItem = qxWeb(item); var styles = { "zIndex" : zIndex, "display" : "block", "position" : "absolute", "backgroundColor" : color, "opacity" : opacity, "width" : qItem.getWidth() + "px", "height" : qItem.getHeight() + "px" }; if(isDocument){ styles.top = 0 + "px"; styles.left = 0 + "px"; } else { var pos = qItem.getOffset(); styles.top = pos.top + "px"; styles.left = pos.left + "px"; }; item.__blocker.div.setStyles(styles); if(item.__blocker.iframe){ styles.zIndex = styles.zIndex - 1; styles.backgroundColor = "transparent"; styles.opacity = 0; item.__blocker.iframe.setStyles(styles); }; }, /** * Creates an iframe element used as a blocker in IE * * @param win {Window} The parent window of the item to be blocked * @return {Element} Iframe blocker */ __getIframeElement : function(win){ var iframe = qxWeb.create('<iframe></iframe>'); iframe.setAttributes({ frameBorder : 0, frameSpacing : 0, marginWidth : 0, marginHeight : 0, hspace : 0, vspace : 0, border : 0, allowTransparency : false, src : "javascript:false" }); return iframe; }, /** * Callback for the Window's resize event. Applies the window's new sizes * to the blocker element(s). * * @param ev {Event} resize event */ __onWindowResize : function(ev){ var win = this[0]; var size = { width : this.getWidth() + "px", height : this.getHeight() + "px" }; qxWeb(win.document.__blocker.div).setStyles(size); if(win.document.__blocker.iframe){ qxWeb(win.document.__blocker.iframe).setStyles(size); }; }, /** * Removes the given item's blocker element(s) from the DOM * * @param item {Element} Blocked element * @param index {Number} index of the item in the collection */ __detachBlocker : function(item, index){ if(!item.__blocker){ return; }; item.__blocker.div.remove(); if(item.__blocker.iframe){ item.__blocker.iframe.remove(); }; if(qxWeb.isDocument(item)){ qxWeb(qxWeb.getWindow(item)).off("resize", qx.module.Blocker.__onWindowResize); }; }, /** * Adds an overlay to all items in the collection that intercepts mouse * events. * * @attach {qxWeb} * @param color {String ? transparent} The color for the blocker element (any CSS color value) * @param opacity {Float ? 0} The CSS opacity value for the blocker * @param zIndex {Number ? 10000} The zIndex value for the blocker * @return {qxWeb} The collection for chaining */ block : function(color, opacity, zIndex){ if(!this[0]){ return this; }; color = color || "transparent"; opacity = opacity || 0; zIndex = zIndex || 10000; this.forEach(function(item, index){ qx.module.Blocker.__attachBlocker(item, color, opacity, zIndex); }); return this; }, /** * Removes the blockers from all items in the collection * * @attach {qxWeb} * @return {qxWeb} The collection for chaining */ unblock : function(){ if(!this[0]){ return this; }; this.forEach(qx.module.Blocker.__detachBlocker); return this; } }, defer : function(statics){ qxWeb.$attach({ "block" : statics.block, "unblock" : statics.unblock }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Css) #require(qx.module.Event) ************************************************************************ */ /** * Cross browser animation layer. It uses feature detection to check if CSS * animations are available and ready to use. If not, a JavaScript-based * fallback will be used. */ qx.Bootstrap.define("qx.module.Animation", { events : { /** Fired when an animation starts. */ "animationStart" : undefined, /** Fired when an animation has ended one iteration. */ "animationIteration" : undefined, /** Fired when an animation has ended. */ "animationEnd" : undefined }, statics : { __animationHandles : null, /** * Internal initializer to make sure we always have a plain array * for storing animation handles. * @internal */ $init : function(){ this.__animationHandles = []; }, /** * Returns the stored animation handles. The handles are only * available while an animation is running. * * @internal * @return {Array} An array of animation handles. */ getAnimationHandles : function(){ return this.__animationHandles; }, /** * Animation description used in {@link #fadeOut}. */ _fadeOut : { duration : 700, timing : "ease-out", keep : 100, keyFrames : { '0' : { opacity : 1 }, '100' : { opacity : 0, display : "none" } } }, /** * Animation description used in {@link #fadeIn}. */ _fadeIn : { duration : 700, timing : "ease-in", keep : 100, keyFrames : { '0' : { opacity : 0 }, '100' : { opacity : 1 } } }, /** * Starts the animation with the given description. * The description should be a map, which could look like this: * * <pre class="javascript"> * { * "duration": 1000, * "keep": 100, * "keyFrames": { * 0 : {"opacity": 1, "scale": 1}, * 100 : {"opacity": 0, "scale": 0} * }, * "origin": "50% 50%", * "repeat": 1, * "timing": "ease-out", * "alternate": false, * "delay": 2000 * } * </pre> * * *duration* is the time in milliseconds one animation cycle should take. * * *keep* is the key frame to apply at the end of the animation. (optional) * * *keyFrames* is a map of separate frames. Each frame is defined by a * number which is the percentage value of time in the animation. The value * is a map itself which holds css properties or transforms * (Transforms only for CSS Animations). * * *origin* maps to the transform origin {@link qx.bom.element.Transform#setOrigin} * (Only for CSS animations). * * *repeat* is the amount of time the animation should be run in * sequence. You can also use "infinite". * * *timing* takes one of these predefined values: * <code>ease</code> | <code>linear</code> | <code>ease-in</code> * | <code>ease-out</code> | <code>ease-in-out</code> | * <code>cubic-bezier(&lt;number&gt;, &lt;number&gt;, &lt;number&gt;, &lt;number&gt;)</code> * (cubic-bezier only available for CSS animations) * * *alternate* defines if every other animation should be run in reverse order. * * *delay* is the time in milliseconds the animation should wait before start. * * @attach {qxWeb} * @param desc {Map} The animation's description. * @param duration {Number?} The duration in milliseconds of the animation, * which will override the duration given in the description. * @return {qxWeb} The collection for chaining. */ animate : function(desc, duration){ if(this.__animationHandles.length > 0){ throw new Error("Only one animation at a time."); }; for(var i = 0;i < this.length;i++){ var handle = qx.bom.element.Animation.animate(this[i], desc, duration); var self = this; // only register for the first element if(i == 0){ handle.on("start", function(){ self.emit("animationStart"); }, handle); handle.on("iteration", function(){ self.emit("animationIteration"); }, handle); }; handle.on("end", function(){ var handles = self.__animationHandles; handles.splice(self.indexOf(handle), 1); if(handles.length == 0){ self.emit("animationEnd"); }; }, handle); this.__animationHandles.push(handle); }; return this; }, /** * Starts an animation in reversed order. For further details, take a look at * the {@link #animate} method. * @attach {qxWeb} * @param desc {Map} The animation's description. * @param duration {Number?} The duration in milliseconds of the animation, * which will override the duration given in the description. * @return {qxWeb} The collection for chaining. */ animateReverse : function(desc, duration){ if(this.__animationHandles.length > 0){ throw new Error("Only one animation at a time."); }; for(var i = 0;i < this.length;i++){ var handle = qx.bom.element.Animation.animateReverse(this[i], desc, duration); var self = this; handle.on("end", function(){ var handles = self.__animationHandles; handles.splice(self.indexOf(handle), 1); if(handles.length == 0){ self.emit("animationEnd"); }; }, handle); this.__animationHandles.push(handle); }; return this; }, /** * Manipulates the play state of the animation. * This can be used to continue an animation when paused. * @attach {qxWeb} * @return {qxWeb} The collection for chaining. */ play : function(){ for(var i = 0;i < this.__animationHandles.length;i++){ this.__animationHandles[i].play(); }; return this; }, /** * Manipulates the play state of the animation. * This can be used to pause an animation when running. * @attach {qxWeb} * @return {qxWeb} The collection for chaining. */ pause : function(){ for(var i = 0;i < this.__animationHandles.length;i++){ this.__animationHandles[i].pause(); }; return this; }, /** * Stops a running animation. * @attach {qxWeb} * @return {qxWeb} The collection for chaining. */ stop : function(){ for(var i = 0;i < this.__animationHandles.length;i++){ this.__animationHandles[i].stop(); }; this.__animationHandles = []; return this; }, /** * Returns whether an animation is running or not. * @attach {qxWeb} * @return {Boolean} <code>true</code>, if an animation is running. */ isPlaying : function(){ for(var i = 0;i < this.__animationHandles.length;i++){ if(this.__animationHandles[i].isPlaying()){ return true; }; }; return false; }, /** * Returns whether an animation has ended or not. * @attach {qxWeb} * @return {Boolean} <code>true</code>, if an animation has ended. */ isEnded : function(){ for(var i = 0;i < this.__animationHandles.length;i++){ if(!this.__animationHandles[i].isEnded()){ return false; }; }; return true; }, /** * Fades in all elements in the collection. * @attach {qxWeb} * @param duration {Number?} The duration in milliseconds. * @return {qxWeb} The collection for chaining. */ fadeIn : function(duration){ // remove 'display: none' style this.setStyle("display", ""); return this.animate(qx.module.Animation._fadeIn, duration); }, /** * Fades out all elements in the collection. * @attach {qxWeb} * @param duration {Number?} The duration in milliseconds. * @return {qxWeb} The collection for chaining. */ fadeOut : function(duration){ return this.animate(qx.module.Animation._fadeOut, duration); } }, defer : function(statics){ qxWeb.$attach({ "animate" : statics.animate, "animateReverse" : statics.animateReverse, "fadeIn" : statics.fadeIn, "fadeOut" : statics.fadeOut, "play" : statics.play, "pause" : statics.pause, "stop" : statics.stop, "isEnded" : statics.isEnded, "isPlaying" : statics.isPlaying, "getAnimationHandles" : statics.getAnimationHandles }); qxWeb.$attachInit(statics.$init); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * Wrapper for {@link qx.bom.element.AnimationCss} and * {@link qx.bom.element.AnimationJs}. It offers the pubilc API and decides using * feature checks either to use CSS animations or JS animations. * * If you use this class, the restrictions of the JavaScript animations apply. * This means that you can not use transforms and custom bezier timing functions. */ qx.Bootstrap.define("qx.bom.element.Animation", { statics : { /** * This function takes care of the feature check and starts the animation. * It takes a DOM element to apply the animation to, and a description. * The description should be a map, which could look like this: * * <pre class="javascript"> * { * "duration": 1000, * "keep": 100, * "keyFrames": { * 0 : {"opacity": 1, "scale": 1}, * 100 : {"opacity": 0, "scale": 0} * }, * "origin": "50% 50%", * "repeat": 1, * "timing": "ease-out", * "alternate": false, * "delay" : 2000 * } * </pre> * * *duration* is the time in milliseconds one animation cycle should take. * * *keep* is the key frame to apply at the end of the animation. (optional) * Keep in mind that the keep key is reversed in case you use an reverse * animation or set the alternate key and a even repeat count. * * *keyFrames* is a map of separate frames. Each frame is defined by a * number which is the percentage value of time in the animation. The value * is a map itself which holds css properties or transforms * {@link qx.bom.element.Transform} (Transforms only for CSS Animations). * * *origin* maps to the transform origin {@link qx.bom.element.Transform#setOrigin} * (Only for CSS animations). * * *repeat* is the amount of time the animation should be run in * sequence. You can also use "infinite". * * *timing* takes one of the predefined value: * <code>ease</code> | <code>linear</code> | <code>ease-in</code> * | <code>ease-out</code> | <code>ease-in-out</code> | * <code>cubic-bezier(&lt;number&gt;, &lt;number&gt;, &lt;number&gt;, &lt;number&gt;)</code> * (cubic-bezier only available for CSS animations) * * *alternate* defines if every other animation should be run in reverse order. * * *delay* is the time in milliseconds the animation should wait before start. * * @param el {Element} The element to animate. * @param desc {Map} The animations description. * @param duration {Integer?} The duration in milliseconds of the animation * which will override the duration given in the description. * @return {qx.bom.element.AnimationHandle} AnimationHandle instance to control * the animation. */ animate : function(el, desc, duration){ var onlyCssKeys = qx.bom.element.Animation.__hasOnlyCssKeys(el, desc.keyFrames); if(qx.core.Environment.get("css.animation") && onlyCssKeys){ return qx.bom.element.AnimationCss.animate(el, desc, duration); } else { return qx.bom.element.AnimationJs.animate(el, desc, duration); }; }, /** * Starts an animation in reversed order. For further details, take a look at * the {@link #animate} method. * @param el {Element} The element to animate. * @param desc {Map} The animations description. * @param duration {Integer?} The duration in milliseconds of the animation * which will override the duration given in the description. * @return {qx.bom.element.AnimationHandle} AnimationHandle instance to control * the animation. */ animateReverse : function(el, desc, duration){ var onlyCssKeys = qx.bom.element.Animation.__hasOnlyCssKeys(el, desc.keyFrames); if(qx.core.Environment.get("css.animation") && onlyCssKeys){ return qx.bom.element.AnimationCss.animateReverse(el, desc, duration); } else { return qx.bom.element.AnimationJs.animateReverse(el, desc, duration); }; }, /** * Detection helper which detects if only CSS keys are in * the animations key frames. * @param el {Element} The element to check for the styles. * @param keyFrames {Map} The keyFrames of the animation. * @return {Boolean} <code>true</code> if only css properties are included. */ __hasOnlyCssKeys : function(el, keyFrames){ var keys = []; for(var nr in keyFrames){ var frame = keyFrames[nr]; for(var key in frame){ if(keys.indexOf(key) == -1){ keys.push(key); }; }; }; var transformKeys = ["scale", "rotate", "skew", "translate"]; for(var i = 0;i < keys.length;i++){ var key = qx.lang.String.camelCase(keys[i]); if(!(key in el.style)){ // check for transform keys if(transformKeys.indexOf(keys[i]) != -1){ continue; }; return false; }; }; return true; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.bom.Stylesheet) ************************************************************************ */ /** * Responsible for checking all relevant animation properties. * * Spec: http://www.w3.org/TR/css3-animations/ * * @internal */ qx.Bootstrap.define("qx.bom.client.CssAnimation", { statics : { /** * Main check method which returns an object if CSS animations are * supported. This object contains all necessary keys to work with CSS * animations. * <ul> * <li><code>name</code> The name of the css animation style</li> * <li><code>play-state</code> The name of the play-state style</li> * <li><code>start-event</code> The name of the start event</li> * <li><code>iternation-event</code> The name of the iternation event</li> * <li><code>end-event</code> The name of the end event</li> * <li><code>fill-mode</code> The fill-mode style</li> * <li><code>keyframes</code> The name of the keyframes selector.</li> * </ul> * * @internal * @return {Object|null} The described object or null, if animations are * not supported. */ getSupport : function(){ var name = qx.bom.client.CssAnimation.getName(); if(name != null){ return { "name" : name, "play-state" : qx.bom.client.CssAnimation.getPlayState(), "start-event" : qx.bom.client.CssAnimation.getAnimationStart(), "iteration-event" : qx.bom.client.CssAnimation.getAnimationIteration(), "end-event" : qx.bom.client.CssAnimation.getAnimationEnd(), "fill-mode" : qx.bom.client.CssAnimation.getFillMode(), "keyframes" : qx.bom.client.CssAnimation.getKeyFrames() }; }; return null; }, /** * Checks for the 'animation-fill-mode' CSS style. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getFillMode : function(){ return qx.bom.Style.getPropertyName("AnimationFillMode"); }, /** * Checks for the 'animation-play-state' CSS style. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getPlayState : function(){ return qx.bom.Style.getPropertyName("AnimationPlayState"); }, /** * Checks for the style name used for animations. * @internal * @return {String|null} The name of the style or null, if the style is * not supported. */ getName : function(){ return qx.bom.Style.getPropertyName("animation"); }, /** * Checks for the event name of animation start. * @internal * @return {String} The name of the event. */ getAnimationStart : function(){ var mapping = { "msAnimation" : "MSAnimationStart", "WebkitAnimation" : "webkitAnimationStart", "MozAnimation" : "animationstart", "OAnimation" : "oAnimationStart", "animation" : "animationstart" }; return mapping[this.getName()]; }, /** * Checks for the event name of animation end. * @internal * @return {String} The name of the event. */ getAnimationIteration : function(){ var mapping = { "msAnimation" : "MSAnimationIteration", "WebkitAnimation" : "webkitAnimationIteration", "MozAnimation" : "animationiteration", "OAnimation" : "oAnimationIteration", "animation" : "animationiteration" }; return mapping[this.getName()]; }, /** * Checks for the event name of animation end. * @internal * @return {String} The name of the event. */ getAnimationEnd : function(){ var mapping = { "msAnimation" : "MSAnimationEnd", "WebkitAnimation" : "webkitAnimationEnd", "MozAnimation" : "animationend", "OAnimation" : "oAnimationEnd", "animation" : "animationend" }; return mapping[this.getName()]; }, /** * Checks what selector should be used to add keyframes to stylesheets. * @internal * @return {String|null} The name of the selector or null, if the selector * is not supported. */ getKeyFrames : function(){ var prefixes = qx.bom.Style.VENDOR_PREFIXES; var keyFrames = []; for(var i = 0;i < prefixes.length;i++){ var key = "@" + qx.lang.String.hyphenate(prefixes[i]) + "-keyframes"; // special treatment for IE10 if(key == "@ms-keyframes"){ key = "@-ms-keyframes"; }; keyFrames.push(key); }; keyFrames.unshift("@keyframes"); var sheet = qx.bom.Stylesheet.createElement(); for(var i = 0;i < keyFrames.length;i++){ try{ qx.bom.Stylesheet.addRule(sheet, keyFrames[i] + " name", ""); return keyFrames[i]; } catch(e) { }; }; return null; }, /** * Checks for the requestAnimationFrame method and return the prefixed name. * @internal * @return {String|null} A string the method name or null, if the method * is not supported. */ getRequestAnimationFrame : function(){ var choices = ["requestAnimationFrame", "msRequestAnimationFrame", "webkitRequestAnimationFrame", "mozRequestAnimationFrame", "oRequestAnmiationFrame"]; for(var i = 0;i < choices.length;i++){ if(window[choices[i]] != undefined){ return choices[i]; }; }; return null; } }, defer : function(statics){ qx.core.Environment.add("css.animation", statics.getSupport); qx.core.Environment.add("css.animation.requestframe", statics.getRequestAnimationFrame); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /** * This class is responsible for applying CSS3 animations to plain DOM elements. * * The implementation is mostly a cross-browser wrapper for applying the * animations, including transforms. If the browser does not support * CSS animations, but you have set a keep frame, the keep frame will be applied * immediately, thus making the animations optional. * * The API aligns closely to the spec wherever possible. * * http://www.w3.org/TR/css3-animations/ * * {@link qx.bom.element.Animation} is the class, which takes care of the * feature detection for CSS animations and decides which implementation * (CSS or JavaScript) should be used. Most likely, this implementation should * be the one to use. */ qx.Bootstrap.define("qx.bom.element.AnimationCss", { statics : { // initialization __sheet : null, __rulePrefix : "Anni", __id : 0, /** Static map of rules */ __rules : { }, /** The used keys for transforms. */ __transitionKeys : { "scale" : true, "rotate" : true, "skew" : true, "translate" : true }, /** Map of cross browser CSS keys. */ __cssAnimationKeys : qx.core.Environment.get("css.animation"), /** * This is the main function to start the animation in reverse mode. * For further details, take a look at the documentation of the wrapper * {@link qx.bom.element.Animation}. * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @return {qx.bom.element.AnimationHandle} The handle. */ animateReverse : function(el, desc, duration){ return this._animate(el, desc, duration, true); }, /** * This is the main function to start the animation. For further details, * take a look at the documentation of the wrapper * {@link qx.bom.element.Animation}. * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @return {qx.bom.element.AnimationHandle} The handle. */ animate : function(el, desc, duration){ return this._animate(el, desc, duration, false); }, /** * Internal method to start an animation either reverse or not. * {@link qx.bom.element.Animation}. * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @param reverse {Boolean} <code>true</code>, if the animation should be * reversed. * @return {qx.bom.element.AnimationHandle} The handle. */ _animate : function(el, desc, duration, reverse){ this.__normalizeDesc(desc); { }; // reverse the keep property if the animation is reverse as well var keep = desc.keep; if(keep != null && (reverse || (desc.alternate && desc.repeat % 2 == 0))){ keep = 100 - keep; }; if(!this.__sheet){ this.__sheet = qx.bom.Stylesheet.createElement(); }; var keyFrames = desc.keyFrames; if(duration == undefined){ duration = desc.duration; }; // if animations are supported if(this.__cssAnimationKeys != null){ var name = this.__addKeyFrames(keyFrames, reverse); var style = name + " " + duration + "ms " + desc.repeat + " " + desc.timing + " " + (desc.delay ? desc.delay + "ms " : "") + (desc.alternate ? "alternate" : ""); qx.bom.Event.addNativeListener(el, this.__cssAnimationKeys["start-event"], this.__onAnimationStart); qx.bom.Event.addNativeListener(el, this.__cssAnimationKeys["iteration-event"], this.__onAnimationIteration); qx.bom.Event.addNativeListener(el, this.__cssAnimationKeys["end-event"], this.__onAnimationEnd); el.style[qx.lang.String.camelCase(this.__cssAnimationKeys["name"])] = style; // use the fill mode property if available and suitable if(keep && keep == 100 && this.__cssAnimationKeys["fill-mode"]){ el.style[this.__cssAnimationKeys["fill-mode"]] = "forwards"; }; }; var animation = new qx.bom.element.AnimationHandle(); animation.desc = desc; animation.el = el; animation.keep = keep; el.$$animation = animation; // additional transform keys if(desc.origin != null){ qx.bom.element.Transform.setOrigin(el, desc.origin); }; // fallback for browsers not supporting animations if(this.__cssAnimationKeys == null){ window.setTimeout(function(){ qx.bom.element.AnimationCss.__onAnimationEnd({ target : el }); }, 0); }; return animation; }, /** * Handler for the animation start. * @param e {Event} The native event from the browser. */ __onAnimationStart : function(e){ e.target.$$animation.emit("start", e.target); }, /** * Handler for the animation iteration. * @param e {Event} The native event from the browser. */ __onAnimationIteration : function(e){ // It could happen that an animation end event is fired before an // animation iteration appears [BUG #6928] if(e.target != null && e.target.$$animation != null){ e.target.$$animation.emit("iteration", e.target); }; }, /** * Handler for the animation end. * @param e {Event} The native event from the browser. */ __onAnimationEnd : function(e){ var el = e.target; var animation = el.$$animation; // ignore events when already cleaned up if(!animation){ return; }; var desc = animation.desc; if(qx.bom.element.AnimationCss.__cssAnimationKeys != null){ // reset the styling var key = qx.lang.String.camelCase(qx.bom.element.AnimationCss.__cssAnimationKeys["name"]); el.style[key] = ""; qx.bom.Event.removeNativeListener(el, qx.bom.element.AnimationCss.__cssAnimationKeys["name"], qx.bom.element.AnimationCss.__onAnimationEnd); }; if(desc.origin != null){ qx.bom.element.Transform.setOrigin(el, ""); }; qx.bom.element.AnimationCss.__keepFrame(el, desc.keyFrames[animation.keep]); el.$$animation = null; animation.el = null; animation.ended = true; animation.emit("end", el); }, /** * Helper method which takes an element and a key frame description and * applies the properties defined in the given frame to the element. This * method is used to keep the state of the animation. * @param el {Element} The element to apply the frame to. * @param endFrame {Map} The description of the end frame, which is basically * a map containing CSS properties and values including transforms. */ __keepFrame : function(el, endFrame){ // keep the element at this animation step var transforms; for(var style in endFrame){ if(style in qx.bom.element.AnimationCss.__transitionKeys){ if(!transforms){ transforms = { }; }; transforms[style] = endFrame[style]; } else { el.style[qx.lang.String.camelCase(style)] = endFrame[style]; }; }; // transform keeping if(transforms){ qx.bom.element.Transform.transform(el, transforms); }; }, /** * Preprocessing of the description to make sure every necessary key is * set to its default. * @param desc {Map} The description of the animation. */ __normalizeDesc : function(desc){ if(!desc.hasOwnProperty("alternate")){ desc.alternate = false; }; if(!desc.hasOwnProperty("keep")){ desc.keep = null; }; if(!desc.hasOwnProperty("repeat")){ desc.repeat = 1; }; if(!desc.hasOwnProperty("timing")){ desc.timing = "linear"; }; if(!desc.hasOwnProperty("origin")){ desc.origin = null; }; }, /** * Debugging helper to validate the description. * @signature function(desc) * @param desc {Map} The description of the animation. */ __validateDesc : null, /** * Helper to add the given frames to an internal CSS stylesheet. It parses * the description and adds the key frames to the sheet. * @param frames {Map} A map of key frames that describe the animation. * @param reverse {Boolean} <code>true</code>, if the key frames should * be added in reverse order. * @return {String} The generated name of the keyframes rule. */ __addKeyFrames : function(frames, reverse){ var rule = ""; // for each key frame for(var position in frames){ rule += (reverse ? -(position - 100) : position) + "% {"; var frame = frames[position]; var transforms; // each style for(var style in frame){ if(style in this.__transitionKeys){ if(!transforms){ transforms = { }; }; transforms[style] = frame[style]; } else { rule += style + ":" + frame[style] + ";"; }; }; // transform handling if(transforms){ rule += qx.bom.element.Transform.getCss(transforms); }; rule += "} "; }; // cached shorthand if(this.__rules[rule]){ return this.__rules[rule]; }; var name = this.__rulePrefix + this.__id++; var selector = this.__cssAnimationKeys["keyframes"] + " " + name; qx.bom.Stylesheet.addRule(this.__sheet, selector, rule); this.__rules[rule] = name; return name; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #ignore(qx.bom.element.AnimationJs) ************************************************************************ */ /** * This is a simple handle, which will be returned when an animation is * started using the {@link qx.bom.element.Animation#animate} method. It * basically controls the animation. */ qx.Bootstrap.define("qx.bom.element.AnimationHandle", { extend : qx.event.Emitter, construct : function(){ var css = qx.core.Environment.get("css.animation"); this.__playState = css && css["play-state"]; this.__playing = true; }, events : { /** Fired when the animation started via {@link qx.bom.element.Animation}. */ "start" : "Element", /** * Fired when the animation started via {@link qx.bom.element.Animation} has * ended. */ "end" : "Element", /** Fired on every iteration of the animation. */ "iteration" : "Element" }, members : { __playState : null, __playing : false, __ended : false, /** * Accessor of the playing state. * @return {Boolean} <code>true</code>, if the animations is playing. */ isPlaying : function(){ return this.__playing; }, /** * Accessor of the ended state. * @return {Boolean} <code>true</code>, if the animations has ended. */ isEnded : function(){ return this.__ended; }, /** * Accessor of the paused state. * @return {Boolean} <code>true</code>, if the animations is paused. */ isPaused : function(){ return this.el.style[this.__playState] == "paused"; }, /** * Pauses the animation, if running. If not running, it will be ignored. */ pause : function(){ if(this.el){ this.el.style[this.__playState] = "paused"; this.el.$$animation.__playing = false; // in case the animation is based on JS if(this.animationId && qx.bom.element.AnimationJs){ qx.bom.element.AnimationJs.pause(this); }; }; }, /** * Resumes an animation. This does not start the animation once it has ended. * You need to create start a new Animation if you want to restart the animation. */ play : function(){ if(this.el){ this.el.style[this.__playState] = "running"; this.el.$$animation.__playing = true; // in case the animation is based on JS if(this.i != undefined && qx.bom.element.AnimationJs){ qx.bom.element.AnimationJs.play(this); }; }; }, /** * Stops the animation if running. */ stop : function(){ if(this.el && qx.core.Environment.get("css.animation") && !this.animationId){ this.el.style[this.__playState] = ""; this.el.style[qx.core.Environment.get("css.animation").name] = ""; this.el.$$animation.__playing = false; this.el.$$animation.__ended = true; }; // in case the animation is based on JS if(qx.bom.element.AnimationJs){ qx.bom.element.AnimationJs.stop(this); }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #ignore(qx.bom.element.Style) #use(qx.bom.element.AnimationJs#play) ************************************************************************ */ /** * This class offers the same API as the CSS3 animation layer in * {@link qx.bom.element.AnimationCss} but uses JavaScript to fake the behavior. * * {@link qx.bom.element.Animation} is the class, which takes care of the * feature detection for CSS animations and decides which implementation * (CSS or JavaScript) should be used. Most likely, this implementation should * be the one to use. */ qx.Bootstrap.define("qx.bom.element.AnimationJs", { statics : { /** * The maximal time a frame should take. */ __maxStepTime : 30, /** * The supported CSS units. */ __units : ["%", "in", "cm", "mm", "em", "ex", "pt", "pc", "px"], /** * This is the main function to start the animation. For further details, * take a look at the documentation of the wrapper * {@link qx.bom.element.Animation}. * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @return {qx.bom.element.AnimationHandle} The handle. */ animate : function(el, desc, duration){ return this._animate(el, desc, duration, false); }, /** * This is the main function to start the animation in reversed mode. * For further details, take a look at the documentation of the wrapper * {@link qx.bom.element.Animation}. * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @return {qx.bom.element.AnimationHandle} The handle. */ animateReverse : function(el, desc, duration){ return this._animate(el, desc, duration, true); }, /** * Helper to start the animation, either in reversed order or not. * * @param el {Element} The element to animate. * @param desc {Map} Animation description. * @param duration {Integer?} The duration of the animation which will * override the duration given in the description. * @param reverse {Boolean} <code>true</code>, if the animation should be * reversed. * @return {qx.bom.element.AnimationHandle} The handle. */ _animate : function(el, desc, duration, reverse){ // stop if an animation is already running if(el.$$animation){ return el.$$animation; }; desc = qx.lang.Object.clone(desc, true); if(duration == undefined){ duration = desc.duration; }; var keyFrames = desc.keyFrames; var keys = this.__getOrderedKeys(keyFrames); var stepTime = this.__getStepTime(duration, keys); var steps = parseInt(duration / stepTime, 10); this.__normalizeKeyFrames(keyFrames, el); var delta = this.__calculateDelta(steps, stepTime, keys, keyFrames, duration, desc.timing); var handle = new qx.bom.element.AnimationHandle(); if(reverse){ delta.reverse(); handle.reverse = true; }; handle.desc = desc; handle.el = el; handle.delta = delta; handle.stepTime = stepTime; handle.steps = steps; el.$$animation = handle; handle.i = 0; handle.initValues = { }; handle.repeatSteps = this.__applyRepeat(steps, desc.repeat); var delay = desc.delay || 0; var self = this; window.setTimeout(function(){ self.play(handle); }, delay); return handle; }, /** * Try to normalize the keyFrames by adding the default / set values of the * element. * @param keyFrames {Map} The map of key frames. * @param el {Element} The element to animate. */ __normalizeKeyFrames : function(keyFrames, el){ // collect all possible keys and its units var units = { }; for(var percent in keyFrames){ for(var name in keyFrames[percent]){ if(units[name] == undefined){ var item = keyFrames[percent][name]; if(typeof item == "string"){ units[name] = item.substring((parseInt(item, 10) + "").length, item.length); } else { units[name] = ""; }; }; }; }; // add all missing keys for(var percent in keyFrames){ var frame = keyFrames[percent]; for(var name in units){ if(frame[name] == undefined){ if(name in el.style){ // get the computed style if possible if(window.getComputedStyle){ frame[name] = getComputedStyle(el, null)[name]; } else { frame[name] = el.style[name]; }; } else { frame[name] = el[name]; }; // if its a unit we know, set 0 as fallback if(frame[name] === "" && this.__units.indexOf(units[name]) != -1){ frame[name] = "0" + units[name]; }; }; }; }; }, /** * Precalculation of the delta which will be applied during the animation. * The whole deltas will be calculated prior to the animation and stored * in a single array. This method takes care of that calculation. * * @param steps {Integer} The amount of steps to take to the end of the * animation. * @param stepTime {Integer} The amount of milliseconds each step takes. * @param keys {Array} Ordered list of keys in the key frames map. * @param keyFrames {Map} The map of key frames. * @param duration {Integer} Time in milliseconds the animation should take. * @param timing {String} The given timing function. * @return {Array} An array containing the animation deltas. */ __calculateDelta : function(steps, stepTime, keys, keyFrames, duration, timing){ var delta = new Array(steps); var keyIndex = 1; delta[0] = keyFrames[0]; var last = keyFrames[0]; var next = keyFrames[keys[keyIndex]]; // for every step for(var i = 1;i < delta.length;i++){ // switch key frames if we crossed a percent border if(i * stepTime / duration * 100 > keys[keyIndex]){ last = next; keyIndex++; next = keyFrames[keys[keyIndex]]; }; delta[i] = { }; // for every property for(var name in next){ var nItem = next[name] + ""; // color values if(nItem.charAt(0) == "#"){ // get the two values from the frames as RGB arrays var value0 = qx.util.ColorUtil.cssStringToRgb(last[name]); var value1 = qx.util.ColorUtil.cssStringToRgb(nItem); var stepValue = []; // calculate every color chanel for(var j = 0;j < value0.length;j++){ var range = value0[j] - value1[j]; stepValue[j] = parseInt(value0[j] - range * qx.bom.AnimationFrame.calculateTiming(timing, i / steps), 10); }; delta[i][name] = qx.util.ColorUtil.rgbToHexString(stepValue); } else if(!isNaN(parseInt(nItem, 10))){ var unit = nItem.substring((parseInt(nItem, 10) + "").length, nItem.length); var range = parseFloat(nItem) - parseFloat(last[name]); delta[i][name] = (parseFloat(last[name]) + range * qx.bom.AnimationFrame.calculateTiming(timing, i / steps)) + unit; } else { delta[i][name] = last[name] + ""; }; }; }; // make sure the last key frame is right delta[delta.length - 1] = keyFrames[100]; return delta; }, /** * Internal helper for the {@link qx.bom.element.AnimationHandle} to play * the animation. * @internal * @param handle {qx.bom.element.AnimationHandle} The hand which * represents the animation. * @return {qx.bom.element.AnimationHandle} The handle for chaining. */ play : function(handle){ handle.emit("start", handle.el); var id = window.setInterval(function(){ handle.repeatSteps--; var values = handle.delta[handle.i % handle.steps]; // save the init values if(handle.i === 0){ for(var name in values){ if(handle.initValues[name] === undefined){ // animate element property if(handle.el[name] !== undefined){ handle.initValues[name] = handle.el[name]; } else if(qx.bom.element.Style){ handle.initValues[name] = qx.bom.element.Style.get(handle.el, qx.lang.String.camelCase(name)); } else { handle.initValues[name] = handle.el.style[qx.lang.String.camelCase(name)]; }; }; }; }; qx.bom.element.AnimationJs.__applyStyles(handle.el, values); handle.i++; // iteration condition if(handle.i % handle.steps == 0){ handle.emit("iteration", handle.el); if(handle.desc.alternate){ handle.delta.reverse(); }; }; // end condition if(handle.repeatSteps < 0){ qx.bom.element.AnimationJs.stop(handle); }; }, handle.stepTime); handle.animationId = id; return handle; }, /** * Internal helper for the {@link qx.bom.element.AnimationHandle} to pause * the animation. * @internal * @param handle {qx.bom.element.AnimationHandle} The hand which * represents the animation. * @return {qx.bom.element.AnimationHandle} The handle for chaining. */ pause : function(handle){ // stop the interval window.clearInterval(handle.animationId); handle.animationId = null; return handle; }, /** * Internal helper for the {@link qx.bom.element.AnimationHandle} to stop * the animation. * @internal * @param handle {qx.bom.element.AnimationHandle} The hand which * represents the animation. * @return {qx.bom.element.AnimationHandle} The handle for chaining. */ stop : function(handle){ var desc = handle.desc; var el = handle.el; var initValues = handle.initValues; if(handle.animationId){ window.clearInterval(handle.animationId); }; // check if animation is already stopped if(el == undefined){ return handle; }; // if we should keep a frame var keep = desc.keep; if(keep != undefined){ if(handle.reverse || (desc.alternate && desc.repeat && desc.repeat % 2 == 0)){ keep = 100 - keep; }; this.__applyStyles(el, desc.keyFrames[keep]); } else { this.__applyStyles(el, initValues); }; el.$$animation = null; handle.el = null; handle.ended = true; handle.animationId = null; handle.emit("end", el); return handle; }, /** * Takes care of the repeat key of the description. * @param steps {Integer} The number of steps one iteration would take. * @param repeat {Integer|String} It can be either a number how often the * animation should be repeated or the string 'infinite'. * @return {Integer} The number of steps to animate. */ __applyRepeat : function(steps, repeat){ if(repeat == undefined){ return steps; }; if(repeat == "infinite"){ return Number.MAX_VALUE; }; return steps * repeat; }, /** * Central method to apply css styles and element properties. * @param el {Element} The DOM element to apply the styles. * @param styles {Map} A map containing styles and values. */ __applyStyles : function(el, styles){ for(var key in styles){ // ignore undefined values (might be a bad detection) if(styles[key] === undefined){ continue; }; // apply element property value if(key in el){ el[key] = styles[key]; continue; }; var name = qx.lang.String.camelCase(key); if(qx.bom.element.Style){ qx.bom.element.Style.set(el, name, styles[key]); } else { el.style[name] = styles[key]; }; }; }, /** * Dynamic calculation of the steps time considering a max step time. * @param duration {Number} The duration of the animation. * @param keys {Array} An array containing the orderd set of key frame keys. * @return {Integer} The best suited step time. */ __getStepTime : function(duration, keys){ // get min difference var minDiff = 100; for(var i = 0;i < keys.length - 1;i++){ minDiff = Math.min(minDiff, keys[i + 1] - keys[i]); }; var stepTime = duration * minDiff / 100; while(stepTime > this.__maxStepTime){ stepTime = stepTime / 2; }; return Math.round(stepTime); }, /** * Helper which returns the orderd keys of the key frame map. * @param keyFrames {Map} The map of key frames. * @return {Array} An orderd list of kyes. */ __getOrderedKeys : function(keyFrames){ var keys = Object.keys(keyFrames); for(var i = 0;i < keys.length;i++){ keys[i] = parseInt(keys[i], 10); }; keys.sort(function(a, b){ return a - b; }); return keys; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) * Christian Hagendorn (cs) ************************************************************************ */ /* ************************************************************************ #ignore(qx.theme.*) #ignore(qx.theme) #ignore(qx.Class) ************************************************************************ */ /** * Methods to convert colors between different color spaces. */ qx.Bootstrap.define("qx.util.ColorUtil", { statics : { /** * Regular expressions for color strings */ REGEXP : { hex3 : /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6 : /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, rgb : /^rgb\(\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*,\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*,\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*\)$/, rgba : /^rgba\(\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*,\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*,\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*,\s*([0-9]{1,3}\.{0,1}[0-9]*)\s*\)$/ }, /** * CSS3 system color names. */ SYSTEM : { activeborder : true, activecaption : true, appworkspace : true, background : true, buttonface : true, buttonhighlight : true, buttonshadow : true, buttontext : true, captiontext : true, graytext : true, highlight : true, highlighttext : true, inactiveborder : true, inactivecaption : true, inactivecaptiontext : true, infobackground : true, infotext : true, menu : true, menutext : true, scrollbar : true, threeddarkshadow : true, threedface : true, threedhighlight : true, threedlightshadow : true, threedshadow : true, window : true, windowframe : true, windowtext : true }, /** * Named colors, only the 16 basic colors plus the following ones: * transparent, grey, magenta, orange and brown */ NAMED : { black : [0, 0, 0], silver : [192, 192, 192], gray : [128, 128, 128], white : [255, 255, 255], maroon : [128, 0, 0], red : [255, 0, 0], purple : [128, 0, 128], fuchsia : [255, 0, 255], green : [0, 128, 0], lime : [0, 255, 0], olive : [128, 128, 0], yellow : [255, 255, 0], navy : [0, 0, 128], blue : [0, 0, 255], teal : [0, 128, 128], aqua : [0, 255, 255], // Additional values transparent : [-1, -1, -1], magenta : [255, 0, 255], // alias for fuchsia orange : [255, 165, 0], brown : [165, 42, 42] }, /** * Whether the incoming value is a named color. * * @param value {String} the color value to test * @return {Boolean} true if the color is a named color */ isNamedColor : function(value){ return this.NAMED[value] !== undefined; }, /** * Whether the incoming value is a system color. * * @param value {String} the color value to test * @return {Boolean} true if the color is a system color */ isSystemColor : function(value){ return this.SYSTEM[value] !== undefined; }, /** * Whether the color theme manager is loaded. Generally * part of the GUI of qooxdoo. * * @return {Boolean} <code>true</code> when color theme support is ready. **/ supportsThemes : function(){ if(qx.Class){ return qx.Class.isDefined("qx.theme.manager.Color"); }; return false; }, /** * Whether the incoming value is a themed color. * * @param value {String} the color value to test * @return {Boolean} true if the color is a themed color */ isThemedColor : function(value){ if(!this.supportsThemes()){ return false; }; if(qx.theme && qx.theme.manager && qx.theme.manager.Color){ return qx.theme.manager.Color.getInstance().isDynamic(value); }; return false; }, /** * Try to convert an incoming string to an RGB array. * Supports themed, named and system colors, but also RGB strings, * hex3 and hex6 values. * * @param str {String} any string * @return {Array} returns an array of red, green, blue on a successful transformation * @throws {Error} if the string could not be parsed */ stringToRgb : function(str){ if(this.supportsThemes() && this.isThemedColor(str)){ var str = qx.theme.manager.Color.getInstance().resolveDynamic(str); }; if(this.isNamedColor(str)){ return this.NAMED[str]; } else if(this.isSystemColor(str)){ throw new Error("Could not convert system colors to RGB: " + str); } else if(this.isRgbString(str)){ return this.__rgbStringToRgb(); } else if(this.isHex3String(str)){ return this.__hex3StringToRgb(); } else if(this.isHex6String(str)){ return this.__hex6StringToRgb(); };;;; throw new Error("Could not parse color: " + str); }, /** * Try to convert an incoming string to an RGB array. * Support named colors, RGB strings, hex3 and hex6 values. * * @param str {String} any string * @return {Array} returns an array of red, green, blue on a successful transformation * @throws {Error} if the string could not be parsed */ cssStringToRgb : function(str){ if(this.isNamedColor(str)){ return this.NAMED[str]; } else if(this.isSystemColor(str)){ throw new Error("Could not convert system colors to RGB: " + str); } else if(this.isRgbString(str)){ return this.__rgbStringToRgb(); } else if(this.isRgbaString(str)){ return this.__rgbaStringToRgb(); } else if(this.isHex3String(str)){ return this.__hex3StringToRgb(); } else if(this.isHex6String(str)){ return this.__hex6StringToRgb(); };;;;; throw new Error("Could not parse color: " + str); }, /** * Try to convert an incoming string to an RGB string, which can be used * for all color properties. * Supports themed, named and system colors, but also RGB strings, * hex3 and hex6 values. * * @param str {String} any string * @return {String} a RGB string * @throws {Error} if the string could not be parsed */ stringToRgbString : function(str){ return this.rgbToRgbString(this.stringToRgb(str)); }, /** * Converts a RGB array to an RGB string * * @param rgb {Array} an array with red, green and blue * @return {String} a RGB string */ rgbToRgbString : function(rgb){ return "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")"; }, /** * Converts a RGB array to an hex6 string * * @param rgb {Array} an array with red, green and blue * @return {String} a hex6 string (#xxxxxx) */ rgbToHexString : function(rgb){ return ("#" + qx.lang.String.pad(rgb[0].toString(16).toUpperCase(), 2) + qx.lang.String.pad(rgb[1].toString(16).toUpperCase(), 2) + qx.lang.String.pad(rgb[2].toString(16).toUpperCase(), 2)); }, /** * Detects if a string is a valid qooxdoo color * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid qooxdoo color */ isValidPropertyValue : function(str){ return (this.isThemedColor(str) || this.isNamedColor(str) || this.isHex3String(str) || this.isHex6String(str) || this.isRgbString(str) || this.isRgbaString(str)); }, /** * Detects if a string is a valid CSS color string * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid CSS color string */ isCssString : function(str){ return (this.isSystemColor(str) || this.isNamedColor(str) || this.isHex3String(str) || this.isHex6String(str) || this.isRgbString(str) || this.isRgbaString(str)); }, /** * Detects if a string is a valid hex3 string * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid hex3 string */ isHex3String : function(str){ return this.REGEXP.hex3.test(str); }, /** * Detects if a string is a valid hex6 string * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid hex6 string */ isHex6String : function(str){ return this.REGEXP.hex6.test(str); }, /** * Detects if a string is a valid RGB string * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid RGB string */ isRgbString : function(str){ return this.REGEXP.rgb.test(str); }, /** * Detects if a string is a valid RGBA string * * @param str {String} any string * @return {Boolean} true when the incoming value is a valid RGBA string */ isRgbaString : function(str){ return this.REGEXP.rgba.test(str); }, /** * Converts a regexp object match of a rgb string to an RGB array. * * @return {Array} an array with red, green, blue */ __rgbStringToRgb : function(){ var red = parseInt(RegExp.$1, 10); var green = parseInt(RegExp.$2, 10); var blue = parseInt(RegExp.$3, 10); return [red, green, blue]; }, /** * Converts a regexp object match of a rgba string to an RGB array. * * @return {Array} an array with red, green, blue */ __rgbaStringToRgb : function(){ var red = parseInt(RegExp.$1, 10); var green = parseInt(RegExp.$2, 10); var blue = parseInt(RegExp.$3, 10); return [red, green, blue]; }, /** * Converts a regexp object match of a hex3 string to an RGB array. * * @return {Array} an array with red, green, blue */ __hex3StringToRgb : function(){ var red = parseInt(RegExp.$1, 16) * 17; var green = parseInt(RegExp.$2, 16) * 17; var blue = parseInt(RegExp.$3, 16) * 17; return [red, green, blue]; }, /** * Converts a regexp object match of a hex6 string to an RGB array. * * @return {Array} an array with red, green, blue */ __hex6StringToRgb : function(){ var red = (parseInt(RegExp.$1, 16) * 16) + parseInt(RegExp.$2, 16); var green = (parseInt(RegExp.$3, 16) * 16) + parseInt(RegExp.$4, 16); var blue = (parseInt(RegExp.$5, 16) * 16) + parseInt(RegExp.$6, 16); return [red, green, blue]; }, /** * Converts a hex3 string to an RGB array * * @param value {String} a hex3 (#xxx) string * @return {Array} an array with red, green, blue */ hex3StringToRgb : function(value){ if(this.isHex3String(value)){ return this.__hex3StringToRgb(value); }; throw new Error("Invalid hex3 value: " + value); }, /** * Converts a hex3 (#xxx) string to a hex6 (#xxxxxx) string. * * @param value {String} a hex3 (#xxx) string * @return {String} The hex6 (#xxxxxx) string or the passed value when the * passed value is not an hex3 (#xxx) value. */ hex3StringToHex6String : function(value){ if(this.isHex3String(value)){ return this.rgbToHexString(this.hex3StringToRgb(value)); }; return value; }, /** * Converts a hex6 string to an RGB array * * @param value {String} a hex6 (#xxxxxx) string * @return {Array} an array with red, green, blue */ hex6StringToRgb : function(value){ if(this.isHex6String(value)){ return this.__hex6StringToRgb(value); }; throw new Error("Invalid hex6 value: " + value); }, /** * Converts a hex string to an RGB array * * @param value {String} a hex3 (#xxx) or hex6 (#xxxxxx) string * @return {Array} an array with red, green, blue */ hexStringToRgb : function(value){ if(this.isHex3String(value)){ return this.__hex3StringToRgb(value); }; if(this.isHex6String(value)){ return this.__hex6StringToRgb(value); }; throw new Error("Invalid hex value: " + value); }, /** * Convert RGB colors to HSB * * @param rgb {Number[]} red, blue and green as array * @return {Array} an array with hue, saturation and brightness */ rgbToHsb : function(rgb){ var hue,saturation,brightness; var red = rgb[0]; var green = rgb[1]; var blue = rgb[2]; var cmax = (red > green) ? red : green; if(blue > cmax){ cmax = blue; }; var cmin = (red < green) ? red : green; if(blue < cmin){ cmin = blue; }; brightness = cmax / 255.0; if(cmax != 0){ saturation = (cmax - cmin) / cmax; } else { saturation = 0; }; if(saturation == 0){ hue = 0; } else { var redc = (cmax - red) / (cmax - cmin); var greenc = (cmax - green) / (cmax - cmin); var bluec = (cmax - blue) / (cmax - cmin); if(red == cmax){ hue = bluec - greenc; } else if(green == cmax){ hue = 2.0 + redc - bluec; } else { hue = 4.0 + greenc - redc; }; hue = hue / 6.0; if(hue < 0){ hue = hue + 1.0; }; }; return [Math.round(hue * 360), Math.round(saturation * 100), Math.round(brightness * 100)]; }, /** * Convert HSB colors to RGB * * @param hsb {Number[]} an array with hue, saturation and brightness * @return {Integer[]} an array with red, green, blue */ hsbToRgb : function(hsb){ var i,f,p,q,t; var hue = hsb[0] / 360; var saturation = hsb[1] / 100; var brightness = hsb[2] / 100; if(hue >= 1.0){ hue %= 1.0; }; if(saturation > 1.0){ saturation = 1.0; }; if(brightness > 1.0){ brightness = 1.0; }; var tov = Math.floor(255 * brightness); var rgb = { }; if(saturation == 0.0){ rgb.red = rgb.green = rgb.blue = tov; } else { hue *= 6.0; i = Math.floor(hue); f = hue - i; p = Math.floor(tov * (1.0 - saturation)); q = Math.floor(tov * (1.0 - (saturation * f))); t = Math.floor(tov * (1.0 - (saturation * (1.0 - f)))); switch(i){case 0: rgb.red = tov; rgb.green = t; rgb.blue = p; break;case 1: rgb.red = q; rgb.green = tov; rgb.blue = p; break;case 2: rgb.red = p; rgb.green = tov; rgb.blue = t; break;case 3: rgb.red = p; rgb.green = q; rgb.blue = tov; break;case 4: rgb.red = t; rgb.green = p; rgb.blue = tov; break;case 5: rgb.red = tov; rgb.green = p; rgb.blue = q; break;}; }; return [rgb.red, rgb.green, rgb.blue]; }, /** * Creates a random color. * * @return {String} a valid qooxdoo/CSS rgb color string. */ randomColor : function(){ var r = Math.round(Math.random() * 255); var g = Math.round(Math.random() * 255); var b = Math.round(Math.random() * 255); return this.rgbToRgbString([r, g, b]); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /** * This is a cross browser wrapper for requestAnimationFrame. For further * information about the feature, take a look at spec: * http://www.w3.org/TR/animation-timing/ * * This class offers two ways of using this feature. First, the plain * API the spec describes. * * Here is a sample usage: * <pre class='javascript'>var start = +(new Date()); * var clb = function(time) { * if (time >= start + duration) { * // ... do some last tasks * } else { * var timePassed = time - start; * // ... calculate the current step and apply it * qx.bom.AnimationFrame.request(clb, this); * } * }; * qx.bom.AnimationFrame.request(clb, this); * </pre> * * Another way of using it is to use it as an instance emitting events. * * Here is a sample usage of that API: * <pre class='javascript'>var frame = new qx.bom.AnimationFrame(); * frame.on("end", function() { * // ... do some last tasks * }, this); * frame.on("frame", function(timePassed) { * // ... calculate the current step and apply it * }, this); * frame.startSequence(duration); * </pre> */ qx.Bootstrap.define("qx.bom.AnimationFrame", { extend : qx.event.Emitter, events : { /** Fired as soon as the animation has ended. */ "end" : undefined, /** Fired on every frame having the passed time as value. */ "frame" : "Number" }, members : { /** * Method used to start a series of animation frames. The series will end as * soon as the given duration is over. * * @param duration {Number} The duration the sequence should take. */ startSequence : function(duration){ var start = +(new Date()); var clb = function(){ var time = +(new Date()); // final call if(time >= start + duration){ this.emit("end"); this.id = null; } else { var timePassed = time - start; this.emit("frame", timePassed); this.id = qx.bom.AnimationFrame.request(clb, this); }; }; this.id = qx.bom.AnimationFrame.request(clb, this); } }, statics : { /** * The default time in ms the timeout fallback implementation uses. */ TIMEOUT : 30, /** * Calculation of the predefined timing functions. Approximation of the real * bezier curves has ben used for easier calculation. This is good and close * enough for the predefined functions like <code>ease</code> or * <code>linear</code>. * * @param func {String} The defined timing function. One of the following values: * <code>"ease-in"</code>, <code>"ease-out"</code>, <code>"linear"</code>, * <code>"ease-in-out"</code>, <code>"ease"</code>. * @param x {Integer} The percent value of the function. * @return {Integer} The calculated value */ calculateTiming : function(func, x){ if(func == "ease-in"){ var a = [3.1223e-7, 0.0757, 1.2646, -0.167, -0.4387, 0.2654]; } else if(func == "ease-out"){ var a = [-7.0198e-8, 1.652, -0.551, -0.0458, 0.1255, -0.1807]; } else if(func == "linear"){ return x; } else if(func == "ease-in-out"){ var a = [2.482e-7, -0.2289, 3.3466, -1.0857, -1.7354, 0.7034]; } else { // default is 'ease' var a = [-0.0021, 0.2472, 9.8054, -21.6869, 17.7611, -5.1226]; };;; // A 6th grade polynomial has been used as approximation of the original // bezier curves described in the transition spec // http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag // (the same is used for animations as well) var y = 0; for(var i = 0;i < a.length;i++){ y += a[i] * Math.pow(x, i); }; return y; }, /** * Request for an animation frame. If the native <code>requestAnimationFrame</code> * method is supported, it will be used. Otherwise, we use timeouts with a * 30ms delay. * @param callback {Function} The callback function which will get the current * time as argument. * @param context {var} The context of the callback. * @return {Number} The id of the request. */ request : function(callback, context){ var req = qx.core.Environment.get("css.animation.requestframe"); var clb = function(){ var time = +(new Date()); callback.call(context, time); }; if(req){ return window[req](clb); } else { return window.setTimeout(clb, qx.bom.AnimationFrame.TIMEOUT); }; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) * Christian Hagendorn (chris_schmidt) ************************************************************************ */ /** * Abstract class to compute the position of an object on one axis. */ qx.Bootstrap.define("qx.util.placement.AbstractAxis", { extend : Object, statics : { /** * Computes the start of the object on the axis * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param areaSize {Integer} Size of the axis. * @param position {String} Alignment of the object on the target. Valid values are * <ul> * <li><code>edge-start</code> The object is placed before the target</li> * <li><code>edge-end</code> The object is placed after the target</li> * <li><code>align-start</code>The start of the object is aligned with the start of the target</li> * <li><code>align-center</code>The center of the object is aligned with the center of the target</li> * <li><code>align-end</code>The end of the object is aligned with the end of the object</li> * </ul> * @return {Integer} The computed start position of the object. * @abstract */ computeStart : function(size, target, offsets, areaSize, position){ throw new Error("abstract method call!"); }, /** * Computes the start of the object by taking only the attachment and * alignment into account. The object by be not fully visible. * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param position {String} Accepts the same values as the <code> position</code> * argument of {@link #computeStart}. * @return {Integer} The computed start position of the object. */ _moveToEdgeAndAlign : function(size, target, offsets, position){ switch(position){case "edge-start": return target.start - offsets.end - size;case "edge-end": return target.end + offsets.start;case "align-start": return target.start + offsets.start;case "align-center": return target.start + parseInt((target.end - target.start - size) / 2, 10) + offsets.start;case "align-end": return target.end - offsets.end - size;}; }, /** * Whether the object specified by <code>start</code> and <code>size</code> * is completely inside of the axis' range.. * * @param start {Integer} Computed start position of the object * @param size {Integer} Size of the object * @param areaSize {Integer} The size of the axis * @return {Boolean} Whether the object is inside of the axis' range */ _isInRange : function(start, size, areaSize){ return start >= 0 && start + size <= areaSize; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) * Christian Hagendorn (chris_schmidt) ************************************************************************ */ /** * Places the object directly at the specified position. It is not moved if * parts of the object are outside of the axis' range. */ qx.Bootstrap.define("qx.util.placement.DirectAxis", { statics : { /** * Computes the start of the object by taking only the attachment and * alignment into account. The object by be not fully visible. * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param position {String} Accepts the same values as the <code> position</code> * argument of {@link #computeStart}. * @return {Integer} The computed start position of the object. */ _moveToEdgeAndAlign : qx.util.placement.AbstractAxis._moveToEdgeAndAlign, /** * Computes the start of the object on the axis * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param areaSize {Integer} Size of the axis. * @param position {String} Alignment of the object on the target. Valid values are * <ul> * <li><code>edge-start</code> The object is placed before the target</li> * <li><code>edge-end</code> The object is placed after the target</li> * <li><code>align-start</code>The start of the object is aligned with the start of the target</li> * <li><code>align-center</code>The center of the object is aligned with the center of the target</li> * <li><code>align-end</code>The end of the object is aligned with the end of the object</li> * </ul> * @return {Integer} The computed start position of the object. */ computeStart : function(size, target, offsets, areaSize, position){ return this._moveToEdgeAndAlign(size, target, offsets, position); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) * Christian Hagendorn (chris_schmidt) ************************************************************************ */ /** * Places the object to the target. If parts of the object are outside of the * range this class places the object at the best "edge", "alignment" * combination so that the overlap between object and range is maximized. */ qx.Bootstrap.define("qx.util.placement.KeepAlignAxis", { statics : { /** * Computes the start of the object by taking only the attachment and * alignment into account. The object by be not fully visible. * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param position {String} Accepts the same values as the <code> position</code> * argument of {@link #computeStart}. * @return {Integer} The computed start position of the object. */ _moveToEdgeAndAlign : qx.util.placement.AbstractAxis._moveToEdgeAndAlign, /** * Whether the object specified by <code>start</code> and <code>size</code> * is completely inside of the axis' range.. * * @param start {Integer} Computed start position of the object * @param size {Integer} Size of the object * @param areaSize {Integer} The size of the axis * @return {Boolean} Whether the object is inside of the axis' range */ _isInRange : qx.util.placement.AbstractAxis._isInRange, /** * Computes the start of the object on the axis * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param areaSize {Integer} Size of the axis. * @param position {String} Alignment of the object on the target. Valid values are * <ul> * <li><code>edge-start</code> The object is placed before the target</li> * <li><code>edge-end</code> The object is placed after the target</li> * <li><code>align-start</code>The start of the object is aligned with the start of the target</li> * <li><code>align-center</code>The center of the object is aligned with the center of the target</li> * <li><code>align-end</code>The end of the object is aligned with the end of the object</li> * </ul> * @return {Integer} The computed start position of the object. */ computeStart : function(size, target, offsets, areaSize, position){ var start = this._moveToEdgeAndAlign(size, target, offsets, position); var range1End,range2Start; if(this._isInRange(start, size, areaSize)){ return start; }; if(position == "edge-start" || position == "edge-end"){ range1End = target.start - offsets.end; range2Start = target.end + offsets.start; } else { range1End = target.end - offsets.end; range2Start = target.start + offsets.start; }; if(range1End > areaSize - range2Start){ start = range1End - size; } else { start = range2Start; }; return start; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Fabian Jakobs (fjakobs) * Christian Hagendorn (chris_schmidt) ************************************************************************ */ /** * Places the object according to the target. If parts of the object are outside * of the axis' range the object's start is adjusted so that the overlap between * the object and the axis is maximized. */ qx.Bootstrap.define("qx.util.placement.BestFitAxis", { statics : { /** * Whether the object specified by <code>start</code> and <code>size</code> * is completely inside of the axis' range.. * * @param start {Integer} Computed start position of the object * @param size {Integer} Size of the object * @param areaSize {Integer} The size of the axis * @return {Boolean} Whether the object is inside of the axis' range */ _isInRange : qx.util.placement.AbstractAxis._isInRange, /** * Computes the start of the object by taking only the attachment and * alignment into account. The object by be not fully visible. * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param position {String} Accepts the same values as the <code> position</code> * argument of {@link #computeStart}. * @return {Integer} The computed start position of the object. */ _moveToEdgeAndAlign : qx.util.placement.AbstractAxis._moveToEdgeAndAlign, /** * Computes the start of the object on the axis * * @param size {Integer} Size of the object to align * @param target {Map} Location of the object to align the object to. This map * should have the keys <code>start</code> and <code>end</code>. * @param offsets {Map} Map with all offsets on each side. * Comes with the keys <code>start</code> and <code>end</code>. * @param areaSize {Integer} Size of the axis. * @param position {String} Alignment of the object on the target. Valid values are * <ul> * <li><code>edge-start</code> The object is placed before the target</li> * <li><code>edge-end</code> The object is placed after the target</li> * <li><code>align-start</code>The start of the object is aligned with the start of the target</li> * <li><code>align-center</code>The center of the object is aligned with the center of the target</li> * <li><code>align-end</code>The end of the object is aligned with the end of the object</li> * </ul> * @return {Integer} The computed start position of the object. */ computeStart : function(size, target, offsets, areaSize, position){ var start = this._moveToEdgeAndAlign(size, target, offsets, position); if(this._isInRange(start, size, areaSize)){ return start; }; if(start < 0){ start = Math.min(0, areaSize - size); }; if(start + size > areaSize){ start = Math.max(0, areaSize - size); }; return start; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.util.placement.KeepAlignAxis#computeStart) #require(qx.util.placement.BestFitAxis#computeStart) #require(qx.util.placement.DirectAxis#computeStart) ************************************************************************ */ /** * The Placement module provides a convenient way to align two elements relative * to each other using various pre-defined algorithms. */ qxWeb.define("qx.module.Placement", { statics : { /** * Moves the first element in the collection, aligning it with the given * target. * * @attach{qxWeb} * @param target {Element} Placement target * @param position {String} Alignment of the object with the target, any of * <code>"top-left"</code>, <code>"top-center"</code>, <code>"top-right"</code>, * <code>"bottom-left"</code>, <code>"bottom-center"</code>, <code>"bottom-right"</code>, * <code>"left-top"</code>, <code>"left-middle"</code>, <code>"left-bottom"</code>, * <code>"right-top"</code>, <code>"right-middle"</code>, <code>"right-bottom"</code> * @param offsets {Map?null} Map with the desired offsets between the two elements. * Must contain the keys <code>left</code>, <code>top</code>, * <code>right</code> and <code>bottom</code> * @param modeX {String?"direct"} Horizontal placement mode. Valid values are: * <ul> * <li><code>direct</code>: place the element directly at the given * location.</li> * <li><code>keep-align</code>: if the element is partially outside of the * visible area, it is moved to the best fitting 'edge' and 'alignment' of * the target. * It is guaranteed the the new position attaches the object to one of the * target edges and that it is aligned with a target edge.</li> * <li><code>best-fit</code>: If the element is partially outside of the visible * area, it is moved into the view port, ignoring any offset and position * values.</li> * </ul> * @param modeY {String?"direct"} Vertical placement mode. Accepts the same values as * the 'modeX' argument. * @return {qxWeb} The collection for chaining */ placeTo : function(target, position, offsets, modeX, modeY){ if(!this[0]){ return null; }; var axes = { x : qx.module.Placement._getAxis(modeX), y : qx.module.Placement._getAxis(modeY) }; var size = { width : this.getWidth(), height : this.getHeight() }; var parent = this.getParents(); var area = { width : parent.getWidth(), height : parent.getHeight() }; var target = qxWeb(target).getOffset(); var offsets = offsets || { top : 0, right : 0, bottom : 0, left : 0 }; var splitted = position.split("-"); var edge = splitted[0]; var align = splitted[1]; var position = { x : qx.module.Placement._getPositionX(edge, align), y : qx.module.Placement._getPositionY(edge, align) }; var newLocation = qx.module.Placement._computePlacement(axes, size, area, target, offsets, position); this.setStyles({ position : "absolute", left : newLocation.left + "px", top : newLocation.top + "px" }); return this; }, /** * Returns the appropriate axis implementation for the given placement * mode * * @param mode {String} Placement mode * @return {Object} Placement axis class */ _getAxis : function(mode){ switch(mode){case "keep-align": return qx.util.placement.KeepAlignAxis;case "best-fit": return qx.util.placement.BestFitAxis;case "direct":default: return qx.util.placement.DirectAxis;}; }, /** * Returns the computed coordinates for the element to be placed * * @param axes {Map} Map with the keys <code>x</code> and <code>y</code>. Values * are the axis implementations * @param size {Map} Map with the keys <code>width</code> and <code>height</code> * containing the size of the placement target * @param area {Map} Map with the keys <code>width</code> and <code>height</code> * containing the size of the two elements' common parent (available space for * placement) * @param target {qxWeb} Collection containing the placement target * @param offsets {Map} Map of offsets (top, right, bottom, left) * @param position {Map} Map with the keys <code>x</code> and <code>y</code>, * containing the type of positioning for each axis * @return {Map} Map with the keys <code>left</code> and <code>top</code> * containing the computed coordinates to which the element should be moved */ _computePlacement : function(axes, size, area, target, offsets, position){ var left = axes.x.computeStart(size.width, { start : target.left, end : target.right }, { start : offsets.left, end : offsets.right }, area.width, position.x); var top = axes.y.computeStart(size.height, { start : target.top, end : target.bottom }, { start : offsets.top, end : offsets.bottom }, area.height, position.y); return { left : left, top : top }; }, /** * Returns the X axis positioning type for the given edge and alignment * values * * @param edge {String} edge value * @param align {String} align value * @return {String} X positioning type */ _getPositionX : function(edge, align){ if(edge == "left"){ return "edge-start"; } else if(edge == "right"){ return "edge-end"; } else if(align == "left"){ return "align-start"; } else if(align == "right"){ return "align-end"; };;; }, /** * Returns the Y axis positioning type for the given edge and alignment * values * * @param edge {String} edge value * @param align {String} align value * @return {String} Y positioning type */ _getPositionY : function(edge, align){ if(edge == "top"){ return "edge-start"; } else if(edge == "bottom"){ return "edge-end"; } else if(align == "top"){ return "align-start"; } else if(align == "bottom"){ return "align-end"; };;; } }, defer : function(statics){ qxWeb.$attach({ "placeTo" : statics.placeTo }); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) ************************************************************************ */ /** * Creates a touch event handler that fires high-level events such as "swipe" * based on low-level event sequences on the given element */ qx.Bootstrap.define("qx.module.event.TouchHandler", { statics : { /** * List of events that require a touch handler * @type {Array} */ TYPES : ["tap", "swipe"], /** * Creates a touch handler for the given element when a touch event listener * is attached to it * * @param element {Element} DOM element */ register : function(element){ if(!element.__touchHandler){ if(!element.__emitter){ element.__emitter = new qx.event.Emitter(); }; element.__touchHandler = new qx.event.handler.TouchCore(element, element.__emitter); }; }, /** * Removes the touch event handler from the element if there are no more * touch event listeners attached to it * @param element {Element} DOM element */ unregister : function(element){ if(element.__touchHandler){ if(!element.__emitter){ element.__touchHandler = null; } else { var hasTouchListener = false; var listeners = element.__emitter.getListeners(); qx.module.event.TouchHandler.TYPES.forEach(function(type){ if(type in listeners && listeners[type].length > 0){ hasTouchListener = true; }; }); if(!hasTouchListener){ element.__touchHandler = null; }; }; }; } }, defer : function(statics){ qxWeb.$registerEventHook(statics.TYPES, statics.register, statics.unregister); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) * Tino Butz (tbtz) * Christian Hagendorn (chris_schmidt) * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #ignore(qx.event.type.Tap) #ignore(qx.event.type.Swipe) #ignore(qx.event.type) #ignore(qx.event) ************************************************************************ */ /** * Listens for native touch events and fires composite events like "tap" and * "swipe" */ qx.Bootstrap.define("qx.event.handler.TouchCore", { extend : Object, statics : { /** {Integer} The maximum distance of a tap. Only if the x or y distance of * the performed tap is less or equal the value of this constant, a tap * event is fired. */ TAP_MAX_DISTANCE : qx.core.Environment.get("os.name") != "android" ? 10 : 40, /** {Map} The direction of a swipe relative to the axis */ SWIPE_DIRECTION : { x : ["left", "right"], y : ["up", "down"] }, /** {Integer} The minimum distance of a swipe. Only if the x or y distance * of the performed swipe is greater as or equal the value of this * constant, a swipe event is fired. */ SWIPE_MIN_DISTANCE : qx.core.Environment.get("os.name") != "android" ? 11 : 41, /** {Integer} The minimum velocity of a swipe. Only if the velocity of the * performed swipe is greater as or equal the value of this constant, a * swipe event is fired. */ SWIPE_MIN_VELOCITY : 0 }, /** * Create a new instance * * @param target {Element} element on which to listen for native touch events * @param emitter {qx.event.Emitter} Event emitter object */ construct : function(target, emitter){ this.__target = target; this.__emitter = emitter; this._initTouchObserver(); }, members : { __target : null, __emitter : null, __onTouchEventWrapper : null, __originalTarget : null, __startPageX : null, __startPageY : null, __startTime : null, __isSingleTouchGesture : null, __onMove : null, /* --------------------------------------------------------------------------- OBSERVER INIT --------------------------------------------------------------------------- */ /** * Initializes the native touch event listeners. */ _initTouchObserver : function(){ this.__onTouchEventWrapper = qx.lang.Function.listener(this._onTouchEvent, this); var Event = qx.bom.Event; Event.addNativeListener(this.__target, "touchstart", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "touchmove", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "touchend", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "touchcancel", this.__onTouchEventWrapper); if(qx.core.Environment.get("event.mspointer")){ Event.addNativeListener(this.__target, "MSPointerDown", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "MSPointerMove", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "MSPointerUp", this.__onTouchEventWrapper); Event.addNativeListener(this.__target, "MSPointerCancel", this.__onTouchEventWrapper); }; }, /* --------------------------------------------------------------------------- OBSERVER STOP --------------------------------------------------------------------------- */ /** * Disconnects the native touch event listeners. */ _stopTouchObserver : function(){ var Event = qx.bom.Event; Event.removeNativeListener(this.__target, "touchstart", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "touchmove", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "touchend", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "touchcancel", this.__onTouchEventWrapper); if(qx.core.Environment.get("event.mspointer")){ Event.removeNativeListener(this.__target, "MSPointerDown", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "MSPointerMove", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "MSPointerUp", this.__onTouchEventWrapper); Event.removeNativeListener(this.__target, "MSPointerCancel", this.__onTouchEventWrapper); }; }, /* --------------------------------------------------------------------------- NATIVE EVENT OBSERVERS --------------------------------------------------------------------------- */ /** * Handler for native touch events. * * @param domEvent {Event} The touch event from the browser. */ _onTouchEvent : function(domEvent){ this._commonTouchEventHandler(domEvent); }, /** * Called by an event handler. * * @param domEvent {Event} DOM event * @param type {String ? null} type of the event */ _commonTouchEventHandler : function(domEvent, type){ var type = type || domEvent.type; if(qx.core.Environment.get("event.mspointer")){ domEvent.changedTouches = [domEvent]; domEvent.targetTouches = [domEvent]; domEvent.touches = [domEvent]; if(type == "MSPointerDown"){ type = "touchstart"; } else if(type == "MSPointerUp"){ type = "touchend"; } else if(type == "MSPointerMove"){ if(this.__onMove == true){ type = "touchmove"; }; } else if(type == "MSPointerCancel"){ type = "touchcancel"; };;; }; if(type == "touchstart"){ this.__originalTarget = this._getTarget(domEvent); }; this._fireEvent(domEvent, type); this.__checkAndFireGesture(domEvent, type); }, /* --------------------------------------------------------------------------- HELPERS --------------------------------------------------------------------------- */ /** * Return the target of the event. * * @param domEvent {Event} DOM event * @return {Element} Event target */ _getTarget : function(domEvent){ var target = qx.bom.Event.getTarget(domEvent); // Text node. Fix Safari Bug, see http://www.quirksmode.org/js/events_properties.html if(qx.core.Environment.get("engine.name") == "webkit"){ if(target && target.nodeType == 3){ target = target.parentNode; }; } else if(qx.core.Environment.get("event.mspointer")){ // Fix for IE10 and pointer-events:none var targetForIE = this.__evaluateTarget(domEvent); if(targetForIE){ target = targetForIE; }; }; return target; }, /** * This method fixes "pointer-events:none" for Internet Explorer 10. * Checks which elements are placed to position x/y and traverses the array * till one element has no "pointer-events:none" inside its style attribute. * @param domEvent {Event} DOM event * @return {Element | null} Event target */ __evaluateTarget : function(domEvent){ if(domEvent && domEvent.touches){ var clientX = domEvent.touches[0].clientX; var clientY = domEvent.touches[0].clientY; }; // Retrieve an array with elements on point X/Y. var hitTargets = document.msElementsFromPoint(clientX, clientY); if(hitTargets){ // Traverse this array for the elements which has no pointer-events:none inside. for(var i = 0;i < hitTargets.length;i++){ var currentTarget = hitTargets[i]; var pointerEvents = qx.bom.element.Style.get(currentTarget, "pointer-events", 3); if(pointerEvents != "none"){ return currentTarget; }; }; }; return null; }, /** * Fire a touch event with the given parameters * * @param domEvent {Event} DOM event * @param type {String ? null} type of the event * @param target {Element ? null} event target */ _fireEvent : function(domEvent, type, target){ if(!target){ target = this._getTarget(domEvent); }; var type = type || domEvent.type; if(target && target.nodeType && this.__emitter){ this.__emitter.emit(type, domEvent); }; }, /** * Checks if a gesture was made and fires the gesture event. * * @param domEvent {Event} DOM event * @param type {String ? null} type of the event * @param target {Element ? null} event target */ __checkAndFireGesture : function(domEvent, type, target){ if(!target){ target = this._getTarget(domEvent); }; var type = type || domEvent.type; if(type == "touchstart"){ this.__gestureStart(domEvent, target); } else if(type == "touchmove"){ this.__gestureChange(domEvent, target); } else if(type == "touchend"){ this.__gestureEnd(domEvent, target); };; }, /** * Helper method for gesture start. * * @param domEvent {Event} DOM event * @param target {Element} event target */ __gestureStart : function(domEvent, target){ var touch = domEvent.changedTouches[0]; this.__onMove = true; this.__startPageX = touch.screenX; this.__startPageY = touch.screenY; this.__startTime = new Date().getTime(); this.__isSingleTouchGesture = domEvent.changedTouches.length === 1; }, /** * Helper method for gesture change. * * @param domEvent {Event} DOM event * @param target {Element} event target */ __gestureChange : function(domEvent, target){ // Abort a single touch gesture when another touch occurs. if(this.__isSingleTouchGesture && domEvent.changedTouches.length > 1){ this.__isSingleTouchGesture = false; }; }, /** * Helper method for gesture end. * * @param domEvent {Event} DOM event * @param target {Element} event target */ __gestureEnd : function(domEvent, target){ this.__onMove = false; if(this.__isSingleTouchGesture){ var touch = domEvent.changedTouches[0]; var deltaCoordinates = { x : touch.screenX - this.__startPageX, y : touch.screenY - this.__startPageY }; var clazz = qx.event.handler.TouchCore; var eventType; if(this.__originalTarget == target && Math.abs(deltaCoordinates.x) <= clazz.TAP_MAX_DISTANCE && Math.abs(deltaCoordinates.y) <= clazz.TAP_MAX_DISTANCE){ if(qx.event && qx.event.type && qx.event.type.Tap){ eventType = qx.event.type.Tap; }; this._fireEvent(domEvent, "tap", target, eventType); } else { var swipe = this.__getSwipeGesture(domEvent, target, deltaCoordinates); if(swipe){ if(qx.event && qx.event.type && qx.event.type.Swipe){ eventType = qx.event.type.Swipe; }; domEvent.swipe = swipe; this._fireEvent(domEvent, "swipe", target, eventType); }; }; }; }, /** * Returns the swipe gesture when the user performed a swipe. * * @param domEvent {Event} DOM event * @param target {Element} event target * @param deltaCoordinates {Map} delta x/y coordinates since the gesture started. * @return {Map} returns the swipe data when the user performed a swipe, null if the gesture was no swipe. */ __getSwipeGesture : function(domEvent, target, deltaCoordinates){ var clazz = qx.event.handler.TouchCore; var duration = new Date().getTime() - this.__startTime; var axis = (Math.abs(deltaCoordinates.x) >= Math.abs(deltaCoordinates.y)) ? "x" : "y"; var distance = deltaCoordinates[axis]; var direction = clazz.SWIPE_DIRECTION[axis][distance < 0 ? 0 : 1]; var velocity = (duration !== 0) ? distance / duration : 0; var swipe = null; if(Math.abs(velocity) >= clazz.SWIPE_MIN_VELOCITY && Math.abs(distance) >= clazz.SWIPE_MIN_DISTANCE){ swipe = { startTime : this.__startTime, duration : duration, axis : axis, direction : direction, distance : distance, velocity : velocity }; }; return swipe; }, /** * Dispose this object */ dispose : function(){ this._stopTouchObserver(); this.__originalTarget = this.__target = this.__emitter = null; } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) ************************************************************************ */ /** * Normalization for orientationchange events * Example: * <pre class="javascript"> * q(window).on("orientationchange", function(ev) { * ev.getOrientation(); * ev.isLandscape(); * }); * </pre> */ qx.Bootstrap.define("qx.module.event.Orientation", { statics : { /** * List of event types to be normalized * @type {Array} */ TYPES : ["orientationchange"], /** * List of qx.module.event.Orientation methods to be attached to native * event objects * @type {Array} * @internal */ BIND_METHODS : ["getOrientation", "isLandscape", "isPortrait"], /** * Returns the current orientation of the viewport in degrees. * * All possible values and their meaning: * * * <code>0</code>: "Portrait" * * <code>-90</code>: "Landscape (right, screen turned clockwise)" * * <code>90</code>: "Landscape (left, screen turned counterclockwise)" * * <code>180</code>: "Portrait (upside-down portrait)" * * @return {Number} The current orientation in degrees */ getOrientation : function(){ return this._orientation; }, /** * Whether the viewport orientation is currently in landscape mode. * * @return {Boolean} <code>true</code> when the viewport orientation * is currently in landscape mode. */ isLandscape : function(){ return this._mode == "landscape"; }, /** * Whether the viewport orientation is currently in portrait mode. * * @return {Boolean} <code>true</code> when the viewport orientation * is currently in portrait mode. */ isPortrait : function(){ return this._mode == "portrait"; }, /** * Manipulates the native event object, adding methods if they're not * already present * * @param event {Event} Native event object * @param element {Element} DOM element the listener was attached to * @param type {String} Event type * @return {Event} Normalized event object * @internal */ normalize : function(event, element, type){ if(!event){ return event; }; event._type = type; var bindMethods = qx.module.event.Orientation.BIND_METHODS; for(var i = 0,l = bindMethods.length;i < l;i++){ if(typeof event[bindMethods[i]] != "function"){ event[bindMethods[i]] = qx.module.event.Orientation[bindMethods[i]].bind(event); }; }; return event; } }, defer : function(statics){ qxWeb.$registerEventNormalization(statics.TYPES, statics.normalize); } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (wittemann) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Attribute) #require(qx.module.Css) #require(qx.module.Environment) #require(qx.module.Event) #require(qx.module.Manipulating) #require(qx.module.Polyfill) #require(qx.module.Traversing) ************************************************************************ */ /** * Placeholder class which simply defines and includes the core of qxWeb. * The core modules are: * * * {@link qx.module.Attribute} * * {@link qx.module.Css} * * {@link qx.module.Environment} * * {@link qx.module.Event} * * {@link qx.module.Manipulating} * * {@link qx.module.Polyfill} * * {@link qx.module.Traversing} */ qx.Bootstrap.define("qx.module.Core", { }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /* ************************************************************************ #require(qx.module.Event) #require(qx.module.Environment) ************************************************************************ */ /** * Normalization for native keyboard events */ qx.Bootstrap.define("qx.module.event.Keyboard", { statics : { /** * List of event types to be normalized * @type {Array} */ TYPES : ["keydown", "keypress", "keyup"], /** * List qx.module.event.Keyboard methods to be attached to native mouse event * objects * @type {Array} * @internal */ BIND_METHODS : ["getKeyIdentifier"], /** * Identifier of the pressed key. This property is modeled after the <em>KeyboardEvent.keyIdentifier</em> property * of the W3C DOM 3 event specification * (http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/events.html#Events-KeyboardEvent-keyIdentifier). * * Printable keys are represented by an unicode string, non-printable keys * have one of the following values: * * <table> * <tr><th>Backspace</th><td>The Backspace (Back) key.</td></tr> * <tr><th>Tab</th><td>The Horizontal Tabulation (Tab) key.</td></tr> * <tr><th>Space</th><td>The Space (Spacebar) key.</td></tr> * <tr><th>Enter</th><td>The Enter key. Note: This key identifier is also used for the Return (Macintosh numpad) key.</td></tr> * <tr><th>Shift</th><td>The Shift key.</td></tr> * <tr><th>Control</th><td>The Control (Ctrl) key.</td></tr> * <tr><th>Alt</th><td>The Alt (Menu) key.</td></tr> * <tr><th>CapsLock</th><td>The CapsLock key</td></tr> * <tr><th>Meta</th><td>The Meta key. (Apple Meta and Windows key)</td></tr> * <tr><th>Escape</th><td>The Escape (Esc) key.</td></tr> * <tr><th>Left</th><td>The Left Arrow key.</td></tr> * <tr><th>Up</th><td>The Up Arrow key.</td></tr> * <tr><th>Right</th><td>The Right Arrow key.</td></tr> * <tr><th>Down</th><td>The Down Arrow key.</td></tr> * <tr><th>PageUp</th><td>The Page Up key.</td></tr> * <tr><th>PageDown</th><td>The Page Down (Next) key.</td></tr> * <tr><th>End</th><td>The End key.</td></tr> * <tr><th>Home</th><td>The Home key.</td></tr> * <tr><th>Insert</th><td>The Insert (Ins) key. (Does not fire in Opera/Win)</td></tr> * <tr><th>Delete</th><td>The Delete (Del) Key.</td></tr> * <tr><th>F1</th><td>The F1 key.</td></tr> * <tr><th>F2</th><td>The F2 key.</td></tr> * <tr><th>F3</th><td>The F3 key.</td></tr> * <tr><th>F4</th><td>The F4 key.</td></tr> * <tr><th>F5</th><td>The F5 key.</td></tr> * <tr><th>F6</th><td>The F6 key.</td></tr> * <tr><th>F7</th><td>The F7 key.</td></tr> * <tr><th>F8</th><td>The F8 key.</td></tr> * <tr><th>F9</th><td>The F9 key.</td></tr> * <tr><th>F10</th><td>The F10 key.</td></tr> * <tr><th>F11</th><td>The F11 key.</td></tr> * <tr><th>F12</th><td>The F12 key.</td></tr> * <tr><th>NumLock</th><td>The Num Lock key.</td></tr> * <tr><th>PrintScreen</th><td>The Print Screen (PrintScrn, SnapShot) key.</td></tr> * <tr><th>Scroll</th><td>The scroll lock key</td></tr> * <tr><th>Pause</th><td>The pause/break key</td></tr> * <tr><th>Win</th><td>The Windows Logo key</td></tr> * <tr><th>Apps</th><td>The Application key (Windows Context Menu)</td></tr> * </table> * * @return {String} The key identifier */ getKeyIdentifier : function(){ if(this.type == "keypress" && (qxWeb.env.get("engine.name") != "gecko" || this.charCode !== 0)){ return qx.event.util.Keyboard.charCodeToIdentifier(this.charCode || this.keyCode); }; return qx.event.util.Keyboard.keyCodeToIdentifier(this.keyCode); }, /** * Manipulates the native event object, adding methods if they're not * already present * * @param event {Event} Native event object * @param element {Element} DOM element the listener was attached to * @return {Event} Normalized event object * @internal */ normalize : function(event, element){ if(!event){ return event; }; var bindMethods = qx.module.event.Keyboard.BIND_METHODS; for(var i = 0,l = bindMethods.length;i < l;i++){ if(typeof event[bindMethods[i]] != "function"){ event[bindMethods[i]] = qx.module.event.Keyboard[bindMethods[i]].bind(event); }; }; return event; }, /** * IE9 will not fire an "input" event on text input elements if the user changes * the field's value by pressing the Backspace key. We fix this by listening * for the "keyup" event and emitting the missing event if necessary * * @param element {Element} Target element */ registerInputFix : function(element){ if(element.type === "text" || element.type === "password" || element.type === "textarea"){ if(!element.__inputFix){ element.__inputFix = qxWeb(element).on("keyup", qx.module.event.Keyboard._inputFix); }; }; }, /** * Removes the IE9 input event fix * @param element {Element} target element */ unregisterInputFix : function(element){ if(element.__inputFix && !qxWeb(element).hasListener("input")){ qxWeb(element).off("keyup", qx.module.event.Keyboard._inputFix); element.__inputFix = null; }; }, /** * IE9 fix: Emits an "input" event if a text input element's value was changed * using the Backspace key * @param ev {Event} Keyup event */ _inputFix : function(ev){ if(ev.getKeyIdentifier() !== "Backspace"){ return; }; var target = ev.getTarget(); var newValue = qxWeb(target).getValue(); if(!target.__oldInputValue || target.__oldInputValue !== newValue){ target.__oldInputValue = newValue; ev.type = ev._type = "input"; target.__emitter.emit("input", ev); }; } }, defer : function(statics){ qxWeb.$registerEventNormalization(qx.module.event.Keyboard.TYPES, statics.normalize); if(qxWeb.env.get("engine.name") === "mshtml" && qxWeb.env.get("browser.documentmode") === 9){ qxWeb.$registerEventHook("input", statics.registerInputFix, statics.unregisterInputFix); }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) * Fabian Jakobs (fjakobs) ************************************************************************ */ /** * Utilities for working with character codes and key identifiers */ qx.Bootstrap.define("qx.event.util.Keyboard", { statics : { /* --------------------------------------------------------------------------- KEY MAPS --------------------------------------------------------------------------- */ /** * {Map} maps the charcodes of special printable keys to key identifiers * * @lint ignoreReferenceField(specialCharCodeMap) */ specialCharCodeMap : { '8' : "Backspace", // The Backspace (Back) key. '9' : "Tab", // The Horizontal Tabulation (Tab) key. // Note: This key identifier is also used for the // Return (Macintosh numpad) key. '13' : "Enter", // The Enter key. '27' : "Escape", // The Escape (Esc) key. '32' : "Space" }, /** * {Map} maps the keycodes of the numpad keys to the right charcodes * * @lint ignoreReferenceField(numpadToCharCode) */ numpadToCharCode : { '96' : "0".charCodeAt(0), '97' : "1".charCodeAt(0), '98' : "2".charCodeAt(0), '99' : "3".charCodeAt(0), '100' : "4".charCodeAt(0), '101' : "5".charCodeAt(0), '102' : "6".charCodeAt(0), '103' : "7".charCodeAt(0), '104' : "8".charCodeAt(0), '105' : "9".charCodeAt(0), '106' : "*".charCodeAt(0), '107' : "+".charCodeAt(0), '109' : "-".charCodeAt(0), '110' : ",".charCodeAt(0), '111' : "/".charCodeAt(0) }, /** * {Map} maps the keycodes of non printable keys to key identifiers * * @lint ignoreReferenceField(keyCodeToIdentifierMap) */ keyCodeToIdentifierMap : { '16' : "Shift", // The Shift key. '17' : "Control", // The Control (Ctrl) key. '18' : "Alt", // The Alt (Menu) key. '20' : "CapsLock", // The CapsLock key '224' : "Meta", // The Meta key. (Apple Meta and Windows key) '37' : "Left", // The Left Arrow key. '38' : "Up", // The Up Arrow key. '39' : "Right", // The Right Arrow key. '40' : "Down", // The Down Arrow key. '33' : "PageUp", // The Page Up key. '34' : "PageDown", // The Page Down (Next) key. '35' : "End", // The End key. '36' : "Home", // The Home key. '45' : "Insert", // The Insert (Ins) key. (Does not fire in Opera/Win) '46' : "Delete", // The Delete (Del) Key. '112' : "F1", // The F1 key. '113' : "F2", // The F2 key. '114' : "F3", // The F3 key. '115' : "F4", // The F4 key. '116' : "F5", // The F5 key. '117' : "F6", // The F6 key. '118' : "F7", // The F7 key. '119' : "F8", // The F8 key. '120' : "F9", // The F9 key. '121' : "F10", // The F10 key. '122' : "F11", // The F11 key. '123' : "F12", // The F12 key. '144' : "NumLock", // The Num Lock key. '44' : "PrintScreen", // The Print Screen (PrintScrn, SnapShot) key. '145' : "Scroll", // The scroll lock key '19' : "Pause", // The pause/break key // The left Windows Logo key or left cmd key '91' : qx.core.Environment.get("os.name") == "osx" ? "cmd" : "Win", '92' : "Win", // The right Windows Logo key or left cmd key // The Application key (Windows Context Menu) or right cmd key '93' : qx.core.Environment.get("os.name") == "osx" ? "cmd" : "Apps" }, /** char code for capital A */ charCodeA : "A".charCodeAt(0), /** char code for capital Z */ charCodeZ : "Z".charCodeAt(0), /** char code for 0 */ charCode0 : "0".charCodeAt(0), /** char code for 9 */ charCode9 : "9".charCodeAt(0), /** * converts a keyboard code to the corresponding identifier * * @param keyCode {Integer} key code * @return {String} key identifier */ keyCodeToIdentifier : function(keyCode){ if(this.isIdentifiableKeyCode(keyCode)){ var numPadKeyCode = this.numpadToCharCode[keyCode]; if(numPadKeyCode){ return String.fromCharCode(numPadKeyCode); }; return (this.keyCodeToIdentifierMap[keyCode] || this.specialCharCodeMap[keyCode] || String.fromCharCode(keyCode)); } else { return "Unidentified"; }; }, /** * converts a character code to the corresponding identifier * * @param charCode {String} character code * @return {String} key identifier */ charCodeToIdentifier : function(charCode){ return this.specialCharCodeMap[charCode] || String.fromCharCode(charCode).toUpperCase(); }, /** * Check whether the keycode can be reliably detected in keyup/keydown events * * @param keyCode {String} key code to check. * @return {Boolean} Whether the keycode can be reliably detected in keyup/keydown events. */ isIdentifiableKeyCode : function(keyCode){ // A-Z (TODO: is this lower or uppercase?) if(keyCode >= this.charCodeA && keyCode <= this.charCodeZ){ return true; }; // 0-9 if(keyCode >= this.charCode0 && keyCode <= this.charCode9){ return true; }; // Enter, Space, Tab, Backspace if(this.specialCharCodeMap[keyCode]){ return true; }; // Numpad if(this.numpadToCharCode[keyCode]){ return true; }; // non printable keys if(this.isNonPrintableKeyCode(keyCode)){ return true; }; return false; }, /** * Checks whether the keyCode represents a non printable key * * @param keyCode {String} key code to check. * @return {Boolean} Whether the keyCode represents a non printable key. */ isNonPrintableKeyCode : function(keyCode){ return this.keyCodeToIdentifierMap[keyCode] ? true : false; }, /** * Checks whether a given string is a valid keyIdentifier * * @param keyIdentifier {String} The key identifier. * @return {Boolean} whether the given string is a valid keyIdentifier */ isValidKeyIdentifier : function(keyIdentifier){ if(this.identifierToKeyCodeMap[keyIdentifier]){ return true; }; if(keyIdentifier.length != 1){ return false; }; if(keyIdentifier >= "0" && keyIdentifier <= "9"){ return true; }; if(keyIdentifier >= "A" && keyIdentifier <= "Z"){ return true; }; switch(keyIdentifier){case "+":case "-":case "*":case "/": return true;default: return false;}; }, /** * Checks whether a given string is a printable keyIdentifier. * * @param keyIdentifier {String} The key identifier. * @return {Boolean} whether the given string is a printable keyIdentifier. */ isPrintableKeyIdentifier : function(keyIdentifier){ if(keyIdentifier === "Space"){ return true; } else { return this.identifierToKeyCodeMap[keyIdentifier] ? false : true; }; } }, defer : function(statics, members){ // construct inverse of keyCodeToIdentifierMap if(!statics.identifierToKeyCodeMap){ statics.identifierToKeyCodeMap = { }; for(var key in statics.keyCodeToIdentifierMap){ statics.identifierToKeyCodeMap[statics.keyCodeToIdentifierMap[key]] = parseInt(key, 10); }; for(var key in statics.specialCharCodeMap){ statics.identifierToKeyCodeMap[statics.specialCharCodeMap[key]] = parseInt(key, 10); }; }; } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ************************************************************************ */ /** * A wrapper for Cookie handling. */ qx.Bootstrap.define("qx.bom.Cookie", { /* ***************************************************************************** STATICS ***************************************************************************** */ statics : { /* --------------------------------------------------------------------------- USER APPLICATION METHODS --------------------------------------------------------------------------- */ /** * Returns the string value of a cookie. * * @param key {String} The key for the saved string value. * @return {null | String} Returns the saved string value, if the cookie * contains a value for the key, <code>null</code> otherwise. */ get : function(key){ var start = document.cookie.indexOf(key + "="); var len = start + key.length + 1; if((!start) && (key != document.cookie.substring(0, key.length))){ return null; }; if(start == -1){ return null; }; var end = document.cookie.indexOf(";", len); if(end == -1){ end = document.cookie.length; }; return unescape(document.cookie.substring(len, end)); }, /** * Sets the string value of a cookie. * * @param key {String} The key for the string value. * @param value {String} The string value. * @param expires {Number?null} The expires in days starting from now, * or <code>null</code> if the cookie should deleted after browser close. * @param path {String?null} Path value. * @param domain {String?null} Domain value. * @param secure {Boolean?null} Secure flag. */ set : function(key, value, expires, path, domain, secure){ // Generate cookie var cookie = [key, "=", escape(value)]; if(expires){ var today = new Date(); today.setTime(today.getTime()); cookie.push(";expires=", new Date(today.getTime() + (expires * 1000 * 60 * 60 * 24)).toGMTString()); }; if(path){ cookie.push(";path=", path); }; if(domain){ cookie.push(";domain=", domain); }; if(secure){ cookie.push(";secure"); }; // Store cookie document.cookie = cookie.join(""); }, /** * Deletes the string value of a cookie. * * @param key {String} The key for the string value. * @param path {String?null} Path value. * @param domain {String?null} Domain value. */ del : function(key, path, domain){ if(!qx.bom.Cookie.get(key)){ return; }; // Generate cookie var cookie = [key, "="]; if(path){ cookie.push(";path=", path); }; if(domain){ cookie.push(";domain=", domain); }; cookie.push(";expires=Thu, 01-Jan-1970 00:00:01 GMT"); // Store cookie document.cookie = cookie.join(""); } } }); /* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2012 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /** * Cookie handling module */ qx.Bootstrap.define("qx.module.Cookie", { statics : { /** * Returns the string value of a cookie. * * @attachStatic {qxWeb, cookie.get} * @param key {String} The key for the saved string value. * @return {String|null} Returns the saved string value if the cookie * contains a value for the key, otherwise <code>null</code> * @signature function(key) */ get : qx.bom.Cookie.get, /** * Sets the string value of a cookie. * * @attachStatic {qxWeb, cookie.set} * @param key {String} The key for the string value. * @param value {String} The string value. * @param expires {Number?null} Expires directive value in days starting from now, * or <code>null</code> if the cookie should be deleted when the browser * is closed. * @param path {String?null} Path value. * @param domain {String?null} Domain value. * @param secure {Boolean?null} Secure flag. * @signature function(key, value, expires, path, domain, secure) */ set : qx.bom.Cookie.set, /** * Deletes the string value of a cookie. * * @attachStatic {qxWeb, cookie.del} * @param key {String} The key for the string value. * @param path {String?null} Path value. * @param domain {String?null} Domain value. * @signature function(key, path, domain) */ del : qx.bom.Cookie.del }, defer : function(statics){ qxWeb.$attachStatic({ "cookie" : { get : statics.get, set : statics.set, del : statics.del } }); } }); var exp = envinfo["qx.export"]; if (exp) { for (var name in exp) { var c = exp[name].split("."); var root = window; for (var i=0; i < c.length; i++) { root = root[c[i]]; }; window[name] = root; } } window["qx"] = undefined; try { delete window.qx; } catch(e) {} })();
source/components/DataHandler/DataHandler.js
cloud-walker/react-inspect
import React from 'react' import is from 'ramda/src/is' import pipe from 'ramda/src/pipe' import addIndex from 'ramda/src/addIndex' import map from 'ramda/src/map' import keys from 'ramda/src/keys' import stripFunction from '../../utils/stripFunction' import Level from '../Level' import Punctuation from '../Punctuation' import Key from '../Key' import Value from '../Value' import CollapseHandler from '../CollapseHandler' const Component = class extends React.Component { static displayName = 'ReactInspectDataHandler' static defaultProps = { outer: false, } render() { const {data, outer, theme} = this.props if (is(String)(data)) { return <Value type="string" theme={theme}>{`"${data}"`}</Value> } if (is(Number)(data)) { return <Value type="number" theme={theme}>{`${data}`}</Value> } if (is(Function)(data)) { const value = ( <Value type="function" theme={theme}> {stripFunction(String(data))} </Value> ) if (outer) { return value } return ( <CollapseHandler> {show => show ? value : {...value, props: {...value.props, children: 'fn'}}} </CollapseHandler> ) } if (is(Array)(data)) { const value = addIndex(map)((x, i) => ( <Level key={i}> <Component data={x} theme={theme} /> </Level> ))(data) return ( <span> <Punctuation theme={theme}>{'['}</Punctuation> {outer ? ( value ) : ( <CollapseHandler> {show => show ? ( value ) : ( <Punctuation theme={theme}>...</Punctuation> )} </CollapseHandler> )} <Punctuation theme={theme}>{']'}</Punctuation> </span> ) } if (is(Object)(data)) { const value = pipe( keys, map(x => ( <Level key={x}> <Key theme={theme}>{x}</Key> <Punctuation theme={theme}>:</Punctuation>{' '} <Component data={data[x]} theme={theme} /> </Level> )), )(data) return ( <span> <Punctuation theme={theme}>{'{'}</Punctuation> {outer ? ( value ) : ( <CollapseHandler> {show => show ? ( value ) : ( <Punctuation theme={theme}>...</Punctuation> )} </CollapseHandler> )} <Punctuation theme={theme}>{'}'}</Punctuation> </span> ) } return <Value type="keyword" theme={theme}>{`${data}`}</Value> } } export default Component
docs/src/app/components/pages/components/FlatButton/ExampleSimple.js
ArcanisCz/material-ui
import React from 'react'; import FlatButton from 'material-ui/FlatButton'; const FlatButtonExampleSimple = () => ( <div> <FlatButton label="Default" /> <FlatButton label="Primary" primary={true} /> <FlatButton label="Secondary" secondary={true} /> <FlatButton label="Disabled" disabled={true} /> </div> ); export default FlatButtonExampleSimple;
src/components/options/Settings.js
svrnm/demomonkey
import React from 'react' import ToggleButton from 'react-toggle-button' import PropTypes from 'prop-types' import JSZip from 'jszip' import AceEditor from 'react-ace' import Synchronization from './setting/Synchronization' import 'brace/theme/textmate' import 'brace/mode/ini' import 'brace/ext/searchbox' class Settings extends React.Component { static propTypes = { settings: PropTypes.object.isRequired, configurations: PropTypes.arrayOf(PropTypes.object).isRequired, onSetBaseTemplate: PropTypes.func.isRequired, onSetMonkeyInterval: PropTypes.func.isRequired, onToggleOptionalFeature: PropTypes.func.isRequired, onConnected: PropTypes.func.isRequired, onDisconnected: PropTypes.func.isRequired } downloadAll() { event.preventDefault() var zip = new JSZip() this.props.configurations.forEach((configuration) => { zip.file(configuration.name + '.mnky', configuration.content) }) zip.generateAsync({ type: 'base64' }) .then(function (content) { window.chrome.downloads.download({ url: 'data:application/zip;base64,' + content, filename: 'demomonkey-' + (new Date()).toISOString().split('T')[0] + '.zip' // Optional }) }) } render() { return ( <div className="content"> <div className="settings"> <h1>Settings</h1> <h2>Base Template</h2> <div className="template-box"> <label htmlFor="template">New configuration template (will auto-save):</label> <AceEditor height="200px" width="100%" minLines={20} theme="textmate" mode="mnky" value={this.props.settings.baseTemplate} name="template" editorProps={{$blockScrolling: true}} onChange={this.props.onSetBaseTemplate} /> </div> <h2>{'Monkey\'s Behavior'}</h2> <b>Update interval:</b> <input type="text" value={this.props.settings.monkeyInterval} onChange={this.props.onSetMonkeyInterval} /> <h2>Optional Features</h2> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('undo')} value={this.props.settings.optionalFeatures.undo}/><label><b>Undo replacements</b> when configuration is disabled</label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('autoReplace')} value={this.props.settings.optionalFeatures.autoReplace}/><label><b>Automatically apply replacements</b> when configuration is saved. <i>(This will also disable undo)</i></label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('autoSave')} value={this.props.settings.optionalFeatures.autoSave}/><label><b>Save configuration on line break</b></label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('saveOnClose')} value={this.props.settings.optionalFeatures.saveOnClose}/><label><b>Save configuration when it is closed</b></label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('adrumTracking')} value={this.props.settings.optionalFeatures.adrumTracking}/><label><b>Allow browser monitoring.</b> DemoMonkey uses AppDynamics End-User Monitoring to analyze user behavior. You need to reload your browser window after changing this value!</label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('editorAutocomplete')} value={this.props.settings.optionalFeatures.editorAutocomplete}/><label><b>Autocomplete on existing words.</b> The editor for configurations will display an auto completion providing words that are already existing within your configuration.</label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('onlyShowAvailableConfigurations')} value={this.props.settings.optionalFeatures.onlyShowAvailableConfigurations}/><label><b>Only show available configurations.</b> Set the default value for the popup toggle, which hides configurations that are not available for the current url.</label> </div> <div className="toggle-group"> <ToggleButton onToggle={() => this.props.onToggleOptionalFeature('inDevTools')} value={this.props.settings.optionalFeatures.inDevTools}/><label><b>Integrate with Chrome Dev Tools.</b> Turn this option on to see the DemoMonkey dashboard within the Chrome Developer Toolbar.</label> </div> <Synchronization remoteConnections={this.props.settings.remoteConnections} onConnected={this.props.onConnected} onDisconnected={this.props.onDisconnected} /> <h2>Backup</h2> You can always open the <a href="backup.html">backup page</a> to download your files or manipulate your settings. Please use with caution! <button className="save-button" onClick={(event) => this.downloadAll(event)}>Download all configurations</button> </div> </div> ) } } export default Settings
src/renderers/dom/client/utils/__tests__/getNodeForCharacterOffset-test.js
miaozhirui/react
/** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @emails react-core */ 'use strict'; var getTestDocument = require('getTestDocument'); var getNodeForCharacterOffset = require('getNodeForCharacterOffset'); // Create node from HTML string function createNode(html) { var node = (getTestDocument() || document).createElement('div'); node.innerHTML = html; return node; } // Check getNodeForCharacterOffset return value matches expected result. function expectNodeOffset(result, textContent, nodeOffset) { expect(result.node.textContent).toBe(textContent); expect(result.offset).toBe(nodeOffset); } describe('getNodeForCharacterOffset', function() { it('should handle siblings', function() { var node = createNode('<i>123</i><i>456</i><i>789</i>'); expectNodeOffset(getNodeForCharacterOffset(node, 0), '123', 0); expectNodeOffset(getNodeForCharacterOffset(node, 4), '456', 1); }); it('should handle trailing chars', function() { var node = createNode('<i>123</i><i>456</i><i>789</i>'); expectNodeOffset(getNodeForCharacterOffset(node, 3), '123', 3); expectNodeOffset(getNodeForCharacterOffset(node, 9), '789', 3); }); it('should handle trees', function() { var node = createNode( '<i>' + '<i>1</i>' + '<i>' + '<i>' + '<i>2</i>' + '<i></i>' + '</i>' + '</i>' + '<i>' + '3' + '<i>45</i>' + '</i>' + '</i>' ); expectNodeOffset(getNodeForCharacterOffset(node, 3), '3', 1); expectNodeOffset(getNodeForCharacterOffset(node, 5), '45', 2); expect(getNodeForCharacterOffset(node, 10)).toBeUndefined(); }); it('should handle non-existent offset', function() { var node = createNode('<i>123</i>'); expect(getNodeForCharacterOffset(node, -1)).toBeUndefined(); expect(getNodeForCharacterOffset(node, 4)).toBeUndefined(); }); });
src/svg-icons/device/battery-charging-20.js
skarnecki/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceBatteryCharging20 = (props) => ( <SvgIcon {...props}> <path d="M11 20v-3H7v3.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V17h-4.4L11 20z"/><path fillOpacity=".3" d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V17h4v-2.5H9L13 7v5.5h2L12.6 17H17V5.33C17 4.6 16.4 4 15.67 4z"/> </SvgIcon> ); DeviceBatteryCharging20 = pure(DeviceBatteryCharging20); DeviceBatteryCharging20.displayName = 'DeviceBatteryCharging20'; export default DeviceBatteryCharging20;
node_modules/react-native/local-cli/templates/HelloNavigation/components/ListItem.js
solium/swift-react-native-hybrid
'use strict'; import React, { Component } from 'react'; import { Platform, StyleSheet, Text, TouchableHighlight, TouchableNativeFeedback, View, } from 'react-native'; /** * Renders the right type of Touchable for the list item, based on platform. */ const Touchable = ({onPress, children}) => { const child = React.Children.only(children); if (Platform.OS === 'android') { return ( <TouchableNativeFeedback onPress={onPress}> {child} </TouchableNativeFeedback> ); } else { return ( <TouchableHighlight onPress={onPress} underlayColor="#ddd"> {child} </TouchableHighlight> ); } } const ListItem = ({label, onPress}) => ( <Touchable onPress={onPress}> <View style={styles.item}> <Text style={styles.label}>{label}</Text> </View> </Touchable> ); const styles = StyleSheet.create({ item: { height: 48, justifyContent: 'center', paddingLeft: 12, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: '#ddd', }, label: { fontSize: 16, } }); export default ListItem;
react-poc-guests/app/components/GuestsTable/index.js
Meesayen/react-poc
/** * * GuestsTable * */ import React from 'react'; import { Link } from 'react-router'; import Table from 'react-bootstrap/lib/Table'; import styles from './styles.css'; function GuestsTable(props) { return ( <Table striped bordered hover > <thead> <tr> <th>Name</th> <th>Email</th> <th>Address</th> </tr> </thead> <tbody> {props.list.map((el, i) => ( <tr key={`item-${i}`}> <td className={styles.name}> <Link to={`${props.pathRoot}/${i}`}> {`${el.getIn(['name', 'title'])} ${el.getIn(['name', 'first'])} ${el.getIn(['name', 'last'])}`} </Link> </td> <td>{el.get('email')}</td> <td>{el.getIn(['location', 'street'])}</td> </tr> ))} </tbody> </Table> ); } GuestsTable.propTypes = { list: React.PropTypes.array, pathRoot: React.PropTypes.string, }; export default GuestsTable;
ajax/libs/core-js/0.9.10/library.js
tholu/cdnjs
/** * Core.js 0.9.10 * https://github.com/zloirock/core-js * License: http://rock.mit-license.org * © 2015 Denis Pushkarev */ !function(undefined){ 'use strict'; var __e = null, __g = null; /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(47); __webpack_require__(2); __webpack_require__(3); __webpack_require__(4); __webpack_require__(5); __webpack_require__(6); __webpack_require__(7); __webpack_require__(8); __webpack_require__(9); __webpack_require__(10); __webpack_require__(11); __webpack_require__(12); __webpack_require__(13); __webpack_require__(14); __webpack_require__(15); __webpack_require__(16); __webpack_require__(17); __webpack_require__(18); __webpack_require__(19); __webpack_require__(20); __webpack_require__(21); __webpack_require__(22); __webpack_require__(23); __webpack_require__(24); __webpack_require__(25); __webpack_require__(26); __webpack_require__(27); __webpack_require__(28); __webpack_require__(29); __webpack_require__(30); __webpack_require__(31); __webpack_require__(32); __webpack_require__(33); __webpack_require__(34); __webpack_require__(35); __webpack_require__(36); __webpack_require__(37); __webpack_require__(38); __webpack_require__(39); __webpack_require__(40); __webpack_require__(41); __webpack_require__(42); __webpack_require__(43); __webpack_require__(44); __webpack_require__(45); __webpack_require__(46); __webpack_require__(1); __webpack_require__(48); __webpack_require__(49); __webpack_require__(50); __webpack_require__(51); __webpack_require__(52); __webpack_require__(53); __webpack_require__(54); __webpack_require__(55); __webpack_require__(56); __webpack_require__(57); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , partial = __webpack_require__(91); // https://esdiscuss.org/topic/promise-returning-delay-function $def($def.G + $def.F, { delay: function(time){ return new ($.core.Promise || $.g.Promise)(function(resolve){ setTimeout(partial.call(resolve, true), time); }); } }); /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // ECMAScript 6 symbols shim var $ = __webpack_require__(58) , setTag = __webpack_require__(60).set , uid = __webpack_require__(64) , $def = __webpack_require__(61) , $redef = __webpack_require__(87) , keyOf = __webpack_require__(92) , enumKeys = __webpack_require__(93) , assertObject = __webpack_require__(65).obj , has = $.has , $create = $.create , getDesc = $.getDesc , setDesc = $.setDesc , desc = $.desc , getNames = $.getNames , toObject = $.toObject , $Symbol = $.g.Symbol , setter = false , TAG = uid('tag') , HIDDEN = uid('hidden') , _propertyIsEnumerable = {}.propertyIsEnumerable , SymbolRegistry = {} , AllSymbols = {} , useNative = $.isFunction($Symbol); function wrap(tag){ var sym = AllSymbols[tag] = $.set($create($Symbol.prototype), TAG, tag); $.DESC && setter && setDesc(Object.prototype, tag, { configurable: true, set: function(value){ if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setDesc(this, tag, desc(1, value)); } }); return sym; } function defineProperty(it, key, D){ if(D && has(AllSymbols, key)){ if(!D.enumerable){ if(!has(it, HIDDEN))setDesc(it, HIDDEN, desc(1, {})); it[HIDDEN][key] = true; } else { if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; D = $create(D, {enumerable: desc(0, false)}); } } return setDesc(it, key, D); } function defineProperties(it, P){ assertObject(it); var keys = enumKeys(P = toObject(P)) , i = 0 , l = keys.length , key; while(l > i)defineProperty(it, key = keys[i++], P[key]); return it; } function create(it, P){ return P === undefined ? $create(it) : defineProperties($create(it), P); } function propertyIsEnumerable(key){ var E = _propertyIsEnumerable.call(this, key); return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; } function getOwnPropertyDescriptor(it, key){ var D = getDesc(it = toObject(it), key); if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; return D; } function getOwnPropertyNames(it){ var names = getNames(toObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); return result; } function getOwnPropertySymbols(it){ var names = getNames(toObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); return result; } // 19.4.1.1 Symbol([description]) if(!useNative){ $Symbol = function Symbol(){ if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor'); return wrap(uid(arguments[0])); }; $redef($Symbol.prototype, 'toString', function(){ return this[TAG]; }); $.create = create; $.setDesc = defineProperty; $.getDesc = getOwnPropertyDescriptor; $.setDescs = defineProperties; $.getNames = getOwnPropertyNames; $.getSymbols = getOwnPropertySymbols; if($.DESC && $.FW)$redef(Object.prototype, 'propertyIsEnumerable', propertyIsEnumerable, true); } var symbolStatics = { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(key){ return keyOf(SymbolRegistry, key); }, useSetter: function(){ setter = true; }, useSimple: function(){ setter = false; } }; // 19.4.2.2 Symbol.hasInstance // 19.4.2.3 Symbol.isConcatSpreadable // 19.4.2.4 Symbol.iterator // 19.4.2.6 Symbol.match // 19.4.2.8 Symbol.replace // 19.4.2.9 Symbol.search // 19.4.2.10 Symbol.species // 19.4.2.11 Symbol.split // 19.4.2.12 Symbol.toPrimitive // 19.4.2.13 Symbol.toStringTag // 19.4.2.14 Symbol.unscopables $.each.call(( 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + 'species,split,toPrimitive,toStringTag,unscopables' ).split(','), function(it){ var sym = __webpack_require__(71)(it); symbolStatics[it] = useNative ? sym : wrap(sym); } ); setter = true; $def($def.G + $def.W, {Symbol: $Symbol}); $def($def.S, 'Symbol', symbolStatics); $def($def.S + $def.F * !useNative, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: getOwnPropertySymbols }); // 19.4.3.5 Symbol.prototype[@@toStringTag] setTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setTag($.g.JSON, 'JSON', true); /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $def = __webpack_require__(61); $def($def.S, 'Object', {assign: __webpack_require__(69)}); /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.10 Object.is(value1, value2) var $def = __webpack_require__(61); $def($def.S, 'Object', { is: function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; } }); /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) var $def = __webpack_require__(61); $def($def.S, 'Object', {setPrototypeOf: __webpack_require__(70).set}); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , isObject = $.isObject , toObject = $.toObject; $.each.call(('freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,' + 'getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames').split(',') , function(KEY, ID){ var fn = ($.core.Object || {})[KEY] || Object[KEY] , forced = 0 , method = {}; method[KEY] = ID == 0 ? function freeze(it){ return isObject(it) ? fn(it) : it; } : ID == 1 ? function seal(it){ return isObject(it) ? fn(it) : it; } : ID == 2 ? function preventExtensions(it){ return isObject(it) ? fn(it) : it; } : ID == 3 ? function isFrozen(it){ return isObject(it) ? fn(it) : true; } : ID == 4 ? function isSealed(it){ return isObject(it) ? fn(it) : true; } : ID == 5 ? function isExtensible(it){ return isObject(it) ? fn(it) : false; } : ID == 6 ? function getOwnPropertyDescriptor(it, key){ return fn(toObject(it), key); } : ID == 7 ? function getPrototypeOf(it){ return fn(Object($.assertDefined(it))); } : ID == 8 ? function keys(it){ return fn(toObject(it)); } : function getOwnPropertyNames(it){ return fn(toObject(it)); }; try { fn('z'); } catch(e){ forced = 1; } $def($def.S + $def.F * forced, 'Object', method); }); /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , HAS_INSTANCE = __webpack_require__(71)('hasInstance') , FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O){ if(!$.isFunction(this) || !$.isObject(O))return false; if(!$.isObject(this.prototype))return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while(O = $.getProto(O))if(this.prototype === O)return true; return false; }}); /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , abs = Math.abs , floor = Math.floor , _isFinite = $.g.isFinite , MAX_SAFE_INTEGER = 0x1fffffffffffff; // pow(2, 53) - 1 == 9007199254740991; function isInteger(it){ return !$.isObject(it) && _isFinite(it) && floor(it) === it; } $def($def.S, 'Number', { // 20.1.2.1 Number.EPSILON EPSILON: Math.pow(2, -52), // 20.1.2.2 Number.isFinite(number) isFinite: function isFinite(it){ return typeof it == 'number' && _isFinite(it); }, // 20.1.2.3 Number.isInteger(number) isInteger: isInteger, // 20.1.2.4 Number.isNaN(number) isNaN: function isNaN(number){ return number != number; }, // 20.1.2.5 Number.isSafeInteger(number) isSafeInteger: function isSafeInteger(number){ return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER; }, // 20.1.2.6 Number.MAX_SAFE_INTEGER MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, // 20.1.2.10 Number.MIN_SAFE_INTEGER MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER, // 20.1.2.12 Number.parseFloat(string) parseFloat: parseFloat, // 20.1.2.13 Number.parseInt(string, radix) parseInt: parseInt }); /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { var Infinity = 1 / 0 , $def = __webpack_require__(61) , E = Math.E , pow = Math.pow , abs = Math.abs , exp = Math.exp , log = Math.log , sqrt = Math.sqrt , ceil = Math.ceil , floor = Math.floor , EPSILON = pow(2, -52) , EPSILON32 = pow(2, -23) , MAX32 = pow(2, 127) * (2 - EPSILON32) , MIN32 = pow(2, -126); function roundTiesToEven(n){ return n + 1 / EPSILON - 1 / EPSILON; } // 20.2.2.28 Math.sign(x) function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; } // 20.2.2.5 Math.asinh(x) function asinh(x){ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1)); } // 20.2.2.14 Math.expm1(x) function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; } $def($def.S, 'Math', { // 20.2.2.3 Math.acosh(x) acosh: function acosh(x){ return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x; }, // 20.2.2.5 Math.asinh(x) asinh: asinh, // 20.2.2.7 Math.atanh(x) atanh: function atanh(x){ return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2; }, // 20.2.2.9 Math.cbrt(x) cbrt: function cbrt(x){ return sign(x = +x) * pow(abs(x), 1 / 3); }, // 20.2.2.11 Math.clz32(x) clz32: function clz32(x){ return (x >>>= 0) ? 31 - floor(log(x + 0.5) * Math.LOG2E) : 32; }, // 20.2.2.12 Math.cosh(x) cosh: function cosh(x){ return (exp(x = +x) + exp(-x)) / 2; }, // 20.2.2.14 Math.expm1(x) expm1: expm1, // 20.2.2.16 Math.fround(x) fround: function fround(x){ var $abs = abs(x) , $sign = sign(x) , a, result; if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); if(result > MAX32 || result != result)return $sign * Infinity; return $sign * result; }, // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars var sum = 0 , len1 = arguments.length , len2 = len1 , args = Array(len1) , larg = 0 , arg; while(len1--){ arg = args[len1] = abs(arguments[len1]); if(arg == Infinity)return Infinity; if(arg > larg)larg = arg; } larg = larg || 1; while(len2--)sum += pow(args[len2] / larg, 2); return larg * sqrt(sum); }, // 20.2.2.18 Math.imul(x, y) imul: function imul(x, y){ var UInt16 = 0xffff , xn = +x , yn = +y , xl = UInt16 & xn , yl = UInt16 & yn; return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0); }, // 20.2.2.20 Math.log1p(x) log1p: function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x); }, // 20.2.2.21 Math.log10(x) log10: function log10(x){ return log(x) / Math.LN10; }, // 20.2.2.22 Math.log2(x) log2: function log2(x){ return log(x) / Math.LN2; }, // 20.2.2.28 Math.sign(x) sign: sign, // 20.2.2.30 Math.sinh(x) sinh: function sinh(x){ return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2); }, // 20.2.2.33 Math.tanh(x) tanh: function tanh(x){ var a = expm1(x = +x) , b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); }, // 20.2.2.34 Math.trunc(x) trunc: function trunc(it){ return (it > 0 ? floor : ceil)(it); } }); /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61) , toIndex = __webpack_require__(58).toIndex , fromCharCode = String.fromCharCode , $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $def($def.S + $def.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars var res = [] , len = arguments.length , i = 0 , code; while(len > i){ code = +arguments[i++]; if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61); $def($def.S, 'String', { // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function raw(callSite){ var tpl = $.toObject(callSite.raw) , len = $.toLength(tpl.length) , sln = arguments.length , res = [] , i = 0; while(len > i){ res.push(String(tpl[i++])); if(i < sln)res.push(String(arguments[i])); } return res.join(''); } }); /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { var set = __webpack_require__(58).set , $at = __webpack_require__(72)(true) , ITER = __webpack_require__(64).safe('iter') , $iter = __webpack_require__(73) , step = $iter.step; // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(74)(String, 'String', function(iterated){ set(this, ITER, {o: String(iterated), i: 0}); // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , index = iter.i , point; if(index >= O.length)return step(1); point = $at(O, index); iter.i += point.length; return step(0, point); }); /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(61) , $at = __webpack_require__(72)(false); $def($def.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos){ return $at(this, pos); } }); /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , cof = __webpack_require__(60) , $def = __webpack_require__(61) , toLength = $.toLength; // should throw error on regex $def($def.P + $def.F * !__webpack_require__(68)(function(){ 'q'.endsWith(/./); }), 'String', { // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) endsWith: function endsWith(searchString /*, endPosition = @length */){ if(cof(searchString) == 'RegExp')throw TypeError(); var that = String($.assertDefined(this)) , endPosition = arguments[1] , len = toLength(that.length) , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); searchString += ''; return that.slice(end - searchString.length, end) === searchString; } }); /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , cof = __webpack_require__(60) , $def = __webpack_require__(61); $def($def.P, 'String', { // 21.1.3.7 String.prototype.includes(searchString, position = 0) includes: function includes(searchString /*, position = 0 */){ if(cof(searchString) == 'RegExp')throw TypeError(); return !!~String($.assertDefined(this)).indexOf(searchString, arguments[1]); } }); /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61); $def($def.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: __webpack_require__(75) }); /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , cof = __webpack_require__(60) , $def = __webpack_require__(61); // should throw error on regex $def($def.P + $def.F * !__webpack_require__(68)(function(){ 'q'.startsWith(/./); }), 'String', { // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) startsWith: function startsWith(searchString /*, position = 0 */){ if(cof(searchString) == 'RegExp')throw TypeError(); var that = String($.assertDefined(this)) , index = $.toLength(Math.min(arguments[1], that.length)); searchString += ''; return that.slice(index, index + searchString.length) === searchString; } }); /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , $def = __webpack_require__(61) , $iter = __webpack_require__(73) , call = __webpack_require__(77); $def($def.S + $def.F * !__webpack_require__(79)(function(iter){ Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ var O = Object($.assertDefined(arrayLike)) , mapfn = arguments[1] , mapping = mapfn !== undefined , f = mapping ? ctx(mapfn, arguments[2], 2) : undefined , index = 0 , length, result, step, iterator; if($iter.is(O)){ iterator = $iter.get(O); // strange IE quirks mode bug -> use typeof instead of isFunction result = new (typeof this == 'function' ? this : Array); for(; !(step = iterator.next()).done; index++){ result[index] = mapping ? call(iterator, f, [step.value, index], true) : step.value; } } else { // strange IE quirks mode bug -> use typeof instead of isFunction result = new (typeof this == 'function' ? this : Array)(length = $.toLength(O.length)); for(; length > index; index++){ result[index] = mapping ? f(O[index], index) : O[index]; } } result.length = index; return result; } }); /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61); $def($def.S, 'Array', { // 22.1.2.3 Array.of( ...items) of: function of(/* ...args */){ var index = 0 , length = arguments.length // strange IE quirks mode bug -> use typeof instead of isFunction , result = new (typeof this == 'function' ? this : Array)(length); while(length > index)result[index] = arguments[index++]; result.length = length; return result; } }); /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , setUnscope = __webpack_require__(78) , ITER = __webpack_require__(64).safe('iter') , $iter = __webpack_require__(73) , step = $iter.step , Iterators = $iter.Iterators; // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() __webpack_require__(74)(Array, 'Array', function(iterated, kind){ $.set(this, ITER, {o: $.toObject(iterated), i: 0, k: kind}); // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , kind = iter.k , index = iter.i++; if(!O || index >= O.length){ iter.o = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; setUnscope('keys'); setUnscope('values'); setUnscope('entries'); /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(80)(Array); /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61) , toIndex = $.toIndex; $def($def.P, 'Array', { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) copyWithin: function copyWithin(target/* = 0 */, start /* = 0, end = @length */){ var O = Object($.assertDefined(this)) , len = $.toLength(O.length) , to = toIndex(target, len) , from = toIndex(start, len) , end = arguments[2] , fin = end === undefined ? len : toIndex(end, len) , count = Math.min(fin - from, len - to) , inc = 1; if(from < to && to < from + count){ inc = -1; from = from + count - 1; to = to + count - 1; } while(count-- > 0){ if(from in O)O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; } }); __webpack_require__(78)('copyWithin'); /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61) , toIndex = $.toIndex; $def($def.P, 'Array', { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) fill: function fill(value /*, start = 0, end = @length */){ var O = Object($.assertDefined(this)) , length = $.toLength(O.length) , index = toIndex(arguments[1], length) , end = arguments[2] , endPos = end === undefined ? length : toIndex(end, length); while(endPos > index)O[index++] = value; return O; } }); __webpack_require__(78)('fill'); /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var KEY = 'find' , $def = __webpack_require__(61) , forced = true , $find = __webpack_require__(63)(5); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { find: function find(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(78)(KEY); /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var KEY = 'findIndex' , $def = __webpack_require__(61) , forced = true , $find = __webpack_require__(63)(6); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { findIndex: function findIndex(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(78)(KEY); /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , cof = __webpack_require__(60) , $def = __webpack_require__(61) , assert = __webpack_require__(65) , forOf = __webpack_require__(81) , setProto = __webpack_require__(70).set , species = __webpack_require__(80) , SPECIES = __webpack_require__(71)('species') , RECORD = __webpack_require__(64).safe('record') , PROMISE = 'Promise' , global = $.g , process = global.process , asap = process && process.nextTick || __webpack_require__(82).set , P = global[PROMISE] , isFunction = $.isFunction , isObject = $.isObject , assertFunction = assert.fn , assertObject = assert.obj; var useNative = function(){ var test, works = false; function P2(x){ var self = new P(x); setProto(self, P2.prototype); return self; } try { works = isFunction(P) && isFunction(P.resolve) && P.resolve(test = new P(function(){})) == test; setProto(P2, P); P2.prototype = $.create(P.prototype, {constructor: {value: P2}}); // actual Firefox has broken subclass support, test that if(!(P2.resolve(5).then(function(){}) instanceof P2)){ works = false; } } catch(e){ works = false; } return works; }(); // helpers function getConstructor(C){ var S = assertObject(C)[SPECIES]; return S != undefined ? S : C; } function isThenable(it){ var then; if(isObject(it))then = it.then; return isFunction(then) ? then : false; } function notify(record){ var chain = record.c; if(chain.length)asap(function(){ var value = record.v , ok = record.s == 1 , i = 0; function run(react){ var cb = ok ? react.ok : react.fail , ret, then; try { if(cb){ if(!ok)record.h = true; ret = cb === true ? value : cb(value); if(ret === react.P){ react.rej(TypeError('Promise-chain cycle')); } else if(then = isThenable(ret)){ then.call(ret, react.res, react.rej); } else react.res(ret); } else react.rej(value); } catch(err){ react.rej(err); } } while(chain.length > i)run(chain[i++]); // variable length - can't use forEach chain.length = 0; }); } function isUnhandled(promise){ var record = promise[RECORD] , chain = record.a || record.c , i = 0 , react; if(record.h)return false; while(chain.length > i){ react = chain[i++]; if(react.fail || !isUnhandled(react.P))return false; } return true; } function $reject(value){ var record = this , promise; if(record.d)return; record.d = true; record = record.r || record; // unwrap record.v = value; record.s = 2; record.a = record.c.slice(); setTimeout(function(){ asap(function(){ if(isUnhandled(promise = record.p)){ if(cof(process) == 'process'){ process.emit('unhandledRejection', value, promise); } else if(global.console && isFunction(console.error)){ console.error('Unhandled promise rejection', value); } } record.a = undefined; }); }, 1); notify(record); } function $resolve(value){ var record = this , then, wrapper; if(record.d)return; record.d = true; record = record.r || record; // unwrap try { if(then = isThenable(value)){ wrapper = {r: record, d: false}; // wrap then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } else { record.v = value; record.s = 1; notify(record); } } catch(err){ $reject.call(wrapper || {r: record, d: false}, err); // wrap } } // constructor polyfill if(!useNative){ // 25.4.3.1 Promise(executor) P = function Promise(executor){ assertFunction(executor); var record = { p: assert.inst(this, P, PROMISE), // <- promise c: [], // <- awaiting reactions a: undefined, // <- checked in isUnhandled reactions s: 0, // <- state d: false, // <- done v: undefined, // <- value h: false // <- handled rejection }; $.hide(this, RECORD, record); try { executor(ctx($resolve, record, 1), ctx($reject, record, 1)); } catch(err){ $reject.call(record, err); } }; __webpack_require__(83)(P.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected){ var S = assertObject(assertObject(this).constructor)[SPECIES]; var react = { ok: isFunction(onFulfilled) ? onFulfilled : true, fail: isFunction(onRejected) ? onRejected : false }; var promise = react.P = new (S != undefined ? S : P)(function(res, rej){ react.res = assertFunction(res); react.rej = assertFunction(rej); }); var record = this[RECORD]; record.c.push(react); if(record.a)record.a.push(react); record.s && notify(record); return promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function(onRejected){ return this.then(undefined, onRejected); } }); } // export $def($def.G + $def.W + $def.F * !useNative, {Promise: P}); cof.set(P, PROMISE); species(P); species($.core[PROMISE]); // for wrapper // statics $def($def.S + $def.F * !useNative, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r){ return new (getConstructor(this))(function(res, rej){ rej(r); }); }, // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x){ return isObject(x) && RECORD in x && $.getProto(x) === this.prototype ? x : new (getConstructor(this))(function(res){ res(x); }); } }); $def($def.S + $def.F * !(useNative && __webpack_require__(79)(function(iter){ P.all(iter)['catch'](function(){}); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable){ var C = getConstructor(this) , values = []; return new C(function(res, rej){ forOf(iterable, false, values.push, values); var remaining = values.length , results = Array(remaining); if(remaining)$.each.call(values, function(promise, index){ C.resolve(promise).then(function(value){ results[index] = value; --remaining || res(results); }, rej); }); else res(results); }); }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable){ var C = getConstructor(this); return new C(function(res, rej){ forOf(iterable, false, function(promise){ C.resolve(promise).then(res, rej); }); }); } }); /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(84); // 23.1 Map Objects __webpack_require__(85)('Map', { // 23.1.3.6 Map.prototype.get(key) get: function get(key){ var entry = strong.getEntry(this, key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(84); // 23.2 Set Objects __webpack_require__(85)('Set', { // 23.2.3.1 Set.prototype.add(value) add: function add(value){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , weak = __webpack_require__(86) , leakStore = weak.leakStore , ID = weak.ID , WEAK = weak.WEAK , has = $.has , isObject = $.isObject , isFrozen = Object.isFrozen || $.core.Object.isFrozen , tmp = {}; // 23.3 WeakMap Objects var WeakMap = __webpack_require__(85)('WeakMap', { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key){ if(isObject(key)){ if(isFrozen(key))return leakStore(this).get(key); if(has(key, WEAK))return key[WEAK][this[ID]]; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value){ return weak.def(this, key, value); } }, weak, true, true); // IE11 WeakMap frozen keys fix if($.FW && new WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ $.each.call(['delete', 'has', 'get', 'set'], function(key){ var method = WeakMap.prototype[key]; __webpack_require__(87)(WeakMap.prototype, key, function(a, b){ // store frozen objects on leaky map if(isObject(a) && isFrozen(a)){ var result = leakStore(this)[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }); }); } /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var weak = __webpack_require__(86); // 23.4 WeakSet Objects __webpack_require__(85)('WeakSet', { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value){ return weak.def(this, value, true); } }, weak, false, true); /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , setProto = __webpack_require__(70) , $iter = __webpack_require__(73) , ITERATOR = __webpack_require__(71)('iterator') , ITER = __webpack_require__(64).safe('iter') , step = $iter.step , assert = __webpack_require__(65) , isObject = $.isObject , getProto = $.getProto , $Reflect = $.g.Reflect , _apply = Function.apply , assertObject = assert.obj , _isExtensible = Object.isExtensible || $.isObject , _preventExtensions = Object.preventExtensions || $.it // IE TP has broken Reflect.enumerate , buggyEnumerate = !($Reflect && $Reflect.enumerate && ITERATOR in $Reflect.enumerate({})); function Enumerate(iterated){ $.set(this, ITER, {o: iterated, k: undefined, i: 0}); } $iter.create(Enumerate, 'Object', function(){ var iter = this[ITER] , keys = iter.k , key; if(keys == undefined){ iter.k = keys = []; for(key in iter.o)keys.push(key); } do { if(iter.i >= keys.length)return step(1); } while(!((key = keys[iter.i++]) in iter.o)); return step(0, key); }); var reflect = { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) apply: function apply(target, thisArgument, argumentsList){ return _apply.call(target, thisArgument, argumentsList); }, // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) construct: function construct(target, argumentsList /*, newTarget*/){ var proto = assert.fn(arguments.length < 3 ? target : arguments[2]).prototype , instance = $.create(isObject(proto) ? proto : Object.prototype) , result = _apply.call(target, instance, argumentsList); return isObject(result) ? result : instance; }, // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) defineProperty: function defineProperty(target, propertyKey, attributes){ assertObject(target); try { $.setDesc(target, propertyKey, attributes); return true; } catch(e){ return false; } }, // 26.1.4 Reflect.deleteProperty(target, propertyKey) deleteProperty: function deleteProperty(target, propertyKey){ var desc = $.getDesc(assertObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; }, // 26.1.6 Reflect.get(target, propertyKey [, receiver]) get: function get(target, propertyKey/*, receiver*/){ var receiver = arguments.length < 3 ? target : arguments[2] , desc = $.getDesc(assertObject(target), propertyKey), proto; if(desc)return $.has(desc, 'value') ? desc.value : desc.get === undefined ? undefined : desc.get.call(receiver); return isObject(proto = getProto(target)) ? get(proto, propertyKey, receiver) : undefined; }, // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ return $.getDesc(assertObject(target), propertyKey); }, // 26.1.8 Reflect.getPrototypeOf(target) getPrototypeOf: function getPrototypeOf(target){ return getProto(assertObject(target)); }, // 26.1.9 Reflect.has(target, propertyKey) has: function has(target, propertyKey){ return propertyKey in target; }, // 26.1.10 Reflect.isExtensible(target) isExtensible: function isExtensible(target){ return _isExtensible(assertObject(target)); }, // 26.1.11 Reflect.ownKeys(target) ownKeys: __webpack_require__(88), // 26.1.12 Reflect.preventExtensions(target) preventExtensions: function preventExtensions(target){ assertObject(target); try { _preventExtensions(target); return true; } catch(e){ return false; } }, // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) set: function set(target, propertyKey, V/*, receiver*/){ var receiver = arguments.length < 4 ? target : arguments[3] , ownDesc = $.getDesc(assertObject(target), propertyKey) , existingDescriptor, proto; if(!ownDesc){ if(isObject(proto = getProto(target))){ return set(proto, propertyKey, V, receiver); } ownDesc = $.desc(0); } if($.has(ownDesc, 'value')){ if(ownDesc.writable === false || !isObject(receiver))return false; existingDescriptor = $.getDesc(receiver, propertyKey) || $.desc(0); existingDescriptor.value = V; $.setDesc(receiver, propertyKey, existingDescriptor); return true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } }; // 26.1.14 Reflect.setPrototypeOf(target, proto) if(setProto)reflect.setPrototypeOf = function setPrototypeOf(target, proto){ setProto.check(target, proto); try { setProto.set(target, proto); return true; } catch(e){ return false; } }; $def($def.G, {Reflect: {}}); $def($def.S + $def.F * buggyEnumerate, 'Reflect', { // 26.1.5 Reflect.enumerate(target) enumerate: function enumerate(target){ return new Enumerate(assertObject(target)); } }); $def($def.S, 'Reflect', reflect); /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/domenic/Array.prototype.includes var $def = __webpack_require__(61) , $includes = __webpack_require__(66)(true); $def($def.P, 'Array', { includes: function includes(el /*, fromIndex = 0 */){ return $includes(this, el, arguments[1]); } }); __webpack_require__(78)('includes'); /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/mathiasbynens/String.prototype.at 'use strict'; var $def = __webpack_require__(61) , $at = __webpack_require__(72)(true); $def($def.P, 'String', { at: function at(pos){ return $at(this, pos); } }); /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(61) , $pad = __webpack_require__(89); $def($def.P, 'String', { lpad: function lpad(n){ return $pad(this, n, arguments[1], true); } }); /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(61) , $pad = __webpack_require__(89); $def($def.P, 'String', { rpad: function rpad(n){ return $pad(this, n, arguments[1], false); } }); /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { // https://gist.github.com/kangax/9698100 var $def = __webpack_require__(61); $def($def.S, 'RegExp', { escape: __webpack_require__(67)(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true) }); /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { // https://gist.github.com/WebReflection/9353781 var $ = __webpack_require__(58) , $def = __webpack_require__(61) , ownKeys = __webpack_require__(88); $def($def.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ var O = $.toObject(object) , result = {}; $.each.call(ownKeys(O), function(key){ $.setDesc(result, key, $.desc(0, $.getDesc(O, key))); }); return result; } }); /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { // http://goo.gl/XkBrjD var $ = __webpack_require__(58) , $def = __webpack_require__(61); function createObjectToArray(isEntries){ return function(object){ var O = $.toObject(object) , keys = $.getKeys(O) , length = keys.length , i = 0 , result = Array(length) , key; if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]]; else while(length > i)result[i] = O[keys[i++]]; return result; }; } $def($def.S, 'Object', { values: createObjectToArray(false), entries: createObjectToArray(true) }); /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON __webpack_require__(90)('Map'); /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON __webpack_require__(90)('Set'); /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61) , $task = __webpack_require__(82); $def($def.G + $def.B, { setImmediate: $task.set, clearImmediate: $task.clear }); /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(20); var $ = __webpack_require__(58) , Iterators = __webpack_require__(73).Iterators , ITERATOR = __webpack_require__(71)('iterator') , ArrayValues = Iterators.Array , NodeList = $.g.NodeList; if($.FW && NodeList && !(ITERATOR in NodeList.prototype)){ $.hide(NodeList.prototype, ITERATOR, ArrayValues); } Iterators.NodeList = ArrayValues; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { // ie9- setTimeout & setInterval additional parameters fix var $ = __webpack_require__(58) , $def = __webpack_require__(61) , invoke = __webpack_require__(62) , partial = __webpack_require__(91) , navigator = $.g.navigator , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check function wrap(set){ return MSIE ? function(fn, time /*, ...args */){ return set(invoke( partial, [].slice.call(arguments, 2), $.isFunction(fn) ? fn : Function(fn) ), time); } : set; } $def($def.G + $def.B + $def.F * MSIE, { setTimeout: wrap($.g.setTimeout), setInterval: wrap($.g.setInterval) }); /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , $def = __webpack_require__(61) , assign = __webpack_require__(69) , keyOf = __webpack_require__(92) , ITER = __webpack_require__(64).safe('iter') , assert = __webpack_require__(65) , $iter = __webpack_require__(73) , forOf = __webpack_require__(81) , step = $iter.step , getKeys = $.getKeys , toObject = $.toObject , has = $.has; function Dict(iterable){ var dict = $.create(null); if(iterable != undefined){ if($iter.is(iterable)){ forOf(iterable, true, function(key, value){ dict[key] = value; }); } else assign(dict, iterable); } return dict; } Dict.prototype = null; function DictIterator(iterated, kind){ $.set(this, ITER, {o: toObject(iterated), a: getKeys(iterated), i: 0, k: kind}); } $iter.create(DictIterator, 'Dict', function(){ var iter = this[ITER] , O = iter.o , keys = iter.a , kind = iter.k , key; do { if(iter.i >= keys.length){ iter.o = undefined; return step(1); } } while(!has(O, key = keys[iter.i++])); if(kind == 'keys' )return step(0, key); if(kind == 'values')return step(0, O[key]); return step(0, [key, O[key]]); }); function createDictIter(kind){ return function(it){ return new DictIterator(it, kind); }; } function generic(A, B){ // strange IE quirks mode bug -> use typeof instead of isFunction return typeof A == 'function' ? A : B; } // 0 -> Dict.forEach // 1 -> Dict.map // 2 -> Dict.filter // 3 -> Dict.some // 4 -> Dict.every // 5 -> Dict.find // 6 -> Dict.findKey // 7 -> Dict.mapPairs function createDictMethod(TYPE){ var IS_MAP = TYPE == 1 , IS_EVERY = TYPE == 4; return function(object, callbackfn, that /* = undefined */){ var f = ctx(callbackfn, that, 3) , O = toObject(object) , result = IS_MAP || TYPE == 7 || TYPE == 2 ? new (generic(this, Dict)) : undefined , key, val, res; for(key in O)if(has(O, key)){ val = O[key]; res = f(val, key, object); if(TYPE){ if(IS_MAP)result[key] = res; // map else if(res)switch(TYPE){ case 2: result[key] = val; break; // filter case 3: return true; // some case 5: return val; // find case 6: return key; // findKey case 7: result[res[0]] = res[1]; // mapPairs } else if(IS_EVERY)return false; // every } } return TYPE == 3 || IS_EVERY ? IS_EVERY : result; }; } // true -> Dict.turn // false -> Dict.reduce function createDictReduce(IS_TURN){ return function(object, mapfn, init){ assert.fn(mapfn); var O = toObject(object) , keys = getKeys(O) , length = keys.length , i = 0 , memo, key, result; if(IS_TURN){ memo = init == undefined ? new (generic(this, Dict)) : Object(init); } else if(arguments.length < 3){ assert(length, 'Reduce of empty object with no initial value'); memo = O[keys[i++]]; } else memo = Object(init); while(length > i)if(has(O, key = keys[i++])){ result = mapfn(memo, O[key], key, object); if(IS_TURN){ if(result === false)break; } else memo = result; } return memo; }; } var findKey = createDictMethod(6); $def($def.G + $def.F, {Dict: Dict}); $def($def.S, 'Dict', { keys: createDictIter('keys'), values: createDictIter('values'), entries: createDictIter('entries'), forEach: createDictMethod(0), map: createDictMethod(1), filter: createDictMethod(2), some: createDictMethod(3), every: createDictMethod(4), find: createDictMethod(5), findKey: findKey, mapPairs: createDictMethod(7), reduce: createDictReduce(false), turn: createDictReduce(true), keyOf: keyOf, includes: function(object, el){ return (el == el ? keyOf(object, el) : findKey(object, function(it){ return it != it; })) !== undefined; }, // Has / get / set own property has: has, get: function(object, key){ if(has(object, key))return object[key]; }, set: $.def, isDict: function(it){ return $.isObject(it) && $.getProto(it) === Dict.prototype; } }); /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { var core = __webpack_require__(58).core , $iter = __webpack_require__(73); core.isIterable = $iter.is; core.getIterator = $iter.get; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , safe = __webpack_require__(64).safe , $def = __webpack_require__(61) , $iter = __webpack_require__(73) , forOf = __webpack_require__(81) , ENTRIES = safe('entries') , FN = safe('fn') , ITER = safe('iter') , call = __webpack_require__(77) , getIterator = $iter.get , setIterator = $iter.set , createIterator = $iter.create; function $for(iterable, entries){ if(!(this instanceof $for))return new $for(iterable, entries); this[ITER] = getIterator(iterable); this[ENTRIES] = !!entries; } createIterator($for, 'Wrapper', function(){ return this[ITER].next(); }); var $forProto = $for.prototype; setIterator($forProto, function(){ return this[ITER]; // unwrap }); function createChainIterator(next){ function Iterator(iter, fn, that){ this[ITER] = getIterator(iter); this[ENTRIES] = iter[ENTRIES]; this[FN] = ctx(fn, that, iter[ENTRIES] ? 2 : 1); } createIterator(Iterator, 'Chain', next, $forProto); setIterator(Iterator.prototype, $.that); // override $forProto iterator return Iterator; } var MapIter = createChainIterator(function(){ var step = this[ITER].next(); return step.done ? step : $iter.step(0, call(this[ITER], this[FN], step.value, this[ENTRIES])); }); var FilterIter = createChainIterator(function(){ for(;;){ var step = this[ITER].next(); if(step.done || call(this[ITER], this[FN], step.value, this[ENTRIES]))return step; } }); __webpack_require__(83)($forProto, { of: function(fn, that){ forOf(this, this[ENTRIES], fn, that); }, array: function(fn, that){ var result = []; forOf(fn != undefined ? this.map(fn, that) : this, false, result.push, result); return result; }, filter: function(fn, that){ return new FilterIter(this, fn, that); }, map: function(fn, that){ return new MapIter(this, fn, that); } }); $for.isIterable = $iter.is; $for.getIterator = getIterator; $def($def.G + $def.F, {$for: $for}); /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , cel = __webpack_require__(59) , cof = __webpack_require__(60) , $def = __webpack_require__(61) , invoke = __webpack_require__(62) , arrayMethod = __webpack_require__(63) , IE_PROTO = __webpack_require__(64).safe('__proto__') , assert = __webpack_require__(65) , assertObject = assert.obj , ObjectProto = Object.prototype , html = $.html , A = [] , _slice = A.slice , _join = A.join , classof = cof.classof , has = $.has , defineProperty = $.setDesc , getOwnDescriptor = $.getDesc , defineProperties = $.setDescs , isFunction = $.isFunction , toObject = $.toObject , toLength = $.toLength , toIndex = $.toIndex , IE8_DOM_DEFINE = false , $indexOf = __webpack_require__(66)(false) , $forEach = arrayMethod(0) , $map = arrayMethod(1) , $filter = arrayMethod(2) , $some = arrayMethod(3) , $every = arrayMethod(4); if(!$.DESC){ try { IE8_DOM_DEFINE = defineProperty(cel('div'), 'x', {get: function(){ return 8; }} ).x == 8; } catch(e){ /* empty */ } $.setDesc = function(O, P, Attributes){ if(IE8_DOM_DEFINE)try { return defineProperty(O, P, Attributes); } catch(e){ /* empty */ } if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); if('value' in Attributes)assertObject(O)[P] = Attributes.value; return O; }; $.getDesc = function(O, P){ if(IE8_DOM_DEFINE)try { return getOwnDescriptor(O, P); } catch(e){ /* empty */ } if(has(O, P))return $.desc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); }; $.setDescs = defineProperties = function(O, Properties){ assertObject(O); var keys = $.getKeys(Properties) , length = keys.length , i = 0 , P; while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); return O; }; } $def($def.S + $def.F * !$.DESC, 'Object', { // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $.getDesc, // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) defineProperty: $.setDesc, // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) defineProperties: defineProperties }); // IE 8- don't enum bug keys var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + 'toLocaleString,toString,valueOf').split(',') // Additional keys for getOwnPropertyNames , keys2 = keys1.concat('length', 'prototype') , keysLen1 = keys1.length; // Create object with `null` prototype: use iframe Object with cleared prototype var createDict = function(){ // Thrash, waste and sodomy: IE GC bug var iframe = cel('iframe') , i = keysLen1 , gt = '>' , iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write('<script>document.F=Object</script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict.prototype[keys1[i]]; return createDict(); }; function createGetKeys(names, length){ return function(object){ var O = toObject(object) , i = 0 , result = [] , key; for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(length > i)if(has(O, key = names[i++])){ ~$indexOf(result, key) || result.push(key); } return result; }; } function isPrimitive(it){ return !$.isObject(it); } function Empty(){} $def($def.S, 'Object', { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) getPrototypeOf: $.getProto = $.getProto || function(O){ O = Object(assert.def(O)); if(has(O, IE_PROTO))return O[IE_PROTO]; if(isFunction(O.constructor) && O instanceof O.constructor){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }, // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true), // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) create: $.create = $.create || function(O, /*?*/Properties){ var result; if(O !== null){ Empty.prototype = assertObject(O); result = new Empty(); Empty.prototype = null; // add "__proto__" for Object.getPrototypeOf shim result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }, // 19.1.2.14 / 15.2.3.14 Object.keys(O) keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false), // 19.1.2.17 / 15.2.3.8 Object.seal(O) seal: $.it, // <- cap // 19.1.2.5 / 15.2.3.9 Object.freeze(O) freeze: $.it, // <- cap // 19.1.2.15 / 15.2.3.10 Object.preventExtensions(O) preventExtensions: $.it, // <- cap // 19.1.2.13 / 15.2.3.11 Object.isSealed(O) isSealed: isPrimitive, // <- cap // 19.1.2.12 / 15.2.3.12 Object.isFrozen(O) isFrozen: isPrimitive, // <- cap // 19.1.2.11 / 15.2.3.13 Object.isExtensible(O) isExtensible: $.isObject // <- cap }); // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) $def($def.P, 'Function', { bind: function(that /*, args... */){ var fn = assert.fn(this) , partArgs = _slice.call(arguments, 1); function bound(/* args... */){ var args = partArgs.concat(_slice.call(arguments)); return invoke(fn, args, this instanceof bound ? $.create(fn.prototype) : that); } if(fn.prototype)bound.prototype = fn.prototype; return bound; } }); // Fix for not array-like ES3 string and DOM objects if(!(0 in Object('z') && 'z'[0] == 'z')){ $.ES5Object = function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; } var buggySlice = true; try { if(html)_slice.call(html); buggySlice = false; } catch(e){ /* empty */ } $def($def.P + $def.F * buggySlice, 'Array', { slice: function slice(begin, end){ var len = toLength(this.length) , klass = cof(this); end = end === undefined ? len : end; if(klass == 'Array')return _slice.call(this, begin, end); var start = toIndex(begin, len) , upTo = toIndex(end, len) , size = toLength(upTo - start) , cloned = Array(size) , i = 0; for(; i < size; i++)cloned[i] = klass == 'String' ? this.charAt(start + i) : this[start + i]; return cloned; } }); $def($def.P + $def.F * ($.ES5Object != Object), 'Array', { join: function join(){ return _join.apply($.ES5Object(this), arguments); } }); // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) $def($def.S, 'Array', { isArray: function(arg){ return cof(arg) == 'Array'; } }); function createArrayReduce(isRight){ return function(callbackfn, memo){ assert.fn(callbackfn); var O = toObject(this) , length = toLength(O.length) , index = isRight ? length - 1 : 0 , i = isRight ? -1 : 1; if(arguments.length < 2)for(;;){ if(index in O){ memo = O[index]; index += i; break; } index += i; assert(isRight ? index >= 0 : length > index, 'Reduce of empty array with no initial value'); } for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ memo = callbackfn(memo, O[index], index, this); } return memo; }; } $def($def.P, 'Array', { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: $.each = $.each || function forEach(callbackfn/*, that = undefined */){ return $forEach(this, callbackfn, arguments[1]); }, // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: function map(callbackfn/*, that = undefined */){ return $map(this, callbackfn, arguments[1]); }, // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: function filter(callbackfn/*, that = undefined */){ return $filter(this, callbackfn, arguments[1]); }, // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: function some(callbackfn/*, that = undefined */){ return $some(this, callbackfn, arguments[1]); }, // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: function every(callbackfn/*, that = undefined */){ return $every(this, callbackfn, arguments[1]); }, // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: createArrayReduce(false), // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: createArrayReduce(true), // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: function indexOf(el /*, fromIndex = 0 */){ return $indexOf(this, el, arguments[1]); }, // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function(el, fromIndex /* = @[*-1] */){ var O = toObject(this) , length = toLength(O.length) , index = length - 1; if(arguments.length > 1)index = Math.min(index, $.toInteger(fromIndex)); if(index < 0)index = toLength(length + index); for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; return -1; } }); // 21.1.3.25 / 15.5.4.20 String.prototype.trim() $def($def.P, 'String', {trim: __webpack_require__(67)(/^\s*([\s\S]*\S)?\s*$/, '$1')}); // 20.3.3.1 / 15.9.4.4 Date.now() $def($def.S, 'Date', {now: function(){ return +new Date; }}); function lz(num){ return num > 9 ? num : '0' + num; } // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() // PhantomJS and old webkit had a broken Date implementation. var date = new Date(-5e13 - 1) , brokenDate = !(date.toISOString && date.toISOString() == '0385-07-25T07:06:39.999Z' && __webpack_require__(68)(function(){ new Date(NaN).toISOString(); })); $def($def.P + $def.F * brokenDate, 'Date', {toISOString: function(){ if(!isFinite(this))throw RangeError('Invalid time value'); var d = this , y = d.getUTCFullYear() , m = d.getUTCMilliseconds() , s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; }}); if(classof(function(){ return arguments; }()) == 'Object')cof.classof = function(it){ var tag = classof(it); return tag == 'Object' && isFunction(it.callee) ? 'Arguments' : tag; }; /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61); // Placeholder $.core._ = $.path._ = $.path._ || {}; $def($def.P + $def.F, 'Function', { part: __webpack_require__(91) }); /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , ownKeys = __webpack_require__(88); function define(target, mixin){ var keys = ownKeys($.toObject(mixin)) , length = keys.length , i = 0, key; while(length > i)$.setDesc(target, key = keys[i++], $.getDesc(mixin, key)); return target; } $def($def.S + $def.F, 'Object', { isObject: $.isObject, classof: __webpack_require__(60).classof, define: define, make: function(proto, mixin){ return define($.create(proto), mixin); } }); /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61) , assertFunction = __webpack_require__(65).fn; $def($def.P + $def.F, 'Array', { turn: function(fn, target /* = [] */){ assertFunction(fn); var memo = target == undefined ? [] : Object(target) , O = $.ES5Object(this) , length = $.toLength(O.length) , index = 0; while(length > index)if(fn(memo, O[index], index++, this) === false)break; return memo; } }); __webpack_require__(78)('turn'); /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , ITER = __webpack_require__(64).safe('iter'); __webpack_require__(74)(Number, 'Number', function(iterated){ $.set(this, ITER, {l: $.toLength(iterated), i: 0}); }, function(){ var iter = this[ITER] , i = iter.i++ , done = i >= iter.l; return {done: done, value: done ? undefined : i}; }); /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61) , invoke = __webpack_require__(62) , methods = {}; methods.random = function(lim /* = 0 */){ var a = +this , b = lim == undefined ? 0 : +lim , m = Math.min(a, b); return Math.random() * (Math.max(a, b) - m) + m; }; if($.FW)$.each.call(( // ES3: 'round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,' + // ES6: 'acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc' ).split(','), function(key){ var fn = Math[key]; if(fn)methods[key] = function(/* ...args */){ // ie9- dont support strict mode & convert `this` to object -> convert it to number var args = [+this] , i = 0; while(arguments.length > i)args.push(arguments[i++]); return invoke(fn, args); }; } ); $def($def.P + $def.F, 'Number', methods); /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61) , replacer = __webpack_require__(67); var escapeHTMLDict = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&apos;' }, unescapeHTMLDict = {}, key; for(key in escapeHTMLDict)unescapeHTMLDict[escapeHTMLDict[key]] = key; $def($def.P + $def.F, 'String', { escapeHTML: replacer(/[&<>"']/g, escapeHTMLDict), unescapeHTML: replacer(/&(?:amp|lt|gt|quot|apos);/g, unescapeHTMLDict) }); /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , core = $.core , formatRegExp = /\b\w\w?\b/g , flexioRegExp = /:(.*)\|(.*)$/ , locales = {} , current = 'en' , SECONDS = 'Seconds' , MINUTES = 'Minutes' , HOURS = 'Hours' , DATE = 'Date' , MONTH = 'Month' , YEAR = 'FullYear'; function lz(num){ return num > 9 ? num : '0' + num; } function createFormat(prefix){ return function(template, locale /* = current */){ var that = this , dict = locales[$.has(locales, locale) ? locale : current]; function get(unit){ return that[prefix + unit](); } return String(template).replace(formatRegExp, function(part){ switch(part){ case 's' : return get(SECONDS); // Seconds : 0-59 case 'ss' : return lz(get(SECONDS)); // Seconds : 00-59 case 'm' : return get(MINUTES); // Minutes : 0-59 case 'mm' : return lz(get(MINUTES)); // Minutes : 00-59 case 'h' : return get(HOURS); // Hours : 0-23 case 'hh' : return lz(get(HOURS)); // Hours : 00-23 case 'D' : return get(DATE); // Date : 1-31 case 'DD' : return lz(get(DATE)); // Date : 01-31 case 'W' : return dict[0][get('Day')]; // Day : Понедельник case 'N' : return get(MONTH) + 1; // Month : 1-12 case 'NN' : return lz(get(MONTH) + 1); // Month : 01-12 case 'M' : return dict[2][get(MONTH)]; // Month : Январь case 'MM' : return dict[1][get(MONTH)]; // Month : Января case 'Y' : return get(YEAR); // Year : 2014 case 'YY' : return lz(get(YEAR) % 100); // Year : 14 } return part; }); }; } function addLocale(lang, locale){ function split(index){ var result = []; $.each.call(locale.months.split(','), function(it){ result.push(it.replace(flexioRegExp, '$' + index)); }); return result; } locales[lang] = [locale.weekdays.split(','), split(1), split(2)]; return core; } $def($def.P + $def.F, DATE, { format: createFormat('get'), formatUTC: createFormat('getUTC') }); addLocale(current, { weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', months: 'January,February,March,April,May,June,July,August,September,October,November,December' }); addLocale('ru', { weekdays: 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота', months: 'Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,' + 'Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь' }); core.locale = function(locale){ return $.has(locales, locale) ? current = locale : current; }; core.addLocale = addLocale; /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61); $def($def.G + $def.F, {global: __webpack_require__(58).g}); /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , $def = __webpack_require__(61) , log = {} , enabled = true; // Methods from https://github.com/DeveloperToolsWG/console-object/blob/master/api.md $.each.call(('assert,clear,count,debug,dir,dirxml,error,exception,' + 'group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,' + 'markTimeline,profile,profileEnd,table,time,timeEnd,timeline,' + 'timelineEnd,timeStamp,trace,warn').split(','), function(key){ log[key] = function(){ if(enabled && $.g.console && $.isFunction(console[key])){ return Function.apply.call(console[key], console, arguments); } }; }); $def($def.G + $def.F, {log: __webpack_require__(69)(log.log, log, { enable: function(){ enabled = true; }, disable: function(){ enabled = false; } })}); /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { // JavaScript 1.6 / Strawman array statics shim var $ = __webpack_require__(58) , $def = __webpack_require__(61) , $Array = $.core.Array || Array , statics = {}; function setStatics(keys, length){ $.each.call(keys.split(','), function(key){ if(length == undefined && key in $Array)statics[key] = $Array[key]; else if(key in [])statics[key] = __webpack_require__(76)(Function.call, [][key], length); }); } setStatics('pop,reverse,shift,keys,values,entries', 1); setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + 'reduce,reduceRight,copyWithin,fill,turn'); $def($def.S, 'Array', statics); /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var global = typeof self != 'undefined' ? self : Function('return this')() , core = {} , defineProperty = Object.defineProperty , hasOwnProperty = {}.hasOwnProperty , ceil = Math.ceil , floor = Math.floor , max = Math.max , min = Math.min; // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty. var DESC = !!function(){ try { return defineProperty({}, 'a', {get: function(){ return 2; }}).a == 2; } catch(e){ /* empty */ } }(); var hide = createDefiner(1); // 7.1.4 ToInteger function toInteger(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); } function desc(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; } function simpleSet(object, key, value){ object[key] = value; return object; } function createDefiner(bitmap){ return DESC ? function(object, key, value){ return $.setDesc(object, key, desc(bitmap, value)); } : simpleSet; } function isObject(it){ return it !== null && (typeof it == 'object' || typeof it == 'function'); } function isFunction(it){ return typeof it == 'function'; } function assertDefined(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; } var $ = module.exports = __webpack_require__(94)({ g: global, core: core, html: global.document && document.documentElement, // http://jsperf.com/core-js-isobject isObject: isObject, isFunction: isFunction, it: function(it){ return it; }, that: function(){ return this; }, // 7.1.4 ToInteger toInteger: toInteger, // 7.1.15 ToLength toLength: function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }, toIndex: function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }, has: function(it, key){ return hasOwnProperty.call(it, key); }, create: Object.create, getProto: Object.getPrototypeOf, DESC: DESC, desc: desc, getDesc: Object.getOwnPropertyDescriptor, setDesc: defineProperty, setDescs: Object.defineProperties, getKeys: Object.keys, getNames: Object.getOwnPropertyNames, getSymbols: Object.getOwnPropertySymbols, assertDefined: assertDefined, // Dummy, fix for not array-like ES3 string in es5 module ES5Object: Object, toObject: function(it){ return $.ES5Object(assertDefined(it)); }, hide: hide, def: createDefiner(0), set: global.Symbol ? simpleSet : hide, each: [].forEach }); /* eslint-disable no-undef */ if(typeof __e != 'undefined')__e = core; if(typeof __g != 'undefined')__g = global; /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , document = $.g.document , isObject = $.isObject // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , TAG = __webpack_require__(71)('toStringTag') , toString = {}.toString; function cof(it){ return toString.call(it).slice(8, -1); } cof.classof = function(it){ var O, T; return it == undefined ? it === undefined ? 'Undefined' : 'Null' : typeof (T = (O = Object(it))[TAG]) == 'string' ? T : cof(O); }; cof.set = function(it, tag, stat){ if(it && !$.has(it = stat ? it : it.prototype, TAG))$.hide(it, TAG, tag); }; module.exports = cof; /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , global = $.g , core = $.core , isFunction = $.isFunction; function ctx(fn, that){ return function(){ return fn.apply(that, arguments); }; } // type bitmap $def.F = 1; // forced $def.G = 2; // global $def.S = 4; // static $def.P = 8; // proto $def.B = 16; // bind $def.W = 32; // wrap function $def(type, name, source){ var key, own, out, exp , isGlobal = type & $def.G , isProto = type & $def.P , target = isGlobal ? global : type & $def.S ? global[name] : (global[name] || {}).prototype , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // contains in native own = !(type & $def.F) && target && key in target; if(own && key in exports)continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces if(isGlobal && !isFunction(target[key]))exp = source[key]; // bind timers to global for call from export context else if(type & $def.B && own)exp = ctx(out, global); // wrap global constructors for prevent change them in library else if(type & $def.W && target[key] == out)!function(C){ exp = function(param){ return this instanceof C ? new C(param) : C(param); }; exp.prototype = C.prototype; }(out); else exp = isProto && isFunction(out) ? ctx(Function.call, out) : out; // export exports[key] = exp; if(isProto)(exports.prototype || (exports.prototype = {}))[key] = out; } } module.exports = $def; /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { // Fast apply // http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; switch(args.length){ case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4]) : fn.call(that, args[0], args[1], args[2], args[3], args[4]); } return fn.apply(that, args); }; /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var $ = __webpack_require__(58) , ctx = __webpack_require__(76); module.exports = function(TYPE){ var IS_MAP = TYPE == 1 , IS_FILTER = TYPE == 2 , IS_SOME = TYPE == 3 , IS_EVERY = TYPE == 4 , IS_FIND_INDEX = TYPE == 6 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function($this, callbackfn, that){ var O = Object($.assertDefined($this)) , self = $.ES5Object(O) , f = ctx(callbackfn, that, 3) , length = $.toLength(self.length) , index = 0 , result = IS_MAP ? Array(length) : IS_FILTER ? [] : undefined , val, res; for(;length > index; index++)if(NO_HOLES || index in self){ val = self[index]; res = f(val, index, O); if(TYPE){ if(IS_MAP)result[index] = res; // map else if(res)switch(TYPE){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(IS_EVERY)return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { var sid = 0; function uid(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++sid + Math.random()).toString(36)); } uid.safe = __webpack_require__(58).g.Symbol || uid; module.exports = uid; /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58); function assert(condition, msg1, msg2){ if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1); } assert.def = $.assertDefined; assert.fn = function(it){ if(!$.isFunction(it))throw TypeError(it + ' is not a function!'); return it; }; assert.obj = function(it){ if(!$.isObject(it))throw TypeError(it + ' is not an object!'); return it; }; assert.inst = function(it, Constructor, name){ if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); return it; }; module.exports = assert; /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var $ = __webpack_require__(58); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = $.toObject($this) , length = $.toLength(O.length) , index = $.toIndex(fromIndex, length) , value; if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; } else for(;length > index; index++)if(IS_INCLUDES || index in O){ if(O[index] === el)return IS_INCLUDES || index; } return !IS_INCLUDES && -1; }; }; /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = function(regExp, replace, isStatic){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; } : replace; return function(it){ return String(isStatic ? it : this).replace(regExp, replacer); }; }; /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { module.exports = function(exec){ try { exec(); return false; } catch(e){ return true; } }; /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , enumKeys = __webpack_require__(93); // 19.1.2.1 Object.assign(target, source, ...) /* eslint-disable no-unused-vars */ module.exports = Object.assign || function assign(target, source){ /* eslint-enable no-unused-vars */ var T = Object($.assertDefined(target)) , l = arguments.length , i = 1; while(l > i){ var S = $.ES5Object(arguments[i++]) , keys = enumKeys(S) , length = keys.length , j = 0 , key; while(length > j)T[key = keys[j++]] = S[key]; } return T; }; /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var $ = __webpack_require__(58) , assert = __webpack_require__(65); function check(O, proto){ assert.obj(O); assert(proto === null || $.isObject(proto), proto, ": can't set as prototype!"); } module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} // eslint-disable-line ? function(buggy, set){ try { set = __webpack_require__(76)(Function.call, $.getDesc(Object.prototype, '__proto__').set, 2); set({}, []); } catch(e){ buggy = true; } return function setPrototypeOf(O, proto){ check(O, proto); if(buggy)O.__proto__ = proto; else set(O, proto); return O; }; }() : undefined), check: check }; /***/ }, /* 71 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(58).g , store = {}; module.exports = function(name){ return store[name] || (store[name] = global.Symbol && global.Symbol[name] || __webpack_require__(64).safe('Symbol.' + name)); }; /***/ }, /* 72 */ /***/ function(module, exports, __webpack_require__) { // true -> String#at // false -> String#codePointAt var $ = __webpack_require__(58); module.exports = function(TO_STRING){ return function(that, pos){ var s = String($.assertDefined(that)) , i = $.toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }, /* 73 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , cof = __webpack_require__(60) , assertObject = __webpack_require__(65).obj , SYMBOL_ITERATOR = __webpack_require__(71)('iterator') , FF_ITERATOR = '@@iterator' , Iterators = {} , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() setIterator(IteratorPrototype, $.that); function setIterator(O, value){ $.hide(O, SYMBOL_ITERATOR, value); // Add iterator for FF iterator protocol if(FF_ITERATOR in [])$.hide(O, FF_ITERATOR, value); } module.exports = { // Safari has buggy iterators w/o `next` BUGGY: 'keys' in [] && !('next' in [].keys()), Iterators: Iterators, step: function(done, value){ return {value: value, done: !!done}; }, is: function(it){ var O = Object(it) , Symbol = $.g.Symbol , SYM = Symbol && Symbol.iterator || FF_ITERATOR; return SYM in O || SYMBOL_ITERATOR in O || $.has(Iterators, cof.classof(O)); }, get: function(it){ var Symbol = $.g.Symbol , ext = it[Symbol && Symbol.iterator || FF_ITERATOR] , getIter = ext || it[SYMBOL_ITERATOR] || Iterators[cof.classof(it)]; return assertObject(getIter.call(it)); }, set: setIterator, create: function(Constructor, NAME, next, proto){ Constructor.prototype = $.create(proto || IteratorPrototype, {next: $.desc(1, next)}); cof.set(Constructor, NAME + ' Iterator'); } }; /***/ }, /* 74 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(61) , $redef = __webpack_require__(87) , $ = __webpack_require__(58) , cof = __webpack_require__(60) , $iter = __webpack_require__(73) , SYMBOL_ITERATOR = __webpack_require__(71)('iterator') , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values' , Iterators = $iter.Iterators; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){ $iter.create(Constructor, NAME, next); function createMethod(kind){ function $$(that){ return new Constructor(that, kind); } switch(kind){ case KEYS: return function keys(){ return $$(this); }; case VALUES: return function values(){ return $$(this); }; } return function entries(){ return $$(this); }; } var TAG = NAME + ' Iterator' , proto = Base.prototype , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , _default = _native || createMethod(DEFAULT) , methods, key; // Fix native if(_native){ var IteratorPrototype = $.getProto(_default.call(new Base)); // Set @@toStringTag to native iterators cof.set(IteratorPrototype, TAG, true); // FF fix if($.FW && $.has(proto, FF_ITERATOR))$iter.set(IteratorPrototype, $.that); } // Define iterator if($.FW)$iter.set(proto, _default); // Plug for library Iterators[NAME] = _default; Iterators[TAG] = $.that; if(DEFAULT){ methods = { keys: IS_SET ? _default : createMethod(KEYS), values: DEFAULT == VALUES ? _default : createMethod(VALUES), entries: DEFAULT != VALUES ? _default : createMethod('entries') }; if(FORCE)for(key in methods){ if(!(key in proto))$redef(proto, key, methods[key]); } else $def($def.P + $def.F * $iter.BUGGY, NAME, methods); } }; /***/ }, /* 75 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58); module.exports = function repeat(count){ var str = String($.assertDefined(this)) , res = '' , n = $.toInteger(count); if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; /***/ }, /* 76 */ /***/ function(module, exports, __webpack_require__) { // Optional / simple context binding var assertFunction = __webpack_require__(65).fn; module.exports = function(fn, that, length){ assertFunction(fn); if(~length && that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); }; case 2: return function(a, b){ return fn.call(that, a, b); }; case 3: return function(a, b, c){ return fn.call(that, a, b, c); }; } return function(/* ...args */){ return fn.apply(that, arguments); }; }; /***/ }, /* 77 */ /***/ function(module, exports, __webpack_require__) { var assertObject = __webpack_require__(65).obj; function close(iterator){ var ret = iterator['return']; if(ret !== undefined)assertObject(ret.call(iterator)); } function call(iterator, fn, value, entries){ try { return entries ? fn(assertObject(value)[0], value[1]) : fn(value); } catch(e){ close(iterator); throw e; } } call.close = close; module.exports = call; /***/ }, /* 78 */ /***/ function(module, exports, __webpack_require__) { // 22.1.3.31 Array.prototype[@@unscopables] var $ = __webpack_require__(58) , UNSCOPABLES = __webpack_require__(71)('unscopables'); if($.FW && !(UNSCOPABLES in []))$.hide(Array.prototype, UNSCOPABLES, {}); module.exports = function(key){ if($.FW)[][UNSCOPABLES][key] = true; }; /***/ }, /* 79 */ /***/ function(module, exports, __webpack_require__) { var SYMBOL_ITERATOR = __webpack_require__(71)('iterator') , SAFE_CLOSING = false; try { var riter = [7][SYMBOL_ITERATOR](); riter['return'] = function(){ SAFE_CLOSING = true; }; Array.from(riter, function(){ throw 2; }); } catch(e){ /* empty */ } module.exports = function(exec){ if(!SAFE_CLOSING)return false; var safe = false; try { var arr = [7] , iter = arr[SYMBOL_ITERATOR](); iter.next = function(){ safe = true; }; arr[SYMBOL_ITERATOR] = function(){ return iter; }; exec(arr); } catch(e){ /* empty */ } return safe; }; /***/ }, /* 80 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , SPECIES = __webpack_require__(71)('species'); module.exports = function(C){ if($.DESC && !(SPECIES in C))$.setDesc(C, SPECIES, { configurable: true, get: $.that }); }; /***/ }, /* 81 */ /***/ function(module, exports, __webpack_require__) { var ctx = __webpack_require__(76) , get = __webpack_require__(73).get , call = __webpack_require__(77); module.exports = function(iterable, entries, fn, that){ var iterator = get(iterable) , f = ctx(fn, that, entries ? 2 : 1) , step; while(!(step = iterator.next()).done){ if(call(iterator, f, step.value, entries) === false){ return call.close(iterator); } } }; /***/ }, /* 82 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , cof = __webpack_require__(60) , invoke = __webpack_require__(62) , cel = __webpack_require__(59) , global = $.g , isFunction = $.isFunction , html = $.html , process = global.process , setTask = global.setImmediate , clearTask = global.clearImmediate , postMessage = global.postMessage , addEventListener = global.addEventListener , MessageChannel = global.MessageChannel , counter = 0 , queue = {} , ONREADYSTATECHANGE = 'onreadystatechange' , defer, channel, port; function run(){ var id = +this; if($.has(queue, id)){ var fn = queue[id]; delete queue[id]; fn(); } } function listner(event){ run.call(event.data); } // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if(!isFunction(setTask) || !isFunction(clearTask)){ setTask = function(fn){ var args = [], i = 1; while(arguments.length > i)args.push(arguments[i++]); queue[++counter] = function(){ invoke(isFunction(fn) ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function(id){ delete queue[id]; }; // Node.js 0.8- if(cof(process) == 'process'){ defer = function(id){ process.nextTick(ctx(run, id, 1)); }; // Modern browsers, skip implementation for WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is object } else if(addEventListener && isFunction(postMessage) && !global.importScripts){ defer = function(id){ postMessage(id, '*'); }; addEventListener('message', listner, false); // WebWorkers } else if(isFunction(MessageChannel)){ channel = new MessageChannel; port = channel.port2; channel.port1.onmessage = listner; defer = ctx(port.postMessage, port, 1); // IE8- } else if(ONREADYSTATECHANGE in cel('script')){ defer = function(id){ html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function(id){ setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; /***/ }, /* 83 */ /***/ function(module, exports, __webpack_require__) { var $redef = __webpack_require__(87); module.exports = function(target, src){ for(var key in src)$redef(target, key, src[key]); return target; }; /***/ }, /* 84 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , ctx = __webpack_require__(76) , safe = __webpack_require__(64).safe , assert = __webpack_require__(65) , forOf = __webpack_require__(81) , step = __webpack_require__(73).step , has = $.has , set = $.set , isObject = $.isObject , hide = $.hide , isFrozen = Object.isFrozen || $.core.Object.isFrozen , ID = safe('id') , O1 = safe('O1') , LAST = safe('last') , FIRST = safe('first') , ITER = safe('iter') , SIZE = $.DESC ? safe('size') : 'size' , id = 0; function fastKey(it, create){ // return primitive with prefix if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it; // can't set id to frozen object if(isFrozen(it))return 'F'; if(!has(it, ID)){ // not necessary to add id if(!create)return 'E'; // add missing object id hide(it, ID, ++id); // return object id with prefix } return 'O' + it[ID]; } function getEntry(that, key){ // fast case var index = fastKey(key), entry; if(index != 'F')return that[O1][index]; // frozen object case for(entry = that[FIRST]; entry; entry = entry.n){ if(entry.k == key)return entry; } } module.exports = { getConstructor: function(NAME, IS_MAP, ADDER){ function C(){ var that = assert.inst(this, C, NAME) , iterable = arguments[0]; set(that, O1, $.create(null)); set(that, SIZE, 0); set(that, LAST, undefined); set(that, FIRST, undefined); if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); } __webpack_require__(83)(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear(){ for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){ entry.r = true; if(entry.p)entry.p = entry.p.n = undefined; delete data[entry.i]; } that[FIRST] = that[LAST] = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function(key){ var that = this , entry = getEntry(that, key); if(entry){ var next = entry.n , prev = entry.p; delete that[O1][entry.i]; entry.r = true; if(prev)prev.n = next; if(next)next.p = prev; if(that[FIRST] == entry)that[FIRST] = next; if(that[LAST] == entry)that[LAST] = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /*, that = undefined */){ var f = ctx(callbackfn, arguments[1], 3) , entry; while(entry = entry ? entry.n : this[FIRST]){ f(entry.v, entry.k, this); // revert to the last existing entry while(entry && entry.r)entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key){ return !!getEntry(this, key); } }); if($.DESC)$.setDesc(C.prototype, 'size', { get: function(){ return assert.def(this[SIZE]); } }); return C; }, def: function(that, key, value){ var entry = getEntry(that, key) , prev, index; // change existing entry if(entry){ entry.v = value; // create new entry } else { that[LAST] = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that[LAST], // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if(!that[FIRST])that[FIRST] = entry; if(prev)prev.n = entry; that[SIZE]++; // add to index if(index != 'F')that[O1][index] = entry; } return that; }, getEntry: getEntry, // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 setIter: function(C, NAME, IS_MAP){ __webpack_require__(74)(C, NAME, function(iterated, kind){ set(this, ITER, {o: iterated, k: kind}); }, function(){ var iter = this[ITER] , kind = iter.k , entry = iter.l; // revert to the last existing entry while(entry && entry.r)entry = entry.p; // get next entry if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){ // or finish the iteration iter.o = undefined; return step(1); } // return step by kind if(kind == 'keys' )return step(0, entry.k); if(kind == 'values')return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); } }; /***/ }, /* 85 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , $def = __webpack_require__(61) , BUGGY = __webpack_require__(73).BUGGY , forOf = __webpack_require__(81) , species = __webpack_require__(80) , assertInstance = __webpack_require__(65).inst; module.exports = function(NAME, methods, common, IS_MAP, IS_WEAK){ var Base = $.g[NAME] , C = Base , ADDER = IS_MAP ? 'set' : 'add' , proto = C && C.prototype , O = {}; function fixMethod(KEY, CHAIN){ if($.FW){ var method = proto[KEY]; __webpack_require__(87)(proto, KEY, function(a, b){ var result = method.call(this, a === 0 ? 0 : a, b); return CHAIN ? this : result; }); } } if(!$.isFunction(C) || !(IS_WEAK || !BUGGY && proto.forEach && proto.entries)){ // create collection constructor C = common.getConstructor(NAME, IS_MAP, ADDER); __webpack_require__(83)(C.prototype, methods); } else { var inst = new C , chain = inst[ADDER](IS_WEAK ? {} : -0, 1) , buggyZero; // wrap for init collections from iterable if(!__webpack_require__(79)(function(iter){ new C(iter); })){ // eslint-disable-line no-new C = function(){ assertInstance(this, C, NAME); var that = new Base , iterable = arguments[0]; if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); return that; }; C.prototype = proto; if($.FW)proto.constructor = C; } IS_WEAK || inst.forEach(function(val, key){ buggyZero = 1 / key === -Infinity; }); // fix converting -0 key to +0 if(buggyZero){ fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } // + fix .add & .set for chaining if(buggyZero || chain !== inst)fixMethod(ADDER, true); } __webpack_require__(60).set(C, NAME); O[NAME] = C; $def($def.G + $def.W + $def.F * (C != Base), O); species(C); species($.core[NAME]); // for wrapper if(!IS_WEAK)common.setIter(C, NAME, IS_MAP); return C; }; /***/ }, /* 86 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , safe = __webpack_require__(64).safe , assert = __webpack_require__(65) , forOf = __webpack_require__(81) , _has = $.has , isObject = $.isObject , hide = $.hide , isFrozen = Object.isFrozen || $.core.Object.isFrozen , id = 0 , ID = safe('id') , WEAK = safe('weak') , LEAK = safe('leak') , method = __webpack_require__(63) , find = method(5) , findIndex = method(6); function findFrozen(store, key){ return find(store.array, function(it){ return it[0] === key; }); } // fallback for frozen keys function leakStore(that){ return that[LEAK] || hide(that, LEAK, { array: [], get: function(key){ var entry = findFrozen(this, key); if(entry)return entry[1]; }, has: function(key){ return !!findFrozen(this, key); }, set: function(key, value){ var entry = findFrozen(this, key); if(entry)entry[1] = value; else this.array.push([key, value]); }, 'delete': function(key){ var index = findIndex(this.array, function(it){ return it[0] === key; }); if(~index)this.array.splice(index, 1); return !!~index; } })[LEAK]; } module.exports = { getConstructor: function(NAME, IS_MAP, ADDER){ function C(){ $.set(assert.inst(this, C, NAME), ID, id++); var iterable = arguments[0]; if(iterable != undefined)forOf(iterable, IS_MAP, this[ADDER], this); } __webpack_require__(83)(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this)['delete'](key); return _has(key, WEAK) && _has(key[WEAK], this[ID]) && delete key[WEAK][this[ID]]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this).has(key); return _has(key, WEAK) && _has(key[WEAK], this[ID]); } }); return C; }, def: function(that, key, value){ if(isFrozen(assert.obj(key))){ leakStore(that).set(key, value); } else { _has(key, WEAK) || hide(key, WEAK, {}); key[WEAK][that[ID]] = value; } return that; }, leakStore: leakStore, WEAK: WEAK, ID: ID }; /***/ }, /* 87 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(58).hide; /***/ }, /* 88 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58) , assertObject = __webpack_require__(65).obj; module.exports = function ownKeys(it){ assertObject(it); var keys = $.getNames(it) , getSymbols = $.getSymbols; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; /***/ }, /* 89 */ /***/ function(module, exports, __webpack_require__) { // http://wiki.ecmascript.org/doku.php?id=strawman:string_padding var $ = __webpack_require__(58) , repeat = __webpack_require__(75); module.exports = function(that, minLength, fillChar, left){ // 1. Let O be CheckObjectCoercible(this value). // 2. Let S be ToString(O). var S = String($.assertDefined(that)); // 4. If intMinLength is undefined, return S. if(minLength === undefined)return S; // 4. Let intMinLength be ToInteger(minLength). var intMinLength = $.toInteger(minLength); // 5. Let fillLen be the number of characters in S minus intMinLength. var fillLen = intMinLength - S.length; // 6. If fillLen < 0, then throw a RangeError exception. // 7. If fillLen is +∞, then throw a RangeError exception. if(fillLen < 0 || fillLen === Infinity){ throw new RangeError('Cannot satisfy string length ' + minLength + ' for string: ' + S); } // 8. Let sFillStr be the string represented by fillStr. // 9. If sFillStr is undefined, let sFillStr be a space character. var sFillStr = fillChar === undefined ? ' ' : String(fillChar); // 10. Let sFillVal be a String made of sFillStr, repeated until fillLen is met. var sFillVal = repeat.call(sFillStr, Math.ceil(fillLen / sFillStr.length)); // truncate if we overflowed if(sFillVal.length > fillLen)sFillVal = left ? sFillVal.slice(sFillVal.length - fillLen) : sFillVal.slice(0, fillLen); // 11. Return a string made from sFillVal, followed by S. // 11. Return a String made from S, followed by sFillVal. return left ? sFillVal.concat(S) : S.concat(sFillVal); }; /***/ }, /* 90 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $def = __webpack_require__(61) , forOf = __webpack_require__(81); module.exports = function(NAME){ $def($def.P, NAME, { toJSON: function toJSON(){ var arr = []; forOf(this, false, arr.push, arr); return arr; } }); }; /***/ }, /* 91 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(58) , invoke = __webpack_require__(62) , assertFunction = __webpack_require__(65).fn; module.exports = function(/* ...pargs */){ var fn = assertFunction(this) , length = arguments.length , pargs = Array(length) , i = 0 , _ = $.path._ , holder = false; while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; return function(/* ...args */){ var that = this , _length = arguments.length , j = 0, k = 0, args; if(!holder && !_length)return invoke(fn, pargs, that); args = pargs.slice(); if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; while(_length > k)args.push(arguments[k++]); return invoke(fn, args, that); }; }; /***/ }, /* 92 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58); module.exports = function(object, el){ var O = $.toObject(object) , keys = $.getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; /***/ }, /* 93 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(58); module.exports = function(it){ var keys = $.getKeys(it) , getDesc = $.getDesc , getSymbols = $.getSymbols; if(getSymbols)$.each.call(getSymbols(it), function(key){ if(getDesc(it, key).enumerable)keys.push(key); }); return keys; }; /***/ }, /* 94 */ /***/ function(module, exports, __webpack_require__) { module.exports = function($){ $.FW = false; $.path = $.core; return $; }; /***/ } /******/ ]); // CommonJS export if(typeof module != 'undefined' && module.exports)module.exports = __e; // RequireJS export else if(typeof define == 'function' && define.amd)define(function(){return __e}); // Export to global object else __g.core = __e; }();
manager/js/components/common/Spinner.js
dunkvalio/ReactNative
import React from 'react'; import { View, ActivityIndicator } from 'react-native'; const Spinner = ({ size }) => { return ( <View style={styles.spinnerStyle}> <ActivityIndicator size={size || 'large'} /> </View> ); }; const styles = { spinnerStyle: { flex: 1, justifyContent: 'center', alignItems: 'center', } } export { Spinner };
fields/types/number/NumberColumn.js
dryna/keystone-twoje-urodziny
import React from 'react'; import numeral from 'numeral'; import ItemsTableCell from '../../components/ItemsTableCell'; import ItemsTableValue from '../../components/ItemsTableValue'; var NumberColumn = React.createClass({ displayName: 'NumberColumn', propTypes: { col: React.PropTypes.object, data: React.PropTypes.object, }, renderValue () { const value = this.props.data.fields[this.props.col.path]; if (!value || isNaN(value)) return null; const formattedValue = (this.props.col.path === 'money') ? numeral(value).format('$0,0.00') : value; return formattedValue; }, render () { return ( <ItemsTableCell> <ItemsTableValue field={this.props.col.type}> {this.renderValue()} </ItemsTableValue> </ItemsTableCell> ); }, }); module.exports = NumberColumn;
ajax/libs/material-ui/5.0.0-alpha.13/node/TextareaAutosize/TextareaAutosize.js
cdnjs/cdnjs
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _debounce = _interopRequireDefault(require("../utils/debounce")); var _useForkRef = _interopRequireDefault(require("../utils/useForkRef")); var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect")); var _ownerWindow = _interopRequireDefault(require("../utils/ownerWindow")); function getStyleValue(computedStyle, property) { return parseInt(computedStyle[property], 10) || 0; } const styles = { /* Styles applied to the shadow textarea element. */ shadow: { // Visibility needed to hide the extra text area on iPads visibility: 'hidden', // Remove from the content flow position: 'absolute', // Ignore the scrollbar width overflow: 'hidden', height: 0, top: 0, left: 0, // Create a new layer, increase the isolation of the computed values transform: 'translateZ(0)' } }; const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(props, ref) { const { onChange, maxRows, minRows = 1, style, value } = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, ["onChange", "maxRows", "minRows", "style", "value"]); const { current: isControlled } = React.useRef(value != null); const inputRef = React.useRef(null); const handleRef = (0, _useForkRef.default)(ref, inputRef); const shadowRef = React.useRef(null); const renders = React.useRef(0); const [state, setState] = React.useState({}); const syncHeight = React.useCallback(() => { const input = inputRef.current; const containerWindow = (0, _ownerWindow.default)(input); const computedStyle = containerWindow.getComputedStyle(input); const inputShallow = shadowRef.current; inputShallow.style.width = computedStyle.width; inputShallow.value = input.value || props.placeholder || 'x'; if (inputShallow.value.slice(-1) === '\n') { // Certain fonts which overflow the line height will cause the textarea // to report a different scrollHeight depending on whether the last line // is empty. Make it non-empty to avoid this issue. inputShallow.value += ' '; } const boxSizing = computedStyle['box-sizing']; const padding = getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top'); const border = getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); // The height of the inner content const innerHeight = inputShallow.scrollHeight - padding; // Measure height of a textarea with a single row inputShallow.value = 'x'; const singleRowHeight = inputShallow.scrollHeight - padding; // The height of the outer content let outerHeight = innerHeight; if (minRows) { outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight); } if (maxRows) { outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight); } outerHeight = Math.max(outerHeight, singleRowHeight); // Take the box sizing into account for applying this value as a style. const outerHeightStyle = outerHeight + (boxSizing === 'border-box' ? padding + border : 0); const overflow = Math.abs(outerHeight - innerHeight) <= 1; setState(prevState => { // Need a large enough difference to update the height. // This prevents infinite rendering loop. if (renders.current < 20 && (outerHeightStyle > 0 && Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1 || prevState.overflow !== overflow)) { renders.current += 1; return { overflow, outerHeightStyle }; } if (process.env.NODE_ENV !== 'production') { if (renders.current === 20) { console.error(['Material-UI: Too many re-renders. The layout is unstable.', 'TextareaAutosize limits the number of renders to prevent an infinite loop.'].join('\n')); } } return prevState; }); }, [maxRows, minRows, props.placeholder]); React.useEffect(() => { const handleResize = (0, _debounce.default)(() => { renders.current = 0; syncHeight(); }); const containerWindow = (0, _ownerWindow.default)(inputRef.current); containerWindow.addEventListener('resize', handleResize); return () => { handleResize.clear(); containerWindow.removeEventListener('resize', handleResize); }; }, [syncHeight]); (0, _useEnhancedEffect.default)(() => { syncHeight(); }); React.useEffect(() => { renders.current = 0; }, [value]); const handleChange = event => { renders.current = 0; if (!isControlled) { syncHeight(); } if (onChange) { onChange(event); } }; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("textarea", (0, _extends2.default)({ value: value, onChange: handleChange, ref: handleRef // Apply the rows prop to get a "correct" first SSR paint , rows: minRows, style: (0, _extends2.default)({ height: state.outerHeightStyle, // Need a large enough difference to allow scrolling. // This prevents infinite rendering loop. overflow: state.overflow ? 'hidden' : null }, style) }, other)), /*#__PURE__*/React.createElement("textarea", { "aria-hidden": true, className: props.className, readOnly: true, ref: shadowRef, tabIndex: -1, style: (0, _extends2.default)({}, styles.shadow, style) })); }); process.env.NODE_ENV !== "production" ? TextareaAutosize.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * @ignore */ className: _propTypes.default.string, /** * Maximum number of rows to display. */ maxRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), /** * Minimum number of rows to display. * @default 1 */ minRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), /** * @ignore */ onChange: _propTypes.default.func, /** * @ignore */ placeholder: _propTypes.default.string, /** * @ignore */ style: _propTypes.default.object, /** * @ignore */ value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.number, _propTypes.default.string]) } : void 0; var _default = TextareaAutosize; exports.default = _default;
src/content/index.js
Vision100IT/v100it-template
import React from 'react'; import FaFacebookSquare from 'react-icons/lib/fa/facebook-square'; import FaTwitterSquare from 'react-icons/lib/fa/twitter-square'; import boardMembers from './board-members'; import teamMembers from './team-members'; export default { boardMembers, teamMembers, hero: { tagline: '# Can a church really do IT _effectively?_\n# Come on, we’ll show you' }, banners: [{ display: 'visible', type: 'announcement', text: 'Testing the announcement banner' }, { display: 'visible', type: 'warning', text: 'Testing the warning banner' }], productcards: [{ number: 'one', background: 'black', image: 'elvanto.png', imagepadding: '10', text: 'Have you got started with Elvanto yet?' }, { number: 'two', background: 'white', image: 'soul.jpeg', imagepadding: '10', text: 'Let us help you get the most out of your website' }, { number: 'three', background: 'black', image: 'sparkleshare.png', imagepadding: '10', text: 'Dropbox, google drive & USB sticks making you nuts?' }, { number: 'four', background: 'white', image: 'close-image.jpeg', imagepadding: '0', text: 'Thinking of a refresh? Read our recommendations' }], mainmenu: { links: [{ text: 'How we<br />can help you', to: '#how' }, { text: 'Who are<br />New Front Door?', to: '#who' }, { text: 'Philosophy<br />+ Tools', to: '#tools' }, { text: 'Events +<br />Training', to: '#events' }, { text: 'Pricing', to: '#pricing' }, { text: 'Come<br />on board', to: '#join' }] }, clientmenu: { links: [{ text: 'Feature<br />Request', to: '/feature' }, { text: 'Support<br />Request', to: '/support' }, { text: 'About Us', to: '/about' }] }, mobilemenu: { primary: [{ text: 'News', to: '/client' }, { text: 'Visitor', to: '#how' }], secondary: [{ text: 'Search', to: '#' }, { text: 'News', to: '/client' }], teriary: [{ text: 'Search', to: '#' }, { text: 'Contact', to: '/contact' }] }, footerLinks: [{ heading: 'Our', links: [{ text: 'Philosophy + Tools', to: '/#tools' }, { text: 'Pitch', to: '/#how' }, { text: 'Events', to: '/#events' }, { text: 'Pricing', to: '/#pricing' }, { text: 'Consultation', to: '/consultation' }] }, { heading: 'About Us', links: [{ text: 'Mission + Vision', to: '/about#mission' }, { text: 'History', to: '/about#history' }, { text: 'Team Members', to: '/about#team' }, { text: 'Privacy Policy', to: '/documentation/privacy' }] }, { heading: 'Support', links: [{ text: 'Support Request', to: '/support' }, { text: 'Feature Request', to: '/feature' }, { text: 'Contact Us', to: '/contact' }] }, { heading: 'Connect', links: [{ text: 'Podcast', target: 'https://podcasts.apple.com/au/podcast/new-front-door-the-church-it-guild/id1477414931' }, { text: 'Mailing List', to: '/contact' }, { children: (<FaFacebookSquare/>), target: 'https://www.facebook.com/NewFrontDoorIT/' }, { children: (<FaTwitterSquare/>), target: 'https://twitter.com/NewFrontDoorIT' }] }, { links: [] }] };
ajax/libs/F2/1.3.2/f2.no-easyXDM.min.js
warpech/cdnjs
/*! F2 - v1.3.2 - 11-18-2013 - See below for copyright and license */ (function(exports){if(!exports.F2||exports.F2_TESTING_MODE){/*! JSON.org requires the following notice to accompany json2: Copyright (c) 2002 JSON.org http://json.org 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 shall be used for Good, not Evil. 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. */ "object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,s=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(i=l.length,n=0;i>n;n+=1)a[n]=str(n,l)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,l),o&&a.push(quote(r)+(gap?": ":":")+o));else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(o=str(r,l),o&&a.push(quote(r)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),/*! * jQuery JavaScript Library v1.8.3 * The jQuery Foundation and other contributors require the following notice to accompany jQuery: * * Copyright (c) 2013 jQuery Foundation and other contributors * * http://jquery.com * * 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. * */ function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var o="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(o),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(i){}Y.data(e,n,r)}else r=t}return r}function o(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var o=!!t.call(e,r,e);return o===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(Mt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Dt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,o,i=Y._data(e),a=Y._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;o>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Vt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Vt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,o=vn.length;o--;)if(t=vn[o]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,o=[],i=0,a=e.length;a>i;i++)n=e[i],n.style&&(o[i]=Y._data(n,"olddisplay"),t?(o[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(o[i]=Y._data(n,"olddisplay",C(n.nodeName)))):(r=nn(n,"display"),o[i]||"none"===r||Y._data(n,"olddisplay",r)));for(i=0;a>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?o[i]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function _(e,t,n,r){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,i=0;4>o;o+=2)"margin"===n&&(i+=Y.css(e,n+yn[o],!0)),r?("content"===n&&(i-=parseFloat(nn(e,"padding"+yn[o]))||0),"margin"!==n&&(i-=parseFloat(nn(e,"border"+yn[o]+"Width"))||0)):(i+=parseFloat(nn(e,"padding"+yn[o]))||0,"padding"!==n&&(i+=parseFloat(nn(e,"border"+yn[o]+"Width"))||0));return i}function x(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o=!0,i=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;o=i&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+_(e,t,n||(i?"border":"content"),o)+"px"}function C(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo(U.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=U.body.appendChild(rn||Y.extend(U.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write("<!doctype html><html><body>"),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),U.body.removeChild(rn)),hn[e]=n,n}function w(e,t,n,r){var o;if(Y.isArray(t))Y.each(t,function(t,o){n||xn.test(e)?r(e,o):w(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(o in t)w(e+"["+o+"]",t[o],n,r)}function A(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o,i,a=t.toLowerCase().split(tt),s=0,l=a.length;if(Y.isFunction(n))for(;l>s;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function F(e,n,r,o,i,a){i=i||n.dataTypes[0],a=a||{},a[i]=!0;for(var s,l=e[i],c=0,u=l?l.length:0,p=e===Hn;u>c&&(p||!s);c++)s=l[c](n,r,o),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=F(e,n,r,o,s,a)));return!p&&s||a["*"]||(s=F(e,n,r,o,"*",a)),s}function T(e,n){var r,o,i=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((i[r]?e:o||(o={}))[r]=n[r]);o&&Y.extend(!0,e,o)}function k(e,n,r){var o,i,a,s,l=e.contents,c=e.dataTypes,u=e.responseFields;for(i in u)i in r&&(n[u[i]]=r[i]);for(;"*"===c[0];)c.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("content-type"));if(o)for(i in l)if(l[i]&&l[i].test(o)){c.unshift(i);break}if(c[0]in r)a=c[0];else{for(i in r){if(!c[0]||e.converters[i+" "+c[0]]){a=i;break}s||(s=i)}a=a||s}return a?(a!==c[0]&&c.unshift(a),r[a]):t}function E(e,t){var n,r,o,i,a=e.dataTypes.slice(),s=a[0],l={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;o=a[++c];)if("*"!==o){if("*"!==s&&s!==o){if(n=l[s+" "+o]||l["* "+o],!n)for(r in l)if(i=r.split(" "),i[1]===o&&(n=l[s+" "+i[0]]||l["* "+i[0]])){n===!0?n=l[r]:l[r]!==!0&&(o=i[0],a.splice(c--,0,o));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+o}}}s=o}return{state:"success",data:t}}function N(){try{return new e.XMLHttpRequest}catch(t){}}function S(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function R(){return setTimeout(function(){Xn=t},0),Xn=Y.now()}function j(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),o=0,i=r.length;i>o;o++)if(r[o].call(e,t,n))return})}function I(e,t,n){var r,o=0,i=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Xn||R(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,i=0,s=l.tweens.length;s>i;i++)l.tweens[i].run(o);return a.notifyWith(e,[l,o,n]),1>o&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||R(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){for(var n=0,r=t?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(O(c,l.opts.specialEasing);i>o;o++)if(r=Zn[o].call(l,e,c,l.opts))return r;return j(l,c),Y.isFunction(l.opts.start)&&l.opts.start.call(e,l),Y.fx.timer(Y.extend(s,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function O(e,t){var n,r,o,i,a;for(n in e)if(r=Y.camelCase(n),o=t[r],i=e[n],Y.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function P(e,t,n){var r,o,i,a,s,l,c,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Kn.exec(i)){if(delete t[r],l=l||"toggle"===i,i===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),l&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)o=g[r],c=f.createTween(o,m?s[o]:0),h[o]=s[o]||Y.style(e,o),o in s||(s[o]=c.start,m&&(c.end=c.start,c.start="width"===o||"height"===o?1:0))}}function M(e,t,n,r,o){return new M.prototype.init(e,t,n,r,o)}function H(e,t){var n,r={height:e},o=0;for(t=t?1:0;4>o;o+=2-t)n=yn[o],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function L(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var D,B,U=e.document,Q=e.location,q=e.navigator,W=e.jQuery,$=e.$,z=Array.prototype.push,J=Array.prototype.slice,X=Array.prototype.indexOf,V=Object.prototype.toString,K=Object.prototype.hasOwnProperty,G=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,D)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,ot=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,it=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,lt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){U.addEventListener?(U.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===U.readyState&&(U.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var o,i,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(o="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!o||!o[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(o[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:U,e=Y.parseHTML(o[1],a,!0),ot.test(o[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(i=U.getElementById(o[2]),i&&i.parentNode){if(i.id!==o[2])return r.find(e);this.length=1,this[0]=i}return this.context=U,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return J.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(J.apply(this,arguments),"slice",J.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,o,i,a,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||Y.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(n in e)r=s[n],o=e[n],s!==o&&(u&&o&&(Y.isPlainObject(o)||(i=Y.isArray(o)))?(i?(i=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,o)):o!==t&&(s[n]=o));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=$),t&&e.jQuery===Y&&(e.jQuery=W),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!U.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith(U,[Y]),Y.fn.trigger&&Y(U).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[V.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!K.call(e,"constructor")&&!K.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||K.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||U,(r=ot.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):it.test(n.replace(st,"@").replace(lt,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,o;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(o=new DOMParser,r=o.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(i){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var o,i=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(o in e)if(n.apply(e[o],r)===!1)break}else for(;a>i&&n.apply(e[i++],r)!==!1;);else if(s){for(o in e)if(n.call(e[o],o,e[o])===!1)break}else for(;a>i&&n.call(e[i],i,e[i++])!==!1;);return e},trim:G&&!G.call(" ")?function(e){return null==e?"":G.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(X)return X.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,o=e.length,i=0;if("number"==typeof r)for(;r>i;i++)e[o++]=n[i];else for(;n[i]!==t;)e[o++]=n[i++];return e.length=o,e},grep:function(e,t,n){var r,o=[],i=0,a=e.length;for(n=!!n;a>i;i++)r=!!t(e[i],i),n!==r&&o.push(e[i]);return o},map:function(e,n,r){var o,i,a=[],s=0,l=e.length,c=e instanceof Y||l!==t&&"number"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||Y.isArray(e));if(c)for(;l>s;s++)o=n(e[s],s,r),null!=o&&(a[a.length]=o);else for(i in e)o=n(e[i],i,r),null!=o&&(a[a.length]=o);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,o,i;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(o=J.call(arguments,2),i=function(){return e.apply(n,o.concat(J.call(arguments)))},i.guid=e.guid=e.guid||Y.guid++,i):t},access:function(e,n,r,o,i,a,s){var l,c=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,o);i=1}else if(o!==t){if(l=s===t&&Y.isFunction(o),c&&(l?(l=n,n=function(e,t,n){return l.call(Y(e),n)}):(n.call(e,o),n=null)),n)for(;p>u;u++)n(e[u],r,l?o.call(e[u],u,n(e[u],r)):o,s);i=1}return i?e:c?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===U.readyState)setTimeout(Y.ready,1);else if(U.addEventListener)U.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{U.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&U.documentElement}catch(r){}n&&n.doScroll&&function o(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),D=Y(U);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,o,i,a,s,l,c=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,o=!0,l=a||0,a=0,s=c.length,i=!0;c&&s>l;l++)if(c[l].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}i=!1,c&&(u?u.length&&p(u.shift()):r?c=[]:f.disable())},f={add:function(){if(c){var t=c.length;(function n(t){Y.each(t,function(t,r){var o=Y.type(r);"function"===o?e.unique&&f.has(r)||c.push(r):r&&r.length&&"string"!==o&&n(r)})})(arguments),i?s=c.length:r&&(a=t,p(r))}return this},remove:function(){return c&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,c,n))>-1;)c.splice(n,1),i&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return Y.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=u=r=t,this},disabled:function(){return!c},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!c||o&&!u||(i?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var i=r[0],a=e[t];o[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i+"With"](this===o?n:this,[e])}:n[i])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},o={};return r.pipe=r.then,Y.each(t,function(e,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),o[i[0]]=a.fire,o[i[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,r,o=0,i=J.call(arguments),a=i.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,l=1===s?e:Y.Deferred(),c=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?J.call(arguments):o,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>o;o++)i[o]&&Y.isFunction(i[o].promise)?i[o].promise().done(c(o,r,i)).fail(l.reject).progress(c(o,n,t)):--s;return s||l.resolveWith(r,i),l.promise()}}),Y.support=function(){var n,r,o,i,a,s,l,c,u,p,f,d=U.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=d.getElementsByTagName("*"),o=d.getElementsByTagName("a")[0],!r||!o||!r.length)return{};i=U.createElement("select"),a=i.appendChild(U.createElement("option")),s=d.getElementsByTagName("input")[0],o.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(o.getAttribute("style")),hrefNormalized:"/a"===o.getAttribute("href"),opacity:/^0.5/.test(o.style.opacity),cssFloat:!!o.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!U.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==U.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===U.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=U.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),l=U.createDocumentFragment(),l.appendChild(d.lastChild),n.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,l.removeChild(s),l.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})c="on"+u,p=c in d,p||(d.setAttribute(c,"return;"),p="function"==typeof d[c]),n[u+"Bubbles"]=p;return Y(function(){var r,o,i,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=U.getElementsByTagName("body")[0];l&&(r=U.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(r,l.firstChild),o=U.createElement("div"),r.appendChild(o),o.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=o.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",n.reliableHiddenOffsets=p&&0===i[0].offsetHeight,o.innerHTML="",o.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===o.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(o,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(o,null)||{width:"4px"}).width,a=U.createElement("div"),a.style.cssText=o.style.cssText=s,a.style.marginRight=a.style.width="0",o.style.width="1px",o.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),o.style.zoom!==t&&(o.innerHTML="",o.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===o.offsetWidth,o.style.display="block",o.style.overflow="visible",o.innerHTML="<div></div>",o.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==o.offsetWidth,r.style.zoom=1),l.removeChild(r),r=o=i=a=null)}),l.removeChild(d),r=o=i=a=s=l=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!o(e)},data:function(e,n,r,o){if(Y.acceptData(e)){var i,a,s=Y.expando,l="string"==typeof n,c=e.nodeType,u=c?Y.cache:e,p=c?e[s]:e[s]&&s;if(p&&u[p]&&(o||u[p].data)||!l||r!==t)return p||(c?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},c||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(o?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),i=u[p],o||(i.data||(i.data={}),i=i.data),r!==t&&(i[Y.camelCase(n)]=r),l?(a=i[n],null==a&&(a=i[Y.camelCase(n)])):a=i,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,i,a,s=e.nodeType,l=s?Y.cache:e,c=s?e[Y.expando]:Y.expando;if(l[c]){if(t&&(r=n?l[c]:l[c].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(i=0,a=t.length;a>i;i++)delete r[t[i]];if(!(n?o:Y.isEmptyObject)(r))return}(n||(delete l[c].data,o(l[c])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||l!=l.window?delete l[c]:l[c]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var o,i,a,s,l,c=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(c),1===c.nodeType&&!Y._data(c,"parsedAttrs"))){for(a=c.attributes,l=a.length;l>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(c,s,p[s]));Y._data(c,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(o=e.split(".",2),o[1]=o[1]?"."+o[1]:"",i=o[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+i,[o[0]]),p===t&&c&&(p=Y.data(c,e),p=r(c,e,p)),p===t&&o[1]?this.data(o[0]):p):(o[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+i,o),Y.data(this,e,n),t.triggerHandler("changeData"+i,o)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var o;return e?(n=(n||"fx")+"queue",o=Y._data(e,n),r&&(!o||Y.isArray(r)?o=Y._data(e,n,Y.makeArray(r)):o.push(r)),o||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,o=n.shift(),i=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,o=1,i=Y.Deferred(),a=this,s=this.length,l=function(){--o||i.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(o++,r.empty.add(l));return l(),i.promise(n)}});var yt,vt,bt,_t=/[\t\r\n]/g,xt=/\r/g,Ct=/^(?:button|input)$/i,wt=/^(?:button|input|object|select|textarea)$/i,At=/^a(?:rea|)$/i,Ft=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Tt=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,o,i,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(o=this[n],1===o.nodeType)if(o.className||1!==t.length){for(i=" "+o.className+" ",a=0,s=t.length;s>a;a++)0>i.indexOf(" "+t[a]+" ")&&(i+=t[a]+" ");o.className=Y.trim(i)}else o.className=e;return this},removeClass:function(e){var n,r,o,i,a,s,l;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,l=this.length;l>s;s++)if(o=this[s],1===o.nodeType&&o.className){for(r=(" "+o.className+" ").replace(_t," "),i=0,a=n.length;a>i;i++)for(;r.indexOf(" "+n[i]+" ")>=0;)r=r.replace(" "+n[i]+" "," ");o.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var o,i=0,a=Y(this),s=t,l=e.split(tt);o=l[i++];)s=r?s:!a.hasClass(o),a[s?"addClass":"removeClass"](o);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(_t," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,o,i=this[0];{if(arguments.length)return o=Y.isFunction(e),this.each(function(r){var i,a=Y(this);1===this.nodeType&&(i=o?e.call(this,r,a.val()):e,null==i?i="":"number"==typeof i?i+="":Y.isArray(i)&&(i=Y.map(i,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,i,"value")!==t||(this.value=i))});if(i)return n=Y.valHooks[i.type]||Y.valHooks[i.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(i,"value"))!==t?r:(r=i.value,"string"==typeof r?r.replace(xt,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type||0>o,a=i?null:[],s=i?o+1:r.length,l=0>o?s:i?o:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==o||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),i)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,o){var i,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return o&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==l||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(Ft.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(i=a.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(i=a.get(e,n))?i:(i=e.getAttribute(n),null===i?t:i))},removeAttr:function(e,t){var n,r,o,i,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)o=r[a],o&&(n=Y.propFix[o]||o,i=Ft.test(o),i||Y.attr(e,o,""),e.removeAttribute(Tt?o:n),i&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(Ct.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var o,i,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,i=Y.propHooks[n]),r!==t?i&&"set"in i&&(o=i.set(e,r,n))!==t?o:e[n]=r:i&&"get"in i&&null!==(o=i.get(e,n))?o:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):wt.test(e.nodeName)||At.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,o=Y.prop(e,n);return o===!0||"boolean"!=typeof o&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},Tt||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=U.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) }}),Y.support.hrefNormalized||Y.each(["href","src","width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),Y.support.style||(Y.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Y.support.optSelected||(Y.propHooks.selected=Y.extend(Y.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Y.support.enctype||(Y.propFix.enctype="encoding"),Y.support.checkOn||Y.each(["radio","checkbox"],function(){Y.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Y.each(["radio","checkbox"],function(){Y.valHooks[this]=Y.extend(Y.valHooks[this],{set:function(e,n){return Y.isArray(n)?e.checked=Y.inArray(Y(e).val(),n)>=0:t}})});var kt=/^(?:textarea|input|select)$/i,Et=/^([^\.]*|)(?:\.(.+)|)$/,Nt=/(?:^|\s)hover(\.\S+|)\b/,St=/^key/,Rt=/^(?:mouse|contextmenu)|click/,jt=/^(?:focusinfocus|focusoutblur)$/,It=function(e){return Y.event.special.hover?e:e.replace(Nt,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,o,i){var a,s,l,c,u,p,f,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=Y._data(e))){for(r.handler&&(h=r,r=h.handler,i=h.selector),r.guid||(r.guid=Y.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return Y===t||e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=Y.trim(It(n)).split(" "),c=0;n.length>c;c++)u=Et.exec(n[c])||[],p=u[1],f=(u[2]||"").split(".").sort(),m=Y.event.special[p]||{},p=(i?m.delegateType:m.bindType)||p,m=Y.event.special[p]||{},d=Y.extend({type:p,origType:u[1],data:o,handler:r,guid:r.guid,selector:i,needsContext:i&&Y.expr.match.needsContext.test(i),namespace:f.join(".")},h),g=l[p],g||(g=l[p]=[],g.delegateCount=0,m.setup&&m.setup.call(e,o,f,s)!==!1||(e.addEventListener?e.addEventListener(p,s,!1):e.attachEvent&&e.attachEvent("on"+p,s))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),i?g.splice(g.delegateCount++,0,d):g.push(d),Y.event.global[p]=!0;e=null}},global:{},remove:function(e,t,n,r,o){var i,a,s,l,c,u,p,f,d,h,g,m=Y.hasData(e)&&Y._data(e);if(m&&(f=m.events)){for(t=Y.trim(It(t||"")).split(" "),i=0;t.length>i;i++)if(a=Et.exec(t[i])||[],s=l=a[1],c=a[2],s){for(d=Y.event.special[s]||{},s=(r?d.delegateType:d.bindType)||s,h=f[s]||[],u=h.length,c=c?RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0;h.length>p;p++)g=h[p],!o&&l!==g.origType||n&&n.guid!==g.guid||c&&!c.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(h.splice(p--,1),g.selector&&h.delegateCount--,d.remove&&d.remove.call(e,g));0===h.length&&u!==h.length&&(d.teardown&&d.teardown.call(e,c,m.handle)!==!1||Y.removeEvent(e,s,m.handle),delete f[s])}else for(s in f)Y.event.remove(e,s+t[i],n,r,!0);Y.isEmptyObject(f)&&(delete m.handle,Y.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,o,i){if(!o||3!==o.nodeType&&8!==o.nodeType){var a,s,l,c,u,p,f,d,h,g,m=n.type||n,y=[];if(!jt.test(m+Y.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),o&&!Y.event.customEvent[m]||Y.event.global[m]))if(n="object"==typeof n?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0>m.indexOf(":")?"on"+m:"",o){if(n.result=t,n.target||(n.target=o),r=null!=r?Y.makeArray(r):[],r.unshift(n),f=Y.event.special[m]||{},!f.trigger||f.trigger.apply(o,r)!==!1){if(h=[[o,f.bindType||m]],!i&&!f.noBubble&&!Y.isWindow(o)){for(g=f.delegateType||m,c=jt.test(g+m)?o:o.parentNode,u=o;c;c=c.parentNode)h.push([c,g]),u=c;u===(o.ownerDocument||U)&&h.push([u.defaultView||u.parentWindow||e,g])}for(l=0;h.length>l&&!n.isPropagationStopped();l++)c=h[l][0],n.type=h[l][1],d=(Y._data(c,"events")||{})[n.type]&&Y._data(c,"handle"),d&&d.apply(c,r),d=p&&c[p],d&&Y.acceptData(c)&&d.apply&&d.apply(c,r)===!1&&n.preventDefault();return n.type=m,i||n.isDefaultPrevented()||f._default&&f._default.apply(o.ownerDocument,r)!==!1||"click"===m&&Y.nodeName(o,"a")||!Y.acceptData(o)||p&&o[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!Y.isWindow(o)&&(u=o[p],u&&(o[p]=null),Y.event.triggered=m,o[m](),Y.event.triggered=t,u&&(o[p]=u)),n.result}}else{a=Y.cache;for(l in a)a[l].events&&a[l].events[m]&&Y.event.trigger(n,r,a[l].handle.elem,!0)}}},dispatch:function(n){n=Y.event.fix(n||e.event);var r,o,i,a,s,l,c,u,p,f=(Y._data(this,"events")||{})[n.type]||[],d=f.delegateCount,h=J.call(arguments),g=!n.exclusive&&!n.namespace,m=Y.event.special[n.type]||{},y=[];if(h[0]=n,n.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,n)!==!1){if(d&&(!n.button||"click"!==n.type))for(i=n.target;i!=this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==n.type){for(s={},c=[],r=0;d>r;r++)u=f[r],p=u.selector,s[p]===t&&(s[p]=u.needsContext?Y(p,this).index(i)>=0:Y.find(p,this,null,[i]).length),s[p]&&c.push(u);c.length&&y.push({elem:i,matches:c})}for(f.length>d&&y.push({elem:this,matches:f.slice(d)}),r=0;y.length>r&&!n.isPropagationStopped();r++)for(l=y[r],n.currentTarget=l.elem,o=0;l.matches.length>o&&!n.isImmediatePropagationStopped();o++)u=l.matches[o],(g||!n.namespace&&!u.namespace||n.namespace_re&&n.namespace_re.test(u.namespace))&&(n.data=u.data,n.handleObj=u,a=((Y.event.special[u.origType]||{}).handle||u.handler).apply(l.elem,h),a!==t&&(n.result=a,a===!1&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,o,i,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||U,o=r.documentElement,i=r.body,e.pageX=n.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[Y.expando])return e;var t,n,r=e,o=Y.event.fixHooks[e.type]||{},i=o.props?this.props.concat(o.props):this.props;for(e=Y.Event(r),t=i.length;t;)n=i[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||U),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){Y.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var o=Y.extend(new Y.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Y.event.trigger(o,null,t):Y.event.dispatch.call(t,o),o.isDefaultPrevented()&&n.preventDefault()}},Y.event.handle=Y.event.dispatch,Y.removeEvent=U.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var o="on"+n;e.detachEvent&&(e[o]===t&&(e[o]=null),e.detachEvent(o,r))},Y.Event=function(e,n){return this instanceof Y.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:i):this.type=e,n&&Y.extend(this,n),this.timeStamp=e&&e.timeStamp||Y.now(),this[Y.expando]=!0,t):new Y.Event(e,n)},Y.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:i,isPropagationStopped:i,isImmediatePropagationStopped:i},Y.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return i.selector,(!o||o!==r&&!Y.contains(r,o))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),Y.support.submitBubbles||(Y.event.special.submit={setup:function(){return Y.nodeName(this,"form")?!1:(Y.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=Y.nodeName(n,"input")||Y.nodeName(n,"button")?n.form:t;r&&!Y._data(r,"_submit_attached")&&(Y.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Y._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Y.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Y.nodeName(this,"form")?!1:(Y.event.remove(this,"._submit"),t)}}),Y.support.changeBubbles||(Y.event.special.change={setup:function(){return kt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Y.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Y.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Y.event.simulate("change",this,e,!0)})),!1):(Y.event.add(this,"beforeactivate._change",function(e){var t=e.target;kt.test(t.nodeName)&&!Y._data(t,"_change_attached")&&(Y.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Y.event.simulate("change",this.parentNode,e,!0)}),Y._data(t,"_change_attached",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Y.event.remove(this,"._change"),!kt.test(this.nodeName)}}),Y.support.focusinBubbles||Y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){Y.event.simulate(t,e.target,Y.event.fix(e),!0)};Y.event.special[t]={setup:function(){0===n++&&U.addEventListener(e,r,!0)},teardown:function(){0===--n&&U.removeEventListener(e,r,!0)}}}),Y.fn.extend({on:function(e,n,r,o,a){var s,l;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(l in e)this.on(l,n,r,e[l],a);return this}if(null==r&&null==o?(o=n,r=n=t):null==o&&("string"==typeof n?(o=r,r=t):(o=r,r=n,n=t)),o===!1)o=i;else if(!o)return this;return 1===a&&(s=o,o=function(e){return Y().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=Y.guid++)),this.each(function(){Y.event.add(this,e,o,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var o,a;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,Y(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(a in e)this.off(a,n,e[a]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=i),this.each(function(){Y.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return Y(this.context).on(e,this.selector,t,n),this},die:function(e,t){return Y(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){Y.event.trigger(e,t,this)})},triggerHandler:function(e,n){return this[0]?Y.event.trigger(e,n,this[0],!0):t},toggle:function(e){var t=arguments,n=e.guid||Y.guid++,r=0,o=function(n){var o=(Y._data(this,"lastToggle"+e.guid)||0)%r;return Y._data(this,"lastToggle"+e.guid,o+1),n.preventDefault(),t[o].apply(this,arguments)||!1};for(o.guid=n;t.length>r;)t[r++].guid=n;return this.click(o)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Y.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Y.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},St.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),Rt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),/*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ function(e,t){function n(e,t,n,r){n=n||[],t=t||R;var o,i,a,s,l=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==l&&9!==l)return[];if(a=x(t),!a&&!r&&(o=nt.exec(e)))if(s=o[1]){if(9===l){if(i=t.getElementById(s),!i||!i.parentNode)return n;if(i.id===s)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(s))&&C(t,i)&&i.id===s)return n.push(i),n}else{if(o[2])return M.apply(n,H.call(t.getElementsByTagName(e),0)),n;if((s=o[3])&&ft&&t.getElementsByClassName)return M.apply(n,H.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function o(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function i(e){return D(function(t){return t=+t,D(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,o,i,a,s,l,c,u=Q[N][e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=b.preFilter;s;){(!r||(o=Z.exec(s)))&&(o&&(s=s.slice(o[0].length)||s),l.push(i=[])),r=!1,(o=et.exec(s))&&(i.push(r=new S(o.shift())),s=s.slice(r.length),r.type=o[0].replace(G," "));for(a in b.filter)!(o=st[a].exec(s))||c[a]&&!(o=c[a](o))||(i.push(r=new S(o.shift())),s=s.slice(r.length),r.type=a,r.matches=o);if(!r)break}return t?s.length:s?n.error(e):Q(e,l).slice(0)}function l(e,t,n){var r=t.dir,o=n&&"parentNode"===t.dir,i=O++;return t.first?function(t,n,i){for(;t=t[r];)if(o||1===t.nodeType)return e(t,n,i)}:function(t,n,a){if(a){for(;t=t[r];)if((o||1===t.nodeType)&&e(t,n,a))return t}else for(var s,l=I+" "+i+" ",c=l+y;t=t[r];)if(o||1===t.nodeType){if((s=t[N])===c)return t.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(t.sizset)return t}else{if(t[N]=c,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function c(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,o){for(var i,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(i=e[s])&&(!n||n(i,r,o))&&(a.push(i),c&&t.push(s));return a}function p(e,t,n,r,o,i){return r&&!r[N]&&(r=p(r)),o&&!o[N]&&(o=p(o,i)),D(function(i,a,s,l){var c,p,f,d=[],g=[],m=a.length,y=i||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!i&&t?y:u(y,d,e,s,l),b=n?o||(i?e:m||r)?[]:a:v;if(n&&n(v,b,s,l),r)for(c=u(b,g),r(c,[],s,l),p=c.length;p--;)(f=c[p])&&(b[g[p]]=!(v[g[p]]=f));if(i){if(o||e){if(o){for(c=[],p=b.length;p--;)(f=b[p])&&c.push(v[p]=f);o(null,b=[],c,l)}for(p=b.length;p--;)(f=b[p])&&(c=o?L.call(i,f):d[p])>-1&&(i[c]=!(a[c]=f))}}else b=u(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):M.apply(a,b)})}function f(e){for(var t,n,r,o=e.length,i=b.relative[e[0].type],a=i||b.relative[" "],s=i?1:0,u=l(function(e){return e===t},a,!0),d=l(function(e){return L.call(t,e)>-1},a,!0),h=[function(e,n,r){return!i&&(r||n!==T)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];o>s;s++)if(n=b.relative[e[s].type])h=[l(c(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[N]){for(r=++s;o>r&&!b.relative[e[r].type];r++);return p(s>1&&c(h),s>1&&e.slice(0,s-1).join("").replace(G,"$1"),n,r>s&&f(e.slice(s,r)),o>r&&f(e=e.slice(r)),o>r&&e.join(""))}h.push(n)}return c(h)}function d(e,t){var r=t.length>0,o=e.length>0,i=function(a,s,l,c,p){var f,d,h,g=[],m=0,v="0",_=a&&[],x=null!=p,C=T,w=a||o&&b.find.TAG("*",p&&s.parentNode||s),A=I+=null==C?1:Math.E;for(x&&(T=s!==R&&s,y=i.el);null!=(f=w[v]);v++){if(o&&f){for(d=0;h=e[d];d++)if(h(f,s,l)){c.push(f);break}x&&(I=A,y=++i.el)}r&&((f=!h&&f)&&m--,a&&_.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(_,g,s,l);if(a){if(m>0)for(;v--;)_[v]||g[v]||(g[v]=P.call(c));g=u(g)}M.apply(c,g),x&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(c)}return x&&(I=A,T=C),_};return i.el=0,r?D(i):i}function h(e,t,r){for(var o=0,i=t.length;i>o;o++)n(e,t[o],r);return r}function g(e,t,n,r,o){var i,a,l,c,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(l=a[0]).type&&9===t.nodeType&&!o&&b.relative[a[1].type]){if(t=b.find.ID(l.matches[0].replace(at,""),t,o)[0],!t)return n;e=e.slice(a.shift().length)}for(i=st.POS.test(e)?-1:a.length-1;i>=0&&(l=a[i],!b.relative[c=l.type]);i--)if((u=b.find[c])&&(r=u(l.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,o))){if(a.splice(i,1),e=r.length&&a.join(""),!e)return M.apply(n,H.call(r,0)),n;break}}return w(e,p)(r,t,o,n,rt.test(e)),n}function m(){}var y,v,b,_,x,C,w,A,F,T,k=!0,E="undefined",N=("sizcache"+Math.random()).replace(".",""),S=String,R=e.document,j=R.documentElement,I=0,O=0,P=[].pop,M=[].push,H=[].slice,L=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},D=function(e,t){return e[N]=null==t||t,e},B=function(){var e={},t=[];return D(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},U=B(),Q=B(),q=B(),W="[\\x20\\t\\r\\n\\f]",$="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=$.replace("w","w#"),J="([*^$|!~]?=)",X="\\["+W+"*("+$+")"+W+"*(?:"+J+W+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+W+"*\\]",V=":("+$+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+X+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)",G=RegExp("^"+W+"+|((?:^|[^\\\\])(?:\\\\.)*)"+W+"+$","g"),Z=RegExp("^"+W+"*,"+W+"*"),et=RegExp("^"+W+"*([\\x20\\t\\r\\n\\f>+~])"+W+"*"),tt=RegExp(V),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,ot=/h\d/i,it=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+$+")"),CLASS:RegExp("^\\.("+$+")"),NAME:RegExp("^\\[name=['\"]?("+$+")['\"]?\\]"),TAG:RegExp("^("+$.replace("w","w*")+")"),ATTR:RegExp("^"+X),PSEUDO:RegExp("^"+V),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),needsContext:RegExp("^"+W+"*[>+~]|"+K,"i")},lt=function(e){var t=R.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(R.createComment("")),!e.getElementsByTagName("*").length}),ut=lt(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==E&&"#"===e.firstChild.getAttribute("href")}),pt=lt(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=lt(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=lt(function(e){e.id=N+0,e.innerHTML="<a name='"+N+"'></a><div name='"+N+"'></div>",j.insertBefore(e,j.firstChild);var t=R.getElementsByName&&R.getElementsByName(N).length===2+R.getElementsByName(N+0).length;return v=!R.getElementById(N),j.removeChild(e),t});try{H.call(j.childNodes,0)[0].nodeType}catch(ht){H=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},_=n.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=_(t);return n},x=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=n.contains=j.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:j.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=x(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:D,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==E&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==E&&!r){var o=n.getElementById(e);return o?o.id===e||typeof o.getAttributeNode!==E&&o.getAttributeNode("id").value===e?[o]:t:[]}},TAG:ct?function(e,n){return typeof n.getElementsByTagName!==E?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,o=[],i=0;r=n[i];i++)1===r.nodeType&&o.push(r);return o}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==E?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===E||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==E&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[N][e+" "];return t||(t=RegExp("(^|"+W+")"+e+"("+W+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==E&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(o){var i=n.attr(o,e);return null==i?"!="===t:t?(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.substr(i.length-r.length)===r:"~="===t?(" "+i+" ").indexOf(r)>-1:"|="===t?i===r||i.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,o,i=e.parentNode;if(1===n&&0===r)return!0;if(i)for(o=0,t=i.firstChild;t&&(1!==t.nodeType||(o++,e!==t));t=t.nextSibling);return o-=r,o===n||0===o%n&&o/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,o=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return o[N]?o(t):o.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?D(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)r=L.call(e,i[a]),e[r]=!(n[r]=i[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:D(function(e){var t=[],n=[],r=w(e.replace(G,"$1"));return r[N]?D(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:D(function(e){return function(t){return n(e,t).length>0}}),contains:D(function(e){return function(t){return(t.textContent||t.innerText||_(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return ot.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:o("submit"),reset:o("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return it.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:i(function(){return[0]}),last:i(function(e,t){return[t-1]}),eq:i(function(e,t,n){return[0>n?n+t:n]}),even:i(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:i(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:i(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:i(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},A=j.compareDocumentPosition?function(e,t){return e===t?(F=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return F=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,o=[],i=[],s=e.parentNode,l=t.parentNode,c=s;if(s===l)return a(e,t);if(!s)return-1;if(!l)return 1;for(;c;)o.unshift(c),c=c.parentNode;for(c=l;c;)i.unshift(c),c=c.parentNode;n=o.length,r=i.length;for(var u=0;n>u&&r>u;u++)if(o[u]!==i[u])return a(o[u],i[u]);return u===n?a(e,i[u],-1):a(o[u],t,1)},[0,0].sort(A),k=!F,n.uniqueSort=function(e){var t,n=[],r=1,o=0;if(F=k,e.sort(A),F){for(;t=e[r];r++)t===e[r-1]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},w=n.compile=function(e,t){var n,r=[],o=[],i=q[N][e+" "];if(!i){for(t||(t=s(e)),n=t.length;n--;)i=f(t[n]),i[N]?r.push(i):o.push(i);i=q(e,d(o,r))}return i},R.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,o=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],a=[":active"],l=j.matchesSelector||j.mozMatchesSelector||j.webkitMatchesSelector||j.oMatchesSelector||j.msMatchesSelector;lt(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+W+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),lt(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+W+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=RegExp(i.join("|")),g=function(e,n,o,a,l){if(!a&&!l&&!i.test(e)){var c,u,p=!0,f=N,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(c=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+c[u].join("");d=rt.test(e)&&n.parentNode||n,h=c.join(",")}if(h)try{return M.apply(o,H.call(d.querySelectorAll(h),0)),o}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,o,a,l)},l&&(lt(function(t){e=l.call(t,"div");try{l.call(t,"[test!='']:sizzle"),a.push("!=",V)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(o,"='$1']"),!x(t)&&!a.test(r)&&!i.test(r))try{var s=l.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Ot=/Until$/,Pt=/^(?:parents|prev(?:Until|All))/,Mt=/^.[^:#\[\.,]*$/,Ht=Y.expr.match.needsContext,Lt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,o,i,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(o=r;a.length>o;o++)for(i=0;r>i;i++)if(a[i]===a[o]){a.splice(o--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?Ht.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,o=this.length,i=[],a=Ht.test(e)||"string"!=typeof e?Y(e,t||this.context):0;o>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){i.push(n);break}n=n.parentNode}return i=i.length>1?Y.unique(i):i,this.pushStack(i,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var o=Y.map(this,t,n);return Ot.test(e)||(r=n),r&&"string"==typeof r&&(o=Y.filter(r,o)),o=this.length>1&&!Lt[e]?Y.unique(o):o,this.length>1&&Pt.test(e)&&(o=o.reverse()),this.pushStack(o,e,J.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var o=[],i=e[n];i&&9!==i.nodeType&&(r===t||1!==i.nodeType||!Y(i).is(r));)1===i.nodeType&&o.push(i),i=i[n];return o},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,Ut=/^\s+/,Qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,qt=/<([\w:]+)/,Wt=/<tbody/i,$t=/<|&#?\w+;/,zt=/<(?:script|style|link)/i,Jt=/<(?:script|object|embed|option|style)/i,Xt=RegExp("<(?:"+Dt+")[\\s/>]","i"),Vt=/^(?:checkbox|radio)$/,Kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Zt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},en=u(U),tn=en.appendChild(U.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X<div>","</div>"]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||U).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,o=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Xt.test(e)||!Y.support.leadingWhitespace&&Ut.test(e)||Zt[(qt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Qt,"<$1></$2>");try{for(;o>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(i){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var o,i,a,s,l=0,c=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof c&&Kt.test(c))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(c))return this.each(function(o){var i=Y(this);e[0]=c.call(this,o,n?i.html():t),i.domManip(e,n,r)});if(this[0]){if(o=Y.buildFragment(e,this,u),a=o.fragment,i=a.firstChild,1===a.childNodes.length&&(a=i),i)for(n=n&&Y.nodeName(i,"tr"),s=o.cacheable||f-1;f>l;l++)r.call(n&&Y.nodeName(this[l],"table")?p(this[l],"tbody"):this[l],l===s?a:Y.clone(a,!0,!0));a=i=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var o,i,a,s=e[0];return n=n||U,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===U&&"<"===s.charAt(0))||Jt.test(s)||!Y.support.checkClone&&Kt.test(s)||!Y.support.html5Clone&&Xt.test(s)||(i=!0,o=Y.fragments[s],a=o!==t),o||(o=n.createDocumentFragment(),Y.clean(e,n,o,r),i&&(Y.fragments[s]=a&&o)),{fragment:o,cacheable:i}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,o=0,i=[],a=Y(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>o;o++)r=(o>0?this.clone(!0):this).get(),Y(a[o])[t](r),i=i.concat(r);return this.pushStack(i,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,o,i,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Xt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),o=h(a),i=0;r[i];++i)o[i]&&d(r[i],o[i]);if(t&&(f(e,a),n))for(r=h(e),o=h(a),i=0;r[i];++i)f(r[i],o[i]);return r=o=null,a},clean:function(e,n,r,o){var i,a,s,l,c,p,f,d,h,m,y,v=n===U&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=U),i=0;null!=(s=e[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if($t.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(Qt,"<$1></$2>"),l=(qt.exec(s)||["",""])[1].toLowerCase(),c=Zt[l]||Zt._default,p=c[0],f.innerHTML=c[1]+s+c[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Wt.test(s),h="table"!==l||d?"<table>"!==c[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&Ut.test(s)&&f.insertBefore(n.createTextNode(Ut.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(i=0;null!=(s=b[i]);i++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Gt.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},i=0;null!=(s=b[i]);i++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[i+1,0].concat(y)),i+=y.length));return b},cleanData:function(e,t){for(var n,r,o,i,a=0,s=Y.expando,l=Y.cache,c=Y.support.deleteExpando,u=Y.event.special;null!=(o=e[a]);a++)if((t||Y.acceptData(o))&&(r=o[s],n=r&&l[r])){if(n.events)for(i in n.events)u[i]?Y.event.remove(o,i):Y.removeEvent(o,i,n.handle);l[r]&&(delete l[r],c?delete o[s]:o.removeAttribute?o.removeAttribute(s):o[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(q.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(U);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,ln=/^(top|right|bottom|left)$/,cn=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,l=Y.camelCase(n),c=e.style;if(n=Y.cssProps[l]||(Y.cssProps[l]=m(c,l)),s=Y.cssHooks[n]||Y.cssHooks[l],r===t)return s&&"get"in s&&(i=s.get(e,!1,o))!==t?i:c[n];if(a=typeof r,"string"===a&&(i=dn.exec(r))&&(r=(i[1]+1)*i[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[l]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,o))===t)))try{c[n]=r}catch(u){}}},css:function(e,n,r,o){var i,a,s,l=Y.camelCase(n);return n=Y.cssProps[l]||(Y.cssProps[l]=m(e.style,l)),s=Y.cssHooks[n]||Y.cssHooks[l],s&&"get"in s&&(i=s.get(e,!0,o)),i===t&&(i=nn(e,n)),"normal"===i&&n in mn&&(i=mn[n]),r||o!==t?(a=parseFloat(i),r||Y.isNumeric(a)?a||0:i):i},swap:function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];r=n.call(e);for(o in t)e.style[o]=i[o];return r}}),e.getComputedStyle?nn=function(t,n){var r,o,i,a,s=e.getComputedStyle(t,null),l=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(o=l.width,i=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=s.width,l.width=o,l.minWidth=i,l.maxWidth=a)),r}:U.documentElement.currentStyle&&(nn=function(e,t){var n,r,o=e.currentStyle&&e.currentStyle[t],i=e.style;return null==o&&i&&i[t]&&(o=i[t]),fn.test(o)&&!ln.test(t)&&(n=i.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),i.left="fontSize"===t?"1em":o,o=i.pixelLeft+"px",i.left=n,r&&(e.runtimeStyle.left=r)),""===o?"auto":o}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,o){return r?0===e.offsetWidth&&cn.test(nn(e,"display"))?Y.swap(e,gn,function(){return x(e,n,o)}):x(e,n,o):t},set:function(e,t,r){return b(e,t,r?_(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,o=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",i=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(i.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(i)?i.replace(an,o):i+" "+o)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,o="string"==typeof n?n.split(" "):[n],i={};for(r=0;4>r;r++)i[e+yn[r]+t]=o[r]||o[r-2]||o[0];return i}},un.test(e)||(Y.cssHooks[e+t].set=b)});var _n=/%20/g,xn=/\[\]$/,Cn=/\r?\n/g,wn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,An=/^(?:select|textarea)/i; Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||An.test(this.nodeName)||wn.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(Cn,"\r\n")}}):{name:t.name,value:n.replace(Cn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,o=[],i=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){i(this.name,this.value)});else for(r in e)w(r,e[r],n,i);return o.join("&").replace(_n,"+")};var Fn,Tn,kn=/#.*$/,En=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Sn=/^(?:GET|HEAD)$/,Rn=/^\/\//,jn=/\?/,In=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,On=/([?&])_=[^&]*/,Pn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Mn=Y.fn.load,Hn={},Ln={},Dn=["*/"]+["*"];try{Tn=Q.href}catch(Bn){Tn=U.createElement("a"),Tn.href="",Tn=Tn.href}Fn=Pn.exec(Tn.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&Mn)return Mn.apply(this,arguments);if(!this.length)return this;var o,i,a,s=this,l=e.indexOf(" ");return l>=0&&(o=e.slice(l,e.length),e=e.slice(0,l)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(i="POST"),Y.ajax({url:e,type:i,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(o?Y("<div>").append(e.replace(In,"")).find(o):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,o,i){return Y.isFunction(r)&&(i=i||o,o=r,r=t),Y.ajax({type:n,url:e,data:r,success:o,dataType:i})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?T(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),T(e,t),e},ajaxSettings:{url:Tn,isLocal:Nn.test(Fn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Dn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:A(Hn),ajaxTransport:A(Ln),ajax:function(e,n){function r(e,n,r,a){var c,p,v,b,x,w=n;2!==_&&(_=2,l&&clearTimeout(l),s=t,i=a||"",C.readyState=e>0?4:0,r&&(b=k(f,C,r)),e>=200&&300>e||304===e?(f.ifModified&&(x=C.getResponseHeader("Last-Modified"),x&&(Y.lastModified[o]=x),x=C.getResponseHeader("Etag"),x&&(Y.etag[o]=x)),304===e?(w="notmodified",c=!0):(c=E(f,b),w=c.state,p=c.data,v=c.error,c=!v)):(v=w,(!w||e)&&(w="error",0>e&&(e=0))),C.status=e,C.statusText=(n||w)+"",c?g.resolveWith(d,[p,w,C]):g.rejectWith(d,[C,w,v]),C.statusCode(y),y=t,u&&h.trigger("ajax"+(c?"Success":"Error"),[C,f,c?p:v]),m.fireWith(d,[C,w]),u&&(h.trigger("ajaxComplete",[C,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var o,i,a,s,l,c,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},_=0,x="canceled",C={readyState:0,setRequestHeader:function(e,t){if(!_){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===_?i:null},getResponseHeader:function(e){var n;if(2===_){if(!a)for(a={};n=En.exec(i);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return _||(f.mimeType=e),this},abort:function(e){return e=e||x,s&&s.abort(e),r(0,e),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(e){if(e){var t;if(2>_)for(t in e)y[t]=[y[t],e[t]];else t=e[C.status],C.always(t)}return this},f.url=((e||f.url)+"").replace(kn,"").replace(Rn,Fn[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(c=Pn.exec(f.url.toLowerCase()),f.crossDomain=!(!c||c[1]===Fn[1]&&c[2]===Fn[2]&&(c[3]||("http:"===c[1]?80:443))==(Fn[3]||("http:"===Fn[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),F(Hn,f,n,C),2===_)return C;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Sn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(jn.test(f.url)?"&":"?")+f.data,delete f.data),o=f.url,f.cache===!1)){var w=Y.now(),A=f.url.replace(On,"$1_="+w);f.url=A+(A===f.url?(jn.test(f.url)?"&":"?")+"_="+w:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(o=o||f.url,Y.lastModified[o]&&C.setRequestHeader("If-Modified-Since",Y.lastModified[o]),Y.etag[o]&&C.setRequestHeader("If-None-Match",Y.etag[o])),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Dn+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,C,f)===!1||2===_))return C.abort();x="abort";for(p in{success:1,error:1,complete:1})C[p](f[p]);if(s=F(Ln,f,n,C)){C.readyState=1,u&&h.trigger("ajaxSend",[C,f]),f.async&&f.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},f.timeout));try{_=1,s.send(v,r)}catch(T){if(!(2>_))throw T;r(-1,T)}}else r(-1,"No Transport");return C},active:0,lastModified:{},etag:{}});var Un=[],Qn=/\?/,qn=/(=)\?(?=&|$)|\?\?/,Wn=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Un.pop()||Y.expando+"_"+Wn++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,o){var i,a,s,l=n.data,c=n.url,u=n.jsonp!==!1,p=u&&qn.test(c),f=u&&!p&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&qn.test(l);return"jsonp"===n.dataTypes[0]||p||f?(i=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[i],p?n.url=c.replace(qn,"$1"+i):f?n.data=l.replace(qn,"$1"+i):u&&(n.url+=(Qn.test(c)?"&":"?")+n.jsonp+"="+i),n.converters["script json"]=function(){return s||Y.error(i+" was not called"),s[0]},n.dataTypes[0]="json",e[i]=function(){s=arguments},o.always(function(){e[i]=a,n[i]&&(n.jsonpCallback=r.jsonpCallback,Un.push(i)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=U.head||U.getElementsByTagName("head")[0]||U.documentElement;return{send:function(o,i){n=U.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,o){(o||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,o||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var $n,zn=e.ActiveXObject?function(){for(var e in $n)$n[e](0,1)}:!1,Jn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&N()||S()}:N,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(o,i){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");try{for(s in o)l.setRequestHeader(s,o[s])}catch(c){}l.send(n.hasContent&&n.data||null),r=function(e,o){var s,c,u,p,f;try{if(r&&(o||4===l.readyState))if(r=t,a&&(l.onreadystatechange=Y.noop,zn&&delete $n[a]),o)4!==l.readyState&&l.abort();else{s=l.status,u=l.getAllResponseHeaders(),p={},f=l.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=l.responseText}catch(d){}try{c=l.statusText}catch(d){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){o||i(-1,h)}p&&i(s,c,p,u)},n.async?4===l.readyState?setTimeout(r,0):(a=++Jn,zn&&($n||($n={},Y(e).unload(zn)),$n[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Xn,Vn,Kn=/^(?:toggle|show|hide)$/,Gn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[P],er={"*":[function(e,t){var n,r,o=this.createTween(e,t),i=Gn.exec(t),a=o.cur(),s=+a||0,l=1,c=20;if(i){if(n=+i[2],r=i[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(o.elem,e,!0)||n||1;do l=l||".5",s/=l,Y.style(o.elem,e,s+r);while(l!==(l=o.cur()/a)&&1!==l&&--c)}o.unit=r,o.start=s,o.end=i[1]?s+(i[1]+1)*n:n}return o}]};Y.Animation=Y.extend(I,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,o=e.length;o>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=M,M.prototype={constructor:M,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Y.cssNumber[n]?"":"px")},cur:function(){var e=M.propHooks[this.prop];return e&&e.get?e.get(this):M.propHooks._default.get(this)},run:function(e){var t,n=M.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,o,i){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(o)?n.apply(this,arguments):this.animate(H(t,!0),r,o,i)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=Y.isEmptyObject(e),i=Y.speed(t,n,r),a=function(){var t=I(this,Y.extend({},e),i);o&&t.stop(!0)};return o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(e,n,r){var o=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",i=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&o(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&o(a[n]);for(n=i.length;n--;)i[n].elem!==this||null!=e&&i[n].queue!==e||(i[n].anim.stop(r),t=!1,i.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=M.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Xn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Xn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Vn&&(Vn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Vn),Vn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,o,i,a,s,l,c={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(c=u.getBoundingClientRect()),o=L(p),i=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=o.pageYOffset||n.scrollTop,l=o.pageXOffset||n.scrollLeft,{top:c.top+s-i,left:c.left+l-a}):c)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var o,i,a=Y(e),s=a.offset(),l=Y.css(e,"top"),c=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[l,c])>-1,p={},f={};u?(f=a.position(),o=f.top,i=f.left):(o=parseFloat(l)||0,i=parseFloat(c)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+o),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||U.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||U.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(o){return Y.access(this,function(e,o,i){var a=L(e);return i===t?a?n in a?a[n]:a.document.documentElement[o]:e[o]:(a?a.scrollTo(r?Y(a).scrollLeft():i,r?i:Y(a).scrollTop()):e[o]=i,t)},e,o,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,o){Y.fn[o]=function(o,i){var a=arguments.length&&(r||"boolean"!=typeof o),s=r||(o===!0||i===!0?"margin":"border");return Y.access(this,function(n,r,o){var i;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(i=n.documentElement,Math.max(n.body["scroll"+e],i["scroll"+e],n.body["offset"+e],i["offset"+e],i["client"+e])):o===t?Y.css(n,r,o,s):Y.style(n,r,o,s)},n,a?o:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window),/*! ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Twitter, Inc. require the following notice to accompany Bootstrap: * * Copyright (c) 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work * except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing permissions and limitations under the License. * * ========================================================= */ !function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")}))},hide:function(t){t&&t.preventDefault(),t=e.Event("hide"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]===e.target||t.$element.has(e.target).length||t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var r=e.support.transition&&n;this.$backdrop=e('<div class="modal-backdrop '+n+'" />').appendTo(document.body),this.$backdrop.click("static"==this.options.backdrop?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),r?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),o=r.data("modal"),i=e.extend({},e.fn.modal.defaults,r.data(),"object"==typeof n&&n);o||r.data("modal",o=new t(this,i)),"string"==typeof n?o[n]():i.show&&o.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),o=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),i=o.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},o.data(),n.data());t.preventDefault(),o.modal(i).one("hide",function(){n.focus()})})}(window.jQuery);/*! * This file creates $ and jQuery variables within the F2 closure scope */ var $,jQuery=$=window.jQuery.noConflict(!0);/*! * Hij1nx requires the following notice to accompany EventEmitter: * * Copyright (c) 2011 hij1nx * * http://www.twitter.com/hij1nx * * 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. * */ !function(e){function t(){this._events={}}function n(e){e&&(e.delimiter&&(this.delimiter=e.delimiter),e.wildcard&&(this.wildcard=e.wildcard),this.wildcard&&(this.listenerTree={}))}function r(e){this._events={},n.call(this,e)}function o(e,t,n,r){if(!n)return[];var i,a,s,l,c,u,p,f=[],d=t.length,h=t[r],g=t[r+1];if(r===d&&n._listeners){if("function"==typeof n._listeners)return e&&e.push(n._listeners),[n];for(i=0,a=n._listeners.length;a>i;i++)e&&e.push(n._listeners[i]);return[n]}if("*"===h||"**"===h||n[h]){if("*"===h){for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&(f=f.concat(o(e,t,n[s],r+1)));return f}if("**"===h){p=r+1===d||r+2===d&&"*"===g,p&&n._listeners&&(f=f.concat(o(e,t,n,d)));for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&("*"===s||"**"===s?(n[s]._listeners&&!p&&(f=f.concat(o(e,t,n[s],d))),f=f.concat(o(e,t,n[s],r))):f=s===g?f.concat(o(e,t,n[s],r+2)):f.concat(o(e,t,n[s],r)));return f}f=f.concat(o(e,t,n[h],r+1))}if(l=n["*"],l&&o(e,t,l,r+1),c=n["**"])if(d>r){c._listeners&&o(e,t,c,d);for(s in c)"_listeners"!==s&&c.hasOwnProperty(s)&&(s===g?o(e,t,c[s],r+2):s===h?o(e,t,c[s],r+1):(u={},u[s]=c[s],o(e,t,{"**":u},r+1)))}else c._listeners?o(e,t,c,d):c["*"]&&c["*"]._listeners&&o(e,t,c["*"],d);return f}function i(e,t){e="string"==typeof e?e.split(this.delimiter):e.slice();for(var n=0,r=e.length;r>n+1;n++)if("**"===e[n]&&"**"===e[n+1])return;for(var o=this.listenerTree,i=e.shift();i;){if(o[i]||(o[i]={}),o=o[i],0===e.length){if(o._listeners){if("function"==typeof o._listeners)o._listeners=[o._listeners,t];else if(a(o._listeners)&&(o._listeners.push(t),!o._listeners.warned)){var l=s;this._events.maxListeners!==undefined&&(l=this._events.maxListeners),l>0&&o._listeners.length>l&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace())}}else o._listeners=t;return!0}i=e.shift()}return!0}var a=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=10;r.prototype.delimiter=".",r.prototype.setMaxListeners=function(e){this._events||t.call(this),this._events.maxListeners=e},r.prototype.event="",r.prototype.once=function(e,t){return this.many(e,1,t),this},r.prototype.many=function(e,t,n){function r(){0===--t&&o.off(e,r),n.apply(this,arguments)}var o=this;if("function"!=typeof n)throw Error("many only accepts instances of Function");return r._origin=n,this.on(e,r),o},r.prototype.emit=function(){this._events||t.call(this);var e=arguments[0];if("newListener"===e&&!this._events.newListener)return!1;if(this._all){for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];for(i=0,n=this._all.length;n>i;i++)this.event=e,this._all[i].apply(this,r)}if("error"===e&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");var a;if(this.wildcard){a=[];var s="string"==typeof e?e.split(this.delimiter):e.slice();o.call(this,a,s,this.listenerTree,0)}else a=this._events[e];if("function"==typeof a){if(this.event=e,1===arguments.length)a.call(this);else if(arguments.length>1)switch(arguments.length){case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];a.apply(this,r)}return!0}if(a){for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];for(var l=a.slice(),i=0,n=l.length;n>i;i++)this.event=e,l[i].apply(this,r);return l.length>0||this._all}return this._all},r.prototype.on=function(e,n){if("function"==typeof e)return this.onAny(e),this;if("function"!=typeof n)throw Error("on only accepts instances of Function");if(this._events||t.call(this),this.emit("newListener",e,n),this.wildcard)return i.call(this,e,n),this;if(this._events[e]){if("function"==typeof this._events[e])this._events[e]=[this._events[e],n];else if(a(this._events[e])&&(this._events[e].push(n),!this._events[e].warned)){var r=s;this._events.maxListeners!==undefined&&(r=this._events.maxListeners),r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}else this._events[e]=n;return this},r.prototype.onAny=function(e){if(this._all||(this._all=[]),"function"!=typeof e)throw Error("onAny only accepts instances of Function");return this._all.push(e),this},r.prototype.addListener=r.prototype.on,r.prototype.off=function(e,t){if("function"!=typeof t)throw Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();r=o.call(this,null,i,this.listenerTree,0)}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var s=0;r.length>s;s++){var l=r[s];if(n=l._listeners,a(n)){for(var c=-1,u=0,p=n.length;p>u;u++)if(n[u]===t||n[u].listener&&n[u].listener===t||n[u]._origin&&n[u]._origin===t){c=u;break}if(0>c)return this;this.wildcard?l._listeners.splice(c,1):this._events[e].splice(c,1),0===n.length&&(this.wildcard?delete l._listeners:delete this._events[e])}else(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete l._listeners:delete this._events[e])}return this},r.prototype.offAny=function(e){var t,n=0,r=0;if(e&&this._all&&this._all.length>0){for(t=this._all,n=0,r=t.length;r>n;n++)if(e===t[n])return t.splice(n,1),this}else this._all=[];return this},r.prototype.removeListener=r.prototype.off,r.prototype.removeAllListeners=function(e){if(0===arguments.length)return!this._events||t.call(this),this;if(this.wildcard)for(var n="string"==typeof e?e.split(this.delimiter):e.slice(),r=o.call(this,null,n,this.listenerTree,0),i=0;r.length>i;i++){var a=r[i];a._listeners=null}else{if(!this._events[e])return this;this._events[e]=null}return this},r.prototype.listeners=function(e){if(this.wildcard){var n=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return o.call(this,n,r,this.listenerTree,0),n}return this._events||t.call(this),this._events[e]||(this._events[e]=[]),a(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},r.prototype.listenersAny=function(){return this._all?this._all:[]},e.EventEmitter2=r}("undefined"!=typeof process&&process.title!==void 0&&exports!==void 0?exports:window);/*! * F2 v1.3.2 11-18-2013 * Copyright (c) 2013 Markit On Demand, Inc. http://www.openf2.org * * "F2" is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. * * Please note that F2 ("Software") may contain third party material that Markit * On Demand Inc. has a license to use and include within the Software (the * "Third Party Material"). A list of the software comprising the Third Party Material * and the terms and conditions under which such Third Party Material is distributed * are reproduced in the ThirdPartyMaterial.md file available at: * * https://github.com/OpenF2/F2/blob/master/ThirdPartyMaterial.md * * The inclusion of the Third Party Material in the Software does not grant, provide * nor result in you having acquiring any rights whatsoever, other than as stipulated * in the terms and conditions related to the specific Third Party Material, if any. * */ var F2;F2=function(){var e=function(e,n){function r(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return n=t(n||""),e=t(e||""),n&&e?(n.protocol||e.protocol)+(n.protocol||n.authority?n.authority:e.authority)+r(n.protocol||n.authority||"/"===n.pathname.charAt(0)?n.pathname:n.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+n.pathname:e.pathname)+(n.protocol||n.authority||n.pathname?n.search:n.search||e.search)+n.hash:null},t=function(e){var t=(e+"").replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null};return{appConfigReplacer:function(e,t){return"root"==e||"ui"==e||"height"==e?void 0:t},Apps:{},extend:function(e,t,n){var r="function"==typeof t,o=e?e.split("."):[],i=this;t=t||{},"F2"===o[0]&&(o=o.slice(1));for(var a=0,s=o.length;s>a;a++)i[o[a]]||(i[o[a]]=r&&a+1==s?t:{}),i=i[o[a]];if(!r)for(var l in t)(i[l]===void 0||n)&&(i[l]=t[l]);return i},guid:function(){var e=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},inArray:function(e,t){return jQuery.inArray(e,t)>-1},isLocalRequest:function(t){var n,r,o=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,i=t.toLowerCase(),a=o.exec(i);try{n=location.href}catch(s){n=document.createElement("a"),n.href="",n=n.href}n=n.toLowerCase(),a||(i=e(n,i).toLowerCase(),a=o.exec(i)),r=o.exec(n)||[];var l=!(a&&(a[1]!==r[1]||a[2]!==r[2]||(a[3]||("http:"===a[1]?"80":"443"))!==(r[3]||("http:"===r[1]?"80":"443"))));return l},isNativeDOMNode:function(e){var t="object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n="object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName;return t||n},log:function(){for(var e,t,n,r="log",o=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],a=i.length,s=window.console=window.console||{};a--;)t=i[a],s[t]||(s[t]=o),arguments&&arguments.length>1&&arguments[0]==t&&(r=t,n=Array.prototype.slice.call(arguments,1));e=Function.prototype.bind?Function.prototype.bind.call(s[r],s):function(){Function.prototype.apply.call(s[r],s,n||arguments)},e.apply(this,n||arguments)},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.3.2"}}}(),F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[],appScriptLoadFailed:[]},r={appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appDestroy:function(e){e&&e.app&&e.app.destroy&&"function"==typeof e.app.destroy?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(e.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})}},o=function(e,t,n,r){i(e);var o={func:n,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!o.func&&!o.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(o.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return o},i=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},a=function(e,t,r){if(i(e),r||t)if(!r&&t)n[t]=[];else if(r&&!t){r=r.toLowerCase();for(var o in n){for(var a=n[o],s=[],l=0,c=a.length;c>l;l++){var u=a[l];u&&(u.namespace&&u.namespace.toLowerCase()==r||s.push(u))}a=s}}else if(r&&n[t]){r=r.toLowerCase();for(var p=[],f=0,d=n[t].length;d>f;f++){var h=n[t][f];h&&(h.namespace&&h.namespace.toLowerCase()==r||p.push(h))}n[t]=p}};return{getToken:function(){return delete this.getToken,e},__f2GetToken:function(){return delete this.__f2GetToken,t},__trigger:function(e,o){if(e!=t)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!n||!n[o])throw"Invalid EventKey passed. Check your inputs and try again.";for(var i=[],a=2,s=arguments.length;s>a;a++)i.push(arguments[a]);if(0===n[o].length&&r[o])return r[o].apply(F2,i),this;if(0===n[o].length&&!n[o])return this;for(var l=0,c=n[o].length;c>l;l++){var u=n[o][l];if(u.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var p=jQuery(arguments[2].root).append(arguments[3]);jQuery(u.domNode).append(p)}else u.domNode&&arguments[2]&&!arguments[2].root&&arguments[3]?(arguments[2].root=jQuery(arguments[3]).get(0),jQuery(u.domNode).append(arguments[2].root)):u.func.apply(F2,i)}return this},on:function(e,t,r){var i=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var a=t.split(".");t=a[0],i=a[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(o(e,i,r,"appRender"==t)),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var o=t.split(".");t=o[0],r=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return a(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter",APP_SCRIPT_LOAD_FAILED:"appScriptLoadFailed"}}()}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},debugMode:!1,scriptErrorTimeout:7e3,isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()),F2.extend("Rpc",function(){var e={},t="",n={},r=RegExp("^"+F2.Constants.Sockets.EVENT),o=RegExp("^"+F2.Constants.Sockets.RPC),i=RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),a=RegExp("^"+F2.Constants.Sockets.LOAD),s=RegExp("^"+F2.Constants.Sockets.UI_RPC),l=function(){var e,t=!1,r=[],o=new easyXDM.Socket({onMessage:function(i,s){if(!t&&a.test(i)){i=i.replace(a,"");var l=F2.parse(i);2==l.length&&(e=l[0],n[e.instanceId]={config:e,socket:o},F2.registerApps([e],[l[1]]),jQuery.each(r,function(){p(e,i,s)}),t=!0)}else t?p(e,i,s):r.push(i)}})},c=function(e,n){var r=jQuery(e.root);if(r.is("."+F2.Constants.Css.APP_CONTAINER)||r.find("."+F2.Constants.Css.APP_CONTAINER),!r.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var o={scrolling:"no",style:{width:"100%"}};e.height&&(o.style.height=e.height+"px");var i=new easyXDM.Socket({remote:t,container:r.get(0),props:o,onMessage:function(t,n){p(e,t,n)},onReady:function(){i.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return i},u=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},p=function(t,n){function a(e,t){for(var n=(t+"").split("."),r=0;n.length>r;r++){if(void 0===e[n[r]]){e=void 0;break}e=e[n[r]]}return e}function l(e,t,n){var r=F2.parse(t.replace(e,""));return r.params&&r.params.length&&r.callbacks&&r.callbacks.length&&jQuery.each(r.callbacks,function(e,t){jQuery.each(r.params,function(e,o){t==o&&(r.params[e]=u(n,t))})}),r}var c,p;s.test(n)?(c=l(s,n,t.instanceId),p=a(t.ui,c.functionName),void 0!==p?p.apply(t.ui,c.params):F2.log("Unable to locate UI RPC function: "+c.functionName)):o.test(n)?(c=l(o,n,t.instanceId),p=a(window,c.functionName),void 0!==p?p.apply(p,c.params):F2.log("Unable to locate RPC function: "+c.functionName)):i.test(n)?(c=l(i,n,t.instanceId),void 0!==e[c.functionName]&&(e[c.functionName].apply(e[c.functionName],c.params),delete e[c.functionName])):r.test(n)&&(c=l(r,n,t.instanceId),F2.Events._socketEmit.apply(F2.Events,c))},f=function(t){var n=F2.guid();return e[n]=t,n};return{broadcast:function(e,t){var r=e+F2.stringify(t);jQuery.each(n,function(e,t){t.socket.postMessage(r)})},call:function(e,t,r,o){var i=[];jQuery.each(o,function(e,t){if("function"==typeof t){var n=f(t);o[e]=n,i.push(n)}}),n[e].socket.postMessage(t+F2.stringify({functionName:r,params:o,callbacks:i}))},init:function(e){t=e,t||l()},isRemote:function(e){return void 0!==n[e]&&n[e].config.isSecure&&0===jQuery(n[e].config.root).find("iframe").length},register:function(e,t){e&&t?n[e.instanceId]={config:e,socket:c(e,t)}:F2.log("Unable to register socket connection. Please check container configuration.")}}}()),F2.extend("UI",function(){var e,t=function(e){var t=e,n=jQuery(e.root),r=function(e){e=e||jQuery(t.root).outerHeight(),F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"updateHeight",[e]):(t.height=e,n.find("iframe").height(t.height))};return{hideMask:function(e){F2.UI.hideMask(t.instanceId,e)},Modals:function(){var e=function(e){return['<div class="modal">','<header class="modal-header">',"<h3>Alert!</h3>","</header>",'<div class="modal-body">',"<p>",e,"</p>","</div>",'<div class="modal-footer">','<button class="btn btn-primary btn-ok">OK</button>',"</div>","</div>"].join("")},n=function(e){return['<div class="modal">','<header class="modal-header">',"<h3>Confirm</h3>","</header>",'<div class="modal-body">',"<p>",e,"</p>","</div>",'<div class="modal-footer">','<button type="button" class="btn btn-primary btn-ok">OK</button>','<button type="button" class="btn btn-cancel">Cancel</button">',"</div>","</div>"].join("")};return{alert:function(n,r){return F2.isInit()?(F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(e,r,o){return F2.isInit()?(F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(o||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,o=/change/i;e.setMaxListeners(0);var i=function(e){return o.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(o){"function"==typeof o?this.on("change",o):"string"==typeof o&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(o,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+o+'"]',n).removeClass("hide"),r(),e.emit("change",o)))},off:function(t,n){i(t)&&e.off(t,n)},on:function(t,n){i(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t);n.find("> ."+F2.Constants.Css.MASK).remove(),n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var o=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),i=jQuery("<div>").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||i.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+100*e.UI.Mask.opacity+")",opacity:e.UI.Mask.opacity}),"static"===o.css("position")&&(o.css({position:"relative"}),o.data(F2.Constants.Css.MASK_CONTAINER,!0)),o.append(i)}},t}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);return _config.afterAppRender&&!r?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(r).addClass(F2.Constants.Css.APP),r.get(0))},_appRender=function(e,t){return t=_outerHtml(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),_outerHtml(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_appScriptLoadFailed=function(e,t){var n=_config.appScriptLoadFailed||jQuery.noop;return n(e,t)},_createAppConfig=function(e){return e=jQuery.extend(!0,{},e),e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME),e},_hydrateContainerConfig=function(e){e.scriptErrorTimeout||(e.scriptErrorTimeout=F2.ContainerConfig.scriptErrorTimeout),e.debugMode!==!0&&(e.debugMode=F2.ContainerConfig.debugMode)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_createAppInstance=function(e,t){e.ui=new F2.UI(e),void 0!==F2.Apps[e.appId]&&("function"==typeof F2.Apps[e.appId]?setTimeout(function(){_apps[e.instanceId].app=new F2.Apps[e.appId](e,t,e.root),void 0!==_apps[e.instanceId].app.init&&_apps[e.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+e.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,readyStates="addEventListener"in window?{}:{loaded:!0,complete:!0},appInit=function(){jQuery.each(appConfigs,function(e,t){_createAppInstance(t,appManifest.apps[e])})},_error=function(e){setTimeout(function(){var t={src:e.target.src,appId:appConfigs[0].appId};F2.log("Script defined in '"+t.appId+"' failed to load '"+t.src+"'"),F2.Events.emit("RESOURCE_FAILED_TO_LOAD",t),_bUsesAppHandlers?F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED,appConfigs[0],t.src):_appScriptLoadFailed(appConfigs[0],t.src)},_config.scriptErrorTimeout)},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e),_bUsesAppHandlers?F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED,appConfigs[0],exception):_appScriptLoadFailed(appConfigs[0],exception)}})},stylesFragment=null,useCreateStyleSheet=!!document.createStyleSheet;jQuery.each(styles,function(e,t){useCreateStyleSheet?document.createStyleSheet(t):(stylesFragment=stylesFragment||[],stylesFragment.push('<link rel="stylesheet" type="text/css" href="'+t+'"/>'))}),stylesFragment&&jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(_bUsesAppHandlers){F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],_outerHtml(t.html));var n=appConfigs[e].appId;if(!appConfigs[e].root)throw"Root for "+n+" must be a native DOM element and cannot be null or undefined. Check your AppHandler callbacks to ensure you have set App root to a native DOM element.";var r=jQuery(appConfigs[e].root);if(0===r.parents("body:first").length)throw"App root for "+n+" was not appended to the DOM. Check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]),!F2.isNativeDOMNode(appConfigs[e].root))throw"App root for "+n+" must be a native DOM element. Check your AppHandler callbacks to ensure you have set app root to a native DOM element.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+n)}else appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){var n=document,r=n.createElement("script"),o=t;_config.debugMode&&(o+="?cachebuster="+(new Date).getTime()),r.async=!1,r.src=o,r.type="text/javascript",r.charset="utf-8",r.onerror=_error,r.onload=r.onreadystatechange=function(e){e=e||window.event,("load"==e.type||readyStates[r.readyState])&&(r.onload=r.onreadystatechange=r.onerror=null,r=null,++scriptsLoaded==scriptCount&&(evalInlines(),appInit()))},n.body.appendChild(r)}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var n=jQuery(e.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html),0===n.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e),!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}else e.root=_afterAppRender(e,_appRender(e,"<div></div>"));e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(e){return jQuery("<div></div>").append(e).html()},_validateApp=function(e){return e.appId?e.root||e.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(e){return{appId:e.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(e){_config=e||{},_validateContainerConfig(),_hydrateContainerConfig(_config),_bUsesAppHandlers=!(_config.beforeAppRender||_config.appRender||_config.afterAppRender||_config.appScriptLoadFailed),(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!e)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var n=[],r={},o={},i=!1;return e=[].concat(e),t=[].concat(t||[]),i=!!t.length,e.length?e.length&&i&&e.length!=t.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(e,function(e,o){if(o=_createAppConfig(o),o.root=o.root||null,_validateApp(o)){if(_apps[o.instanceId]={config:o},o.root){if(!o.root&&"string"!=typeof o.root&&!F2.isNativeDOMNode(o.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",o),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(o.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",o),F2.log("Number of dom node instances:",jQuery(o.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(o),_initAppEvents(o),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,o),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,o)):o.root=_beforeAppRender(o),i?_loadApps(o,t[e]):o.enableBatchRequests&&!o.isSecure?(r[o.manifestUrl.toLowerCase()]=r[o.manifestUrl.toLowerCase()]||[],r[o.manifestUrl.toLowerCase()].push(o)):n.push({apps:[o],url:o.manifestUrl})}}),i||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;o[n]=o[n]||[],o[n].push(t)}),jQuery.each(o,function(e,t){var n=function(r,o){if(o){var i=o.url,a="GET",s="jsonp",l=function(){n(e,t.pop())},c=function(){jQuery.each(o.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},u=function(e){_loadApps(o.apps,e)};if(_config.xhr&&_config.xhr.dataType&&(s=_config.xhr.dataType(o.url,o.apps),"string"!=typeof s))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(a=_config.xhr.type(o.url,o.apps),"string"!=typeof a))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(i=_config.xhr.url(o.url,o.apps),"string"!=typeof i))throw"ContainerConfig.xhr.url should return a string";var p=_config.xhr;"function"!=typeof p&&(p=function(e,t,n,i,l){jQuery.ajax({url:e,type:a,data:{params:F2.stringify(o.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:s,success:n,error:function(e,t,n){F2.log("Failed to load app(s)",""+n,o.apps),i()},complete:l})}),p(i,o.apps,u,c,l)}};n(e,t.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(e){return _isInit()?(_apps[e]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e]),delete _apps[e]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}})("undefined"!=typeof exports?exports:window);
src/Transition.js
simonliubo/react-ui
import React from 'react'; import TransitionEvents from './utils/TransitionEvents'; import classnames from 'classnames'; export const UNMOUNTED = 0; export const EXITED = 1; export const ENTERING = 2; export const ENTERED = 3; export const EXITING = 4; class Transition extends React.Component { constructor(props, context) { super(props, context); let initialStatus; if (props.in) { // Start enter transition in componentDidMount. initialStatus = props.transitionAppear ? EXITED : ENTERED; } else { initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED; } this.state = {status: initialStatus}; this.nextCallback = null; } componentDidMount() { if (this.props.transitionAppear && this.props.in) { this.performEnter(this.props); } } componentWillReceiveProps(nextProps) { const status = this.state.status; if (nextProps.in) { if (status === EXITING) { this.performEnter(nextProps); } else if (this.props.unmountOnExit) { if (status === UNMOUNTED) { // Start enter transition in componentDidUpdate. this.setState({status: EXITED}); } } else if (status === EXITED) { this.performEnter(nextProps); } // Otherwise we're already entering or entered. } else { if (status === ENTERING || status === ENTERED) { this.performExit(nextProps); } // Otherwise we're already exited or exiting. } } componentDidUpdate() { if (this.props.unmountOnExit && this.state.status === EXITED) { // EXITED is always a transitional state to either ENTERING or UNMOUNTED // when using unmountOnExit. if (this.props.in) { this.performEnter(this.props); } else { this.setState({status: UNMOUNTED}); } } } componentWillUnmount() { this.cancelNextCallback(); } performEnter(props) { this.cancelNextCallback(); const node = React.findDOMNode(this); // Not this.props, because we might be about to receive new props. props.onEnter(node); this.safeSetState({status: ENTERING}, () => { this.props.onEntering(node); this.onTransitionEnd(node, () => { this.safeSetState({status: ENTERED}, () => { this.props.onEntered(node); }); }); }); } performExit(props) { this.cancelNextCallback(); const node = React.findDOMNode(this); // Not this.props, because we might be about to receive new props. props.onExit(node); this.safeSetState({status: EXITING}, () => { this.props.onExiting(node); this.onTransitionEnd(node, () => { this.safeSetState({status: EXITED}, () => { this.props.onExited(node); }); }); }); } cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel(); this.nextCallback = null; } } safeSetState(nextState, callback) { // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. this.setState(nextState, this.setNextCallback(callback)); } setNextCallback(callback) { let active = true; this.nextCallback = (event) => { if (active) { active = false; this.nextCallback = null; callback(event); } }; this.nextCallback.cancel = () => { active = false; }; return this.nextCallback; } onTransitionEnd(node, handler) { this.setNextCallback(handler); if (node) { TransitionEvents.addEndEventListener(node, this.nextCallback); setTimeout(this.nextCallback, this.props.duration); } else { setTimeout(this.nextCallback, 0); } } render() { const status = this.state.status; if (status === UNMOUNTED) { return null; } const {children, className, ...childProps} = this.props; Object.keys(Transition.propTypes).forEach(key => delete childProps[key]); let transitionClassName; if (status === EXITED) { transitionClassName = this.props.exitedClassName; } else if (status === ENTERING) { transitionClassName = this.props.enteringClassName; } else if (status === ENTERED) { transitionClassName = this.props.enteredClassName; } else if (status === EXITING) { transitionClassName = this.props.exitingClassName; } const child = React.Children.only(children); return React.cloneElement( child, { ...childProps, className: classnames( child.props.className, className, transitionClassName ) } ); } } Transition.propTypes = { /** * Show the component; triggers the enter or exit animation */ in: React.PropTypes.bool, /** * Unmount the component (remove it from the DOM) when it is not shown */ unmountOnExit: React.PropTypes.bool, /** * Run the enter animation when the component mounts, if it is initially * shown */ transitionAppear: React.PropTypes.bool, /** * Duration of the animation in milliseconds, to ensure that finishing * callbacks are fired even if the original browser transition end events are * canceled */ duration: React.PropTypes.number, /** * CSS class or classes applied when the component is exited */ exitedClassName: React.PropTypes.string, /** * CSS class or classes applied while the component is exiting */ exitingClassName: React.PropTypes.string, /** * CSS class or classes applied when the component is entered */ enteredClassName: React.PropTypes.string, /** * CSS class or classes applied while the component is entering */ enteringClassName: React.PropTypes.string, /** * Callback fired before the "entering" classes are applied */ onEnter: React.PropTypes.func, /** * Callback fired after the "entering" classes are applied */ onEntering: React.PropTypes.func, /** * Callback fired after the "enter" classes are applied */ onEntered: React.PropTypes.func, /** * Callback fired before the "exiting" classes are applied */ onExit: React.PropTypes.func, /** * Callback fired after the "exiting" classes are applied */ onExiting: React.PropTypes.func, /** * Callback fired after the "exited" classes are applied */ onExited: React.PropTypes.func }; // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, duration: 300, unmountOnExit: false, transitionAppear: false, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop }; export default Transition;
src/components/discover/todo-list/view/DoneListTitle.js
phodal/growth-ng
import React, { Component } from 'react'; import { View, Text } from 'react-native'; import AppStyle from '../../../../theme/styles'; class DoneListTitle extends Component { static componentName = 'DoneListTitle'; render() { return ( <View style={AppStyle.titleVerticalCenterColorGrayStyle} > <Text style={{ color: '#999' }}>已完成</Text> </View>); } } export default DoneListTitle;
src/svg-icons/av/playlist-add.js
hai-cea/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvPlaylistAdd = (props) => ( <SvgIcon {...props}> <path d="M14 10H2v2h12v-2zm0-4H2v2h12V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM2 16h8v-2H2v2z"/> </SvgIcon> ); AvPlaylistAdd = pure(AvPlaylistAdd); AvPlaylistAdd.displayName = 'AvPlaylistAdd'; AvPlaylistAdd.muiName = 'SvgIcon'; export default AvPlaylistAdd;
tp-4/sebareverso/src/pages/users/Formulario.js
jpgonzalezquinteros/sovos-reactivo-2017
import React from 'react'; import { Modal, Input } from 'antd'; const { TextArea } = Input; class Formulario extends React.Component { state = { id:null, name: '', username:'', email:'' } componentWillMount() { this.props.actions.fetchPost(1); } handleOk = () => { this.setState({ descripcionError:null }); this.props.onSave(this.state); } handleCancel = () => { this.props.onCancel(); } render() { let {title, body} = this.props.userSeleccionado; return ( <div> <Modal title = "Nuevo Usuario" visible={true} onOk={this.handleOk} onCancel={this.handleCancel} okText="Guardar" cancelText="Cancelar" > <Input placeholder="Nombre" value={name} /> <Input placeholder="Nombre de usuario" value={username} /> <Input placeholder="e-mail" value={email} /> </Modal> </div> ); } } export default Formulario;
envkey-react/src/containers/import_env_container.js
envkey/envkey-app
import React from 'react' import { connect } from 'react-redux' import h from "lib/ui/hyperscript_with_helpers" import R from 'ramda' import {secureRandomAlphanumeric} from 'lib/crypto' import { parseMultiFormat } from 'lib/parse' import { importerPlaceholder } from 'lib/env/imports' import { importSingleEnvironment } from 'actions' import { getApp, getIsImportingEnvironment, getImportErrors } from 'selectors' const initialState = { val: "", valid: false, parsed: null } class ImportEnv extends React.Component { constructor(props) { super(props) this.state = initialState } componentWillReceiveProps(nextProps){ if (this.props.isSubmitting && !nextProps.isSubmitting){ if (!this.props.importError && nextProps.importError){ this.setState(initialState) } else { this.props.onClose() } } } _onSubmit(e){ e.preventDefault() this.props.onSubmit(this.state.parsed) } _onChange(e){ const txt = e.target.value let val, valid, parsed if(txt){ parsed = parseMultiFormat(txt.trim()) valid = parsed != null } else { parsed = null valid = false } this.setState({val, valid, parsed}) } _environmentTitle(){ return this.props.subEnv ? this.props.subEnv["@@__name__"] : this.props.environment } render(){ return h.div(".env-modal.import-env", [ h.div(".bg", {onClick: this.props.onClose}), h.form([ this._renderClose(), <h3>Import To <em>{this._environmentTitle()}</em></h3>, h.textarea({ disabled: this.props.isSubmitting, value: this.val, placeholder: importerPlaceholder(this._environmentTitle()), onChange: ::this._onChange }), this._renderSubmit() ]) ]) } _renderSubmit(){ if(this.props.isSubmitting){ return h.div(".actions", [ h.button({disabled: true}, ["Importing..."]), ]) } else { return h.div(".actions", [ h.button({ onClick: ::this._onSubmit, disabled: !this.state.valid || !this.state.parsed }, 'Import') ]) } } _renderClose(){ return h.span(".close", {onClick: this.props.onClose}, "⟵") } } const mapStateToProps = (state, ownProps) => { return { ...ownProps, isSubmitting: getIsImportingEnvironment(ownProps.app.id, ownProps.environment, state), importError: getImportErrors(ownProps.app.id, state) } } const mapDispatchToProps = (dispatch, ownProps) => { return { onSubmit: parsed => { const subEnvId = R.path(["subEnv", "@@__id__"], ownProps) dispatch(importSingleEnvironment({ parsed, subEnvId, environment: ownProps.environment, parentType: "app", parentId: ownProps.app.id })) } } } export default connect(mapStateToProps, mapDispatchToProps)(ImportEnv)
node_modules/antd/es/badge/index.js
ZSMingNB/react-news
import _extends from 'babel-runtime/helpers/extends'; import _defineProperty from 'babel-runtime/helpers/defineProperty'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _createClass from 'babel-runtime/helpers/createClass'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; var __rest = this && this.__rest || function (s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; }if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; }return t; }; import React from 'react'; import PropTypes from 'prop-types'; import Animate from 'rc-animate'; import ScrollNumber from './ScrollNumber'; import classNames from 'classnames'; import warning from '../_util/warning'; var Badge = function (_React$Component) { _inherits(Badge, _React$Component); function Badge() { _classCallCheck(this, Badge); return _possibleConstructorReturn(this, (Badge.__proto__ || Object.getPrototypeOf(Badge)).apply(this, arguments)); } _createClass(Badge, [{ key: 'render', value: function render() { var _classNames, _classNames2; var _a = this.props, count = _a.count, showZero = _a.showZero, prefixCls = _a.prefixCls, overflowCount = _a.overflowCount, className = _a.className, style = _a.style, children = _a.children, dot = _a.dot, status = _a.status, text = _a.text, restProps = __rest(_a, ["count", "showZero", "prefixCls", "overflowCount", "className", "style", "children", "dot", "status", "text"]); var isDot = dot || status; var displayCount = count > overflowCount ? overflowCount + '+' : count; // dot mode don't need count if (isDot) { displayCount = ''; } var isZero = displayCount === '0' || displayCount === 0; var isEmpty = displayCount === null || displayCount === undefined || displayCount === ''; var hidden = (isEmpty || isZero && !showZero) && !isDot; var scrollNumberCls = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls + '-dot', isDot), _defineProperty(_classNames, prefixCls + '-count', !isDot), _classNames)); var badgeCls = classNames(className, prefixCls, (_classNames2 = {}, _defineProperty(_classNames2, prefixCls + '-status', !!status), _defineProperty(_classNames2, prefixCls + '-not-a-wrapper', !children), _classNames2)); warning(!(children && status), '`Badge[children]` and `Badge[status]` cannot be used at the same time.'); // <Badge status="success" /> if (!children && status) { var _classNames3; var statusCls = classNames((_classNames3 = {}, _defineProperty(_classNames3, prefixCls + '-status-dot', !!status), _defineProperty(_classNames3, prefixCls + '-status-' + status, true), _classNames3)); return React.createElement( 'span', { className: badgeCls }, React.createElement('span', { className: statusCls }), React.createElement( 'span', { className: prefixCls + '-status-text' }, text ) ); } var scrollNumber = hidden ? null : React.createElement(ScrollNumber, { 'data-show': !hidden, className: scrollNumberCls, count: displayCount, style: style }); var statusText = hidden || !text ? null : React.createElement( 'span', { className: prefixCls + '-status-text' }, text ); return React.createElement( 'span', _extends({}, restProps, { className: badgeCls, title: count }), children, React.createElement( Animate, { component: '', showProp: 'data-show', transitionName: children ? prefixCls + '-zoom' : '', transitionAppear: true }, scrollNumber ), statusText ); } }]); return Badge; }(React.Component); export default Badge; Badge.defaultProps = { prefixCls: 'ant-badge', count: null, showZero: false, dot: false, overflowCount: 99 }; Badge.propTypes = { count: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), showZero: PropTypes.bool, dot: PropTypes.bool, overflowCount: PropTypes.number };
ajax/libs/reactive-coffee/0.0.1/reactive-coffee.min.js
jakubfiala/cdnjs
!function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L={}.hasOwnProperty,M=function(a,b){function c(){this.constructor=a}for(var d in b)L.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},N=[].slice,O=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},P=this;"undefined"==typeof exports?this.rx=z={}:z=exports,w=0,v=function(){return w+=1},x=function(a,b){var c;if(!b in a)throw"object has no key "+b;return c=a[b],delete a[b],c},t=function(){return Object.create(null)},k=z.Recorder=function(){function a(){this.stack=[]}return a.prototype.start=function(a){return this.stack.push(a)},a.prototype.stop=function(){return this.stack.pop()},a.prototype.sub=function(a){var b,c;return this.stack.length>0?(c=_(this.stack).last(),b=a(c),c.addSub(b)):void 0},a.prototype.warnMutate=function(){return this.stack.length>0?console.warn("Mutation to observable detected during a bind context"):void 0},a}(),y=new k,z.bind=o=function(a){var b;return b=z.depCell(a),b.refresh(),b},z.lagBind=s=function(a,b){var c;return c=z.lagDepCell(b,a),c.refresh(),c},c=z.DepMgr=function(){function a(){this.uid2src={}}return a.prototype.sub=function(a,b){return this.uid2src[a]=b},a.prototype.unsub=function(a){return this.uid2src[a].unsub(a),x(this.uid2src,a)},a}(),p=new c,e=z.Ev=function(){function a(a){this.inits=a,this.subs=[]}return a.prototype.sub=function(a){var b,c,d,e,f;if(c=v(),null!=this.inits)for(f=this.inits(),d=0,e=f.length;e>d;d++)b=f[d],a(b);return this.subs[c]=a,p.sub(c,this),c},a.prototype.pub=function(a){var b,c,d,e;d=this.subs,e=[];for(c in d)b=d[c],e.push(b(a));return e},a.prototype.unsub=function(a){return x(this.subs,a)},a}(),h=z.ObsCell=function(){function a(a){var b,c=this;this.x=a,this.x=null!=(b=this.x)?b:null,this.onSet=new e(function(){return[[null,c.x]]})}return a.prototype.get=function(){var a=this;return y.sub(function(b){return a.onSet.sub(function(){return b.refresh()})}),this.x},a}(),m=z.SrcCell=function(a){function b(){return H=b.__super__.constructor.apply(this,arguments)}return M(b,a),b.prototype.set=function(a){var b;return y.warnMutate(),b=this.x,this.x=a,this.onSet.pub([b,a]),b},b}(h),b=z.DepCell=function(a){function b(a,c,d){this.body=a,b.__super__.constructor.call(this,null!=c?c:null),this.subs=[],this.refreshing=!1,this.lag=null!=d?d:!1,this.timeout=null}return M(b,a),b.prototype.refresh=function(){var a,b=this;return a=function(){var a,c,d,e,f;if(!b.refreshing){for(a=b.x,f=b.subs,d=0,e=f.length;e>d;d++)c=f[d],p.unsub(c);b.subs=[],y.start(b),b.refreshing=!0;try{b.x=b.body()}finally{b.refreshing=!1,y.stop()}return b.onSet.pub([a,b.x])}},this.refreshing?void 0:this.lag?(null!=this.timeout&&clearTimeout(this.timeout),console.log("setting timeout"),this.timeout=setTimeout(a,500)):a()},b.prototype.addSub=function(a){return this.subs.push(a)},b}(h),g=z.ObsArray=function(){function a(a){var b,c=this;this.xs=a,this.xs=null!=(b=this.xs)?b:[],this.onChange=new e(function(){return[[0,[],c.xs]]})}return a.prototype.all=function(){var a=this;return y.sub(function(b){return a.onChange.sub(function(){return b.refresh()})}),this.xs},a.prototype.at=function(a){var b=this;return y.sub(function(c){return b.onChange.sub(function(b){var d,e,f;return e=b[0],f=b[1],d=b[2],e===a?c.refresh():void 0})}),this.xs[a]},a.prototype.length=function(){var a=this;return y.sub(function(b){return a.onChange.sub(function(a){var c,d,e;return d=a[0],e=a[1],c=a[2],e.length!==c.length?b.refresh():void 0})}),this.xs.length},a.prototype.map=function(a){var b;return b=new f,this.onChange.sub(function(c){var d,e,f;return e=c[0],f=c[1],d=c[2],b.realSplice(e,f.length,d.map(a))}),b},a.prototype.realSplice=function(a,b,c){var d;return d=this.xs.splice.apply(this.xs,[a,b].concat(c)),this.onChange.pub([a,d,c])},a}(),l=z.SrcArray=function(a){function b(){return I=b.__super__.constructor.apply(this,arguments)}return M(b,a),b.prototype.spliceArray=function(a,b,c){return y.warnMutate(),this.realSplice(a,b,c)},b.prototype.splice=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?N.call(arguments,2):[],this.spliceArray(c,b,a)},b.prototype.insert=function(a,b){return this.splice(b,0,a)},b.prototype.remove=function(a){return this.removeAt(_(this.all()).indexOf(a))},b.prototype.removeAt=function(a){return this.splice(a,1)},b.prototype.push=function(a){return this.splice(this.length(),0,a)},b.prototype.put=function(a,b){return this.splice(a,1,b)},b.prototype.replace=function(a){return this.spliceArray(0,this.length(),a)},b}(g),f=z.MappedDepArray=function(a){function b(){return J=b.__super__.constructor.apply(this,arguments)}return M(b,a),b}(g),a=z.DepArray=function(a){function c(a){this.f=a,c.__super__.constructor.call(this),new b(this.f).onSet.sub(function(a){var b,c,d,e,f,g,h;return e=a[0],f=a[1],g=firstWhere(function(){h=[];for(var a=0,b=Math.min(e.length,f.length);b>=0?b>=a:a>=b;b>=0?a++:a--)h.push(a);return h}.apply(this),function(a){return e[a]!==f[a]}),d=g[0],d=g[1],d>-1?(c=e.length-d,b=f.slice(d),this.realSplice(d,c,b)):void 0})}return M(c,a),c}(g),i=z.ObsMap=function(){function a(a){this.x=null!=a?a:{},this.onAdd=new e(function(){var b,c,d;d=[];for(b in a)c=a[b],d.push([b,c]);return d}),this.onRemove=new e,this.onChange=new e}return a.prototype.get=function(a){var b=this;return y.sub(function(c){return b.onChange.sub(function(b){var d,e,f;return e=b[0],d=b[1],f=b[2],a===e?c.refresh():void 0})}),this.x[a]},a.prototype.all=function(){var a=this;return y.sub(function(b){return a.onChange.sub(function(){return b.refresh()})}),_.clone(this.x)},a.prototype.realPut=function(a,b){var c;return O.call(this.x,a)>=0?(c=this.x[a],this.x[a]=b,this.onChange.pub([a,c,b]),c):(this.x[a]=b,this.onAdd.pub([a,b]),void 0)},a.prototype.realRemove=function(a){var b;return b=x(this.x,a),this.onRemove.pub([a,b]),b},a}(),n=z.SrcMap=function(a){function b(){return K=b.__super__.constructor.apply(this,arguments)}return M(b,a),b.prototype.put=function(a,b){return y.warnMutate(),this.realPut(a,b)},b.prototype.remove=function(a){return y.warnMutate(),this.realRemove(a)},b}(i),d=z.DepMap=function(a){function c(a){this.f=a,c.__super__.constructor.call(this),new b(this.f).onSet.sub(function(a){var b,c,d,e,f;c=a[0],e=a[1];for(b in c)d=c[b],!b in e&&this.realRemove(b);f=[];for(b in e)d=e[b],this.x[b]!==d?f.push(this.realPut(b,d)):f.push(void 0);return f})}return M(c,a),c}(i),_.extend(z,{cell:function(a){return new m(a)},array:function(a){return new l(a)},map:function(a){return new n(a)},depCell:function(a){return new b(a)},lagDepCell:function(a,c){return new b(a,c,!0)},depMap:function(a){return new DepMap(a)},depArray:function(b){return new a(b)}}),$.fn.rx=function(a){var b,c,d,e;return d=this.data("rx-map"),null==d&&this.data("rx-map",d=t()),a in d?d[a]:d[a]=function(){var d=this;switch(a){case"focused":return c=z.cell(this.is(":focus")),this.focus(function(){return c.set(!0)}),this.blur(function(){return c.set(!1)}),c;case"val":return e=z.cell(this.val()),this.change(function(){return e.set(d.val())}),this.on("input",function(){return e.set(d.val())}),e;case"checked":return b=z.cell(this.is(":checked")),this.change(function(){return b.set(d.is(":checked"))}),b;default:throw"Unknown reactive property type"}}.call(this)},"undefined"==typeof exports?this.rxt=A={}:A=exports,j=A.RawHtml=function(){function a(a){this.html=a}return a}(),r=["blur","change","click","dblclick","error","focus","focusin","focusout","hover","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","ready","resize","scroll","select","submit","toggle","unload"],B=A.specialAttrs={init:function(a,b){return b.call(a)}},E=function(a){return B[a]=function(b,c){return b[a](function(a){return c.call(b,a)})}};for(F=0,G=r.length;G>F;F++)q=r[F],E(q);A.mktag=u=function(a){return function(b,c){var d,e,f,i,k,l,m,n,o;n=null==b&&null==c?[{},null]:null!=c?[b,c]:_.isString(b)||b instanceof j||_.isArray(b)||b instanceof h||b instanceof g?[{},b]:[b,null],d=n[0],e=n[1],f=$("<"+a+"/>"),o=_.omit(d,_.keys(B));for(k in o)m=o[k],m instanceof h?function(a){return m.onSet.sub(function(b){var c,d;return c=b[0],d=b[1],f.attr(a,d)})}(k):f.attr(k,m);null!=e&&(l=function(a){var b,c,d,e;if(f.html(""),_.isArray(a)){for(e=[],c=0,d=a.length;d>c;c++)b=a[c],_.isString(b)?b=$("<span/>").text(b):b instanceof j&&(b=$("<span/>").html(b.html)),e.push(f.append(b));return e}if(_.isString(a)||a instanceof j)return l([a]);throw"Unknown type for contents: "+a.constructor.name},e instanceof g?e.onChange.sub(function(a){var b,c,d,e,g;return d=a[0],e=a[1],b=a[2],f.children().slice(d,d+e.length).remove(),g=$(function(){var a,d,e;for(e=[],a=0,d=b.length;d>a;a++)c=b[a],e.push(c.get(0));return e}()),d===f.children().length?f.append(g):f.children().slice(d,d+1).before(g)}):e instanceof h?e.onSet.sub(function(a){var b,c;return b=a[0],c=a[1],l(c)}):l(e));for(i in d)i in B&&B[i](f,d[i],d,e);return f}},D=["html","head","title","base","link","meta","style","script","noscript","body","body","section","nav","article","aside","h1","h2","h3","h4","h5","h6","h1","h6","header","footer","address","main","main","p","hr","pre","blockquote","ol","ul","li","dl","dt","dd","dd","figure","figcaption","div","a","em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","ruby","rt","rp","bdi","bdo","span","br","wbr","ins","del","img","iframe","embed","object","param","object","video","audio","source","video","audio","track","video","audio","canvas","map","area","area","map","svg","math","table","caption","colgroup","col","tbody","thead","tfoot","tr","td","th","form","fieldset","legend","fieldset","label","input","button","select","datalist","optgroup","option","select","datalist","textarea","keygen","output","progress","meter","details","summary","details","menuitem","menu"],A.tags=_.object(function(){var a,b,c;for(c=[],a=0,b=D.length;b>a;a++)C=D[a],c.push([C,A.mktag(C)]);return c}()),A.rawHtml=function(a){return new j(a)},A.importTags=function(a){return _(null!=a?a:P).extend(A.tags)}}.call(this);
yycomponent/dropdown/Button.js
77ircloud/yycomponent
import React from 'react'; import { Dropdown } from 'antd'; class Button extends React.Component{ constructor(props){ super(props); } static defaultProps={ trigger:[document.body.ontouchstart===undefined?'hover':'click'] } render() { return (<Dropdown.Button {...this.props}/>); } } export default Button
src/svg-icons/action/invert-colors.js
verdan/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionInvertColors = (props) => ( <SvgIcon {...props}> <path d="M17.66 7.93L12 2.27 6.34 7.93c-3.12 3.12-3.12 8.19 0 11.31C7.9 20.8 9.95 21.58 12 21.58c2.05 0 4.1-.78 5.66-2.34 3.12-3.12 3.12-8.19 0-11.31zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59s.62-3.11 1.76-4.24L12 5.1v14.49z"/> </SvgIcon> ); ActionInvertColors = pure(ActionInvertColors); ActionInvertColors.displayName = 'ActionInvertColors'; ActionInvertColors.muiName = 'SvgIcon'; export default ActionInvertColors;
client/node_modules/react-router/es/IndexLink.js
UnicornCollege/ucl.itkpd.configurator
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; import React from 'react'; import Link from './Link'; /** * An <IndexLink> is used to link to an <IndexRoute>. */ var IndexLink = React.createClass({ displayName: 'IndexLink', render: function render() { return React.createElement(Link, _extends({}, this.props, { onlyActiveOnIndex: true })); } }); export default IndexLink;
ajax/libs/zone.js/0.8.13/zone.js
him2him2/cdnjs
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : (factory()); }(this, (function () { 'use strict'; /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Zone$1 = (function (global) { var performance = global['performance']; function mark(name) { performance && performance['mark'] && performance['mark'](name); } function performanceMeasure(name, label) { performance && performance['measure'] && performance['measure'](name, label); } mark('Zone'); if (global['Zone']) { throw new Error('Zone already loaded.'); } var Zone = (function () { function Zone(parent, zoneSpec) { this._properties = null; this._parent = parent; this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>'; this._properties = zoneSpec && zoneSpec.properties || {}; this._zoneDelegate = new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec); } Zone.assertZonePatched = function () { if (global['Promise'] !== patches['ZoneAwarePromise']) { throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' + 'has been overwritten.\n' + 'Most likely cause is that a Promise polyfill has been loaded ' + 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' + 'If you must load one, do so before loading zone.js.)'); } }; Object.defineProperty(Zone, "root", { get: function () { var zone = Zone.current; while (zone.parent) { zone = zone.parent; } return zone; }, enumerable: true, configurable: true }); Object.defineProperty(Zone, "current", { get: function () { return _currentZoneFrame.zone; }, enumerable: true, configurable: true }); Object.defineProperty(Zone, "currentTask", { get: function () { return _currentTask; }, enumerable: true, configurable: true }); Zone.__load_patch = function (name, fn) { if (patches.hasOwnProperty(name)) { throw Error('Already loaded patch: ' + name); } else if (!global['__Zone_disable_' + name]) { var perfName = 'Zone:' + name; mark(perfName); patches[name] = fn(global, Zone, _api); performanceMeasure(perfName, perfName); } }; Object.defineProperty(Zone.prototype, "parent", { get: function () { return this._parent; }, enumerable: true, configurable: true }); Object.defineProperty(Zone.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); Zone.prototype.get = function (key) { var zone = this.getZoneWith(key); if (zone) return zone._properties[key]; }; Zone.prototype.getZoneWith = function (key) { var current = this; while (current) { if (current._properties.hasOwnProperty(key)) { return current; } current = current._parent; } return null; }; Zone.prototype.fork = function (zoneSpec) { if (!zoneSpec) throw new Error('ZoneSpec required!'); return this._zoneDelegate.fork(this, zoneSpec); }; Zone.prototype.wrap = function (callback, source) { if (typeof callback !== 'function') { throw new Error('Expecting function got: ' + callback); } var _callback = this._zoneDelegate.intercept(this, callback, source); var zone = this; return function () { return zone.runGuarded(_callback, this, arguments, source); }; }; Zone.prototype.run = function (callback, applyThis, applyArgs, source) { if (applyThis === void 0) { applyThis = undefined; } if (applyArgs === void 0) { applyArgs = null; } if (source === void 0) { source = null; } _currentZoneFrame = { parent: _currentZoneFrame, zone: this }; try { return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); } finally { _currentZoneFrame = _currentZoneFrame.parent; } }; Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) { if (applyThis === void 0) { applyThis = null; } if (applyArgs === void 0) { applyArgs = null; } if (source === void 0) { source = null; } _currentZoneFrame = { parent: _currentZoneFrame, zone: this }; try { try { return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); } catch (error) { if (this._zoneDelegate.handleError(this, error)) { throw error; } } } finally { _currentZoneFrame = _currentZoneFrame.parent; } }; Zone.prototype.runTask = function (task, applyThis, applyArgs) { if (task.zone != this) { throw new Error('A task can only be run in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')'); } // https://github.com/angular/zone.js/issues/778, sometimes eventTask // will run in notScheduled(canceled) state, we should not try to // run such kind of task but just return // we have to define an variable here, if not // typescript compiler will complain below var isNotScheduled = task.state === notScheduled; if (isNotScheduled && task.type === eventTask) { return; } var reEntryGuard = task.state != running; reEntryGuard && task._transitionTo(running, scheduled); task.runCount++; var previousTask = _currentTask; _currentTask = task; _currentZoneFrame = { parent: _currentZoneFrame, zone: this }; try { if (task.type == macroTask && task.data && !task.data.isPeriodic) { task.cancelFn = null; } try { return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs); } catch (error) { if (this._zoneDelegate.handleError(this, error)) { throw error; } } } finally { // if the task's state is notScheduled or unknown, then it has already been cancelled // we should not reset the state to scheduled if (task.state !== notScheduled && task.state !== unknown) { if (task.type == eventTask || (task.data && task.data.isPeriodic)) { reEntryGuard && task._transitionTo(scheduled, running); } else { task.runCount = 0; this._updateTaskCount(task, -1); reEntryGuard && task._transitionTo(notScheduled, running, notScheduled); } } _currentZoneFrame = _currentZoneFrame.parent; _currentTask = previousTask; } }; Zone.prototype.scheduleTask = function (task) { if (task.zone && task.zone !== this) { // check if the task was rescheduled, the newZone // should not be the children of the original zone var newZone = this; while (newZone) { if (newZone === task.zone) { throw Error("can not reschedule task to " + this .name + " which is descendants of the original zone " + task.zone.name); } newZone = newZone.parent; } } task._transitionTo(scheduling, notScheduled); var zoneDelegates = []; task._zoneDelegates = zoneDelegates; task._zone = this; try { task = this._zoneDelegate.scheduleTask(this, task); } catch (err) { // should set task's state to unknown when scheduleTask throw error // because the err may from reschedule, so the fromState maybe notScheduled task._transitionTo(unknown, scheduling, notScheduled); // TODO: @JiaLiPassion, should we check the result from handleError? this._zoneDelegate.handleError(this, err); throw err; } if (task._zoneDelegates === zoneDelegates) { // we have to check because internally the delegate can reschedule the task. this._updateTaskCount(task, 1); } if (task.state == scheduling) { task._transitionTo(scheduled, scheduling); } return task; }; Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) { return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null)); }; Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) { return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel)); }; Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) { return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel)); }; Zone.prototype.cancelTask = function (task) { if (task.zone != this) throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')'); task._transitionTo(canceling, scheduled, running); try { this._zoneDelegate.cancelTask(this, task); } catch (err) { // if error occurs when cancelTask, transit the state to unknown task._transitionTo(unknown, canceling); this._zoneDelegate.handleError(this, err); throw err; } this._updateTaskCount(task, -1); task._transitionTo(notScheduled, canceling); task.runCount = 0; return task; }; Zone.prototype._updateTaskCount = function (task, count) { var zoneDelegates = task._zoneDelegates; if (count == -1) { task._zoneDelegates = null; } for (var i = 0; i < zoneDelegates.length; i++) { zoneDelegates[i]._updateTaskCount(task.type, count); } }; return Zone; }()); Zone.__symbol__ = __symbol__; var DELEGATE_ZS = { name: '', onHasTask: function (delegate, _, target, hasTaskState) { return delegate.hasTask(target, hasTaskState); }, onScheduleTask: function (delegate, _, target, task) { return delegate.scheduleTask(target, task); }, onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); }, onCancelTask: function (delegate, _, target, task) { return delegate.cancelTask(target, task); } }; var ZoneDelegate = (function () { function ZoneDelegate(zone, parentDelegate, zoneSpec) { this._taskCounts = { 'microTask': 0, 'macroTask': 0, 'eventTask': 0 }; this.zone = zone; this._parentDelegate = parentDelegate; this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS); this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt); this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate.zone); this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS); this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt); this._interceptCurrZone = zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate.zone); this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS); this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt); this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate.zone); this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS); this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt); this._handleErrorCurrZone = zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone); this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS); this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt); this._scheduleTaskCurrZone = zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone); this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS); this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt); this._invokeTaskCurrZone = zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate.zone); this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS); this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt); this._cancelTaskCurrZone = zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate.zone); this._hasTaskZS = null; this._hasTaskDlgt = null; this._hasTaskDlgtOwner = null; this._hasTaskCurrZone = null; var zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask; var parentHasTask = parentDelegate && parentDelegate._hasTaskZS; if (zoneSpecHasTask || parentHasTask) { // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such // a case all task related interceptors must go through this ZD. We can't short circuit it. this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS; this._hasTaskDlgt = parentDelegate; this._hasTaskDlgtOwner = this; this._hasTaskCurrZone = zone; if (!zoneSpec.onScheduleTask) { this._scheduleTaskZS = DELEGATE_ZS; this._scheduleTaskDlgt = parentDelegate; this._scheduleTaskCurrZone = this.zone; } if (!zoneSpec.onInvokeTask) { this._invokeTaskZS = DELEGATE_ZS; this._invokeTaskDlgt = parentDelegate; this._invokeTaskCurrZone = this.zone; } if (!zoneSpec.onCancelTask) { this._cancelTaskZS = DELEGATE_ZS; this._cancelTaskDlgt = parentDelegate; this._cancelTaskCurrZone = this.zone; } } } ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) { return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) : new Zone(targetZone, zoneSpec); }; ZoneDelegate.prototype.intercept = function (targetZone, callback, source) { return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) : callback; }; ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) { return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) : callback.apply(applyThis, applyArgs); }; ZoneDelegate.prototype.handleError = function (targetZone, error) { return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) : true; }; ZoneDelegate.prototype.scheduleTask = function (targetZone, task) { var returnTask = task; if (this._scheduleTaskZS) { if (this._hasTaskZS) { returnTask._zoneDelegates.push(this._hasTaskDlgtOwner); } returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task); if (!returnTask) returnTask = task; } else { if (task.scheduleFn) { task.scheduleFn(task); } else if (task.type == microTask) { scheduleMicroTask(task); } else { throw new Error('Task is missing scheduleFn.'); } } return returnTask; }; ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) { return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) : task.callback.apply(applyThis, applyArgs); }; ZoneDelegate.prototype.cancelTask = function (targetZone, task) { var value; if (this._cancelTaskZS) { value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task); } else { if (!task.cancelFn) { throw Error('Task is not cancelable'); } value = task.cancelFn(task); } return value; }; ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) { // hasTask should not throw error so other ZoneDelegate // can still trigger hasTask callback try { return this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty); } catch (err) { this.handleError(targetZone, err); } }; ZoneDelegate.prototype._updateTaskCount = function (type, count) { var counts = this._taskCounts; var prev = counts[type]; var next = counts[type] = prev + count; if (next < 0) { throw new Error('More tasks executed then were scheduled.'); } if (prev == 0 || next == 0) { var isEmpty = { microTask: counts.microTask > 0, macroTask: counts.macroTask > 0, eventTask: counts.eventTask > 0, change: type }; this.hasTask(this.zone, isEmpty); } }; return ZoneDelegate; }()); var OPTIMIZED_ZONE_EVENT_TASK = Zone.__symbol__('optimizedZoneEventTask'); var ZoneTask = (function () { function ZoneTask(type, source, callback, options, scheduleFn, cancelFn) { this._zone = null; this.runCount = 0; this._zoneDelegates = null; this._state = 'notScheduled'; this.type = type; this.source = source; this.data = options; this.scheduleFn = scheduleFn; this.cancelFn = cancelFn; this.callback = callback; var self = this; if (type === eventTask && options === OPTIMIZED_ZONE_EVENT_TASK) { this.invoke = ZoneTask.invokeTask; } else { this.invoke = function () { return ZoneTask.invokeTask.apply(global, [self, this, arguments]); }; } } ZoneTask.invokeTask = function (task, target, args) { if (!task) { task = this; } _numberOfNestedTaskFrames++; try { task.runCount++; return task.zone.runTask(task, target, args); } finally { if (_numberOfNestedTaskFrames == 1) { drainMicroTaskQueue(); } _numberOfNestedTaskFrames--; } }; Object.defineProperty(ZoneTask.prototype, "zone", { get: function () { return this._zone; }, enumerable: true, configurable: true }); Object.defineProperty(ZoneTask.prototype, "state", { get: function () { return this._state; }, enumerable: true, configurable: true }); ZoneTask.prototype.cancelScheduleRequest = function () { this._transitionTo(notScheduled, scheduling); }; ZoneTask.prototype._transitionTo = function (toState, fromState1, fromState2) { if (this._state === fromState1 || this._state === fromState2) { this._state = toState; if (toState == notScheduled) { this._zoneDelegates = null; } } else { throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ? ' or \'' + fromState2 + '\'' : '') + ", was '" + this._state + "'."); } }; ZoneTask.prototype.toString = function () { if (this.data && typeof this.data.handleId !== 'undefined') { return this.data.handleId; } else { return Object.prototype.toString.call(this); } }; // add toJSON method to prevent cyclic error when // call JSON.stringify(zoneTask) ZoneTask.prototype.toJSON = function () { return { type: this.type, state: this.state, source: this.source, zone: this.zone.name, invoke: this.invoke, scheduleFn: this.scheduleFn, cancelFn: this.cancelFn, runCount: this.runCount, callback: this.callback }; }; return ZoneTask; }()); ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /// MICROTASK QUEUE ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// var symbolSetTimeout = __symbol__('setTimeout'); var symbolPromise = __symbol__('Promise'); var symbolThen = __symbol__('then'); var _microTaskQueue = []; var _isDrainingMicrotaskQueue = false; function scheduleMicroTask(task) { // if we are not running in any task, and there has not been anything scheduled // we must bootstrap the initial task creation by manually scheduling the drain if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) { // We are not running in Task, so we need to kickstart the microtask queue. if (global[symbolPromise]) { global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue); } else { global[symbolSetTimeout](drainMicroTaskQueue, 0); } } task && _microTaskQueue.push(task); } function drainMicroTaskQueue() { if (!_isDrainingMicrotaskQueue) { _isDrainingMicrotaskQueue = true; while (_microTaskQueue.length) { var queue = _microTaskQueue; _microTaskQueue = []; for (var i = 0; i < queue.length; i++) { var task = queue[i]; try { task.zone.runTask(task, null, null); } catch (error) { _api.onUnhandledError(error); } } } var showError = !Zone[__symbol__('ignoreConsoleErrorUncaughtError')]; _api.microtaskDrainDone(); _isDrainingMicrotaskQueue = false; } } ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /// BOOTSTRAP ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// var NO_ZONE = { name: 'NO ZONE' }; var notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown'; var microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask'; var patches = {}; var _api = { symbol: __symbol__, currentZoneFrame: function () { return _currentZoneFrame; }, onUnhandledError: noop, microtaskDrainDone: noop, scheduleMicroTask: scheduleMicroTask, showUncaughtError: function () { return !Zone[__symbol__('ignoreConsoleErrorUncaughtError')]; }, patchEventTargetMethods: function () { return false; }, patchOnProperties: noop, patchMethod: function () { return noop; }, }; var _currentZoneFrame = { parent: null, zone: new Zone(null, null) }; var _currentTask = null; var _numberOfNestedTaskFrames = 0; function noop() { } function __symbol__(name) { return '__zone_symbol__' + name; } performanceMeasure('Zone', 'Zone'); return global['Zone'] = Zone; })(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) { var __symbol__ = api.symbol; var _uncaughtPromiseErrors = []; var symbolPromise = __symbol__('Promise'); var symbolThen = __symbol__('then'); api.onUnhandledError = function (e) { if (api.showUncaughtError()) { var rejection = e && e.rejection; if (rejection) { console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined); } else { console.error(e); } } }; api.microtaskDrainDone = function () { while (_uncaughtPromiseErrors.length) { var _loop_1 = function () { var uncaughtPromiseError = _uncaughtPromiseErrors.shift(); try { uncaughtPromiseError.zone.runGuarded(function () { throw uncaughtPromiseError; }); } catch (error) { handleUnhandledRejection(error); } }; while (_uncaughtPromiseErrors.length) { _loop_1(); } } }; function handleUnhandledRejection(e) { api.onUnhandledError(e); try { var handler = Zone[__symbol__('unhandledPromiseRejectionHandler')]; if (handler && typeof handler === 'function') { handler.apply(this, [e]); } } catch (err) { } } function isThenable(value) { return value && value.then; } function forwardResolution(value) { return value; } function forwardRejection(rejection) { return ZoneAwarePromise.reject(rejection); } var symbolState = __symbol__('state'); var symbolValue = __symbol__('value'); var source = 'Promise.then'; var UNRESOLVED = null; var RESOLVED = true; var REJECTED = false; var REJECTED_NO_CATCH = 0; function makeResolver(promise, state) { return function (v) { try { resolvePromise(promise, state, v); } catch (err) { resolvePromise(promise, false, err); } // Do not return value or you will break the Promise spec. }; } var once = function () { var wasCalled = false; return function wrapper(wrappedFunction) { return function () { if (wasCalled) { return; } wasCalled = true; wrappedFunction.apply(null, arguments); }; }; }; // Promise Resolution function resolvePromise(promise, state, value) { var onceWrapper = once(); if (promise === value) { throw new TypeError('Promise resolved with itself'); } if (promise[symbolState] === UNRESOLVED) { // should only get value.then once based on promise spec. var then = null; try { if (typeof value === 'object' || typeof value === 'function') { then = value && value.then; } } catch (err) { onceWrapper(function () { resolvePromise(promise, false, err); })(); return promise; } // if (value instanceof ZoneAwarePromise) { if (state !== REJECTED && value instanceof ZoneAwarePromise && value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) && value[symbolState] !== UNRESOLVED) { clearRejectedNoCatch(value); resolvePromise(promise, value[symbolState], value[symbolValue]); } else if (state !== REJECTED && typeof then === 'function') { try { then.apply(value, [ onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)) ]); } catch (err) { onceWrapper(function () { resolvePromise(promise, false, err); })(); } } else { promise[symbolState] = state; var queue = promise[symbolValue]; promise[symbolValue] = value; // record task information in value when error occurs, so we can // do some additional work such as render longStackTrace if (state === REJECTED && value instanceof Error) { value[__symbol__('currentTask')] = Zone.currentTask; } for (var i = 0; i < queue.length;) { scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]); } if (queue.length == 0 && state == REJECTED) { promise[symbolState] = REJECTED_NO_CATCH; try { throw new Error('Uncaught (in promise): ' + value + (value && value.stack ? '\n' + value.stack : '')); } catch (err) { var error_1 = err; error_1.rejection = value; error_1.promise = promise; error_1.zone = Zone.current; error_1.task = Zone.currentTask; _uncaughtPromiseErrors.push(error_1); api.scheduleMicroTask(); // to make sure that it is running } } } } // Resolving an already resolved promise is a noop. return promise; } function clearRejectedNoCatch(promise) { if (promise[symbolState] === REJECTED_NO_CATCH) { // if the promise is rejected no catch status // and queue.length > 0, means there is a error handler // here to handle the rejected promise, we should trigger // windows.rejectionhandled eventHandler or nodejs rejectionHandled // eventHandler try { var handler = Zone[__symbol__('rejectionHandledHandler')]; if (handler && typeof handler === 'function') { handler.apply(this, [{ rejection: promise[symbolValue], promise: promise }]); } } catch (err) { } promise[symbolState] = REJECTED; for (var i = 0; i < _uncaughtPromiseErrors.length; i++) { if (promise === _uncaughtPromiseErrors[i].promise) { _uncaughtPromiseErrors.splice(i, 1); } } } } function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) { clearRejectedNoCatch(promise); var delegate = promise[symbolState] ? (typeof onFulfilled === 'function') ? onFulfilled : forwardResolution : (typeof onRejected === 'function') ? onRejected : forwardRejection; zone.scheduleMicroTask(source, function () { try { resolvePromise(chainPromise, true, zone.run(delegate, undefined, [promise[symbolValue]])); } catch (error) { resolvePromise(chainPromise, false, error); } }); } var ZoneAwarePromise = (function () { function ZoneAwarePromise(executor) { var promise = this; if (!(promise instanceof ZoneAwarePromise)) { throw new Error('Must be an instanceof Promise.'); } promise[symbolState] = UNRESOLVED; promise[symbolValue] = []; // queue; try { executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED)); } catch (error) { resolvePromise(promise, false, error); } } ZoneAwarePromise.toString = function () { return 'function ZoneAwarePromise() { [native code] }'; }; ZoneAwarePromise.resolve = function (value) { return resolvePromise(new this(null), RESOLVED, value); }; ZoneAwarePromise.reject = function (error) { return resolvePromise(new this(null), REJECTED, error); }; ZoneAwarePromise.race = function (values) { var resolve; var reject; var promise = new this(function (res, rej) { _a = [res, rej], resolve = _a[0], reject = _a[1]; var _a; }); function onResolve(value) { promise && (promise = null || resolve(value)); } function onReject(error) { promise && (promise = null || reject(error)); } for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { var value = values_1[_i]; if (!isThenable(value)) { value = this.resolve(value); } value.then(onResolve, onReject); } return promise; }; ZoneAwarePromise.all = function (values) { var resolve; var reject; var promise = new this(function (res, rej) { resolve = res; reject = rej; }); var count = 0; var resolvedValues = []; for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { var value = values_2[_i]; if (!isThenable(value)) { value = this.resolve(value); } value.then((function (index) { return function (value) { resolvedValues[index] = value; count--; if (!count) { resolve(resolvedValues); } }; })(count), reject); count++; } if (!count) resolve(resolvedValues); return promise; }; ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) { var chainPromise = new this.constructor(null); var zone = Zone.current; if (this[symbolState] == UNRESOLVED) { this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected); } else { scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected); } return chainPromise; }; ZoneAwarePromise.prototype.catch = function (onRejected) { return this.then(null, onRejected); }; return ZoneAwarePromise; }()); // Protect against aggressive optimizers dropping seemingly unused properties. // E.g. Closure Compiler in advanced mode. ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve; ZoneAwarePromise['reject'] = ZoneAwarePromise.reject; ZoneAwarePromise['race'] = ZoneAwarePromise.race; ZoneAwarePromise['all'] = ZoneAwarePromise.all; var NativePromise = global[symbolPromise] = global['Promise']; global['Promise'] = ZoneAwarePromise; var symbolThenPatched = __symbol__('thenPatched'); function patchThen(Ctor) { var proto = Ctor.prototype; var originalThen = proto.then; // Keep a reference to the original method. proto[symbolThen] = originalThen; Ctor.prototype.then = function (onResolve, onReject) { var _this = this; var wrapped = new ZoneAwarePromise(function (resolve, reject) { originalThen.call(_this, resolve, reject); }); return wrapped.then(onResolve, onReject); }; Ctor[symbolThenPatched] = true; } function zoneify(fn) { return function () { var resultPromise = fn.apply(this, arguments); if (resultPromise instanceof ZoneAwarePromise) { return resultPromise; } var ctor = resultPromise.constructor; if (!ctor[symbolThenPatched]) { patchThen(ctor); } return resultPromise; }; } if (NativePromise) { patchThen(NativePromise); var fetch_1 = global['fetch']; if (typeof fetch_1 == 'function') { global['fetch'] = zoneify(fetch_1); } } // This is not part of public API, but it is useful for tests, so we expose it. Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors; return ZoneAwarePromise; }); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Suppress closure compiler errors about unknown 'Zone' variable * @fileoverview * @suppress {undefinedVars,globalThis} */ var zoneSymbol = Zone.__symbol__; var _global$1 = typeof window === 'object' && window || typeof self === 'object' && self || global; function bindArguments(args, source) { for (var i = args.length - 1; i >= 0; i--) { if (typeof args[i] === 'function') { args[i] = Zone.current.wrap(args[i], source + '_' + i); } } return args; } function patchPrototype(prototype, fnNames) { var source = prototype.constructor['name']; var _loop_1 = function (i) { var name_1 = fnNames[i]; var delegate = prototype[name_1]; if (delegate) { prototype[name_1] = (function (delegate) { var patched = function () { return delegate.apply(this, bindArguments(arguments, source + '.' + name_1)); }; attachOriginToPatched(patched, delegate); return patched; })(delegate); } }; for (var i = 0; i < fnNames.length; i++) { _loop_1(i); } } var isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope); // Make sure to access `process` through `_global` so that WebPack does not accidently browserify // this code. var isNode = (!('nw' in _global$1) && typeof _global$1.process !== 'undefined' && {}.toString.call(_global$1.process) === '[object process]'); var isBrowser = !isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']); // we are in electron of nw, so we are both browser and nodejs // Make sure to access `process` through `_global` so that WebPack does not accidently browserify // this code. var isMix = typeof _global$1.process !== 'undefined' && {}.toString.call(_global$1.process) === '[object process]' && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']); function patchProperty(obj, prop, prototype) { var desc = Object.getOwnPropertyDescriptor(obj, prop); if (!desc && prototype) { // when patch window object, use prototype to check prop exist or not var prototypeDesc = Object.getOwnPropertyDescriptor(prototype, prop); if (prototypeDesc) { desc = { enumerable: true, configurable: true }; } } // if the descriptor not exists or is not configurable // just return if (!desc || !desc.configurable) { return; } // A property descriptor cannot have getter/setter and be writable // deleting the writable and value properties avoids this error: // // TypeError: property descriptors must not specify a value or be writable when a // getter or setter has been specified delete desc.writable; delete desc.value; var originalDescGet = desc.get; // substr(2) cuz 'onclick' -> 'click', etc var eventName = prop.substr(2); var _prop = zoneSymbol('_' + prop); desc.set = function (newValue) { // in some of windows's onproperty callback, this is undefined // so we need to check it var target = this; if (!target && obj === _global$1) { target = _global$1; } if (!target) { return; } var previousValue = target[_prop]; if (previousValue) { target.removeEventListener(eventName, previousValue); } if (typeof newValue === 'function') { var wrapFn = function (event) { var result = newValue.apply(this, arguments); if (result != undefined && !result) { event.preventDefault(); } return result; }; target[_prop] = wrapFn; target.addEventListener(eventName, wrapFn, false); } else { target[_prop] = null; } }; // The getter would return undefined for unassigned properties but the default value of an // unassigned property is null desc.get = function () { // in some of windows's onproperty callback, this is undefined // so we need to check it var target = this; if (!target && obj === _global$1) { target = _global$1; } if (!target) { return null; } if (target.hasOwnProperty(_prop)) { return target[_prop]; } else if (originalDescGet) { // result will be null when use inline event attribute, // such as <button onclick="func();">OK</button> // because the onclick function is internal raw uncompiled handler // the onclick will be evaluated when first time event was triggered or // the property is accessed, https://github.com/angular/zone.js/issues/525 // so we should use original native get to retrieve the handler var value = originalDescGet && originalDescGet.apply(this); if (value) { desc.set.apply(this, [value]); if (typeof target['removeAttribute'] === 'function') { target.removeAttribute(prop); } return value; } } return null; }; Object.defineProperty(obj, prop, desc); } function patchOnProperties(obj, properties, prototype) { if (properties) { for (var i = 0; i < properties.length; i++) { patchProperty(obj, 'on' + properties[i], prototype); } } else { var onProperties = []; for (var prop in obj) { if (prop.substr(0, 2) == 'on') { onProperties.push(prop); } } for (var j = 0; j < onProperties.length; j++) { patchProperty(obj, onProperties[j], prototype); } } } var originalInstanceKey = zoneSymbol('originalInstance'); // wrap some native API on `window` function patchClass(className) { var OriginalClass = _global$1[className]; if (!OriginalClass) return; // keep original class in global _global$1[zoneSymbol(className)] = OriginalClass; _global$1[className] = function () { var a = bindArguments(arguments, className); switch (a.length) { case 0: this[originalInstanceKey] = new OriginalClass(); break; case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; default: throw new Error('Arg list too long.'); } }; // attach original delegate to patched function attachOriginToPatched(_global$1[className], OriginalClass); var instance = new OriginalClass(function () { }); var prop; for (prop in instance) { // https://bugs.webkit.org/show_bug.cgi?id=44721 if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue; (function (prop) { if (typeof instance[prop] === 'function') { _global$1[className].prototype[prop] = function () { return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); }; } else { Object.defineProperty(_global$1[className].prototype, prop, { set: function (fn) { if (typeof fn === 'function') { this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop); // keep callback in wrapped function so we can // use it in Function.prototype.toString to return // the native one. attachOriginToPatched(this[originalInstanceKey][prop], fn); } else { this[originalInstanceKey][prop] = fn; } }, get: function () { return this[originalInstanceKey][prop]; } }); } }(prop)); } for (prop in OriginalClass) { if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { _global$1[className][prop] = OriginalClass[prop]; } } } function patchMethod(target, name, patchFn) { var proto = target; while (proto && !proto.hasOwnProperty(name)) { proto = Object.getPrototypeOf(proto); } if (!proto && target[name]) { // somehow we did not find it, but we can see it. This happens on IE for Window properties. proto = target; } var delegateName = zoneSymbol(name); var delegate; if (proto && !(delegate = proto[delegateName])) { delegate = proto[delegateName] = proto[name]; var patchDelegate_1 = patchFn(delegate, delegateName, name); proto[name] = function () { return patchDelegate_1(this, arguments); }; attachOriginToPatched(proto[name], delegate); } return delegate; } // TODO: @JiaLiPassion, support cancel task later if necessary function patchMacroTask(obj, funcName, metaCreator) { var setNative = null; function scheduleTask(task) { var data = task.data; data.args[data.callbackIndex] = function () { task.invoke.apply(this, arguments); }; setNative.apply(data.target, data.args); return task; } setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) { var meta = metaCreator(self, args); if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') { var task = Zone.current.scheduleMacroTask(meta.name, args[meta.callbackIndex], meta, scheduleTask, null); return task; } else { // cause an error by calling it directly. return delegate.apply(self, args); } }; }); } function attachOriginToPatched(patched, original) { patched[zoneSymbol('OriginalDelegate')] = original; } var isDetectedIEOrEdge = false; var ieOrEdge = false; function isIEOrEdge() { if (isDetectedIEOrEdge) { return ieOrEdge; } isDetectedIEOrEdge = true; try { var ua = window.navigator.userAgent; var msie = ua.indexOf('MSIE '); if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) { ieOrEdge = true; } return ieOrEdge; } catch (error) { } } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // override Function.prototype.toString to make zone.js patched function // look like native function Zone.__load_patch('toString', function (global, Zone, api) { // patch Func.prototype.toString to let them look like native var originalFunctionToString = Zone['__zone_symbol__originalToString'] = Function.prototype.toString; Function.prototype.toString = function () { if (typeof this === 'function') { var originalDelegate = this[zoneSymbol('OriginalDelegate')]; if (originalDelegate) { if (typeof originalDelegate === 'function') { return originalFunctionToString.apply(this[zoneSymbol('OriginalDelegate')], arguments); } else { return Object.prototype.toString.call(originalDelegate); } } if (this === Promise) { var nativePromise = global[zoneSymbol('Promise')]; if (nativePromise) { return originalFunctionToString.apply(nativePromise, arguments); } } if (this === Error) { var nativeError = global[zoneSymbol('Error')]; if (nativeError) { return originalFunctionToString.apply(nativeError, arguments); } } } return originalFunctionToString.apply(this, arguments); }; // patch Object.prototype.toString to let them look like native var originalObjectToString = Object.prototype.toString; Object.prototype.toString = function () { if (this instanceof Promise) { return '[object Promise]'; } return originalObjectToString.apply(this, arguments); }; }); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var TRUE_STR = 'true'; var FALSE_STR = 'false'; // an identifier to tell ZoneTask do not create a new invoke closure var OPTIMIZED_ZONE_EVENT_TASK = zoneSymbol('optimizedZoneEventTask'); var zoneSymbolEventNames = {}; var globalSources = {}; var CONSTRUCTOR_NAME = 'name'; var FUNCTION_TYPE = 'function'; var OBJECT_TYPE = 'object'; var ZONE_SYMBOL_PREFIX = '__zone_symbol__'; var EVENT_NAME_SYMBOL_REGX = /^__zone_symbol__(\w+)(true|false)$/; var invokeTask = function (task, target, event) { var delegate = task.callback; if (typeof delegate === OBJECT_TYPE && delegate.handleEvent) { // create the bind version of handleEvnet when invoke task.callback = function (event) { return delegate.handleEvent(event); }; task.originalDelegate = delegate; } // invoke static task.invoke task.invoke(task, target, [event]); }; // global shared zoneAwareCallback to handle all event callback with capture = false var globalZoneAwareCallback = function (event) { var target = this || _global; var tasks = target[zoneSymbolEventNames[event.type][FALSE_STR]]; if (tasks) { // invoke all tasks which attached to current target with given event.type and capture = false for (var i = 0; i < tasks.length; i++) { invokeTask(tasks[i], target, event); } } }; // global shared zoneAwareCallback to handle all event callback with capture = true var globalZoneAwareCaptureCallback = function (event) { var target = this || _global; var tasks = target[zoneSymbolEventNames[event.type][TRUE_STR]]; if (tasks) { for (var i = 0; i < tasks.length; i++) { invokeTask(tasks[i], target, event); } } }; function patchEventTargetMethods(obj, patchOptions) { if (!obj) { return false; } var ADD_EVENT_LISTENER = (patchOptions && patchOptions.addEventListenerFnName) || 'addEventListener'; var REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.removeEventListenerFnName) || 'removeEventListener'; var LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listenersFnName) || 'eventListeners'; var REMOVE_ALL_LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.removeAllFnName) || 'removeAllListeners'; var zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER); var ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':'; var PREPEND_EVENT_LISTENER = 'prependListener'; var PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':'; var useGlobalCallback = true; if (patchOptions && patchOptions.useGlobalCallback !== undefined) { useGlobalCallback = patchOptions.useGlobalCallback; } var validateHandler = patchOptions && patchOptions.validateHandler; var checkDuplicate = true; if (patchOptions && patchOptions.checkDuplicate !== undefined) { checkDuplicate = patchOptions.checkDuplicate; } var returnTarget = false; if (patchOptions && patchOptions.returnTarget !== undefined) { returnTarget = patchOptions.returnTarget; } var proto = obj; while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) { proto = Object.getPrototypeOf(proto); } if (!proto && obj[ADD_EVENT_LISTENER]) { // somehow we did not find it, but we can see it. This happens on IE for Window properties. proto = obj; } if (!proto) { return false; } if (proto[zoneSymbolAddEventListener]) { return false; } // a shared global taskData to pass data for scheduleEventTask // so we do not need to create a new object just for pass some data var taskData = {}; var nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER]; var nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] = proto[REMOVE_EVENT_LISTENER]; var nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] = proto[LISTENERS_EVENT_LISTENER]; var nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] = proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER]; var nativePrependEventListener; if (patchOptions && patchOptions.prependEventListenerFnName) { nativePrependEventListener = proto[zoneSymbol(patchOptions.prependEventListenerFnName)] = proto[patchOptions.prependEventListenerFnName]; } var customScheduleGlobal = function (task) { // if there is already a task for the eventName + capture, // just return, because we use the shared globalZoneAwareCallback here. if (taskData.isExisting) { return; } return nativeAddEventListener.apply(taskData.target, [ taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options ]); }; var customCancelGlobal = function (task) { // if all tasks for the eventName + capture have gone, // we will really remove the global event callback, // if not, return if (!task.remove) { return; } return nativeRemoveEventListener.apply(task.target, [ task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options ]); }; var customScheduleNonGlobal = function (task) { return nativeAddEventListener.apply(taskData.target, [taskData.eventName, task.invoke, taskData.options]); }; var customSchedulePrepend = function (task) { return nativePrependEventListener.apply(taskData.target, [taskData.eventName, task.invoke, taskData.options]); }; var customCancelNonGlobal = function (task) { return nativeRemoveEventListener.apply(task.target, [task.eventName, task.invoke, task.options]); }; var customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal; var customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal; var compareTaskCallbackVsDelegate = function (task, delegate) { var typeOfDelegate = typeof delegate; if ((typeOfDelegate === FUNCTION_TYPE && task.callback === delegate) || (typeOfDelegate === OBJECT_TYPE && task.originalDelegate === delegate)) { // same callback, same capture, same event name, just return return true; } return false; }; var compare = (patchOptions && patchOptions.compareTaskCallbackVsDelegate) ? patchOptions.compareTaskCallbackVsDelegate : compareTaskCallbackVsDelegate; var makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget, prepend) { if (returnTarget === void 0) { returnTarget = false; } if (prepend === void 0) { prepend = false; } return function () { var target = this || _global; var targetZone = Zone.current; var delegate = arguments[1]; if (!delegate) { return nativeListener.apply(this, arguments); } // don't create the bind delegate function for handleEvent // case here to improve addEventListener performance // we will create the bind delegate when invoke var isHandleEvent = false; if (typeof delegate !== FUNCTION_TYPE) { if (!delegate.handleEvent) { return nativeListener.apply(this, arguments); } isHandleEvent = true; } if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) { return; } var eventName = arguments[0]; var options = arguments[2]; var capture; if (options === undefined) { capture = false; } else if (options === true) { capture = true; } else if (options === false) { capture = false; } else { capture = options ? !!options.capture : false; } var zone = Zone.current; var symbolEventNames = zoneSymbolEventNames[eventName]; var symbolEventName; if (!symbolEventNames) { // the code is duplicate, but I just want to get some better performance var falseEventName = eventName + FALSE_STR; var trueEventName = eventName + TRUE_STR; var symbol = ZONE_SYMBOL_PREFIX + falseEventName; var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName; zoneSymbolEventNames[eventName] = {}; zoneSymbolEventNames[eventName][FALSE_STR] = symbol; zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture; symbolEventName = capture ? symbolCapture : symbol; } else { symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR]; } var existingTasks = target[symbolEventName]; var isExisting = false; if (existingTasks) { // already have task registered isExisting = true; if (checkDuplicate) { for (var i = 0; i < existingTasks.length; i++) { if (compare(existingTasks[i], delegate)) { // same callback, same capture, same event name, just return return; } } } } else { existingTasks = target[symbolEventName] = []; } var source; var constructorName = target.constructor[CONSTRUCTOR_NAME]; var targetSource = globalSources[constructorName]; if (targetSource) { source = targetSource[eventName]; } if (!source) { source = constructorName + addSource + eventName; } // do not create a new object as task.data to pass those things // just use the global shared one taskData.options = options; taskData.target = target; taskData.capture = capture; taskData.eventName = eventName; taskData.isExisting = isExisting; var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK : null; var task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn); // have to save those information to task in case // application may call task.zone.cancelTask() directly task.options = options; task.target = target; task.capture = capture; task.eventName = eventName; if (isHandleEvent) { // save original delegate for compare to check duplicate task.originalDelegate = delegate; } if (!prepend) { existingTasks.push(task); } else { existingTasks.unshift(task); } if (returnTarget) { return target; } }; }; proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget); if (nativePrependEventListener) { proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true); } proto[REMOVE_EVENT_LISTENER] = function () { var target = this || _global; var eventName = arguments[0]; var options = arguments[2]; var capture; if (options === undefined) { capture = false; } else if (options === true) { capture = true; } else if (options === false) { capture = false; } else { capture = options ? !!options.capture : false; } var delegate = arguments[1]; if (!delegate) { return nativeRemoveEventListener.apply(this, arguments); } if (validateHandler && !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) { return; } var symbolEventNames = zoneSymbolEventNames[eventName]; var symbolEventName; if (symbolEventNames) { symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR]; } var existingTasks = symbolEventName && target[symbolEventName]; if (existingTasks) { for (var i = 0; i < existingTasks.length; i++) { var existingTask = existingTasks[i]; var typeOfDelegate = typeof delegate; if (compare(existingTask, delegate)) { existingTasks.splice(i, 1); if (existingTasks.length === 0) { // all tasks for the eventName + capture have gone, // remove globalZoneAwareCallback and remove the task cache from target existingTask.remove = true; target[symbolEventName] = null; } existingTask.zone.cancelTask(existingTask); return; } } } }; proto[LISTENERS_EVENT_LISTENER] = function () { var target = this || _global; var eventName = arguments[0]; var listeners = []; var tasks = findEventTasks(target, eventName); for (var i = 0; i < tasks.length; i++) { var task = tasks[i]; var delegate = task.originalDelegate ? task.originalDelegate : task.callback; listeners.push(delegate); } return listeners; }; proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () { var target = this || _global; var eventName = arguments[0]; if (!eventName) { var keys = Object.keys(target); for (var i = 0; i < keys.length; i++) { var prop = keys[i]; var match = EVENT_NAME_SYMBOL_REGX.exec(prop); var evtName = match && match[1]; if (evtName && evtName !== 'removeListener') { this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].apply(this, [evtName]); } } this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].apply(this, ['removeListener']); } else { var symbolEventNames = zoneSymbolEventNames[eventName]; if (symbolEventNames) { var symbolEventName = symbolEventNames[FALSE_STR]; var symbolCaptureEventName = symbolEventNames[TRUE_STR]; var tasks = target[symbolEventName]; var captureTasks = target[symbolCaptureEventName]; if (tasks) { var removeTasks = tasks.slice(); for (var i = 0; i < removeTasks.length; i++) { var task = removeTasks[i]; var delegate = task.originalDelegate ? task.originalDelegate : task.callback; this[REMOVE_EVENT_LISTENER].apply(this, [eventName, delegate, task.options]); } } if (captureTasks) { var removeTasks = captureTasks.slice(); for (var i = 0; i < removeTasks.length; i++) { var task = removeTasks[i]; var delegate = task.originalDelegate ? task.originalDelegate : task.callback; this[REMOVE_EVENT_LISTENER].apply(this, [eventName, delegate, task.options]); } } } } }; // for native toString patch attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener); attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener); if (nativeRemoveAllListeners) { attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners); } if (nativeListeners) { attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners); } return true; } function findEventTasks(target, eventName) { var foundTasks = []; for (var prop in target) { var match = EVENT_NAME_SYMBOL_REGX.exec(prop); var evtName = match && match[1]; if (evtName && (!eventName || evtName === eventName)) { var tasks = target[prop]; if (tasks) { for (var i = 0; i < tasks.length; i++) { foundTasks.push(tasks[i]); } } } } return foundTasks; } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function patchTimer(window, setName, cancelName, nameSuffix) { var setNative = null; var clearNative = null; setName += nameSuffix; cancelName += nameSuffix; var tasksByHandleId = {}; function scheduleTask(task) { var data = task.data; function timer() { try { task.invoke.apply(this, arguments); } finally { if (typeof data.handleId === 'number') { // Node returns complex objects as handleIds delete tasksByHandleId[data.handleId]; } } } data.args[0] = timer; data.handleId = setNative.apply(window, data.args); if (typeof data.handleId === 'number') { // Node returns complex objects as handleIds -> no need to keep them around. Additionally, // this throws an // exception in older node versions and has no effect there, because of the stringified key. tasksByHandleId[data.handleId] = task; } return task; } function clearTask(task) { if (typeof task.data.handleId === 'number') { // Node returns complex objects as handleIds delete tasksByHandleId[task.data.handleId]; } return clearNative(task.data.handleId); } setNative = patchMethod(window, setName, function (delegate) { return function (self, args) { if (typeof args[0] === 'function') { var zone = Zone.current; var options = { handleId: null, isPeriodic: nameSuffix === 'Interval', delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null, args: args }; var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask); if (!task) { return task; } // Node.js must additionally support the ref and unref functions. var handle = task.data.handleId; // check whether handle is null, because some polyfill or browser // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' && typeof handle.unref === 'function') { task.ref = handle.ref.bind(handle); task.unref = handle.unref.bind(handle); } return task; } else { // cause an error by calling it directly. return delegate.apply(window, args); } }; }); clearNative = patchMethod(window, cancelName, function (delegate) { return function (self, args) { var task = typeof args[0] === 'number' ? tasksByHandleId[args[0]] : args[0]; if (task && typeof task.type === 'string') { if (task.state !== 'notScheduled' && (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) { // Do not cancel already canceled functions task.zone.cancelTask(task); } } else { // cause an error by calling it directly. delegate.apply(window, args); } }; }); } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /* * This is necessary for Chrome and Chrome mobile, to enable * things like redefining `createdCallback` on an element. */ var _defineProperty = Object[zoneSymbol('defineProperty')] = Object.defineProperty; var _getOwnPropertyDescriptor = Object[zoneSymbol('getOwnPropertyDescriptor')] = Object.getOwnPropertyDescriptor; var _create = Object.create; var unconfigurablesKey = zoneSymbol('unconfigurables'); function propertyPatch() { Object.defineProperty = function (obj, prop, desc) { if (isUnconfigurable(obj, prop)) { throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); } var originalConfigurableFlag = desc.configurable; if (prop !== 'prototype') { desc = rewriteDescriptor(obj, prop, desc); } return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag); }; Object.defineProperties = function (obj, props) { Object.keys(props).forEach(function (prop) { Object.defineProperty(obj, prop, props[prop]); }); return obj; }; Object.create = function (obj, proto) { if (typeof proto === 'object' && !Object.isFrozen(proto)) { Object.keys(proto).forEach(function (prop) { proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); }); } return _create(obj, proto); }; Object.getOwnPropertyDescriptor = function (obj, prop) { var desc = _getOwnPropertyDescriptor(obj, prop); if (isUnconfigurable(obj, prop)) { desc.configurable = false; } return desc; }; } function _redefineProperty(obj, prop, desc) { var originalConfigurableFlag = desc.configurable; desc = rewriteDescriptor(obj, prop, desc); return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag); } function isUnconfigurable(obj, prop) { return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; } function rewriteDescriptor(obj, prop, desc) { desc.configurable = true; if (!desc.configurable) { if (!obj[unconfigurablesKey]) { _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); } obj[unconfigurablesKey][prop] = true; } return desc; } function _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) { try { return _defineProperty(obj, prop, desc); } catch (error) { if (desc.configurable) { // In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's // retry with the original flag value if (typeof originalConfigurableFlag == 'undefined') { delete desc.configurable; } else { desc.configurable = originalConfigurableFlag; } try { return _defineProperty(obj, prop, desc); } catch (error) { var descJson = null; try { descJson = JSON.stringify(desc); } catch (error) { descJson = descJson.toString(); } console.log("Attempting to configure '" + prop + "' with descriptor '" + descJson + "' on object '" + obj + "' and got error, giving up: " + error); } } else { throw error; } } } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // we have to patch the instance since the proto is non-configurable function apply(_global) { var WS = _global.WebSocket; // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener // On older Chrome, no need since EventTarget was already patched if (!_global.EventTarget) { patchEventTargetMethods(WS.prototype); } _global.WebSocket = function (a, b) { var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); var proxySocket; var proxySocketProto; // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); if (onmessageDesc && onmessageDesc.configurable === false) { proxySocket = Object.create(socket); // socket have own property descriptor 'onopen', 'onmessage', 'onclose', 'onerror' // but proxySocket not, so we will keep socket as prototype and pass it to // patchOnProperties method proxySocketProto = socket; ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function (propName) { proxySocket[propName] = function () { return socket[propName].apply(socket, arguments); }; }); } else { // we can patch the real socket proxySocket = socket; } patchOnProperties(proxySocket, ['close', 'error', 'message', 'open'], proxySocketProto); return proxySocket; }; for (var prop in WS) { _global['WebSocket'][prop] = WS[prop]; } } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var globalEventHandlersEventNames = [ 'abort', 'animationcancel', 'animationend', 'animationiteration', 'auxclick', 'beforeinput', 'blur', 'cancel', 'canplay', 'canplaythrough', 'change', 'compositionstart', 'compositionupdate', 'compositionend', 'cuechange', 'click', 'close', 'contextmenu', 'curechange', 'dblclick', 'drag', 'dragend', 'dragenter', 'dragexit', 'dragleave', 'dragover', 'drop', 'durationchange', 'emptied', 'ended', 'error', 'focus', 'focusin', 'focusout', 'gotpointercapture', 'input', 'invalid', 'keydown', 'keypress', 'keyup', 'load', 'loadstart', 'loadeddata', 'loadedmetadata', 'lostpointercapture', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mousewheel', 'pause', 'play', 'playing', 'pointercancel', 'pointerdown', 'pointerenter', 'pointerleave', 'pointerlockchange', 'mozpointerlockchange', 'webkitpointerlockerchange', 'pointerlockerror', 'mozpointerlockerror', 'webkitpointerlockerror', 'pointermove', 'pointout', 'pointerover', 'pointerup', 'progress', 'ratechange', 'reset', 'resize', 'scroll', 'seeked', 'seeking', 'select', 'selectionchange', 'selectstart', 'show', 'sort', 'stalled', 'submit', 'suspend', 'timeupdate', 'volumechange', 'touchcancel', 'touchmove', 'touchstart', 'transitioncancel', 'transitionend', 'waiting', 'wheel' ]; var documentEventNames = [ 'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror', 'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange' ]; var windowEventNames = [ 'absolutedeviceorientation', 'afterinput', 'afterprint', 'appinstalled', 'beforeinstallprompt', 'beforeprint', 'beforeunload', 'devicelight', 'devicemotion', 'deviceorientation', 'deviceorientationabsolute', 'deviceproximity', 'hashchange', 'languagechange', 'message', 'mozbeforepaint', 'offline', 'online', 'paint', 'pageshow', 'pagehide', 'popstate', 'rejectionhandled', 'storage', 'unhandledrejection', 'unload', 'userproximity', 'vrdisplyconnected', 'vrdisplaydisconnected', 'vrdisplaypresentchange' ]; var htmlElementEventNames = [ 'beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend', 'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend', 'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend' ]; var mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend']; var ieElementEventNames = [ 'activate', 'afterupdate', 'ariarequest', 'beforeactivate', 'beforedeactivate', 'beforeeditfocus', 'beforeupdate', 'cellchange', 'controlselect', 'dataavailable', 'datasetchanged', 'datasetcomplete', 'errorupdate', 'filterchange', 'layoutcomplete', 'losecapture', 'move', 'moveend', 'movestart', 'propertychange', 'resizeend', 'resizestart', 'rowenter', 'rowexit', 'rowsdelete', 'rowsinserted', 'command', 'compassneedscalibration', 'deactivate', 'help', 'mscontentzoom', 'msmanipulationstatechanged', 'msgesturechange', 'msgesturedoubletap', 'msgestureend', 'msgesturehold', 'msgesturestart', 'msgesturetap', 'msgotpointercapture', 'msinertiastart', 'mslostpointercapture', 'mspointercancel', 'mspointerdown', 'mspointerenter', 'mspointerhover', 'mspointerleave', 'mspointermove', 'mspointerout', 'mspointerover', 'mspointerup', 'pointerout', 'mssitemodejumplistitemremoved', 'msthumbnailclick', 'stop', 'storagecommit' ]; var webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror']; var formEventNames = ['autocomplete', 'autocompleteerror']; var detailEventNames = ['toggle']; var frameEventNames = ['load']; var frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll']; var marqueeEventNames = ['bounce', 'finish', 'start']; var XMLHttpRequestEventNames = [ 'loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend', 'readystatechange' ]; var IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close']; var websocketEventNames = ['close', 'error', 'open', 'message']; var eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames); function propertyDescriptorPatch(_global) { if (isNode && !isMix) { return; } var supportsWebSocket = typeof WebSocket !== 'undefined'; if (canPatchViaPropertyDescriptor()) { // for browsers that we can patch the descriptor: Chrome & Firefox if (isBrowser) { // in IE/Edge, onProp not exist in window object, but in WindowPrototype // so we need to pass WindowPrototype to check onProp exist or not patchOnProperties(window, eventNames, Object.getPrototypeOf(window)); patchOnProperties(Document.prototype, eventNames); if (typeof window['SVGElement'] !== 'undefined') { patchOnProperties(window['SVGElement'].prototype, eventNames); } patchOnProperties(Element.prototype, eventNames); patchOnProperties(HTMLElement.prototype, eventNames); patchOnProperties(HTMLMediaElement.prototype, mediaElementEventNames); patchOnProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames)); patchOnProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames)); patchOnProperties(HTMLFrameElement.prototype, frameEventNames); patchOnProperties(HTMLIFrameElement.prototype, frameEventNames); var HTMLMarqueeElement_1 = window['HTMLMarqueeElement']; if (HTMLMarqueeElement_1) { patchOnProperties(HTMLMarqueeElement_1.prototype, marqueeEventNames); } } patchOnProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames); var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget']; if (XMLHttpRequestEventTarget) { patchOnProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames); } if (typeof IDBIndex !== 'undefined') { patchOnProperties(IDBIndex.prototype, IDBIndexEventNames); patchOnProperties(IDBRequest.prototype, IDBIndexEventNames); patchOnProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames); patchOnProperties(IDBDatabase.prototype, IDBIndexEventNames); patchOnProperties(IDBTransaction.prototype, IDBIndexEventNames); patchOnProperties(IDBCursor.prototype, IDBIndexEventNames); } if (supportsWebSocket) { patchOnProperties(WebSocket.prototype, websocketEventNames); } } else { // Safari, Android browsers (Jelly Bean) patchViaCapturingAllTheEvents(); patchClass('XMLHttpRequest'); if (supportsWebSocket) { apply(_global); } } } function canPatchViaPropertyDescriptor() { if ((isBrowser || isMix) && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 // IDL interface attributes are not configurable var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); if (desc && !desc.configurable) return false; } var xhrDesc = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange'); // add enumerable and configurable here because in opera // by default XMLHttpRequest.prototype.onreadystatechange is undefined // without adding enumerable and configurable will cause onreadystatechange // non-configurable // and if XMLHttpRequest.prototype.onreadystatechange is undefined, // we should set a real desc instead a fake one if (xhrDesc) { Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', { enumerable: true, configurable: true, get: function () { return true; } }); var req = new XMLHttpRequest(); var result = !!req.onreadystatechange; // restore original desc Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', xhrDesc || {}); return result; } else { Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', { enumerable: true, configurable: true, get: function () { return this[zoneSymbol('fakeonreadystatechange')]; }, set: function (value) { this[zoneSymbol('fakeonreadystatechange')] = value; } }); var req = new XMLHttpRequest(); var detectFunc = function () { }; req.onreadystatechange = detectFunc; var result = req[zoneSymbol('fakeonreadystatechange')] === detectFunc; req.onreadystatechange = null; return result; } } var unboundKey = zoneSymbol('unbound'); // Whenever any eventListener fires, we check the eventListener target and all parents // for `onwhatever` properties and replace them with zone-bound functions // - Chrome (for now) function patchViaCapturingAllTheEvents() { var _loop_1 = function (i) { var property = eventNames[i]; var onproperty = 'on' + property; self.addEventListener(property, function (event) { var elt = event.target, bound, source; if (elt) { source = elt.constructor['name'] + '.' + onproperty; } else { source = 'unknown.' + onproperty; } while (elt) { if (elt[onproperty] && !elt[onproperty][unboundKey]) { bound = Zone.current.wrap(elt[onproperty], source); bound[unboundKey] = elt[onproperty]; elt[onproperty] = bound; } elt = elt.parentElement; } }, true); }; for (var i = 0; i < eventNames.length; i++) { _loop_1(i); } } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function eventTargetPatch(_global, api) { var WTF_ISSUE_555 = 'Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video'; var NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket' .split(','); var EVENT_TARGET = 'EventTarget'; var apis = []; var isWtf = _global['wtf']; var WTF_ISSUE_555_ARRAY = WTF_ISSUE_555.split(','); if (isWtf) { // Workaround for: https://github.com/google/tracing-framework/issues/555 apis = WTF_ISSUE_555_ARRAY.map(function (v) { return 'HTML' + v + 'Element'; }).concat(NO_EVENT_TARGET); } else if (_global[EVENT_TARGET]) { apis.push(EVENT_TARGET); } else { // Note: EventTarget is not available in all browsers, // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget apis = NO_EVENT_TARGET; } var isDisableIECheck = _global['__Zone_disable_IE_check'] || false; var isEnableCrossContextCheck = _global['__Zone_enable_cross_context_check'] || false; var ieOrEdge = isIEOrEdge(); var ADD_EVENT_LISTENER_SOURCE = '.addEventListener:'; var FUNCTION_WRAPPER = '[object FunctionWrapper]'; var BROWSER_TOOLS = 'function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }'; // predefine all __zone_symbol__ + eventName + true/false string for (var i = 0; i < eventNames.length; i++) { var eventName = eventNames[i]; var falseEventName = eventName + FALSE_STR; var trueEventName = eventName + TRUE_STR; var symbol = ZONE_SYMBOL_PREFIX + falseEventName; var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName; zoneSymbolEventNames[eventName] = {}; zoneSymbolEventNames[eventName][FALSE_STR] = symbol; zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture; } // predefine all task.source string for (var i = 0; i < WTF_ISSUE_555.length; i++) { var target = WTF_ISSUE_555_ARRAY[i]; var targets = globalSources[target] = {}; for (var j = 0; j < eventNames.length; j++) { var eventName = eventNames[j]; targets[eventName] = target + ADD_EVENT_LISTENER_SOURCE + eventName; } } var checkIEAndCrossContext = function (nativeDelegate, delegate, target, args) { if (!isDisableIECheck && ieOrEdge) { if (isEnableCrossContextCheck) { try { var testString = delegate.toString(); if ((testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS)) { nativeDelegate.apply(target, args); return false; } } catch (error) { nativeDelegate.apply(target, args); return false; } } else { var testString = delegate.toString(); if ((testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS)) { nativeDelegate.apply(target, args); return false; } } } else if (isEnableCrossContextCheck) { try { delegate.toString(); } catch (error) { nativeDelegate.apply(target, args); return false; } } return true; }; for (var i = 0; i < apis.length; i++) { var type = _global[apis[i]]; patchEventTargetMethods(type && type.prototype, { validateHandler: checkIEAndCrossContext }); } api.patchEventTargetMethods = patchEventTargetMethods; return true; } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function registerElementPatch(_global) { if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) { return; } var _registerElement = document.registerElement; var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback']; document.registerElement = function (name, opts) { if (opts && opts.prototype) { callbacks.forEach(function (callback) { var source = 'Document.registerElement::' + callback; if (opts.prototype.hasOwnProperty(callback)) { var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); if (descriptor && descriptor.value) { descriptor.value = Zone.current.wrap(descriptor.value, source); _redefineProperty(opts.prototype, callback, descriptor); } else { opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); } } else if (opts.prototype[callback]) { opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); } }); } return _registerElement.apply(document, [name, opts]); }; attachOriginToPatched(document.registerElement, _registerElement); } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Zone.__load_patch('timers', function (global, Zone, api) { var set = 'set'; var clear = 'clear'; patchTimer(global, set, clear, 'Timeout'); patchTimer(global, set, clear, 'Interval'); patchTimer(global, set, clear, 'Immediate'); patchTimer(global, 'request', 'cancel', 'AnimationFrame'); patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame'); patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame'); }); Zone.__load_patch('blocking', function (global, Zone, api) { var blockingMethods = ['alert', 'prompt', 'confirm']; for (var i = 0; i < blockingMethods.length; i++) { var name_1 = blockingMethods[i]; patchMethod(global, name_1, function (delegate, symbol, name) { return function (s, args) { return Zone.current.run(delegate, global, args, name); }; }); } }); Zone.__load_patch('EventTarget', function (global, Zone, api) { eventTargetPatch(global, api); // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener var XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget']; if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) { // TODO: @JiaLiPassion, add this back later. api.patchEventTargetMethods(XMLHttpRequestEventTarget.prototype); } patchClass('MutationObserver'); patchClass('WebKitMutationObserver'); patchClass('FileReader'); }); Zone.__load_patch('on_property', function (global, Zone, api) { propertyDescriptorPatch(global); propertyPatch(); registerElementPatch(global); }); Zone.__load_patch('canvas', function (global, Zone, api) { var HTMLCanvasElement = global['HTMLCanvasElement']; if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype && HTMLCanvasElement.prototype.toBlob) { patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', function (self, args) { return { name: 'HTMLCanvasElement.toBlob', target: self, callbackIndex: 0, args: args }; }); } }); Zone.__load_patch('XHR', function (global, Zone, api) { // Treat XMLHTTPRequest as a macrotask. patchXHR(global); var XHR_TASK = zoneSymbol('xhrTask'); var XHR_SYNC = zoneSymbol('xhrSync'); var XHR_LISTENER = zoneSymbol('xhrListener'); var XHR_SCHEDULED = zoneSymbol('xhrScheduled'); function patchXHR(window) { function findPendingTask(target) { var pendingTask = target[XHR_TASK]; return pendingTask; } function scheduleTask(task) { XMLHttpRequest[XHR_SCHEDULED] = false; var data = task.data; // remove existing event listener var listener = data.target[XHR_LISTENER]; var oriAddListener = data.target[zoneSymbol('addEventListener')]; var oriRemoveListener = data.target[zoneSymbol('removeEventListener')]; if (listener) { oriRemoveListener.apply(data.target, ['readystatechange', listener]); } var newListener = data.target[XHR_LISTENER] = function () { if (data.target.readyState === data.target.DONE) { // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with // readyState=4 multiple times, so we need to check task state here if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] && task.state === 'scheduled') { task.invoke(); } } }; oriAddListener.apply(data.target, ['readystatechange', newListener]); var storedTask = data.target[XHR_TASK]; if (!storedTask) { data.target[XHR_TASK] = task; } sendNative.apply(data.target, data.args); XMLHttpRequest[XHR_SCHEDULED] = true; return task; } function placeholderCallback() { } function clearTask(task) { var data = task.data; // Note - ideally, we would call data.target.removeEventListener here, but it's too late // to prevent it from firing. So instead, we store info for the event listener. data.aborted = true; return abortNative.apply(data.target, data.args); } var openNative = patchMethod(window.XMLHttpRequest.prototype, 'open', function () { return function (self, args) { self[XHR_SYNC] = args[2] == false; return openNative.apply(self, args); }; }); var sendNative = patchMethod(window.XMLHttpRequest.prototype, 'send', function () { return function (self, args) { var zone = Zone.current; if (self[XHR_SYNC]) { // if the XHR is sync there is no task to schedule, just execute the code. return sendNative.apply(self, args); } else { var options = { target: self, isPeriodic: false, delay: null, args: args, aborted: false }; return zone.scheduleMacroTask('XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask); } }; }); var abortNative = patchMethod(window.XMLHttpRequest.prototype, 'abort', function (delegate) { return function (self, args) { var task = findPendingTask(self); if (task && typeof task.type == 'string') { // If the XHR has already completed, do nothing. // If the XHR has already been aborted, do nothing. // Fix #569, call abort multiple times before done will cause // macroTask task count be negative number if (task.cancelFn == null || (task.data && task.data.aborted)) { return; } task.zone.cancelTask(task); } // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no // task // to cancel. Do nothing. }; }); } }); Zone.__load_patch('geolocation', function (global, Zone, api) { /// GEO_LOCATION if (global['navigator'] && global['navigator'].geolocation) { patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']); } }); Zone.__load_patch('PromiseRejectionEvent', function (global, Zone, api) { // handle unhandled promise rejection function findPromiseRejectionHandler(evtName) { return function (e) { var eventTasks = findEventTasks(global, evtName); eventTasks.forEach(function (eventTask) { // windows has added unhandledrejection event listener // trigger the event listener var PromiseRejectionEvent = global['PromiseRejectionEvent']; if (PromiseRejectionEvent) { var evt = new PromiseRejectionEvent(evtName, { promise: e.promise, reason: e.rejection }); eventTask.invoke(evt); } }); }; } if (global['PromiseRejectionEvent']) { Zone[zoneSymbol('unhandledPromiseRejectionHandler')] = findPromiseRejectionHandler('unhandledrejection'); Zone[zoneSymbol('rejectionHandledHandler')] = findPromiseRejectionHandler('rejectionhandled'); } }); Zone.__load_patch('util', function (global, Zone, api) { api.patchOnProperties = patchOnProperties; api.patchMethod = patchMethod; }); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ })));
renderer/components/TextEditorPane.js
reactide/reactide
import React from 'react'; import TextEditor from './TextEditor'; import TabContainer from './TabContainer'; import PropTypes from 'prop-types'; const TextEditorPane = ({ appState, setActiveTab, closeTab, onEditorValueChange, cbOpenSimulator_Main, cbOpenSimulator_Ext }) => { // const editorArr = []; // if (Object.keys(appState.openTabs).length > 0) { // //console.log(appState.previousPaths[appState.previousPaths.length-1]); // editorArr.push( // <TextEditor // path={appState.previousPaths[appState.previousPaths.length-1]} // onValueChange={onEditorValueChange} // />); // } return ( <ride-pane> {Object.keys(appState.openTabs).length > 0 && <React.Fragment> <TextEditor path={appState.previousPaths[appState.previousPaths.length - 1]} onValueChange={onEditorValueChange} /> </React.Fragment> } </ride-pane> ); }; TextEditorPane.propTypes = { appState: PropTypes.object.isRequired, setActiveTab: PropTypes.func.isRequired, closeTab: PropTypes.func.isRequired }; export default TextEditorPane;