You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
5.7 KiB

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