JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / flash / dialogs / flash.js
index 4af379f..0e74e01 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -173,7 +173,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                var makeObjectTag = !editor.config.flashEmbedTagOnly,\r
                        makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly;\r
 \r
-               var previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' +\r
+               var previewPreloader,\r
+                       previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' +\r
                        '<div id="FlashPreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' +\r
                        '<div id="FlashPreviewBox"></div></div>';\r
 \r
@@ -185,6 +186,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        {\r
                                // Clear previously saved elements.\r
                                this.fakeImage = this.objectNode = this.embedNode = null;\r
+                               previewPreloader = new CKEDITOR.dom.element( 'embeded', editor.document );\r
 \r
                                // Try to detect any embed or object tag that has Flash parameters.\r
                                var fakeImage = this.getSelectedElement();\r
@@ -318,9 +320,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                        {\r
                                                                                                var dialog = this.getDialog(),\r
                                                                                                updatePreview = function( src ){\r
-\r
+                                                                                                       // Query the preloader to figure out the url impacted by based href.\r
+                                                                                                       previewPreloader.setAttribute( 'src', src );\r
                                                                                                        dialog.preview.setHtml( '<embed height="100%" width="100%" src="'\r
-                                                                                                               + CKEDITOR.tools.htmlEncode( src )\r
+                                                                                                               + CKEDITOR.tools.htmlEncode( previewPreloader.getAttribute( 'src' ) )\r
                                                                                                                + '" type="application/x-shockwave-flash"></embed>' );\r
                                                                                                };\r
                                                                                                // Preview element\r
@@ -559,15 +562,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        items :\r
                                                                        [\r
                                                                                [ editor.lang.common.notSet , ''],\r
-                                                                               [ editor.lang.image.alignLeft , 'left'],\r
-                                                                               [ editor.lang.image.alignAbsBottom , 'absBottom'],\r
-                                                                               [ editor.lang.image.alignAbsMiddle , 'absMiddle'],\r
-                                                                               [ editor.lang.image.alignBaseline , 'baseline'],\r
-                                                                               [ editor.lang.image.alignBottom , 'bottom'],\r
-                                                                               [ editor.lang.image.alignMiddle , 'middle'],\r
-                                                                               [ editor.lang.image.alignRight , 'right'],\r
-                                                                               [ editor.lang.image.alignTextTop , 'textTop'],\r
-                                                                               [ editor.lang.image.alignTop , 'top']\r
+                                                                               [ editor.lang.flash.alignLeft , 'left'],\r
+                                                                               [ editor.lang.flash.alignAbsBottom , 'absBottom'],\r
+                                                                               [ editor.lang.flash.alignAbsMiddle , 'absMiddle'],\r
+                                                                               [ editor.lang.flash.alignBaseline , 'baseline'],\r
+                                                                               [ editor.lang.flash.alignBottom , 'bottom'],\r
+                                                                               [ editor.lang.flash.alignMiddle , 'middle'],\r
+                                                                               [ editor.lang.flash.alignRight , 'right'],\r
+                                                                               [ editor.lang.flash.alignTextTop , 'textTop'],\r
+                                                                               [ editor.lang.flash.alignTop , 'top']\r
                                                                        ],\r
                                                                        setup : loadValue,\r
                                                                        commit : commitValue\r