PageSourceSearch

https://planetstoragecenter.com/scripts/0.9/SpryWidget.js

js planetstoragecenter.com collected 2026-10-08 07:25:36 UTC 13,853 bytes, 54 lines download raw bytes

1/*
2 SpryWidget.js - version 0.17 - Spry Pre-Release 1.7
3
4 Copyright (c) 2009. Adobe Systems Incorporated.
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9
10 Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 Redistributions in binary form must reproduce the above copyright notice,
13 this list of conditions and the following disclaimer in the documentation
14 and/or other materials provided with the distribution.
15 Neither the name of Adobe Systems Incorporated nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE.
30*/
31(function(){if(typeof Spry=="undefined"||!Spry.Utils||!Spry.$$)alert("SpryWidget.js requires SpryDOMUtils.js");else{if(!Spry.Widget)Spry.Widget={};Spry.Widget.setOptions=function(a,b,c){if(a&&b)for(var d in b){var e=b[d];if(!c||e!=void 0)a[d]=e}return a};Spry.Widget.onLoadDidFire=!1;Spry.Widget.onLoadQueue=[];Spry.Widget.addCallbackToOnLoadQueue=function(a,b){if(a){if(b)var c=a,a=function(){c.call(b)};Spry.Widget.onLoadQueue.push(a)}};Spry.Widget.triggerCallbackAfterOnLoad=function(a,b){Spry.Widget.onLoadDidFire?
32a.call(b):Spry.Widget.addCallbackToOnLoadQueue(a,b)};Spry.Widget.processOnLoadQueue=function(){Spry.Widget.onLoadDidFire=!0;for(var a=Spry.Widget.onLoadQueue;a.length;)a.shift()()};Spry.Utils.addLoadListener(Spry.Widget.processOnLoadQueue);Spry.Widget.Base=function(){Spry.Widget.Base.Notifier.call(this)};Spry.Widget.Base.Notifier=function(){this.observers=[];this.suppressNotifications=0};Spry.Widget.Base.Notifier.prototype.addObserver=function(a){if(a){for(var b=this.observers.length,c=0;c<b;c++)if(this.observers[c]==
33a)return;this.observers[b]=a}};Spry.Widget.Base.Notifier.prototype.removeObserver=function(a){if(a)for(var b=0;b<this.observers.length;b++)if(this.observers[b]==a){this.observers.splice(b,1);break}};Spry.Widget.Base.Notifier.prototype.notifyObservers=function(a,b){if(a&&!this.suppressNotifications)for(var c=this.observers.length,d=0;d<c;d++){var e=this.observers[d];if(e)if(typeof e=="function")e(a,this,b);else if(e[a])e[a](this,b)}};Spry.Widget.Base.Notifier.prototype.enableNotifications=function(){if(--this.suppressNotifications<
340)this.suppressNotifications=0,Spry.Debug.reportError("Unbalanced enableNotifications() call!\n")};Spry.Widget.Base.Notifier.prototype.disableNotifications=function(){++this.suppressNotifications};Spry.Widget.Base.prototype=new Spry.Widget.Base.Notifier;Spry.Widget.Base.prototype.constructor=Spry.Widget.Base;Spry.Widget.Base.getElement=function(a){return Spry.$(a)};Spry.Widget.Base.getElements=function(a){var b=typeof a;if(b=="string")return Spry.$$(a);else if(b=="object")if(a.constructor==Array){for(var b=
35[],c=0;c<a.length;c++)b=b.concat(Spry.Widget.Base.getElements(a[c]));return b}else return[a];return[]};Spry.Widget.Base.getElementsByClassName=function(a,b){var c=[];if(typeof a.getElementsByClassName!="undefined")for(var d=a.getElementsByClassName(b),e=0;e<d.length;e++)c.push(d.item(e));else for(var f=RegExp("\\b"+b+"\\b"),d=a.getElementsByTagName("*"),e=0;e<d.length;e++){var g=d.item(e);g.className.search(f)!=-1&&c.push(g)}return c};Spry.Widget.Base.prototype.getElementChildren=function(a){var b=
36[];if(a)for(a=a.firstChild;a;)a.nodeType==1&&(a.className.search(/f3s/)!=-1||a.className.search(/f9s/)!=-1||a.className.search(/position_content/)==0?b=b.concat(this.getElementChildren(a)
36):a.className!="wrap"&&b.push(a)),a=a.nextSibling;return b};Spry.Widget.Base.prototype.groupContentByDelimeter=function(a){for(var b=[],c=a.length,d=0;d<c;d++){var e=a[d],f=[];f.push(e);for(var g=a[d+1],e=e.nextSibling;e&&e!=g;)f.push(e),e=e.nextSibling;b.push(f)}return b};Spry.Widget.Base.prototype.createElement=
37function(a,b,c,d){a=document.createElement(a);if(b)a.className=b;c&&c.appendChild(a);d&&a.appendChild(d);return a};Spry.Widget.Base.prototype.sliceLeftClassStr="Left";Spry.Widget.Base.prototype.sliceRightClassStr="Right";Spry.Widget.Base.prototype.sliceCenterClassStr="Center";Spry.Widget.Base.prototype.sliceTopClassStr="Top";Spry.Widget.Base.prototype.sliceBottomClassStr="Bottom";Spry.Widget.Base.prototype.sliceFuncs={};Spry.Widget.Base.prototype.sliceFuncs["2slice"]=function(a,b,c){a=a?a:document.createElement(b);
38b=document.createElement(b);this.appendChildNodes(b,this.extractChildNodes(a));a.appendChild(b);this.addClassName(a,c+this.sliceLeftClassStr);b.className=c+this.sliceRightClassStr;a.contentContainer=b;return a};Spry.Widget.Base.prototype.sliceFuncs["3slice"]=function(a,b,c){var a=a?a:document.createElement(b),d=document.createElement(b),b=document.createElement(b);this.appendChildNodes(b,this.extractChildNodes(a));a.appendChild(d);d.appendChild(b);this.addClassName(a,c+this.sliceLeftClassStr);d.className=
39c+this.sliceRightClassStr;b.className=c+this.sliceCenterClassStr;a.contentContainer=b;return a};Spry.Widget.Base.prototype.sliceFuncs["3sliceStacked"]=function(a,b,c){var a=a?a:document.createElement(b),d=document.createElement(b),e=document.createElement(b),b=document.createElement(b);this.appendChildNodes(e,this.extractChildNodes(a));a.appendChild(d);a.appendChild(e);a.appendChild(b);this.addClassName(a,c);d.className=c+this.sliceLeftClassStr;e.className=c+this.sliceCenterClassStr;b.className=c+
40this.sliceRightClassStr;a.contentContainer=e;return a};Spry.Widget.Base.prototype.sliceFuncs["9slice"]=function(a,b,c){a||(a=document.createElement(b));this.addClassName(a,c);var d=this.create3SliceStructure(null,b,c+this.sliceTopClassStr),e=this.create3SliceStructure(null,b,c),b=this.create3SliceStructure(null,b,c+this.sliceBottomClassStr);this.appendChildNodes(e.contentContainer,this.extractChildNodes(a));a.appendChild(d);a.appendChild(e);a.appendChild(b);d=e.contentContainer;a.contentContainer=
41d;return d.rootContainer=a};Spry.Widget.Base.prototype.create3SliceStructure=Spry.Widget.Base.prototype.sliceFuncs["3slice"];Spry.Widget.Base.prototype.create9SliceStructure=Spry.Widget.Base.prototype.sliceFuncs["9slice"];Spry.Widget.Base.prototype.createOptionalSlicedStructure=function(a,b,c,d,e){var f;d||(d=this.sliceMap?this.sliceMap:{});e||(e=b);f=(d=d[c])?d:"none",d=f;a||(a=document.createElement(b));this.addClassName(a,c);b=(c||"").split(/\s+/)[0];(c=this.sliceFuncs[d])?a=c.call(this,a,e,b):
42a.contentContainer=a;return a};Spry.Widget.Base.prototype.extractChildNodes=function(a){for(var b=[];a.firstChild;){var c=a.firstChild;b.push(c);a.removeChild(c)}return b};Spry.Widget.Base.prototype.appendChildNodes=function(a,b){for(var c=0;c<b.length;c++)a.appendChild(b[c])};Spry.Widget.Base.prototype.setOptions=Spry.Widget.setOptions;Spry.Widget.Base.prototype.getOnLoadDidFire=function(){return Spry.Widget.onLoadDidFire};Spry.Widget.Base.prototype.addCallbackToOnLoadQueue=Spry.Widget.addCallbackToOnLoadQueue;
43Spry.Widget.Base.prototype.triggerCallbackAfterOnLoad=Spry.Widget.triggerCallbackAfterOnLoad;Spry.Widget.Base.prototype.getElement=Spry.Widget.Base.getElement;Spry.Widget.Base.prototype.getElements=Spry.Widget.Base.getElements;Spry.Widget.Base.prototype.addClassName=Spry.Utils.addClassName;Spry.Widget.Base.prototype.hasClassName=Spry.Utils.hasClassName;Spry.Widget.Base.prototype.removeClassName=Spry.Utils.removeClassName;Spry.Widget.Base.prototype.addEventListener=Spry.Utils.addEventListener;Spry.Widget.Base.prototype.removeEventListener=
44Spry.Utils.removeEventListener;Spry.Widget.Base.prototype.indexOf=function(a,b){if(a){if(a.indexOf)return a.indexOf(b);for(var c=0;c<a.length;c++)if(a[c]==b)return c}return-1};Spry.Widget.Base.prototype.initializePlugIns=function(a,b){var c=new Spry.Widget.Event(this);this.notifyObservers("onPreInitializePlugIns",c);if(c.performDefaultAction){for(var d=b?b:{},e=[],d=((typeof d.useDefaultPlugIns=="undefined"||d.useDefaultPlugIns)&&a?a:[]).concat(d.plugIns?d.plugIns:[]),f=0;f<d.length;f++){var g=d[f];
45this.indexOf(e,g)<0&&e.push(g)}
45this.plugIns=e=e.sort(function(a,b){return(typeof a.priority=="undefined"?50:a.priority)-(typeof b.priority=="undefined"?50:b.priority)});for(f=0;e&&f<e.length;f++)e[f].initialize&&e[f].initialize(this);this.notifyObservers("onPostInitializePlugIns",c)}};Spry.Widget.Base.prototype.getClientPosition=function(a){var b={};b.x=a.offsetLeft;b.y=a.offsetTop;for(a=a.offsetParent;a;)b.x+=a.offsetLeft,b.y+=a.offsetTop,a=a.offsetParent;return b};Spry.Widget.Base.prototype.getStyleProp=
46function(a,b){var c,d=Spry.Utils.camelizeString(b);try{if(a.style&&(c=a.style[d]),!c)if(document.defaultView&&document.defaultView.getComputedStyle){var e=document.defaultView.getComputedStyle(a,null);c=e?e.getPropertyValue(b):null}else a.currentStyle&&(c=a.currentStyle[d])}catch(f){}return c=="auto"?null:c};Spry.Widget.Base.prototype.makePositioned=function(a){var b=this.getStyleProp(a,"position");if(!b||b=="static")if(a.style.position="relative",window.opera)a.style.top=0,a.style.left=0};Spry.Widget.Base.prototype.clearIEAlphaFilter=
47function(a){var b=a.style.filter;b?(b=b.replace(/alpha\([^\)]*\)/,""),b=b.replace(/^\s+|\s+$/,""),a.style.filter=b):b="";return b};Spry.Widget.Base.prototype.setOpacity=function(a,b){a.style.opacity=""+b;var c=this.clearIEAlphaFilter(a);c&&(c+=" ");a.style.filter=c+"alpha(opacity="+b*100+")"};Spry.Widget.Event=function(a,b){this.widget=a;Spry.Widget.setOptions(this,b);this.performDefaultAction=!0};Spry.Widget.Event.prototype.preventDefault=function(){this.performDefaultAction=!1};Spry.Widget.Button=
48function(a,b){Spry.Widget.Base.call(this);this.element=Spry.$$(a)[0];this.setOptions(this,Spry.Widget.Button.config);this.setOptions(this,b);var c=this;this.addEventListener(this.element,"mousedown",function(a){return c.handleMouseDown(a)},!1);this.addEventListener(this.element,"mouseover",function(a){return c.handleMouseOver(a)},!1);this.addEventListener(this.element,"mouseout",function(a){return c.handleMouseOut(a)},!1);if(this.focusElement=this.getFocusElement(this.element))this.addEventListener(this.focusElement,
49"focus",function(a){return c.handleFocus(a)},!1),this.addEventListener(this.focusElement,"blur",function(a){return c.handleBlur(a)},!1),this.addEventListener(this.focusElement,"keydown",function(a){return c.handleKeyDown(a)},!1);this.addEventListener(this.element,"click",function(){return!1},!1);this.mouseUpCallback=function(a){return c.handleMouseUp(a)}};Spry.Widget.Button.config={disabled:!1,mouseOutCancelsClick:!0,onclick:null,downClass:"ButtonDown",hoverClass:"ButtonHover",disabledClass:"ButtonDisabled",
50focusedClass:"ButtonFocused"};Spry.Widget.Button.prototype=new Spry.Widget.Base;Spry.Widget.Button.prototype.constructor=Spry.Widget.Button;Spry.Widget.Button.prototype.handleMouseDown=function(a){if(this.disabled)return!1;this.addClassName(this.element,this.downClass);this.addEventListener(document,"mouseup",this.mouseUpCallback,!0);this.notifyObservers("onButtonDown",{event:a})};Spry.Widget.Button.prototype.handleMouseUp=function(a){if(this.disabled)return!1;this.removeClassName(this.element,this.downClass);
51this.removeEventListener(document,"mouseup",this.mouseUpCallback,!0);if(this.onclick)this.onclick(a);this.notifyObservers("onButtonUp");this.notifyObservers("onButtonClick")};Spry.Widget.Button.prototype.handleMouseOver=function(){if(this.disabled)return!1;this.addClassName(this.element,this.hoverClass);this.notifyObservers("onButtonEnter")};Spry.Widget.Button.prototype.handleMouseOut=function(){if(this.disabled)return!1;var a=this.element;this.removeClassName(a,this.hoverClass);this.mouseOutCancelsClick&&
52(this.removeClassName(a,this.downClass),this.removeEventListener(document,"mouseup",this.mouseUpCallback,!0));this.notifyObservers("onButtonExit")};Spry.Widget.Button.prototype.handleFocus=function(){if(this.disabled)return!1;this.addClassName(this.element,this.focusedClass);this.notifyObservers("onButtonFocused")};Spry.Widget.Button.prototype.handleBlur=function(){if(this.disabled)return!1;this.removeClassName(this.element,this.focusedClass);this.notifyObservers("onButtonBlur")};Spry.Widget.Button.prototype.handleKeyDown=
53function(a){if(this.disabled)return!1;this.notifyObservers("onButtonKeyDown",{event:a,element:this.element})};Spry.Widget.Button.prototype.getFocusElement=function(a){var b=null,c=null,d=null;Spry.Utils.preorderTraversal(a,function(b){if(b.nodeType==1){if(a.attributes.getNamedItem("tabindex"))return c=b,!0;!d&&b.nodeName.toLowerCase()=="a"&&(d=b)}return!1});c?b=c:d&&(b=d);return b};Spry.Widget.Button.prototype.disable=function(){this.disabled=!0;this.removeClassName(this.element,this.downClass);this.removeClassName(this.element,
54this.hoverClass);this.addClassName(this.element,this.disabledClass);this.removeEventListener(document,"mouseup",this.mouseUpCallback,!0)};Spry.Widget.Button.prototype.enable=function(){this.disabled=!1;this.removeClassName(this.element,this.disabledClass)};Spry.Widget.Button.prototype.focus=function(){if(this.disabled)return!1;this.focusElement&&this.focusElement.focus()}}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.