PageRenderTime 28ms CodeModel.GetById 23ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/javascripts/lib/docs/source/FlashComponent.html

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