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