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