[svn r17623] FS#2867 - FCKEditor: Simplifying code for image-related commands.

skala
Ivan Tcholakov 16 years ago
parent b5cfa47b07
commit 4213c3692e
  1. 12
      main/inc/lib/fckeditor/editor/plugins/ImageManager/fckplugin.js
  2. 17
      main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@ -50,11 +50,7 @@
function ImageManager_doubleClick (img) {
//if ( img.tagName == 'IMG' ) FCKCommands.GetCommand( 'ImageManager' ).Execute() ;
if ( img.tagName == 'IMG' &&
!img.getAttribute( '_fckfakelement' ) &&
!img.getAttribute( '_fckflash' ) &&
!img.getAttribute( '_fckmp3' ) &&
!img.getAttribute( '_fckvideo' ) )
if ( FCK.is_real_image( img ) )
{
//FCKCommands.GetCommand( 'ImageManager' ).Execute() ;
FCKCommands.GetCommand( 'Image' ).Execute() ;
@ -70,11 +66,7 @@
if ( image )
{
// Checking whether the selected object is a real image.
if ( image.nodeName.IEquals( 'img' ) &&
!image.getAttribute( '_fckfakelement' ) &&
!image.getAttribute( '_fckflash' ) &&
!image.getAttribute( '_fckmp3' ) &&
!image.getAttribute( '_fckvideo' ) )
if ( FCK.is_real_image( image ) )
{
FCKCommands.GetCommand( 'Image' ).Execute() ;
return ;

@ -795,11 +795,7 @@ for ( var i in FCK.ContextMenu.Listeners )
FCK.ContextMenu.RegisterListener( {
AddItems : function ( menu, tag, tagName )
{
if ( tagName == 'IMG' &&
!tag.getAttribute( '_fckfakelement' ) &&
!tag.getAttribute( '_fckflash' ) &&
!tag.getAttribute( '_fckmp3' ) &&
!tag.getAttribute( '_fckvideo' ) )
if ( FCK.is_real_image( tag ) )
{
// Grouping all image-related commands at the bottom.
menu.AddSeparator();
@ -926,6 +922,17 @@ FCK.RegisterDoubleClickHandler(
**************************************************************************************
*/
// Checking whether a selected object is a real image or not.
FCK.is_real_image = function ( tag )
{
return ( tag.nodeName.IEquals( 'img' ) &&
!tag.getAttribute( '_fckfakelement' ) &&
!tag.getAttribute( '_fckflash' ) &&
!tag.getAttribute( '_fckmp3' ) &&
!tag.getAttribute( '_fckvideo' )
) ? true : false ;
} ;
// Checking for audio file reference which is to be used by a flash player.
FCK.is_audio = function ( tag )
{

Loading…
Cancel
Save