X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fflash%2Fplugin.js;h=873fc562ac801b2c76efc0cae4ebe631542158e7;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=41814e3d67320b3bf89cf95bd2d766b046e7219b;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/flash/plugin.js b/_source/plugins/flash/plugin.js index 41814e3..873fc56 100644 --- a/_source/plugins/flash/plugin.js +++ b/_source/plugins/flash/plugin.js @@ -5,15 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { - var flashFilenameRegex = /\.swf(?:$|\?)/i, - numberRegex = /^\d+(?:\.\d+)?$/; + var flashFilenameRegex = /\.swf(?:$|\?)/i; - function cssifyLength( length ) - { - if ( numberRegex.test( length ) ) - return length + 'px'; - return length; - } + var cssifyLength = CKEDITOR.tools.cssLength; function isFlashEmbed( element ) { @@ -77,12 +71,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }); } + editor.on( 'doubleclick', function( evt ) + { + var element = evt.data.element; + + if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'flash' ) + evt.data.dialog = 'flash'; + }); + // If the "contextmenu" plugin is loaded, register the listeners. if ( editor.contextMenu ) { editor.contextMenu.addListener( function( element, selection ) { - if ( element && element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'flash' ) + if ( element && element.is( 'img' ) && !element.isReadOnly() + && element.data( 'cke-real-element-type' ) == 'flash' ) return { flash : CKEDITOR.TRISTATE_OFF }; }); }