1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
* Ext JS Library 3.4.0
* Copyright(c) 2006-2011 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
<div id="cls-Ext.FlashComponent"></div>/**
* @class Ext.FlashComponent
* @extends Ext.BoxComponent
* @constructor
* @xtype flash
*/
Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
<div id="cfg-Ext.FlashComponent-flashVersion"></div>/**
* @cfg {String} flashVersion
* Indicates the version the flash content was published for. Defaults to <tt>'9.0.115'</tt>.
*/
flashVersion : '9.0.115',
<div id="cfg-Ext.FlashComponent-backgroundColor"></div>/**
* @cfg {String} backgroundColor
* The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
*/
backgroundColor: '#ffffff',
<div id="cfg-Ext.FlashComponent-wmode"></div>/**
* @cfg {String} wmode
* The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
*/
wmode: 'opaque',
<div id="cfg-Ext.FlashComponent-flashVars"></div>/**
* @cfg {Object} flashVars
* A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
*/
flashVars: undefined,
<div id="cfg-Ext.FlashComponent-flashParams"></div>/**
* @cfg {Object} flashParams
* A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
* http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
*/
flashParams: undefined,
<div id="cfg-Ext.FlashComponent-url"></div>/**
* @cfg {String} url
* The URL of the chart to include. Defaults to <tt>undefined</tt>.
*/
url: undefined,
swfId : undefined,
swfWidth: '100%',
swfHeight: '100%',
<div id="cfg-Ext.FlashComponent-expressInstall"></div>/**
* @cfg {Boolean} expressInstall
* True to prompt the user to install flash if not installed. Note that this uses
* Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
*/
expressInstall: false,
initComponent : function(){
Ext.FlashComponent.superclass.initComponent.call(this);
this.addEvents(
<div id="event-Ext.FlashComponent-initialize"></div>/**
* @event initialize
*
* @param {Chart} this
*/
'initialize'
);
},
onRender : function(){
Ext.FlashComponent.superclass.onRender.apply(this, arguments);
var params = Ext.apply({
allowScriptAccess: 'always',
bgcolor: this.backgroundColor,
wmode: this.wmode
}, this.flashParams), vars = Ext.apply({
allowedDomain: document.location.hostname,
YUISwfId: this.getId(),
YUIBridgeCallback: 'Ext.FlashEventProxy.onEvent'
}, this.flashVars);
new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
this.swf = Ext.getDom(this.id);
this.el = Ext.get(this.swf);
},
getSwfId : function(){
return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
},
getId : function(){
return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
},
onFlashEvent : function(e){
switch(e.type){
case "swfReady":
this.initSwf();
return;
case "log":
return;
}
e.component = this;
this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
},
initSwf : function(){
this.onSwfReady(!!this.isInitialized);
this.isInitialized = true;
this.fireEvent('initialize', this);
},
beforeDestroy: function(){
if(this.rendered){
swfobject.removeSWF(this.swf.id);
}
Ext.FlashComponent.superclass.beforeDestroy.call(this);
},
onSwfReady : Ext.emptyFn
});
<div id="prop-Ext.FlashComponent-EXPRESS_INSTALL_URL"></div>/**
* Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
* @static
* @type String
*/
Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
Ext.reg('flash', Ext.FlashComponent);</pre>
</body>
</html>
|