// Spry.Effect.js - version 0.29 - Spry Pre-Release 1.5 Preview // // Copyright (c) 2006. Adobe Systems Incorporated. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of Adobe Systems Incorporated nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. var Spry; if (!Spry) Spry = {}; Spry.forwards = 1; // const Spry.backwards = 2; // const Spry.linearTransition = 1; // const Spry.sinusoidalTransition = 2; // const if (!Spry.Effect) Spry.Effect = {}; ////////////////////////////////////////////////////////////////////// // // Spry.Effect.Registry // ////////////////////////////////////////////////////////////////////// Spry.Effect.Registry = function() { this.effects = []; }; Spry.Effect.Registry.prototype.getRegisteredEffect = function(element, options) { var a = {}; a.element = element; a.options = options; for (var i=0; i0) { if(isFirstEntry) { camelizedString = oStringList[i]; isFirstEntry = false; } else { var s = oStringList[i]; camelizedString += s.charAt(0).toUpperCase() + s.substring(1); } } } return camelizedString; }; Spry.Effect.Utils.isPercentValue = function(value) { var result = false; try { if (value.lastIndexOf("%") > 0) result = true; } catch (e){} return result; }; Spry.Effect.Utils.getPercentValue = function(value) { var result = 0; try { result = Number(value.substring(0, value.lastIndexOf("%"))); } catch (e) {Spry.Effect.Utils.showError('Spry.Effect.Utils.getPercentValue: ' + e);} return result; }; Spry.Effect.Utils.getPixelValue = function(value) { var result = 0; try { result = Number(value.substring(0, value.lastIndexOf("px"))); } catch (e){} return result; }; Spry.Effect.Utils.getFirstChildElement = function(node) { if (node) { var childCurr = node.firstChild; while (childCurr) { if (childCurr.nodeType == 1) // Node.ELEMENT_NODE return childCurr; childCurr = childCurr.nextSibling; } } return null; }; Spry.Effect.Utils.fetchChildImages = function(startEltIn, targetImagesOut) { if(!startEltIn || startEltIn.nodeType != 1 || !targetImagesOut) return; if(startEltIn.hasChildNodes()) { var childImages = startEltIn.getElementsByTagName('img') var imageCnt = childImages.length; for(var i=0; i