2014-09-08 01:27:32 +00:00
< script > w i n d o w . P l a t f o r m = w i n d o w . P l a t f o r m | | { } , w i n d o w . l o g F l a g s = w i n d o w . l o g F l a g s | | { } , f u n c t i o n ( a ) { v a r b = a . f l a g s | | { } ; l o c a t i o n . s e a r c h . s l i c e ( 1 ) . s p l i t ( " & " ) . f o r E a c h ( f u n c t i o n ( a ) { a = a . s p l i t ( " = " ) , a [ 0 ] & & ( b [ a [ 0 ] ] = a [ 1 ] | | ! 0 ) } ) ; v a r c = d o c u m e n t . c u r r e n t S c r i p t | | d o c u m e n t . q u e r y S e l e c t o r ( ' s c r i p t [ s r c * = " p l a t f o r m . j s " ] ' ) ; i f ( c ) f o r ( v a r d , e = c . a t t r i b u t e s , f = 0 ; f < e . l e n g t h ; f + + ) d = e [ f ] , " s r c " ! = = d . n a m e & & ( b [ d . n a m e ] = d . v a l u e | | ! 0 ) ; b . l o g & & b . l o g . s p l i t ( " , " ) . f o r E a c h ( f u n c t i o n ( a ) { w i n d o w . l o g F l a g s [ a ] = ! 0 } ) , b . s h a d o w = b . s h a d o w | | b . s h a d o w d o m | | b . p o l y f i l l , b . s h a d o w = " n a t i v e " = = = b . s h a d o w ? ! 1 : b . s h a d o w | | ! H T M L E l e m e n t . p r o t o t y p e . c r e a t e S h a d o w R o o t , b . s h a d o w & & d o c u m e n t . q u e r y S e l e c t o r A l l ( " s c r i p t " ) . l e n g t h > 1 & & c o n s o l e . w a r n ( " p l a t f o r m . j s i s n o t t h e f i r s t s c r i p t o n t h e p a g e . S e e h t t p : / / w w w . p o l y m e r - p r o j e c t . o r g / d o c s / s t a r t / p l a t f o r m . h t m l # s e t u p f o r d e t a i l s . " ) , b . r e g i s t e r & & ( w i n d o w . C u s t o m E l e m e n t s = w i n d o w . C u s t o m E l e m e n t s | | { f l a g s : { } } , w i n d o w . C u s t o m E l e m e n t s . f l a g s . r e g i s t e r = b . r e g i s t e r ) , b . i m p o r t s & & ( w i n d o w . H T M L I m p o r t s = w i n d o w . H T M L I m p o r t s | | { f l a g s : { } } , w i n d o w . H T M L I m p o r t s . f l a g s . i m p o r t s = b . i m p o r t s ) , a . f l a g s = b } ( P l a t f o r m ) , " u n d e f i n e d " = = t y p e o f W e a k M a p & & ! f u n c t i o n ( ) { v a r a = O b j e c t . d e f i n e P r o p e r t y , b = D a t e . n o w ( ) % 1 e 9 , c = f u n c t i o n ( ) { t h i s . n a m e = " _ _ s t " + ( 1 e 9 * M a t h . r a n d o m ( ) > > > 0 ) + ( b + + + " _ _ " ) } ; c . p r o t o t y p e = { s e t : f u n c t i o n ( b , c ) { v a r d = b [ t h i s . n a m e ] ; d & & d [ 0 ] = = = b ? d [ 1 ] = c : a ( b , t h i s . n a m e , { v a l u e : [ b , c ] , w r i t a b l e : ! 0 } ) } , g e t : f u n c t i o n ( a ) { v a r b ; r e t u r n ( b = a [ t h i s . n a m e ] ) & & b [ 0 ] = = = a ? b [ 1 ] : v o i d 0 } , " d e l e t e " : f u n c t i o n ( a ) { t h i s . s e t ( a , v o i d 0 ) } } , w i n d o w . W e a k M a p = c } ( ) , f u n c t i o n ( g l o b a l ) { " u s e s t r i c t " ; f u n c t i o n d e t e c t O b j e c t O b s e r v e ( ) { f u n c t i o n a ( a ) { b = a } i f ( " f u n c t i o n " ! = t y p e o f O b j e c t . o b s e r v e | | " f u n c t i o n " ! = t y p e o f A r r a y . o b s e r v e ) r e t u r n ! 1 ; v a r b = [ ] , c = { } , d = [ ] ; r e t u r n O b j e c t . o b s e r v e ( c , a ) , A r r a y . o b s e r v e ( d , a ) , c . i d = 1 , c . i d = 2 , d e l e t e c . i d , d . p u s h ( 1 , 2 ) , d . l e n g t h = 0 , O b j e c t . d e l i v e r C h a n g e R e c o r d s ( a ) , 5 ! = = b . l e n g t h ? ! 1 : " a d d " ! = b [ 0 ] . t y p e | | " u p d a t e " ! = b [ 1 ] . t y p e | | " d e l e t e " ! = b [ 2 ] . t y p e | | " s p l i c e " ! = b [ 3 ] . t y p e | | " s p l i c e " ! = b [ 4 ] . t y p e ? ! 1 : ( O b j e c t . u n o b s e r v e ( c , a ) , A r r a y . u n o b s e r v e ( d , a ) , ! 0 ) } f u n c t i o n d e t e c t E v a l ( ) { i f ( " u n d e f i n e d " ! = t y p e o f c h r o m e & & c h r o m e . a p p & & c h r o m e . a p p . r u n t i m e ) r e t u r n ! 1 ; t r y { v a r a = n e w F u n c t i o n ( " " , " r e t u r n t r u e ; " ) ; r e t u r n a ( ) } c a t c h ( b ) { r e t u r n ! 1 } } f u n c t i o n i s I n d e x ( a ) { r e t u r n + a = = = a > > > 0 } f u n c t i o n t o N u m b e r ( a ) { r e t u r n + a } f u n c t i o n i s O b j e c t ( a ) { r e t u r n a = = = O b j e c t ( a ) } f u n c t i o n a r e S a m e V a l u e ( a , b ) { r e t u r n a = = = b ? 0 ! = = a | | 1 / a = = = 1 / b : n u m b e r I s N a N ( a ) & & n u m b e r I s N a N ( b ) ? ! 0 : a ! = = a & & b ! = = b } f u n c t i o n g e t P a t h C h a r T y p e ( a ) { i f ( v o i d 0 = = = a ) r e t u r n " e o f " ; v a r b = a . c h a r C o d e A t ( 0 ) ; s w i t c h ( b ) { c a s e 9 1 : c a s e 9 3 : c a s e 4 6 : c a s e 3 4 : c a s e 3 9 : c a s e 4 8 : r e t u r n a ; c a s e 9 5 : c a s e 3 6 : r e t u r n " i d e n t " ; c a s e 3 2 : c a s e 9 : c a s e 1 0 : c a s e 1 3 : c a s e 1 6 0 : c a s e 6 5 2 7 9 : c a s e 8 2 3 2 : c a s e 8 2 3 3 : r e t u r n " w s " } r e t u r n b > = 9 7 & & 1 2 2 > = b | | b > = 6 5 & & 9 0 > = b ? " i d e n t " : b > = 4 9 & & 5 7 > = b ? " n u m b e r " : " e l s e " } f u n c t i o n n o o p ( ) { } f u n c t i o n p a r s e P a t h ( a ) { f u n c t i o n b ( ) { i f ( ! ( k > = a . l e n g t h ) ) { v a r b = a [ k + 1 ] ; r e t u r n " i n S i n g l e Q u o t e " = = l & & " ' " = = b | | " i n D o u b l e Q u o t e " = = l & & ' " ' = = b ? ( k + + , d = b , m . a p p e n d ( ) , ! 0 ) : v o i d 0 } } f o r ( v a r c , d , e , f , g , h , i , j = [ ] , k = - 1 , l = " b e f o r e P a t h " , m = { p u s h : f u n c t i o n ( ) { v o i d 0 ! = = e & & ( j . p u s h ( e ) , e = v o i d 0 ) } , a p p e n d : f u n c t i o n ( ) { v o i d 0 = = = e ? e = d : e + = d } } ; l ; ) i f ( k + + , c = a [ k ] , " \ \ " ! = c | | ! b ( l ) ) { i f ( f = g e t P a t h C h a r T y p e ( c ) , i = p a t h S t a t e M a c h i n e [ l ] , g = i [ f ] | | i [ " e l s e " ] | | " e r r o r " , " e r r o r " = = g ) r e t u r n ; i f ( l = g [ 0 ] , h = m [ g [ 1 ] ] | | n o o p , d = v o i d 0 = = = g [ 2 ] ? c : g [ 2 ] , h ( ) , " a f t e r P a t h " = = = l ) r e t u r n j } } f u n c t i o n i s I d e n t ( a ) { r e t u r n i d e n t R e g E x p . t e s t ( a ) } f u n c t i o n P a t h ( a , b ) { i f ( b ! = = c o n s t r u c t o r I s P r i v a t e ) t h r o w E r r o r ( " U s e P a t h . g e t t o r e t r i e v e p a t h o b j e c t s " ) ; a . l e n g t h & & A r r a y . p r o t o t y p e . p u s h . a p p l y ( t h i s , a . s l i c e ( ) ) , h a s E v a l & & t h i s . l e n g t h & & ( t h i s . g e t V a l u e F r o m = t h i s . c o m p i l e d G e t V a l u e F r o m F n ( ) ) } f u n c t i o n g e t P a t h ( a ) { i f ( a i n s t a n c e o f P a t h ) r e t u r n a ; i f ( ( n u l l = = a | | 0 = = a . l e n g t h ) & & ( a = " " ) , " s t r i n g " ! = t y p e o f a ) { i f ( i s I n d e x ( a . l e n g t h ) ) r e t u r n n e w P a t h ( a , c o n s t r u c t o r I s P r i v a t e ) ; a = S t r i n g ( a ) } v a r b = p a t h C a c h e [ a ] ; i f ( b ) r e t u r n b ; v a r c = p a r s e P a t h ( a ) ; i f ( ! c ) r e t u r n i n v a l i d P a t h ; v a r b = n e w P a t h ( c , c o n s t r u c t o r I s P r i v a t e ) ; r e t u r n p a t h C a c h e [ a ] = b , b } f u n c t i o n f o r m a t A c c e s s o r ( a ) { r e t u r n i s I n d e x ( a ) ? " [ " + a + " ] " : ' [ " ' + a . r e p l a c e ( / " / g , ' \ \ " ' ) + ' " ] ' } f u n c t i o n d i r t y C h e c k ( a ) { f o r ( v a r b = 0 ; M A X _ D I R T Y _ C H E C K _ C Y C L E S > b & & a . c h e c k _ ( ) ; ) b + + ; r e t u r n g l o b a l . t e s t i n g E x p o s e C y c l e C o u n t & & ( g l o b a l . d i r t y C h e c k C y c l e C o u n t = b ) , b > 0 } f u n c t i o n o b j e c t I s E m p t y ( a ) { f o r ( v a r b i n a ) r e t u r n ! 1 ; r e t u r n ! 0 } f u n c t i o n d i f f I s E m p t y ( a ) { r e t u r n o b j e c t I s E m p t y ( a . a d d e d ) & & o b j e c t I s E m p t y ( a . r e m o v e d ) & & o b j e c t I s E m p
if(L(h)===f)return h}return a[a.length-1]}function i(a){for(var b=[];a;a=a.parent)b.push(a);return b}function j(a,b){for(var c=i(a),d=i(b),e=null;c.length>0&&d.length>0; ){var f=c.pop(),g=d.pop();if(f!==g)break;e=f}return e}function k(a,b,c){b instanceof Q.Window&&(b=b.document); var e,f=L(b),g=L(c),h=d(c,a),e=j(f,g);e||(e=g.root);for(var i=e;i;i=i.parent)for(var k=0;k< h.length ; k + + ) { var l = h[k];if(L(l)===i)return l } return null } function l ( a , b ) { return L ( a ) = = = L ( b ) } function m ( a ) { if ( ! S . get ( a ) & & ( S . set ( a , ! 0 ) , n ( P ( a ) , P ( a . target ) ) , J ) ) { var b = J;throw J = null,b}}function n ( b , c ) { if ( T . get ( b ) ) throw new Error ( " InvalidStateError " ) ; T . set ( b , ! 0 ) , a . renderAllPending ( ) ; var e , f , g , h = b.type;if("load"===h&&!b.bubbles){var i = c;i instanceof Q . Document & & ( g = i.defaultView)&&(f=i,e=[])}if(!e)if(c instanceof Q . Window ) g = c,e=[];else if ( e = d(c,b),"load"!==b.type){var i = e[e.length-1];i instanceof Q . Document & & ( g = i.defaultView)}return _ . set ( b , e ) , o ( b , e , g , f ) & & p ( b , e , g , f ) & & q ( b , e , g , f ) , X . set ( b , ab ) , V . delete ( b , null ) , T . delete ( b ) , b . defaultPrevented } function o ( a , b , c , d ) { var e = bb;if(c&&!r(c,a,e,b,d))return!1;for(var f = b.length-1;f > 0;f--)if(!r(b[f],a,e,b,d))return!1;return!0}function p(a,b,c,d){var e=cb,f=b[0]||c;return r(f,a,e,b,d)}function q(a,b,c,d){for(var e=db,f=1;f< b.length ; f + + ) if ( ! r ( b [ f ] , a , e , b , d ) ) return ; c & & b . length > 0& & r(c,a,e,b,d)}function r(a,b,c,d,e){var f=R.get(a);if(!f)return!0;var g=e||h(d,a);if(g===a){if(c===bb)return!0;c===db& & (c=cb)}else if(c===db&&!b.bubbles)return!0; if("relatedTarget"in b){var i=O(b),j=i.relatedTarget;if(j){if(j instanceof Object& & j.addEventListener){var l=P(j),m=k(b,a,l);if(m===g)return!0}else m=null;W.set(b,m)}}X.set(b,c);var n=b.type,o=!1;U.set(b,g),V.set(b,a);for(var p=0,q=f.length;q>p;p++){var r=f[p];if(r.removed)o=!0;else if(!(r.type!==n||!r.capture& & c===bb||r.capture& & c===db))try{if("function"==typeof r.handler?r.handler.call(a,b):r.handler.handleEvent(b),Z.get(b))return!1}catch(s){J||(J=s)}}if(o){var t=f.slice();f.length=0;for(var p=0;p< t.length ; p + + ) t [ p ] . removed | | f . push ( t [ p ] ) } return ! Y . get ( b ) } function s ( a , b , c ) { this . type = a,this.handler=b,this.capture=Boolean(c)}function t ( a , b ) { if ( ! ( a instanceof eb ) ) return P ( x ( eb , " Event " , a , b ) ) ; var c = a;return pb | | " beforeunload " ! = = c . type ? void ( this . impl = c):new y ( c ) } function u ( a ) { return a & & a . relatedTarget ? Object . create ( a , { relatedTarget: { value:O ( a . relatedTarget ) } } ) :a } function v ( a , b , c ) { var d = window[a],e=function(b,c){return b instanceof d ? void ( this . impl = b):P(x(d,a,b,c))};if(e.prototype=Object.create(b.prototype),c&&M(e.prototype,c),d)try{N(d,e,new d ( " temp " ) ) } catch ( f ) { N ( d , e , document . createEvent ( a ) ) } return e } function w ( a , b ) { return function ( ) { arguments [ b ] = O ( arguments [ b ] ) ; var c = O(this);c[a].apply(c,arguments)}}function x ( a , b , c , d ) { if ( nb ) return new a ( c , u ( d ) ) ; var e = O(document.createEvent(b)),f=mb[b],g=[c];return Object . keys ( f ) . forEach ( function ( a ) { var b = null!=d&&a in d ? d [ a ] :f [ a ] ; " relatedTarget " = = = a & & ( b = O(b)),g.push(b)}),e["init"+b].apply(e,g),e}function y ( a ) { t . call ( this , a ) } function z ( a ) { return " function " = = typeof a ? ! 0:a & & a . handleEvent } function A ( a ) { switch ( a ) { case " DOMAttrModified " :case " DOMAttributeNameChanged " :case " DOMCharacterDataModified " :case " DOMElementNameChanged " :case " DOMNodeInserted " :case " DOMNodeInsertedIntoDocument " :case " DOMNodeRemoved " :case " DOMNodeRemovedFromDocument " :case " DOMSubtreeModified " :return ! 0 } return ! 1 } function B ( a ) { this . impl = a}function C ( a ) { return a instanceof Q . ShadowRoot & & ( a = a.host),O(a)}function D ( a , b ) { var c = R.get(a);if(c)for(var d = 0;d<c.length;d++)if(!c[d].removed&&c[d].type===b)return!0;return!1}function E ( a , b ) { for ( var c = O(a);c;c=c.parentNode)if(D(P(c),b))return!0;return!1}function F ( a ) { K ( a , rb ) } function G ( b , c , e , f ) { a . renderAllPending ( ) ; var g = P(sb.call(c.impl,e,f));if(!g)return null ; var i = d(g,null),j=i.lastIndexOf(b);return-1==j?null:(i=i.slice(0,j),h(i,b))}function H ( a ) { return function ( ) { var b = $.get(this);return b & & b [ a ] & & b [ a ] . value | | null } } function I ( a ) { var b = a.slice(2);return function ( c ) { var d = $.get(this);d||(d=Object.create(null),$.set(this,d));var e = d[a];if(e&&this.removeEventListener(b,e.wrapped,!1),"function"==typeof c ) { var f = function(b){var d = c.call(this,b);d===!1?b.preventDefault():"onbeforeunload
b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.wrappers.Element,c=a.wrappers.HTMLElement,d=a.registerObject,e="http://www.w3.org/2000/svg",f=document.createElementNS(e,"title"),g=d(f),h=Object.getPrototypeOf(g.prototype).constructor;if(!("classList"in f)){var i=Object.getOwnPropertyDescriptor(b.prototype,"classList");Object.defineProperty(c.prototype,"classList",i),delete b.prototype.classList}a.wrappers.SVGElement=h}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){m.call(this,a)}var c=a.mixin,d=a.registerWrapper,e=a.unwrap,f=a.wrap,g=window.SVGUseElement,h="http://www.w3.org/2000/svg",i=f(document.createElementNS(h,"g")),j=document.createElementNS(h,"use"),k=i.constructor,l=Object.getPrototypeOf(k.prototype),m=l.constructor;b.prototype=Object.create(l),"instanceRoot"in j& & c(b.prototype,{get instanceRoot(){return f(e(this).instanceRoot)},get animatedInstanceRoot(){return f(e(this).animatedInstanceRoot)}}),d(g,b,j),a.wrappers.SVGUseElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.EventTarget,d=a.mixin,e=a.registerWrapper,f=a.wrap,g=window.SVGElementInstance;g& & (b.prototype=Object.create(c.prototype),d(b.prototype,{get correspondingElement(){return f(this.impl.correspondingElement)},get correspondingUseElement(){return f(this.impl.correspondingUseElement)},get parentNode(){return f(this.impl.parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return f(this.impl.firstChild)},get lastChild(){return f(this.impl.lastChild)},get previousSibling(){return f(this.impl.previousSibling)},get nextSibling(){return f(this.impl.nextSibling)}}),e(g,b),a.wrappers.SVGElementInstance=b)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){this.impl=a}var c=a.mixin,d=a.registerWrapper,e=a.unwrap,f=a.unwrapIfNeeded,g=a.wrap,h=window.CanvasRenderingContext2D;c(b.prototype,{get canvas(){return g(this.impl.canvas)},drawImage:function(){arguments[0]=f(arguments[0]),this.impl.drawImage.apply(this.impl,arguments)},createPattern:function(){return arguments[0]=e(arguments[0]),this.impl.createPattern.apply(this.impl,arguments)}}),d(h,b,document.createElement("canvas").getContext("2d")),a.wrappers.CanvasRenderingContext2D=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){this.impl=a}var c=a.mixin,d=a.registerWrapper,e=a.unwrapIfNeeded,f=a.wrap,g=window.WebGLRenderingContext;if(g){c(b.prototype,{get canvas(){return f(this.impl.canvas)},texImage2D:function(){arguments[5]=e(arguments[5]),this.impl.texImage2D.apply(this.impl,arguments)},texSubImage2D:function(){arguments[6]=e(arguments[6]),this.impl.texSubImage2D.apply(this.impl,arguments)}});var h=/WebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:null}:{};d(g,b,h),a.wrappers.WebGLRenderingContext=b}}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){this.impl=a}var c=a.registerWrapper,d=a.unwrap,e=a.unwrapIfNeeded,f=a.wrap,g=window.Range;b.prototype={get startContainer(){return f(this.impl.startContainer)},get endContainer(){return f(this.impl.endContainer)},get commonAncestorContainer(){return f(this.impl.commonAncestorContainer)},setStart:function(a,b){this.impl.setStart(e(a),b)},setEnd:function(a,b){this.impl.setEnd(e(a),b)},setStartBefore:function(a){this.impl.setStartBefore(e(a))},setStartAfter:function(a){this.impl.setStartAfter(e(a))},setEndBefore:function(a){this.impl.setEndBefore(e(a))},setEndAfter:function(a){this.impl.setEndAfter(e(a))},selectNode:function(a){this.impl.selectNode(e(a))},selectNodeContents:function(a){this.impl.selectNodeContents(e(a))},compareBoundaryPoints:function(a,b){return this.impl.compareBoundaryPoints(a,d(b))},extractContents:function(){return f(this.impl.extractContents())},cloneContents:function(){return f(this.impl.cloneContents())},insertNode:function(a){this.impl.insertNode(e(a))},surroundContents:function(a){this.impl.surroundContents(e(a))},cloneRange:function(){return f(this.impl.cloneRange()
}break;case"relative slash":if("/"!=u& & "\\"!=u){"file"!=this._scheme& & (this._host=h._host,this._port=h._port),j="relative path";continue}"\\"==u& & i("\\ is an invalid code point."),j="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=u){i("Expected '/', got: "+u),j="authority ignore slashes";continue}j="authority second slash";break;case"authority second slash":if(j="authority ignore slashes","/"!=u){i("Expected '/', got: "+u);continue}break;case"authority ignore slashes":if("/"!=u&&"\\"!=u){j="authority"; continue}i("Expected authority, got: "+u);break;case"authority":if("@"==u){r& & (i("@ already seen."),l+="%40"),r=!0;for(var x=0;x< l.length ; x + + ) { var y = l[x];if(" " ! = y & & " \ n " ! = y & & " \ r " ! = y ) if ( " : " ! = y | | null ! = = this . _password ) { var z = e(y);null!==this._password?this._password+=z:this._username+=z}else this . _password = "" ; else i ( " Invalid whitespace in authority . " ) } l = "" } else { if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u){k-=l.length,l="",j="host";continue}l+=u}break;case"file host " :if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u){2!=l.length||!p.test(l[0])||":"!=l[1]&&"|"!=l[1]?0==l.length?j="relative path start " : ( this . _host = d.call(this,l),l="",j="relative path start " ) :j = "relative path" ; continue } " " = = u | | " \ n " = = u | | " \ r " = = u ? i ( " Invalid whitespace in file host . " ) :l + = u ; break ; case " host " :case " hostname " :if ( " : " ! = u | | s ) { if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u){if(this._host=d.call(this,l),l="",j="relative path start " , g ) break a ; continue } " " ! = u & & " \ n " ! = u & & " \ r " ! = u ? ( " [ " = = u ? s = !0:"]"==u&&(s=!1),l+=u):i("Invalid code point in host / hostname: " + u ) } else if ( this . _host = d.call(this,l),l="",j="port","hostname"==g)break a ; break ; case " port " :if ( / [ 0-9 ] / . test ( u ) ) l + = u ; else { if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u||g){if(""!=l){var A = parseInt(l,10);A!=m[this._scheme]&&(this._port=A+""),l=""}if(g)break a ; j = "relative path start" ; continue } " " = = u | | " \ n " = = u | | " \ r " = = u ? i ( " Invalid code point in port: " + u ) :c . call ( this ) } break ; case " relative path start " :if ( " \ \ " = = u & & i ( " ' \ \ ' not allowed in path . " ) , j = "relative path" , " / " ! = u & & " \ \ " ! = u ) continue ; break ; case " relative path " :if ( o ! = u & & " / " ! = u & & " \ \ " ! = u & & ( g | | " ? " ! = u & & " # " ! = u ) ) " " ! = u & & " \ n " ! = u & & " \ r " ! = u & & ( l + = e ( u ) ) ; else { " \ \ " = = u & & i ( " \ \ not allowed in relative path . " ) ; var B ; ( B = n[l.toLowerCase()])&&(l=B),".."==l?(this._path.pop(),"/"!=u&&"\\"!=u&&this._path.push("")):"."==l&&"/"!=u&&"\\"!=u?this._path.push(""):"."!=l&&("file"==this._scheme&&0==this._path.length&&2==l.length&&p.test(l[0])&&"|"==l[1]&&(l=l[0]+":"),this._path.push(l)),l="","?"==u?(this._query="?",j="query"):"#"==u&&(this._fragment="#",j="fragment")}break;case"query":g||"#"!=u?o!=u&&" " ! = u & & " \ n " ! = u & & " \ r " ! = u & & ( this . _query + = f ( u ) ) : ( this . _fragment = "#" , j = "fragment" ) ; break ; case " fragment " :o ! = u & & " " ! = u & & " \ n " ! = u & & " \ r " ! = u & & ( this . _fragment + = u ) } k + + } } function h ( ) { this . _scheme = "" , this . _schemeData = "" , this . _username = "" , this . _password = null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function i ( a , b ) { void 0 = ==b||b instanceof i | | ( b = new i ( String ( b ) ) ) , this . _url = a,h.call(this);var c = a.replace(/^[ \ t \ r \ n \ f ] + | [ \ t \ r \ n \ f ] + $ / g , " " ) ; g . call ( this , c , null , b ) } var j = !1;if(!a.forceJURL)try{var k = new URL ( " b " , " http: / / a " ) ; j = "http://a/b" = = = k . href } catch ( l ) { } if ( ! j ) { var m = Object.create(null);m.ftp=21,m.file=0,m.gopher=70,m.http=80,m.https=443,m.ws=80,m.wss=443;var n = Object.create(null);n["%2e"]=".",n[".%2e"]="..",n["%2e."]="..",n["%2e%2e"]="..";var o = void 0 , p = /[a-zA-Z]/,q=/[a-zA-Z0-9\+\-\.]/;i.prototype={get href ( ) { if ( this . _isInvalid ) return this . _url ; var a = "" ; return ( " " ! = this . _username | | null ! = this . _password ) & & ( a = this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+a+this.host:"")+this.pathname+this._query+this._fragment},set href ( a ) { h . call ( this ) , g . call ( this , a ) } , get protocol ( ) { return this . _scheme + " : " } , set protocol ( a ) { this . _isInvalid | | g . call ( this , a + " : " , " scheme start " ) } , get host ( ) { return this . _isInvalid ? " " :this . _port ? this . _host + " : " + this . _port:this . _host } , set host ( a ) { ! this . _isInvalid & & this . _isRelative & & g . call ( this , a , " host " ) } , get hostname ( ) { return this . _host } , set hostname ( a ) { ! this . _isInval
}function c(a){for(var b=0;b< y.length ; b + + ) if ( a = ==y[b])return!0}function d ( a ) { var b = n(a);return b ? d ( b . extends ) . concat ( [ b ] ) : [ ] } function e ( a ) { for ( var b , c = a.extends,d=0;b=a.ancestry[d];d++)c=b.is&&b.tag;a.tag=c||a.__name,c&&(a.is=a.__name)}function f ( a ) { if ( ! Object . __proto__ ) { var b = HTMLElement.prototype;if(a.is){var c = document.createElement(a.tag),d=Object.getPrototypeOf(c);d===a.prototype&&(b=d)}for(var e , f = a.prototype;f&&f!==b;)e=Object.getPrototypeOf(f),f.__proto__=e,f=e;a.native=b}}function g ( a ) { return h ( B ( a . tag ) , a ) } function h ( b , c ) { return c . is & & b . setAttribute ( " is " , c . is ) , b . removeAttribute ( " unresolved " ) , i ( b , c ) , b . __upgraded__ = !0,k(b),a.insertedNode(b),a.upgradeSubtree(b),b}function i ( a , b ) { Object . __proto__ ? a . __proto__ = b.prototype:(j(a,b.prototype,b.native),a.__proto__=b.prototype)}function j ( a , b , c ) { for ( var d = {},e=b;e!==c&&e!==HTMLElement.prototype;){for(var f , g = Object.getOwnPropertyNames(e),h=0;f=g[h];h++)d[f]||(Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(e,f)),d[f]=1);e=Object.getPrototypeOf(e)}}function k ( a ) { a . createdCallback & & a . createdCallback ( ) } function l ( a ) { if ( ! a . setAttribute . _polyfilled ) { var b = a.setAttribute;a.setAttribute=function(a,c){m.call(this,a,c,b)};var c = a.removeAttribute;a.removeAttribute=function(a){m.call(this,a,null,c)},a.setAttribute._polyfilled=!0}}function m ( a , b , c ) { a = a.toLowerCase();var d = this.getAttribute(a);c.apply(this,arguments);var e = this.getAttribute(a);this.attributeChangedCallback&&e!==d&&this.attributeChangedCallback(a,d,e)}function n ( a ) { return a ? z [ a . toLowerCase ( ) ] :void 0 } function o ( a , b ) { z [ a ] = b } function p ( a ) { return function ( ) { return g ( a ) } } function q ( a , b , c ) { return a = ==A?r(b,c):C(a,b)}function r ( a , b ) { var c = n(b||a);if(c){if(a==c.tag&&b==c.is)return new c . ctor ; if ( ! b & & ! c . is ) return new c . ctor } if ( b ) { var d = r(a);return d . setAttribute ( " is " , b ) , d } var d = B(a);return a . indexOf ( " - " ) > =0& & i(d,HTMLElement),d}function s(a){if(!a.__upgraded__& & a.nodeType===Node.ELEMENT_NODE){var b=a.getAttribute("is"),c=n(b||a.localName);if(c){if(b& & c.tag==a.localName)return h(a,c);if(!b& & !c.extends)return h(a,c)}}}function t(b){var c=D.call(this,b);return a.upgradeAll(c),c}a||(a=window.CustomElements={flags:{}});var u=a.flags,v=Boolean(document.registerElement),w=!u.register&&v&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative); if(w){var x=function(){};a.registry={},a.upgradeElement=x,a.watchShadow=x,a.upgrade=x,a.upgradeAll=x,a.upgradeSubtree=x,a.observeDocument=x,a.upgradeDocument=x,a.upgradeDocumentTree=x,a.takeRecords=x,a.reservedTagList=[]}else{var y=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],z={},A="http://www.w3.org/1999/xhtml",B=document.createElement.bind(document),C=document.createElementNS.bind(document),D=Node.prototype.cloneNode;document.registerElement=b,document.createElement=r,document.createElementNS=q,Node.prototype.cloneNode=t,a.registry=z,a.upgrade=s}var E;E=Object.__proto__||w?function(a,b){return a instanceof b}:function(a,b){for(var c=a;c;){if(c===b.prototype)return!0;c=c.__proto__}return!1},a.instanceof=E,a.reservedTagList=y,document.register=document.registerElement,a.hasNative=v,a.useNative=w}(window.CustomElements),function(a){function b(a){return"link"===a.localName& & a.getAttribute("rel")===c}var c=a.IMPORT_LINK_TYPE,d={selectors:["link[rel="+c+"]"],map:{link:"parseLink"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(d.selectors);e(b,function(a){d[d.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(a){b(a)&&this.parseImport(a)},parseImport:function(a){a.import&&d.parse(a.import)}},e=Array.prototype.forEach.call.bind(Array.prototype.forEach); a.parser=d,a.IMPORT_LINK_TYPE=c}(window.CustomElements),function(a){function b(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var a=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout; a(function(){CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports& & (CustomElements.elapsed=Cu
2014-08-27 00:01:15 +00:00
<!-- src -->
2014-09-08 01:27:32 +00:00
< script > ( function ( scope ) { var Gui = function ( params ) { if ( ! ready ) { Gui . error ( "Gui not ready. Put your code inside Gui.ready()" ) } params = params || { } ; var panel = document . createElement ( "gui-panel" ) ; panel . autoPlace = params . autoPlace !== false ; if ( panel . autoPlace ) { document . body . appendChild ( panel ) } return panel } ; var controllers = { } ; Gui . register = function ( elementName , test ) { controllers [ elementName ] = test } ; Gui . getController = function ( value ) { for ( var type in controllers ) { var test = controllers [ type ] ; if ( test ( value ) ) { return document . createElement ( type ) } } } ; var ready = false ; var readyHandlers = [ ] ; document . addEventListener ( "polymer-ready" , function ( ) { ready = true ; readyHandlers . forEach ( function ( fnc ) { fnc ( ) } ) } ) ; Gui . ready = function ( fnc ) { if ( ready ) { fnc ( ) } else { readyHandlers . push ( fnc ) } } ; Gui . error = function ( ) { var args = Array . prototype . slice . apply ( arguments ) ; args . unshift ( "dat-gui ::" ) ; console . error . apply ( console , args ) } ; Gui . warn = function ( ) { var args = Array . prototype . slice . apply ( arguments ) ; args . unshift ( "dat-gui ::" ) ; console . warn . apply ( console , args ) } ; var dat = { } ; dat . gui = { } ; dat . gui . GUI = Gui ; dat . GUI = dat . gui . GUI ; dat . color = { } ; dat . color . Color = function ( ) { } ; dat . dom = { } ; dat . dom . dom = function ( ) { } ; dat . controllers = { } ; dat . controllers . Controller = constructor ( "controller-base" ) ; dat . controllers . NumberController = constructor ( "controller-number" ) ; dat . controllers . FunctionController = constructor ( "controller-function" ) ; dat . controllers . ColorController = constructor ( "controller-color" ) ; dat . controllers . BooleanController = constructor ( "controller-boolean" ) ; dat . controllers . OptionController = constructor ( "controller-option" ) ; dat . controllers . NumberControllerBox = dat . controllers . NumberController ; dat . controllers . NumberControllerSlider = dat . controllers . NumberController ; function constructor ( elementName ) { return function ( object , path ) { var el = document . createElement ( elementName ) ; el . watch ( object , path ) ; return el } } scope . dat = dat ; scope . Gui = Gui } ) ( this ) ; < / script >
2014-08-27 00:01:15 +00:00
<!-- base elements -->
2014-09-08 01:27:32 +00:00
< div hidden > < style shim-shadowdom = "" > html / deep / [ layout ] [ horizontal ] , html / deep / [ layout ] [ vertical ] { display : -ms- flexbox ; display : -webkit- flex ; display : flex } html / deep / [ layout ] [ horizontal ] [ inline ] , html / deep / [ layout ] [ vertical ] [ inline ] { display : -ms- inline - flexbox ; display : -webkit- inline-flex ; display : inline-flex } html / deep / [ layout ] [ horizontal ] { -ms- flex-direction : row ; -webkit- flex-direction : row ; flex-direction : row } html / deep / [ layout ] [ horizontal ] [ reverse ] { -ms- flex-direction : row-reverse ; -webkit- flex-direction : row-reverse ; flex-direction : row-reverse } html / deep / [ layout ] [ vertical ] { -ms- flex-direction : column ; -webkit- flex-direction : column ; flex-direction : column } html / deep / [ layout ] [ vertical ] [ reverse ] { -ms- flex-direction : column-reverse ; -webkit- flex-direction : column-reverse ; flex-direction : column-reverse } html / deep / [ layout ] [ wrap ] { -ms- flex-wrap : wrap ; -webkit- flex-wrap : wrap ; flex-wrap : wrap } html / deep / [ layout ] [ wrap-reverse ] { -ms- flex-wrap : wrap-reverse ; -webkit- flex-wrap : wrap-reverse ; flex-wrap : wrap-reverse } html / deep / [ flex ] { -ms- flex : 1 ; -webkit- flex : 1 ; flex : 1 } html / deep / [ flex ] [ auto ] { -ms- flex : 1 1 auto ; -webkit- flex : 1 1 auto ; flex : 1 1 auto } html / deep / [ flex ] [ none ] { -ms- flex : none ; -webkit- flex : none ; flex : none } html / deep / [ flex ] [ one ] { -ms- flex : 1 ; -webkit- flex : 1 ; flex : 1 } html / deep / [ flex ] [ two ] { -ms- flex : 2 ; -webkit- flex : 2 ; flex : 2 } html / deep / [ flex ] [ three ] { -ms- flex : 3 ; -webkit- flex : 3 ; flex : 3 } html / deep / [ flex ] [ four ] { -ms- flex : 4 ; -webkit- flex : 4 ; flex : 4 } html / deep / [ flex ] [ five ] { -ms- flex : 5 ; -webkit- flex : 5 ; flex : 5 } html / deep / [ flex ] [ six ] { -ms- flex : 6 ; -webkit- flex : 6 ; flex : 6 } html / deep / [ flex ] [ seven ] { -ms- flex : 7 ; -webkit- flex : 7 ; flex : 7 } html / deep / [ flex ] [ eight ] { -ms- flex : 8 ; -webkit- flex : 8 ; flex : 8 } html / deep / [ flex ] [ nine ] { -ms- flex : 9 ; -webkit- flex : 9 ; flex : 9 } html / deep / [ flex ] [ ten ] { -ms- flex : 10 ; -webkit- flex : 10 ; flex : 10 } html / deep / [ flex ] [ eleven ] { -ms- flex : 11 ; -webkit- flex : 11 ; flex : 11 } html / deep / [ flex ] [ twelve ] { -ms- flex : 12 ; -webkit- flex : 12 ; flex : 12 } html / deep / [ layout ] [ start ] { -ms- flex-align : start ; -webkit- align-items : flex-start ; align-items : flex-start } html / deep / [ layout ] [ center ] { -ms- flex-align : center ; -webkit- align-items : center ; align-items : center } html / deep / [ layout ] [ end ] { -ms- flex-align : end ; -webkit- align-items : flex-end ; align-items : flex-end } html / deep / [ layout ] [ start-justified ] { -ms- flex-pack : start ; -webkit- justify-content : flex-start ; justify-content : flex-start } html / deep / [ layout ] [ center-justified ] { -ms- flex-pack : center ; -webkit- justify-content : center ; justify-content : center } html / deep / [ layout ] [ end-justified ] { -ms- flex-pack : end ; -webkit- justify-content : flex-end ; justify-content : flex-end } html / deep / [ layout ] [ around-justified ] { -ms- flex-pack : around ; -webkit- justify-content : space-around ; justify-content : space-around } html / deep / [ layout ] [ justified ] { -ms- flex-pack : justify ; -webkit- justify-content : space-between ; justify-content : space-between } html / deep / [ self-start ] { -ms- align-self : flex-start ; -webkit- align-self : flex-start ; align-self : flex-start } html / deep / [ self-center ] { -ms- align-self : center ; -webkit- align-self : center ; align-self : center } html / deep / [ self-end ] { -ms- align-self : flex-end ; -webkit- align-self : flex-end ; align-self : flex-end } html / deep / [ self-stretch ] { -ms- align-self : stretch ; -webkit- align-self : stretch ; align-self : stretch } html / deep / [ block ] { display : block } html / deep / [ hidden ] { display : none !important } html / deep / [ relative ] { position : relative } html / deep / [ fit ] { position : absolute ; top : 0 ; right : 0 ; bottom : 0 ; left : 0 } body [ fullbleed ] { margin : 0 ; height : 100 vh } html / deep / [ segment ] , html / deep / segment { display : block ; position : relative ; -webkit- box-sizing : border-box ; -ms- box-sizing : border-box ; box-sizing : border-box ; margin : 1 em .5 em ; padding : 1 em ; background-color : #fff ; -webkit- box-shadow : 0 0 0 1 px rgba ( 0 , 0 , 0 , .1 ) ; box-shadow : 0 0 0 1 px rgba ( 0 , 0 , 0 , .1 ) ; border-radius : 5 px 5 px 5 px 5 px } < / style > < script > w i n d o w . P o l y m e r G e s t u r e s = { h a s S D P o l y f i l l : B o o l e a n ( w i n d o w . S h a d o w D O M P o l y f i l l ) } , P o l y m e r G e s t u r e s . w r a p = P o l y m e r G e s t u r e s . h a s S D P o l y f i l l ? S h a d o w D O M P o l y f i l l . w r a p I f N e e d e d : f u n c t i o n ( a ) { r e t u r n a } , f u n c t i o n ( a ) { v a r b = ! 1 , c = d o c u m e n t . c r e a t e E l e m e n t ( " m e t a " ) ; i f ( c . c r e a t e S h a d o w R o o t ) { v a r d = c . c r e a t e S h a d o w R o o t ( ) , e = d o c u m e n t . c r e a t e E l e m e n t ( " s p a n " ) ; d . a p p e n d C h i l d ( e ) , c . a d d E v e n t L i s t e n e r ( " t e s t p a t h " , f u n c
if(this.simplePath){var b=this.fullPath;this.valueFn_=function(a,c){return c& & c.addPath(a,b),b.getValueFrom(a)}}else if(this.computed){var c=this.property;this.valueFn_=function(b,d,e){var f=a(b,d,e),g=c(b,d,e);return d& & d.addPath(f,[g]),f?f[g]:void 0}}else{var b=Path.get(this.property.name);this.valueFn_=function(c,d,e){var f=a(c,d,e);return d& & d.addPath(f,b),b.getValueFrom(f)}}}return this.valueFn_},setValue:function(a,b){if(this.simplePath)return this.fullPath.setValueFrom(a,b),b;var c=this.object(a),d=this.property instanceof e?this.property.name:this.property(a);return c[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=c[this.name],g=a;if(f)g=void 0;else if(f=g[this.name],!f)return void console.error("Cannot find function or filter: "+this.name);if(d?f=f.toModel:"function"==typeof f.toDOM& & (f=f.toDOM),"function"!=typeof f)return void console.error("Cannot find function or filter: "+this.name);for(var h=e||[],j=0;j< this.args.length ; j + + ) h . push ( i ( this . args [ j ] ) ( a , b , c ) ) ; return f . apply ( g , h ) } } ; var r = {"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){return a + b } , " - " :function ( a , b ) { return a-b } , " * " :function ( a , b ) { return a * b } , " / " :function ( a , b ) { return a / b } , " % " :function ( a , b ) { return a % b } , " < " :function ( a , b ) { return b > a},">":function(a,b){return a>b},"< =":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"& & ":function(a,b){return a& & b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c,d,e){return r[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throw Error("Disallowed operator: "+a);return b=i(b),c=i(c),function(d,e,f){return s[a](b(d,e,f),c(d,e,f))}},createConditionalExpression:function(a,b,c){return a=i(a),b=i(b),c=i(c),function(d,e,f){return a(d,e,f)?b(d,e,f):c(d,e,f)}},createIdentifier:function(a){var b=new e(a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){var d=new f(b,c,a);return d.dynamicDeps& & (this.dynamicDeps=!0),d},createCallExpression:function(a,b){if(!(a instanceof e))throw Error("Only identifier function invocations are allowed");var c=new g(a.name,b);return function(a,b,d){return c.transform(a,b,d,!1)}},createLiteral:function(a){return new d(a.value)},createArrayExpression:function(a){for(var b=0;b< a.length ; b + + ) a [ b ] = i ( a [ b ] ) ; return function ( b , c , d ) { for ( var e = [],f=0;f<a.length;f++)e.push(a[f](b,c,d));return e } } , createProperty:function ( a , b , c ) { return { key:b instanceof e ? b . name:b . value , value:c } } , createObjectExpression:function ( a ) { for ( var b = 0;b<a.length;b++)a[b].value=i(a[b].value);return function ( b , c , d ) { for ( var e = {},f=0;f<a.length;f++)e[a[f].key]=a[f].value(b,c,d);return e } } , createFilter:function ( a , b ) { this . filters . push ( new g ( a , b ) ) } , createAsExpression:function ( a , b ) { this . expression = a,this.scopeIdent=b},createInExpression:function(a,b,c){this.expression=c,this.scopeIdent=a,this.indexIdent=b},createTopLevel:function(a){this.expression=a},createThisExpression:h},k.prototype={open:function(){return this . value_ } , discardChanges:function ( ) { return this . value_ } , deliver:function ( ) { } , close:function ( ) { } } , l . prototype = {getBinding:function(a,b,c){function d ( ) { if ( h ) return h = !1,g;i.dynamicDeps&&f.startReset();var c = i.getValue(a,i.dynamicDeps?f:void 0 , b ) ; return i . dynamicDeps & & f . finishReset ( ) , c } function e ( c ) { return i . setValue ( a , c , b ) , c } if ( c ) return this . getValue ( a , void 0 , b ) ; var f = new CompoundObserver , g = this.getValue(a,f,b),h=!0,i=this;return new ObserverTransform ( f , d , e , ! 0 ) } , getValue:function ( a , b , c ) { for ( var d = i(this.expression)(a,b,c),e=0;e<this.filters.length;e++)d=this.filters[e].transform(a,b,c,!1,[d]);return d } , setValue:function ( a , b , c ) { for ( var d = this.filters?this.filters.length:0;d-- > 0;)b=this.filters[d].transform(a,void 0,c,!0,[b]);return this.expression.setValue?this.expression.setValue(a,b):void 0}};var t="@"+Math.random().toString(36).slice(2);p.prototype={styleObject:function(a){var b=[];for(var c in a)b.p
}.bind(this))}});e.publish(e.declaration,j),g(function(){document.body.removeAttribute("unresolved"),document.dispatchEvent(new CustomEvent("polymer-ready",{bubbles:!0}))}),document.registerElement("polymer-element",{prototype:j})}(Polymer),function(){var a=document.createElement("polymer-element");a.setAttribute("name","auto-binding"),a.setAttribute("extends","template"),a.init(),Polymer("auto-binding",{createdCallback:function(){this.syntax=this.bindingDelegate=this.makeSyntax(),Polymer.whenPolymerReady(function(){this.model=this,this.setAttribute("bind",""),this.async(function(){this.marshalNodeReferences(this.parentNode),this.fire("template-bound")})}.bind(this))},makeSyntax:function(){var a=Object.create(Polymer.api.declaration.events),b=this;a.findController=function(){return b.model};var c=new PolymerExpressions,d=c.prepareBinding;return c.prepareBinding=function(b,e,f){return a.prepareEventBinding(b,e,f)||d.call(c,b,e,f)},c}})}();< / script > < polymer-element name = "gui-row" attributes = "name comment" assetpath = "../elements/gui-row/" > < template > < div > < style > # row { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 2.9 em ; -webkit- user-select : none ; -moz- user-select : none ; -ms- user-select : none ; user-select : none ; -webkit- transition : background-color .2 s linear ; -moz- transition : background-color .2 s linear ; -o- transition : background-color .2 s linear ; -ms- transition : background-color .2 s linear ; transition : background-color .2 s linear ; border-bottom : 1 px solid rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-true ) # row { font-size : 13.5 px } # controller { height : 100 % } # name { padding : 0 8 px ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box ; width : 38 % ; cursor : default } . comment-true # name { cursor : pointer } : host-context ( . touch-true ) # name { font-size : 11 px ; width : 30 % } # nameInner { overflow : hidden ; -o- text-overflow : ellipsis ; text-overflow : ellipsis } # comment { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; line-height : 1.6 em ; background : #e0cf99 ; color : #333 ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box ; overflow : hidden ; -webkit- transition : height .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -moz- transition : height .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -o- transition : height .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -ms- transition : height .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; transition : height .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; position : absolute ; z-index : 999 ; pointer-events : none ; -webkit- transform : translate3d ( 0 , 20 px , 0 ) ; -moz- transform : translate3d ( 0 , 20 px , 0 ) ; -o- transform : translate3d ( 0 , 20 px , 0 ) ; -ms- transform : translate3d ( 0 , 20 px , 0 ) ; transform : translate3d ( 0 , 20 px , 0 ) ; opacity : 0 ; -ms- filter : "alpha(Opacity=0)" ; filter : alpha ( opacity = 0 ) ; -webkit- transition : all .2 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -moz- transition : all .2 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -o- transition : all .2 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -ms- transition : all .2 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; transition : all .2 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) } : host-context ( . touch-true ) # comment { font-size : 13.5 px } # comment . open-true { opacity : 1 ; -ms- filter : none ; filter : none ; -webkit- transform : translate3d ( 0 , 0 , 0 ) ; -moz- transform : translate3d ( 0 , 0 , 0 ) ; -o- transform : translate3d ( 0 , 0 , 0 ) ; -ms- transform : translate3d ( 0 , 0 , 0 ) ; transform : translate3d ( 0 , 0 , 0 ) } : host-context ( . touch-false ) # comment . open-true { -webkit- transition-delay : 200 ms ; -moz- transition-delay : 200 ms ; -o- transition-delay : 200 ms ; -ms- transition-delay : 200 ms ; transition-delay : 200 ms } # commentInner { padding : 8 px } . comment-true # nameInner { display : inline-block ; border-bottom : 1 px dotted rgba ( 255 , 255 , 255 , .25 ) } < / style > < div id = "row" class = "comment-{{ comment != null }}" layout = "" horizontal = "" > < div id = "name" on-mouseover = "{{ openComment }}" on-mouseout = "{{ closeComment }}" layout = "" horizontal = "" center = "" > < div id = "nameInner" > {{ name }}< / div > < / div > < div id = "controller" flex = "" > < content > < / content > < / div > < / div > < div id = "comment" class = "open-{{ commentOpen }}" hidden ? = " { { comment = = null } } " > < div id = "commentInner" > {{ comment }}< / div > < / div > < / div > < / template > < script > P o l y m e r ( " g u i - r o w " , { c o m m e n t : n u l l , c o m m e n t O p e n : f a l s e , r e a d y : f u n c t i o n ( ) { } , o p e n C o m m e n t : f u n c t i o n ( ) { t h i s . c o m m e n t O p e n = t r u e } , c l o s e C o
2014-08-27 00:01:15 +00:00
< div hidden > undefined< / div >
<!-- controllers -->
2014-09-08 01:27:32 +00:00
< div hidden > < script > Polymer ( "controller-base" , { ready : function ( ) { this . update ( ) } , update : function ( ) { } , init : function ( ) { } , watch : function ( object , path ) { this . object = object ; this . path = path ; this . bind ( "value" , new PathObserver ( this . object , this . path ) ) } , valueChanged : function ( ) { this . update ( ) ; this . fire ( "change" , this . value ) } , on : function ( event , listener ) { this . addEventListener ( event , listener ) ; return this } , map : function ( x , a , b , c , d ) { return ( x - a ) / ( b - a ) * ( d - c ) + c } , listen : function ( ) { Gui . warn ( "controller.listen() is deprecated. " + "All controllers are listened for free." ) ; return this } , getValue : function ( ) { return this . value } , setValue : function ( v ) { this . value = v ; return this } , onChange : function ( v ) { this . addEventListener ( "change" , function ( e ) { v ( e . detail ) } ) ; return this } } ) ; < / script > < polymer-element name = "controller-base" attributes = "object path value" assetpath = "../elements/controller-base/" > < / polymer-element > < script > Gui . register ( "controller-number" , function ( value ) { return typeof value == "number" } ) ; Polymer ( "controller-number" , { value : 0 , decimals : 3 , computed : { slider : "min !== undefined && max !== undefined" } , ready : function ( ) { var _this = this ; window . addEventListener ( "keydown" , function ( e ) { if ( e . keyCode == 18 ) { _this . _alt = true } } , false ) ; window . addEventListener ( "keyup" , function ( e ) { if ( e . keyCode == 18 ) { _this . _alt = false } } , false ) } , init : function ( min , max , step ) { this . min = min ; this . max = max ; this . step = step } , valueChanged : function ( newValue ) { if ( this . step !== undefined ) { this . value = Math . round ( this . value / this . step ) * this . step } if ( this . min !== undefined ) { this . value = Math . max ( this . value , this . min ) } if ( this . max !== undefined ) { this . value = Math . min ( this . value , this . max ) } this . super ( ) } , minChanged : function ( ) { this . value = Math . max ( this . value , this . min ) ; this . update ( ) } , maxChanged : function ( ) { this . value = Math . min ( this . value , this . max ) ; this . update ( ) } , update : function ( ) { var ratio = this . map ( this . value , this . min , this . max , 0 , 1 ) ; if ( this . min < 0 && this . max > 0 ) { this . $ . container . classList . add ( "straddle-zero" ) ; var zero = this . map ( 0 , this . min , this . max , 0 , 1 ) ; if ( this . value >= 0 ) { this . $ . fill . style . left = zero * 100 + "%" ; this . $ . fill . style . width = ( ratio - zero ) * 100 + "%" ; this . $ . fill . style . right = "" } else { this . $ . fill . style . left = "" ; this . $ . fill . style . width = ( zero - ratio ) * 100 + "%" ; this . $ . fill . style . right = ( 1 - zero ) * 100 + "%" } } else { this . $ . container . classList . remove ( "straddle-zero" ) ; if ( this . max > 0 ) { this . $ . fill . style . left = 0 ; this . $ . fill . style . width = ratio * 100 + "%" ; this . $ . fill . style . right = "" } else { this . $ . fill . style . left = "" ; this . $ . fill . style . width = ( 1 - ratio ) * 100 + "%" ; this . $ . fill . style . right = 0 } } this . $ . knob . style . left = ratio * 100 + "%" ; this . $ . container . classList . toggle ( "positive" , this . value >= 0 ) ; this . $ . container . classList . toggle ( "negative" , this . value < 0 ) ; this . super ( ) } , click : function ( e ) { this . $ . input . select ( ) } , keydown : function ( e ) { if ( e . keyCode == 13 ) { this . $ . input . blur ( ) } } , down : function ( e ) { e . preventDefault ( ) ; this . _rect = this . $ . track . getBoundingClientRect ( ) ; if ( ! this . _alt ) { this . value = this . valueFromX ( e . x ) } this . fire ( "sliderDown" ) } , up : function ( e ) { this . fire ( "sliderUp" ) } , trackstart : function ( e ) { this . _dragFriction = 1 } , trackx : function ( e ) { if ( this . step === undefined ) { var dv = this . valueFromDX ( e . ddx ) ; if ( this . _alt ) { dv /= 10 } this . value += dv * this . _dragFriction } else { this . value = this . valueFromX ( e . pageX ) } } , tracky : function ( e ) { this . _dragFriction = Math . max ( . 01 , Math . min ( 1 , this . map ( e . dy , 50 , 300 , 1 , . 1 ) ) ) } , blur : function ( e ) { var v = parseFloat ( this . $ . input . value ) ; if ( v === v ) { this . value = v } } , truncate : function ( v ) { if ( v % 1 !== 0 && this . decimals !== undefined ) { return this . limitDecimals ( v , this . decimals ) } else { return v } } , limitDecimals : function ( v , maxDecimals ) { var str = v . toString ( ) ; var numDecimals = str . substring ( str . indexOf ( "." ) + 1 ) . length ; str = v . toFixed ( Math . min ( numDecimals , this . decimals ) ) ; for ( var z , i = 0 , l = str . length ; i < l ; i ++ ) { if ( str . charAt ( i ) !== "0" ) { z = i } } return str . substring ( 0 , z + 1 ) } , valueFromX : function ( x ) { return this . map ( x , this . _rect . left , this . _rect . right , this . min , this . max ) } , valueFromDX : function ( dx ) { return this . map ( dx , 0 , this . _rect . width , 0 , this . max - this . min ) } } ) ; < / script > < polymer-element name = "controller-number" attributes = "min max value step" extends = "controller-base" assetpath = "../elements/controller-number/" > < template > < style > i n p u t { f o n t : 1 0 p x ' L u c i d a G r a n d e ' , s a n s - s e r i f ; c o l o r :
< div hidden > < script > Gui . register ( "controller-string" , function ( value ) { return typeof value == "string" } ) ; Polymer ( "controller-string" , { click : function ( e ) { this . $ . input . select ( ) } , keydown : function ( e ) { if ( e . keyCode == 13 ) { this . $ . input . blur ( ) } } } ) ; < / script > < polymer-element name = "controller-string" extends = "controller-base" assetpath = "../elements/controller-string/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > input { color : #1ebd6e ; padding-left : 8 px } < / style > < input id = "input" type = "text" value = "{{ value }}" on-click = "{{ click }}" on-keydown = "{{ keydown }}" > < / template > < / polymer-element > < / div >
< div hidden > < script > Gui . register ( "controller-boolean" , function ( value ) { return typeof value == "boolean" } ) ; Polymer ( "controller-boolean" , { ready : function ( ) { } , toggle : function ( ) { this . value = ! this . value } } ) ; < / script > < polymer-element name = "controller-boolean" extends = "controller-base" assetpath = "../elements/controller-boolean/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > # container { height : 100 % ; cursor : pointer ; padding-left : 8 px } # switch-track { width : 2 em ; height : .8 em ; background : rgba ( 255 , 255 , 255 , .25 ) ; border-radius : 999 px ; -webkit- transition : background .1 s linear ; -moz- transition : background .1 s linear ; -o- transition : background .1 s linear ; -ms- transition : background .1 s linear ; transition : background .1 s linear } # switch-knob { height : .8 em ; width : .8 em ; border-radius : 100 % ; background : #ecebe0 ; -webkit- transition : -webkit- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -moz- transition : -moz- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -o- transition : -o- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -ms- transition : -ms- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; transition : transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) } . value-true # switch-track { background : #864694 } . value-true # switch-knob { -webkit- transform : translate3d ( 1.2 em , 0 , 0 ) ; -moz- transform : translate3d ( 1.2 em , 0 , 0 ) ; -o- transform : translate3d ( 1.2 em , 0 , 0 ) ; -ms- transform : translate3d ( 1.2 em , 0 , 0 ) ; transform : translate3d ( 1.2 em , 0 , 0 ) } : host-context ( . touch-false ) . value-false : hover # switch-knob { -webkit- transform : scale ( 1.5 ) ; -moz- transform : scale ( 1.5 ) ; -o- transform : scale ( 1.5 ) ; -ms- transform : scale ( 1.5 ) ; transform : scale ( 1.5 ) } : host-context ( . touch-false ) . value-true : hover # switch-knob { -webkit- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -moz- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -o- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -ms- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) } # text { margin-left : 8 px } . value-false # text { color : rgba ( 255 , 255 , 255 , .25 ) } < / style > < div id = "container" horizontal = "" layout = "" center = "" on-tap = "{{ toggle }}" class = "value-{{ value }}" > < div id = "switch-track" > < div id = "switch-knob" > < / div > < / div > < / div > < / template > < / polymer-element > < / div >
< div hidden > < script > Gui . register ( "controller-function" , function ( value ) { return typeof value == "function" } ) ; Polymer ( "controller-function" , { } ) ; < / script > < polymer-element name = "controller-function" extends = "controller-base" assetpath = "../elements/controller-function/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > < / style > < div id = "container" > < / div > < / template > < / polymer-element > < / div >
2014-09-07 23:55:40 +00:00
< div hidden > < script > Polymer ( "controller-option" , { key : null , ready : function ( ) { this . options = { } } , init : function ( options ) { if ( Array . isArray ( options ) ) { options . forEach ( function ( opt ) { this . options [ opt ] = opt } , this ) } else { this . options = options } } , valueChanged : function ( ) { for ( var i in this . options ) { if ( this . options [ i ] === this . value ) { this . key = i ; break } } this . super ( ) } , keyChanged : function ( ) { this . value = this . options [ this . key ] } , keys : function ( object ) { if ( object ) return Object . keys ( object ) } } ) ; < / script > < polymer-element name = "controller-option" extends = "controller-base" attributes = "options key" assetpath = "../elements/controller-option/" > < template > < style > # container { height : 100 % ; cursor : pointer ; padding-left : 8 px } select { outline : 0 } < / style > < div id = "container" horizontal = "" layout = "" center = "" > < select value = "{{ key }}" on-change = "{{ change }}" > < template repeat = "{{ name in options | keys }}" > < option value = "{{ name }}" > {{ name }}< / option > < / template > < / select > < / div > < / template > < / polymer-element > < / div >