Add JS files
This commit is contained in:
8
include/javascript/yui3/build/widget/widget-min.js
vendored
Executable file
8
include/javascript/yui3/build/widget/widget-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
8
include/javascript/yui3/build/widget/widget-position-ext-min.js
vendored
Executable file
8
include/javascript/yui3/build/widget/widget-position-ext-min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add("widget-position-ext",function(A){var H=A.Lang,C="align",E="bindUI",B="syncUI",D="offsetWidth",I="offsetHeight",K="viewportRegion",G="region",J="alignChange";function F(L){if(!this._posNode){A.error("WidgetPosition needs to be added to the Widget, before WidgetPositionExt is added");}A.after(this._syncUIPosExtras,this,B);A.after(this._bindUIPosExtras,this,E);}F.ATTRS={align:{value:null},centered:{setter:function(L){return this._setAlignCenter(L);},lazyAdd:false,value:false}};F.TL="tl";F.TR="tr";F.BL="bl";F.BR="br";F.TC="tc";F.RC="rc";F.BC="bc";F.LC="lc";F.CC="cc";F.prototype={_syncUIPosExtras:function(){var L=this.get(C);if(L){this._uiSetAlign(L.node,L.points);}},_bindUIPosExtras:function(){this.after(J,this._afterAlignChange);},_setAlignCenter:function(L){if(L){this.set(C,{node:L===true?null:L,points:[F.CC,F.CC]});}return L;},_afterAlignChange:function(L){if(L.newVal){this._uiSetAlign(L.newVal.node,L.newVal.points);}},_uiSetAlign:function(O,N){if(!H.isArray(N)||N.length!=2){A.error("align: Invalid Points Arguments");return;}var M,L,P,Q;if(!O){M=this._posNode.get(K);}else{O=A.Node.get(O);if(O){M=O.get(G);}}if(M){M.width=M.width||M.right-M.left;M.height=M.height||M.bottom-M.top;L=N[0];P=N[1];switch(P){case F.TL:Q=[M.left,M.top];break;case F.TR:Q=[M.right,M.top];break;case F.BL:Q=[M.left,M.bottom];break;case F.BR:Q=[M.right,M.bottom];break;case F.TC:Q=[M.left+Math.floor(M.width/2),M.top];break;case F.BC:Q=[M.left+Math.floor(M.width/2),M.bottom];break;case F.LC:Q=[M.left,M.top+Math.floor(M.height/2)];break;case F.RC:Q=[M.right,M.top+Math.floor(M.height/2),L];break;case F.CC:Q=[M.left+Math.floor(M.width/2),M.top+Math.floor(M.height/2),L];break;default:break;}if(Q){this._doAlign(L,Q[0],Q[1]);}}},_doAlign:function(M,L,P){var O=this._posNode,N;switch(M){case F.TL:N=[L,P];break;case F.TR:N=[L-O.get(D),P];break;case F.BL:N=[L,P-O.get(I)];break;case F.BR:N=[L-O.get(D),P-O.get(I)];break;case F.TC:N=[L-(O.get(D)/2),P];break;case F.BC:N=[L-(O.get(D)/2),P-O.get(I)];break;case F.LC:N=[L,P-(O.get(I)/2)];break;case F.RC:N=[(L-O.get(D)),P-(O.get(I)/2)];break;case F.CC:N=[L-(O.get(D)/2),P-(O.get(I)/2)];break;default:break;}if(N){this.move(N);}},align:function(M,L){this.set(C,{node:M,points:L});},centered:function(L){this.align(L,[F.CC,F.CC]);}};A.WidgetPositionExt=F;},"3.0.0",{requires:["widget","widget-position"]});
|
||||
15
include/javascript/yui3/build/widget/widget-position-ext.js
vendored
Executable file
15
include/javascript/yui3/build/widget/widget-position-ext.js
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('widget-position-ext',function(Y){var L=Y.Lang,ALIGN="align",BINDUI="bindUI",SYNCUI="syncUI",OFFSET_WIDTH="offsetWidth",OFFSET_HEIGHT="offsetHeight",VIEWPORT_REGION="viewportRegion",REGION="region",AlignChange="alignChange";function PositionExt(config){if(!this._posNode){Y.error("WidgetPosition needs to be added to the Widget, before WidgetPositionExt is added");}
|
||||
Y.after(this._syncUIPosExtras,this,SYNCUI);Y.after(this._bindUIPosExtras,this,BINDUI);}
|
||||
PositionExt.ATTRS={align:{value:null},centered:{setter:function(val){return this._setAlignCenter(val);},lazyAdd:false,value:false}};PositionExt.TL="tl";PositionExt.TR="tr";PositionExt.BL="bl";PositionExt.BR="br";PositionExt.TC="tc";PositionExt.RC="rc";PositionExt.BC="bc";PositionExt.LC="lc";PositionExt.CC="cc";PositionExt.prototype={_syncUIPosExtras:function(){var align=this.get(ALIGN);if(align){this._uiSetAlign(align.node,align.points);}},_bindUIPosExtras:function(){this.after(AlignChange,this._afterAlignChange);},_setAlignCenter:function(val){if(val){this.set(ALIGN,{node:val===true?null:val,points:[PositionExt.CC,PositionExt.CC]});}
|
||||
return val;},_afterAlignChange:function(e){if(e.newVal){this._uiSetAlign(e.newVal.node,e.newVal.points);}},_uiSetAlign:function(node,points){if(!L.isArray(points)||points.length!=2){Y.error("align: Invalid Points Arguments");return;}
|
||||
var nodeRegion,widgetPoint,nodePoint,xy;if(!node){nodeRegion=this._posNode.get(VIEWPORT_REGION);}else{node=Y.Node.get(node);if(node){nodeRegion=node.get(REGION);}}
|
||||
if(nodeRegion){nodeRegion.width=nodeRegion.width||nodeRegion.right-nodeRegion.left;nodeRegion.height=nodeRegion.height||nodeRegion.bottom-nodeRegion.top;widgetPoint=points[0];nodePoint=points[1];switch(nodePoint){case PositionExt.TL:xy=[nodeRegion.left,nodeRegion.top];break;case PositionExt.TR:xy=[nodeRegion.right,nodeRegion.top];break;case PositionExt.BL:xy=[nodeRegion.left,nodeRegion.bottom];break;case PositionExt.BR:xy=[nodeRegion.right,nodeRegion.bottom];break;case PositionExt.TC:xy=[nodeRegion.left+Math.floor(nodeRegion.width/2),nodeRegion.top];break;case PositionExt.BC:xy=[nodeRegion.left+Math.floor(nodeRegion.width/2),nodeRegion.bottom];break;case PositionExt.LC:xy=[nodeRegion.left,nodeRegion.top+Math.floor(nodeRegion.height/2)];break;case PositionExt.RC:xy=[nodeRegion.right,nodeRegion.top+Math.floor(nodeRegion.height/2),widgetPoint];break;case PositionExt.CC:xy=[nodeRegion.left+Math.floor(nodeRegion.width/2),nodeRegion.top+Math.floor(nodeRegion.height/2),widgetPoint];break;default:break;}
|
||||
if(xy){this._doAlign(widgetPoint,xy[0],xy[1]);}}},_doAlign:function(widgetPoint,x,y){var widgetNode=this._posNode,xy;switch(widgetPoint){case PositionExt.TL:xy=[x,y];break;case PositionExt.TR:xy=[x-widgetNode.get(OFFSET_WIDTH),y];break;case PositionExt.BL:xy=[x,y-widgetNode.get(OFFSET_HEIGHT)];break;case PositionExt.BR:xy=[x-widgetNode.get(OFFSET_WIDTH),y-widgetNode.get(OFFSET_HEIGHT)];break;case PositionExt.TC:xy=[x-(widgetNode.get(OFFSET_WIDTH)/2),y];break;case PositionExt.BC:xy=[x-(widgetNode.get(OFFSET_WIDTH)/2),y-widgetNode.get(OFFSET_HEIGHT)];break;case PositionExt.LC:xy=[x,y-(widgetNode.get(OFFSET_HEIGHT)/2)];break;case PositionExt.RC:xy=[(x-widgetNode.get(OFFSET_WIDTH)),y-(widgetNode.get(OFFSET_HEIGHT)/2)];break;case PositionExt.CC:xy=[x-(widgetNode.get(OFFSET_WIDTH)/2),y-(widgetNode.get(OFFSET_HEIGHT)/2)];break;default:break;}
|
||||
if(xy){this.move(xy);}},align:function(node,points){this.set(ALIGN,{node:node,points:points});},centered:function(node){this.align(node,[PositionExt.CC,PositionExt.CC]);}};Y.WidgetPositionExt=PositionExt;},'3.0.0',{requires:['widget','widget-position']});
|
||||
8
include/javascript/yui3/build/widget/widget-position-min.js
vendored
Executable file
8
include/javascript/yui3/build/widget/widget-position-min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add("widget-position",function(A){var H=A.Lang,J=A.Widget,K="xy",F="positioned",I="boundingBox",L="renderUI",G="bindUI",D="syncUI",C=J.UI_SRC,E="xyChange";function B(M){this._posNode=this.get(I);A.after(this._renderUIPosition,this,L);A.after(this._syncUIPosition,this,D);A.after(this._bindUIPosition,this,G);}B.ATTRS={x:{setter:function(M){this._setX(M);},lazyAdd:false,getter:function(){return this._getX();}},y:{setter:function(M){this._setY(M);},lazyAdd:false,getter:function(){return this._getY();}},xy:{value:[0,0],validator:function(M){return this._validateXY(M);}}};B.POSITIONED_CLASS_NAME=J.getClassName(F);B.prototype={_renderUIPosition:function(){this._posNode.addClass(B.POSITIONED_CLASS_NAME);},_syncUIPosition:function(){this._uiSetXY(this.get(K));},_bindUIPosition:function(){this.after(E,this._afterXYChange);},move:function(){var M=arguments,N=(H.isArray(M[0]))?M[0]:[M[0],M[1]];this.set(K,N);},syncXY:function(){this.set(K,this._posNode.getXY(),{src:C});},_validateXY:function(M){return(H.isArray(M)&&H.isNumber(M[0])&&H.isNumber(M[1]));},_setX:function(M){this.set(K,[M,this.get(K)[1]]);},_setY:function(M){this.set(K,[this.get(K)[0],M]);},_getX:function(){return this.get(K)[0];},_getY:function(){return this.get(K)[1];},_afterXYChange:function(M){if(M.src!=C){this._uiSetXY(M.newVal);}},_uiSetXY:function(M){this._posNode.setXY(M);}};A.WidgetPosition=B;},"3.0.0",{requires:["widget"]});
|
||||
9
include/javascript/yui3/build/widget/widget-position.js
vendored
Executable file
9
include/javascript/yui3/build/widget/widget-position.js
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('widget-position',function(Y){var Lang=Y.Lang,Widget=Y.Widget,XY_COORD="xy",POSITIONED="positioned",BOUNDING_BOX="boundingBox",RENDERUI="renderUI",BINDUI="bindUI",SYNCUI="syncUI",UI=Widget.UI_SRC,XYChange="xyChange";function Position(config){this._posNode=this.get(BOUNDING_BOX);Y.after(this._renderUIPosition,this,RENDERUI);Y.after(this._syncUIPosition,this,SYNCUI);Y.after(this._bindUIPosition,this,BINDUI);}
|
||||
Position.ATTRS={x:{setter:function(val){this._setX(val);},lazyAdd:false,getter:function(){return this._getX();}},y:{setter:function(val){this._setY(val);},lazyAdd:false,getter:function(){return this._getY();}},xy:{value:[0,0],validator:function(val){return this._validateXY(val);}}};Position.POSITIONED_CLASS_NAME=Widget.getClassName(POSITIONED);Position.prototype={_renderUIPosition:function(){this._posNode.addClass(Position.POSITIONED_CLASS_NAME);},_syncUIPosition:function(){this._uiSetXY(this.get(XY_COORD));},_bindUIPosition:function(){this.after(XYChange,this._afterXYChange);},move:function(){var args=arguments,coord=(Lang.isArray(args[0]))?args[0]:[args[0],args[1]];this.set(XY_COORD,coord);},syncXY:function(){this.set(XY_COORD,this._posNode.getXY(),{src:UI});},_validateXY:function(val){return(Lang.isArray(val)&&Lang.isNumber(val[0])&&Lang.isNumber(val[1]));},_setX:function(val){this.set(XY_COORD,[val,this.get(XY_COORD)[1]]);},_setY:function(val){this.set(XY_COORD,[this.get(XY_COORD)[0],val]);},_getX:function(){return this.get(XY_COORD)[0];},_getY:function(){return this.get(XY_COORD)[1];},_afterXYChange:function(e){if(e.src!=UI){this._uiSetXY(e.newVal);}},_uiSetXY:function(val){this._posNode.setXY(val);}};Y.WidgetPosition=Position;},'3.0.0',{requires:['widget']});
|
||||
8
include/javascript/yui3/build/widget/widget-stack-min.js
vendored
Executable file
8
include/javascript/yui3/build/widget/widget-stack-min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add("widget-stack",function(E){var N=E.Lang,T=E.UA,d=E.Node,F=E.Widget,c="zIndex",P="shim",a="visible",e="boundingBox",W="renderUI",G="bindUI",S="syncUI",Q="offsetWidth",D="offsetHeight",M="parentNode",A="firstChild",X="ownerDocument",H="width",V="height",K="px",O="shimdeferred",f="shimresize",Z="visibleChange",C="widthChange",J="heightChange",b="shimChange",B="zIndexChange",I="contentUpdate",R="stacked";function U(L){this._stackNode=this.get(e);this._stackHandles={};E.after(this._renderUIStack,this,W);E.after(this._syncUIStack,this,S);E.after(this._bindUIStack,this,G);}U.ATTRS={shim:{value:(T.ie==6)},zIndex:{value:0,setter:function(L){return this._setZIndex(L);}}};U.HTML_PARSER={zIndex:function(L){return L.getStyle(c);}};U.SHIM_CLASS_NAME=F.getClassName(P);U.STACKED_CLASS_NAME=F.getClassName(R);U.SHIM_TEMPLATE='<iframe class="'+U.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>';U.prototype={_syncUIStack:function(){this._uiSetShim(this.get(P));this._uiSetZIndex(this.get(c));},_bindUIStack:function(){this.after(b,this._afterShimChange);this.after(B,this._afterZIndexChange);},_renderUIStack:function(){this._stackNode.addClass(U.STACKED_CLASS_NAME);},_setZIndex:function(L){if(N.isString(L)){L=parseInt(L,10);}if(!N.isNumber(L)){L=0;}return L;},_afterShimChange:function(L){this._uiSetShim(L.newVal);},_afterZIndexChange:function(L){this._uiSetZIndex(L.newVal);},_uiSetZIndex:function(L){this._stackNode.setStyle(c,L);},_uiSetShim:function(L){if(L){if(this.get(a)){this._renderShim();}else{this._renderShimDeferred();}}else{this._destroyShim();}},_renderShimDeferred:function(){this._stackHandles[O]=this._stackHandles[O]||[];var Y=this._stackHandles[O],L=function(g){if(g.newVal){this._renderShim();}};Y.push(this.on(Z,L));},_addShimResizeHandlers:function(){this._stackHandles[f]=this._stackHandles[f]||[];var Y=this.sizeShim,L=this._stackHandles[f];this.sizeShim();L.push(this.after(Z,Y));L.push(this.after(C,Y));L.push(this.after(J,Y));L.push(this.after(I,Y));},_detachStackHandles:function(L){var Y=this._stackHandles[L],g;if(Y&&Y.length>0){while((g=Y.pop())){g.detach();}}},_renderShim:function(){var L=this._shimNode,Y=this._stackNode;if(!L){L=this._shimNode=this._getShimTemplate();Y.insertBefore(L,Y.get(A));if(T.ie==6){this._addShimResizeHandlers();}this._detachStackHandles(O);}},_destroyShim:function(){if(this._shimNode){this._shimNode.get(M).removeChild(this._shimNode);this._shimNode=null;this._detachStackHandles(O);this._detachStackHandles(f);}},sizeShim:function(){var Y=this._shimNode,L=this._stackNode;if(Y&&T.ie===6&&this.get(a)){Y.setStyle(H,L.get(Q)+K);Y.setStyle(V,L.get(D)+K);}},_getShimTemplate:function(){return d.create(U.SHIM_TEMPLATE,this._stackNode.get(X));}};E.WidgetStack=U;},"3.0.0",{requires:["widget"]});
|
||||
12
include/javascript/yui3/build/widget/widget-stack.js
vendored
Executable file
12
include/javascript/yui3/build/widget/widget-stack.js
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('widget-stack',function(Y){var L=Y.Lang,UA=Y.UA,Node=Y.Node,Widget=Y.Widget,ZINDEX="zIndex",SHIM="shim",VISIBLE="visible",BOUNDING_BOX="boundingBox",RENDER_UI="renderUI",BIND_UI="bindUI",SYNC_UI="syncUI",OFFSET_WIDTH="offsetWidth",OFFSET_HEIGHT="offsetHeight",PARENT_NODE="parentNode",FIRST_CHILD="firstChild",OWNER_DOCUMENT="ownerDocument",WIDTH="width",HEIGHT="height",PX="px",SHIM_DEFERRED="shimdeferred",SHIM_RESIZE="shimresize",VisibleChange="visibleChange",WidthChange="widthChange",HeightChange="heightChange",ShimChange="shimChange",ZIndexChange="zIndexChange",ContentUpdate="contentUpdate",STACKED="stacked";function Stack(config){this._stackNode=this.get(BOUNDING_BOX);this._stackHandles={};Y.after(this._renderUIStack,this,RENDER_UI);Y.after(this._syncUIStack,this,SYNC_UI);Y.after(this._bindUIStack,this,BIND_UI);}
|
||||
Stack.ATTRS={shim:{value:(UA.ie==6)},zIndex:{value:0,setter:function(val){return this._setZIndex(val);}}};Stack.HTML_PARSER={zIndex:function(contentBox){return contentBox.getStyle(ZINDEX);}};Stack.SHIM_CLASS_NAME=Widget.getClassName(SHIM);Stack.STACKED_CLASS_NAME=Widget.getClassName(STACKED);Stack.SHIM_TEMPLATE='<iframe class="'+Stack.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>';Stack.prototype={_syncUIStack:function(){this._uiSetShim(this.get(SHIM));this._uiSetZIndex(this.get(ZINDEX));},_bindUIStack:function(){this.after(ShimChange,this._afterShimChange);this.after(ZIndexChange,this._afterZIndexChange);},_renderUIStack:function(){this._stackNode.addClass(Stack.STACKED_CLASS_NAME);},_setZIndex:function(zIndex){if(L.isString(zIndex)){zIndex=parseInt(zIndex,10);}
|
||||
if(!L.isNumber(zIndex)){zIndex=0;}
|
||||
return zIndex;},_afterShimChange:function(e){this._uiSetShim(e.newVal);},_afterZIndexChange:function(e){this._uiSetZIndex(e.newVal);},_uiSetZIndex:function(zIndex){this._stackNode.setStyle(ZINDEX,zIndex);},_uiSetShim:function(enable){if(enable){if(this.get(VISIBLE)){this._renderShim();}else{this._renderShimDeferred();}}else{this._destroyShim();}},_renderShimDeferred:function(){this._stackHandles[SHIM_DEFERRED]=this._stackHandles[SHIM_DEFERRED]||[];var handles=this._stackHandles[SHIM_DEFERRED],createBeforeVisible=function(e){if(e.newVal){this._renderShim();}};handles.push(this.on(VisibleChange,createBeforeVisible));},_addShimResizeHandlers:function(){this._stackHandles[SHIM_RESIZE]=this._stackHandles[SHIM_RESIZE]||[];var sizeShim=this.sizeShim,handles=this._stackHandles[SHIM_RESIZE];this.sizeShim();handles.push(this.after(VisibleChange,sizeShim));handles.push(this.after(WidthChange,sizeShim));handles.push(this.after(HeightChange,sizeShim));handles.push(this.after(ContentUpdate,sizeShim));},_detachStackHandles:function(handleKey){var handles=this._stackHandles[handleKey],handle;if(handles&&handles.length>0){while((handle=handles.pop())){handle.detach();}}},_renderShim:function(){var shimEl=this._shimNode,stackEl=this._stackNode;if(!shimEl){shimEl=this._shimNode=this._getShimTemplate();stackEl.insertBefore(shimEl,stackEl.get(FIRST_CHILD));if(UA.ie==6){this._addShimResizeHandlers();}
|
||||
this._detachStackHandles(SHIM_DEFERRED);}},_destroyShim:function(){if(this._shimNode){this._shimNode.get(PARENT_NODE).removeChild(this._shimNode);this._shimNode=null;this._detachStackHandles(SHIM_DEFERRED);this._detachStackHandles(SHIM_RESIZE);}},sizeShim:function(){var shim=this._shimNode,node=this._stackNode;if(shim&&UA.ie===6&&this.get(VISIBLE)){shim.setStyle(WIDTH,node.get(OFFSET_WIDTH)+PX);shim.setStyle(HEIGHT,node.get(OFFSET_HEIGHT)+PX);}},_getShimTemplate:function(){return Node.create(Stack.SHIM_TEMPLATE,this._stackNode.get(OWNER_DOCUMENT));}};Y.WidgetStack=Stack;},'3.0.0',{requires:['widget']});
|
||||
8
include/javascript/yui3/build/widget/widget-stdmod-min.js
vendored
Executable file
8
include/javascript/yui3/build/widget/widget-stdmod-min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add("widget-stdmod",function(A){var D=A.Lang,P=A.Node,c=A.NodeList,W=A.UA,C=A.Widget,B="",j="hd",h="bd",H="ft",e="header",m="body",k="footer",q="fillHeight",K="stdmod",t="px",T="Node",i="Content",o="innerHTML",d="firstChild",G="childNodes",l="createDocumentFragment",M="ownerDocument",U="contentBox",p="boundingBox",Z="height",g="offsetHeight",X="auto",J="headerContentChange",b="bodyContentChange",N="footerContentChange",R="fillHeightChange",S="HeightChange",r="contentUpdate",V="renderUI",f="bindUI",E="syncUI",Q=A.Widget.UI_SRC;function s(L){this._stdModNode=this.get(U);A.after(this._renderUIStdMod,this,V);A.after(this._bindUIStdMod,this,f);A.after(this._syncUIStdMod,this,E);}s.HEADER=e;s.BODY=m;s.FOOTER=k;s.AFTER="after";s.BEFORE="before";s.REPLACE="replace";var I=s.HEADER,a=s.BODY,O=s.FOOTER,n=s.AFTER,F=s.BEFORE;s.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:s.BODY,validator:function(L){return this._validateFillHeight(L);}}};s.HTML_PARSER={headerContent:function(L){return this._parseStdModHTML(I);},bodyContent:function(L){return this._parseStdModHTML(a);},footerContent:function(L){return this._parseStdModHTML(O);}};s.SECTION_CLASS_NAMES={header:C.getClassName(j),body:C.getClassName(h),footer:C.getClassName(H)};s.TEMPLATES={header:'<div class="'+s.SECTION_CLASS_NAMES[I]+'"></div>',body:'<div class="'+s.SECTION_CLASS_NAMES[a]+'"></div>',footer:'<div class="'+s.SECTION_CLASS_NAMES[O]+'"></div>'};s.prototype={_syncUIStdMod:function(){this._uiSetStdMod(I,this.get(I+i));this._uiSetStdMod(a,this.get(a+i));this._uiSetStdMod(O,this.get(O+i));this._uiSetFillHeight(this.get(q));},_renderUIStdMod:function(){this._stdModNode.addClass(C.getClassName(K));},_bindUIStdMod:function(){this.after(J,this._afterHeaderChange);this.after(b,this._afterBodyChange);this.after(N,this._afterFooterChange);this.after(R,this._afterFillHeightChange);this.after(S,this._fillHeight);this.after(r,this._fillHeight);},_afterHeaderChange:function(L){if(L.src!==Q){this._uiSetStdMod(I,L.newVal,L.stdModPosition);}},_afterBodyChange:function(L){if(L.src!==Q){this._uiSetStdMod(a,L.newVal,L.stdModPosition);}},_afterFooterChange:function(L){if(L.src!==Q){this._uiSetStdMod(O,L.newVal,L.stdModPosition);}},_afterFillHeightChange:function(L){this._uiSetFillHeight(L.newVal);},_validateFillHeight:function(L){return!L||L==s.BODY||L==s.HEADER||L==s.FOOTER;},_uiSetFillHeight:function(u){var Y=this.getStdModNode(u);var L=this._currFillNode;if(L&&Y!==L){L.setStyle(Z,B);}if(Y){this._currFillNode=Y;}this._fillHeight();},_fillHeight:function(){if(this.get(q)){var L=this.get(Z);if(L!=B&&L!=X){this.fillHeight(this._currFillNode);}}},_uiSetStdMod:function(v,u,L){if(u){var Y=this.getStdModNode(v)||this._renderStdMod(v);if(u instanceof P||u instanceof c){this._addNodeRef(Y,u,L);}else{this._addNodeHTML(Y,u,L);}this.set(v+i,this._getStdModContent(v),{src:Q});this.fire(r);}},_renderStdMod:function(u){var L=this.get(U),Y=this._findStdModSection(u);if(!Y){Y=this._getStdModTemplate(u);}this._insertStdModSection(L,u,Y);this[u+T]=Y;return this[u+T];},_insertStdModSection:function(L,v,u){var Y=L.get(d);if(v===O||!Y){L.appendChild(u);}else{if(v===I){L.insertBefore(u,Y);}else{var w=this[O+T];if(w){L.insertBefore(u,w);}else{L.appendChild(u);}}}},_getStdModTemplate:function(L){return P.create(s.TEMPLATES[L],this._stdModNode.get(M));},_addNodeHTML:function(u,Y,L){if(L==n){u.set(o,u.get(o)+Y);}else{if(L==F){u.set(o,Y+u.get(o));}else{u.set(o,Y);}}},_addNodeRef:function(x,v,Y){var L=true,u,w;if(Y==F){var y=x.get(d);if(y){if(v instanceof c){for(u=v.size()-1;u>=0;--u){x.insertBefore(v.item(u),y);}}else{x.insertBefore(v,y);}L=false;}}else{if(Y!=n){x.set(o,B);}}if(L){if(v instanceof c){for(u=0,w=v.size();u<w;++u){x.appendChild(v.item(u));}}else{x.appendChild(v);}}},_getPreciseHeight:function(u){var L=(u)?u.get(g):0,v="getBoundingClientRect";if(u&&u.hasMethod(v)){var Y=u.invoke(v);if(Y){L=Y.bottom-Y.top;}}return L;},_findStdModSection:function(L){return this.get(U).query("> ."+s.SECTION_CLASS_NAMES[L]);},_parseStdModHTML:function(x){var w=this._findStdModSection(x),u,Y;if(w){u=w.get(M).invoke(l);Y=w.get(G);for(var L=Y.size()-1;L>=0;L--){var v=u.get(d);if(v){u.insertBefore(Y.item(L),v);}else{u.appendChild(Y.item(L));}}return u;}return null;},_getStdModContent:function(L){return(this[L+T])?this[L+T].get(G):null;},setStdModContent:function(u,Y,L){this.set(u+i,Y,{stdModPosition:L});},getStdModNode:function(L){return this[L+T]||null;},fillHeight:function(u){if(u){var y=this.get(p),AA=[this.headerNode,this.bodyNode,this.footerNode],Y,AB=0,AC=0,x=0,w=false;for(var z=0,v=AA.length;z<v;z++){Y=AA[z];if(Y){if(Y!==u){AC+=this._getPreciseHeight(Y);}else{w=true;}}}if(w){if(W.ie||W.opera){u.setStyle(Z,0+t);}AB=parseInt(y.getComputedStyle(Z),10);if(D.isNumber(AB)){x=AB-AC;if(x>=0){u.setStyle(Z,x+t);}var L=this.get(U).get(g);if(L!=AB){x=x-(L-AB);u.setStyle(Z,x+t);}}}}}};A.WidgetStdMod=s;},"3.0.0",{requires:["widget"]});
|
||||
21
include/javascript/yui3/build/widget/widget-stdmod.js
vendored
Executable file
21
include/javascript/yui3/build/widget/widget-stdmod.js
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('widget-stdmod',function(Y){var L=Y.Lang,Node=Y.Node,NodeList=Y.NodeList,UA=Y.UA,Widget=Y.Widget,EMPTY="",HD="hd",BD="bd",FT="ft",HEADER="header",BODY="body",FOOTER="footer",FILL_HEIGHT="fillHeight",STDMOD="stdmod",PX="px",NODE_SUFFIX="Node",CONTENT_SUFFIX="Content",INNER_HTML="innerHTML",FIRST_CHILD="firstChild",CHILD_NODES="childNodes",CREATE_DOCUMENT_FRAGMENT="createDocumentFragment",OWNER_DOCUMENT="ownerDocument",CONTENT_BOX="contentBox",BOUNDING_BOX="boundingBox",HEIGHT="height",OFFSET_HEIGHT="offsetHeight",AUTO="auto",HeaderChange="headerContentChange",BodyChange="bodyContentChange",FooterChange="footerContentChange",FillHeightChange="fillHeightChange",HeightChange="HeightChange",ContentUpdate="contentUpdate",RENDERUI="renderUI",BINDUI="bindUI",SYNCUI="syncUI",UI=Y.Widget.UI_SRC;function StdMod(config){this._stdModNode=this.get(CONTENT_BOX);Y.after(this._renderUIStdMod,this,RENDERUI);Y.after(this._bindUIStdMod,this,BINDUI);Y.after(this._syncUIStdMod,this,SYNCUI);}
|
||||
StdMod.HEADER=HEADER;StdMod.BODY=BODY;StdMod.FOOTER=FOOTER;StdMod.AFTER="after";StdMod.BEFORE="before";StdMod.REPLACE="replace";var STD_HEADER=StdMod.HEADER,STD_BODY=StdMod.BODY,STD_FOOTER=StdMod.FOOTER,AFTER=StdMod.AFTER,BEFORE=StdMod.BEFORE;StdMod.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:StdMod.BODY,validator:function(val){return this._validateFillHeight(val);}}};StdMod.HTML_PARSER={headerContent:function(contentBox){return this._parseStdModHTML(STD_HEADER);},bodyContent:function(contentBox){return this._parseStdModHTML(STD_BODY);},footerContent:function(contentBox){return this._parseStdModHTML(STD_FOOTER);}};StdMod.SECTION_CLASS_NAMES={header:Widget.getClassName(HD),body:Widget.getClassName(BD),footer:Widget.getClassName(FT)};StdMod.TEMPLATES={header:'<div class="'+StdMod.SECTION_CLASS_NAMES[STD_HEADER]+'"></div>',body:'<div class="'+StdMod.SECTION_CLASS_NAMES[STD_BODY]+'"></div>',footer:'<div class="'+StdMod.SECTION_CLASS_NAMES[STD_FOOTER]+'"></div>'};StdMod.prototype={_syncUIStdMod:function(){this._uiSetStdMod(STD_HEADER,this.get(STD_HEADER+CONTENT_SUFFIX));this._uiSetStdMod(STD_BODY,this.get(STD_BODY+CONTENT_SUFFIX));this._uiSetStdMod(STD_FOOTER,this.get(STD_FOOTER+CONTENT_SUFFIX));this._uiSetFillHeight(this.get(FILL_HEIGHT));},_renderUIStdMod:function(){this._stdModNode.addClass(Widget.getClassName(STDMOD));},_bindUIStdMod:function(){this.after(HeaderChange,this._afterHeaderChange);this.after(BodyChange,this._afterBodyChange);this.after(FooterChange,this._afterFooterChange);this.after(FillHeightChange,this._afterFillHeightChange);this.after(HeightChange,this._fillHeight);this.after(ContentUpdate,this._fillHeight);},_afterHeaderChange:function(e){if(e.src!==UI){this._uiSetStdMod(STD_HEADER,e.newVal,e.stdModPosition);}},_afterBodyChange:function(e){if(e.src!==UI){this._uiSetStdMod(STD_BODY,e.newVal,e.stdModPosition);}},_afterFooterChange:function(e){if(e.src!==UI){this._uiSetStdMod(STD_FOOTER,e.newVal,e.stdModPosition);}},_afterFillHeightChange:function(e){this._uiSetFillHeight(e.newVal);},_validateFillHeight:function(val){return!val||val==StdMod.BODY||val==StdMod.HEADER||val==StdMod.FOOTER;},_uiSetFillHeight:function(fillSection){var fillNode=this.getStdModNode(fillSection);var currNode=this._currFillNode;if(currNode&&fillNode!==currNode){currNode.setStyle(HEIGHT,EMPTY);}
|
||||
if(fillNode){this._currFillNode=fillNode;}
|
||||
this._fillHeight();},_fillHeight:function(){if(this.get(FILL_HEIGHT)){var height=this.get(HEIGHT);if(height!=EMPTY&&height!=AUTO){this.fillHeight(this._currFillNode);}}},_uiSetStdMod:function(section,content,where){if(content){var node=this.getStdModNode(section)||this._renderStdMod(section);if(content instanceof Node||content instanceof NodeList){this._addNodeRef(node,content,where);}else{this._addNodeHTML(node,content,where);}
|
||||
this.set(section+CONTENT_SUFFIX,this._getStdModContent(section),{src:UI});this.fire(ContentUpdate);}},_renderStdMod:function(section){var contentBox=this.get(CONTENT_BOX),sectionNode=this._findStdModSection(section);if(!sectionNode){sectionNode=this._getStdModTemplate(section);}
|
||||
this._insertStdModSection(contentBox,section,sectionNode);this[section+NODE_SUFFIX]=sectionNode;return this[section+NODE_SUFFIX];},_insertStdModSection:function(contentBox,section,sectionNode){var fc=contentBox.get(FIRST_CHILD);if(section===STD_FOOTER||!fc){contentBox.appendChild(sectionNode);}else{if(section===STD_HEADER){contentBox.insertBefore(sectionNode,fc);}else{var footer=this[STD_FOOTER+NODE_SUFFIX];if(footer){contentBox.insertBefore(sectionNode,footer);}else{contentBox.appendChild(sectionNode);}}}},_getStdModTemplate:function(section){return Node.create(StdMod.TEMPLATES[section],this._stdModNode.get(OWNER_DOCUMENT));},_addNodeHTML:function(node,html,where){if(where==AFTER){node.set(INNER_HTML,node.get(INNER_HTML)+html);}else if(where==BEFORE){node.set(INNER_HTML,html+node.get(INNER_HTML));}else{node.set(INNER_HTML,html);}},_addNodeRef:function(node,children,where){var append=true,i,s;if(where==BEFORE){var n=node.get(FIRST_CHILD);if(n){if(children instanceof NodeList){for(i=children.size()-1;i>=0;--i){node.insertBefore(children.item(i),n);}}else{node.insertBefore(children,n);}
|
||||
append=false;}}else if(where!=AFTER){node.set(INNER_HTML,EMPTY);}
|
||||
if(append){if(children instanceof NodeList){for(i=0,s=children.size();i<s;++i){node.appendChild(children.item(i));}}else{node.appendChild(children);}}},_getPreciseHeight:function(node){var height=(node)?node.get(OFFSET_HEIGHT):0,getBCR="getBoundingClientRect";if(node&&node.hasMethod(getBCR)){var preciseRegion=node.invoke(getBCR);if(preciseRegion){height=preciseRegion.bottom-preciseRegion.top;}}
|
||||
return height;},_findStdModSection:function(section){return this.get(CONTENT_BOX).query("> ."+StdMod.SECTION_CLASS_NAMES[section]);},_parseStdModHTML:function(section){var node=this._findStdModSection(section),docFrag,children;if(node){docFrag=node.get(OWNER_DOCUMENT).invoke(CREATE_DOCUMENT_FRAGMENT);children=node.get(CHILD_NODES);for(var i=children.size()-1;i>=0;i--){var fc=docFrag.get(FIRST_CHILD);if(fc){docFrag.insertBefore(children.item(i),fc);}else{docFrag.appendChild(children.item(i));}}
|
||||
return docFrag;}
|
||||
return null;},_getStdModContent:function(section){return(this[section+NODE_SUFFIX])?this[section+NODE_SUFFIX].get(CHILD_NODES):null;},setStdModContent:function(section,content,where){this.set(section+CONTENT_SUFFIX,content,{stdModPosition:where});},getStdModNode:function(section){return this[section+NODE_SUFFIX]||null;},fillHeight:function(node){if(node){var boundingBox=this.get(BOUNDING_BOX),stdModNodes=[this.headerNode,this.bodyNode,this.footerNode],stdModNode,total=0,filled=0,remaining=0,validNode=false;for(var i=0,l=stdModNodes.length;i<l;i++){stdModNode=stdModNodes[i];if(stdModNode){if(stdModNode!==node){filled+=this._getPreciseHeight(stdModNode);}else{validNode=true;}}}
|
||||
if(validNode){if(UA.ie||UA.opera){node.setStyle(HEIGHT,0+PX);}
|
||||
total=parseInt(boundingBox.getComputedStyle(HEIGHT),10);if(L.isNumber(total)){remaining=total-filled;if(remaining>=0){node.setStyle(HEIGHT,remaining+PX);}
|
||||
var offsetHeight=this.get(CONTENT_BOX).get(OFFSET_HEIGHT);if(offsetHeight!=total){remaining=remaining-(offsetHeight-total);node.setStyle(HEIGHT,remaining+PX);}}}}}};Y.WidgetStdMod=StdMod;},'3.0.0',{requires:['widget']});
|
||||
36
include/javascript/yui3/build/widget/widget.js
vendored
Executable file
36
include/javascript/yui3/build/widget/widget.js
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('widget',function(Y){var L=Y.Lang,O=Y.Object,Node=Y.Node,ClassNameManager=Y.ClassNameManager,WIDGET="widget",CONTENT="content",VISIBLE="visible",HIDDEN="hidden",DISABLED="disabled",FOCUSED="focused",WIDTH="width",HEIGHT="height",EMPTY="",HYPHEN="-",BOUNDING_BOX="boundingBox",CONTENT_BOX="contentBox",PARENT_NODE="parentNode",FIRST_CHILD="firstChild",OWNER_DOCUMENT="ownerDocument",BODY="body",TAB_INDEX="tabIndex",LOCALE="locale",INIT_VALUE="initValue",ID="id",RENDER="render",RENDERED="rendered",DESTROYED="destroyed",ContentUpdate="contentUpdate",_instances={};function Widget(config){this._yuid=Y.guid(WIDGET);this._strings={};Widget.superclass.constructor.apply(this,arguments);}
|
||||
Widget._buildCfg={aggregates:["HTML_PARSER"]};Widget.NAME=WIDGET;Widget.UI_SRC="ui";var UI=Widget.UI_SRC;Widget.ATTRS={rendered:{value:false,readOnly:true},boundingBox:{value:null,setter:function(node){return this._setBoundingBox(node);},writeOnce:true},contentBox:{value:null,setter:function(node){return this._setContentBox(node);},writeOnce:true},tabIndex:{value:0,validator:function(val){return(L.isNumber(val)||L.isNull(val));}},focused:{value:false,readOnly:true},disabled:{value:false},visible:{value:true},height:{value:EMPTY},width:{value:EMPTY},moveStyles:{value:false},locale:{value:"en"},strings:{setter:function(val){return this._setStrings(val,this.get(LOCALE));},getter:function(){return this.getStrings(this.get(LOCALE));}}};Widget._NAME_LOWERCASE=Widget.NAME.toLowerCase();Widget.getClassName=function(){var args=Y.Array(arguments,0,true);args.splice(0,0,this._NAME_LOWERCASE);return ClassNameManager.getClassName.apply(ClassNameManager,args);};Widget.getByNode=function(node){var widget,bbMarker=Widget.getClassName();node=Node.get(node);if(node){node=(node.hasClass(bbMarker))?node:node.ancestor("."+bbMarker);if(node){widget=_instances[node.get(ID)];}}
|
||||
return widget||null;};Widget.HTML_PARSER={};Y.extend(Widget,Y.Base,{getClassName:function(){var args=Y.Array(arguments,0,true);args.splice(0,0,this._name);return ClassNameManager.getClassName.apply(ClassNameManager,args);},initializer:function(config){this.publish(ContentUpdate,{preventable:false});this._name=this.constructor.NAME.toLowerCase();var nodeId=this.get(BOUNDING_BOX).get(ID);if(nodeId){_instances[nodeId]=this;}
|
||||
var htmlConfig=this._parseHTML(this.get(CONTENT_BOX));if(htmlConfig){Y.aggregate(config,htmlConfig,false);}},destructor:function(){var boundingBox=this.get(BOUNDING_BOX);Y.Event.purgeElement(boundingBox,true);var nodeId=boundingBox.get(ID);if(nodeId&&nodeId in _instances){delete _instances[nodeId];}},render:function(parentNode){if(this.get(DESTROYED)){return;}
|
||||
if(!this.get(RENDERED)){this.publish(RENDER,{queuable:false,defaultFn:this._defRenderFn});parentNode=(parentNode)?Node.get(parentNode):null;if(parentNode&&!parentNode.inDoc()){parentNode=null;}
|
||||
this.fire(RENDER,{parentNode:parentNode});}
|
||||
return this;},_defRenderFn:function(e){this._renderUI(e.parentNode);this._bindUI();this._syncUI();this.renderer();this._set(RENDERED,true);},renderer:function(){this.renderUI();this.bindUI();this.syncUI();},bindUI:function(){},renderUI:function(){},syncUI:function(){},hide:function(){return this.set(VISIBLE,false);},show:function(){return this.set(VISIBLE,true);},focus:function(){return this._set(FOCUSED,true);},blur:function(){return this._set(FOCUSED,false);},enable:function(){return this.set(DISABLED,false);},disable:function(){return this.set(DISABLED,true);},_parseHTML:function(node){var schema=this._getHtmlParser(),data,val;if(schema&&node&&node.hasChildNodes()){O.each(schema,function(v,k,o){val=null;if(L.isFunction(v)){val=v.call(this,node);}else{if(L.isArray(v)){val=node.queryAll(v[0]);}else{val=node.query(v);}}
|
||||
if(val!==null&&val!==undefined){data=data||{};data[k]=val;}},this);}
|
||||
return data;},_moveStyles:function(nodeFrom,nodeTo){var styles=this.WRAP_STYLES,pos=nodeFrom.getStyle('position'),contentBox=this.get(CONTENT_BOX),xy=[0,0],h,w;if(!this.get('height')){h=contentBox.get('offsetHeight');}
|
||||
if(!this.get('width')){w=contentBox.get('offsetWidth');}
|
||||
if(pos==='absolute'){xy=nodeFrom.getXY();nodeTo.setStyles({right:'auto',bottom:'auto'});nodeFrom.setStyles({right:'auto',bottom:'auto'});}
|
||||
Y.each(styles,function(v,k){var s=nodeFrom.getStyle(k);nodeTo.setStyle(k,s);if(v===false){nodeFrom.setStyle(k,'');}else{nodeFrom.setStyle(k,v);}});if(pos==='absolute'){nodeTo.setXY(xy);}
|
||||
if(h){this.set('height',h);}
|
||||
if(w){this.set('width',w);}},_renderBox:function(parentNode){var contentBox=this.get(CONTENT_BOX),boundingBox=this.get(BOUNDING_BOX),doc=boundingBox.get(OWNER_DOCUMENT)||contentBox.get(OWNER_DOCUMENT),body;if(!boundingBox.compareTo(contentBox.get(PARENT_NODE))){if(this.get('moveStyles')){this._moveStyles(contentBox,boundingBox);}
|
||||
if(contentBox.inDoc(doc)){contentBox.get(PARENT_NODE).replaceChild(boundingBox,contentBox);}
|
||||
boundingBox.appendChild(contentBox);}
|
||||
if(!boundingBox.inDoc(doc)&&!parentNode){body=Node.get(BODY);if(body.get(FIRST_CHILD)){body.insertBefore(boundingBox,body.get(FIRST_CHILD));}else{body.appendChild(boundingBox);}}else{if(parentNode&&!parentNode.compareTo(boundingBox.get(PARENT_NODE))){parentNode.appendChild(boundingBox);}}},_setBoundingBox:function(node){return this._setBox(node,this.BOUNDING_TEMPLATE);},_setContentBox:function(node){return this._setBox(node,this.CONTENT_TEMPLATE);},_setBox:function(node,template){node=Node.get(node)||Node.create(template);var sid=Y.stamp(node);if(!node.get(ID)){node.set(ID,sid);}
|
||||
return node;},_renderUI:function(parentNode){this._renderBoxClassNames();this._renderBox(parentNode);},_renderBoxClassNames:function(){var classes=this._getClasses(),boundingBox=this.get(BOUNDING_BOX),contentBox=this.get(CONTENT_BOX),name,i;boundingBox.addClass(Widget.getClassName());for(i=classes.length-3;i>=0;i--){name=classes[i].NAME;if(name){boundingBox.addClass(ClassNameManager.getClassName(name.toLowerCase()));}}
|
||||
contentBox.addClass(this.getClassName(CONTENT));},_bindUI:function(){this.after('visibleChange',this._afterVisibleChange);this.after('disabledChange',this._afterDisabledChange);this.after('heightChange',this._afterHeightChange);this.after('widthChange',this._afterWidthChange);this.after('focusedChange',this._afterFocusedChange);this._bindDOMListeners();},_bindDOMListeners:function(){var oDocument=this.get(BOUNDING_BOX).get("ownerDocument");oDocument.on("focus",this._onFocus,this);if(Y.UA.webkit){oDocument.on("mousedown",this._onDocMouseDown,this);}},_syncUI:function(){this._uiSetVisible(this.get(VISIBLE));this._uiSetDisabled(this.get(DISABLED));this._uiSetHeight(this.get(HEIGHT));this._uiSetWidth(this.get(WIDTH));this._uiSetFocused(this.get(FOCUSED));this._uiSetTabIndex(this.get(TAB_INDEX));},_uiSetHeight:function(val){if(L.isNumber(val)){val=val+this.DEF_UNIT;}
|
||||
this.get(BOUNDING_BOX).setStyle(HEIGHT,val);},_uiSetWidth:function(val){if(L.isNumber(val)){val=val+this.DEF_UNIT;}
|
||||
this.get(BOUNDING_BOX).setStyle(WIDTH,val);},_uiSetVisible:function(val){var box=this.get(BOUNDING_BOX),sClassName=this.getClassName(HIDDEN);if(val===true){box.removeClass(sClassName);}else{box.addClass(sClassName);}},_uiSetDisabled:function(val){var box=this.get(BOUNDING_BOX),sClassName=this.getClassName(DISABLED);if(val===true){box.addClass(sClassName);}else{box.removeClass(sClassName);}},_uiSetTabIndex:function(index){var boundingBox=this.get(BOUNDING_BOX);if(L.isNumber(index)){boundingBox.set(TAB_INDEX,index);}
|
||||
else{boundingBox.removeAttribute(TAB_INDEX);}},_uiSetFocused:function(val,src){var box=this.get(BOUNDING_BOX),sClassName=this.getClassName(FOCUSED);if(val===true){box.addClass(sClassName);if(src!==UI){box.focus();}}else{box.removeClass(sClassName);if(src!==UI){box.blur();}}},_afterVisibleChange:function(evt){this._uiSetVisible(evt.newVal);},_afterDisabledChange:function(evt){this._uiSetDisabled(evt.newVal);},_afterHeightChange:function(evt){this._uiSetHeight(evt.newVal);},_afterWidthChange:function(evt){this._uiSetWidth(evt.newVal);},_afterFocusedChange:function(evt){this._uiSetFocused(evt.newVal,evt.src);},_onDocMouseDown:function(evt){if(this._hasDOMFocus){this._onFocus(evt);}},_onFocus:function(evt){var target=evt.target,boundingBox=this.get(BOUNDING_BOX),bFocused=(boundingBox.compareTo(target)||boundingBox.contains(target));this._hasDOMFocus=bFocused;this._set(FOCUSED,bFocused,{src:UI});},toString:function(){return this.constructor.NAME+"["+this._yuid+"]";},DEF_UNIT:"px",CONTENT_TEMPLATE:"<div></div>",BOUNDING_TEMPLATE:"<div></div>",WRAP_STYLES:{height:'100%',width:'100%',zIndex:false,position:'static',top:'0',left:'0',bottom:'',right:'',padding:'',margin:''},_setStrings:function(strings,locale){var strs=this._strings;locale=locale.toLowerCase();if(!strs[locale]){strs[locale]={};}
|
||||
Y.aggregate(strs[locale],strings,true);return strs[locale];},_getStrings:function(locale){return this._strings[locale.toLowerCase()];},getStrings:function(locale){locale=(locale||this.get(LOCALE)).toLowerCase();var defLocale=this.getDefaultLocale().toLowerCase(),defStrs=this._getStrings(defLocale),strs=(defStrs)?Y.merge(defStrs):{},localeSegments=locale.split(HYPHEN);if(locale!==defLocale||localeSegments.length>1){var lookup="";for(var i=0,l=localeSegments.length;i<l;++i){lookup+=localeSegments[i];var localeStrs=this._getStrings(lookup);if(localeStrs){Y.aggregate(strs,localeStrs,true);}
|
||||
lookup+=HYPHEN;}}
|
||||
return strs;},getString:function(key,locale){locale=(locale||this.get(LOCALE)).toLowerCase();var defLocale=(this.getDefaultLocale()).toLowerCase(),strs=this._getStrings(defLocale)||{},str=strs[key],idx=locale.lastIndexOf(HYPHEN);if(locale!==defLocale||idx!=-1){do{strs=this._getStrings(locale);if(strs&&key in strs){str=strs[key];break;}
|
||||
idx=locale.lastIndexOf(HYPHEN);if(idx!=-1){locale=locale.substring(0,idx);}}while(idx!=-1);}
|
||||
return str;},getDefaultLocale:function(){return this._conf.get(LOCALE,INIT_VALUE);},_strings:null,_getHtmlParser:function(){if(!this._HTML_PARSER){var classes=this._getClasses(),parser={},i,p;for(i=classes.length-1;i>=0;i--){p=classes[i].HTML_PARSER;if(p){Y.mix(parser,p,true);}}
|
||||
this._HTML_PARSER=parser;}
|
||||
return this._HTML_PARSER;}});Y.Widget=Widget;},'3.0.0',{requires:['attribute','event-focus','base','node','classnamemanager']});
|
||||
Reference in New Issue
Block a user