]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/yui3/build/swf/swf.js
Release 6.5.0
[Github/sugarcrm.git] / include / javascript / yui3 / build / swf / swf.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add("swf",function(B){var M=B.Event,G=B.SWFDetect,I=B.Lang,H=B.UA,J=B.Node,F="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",E="application/x-shockwave-flash",D="10.0.22",A="http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random(),C="SWF.eventHandler",K={align:"",allowFullScreen:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",menu:"",name:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};function L(R,O,c){this._id=B.guid("yuiswf");var S=this._id;var W=J.one(R);var f=c["version"]||D;var Z=(f+"").split(".");var T=G.isFlashVersionAtLeast(parseInt(Z[0]),parseInt(Z[1]),parseInt(Z[2]));var Y=(G.isFlashVersionAtLeast(8,0,0));var Q=Y&&!T&&c["useExpressInstall"];var P=(Q)?A:O;var e="<object ";var U,b;var d="yId="+B.id+"&YUISwfId="+S+"&YUIBridgeCallback="+C+"&allowedDomain="+document.location.hostname;B.SWF._instances[S]=this;if(W&&(T||Q)&&P){e+='id="'+S+'" ';if(H.ie){e+='classid="'+F+'" ';}else{e+='type="'+E+'" data="'+P+'" ';}U="100%";b="100%";e+='width="'+U+'" height="'+b+'">';if(H.ie){e+='<param name="movie" value="'+P+'"/>';}for(var V in c.fixedAttributes){if(K.hasOwnProperty(V)){e+='<param name="'+V+'" value="'+c.fixedAttributes[V]+'"/>';}}for(var X in c.flashVars){var N=c.flashVars[X];if(I.isString(N)){d+="&"+X+"="+encodeURIComponent(N);}}if(d){e+='<param name="flashVars" value="'+d+'"/>';}e+="</object>";W.setContent(e);this._swf=J.one("#"+S);}else{var a={};a.type="wrongflashversion";this.publish("wrongflashversion",{fireOnce:true});this.fire("wrongflashversion",a);}}L._instances=L._instances||{};L.eventHandler=function(N,O){L._instances[N]._eventHandler(O);};L.prototype={_eventHandler:function(N){if(N.type==="swfReady"){this.publish("swfReady",{fireOnce:true});this.fire("swfReady",N);}else{if(N.type==="log"){}else{this.fire(N.type,N);}}},callSWF:function(O,N){if(!N){N=[];}if(this._swf._node[O]){return(this._swf._node[O].apply(this._swf._node,N));}else{return null;}},toString:function(){return"SWF "+this._id;}};B.augment(L,B.EventTarget);B.SWF=L;},"3.3.0");