flash.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. ( function() {
  6. // It is possible to set things in three different places.
  7. // 1. As attributes in the object tag.
  8. // 2. As param tags under the object tag.
  9. // 3. As attributes in the embed tag.
  10. // It is possible for a single attribute to be present in more than one place.
  11. // So let's define a mapping between a sementic attribute and its syntactic
  12. // equivalents.
  13. // Then we'll set and retrieve attribute values according to the mapping,
  14. // instead of having to check and set each syntactic attribute every time.
  15. //
  16. // Reference: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
  17. var ATTRTYPE_OBJECT = 1,
  18. ATTRTYPE_PARAM = 2,
  19. ATTRTYPE_EMBED = 4;
  20. var config = {};
  21. var attributesMap = {
  22. id: [ {
  23. type: ATTRTYPE_OBJECT, name: 'id'
  24. } ],
  25. classid: [ {
  26. type: ATTRTYPE_OBJECT, name: 'classid'
  27. } ],
  28. codebase: [ {
  29. type: ATTRTYPE_OBJECT, name: 'codebase'
  30. } ],
  31. pluginspage: [ {
  32. type: ATTRTYPE_EMBED, name: 'pluginspage'
  33. } ],
  34. src: [ {
  35. type: ATTRTYPE_PARAM, name: 'movie'
  36. }, {
  37. type: ATTRTYPE_EMBED, name: 'src'
  38. }, {
  39. type: ATTRTYPE_OBJECT, name: 'data'
  40. } ],
  41. name: [ {
  42. type: ATTRTYPE_EMBED, name: 'name'
  43. } ],
  44. align: [ {
  45. type: ATTRTYPE_OBJECT, name: 'align'
  46. } ],
  47. 'class': [ {
  48. type: ATTRTYPE_OBJECT, name: 'class'
  49. }, {
  50. type: ATTRTYPE_EMBED, name: 'class'
  51. } ],
  52. width: [ {
  53. type: ATTRTYPE_OBJECT, name: 'width'
  54. }, {
  55. type: ATTRTYPE_EMBED, name: 'width'
  56. } ],
  57. height: [ {
  58. type: ATTRTYPE_OBJECT, name: 'height'
  59. }, {
  60. type: ATTRTYPE_EMBED, name: 'height'
  61. } ],
  62. hSpace: [ {
  63. type: ATTRTYPE_OBJECT, name: 'hSpace'
  64. }, {
  65. type: ATTRTYPE_EMBED, name: 'hSpace'
  66. } ],
  67. vSpace: [ {
  68. type: ATTRTYPE_OBJECT, name: 'vSpace'
  69. }, {
  70. type: ATTRTYPE_EMBED, name: 'vSpace'
  71. } ],
  72. style: [ {
  73. type: ATTRTYPE_OBJECT, name: 'style'
  74. }, {
  75. type: ATTRTYPE_EMBED, name: 'style'
  76. } ],
  77. type: [ {
  78. type: ATTRTYPE_EMBED, name: 'type'
  79. } ]
  80. };
  81. var names = [ 'play', 'loop', 'menu', 'quality', 'scale', 'salign', 'wmode', 'bgcolor', 'base', 'flashvars', 'allowScriptAccess', 'allowFullScreen' ];
  82. for ( var i = 0; i < names.length; i++ ) {
  83. attributesMap[ names[ i ] ] = [ {
  84. type: ATTRTYPE_EMBED, name: names[ i ]
  85. }, {
  86. type: ATTRTYPE_PARAM, name: names[ i ]
  87. } ];
  88. }
  89. // These attributes are "true" by default and not present in editor data (when "true").
  90. // Note that, though default value of "allowFullScreen" is "true", it is not listed here.
  91. // "allowFullScreen" is present in editor data regardless of the value (#7634).
  92. names = [ 'play', 'loop', 'menu' ];
  93. for ( i = 0; i < names.length; i++ )
  94. attributesMap[ names[ i ] ][ 0 ][ 'default' ] = attributesMap[ names[ i ] ][ 1 ][ 'default' ] = true;
  95. function isFlv(src) {
  96. var flashFilenameRegex = /\.flv(?:$|\?)/i;
  97. return flashFilenameRegex.test(src);
  98. }
  99. function loadValue( objectNode, embedNode, paramMap ) {
  100. var attributes = attributesMap[ this.id ];
  101. if ( !attributes )
  102. return;
  103. var isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox );
  104. for ( var i = 0; i < attributes.length; i++ ) {
  105. var attrDef = attributes[ i ];
  106. switch ( attrDef.type ) {
  107. case ATTRTYPE_OBJECT:
  108. if ( !objectNode )
  109. continue;
  110. if ( objectNode.getAttribute( attrDef.name ) !== null ) {
  111. var value = objectNode.getAttribute( attrDef.name );
  112. if ( isCheckbox ) {
  113. this.setValue( value.toLowerCase() == 'true' );
  114. } else {
  115. this.setValue( value );
  116. }
  117. return;
  118. } else if ( isCheckbox ) {
  119. this.setValue( !!attrDef['default'] );
  120. }
  121. break;
  122. case ATTRTYPE_PARAM:
  123. if ( !objectNode ) {
  124. continue;
  125. }
  126. if ( attrDef.name in paramMap ) {
  127. value = paramMap[ attrDef.name ];
  128. if ( isCheckbox )
  129. this.setValue( value.toLowerCase() == 'true' );
  130. else
  131. this.setValue( value );
  132. return;
  133. } else if ( isCheckbox ) {
  134. this.setValue( !!attrDef[ 'default' ] );
  135. }
  136. break;
  137. case ATTRTYPE_EMBED:
  138. if ( !embedNode )
  139. continue;
  140. if ( embedNode.getAttribute( attrDef.name ) ) {
  141. value = embedNode.getAttribute( attrDef.name );
  142. if ( isCheckbox )
  143. this.setValue( value.toLowerCase() == 'true' );
  144. else
  145. this.setValue( value );
  146. return;
  147. } else if ( isCheckbox ) {
  148. this.setValue( !!attrDef[ 'default' ] );
  149. }
  150. }
  151. }
  152. }
  153. function commitValue( objectNode, embedNode, paramMap ) {
  154. var attributes = attributesMap[ this.id ];
  155. if ( !attributes )
  156. return;
  157. var isRemove = ( this.getValue() === '' ),
  158. isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox );
  159. for ( var i = 0; i < attributes.length; i++ ) {
  160. var attrDef = attributes[ i ];
  161. switch ( attrDef.type ) {
  162. case ATTRTYPE_OBJECT:
  163. // Avoid applying the data attribute when not needed (#7733)
  164. if ( !objectNode || ( attrDef.name == 'data' && embedNode && !objectNode.hasAttribute( 'data' ) ) )
  165. continue;
  166. var value = this.getValue();
  167. if ( isRemove || isCheckbox && value === attrDef[ 'default' ] )
  168. objectNode.removeAttribute( attrDef.name );
  169. else
  170. objectNode.setAttribute( attrDef.name, value );
  171. break;
  172. case ATTRTYPE_PARAM:
  173. if ( !objectNode )
  174. continue;
  175. value = this.getValue();
  176. if ( isRemove || isCheckbox && value === attrDef[ 'default' ] ) {
  177. if ( attrDef.name in paramMap )
  178. paramMap[ attrDef.name ].remove();
  179. } else {
  180. if ( attrDef.name in paramMap )
  181. paramMap[ attrDef.name ].setAttribute( 'value', value );
  182. else {
  183. var param = CKEDITOR.dom.element.createFromHtml( '<cke:param></cke:param>', objectNode.getDocument() );
  184. param.setAttributes( { name: attrDef.name, value: value } );
  185. if ( objectNode.getChildCount() < 1 )
  186. param.appendTo( objectNode );
  187. else
  188. param.insertBefore( objectNode.getFirst() );
  189. }
  190. }
  191. break;
  192. case ATTRTYPE_EMBED:
  193. if ( !embedNode )
  194. continue;
  195. value = this.getValue();
  196. if ( isRemove || isCheckbox && value === attrDef[ 'default' ] )
  197. embedNode.removeAttribute( attrDef.name );
  198. else if (attrDef.name === 'src' && isFlv(value)) {
  199. embedNode.setAttribute(attrDef.name, config.flash_flvPlayer);
  200. embedNode.setAttribute('flashvars', 'file=' + value + '&link=' + value);
  201. } else {
  202. embedNode.setAttribute( attrDef.name, value );
  203. }
  204. }
  205. }
  206. }
  207. CKEDITOR.dialog.add( 'flash', function( editor ) {
  208. var makeObjectTag = !editor.config.flashEmbedTagOnly,
  209. makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly;
  210. config = editor.config;
  211. var previewPreloader,
  212. previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) + '<br>' +
  213. '<div id="cke_FlashPreviewLoader' + CKEDITOR.tools.getNextNumber() + '" style="display:none"><div class="loading">&nbsp;</div></div>' +
  214. '<div id="cke_FlashPreviewBox' + CKEDITOR.tools.getNextNumber() + '" class="FlashPreviewBox"></div></div>';
  215. return {
  216. title: editor.lang.flash.title,
  217. minWidth: 420,
  218. minHeight: 310,
  219. onShow: function() {
  220. // Clear previously saved elements.
  221. this.fakeImage = this.objectNode = this.embedNode = null;
  222. previewPreloader = new CKEDITOR.dom.element( 'embed', editor.document );
  223. // Try to detect any embed or object tag that has Flash parameters.
  224. var fakeImage = this.getSelectedElement();
  225. if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'flash' ) {
  226. this.fakeImage = fakeImage;
  227. var realElement = editor.restoreRealElement( fakeImage ),
  228. objectNode = null,
  229. embedNode = null,
  230. paramMap = {};
  231. if ( realElement.getName() == 'cke:object' ) {
  232. objectNode = realElement;
  233. var embedList = objectNode.getElementsByTag( 'embed', 'cke' );
  234. if ( embedList.count() > 0 )
  235. embedNode = embedList.getItem( 0 );
  236. var paramList = objectNode.getElementsByTag( 'param', 'cke' );
  237. for ( var i = 0, length = paramList.count(); i < length; i++ ) {
  238. var item = paramList.getItem( i ),
  239. name = item.getAttribute( 'name' ),
  240. value = item.getAttribute( 'value' );
  241. paramMap[ name ] = value;
  242. }
  243. } else if ( realElement.getName() == 'cke:embed' ) {
  244. embedNode = realElement;
  245. }
  246. this.objectNode = objectNode;
  247. this.embedNode = embedNode;
  248. this.setupContent( objectNode, embedNode, paramMap, fakeImage );
  249. }
  250. },
  251. onOk: function() {
  252. // If there's no selected object or embed, create one. Otherwise, reuse the
  253. // selected object and embed nodes.
  254. var objectNode = null,
  255. embedNode = null,
  256. paramMap = null;
  257. if ( !this.fakeImage ) {
  258. if ( makeObjectTag ) {
  259. objectNode = CKEDITOR.dom.element.createFromHtml( '<cke:object></cke:object>', editor.document );
  260. var attributes = {
  261. classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
  262. codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'
  263. };
  264. objectNode.setAttributes( attributes );
  265. }
  266. if ( makeEmbedTag ) {
  267. embedNode = CKEDITOR.dom.element.createFromHtml( '<cke:embed></cke:embed>', editor.document );
  268. embedNode.setAttributes( {
  269. type: 'application/x-shockwave-flash',
  270. pluginspage: 'http://www.macromedia.com/go/getflashplayer'
  271. } );
  272. if ( objectNode )
  273. embedNode.appendTo( objectNode );
  274. }
  275. } else {
  276. objectNode = this.objectNode;
  277. embedNode = this.embedNode;
  278. }
  279. // Produce the paramMap if there's an object tag.
  280. if ( objectNode ) {
  281. paramMap = {};
  282. var paramList = objectNode.getElementsByTag( 'param', 'cke' );
  283. for ( var i = 0, length = paramList.count(); i < length; i++ )
  284. paramMap[ paramList.getItem( i ).getAttribute( 'name' ) ] = paramList.getItem( i );
  285. }
  286. // A subset of the specified attributes/styles
  287. // should also be applied on the fake element to
  288. // have better visual effect. (#5240)
  289. var extraStyles = {},
  290. extraAttributes = {};
  291. this.commitContent( objectNode, embedNode, paramMap, extraStyles, extraAttributes );
  292. // Refresh the fake image.
  293. var newFakeImage = editor.createFakeElement( objectNode || embedNode, 'cke_flash', 'flash', true );
  294. newFakeImage.setAttributes( extraAttributes );
  295. newFakeImage.setStyles( extraStyles );
  296. if ( this.fakeImage ) {
  297. newFakeImage.replace( this.fakeImage );
  298. editor.getSelection().selectElement( newFakeImage );
  299. } else {
  300. editor.insertElement( newFakeImage );
  301. }
  302. },
  303. onHide: function() {
  304. if ( this.preview )
  305. this.preview.setHtml( '' );
  306. },
  307. contents: [ {
  308. id: 'info',
  309. label: editor.lang.common.generalTab,
  310. accessKey: 'I',
  311. elements: [ {
  312. type: 'vbox',
  313. padding: 0,
  314. children: [ {
  315. type: 'hbox',
  316. widths: [ '280px', '110px' ],
  317. align: 'right',
  318. children: [ {
  319. id: 'src',
  320. type: 'text',
  321. label: editor.lang.common.url,
  322. required: true,
  323. validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.flash.validateSrc ),
  324. setup: loadValue,
  325. commit: commitValue,
  326. onLoad: function() {
  327. var dialog = this.getDialog(),
  328. updatePreview = function( src ) {
  329. // Query the preloader to figure out the url impacted by based href.
  330. previewPreloader.setAttribute( 'src', src );
  331. var embed = document.createElement('embed');
  332. embed.setAttribute('allowfullscreen', 'true');
  333. embed.setAttribute('type', 'application/x-shockwave-flash');
  334. embed.setAttribute('quality', 'high');
  335. embed.setAttribute('height', '100%');
  336. embed.setAttribute('width', '100%');
  337. if (isFlv(src)) {
  338. embed.setAttribute(
  339. 'flashvars',
  340. CKEDITOR.tools.htmlEncode('file=' + src + '&link=' + src + '&height=100%&width=100%')
  341. );
  342. embed.setAttribute('src', CKEDITOR.tools.htmlEncode(config.flash_flvPlayer));
  343. } else {
  344. embed.setAttribute('src', CKEDITOR.tools.htmlEncode(previewPreloader.getAttribute('src')));
  345. }
  346. dialog.preview.setHtml(embed.outerHTML);
  347. };
  348. // Preview element
  349. dialog.preview = dialog.getContentElement( 'info', 'preview' ).getElement().getChild( 3 );
  350. // Sync on inital value loaded.
  351. this.on( 'change', function( evt ) {
  352. if ( evt.data && evt.data.value )
  353. updatePreview( evt.data.value );
  354. } );
  355. // Sync when input value changed.
  356. this.getInputElement().on( 'change', function() {
  357. updatePreview( this.getValue() );
  358. }, this );
  359. }
  360. },
  361. {
  362. type: 'button',
  363. id: 'browse',
  364. filebrowser: 'info:src',
  365. hidden: true,
  366. // v-align with the 'src' field.
  367. // TODO: We need something better than a fixed size here.
  368. style: 'display:inline-block;margin-top:14px;',
  369. label: editor.lang.common.browseServer
  370. } ]
  371. } ]
  372. },
  373. {
  374. type: 'hbox',
  375. widths: [ '25%', '25%', '25%', '25%', '25%' ],
  376. children: [ {
  377. type: 'text',
  378. id: 'width',
  379. requiredContent: 'embed[width]',
  380. style: 'width:95px',
  381. label: editor.lang.common.width,
  382. validate: CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.width ) ),
  383. setup: loadValue,
  384. commit: commitValue
  385. },
  386. {
  387. type: 'text',
  388. id: 'height',
  389. requiredContent: 'embed[height]',
  390. style: 'width:95px',
  391. label: editor.lang.common.height,
  392. validate: CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.height ) ),
  393. setup: loadValue,
  394. commit: commitValue
  395. },
  396. {
  397. type: 'text',
  398. id: 'hSpace',
  399. requiredContent: 'embed[hspace]',
  400. style: 'width:95px',
  401. label: editor.lang.flash.hSpace,
  402. validate: CKEDITOR.dialog.validate.integer( editor.lang.flash.validateHSpace ),
  403. setup: loadValue,
  404. commit: commitValue
  405. },
  406. {
  407. type: 'text',
  408. id: 'vSpace',
  409. requiredContent: 'embed[vspace]',
  410. style: 'width:95px',
  411. label: editor.lang.flash.vSpace,
  412. validate: CKEDITOR.dialog.validate.integer( editor.lang.flash.validateVSpace ),
  413. setup: loadValue,
  414. commit: commitValue
  415. } ]
  416. },
  417. {
  418. type: 'vbox',
  419. children: [ {
  420. type: 'html',
  421. id: 'preview',
  422. style: 'width:95%;',
  423. html: previewAreaHtml
  424. } ]
  425. } ]
  426. },
  427. {
  428. id: 'Upload',
  429. hidden: true,
  430. filebrowser: 'uploadButton',
  431. label: editor.lang.common.upload,
  432. elements: [ {
  433. type: 'file',
  434. id: 'upload',
  435. label: editor.lang.common.upload,
  436. size: 38
  437. },
  438. {
  439. type: 'fileButton',
  440. id: 'uploadButton',
  441. label: editor.lang.common.uploadSubmit,
  442. filebrowser: 'info:src',
  443. 'for': [ 'Upload', 'upload' ]
  444. } ]
  445. },
  446. {
  447. id: 'properties',
  448. label: editor.lang.flash.propertiesTab,
  449. elements: [ {
  450. type: 'hbox',
  451. widths: [ '50%', '50%' ],
  452. children: [ {
  453. id: 'scale',
  454. type: 'select',
  455. requiredContent: 'embed[scale]',
  456. label: editor.lang.flash.scale,
  457. 'default': '',
  458. style: 'width : 100%;',
  459. items: [
  460. [ editor.lang.common.notSet, '' ],
  461. [ editor.lang.flash.scaleAll, 'showall' ],
  462. [ editor.lang.flash.scaleNoBorder, 'noborder' ],
  463. [ editor.lang.flash.scaleFit, 'exactfit' ]
  464. ],
  465. setup: loadValue,
  466. commit: commitValue
  467. },
  468. {
  469. id: 'allowScriptAccess',
  470. type: 'select',
  471. requiredContent: 'embed[allowscriptaccess]',
  472. label: editor.lang.flash.access,
  473. 'default': '',
  474. style: 'width : 100%;',
  475. items: [
  476. [ editor.lang.common.notSet, '' ],
  477. [ editor.lang.flash.accessAlways, 'always' ],
  478. [ editor.lang.flash.accessSameDomain, 'samedomain' ],
  479. [ editor.lang.flash.accessNever, 'never' ]
  480. ],
  481. setup: loadValue,
  482. commit: commitValue
  483. } ]
  484. },
  485. {
  486. type: 'hbox',
  487. widths: [ '50%', '50%' ],
  488. children: [ {
  489. id: 'wmode',
  490. type: 'select',
  491. requiredContent: 'embed[wmode]',
  492. label: editor.lang.flash.windowMode,
  493. 'default': '',
  494. style: 'width : 100%;',
  495. items: [
  496. [ editor.lang.common.notSet, '' ],
  497. [ editor.lang.flash.windowModeWindow, 'window' ],
  498. [ editor.lang.flash.windowModeOpaque, 'opaque' ],
  499. [ editor.lang.flash.windowModeTransparent, 'transparent' ]
  500. ],
  501. setup: loadValue,
  502. commit: commitValue
  503. },
  504. {
  505. id: 'quality',
  506. type: 'select',
  507. requiredContent: 'embed[quality]',
  508. label: editor.lang.flash.quality,
  509. 'default': 'high',
  510. style: 'width : 100%;',
  511. items: [
  512. [ editor.lang.common.notSet, '' ],
  513. [ editor.lang.flash.qualityBest, 'best' ],
  514. [ editor.lang.flash.qualityHigh, 'high' ],
  515. [ editor.lang.flash.qualityAutoHigh, 'autohigh' ],
  516. [ editor.lang.flash.qualityMedium, 'medium' ],
  517. [ editor.lang.flash.qualityAutoLow, 'autolow' ],
  518. [ editor.lang.flash.qualityLow, 'low' ]
  519. ],
  520. setup: loadValue,
  521. commit: commitValue
  522. } ]
  523. },
  524. {
  525. type: 'hbox',
  526. widths: [ '50%', '50%' ],
  527. children: [ {
  528. id: 'align',
  529. type: 'select',
  530. requiredContent: 'object[align]',
  531. label: editor.lang.common.align,
  532. 'default': '',
  533. style: 'width : 100%;',
  534. items: [
  535. [ editor.lang.common.notSet, '' ],
  536. [ editor.lang.common.alignLeft, 'left' ],
  537. [ editor.lang.flash.alignAbsBottom, 'absBottom' ],
  538. [ editor.lang.flash.alignAbsMiddle, 'absMiddle' ],
  539. [ editor.lang.flash.alignBaseline, 'baseline' ],
  540. [ editor.lang.common.alignBottom, 'bottom' ],
  541. [ editor.lang.common.alignMiddle, 'middle' ],
  542. [ editor.lang.common.alignRight, 'right' ],
  543. [ editor.lang.flash.alignTextTop, 'textTop' ],
  544. [ editor.lang.common.alignTop, 'top' ]
  545. ],
  546. setup: loadValue,
  547. commit: function( objectNode, embedNode, paramMap, extraStyles, extraAttributes ) {
  548. var value = this.getValue();
  549. commitValue.apply( this, arguments );
  550. value && ( extraAttributes.align = value );
  551. }
  552. },
  553. {
  554. type: 'html',
  555. html: '<div></div>'
  556. } ]
  557. },
  558. {
  559. type: 'fieldset',
  560. label: CKEDITOR.tools.htmlEncode( editor.lang.flash.flashvars ),
  561. children: [ {
  562. type: 'vbox',
  563. padding: 0,
  564. children: [ {
  565. type: 'checkbox',
  566. id: 'menu',
  567. label: editor.lang.flash.chkMenu,
  568. 'default': true,
  569. setup: loadValue,
  570. commit: commitValue
  571. },
  572. {
  573. type: 'checkbox',
  574. id: 'play',
  575. label: editor.lang.flash.chkPlay,
  576. 'default': true,
  577. setup: loadValue,
  578. commit: commitValue
  579. },
  580. {
  581. type: 'checkbox',
  582. id: 'loop',
  583. label: editor.lang.flash.chkLoop,
  584. 'default': true,
  585. setup: loadValue,
  586. commit: commitValue
  587. },
  588. {
  589. type: 'checkbox',
  590. id: 'allowFullScreen',
  591. label: editor.lang.flash.chkFull,
  592. 'default': true,
  593. setup: loadValue,
  594. commit: commitValue
  595. } ]
  596. } ]
  597. } ]
  598. },
  599. {
  600. id: 'advanced',
  601. label: editor.lang.common.advancedTab,
  602. elements: [ {
  603. type: 'hbox',
  604. children: [ {
  605. type: 'text',
  606. id: 'id',
  607. requiredContent: 'object[id]',
  608. label: editor.lang.common.id,
  609. setup: loadValue,
  610. commit: commitValue
  611. } ]
  612. },
  613. {
  614. type: 'hbox',
  615. widths: [ '45%', '55%' ],
  616. children: [ {
  617. type: 'text',
  618. id: 'bgcolor',
  619. requiredContent: 'embed[bgcolor]',
  620. label: editor.lang.flash.bgcolor,
  621. setup: loadValue,
  622. commit: commitValue
  623. },
  624. {
  625. type: 'text',
  626. id: 'class',
  627. requiredContent: 'embed(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
  628. label: editor.lang.common.cssClass,
  629. setup: loadValue,
  630. commit: commitValue
  631. } ]
  632. },
  633. {
  634. type: 'text',
  635. id: 'style',
  636. requiredContent: 'embed{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
  637. validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
  638. label: editor.lang.common.cssStyle,
  639. setup: loadValue,
  640. commit: commitValue
  641. } ]
  642. } ]
  643. };
  644. } );
  645. } )();