/************************************************************************* Copyright (c) 2011. Adobe Systems Incorporated. All rights reserved. You may distribute this file in source code or object code, solely in unmodified form, and in all cases only as incorporated into your own application created with the Adobe software. 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. **************************************************************************/ /************************************************************************* AdobePatentID="B1316" AdobePatentID="B1318" edge.authoring.0.0.1.min.js - version 0.1.1 **************************************************************************/ (function(g,i){function o(a){return i.compositionDefns[a]}var u=i.triggerDict={element:function(a,b,c){a&&(b=="document"?this.$(document).bind(c,a):this.$(b).bind(c,a))},timeline:function(a,b,c){/^on[A-Z]/.test(b)&&(b=b.charAt(2).toLowerCase()+timeline.subStr(3));if(a&&b){var d=this.getTimelineData(b),v=d.toState,d=d.fromState,f={};f[c]=a;this._getTimeline(b,v,d).addObserver(f)}}},m=i.Symbol=function(a,b){i.Notifier.call(this);this.widgetEventPrefix="edgeSym_";this.element=null;this.options={data:null, initialState:null};this.states={};this.timelines={};this.timelineCache={};this.timelineStateMap={};this.defaultBaseState="Base State";this.baseState=null;this._init(a,b)};i.symbol=m;var t=i.PropertyTween,r=t.substituteParameters;m._substituteParameters=r;var p,s=i.symbolDefns={};i.baseDataName="edgeBaseData";g.extend(m.prototype,i.Notifier.prototype,{constructor:m,_init:function(a,b){if(b&&(g.extend(this.options,b),g.isArray(b.observers)&&b.observers.length))for(var c=b.observers.length,d=0;d0&&this._processNestedSymbolInstances(h);if(this.idLookup)for(var j in this.idLookup)this.idLookup.hasOwnProperty(j)&&(g(j).data("originalId",this.idLookup[j]),g(j).data("symParent",this))}}if(b){if((j=this._getParentSymbol())&&j.options.data.actors&&j.options.data.actors.instance_parameters){e=j.options.data.actors.instance_parameters;f=e.length; for(d=0;dw))q=l,w=l.position+l.duration;q&&q.tween.length>4&&q.tween[4]&&q.tween[4].copyToState&&(q.tween[3]=t)}}b={};if(c)for(m in c=this._getStateData(c),c)if(c.hasOwnProperty(m)){n= c[m];o=h[m];z=n.length;for(p=0;p4&&q.tween[4]&&q.tween[4].copyFromState,q.tween.length<4||!q.tween[4]||typeof q.tween[4].fromValue=="undefined"||l))q.tween[4]||(q.tween[4]={}),q.tween[4].fromValue=t}}if(c)for(j in g)if(g.hasOwnProperty(j)&&g[j][0].position>0&&(c=b[j],c!==void 0))l=i.cloneJSONObject(g[j][0]), l.tween[3]=l.tween[4].fromValue=c,c=l.position,l.position=0,l.duration=c,e.push(l);e=this._createTimelineFromData(e);this._restoreObservers(a,e);return this.timelineCache[d]=e},_createTimelineFromData:function(a){for(var b=jQuery.Edge.Timeline.createTimeline(),c=a.length,d=0;d=d&&this._ensureToState(a,c)}},_rememberBaseStateForTimeline:function(a){if(a&& (a=this.getTimelineData(a)))for(var a=a.timeline,b=a.length,c=0;c=Math.min(n,f)&&d<=Math.max(n,f))return i;n=f}}}return-1},deleteInstance:function(a){var a= a||{},b;this.composition&&(b=this.composition.getSymbolInstances());if(b){var c=this._createEvent({});this.notifyObservers("onPreRemove",c);if(c.performDefaultAction){var d;if(this.aSymbolInstances){var e=this.aSymbolInstances.length;for(d=0;d=0;d--)b[d]==this&&b.splice(d,1);this.element=null;this.notifyObservers("onPostRemove", c)}}},$:function(a){var b=a;typeof a==="string"&&(b=r(a,this.parameterValues));return g(b)}});m.get=function(a){return g(a).data("edgeSymbol")};m.getDefaultEasing=function(){return i.TimelineObject.defaultEasing};m.bindTriggerAction=function(a,b,c,d,e){(a=i.getCompositionSymbolDefns(a)[b])?(c=a.timelines[c].timeline)?(d={trigger:[e,null],position:d,duration:0,id:i.Symbol._makeUniqueID()},c.push(d)):i.logError("$.Edge.Symbol.bindTriggerAction: timeline not found"):i.logError("$.Edge.Symbol.bindTriggerAction: symbol not found")}; var y=function(a,b,c,d,e,f,g){var k=i.getCompositionSymbolDefns(a)[b];if(k){if(!k.actions)k.actions={};g=m._makeUniqueID();k.actions[g]=e;if(!k.bindings)k.bindings=[];c=[[f,c,d],g];k.bindings.push(c);if(null!=i.compositions&&(a=i.compositions[a],null!=a&&(a=a.getSymbolInstances(),null!=a))){k=a.length;for(f=0;f0;)a="eid_"+x++;return a};m._makeUniqueID=A;i.compositions=i.compositions||{};i.compositionDefns=i.compositionDefns||{};i.compositionReadyHandler=i.compositionReadyHandler||{};i.registerCompositionDefn=function(a,b){if(a&&a.length>0&&!i.compositionDefns[a])for(symbolName in i.compositionDefns[a]= b,b)b[symbolName].typeName=symbolName};i.getCompositionSymbolDefns=o;i.getComposition=function(a){if(a)return i.compositions[a]};i.registerCompositionReadyHandler=function(a,b,c){c=c||{};if((!window.edge_authoring_mode||c._tool||window.edge_remote_authoring)&&a&&b)i.compositions[a]?i.compositions.ready(b):(i.compositionReadyHandler[a]=i.compositionReadyHandler[a]||[],i.compositionReadyHandler[a].push(b))};var B=i.Composition=function(a,b,c){c=c||{};if(!window.edge_authoring_mode||c._tool||window.edge_remote_authoring){i.Notifier.call(this); var d,v=!1;d=0;var f,h,k=this,c=i.compositionReadyHandler[a],j=this.symbolDefns=o(a);this.symbolInstances=[];this.compId=a;this.imageRequestCount=0;this.imageRequestList=[];this.readyList=[];this.$loadCalled=this.readyCalled=!1;i.compositions[a]=this;g(window).load(function(){k.$loadCalled=!0;k.imageRequestCount<=0&&k.callReadyList()});e(s);for(f in b)if(d=g(b[f]),d.size()>0){v=!0;break}v||(v=g("body"),g(v).addClass(a));for(f in b)d=g(b[f]),d.each(function(){h=new m(this,{data:j[f],composition:k}); k.symbolInstances.push(h)});if(c)for(d=0;d0;)this.readyList.shift().call(); var a=jQuery.Event("loaded");a.compId=this.getCompId();jQuery(document).trigger(a)},getStage:function(){return m.get(g("."+this.getCompId()))},createSymbolInstanceChild:function(a,b,c){if(a&&b&&this.symbolInstances&&this.symbolDefns[a]){var d=[],e=this;g(b).each(function(){var b=g(this),h=document.createElement("div");(c||c===0)&&b.children().eq(c).get(0)?(b=b.children(),c<0?b.eq(c).after(h):b.eq(c).before(h)):b.append(h);if(h=new m(g(h),{data:e.symbolDefns[a],composition:e,opts:{regenerateID:!0}}))e.symbolInstances.push(h), d.push(h)});return d}},convertElementToSymbolInstance:function(a,b){if(a&&g(a)&&this.symbolInstances&&this.symbolDefns[b]){var c=new m(g(a),{data:this.symbolDefns[b],composition:this,opts:{regenerateID:!0}});this.symbolInstances.push(c);return c}},getSymbolDefSymbolInstances:function(a){var b=[];if(!this.symbolInstances)return b;if(this.symbolDefns.hasOwnProperty(a))for(var c=this.symbolInstances.length,d=0;d=e&&(c=e);c<=0&&(c=0);if(this.animation)return e=g.easing[this.easing](c/e,c,0,1,e),this.animation.compute(a,b,c*this.dScale,e,d)}});g.extend(i.Timeline.prototype,{compute:function(a,b,c,d){for(var e=this.objects,f=e.length,h=[],i={obj:null,end:0},j={obj:null,start:this.getDuration()},l=0;l=n.position&&c<=n.position+n.duration){if(n=n.compute(a,b,c-n.position,d))g.isArray(n)||(n=[n]),h=n}else if(c< n.position){if(n.position<=j.start)j.start=n.position,j.obj=n}else if(c>n.position+n.duration&&n.position+n.duration>=i.end)i.end=n.position,i.obj=n}if(!h||g.isArray(h)&&h.length===0)if(i.obj&&i.obj.animation.toValue)h=i.obj.animation.toValue;else if(j.obj&&j.obj.animation.fromValue)h=j.obj.animation.fromValue;g.isArray(h)||(h=[h]);return h}});g.extend(t.prototype,{compute:function(a,b,c,d){c=this.property;if(a!=this.elements||b!=c)return null;for(var a=this.fromValues,b=this.toValues,c=this.filter, e=a.length,f=[],g=0;g0&&g(f).css("width",b.rect[2]+"px");b.rect[3]>0&&g(f).css("height",b.rect[3]+"px");b.overflow&&(g(f).css("overflow",b.overflow),(b.overflow=="hidden"||b.overflow=="scroll")&&g(f).css("text-overflow", "clip"));b.br&&(b.br.length==1?g(f).css("border-radius",b.br[0]+"px"):(g(f).css("border-top-left-radius",b.br[0]),g(f).css("border-top-right-radius",b.br[1]),g(f).css("border-bottom-right-radius",b.br[2]),g(f).css("border-bottom-left-radius",b.br[3])));if(b.tf){for(var a=[],h=[[3,0],[3,0],[2,0],[3,1],[2,"50%"]],k=0;k=0&&c.children&&d 0){b={};for(c=0;c=0){var c=a.search(/\}/);if(c>b)return b=a.slice(b+2, c),e[b]}}return a}function y(e,a){var b=e.obj.graphics,c=e.params;b.clear();var d="rgba(0,0,0,0)";e.def.fill&&typeof e.def.fill=="object"&&(d=e.def.fill[0]);b.beginFill(d).drawRect(0,0,s(c,e.def.rect[2]),s(c,e.def.rect[3]));for(var g in e.children)e.children.hasOwnProperty(g)&&y(a.children[g])}var x,A,B;x=function(e,a){if(e.type)e.t=e.type;if(e.t)e.t=e.t.toLowerCase();e.type=e.t;e.children?e.c=e.children:e.children=e.c;e.rect?e.r=e.rect:e.rect=e.r;if(!e.rect)e.rect=[];for(;e.rect.length<4;)e.rect[e.rect.length]= 0;e.borderRadius?e.br=e.borderRadius:e.borderRadius=e.br;e.shape?e.sh=e.shape:e.shape=e.sh;e.transform?e.tf=e.transform:e.transform=e.tf;if(e.tf){for(;e.tf.length<5;)e.tf[e.tf.length]=0;for(;e.transform.length<8;)e.tf[e.tf.length]=1}e.opacity?e.o=e.opacity:e.opacity=e.o;if(e.stroke)e.s=e.stroke;e.stroke=e.s;if(e.fill)e.f=e.fill;if(e.f&&a){var b=a[e.f];if(b)e.f=b}e.fill=e.f};return{stageLookup:{},nodeLookup:{},nodeSymbolInstanceLookup:{},DOMNodeSeek:function(){},DOMNodeReset:function(){},DOMNodeStarted:function(){}, DOMNodeCompleted:function(){},renderDOM:function(e,a,b,c,d,g){window.EdgeScreenProfile={name:"detected",dim:[screen.width,screen.height]};o.nodeLookup={};var f;for(f=0;f