flash.js 20 KB

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