Browse Source

Feature #2132 - "asciisvg" plug-in: The script ASCIIMathML.js is linked to the document automaticaly, when it is needed.

Ivan Tcholakov 14 years ago
parent
commit
b0a9951027

+ 262 - 268
main/inc/lib/fckeditor/editor/plugins/asciimath/fckplugin.js

@@ -12,7 +12,7 @@
 // Loading the ASCIIMathML.js if it is not present yet.
 if ( typeof AMprocessNode != 'function' )
 {
-	LoadScript( FCKConfig.ScriptASCIIMathML ) ;
+    LoadScript( FCKConfig.ScriptASCIIMathML ) ;
 }
 
 // Settings for ASCIIMathML.js
@@ -35,25 +35,25 @@ FCKToolbarItems.RegisterItem( 'asciimath', oAsciiMathItem ) ;
 
 // Context menu support.
 FCK.ContextMenu.RegisterListener( {
-	AddItems : function( menu, tag, tagName )
-	{
-		if ( FCKAsciiMath.FindFormulaContainer( tag ) )
-		{
-			menu.AddSeparator() ;
-			menu.AddItem( 'asciimath', FCKLang['DlgAsciiMath'], oAsciiMathItem.IconPath ) ;
-		}
-	}}
+    AddItems : function( menu, tag, tagName )
+    {
+        if ( FCKAsciiMath.FindFormulaContainer( tag ) )
+        {
+            menu.AddSeparator() ;
+            menu.AddItem( 'asciimath', FCKLang['DlgAsciiMath'], oAsciiMathItem.IconPath ) ;
+        }
+    }}
 );
 
 // Double-click support.
 FCK.RegisterDoubleClickHandler(
-	function ( tag )
-	{
-		if ( FCKAsciiMath.FindFormulaContainer( tag ) )
-		{
-			FCKCommands.GetCommand( 'asciimath' ).Execute() ;
-		}
-	}, null
+    function ( tag )
+    {
+        if ( FCKAsciiMath.FindFormulaContainer( tag ) )
+        {
+            FCKCommands.GetCommand( 'asciimath' ).Execute() ;
+        }
+    }, null
 ) ;
 
 // This object implements some AsciiMath related operations.
@@ -61,293 +61,287 @@ var FCKAsciiMath = new Object() ;
 
 FCKAsciiMath.GetSearchElementFromSelection = function()
 {
-	var oSelectedContainer = FCK.Selection.GetSelectedElement() ;
-	if ( ! oSelectedContainer )
-	{
-		oSelectedContainer = FCK.Selection.GetBoundaryParentElement( true ) ;
-	}
-	return oSelectedContainer ;
+    var oSelectedContainer = FCK.Selection.GetSelectedElement() ;
+    if ( ! oSelectedContainer )
+    {
+        oSelectedContainer = FCK.Selection.GetBoundaryParentElement( true ) ;
+    }
+    return oSelectedContainer ;
 }
 
 FCKAsciiMath.IsFormula = function( node )
 {
-	if ( node && node.nodeName && node.nodeName.IEquals( 'span' ) && node.className && node.className.indexOf( 'AM' ) != -1 )
-	{
-		return true ;
-	}
-	return false ;
+    if ( node && node.nodeName && node.nodeName.IEquals( 'span' ) && node.className && node.className.indexOf( 'AM' ) != -1 )
+    {
+        return true ;
+    }
+    return false ;
 }
 
 FCKAsciiMath.FindFormulaContainer = function( node )
 {
-	var current_node = node ;
-	while ( current_node )
-	{
-		if ( !current_node.nodeName )
-		{
-			continue ;
-		}
-		if ( current_node.nodeName.IEquals( 'body', 'table' ) )
-		{
-			break ;
-		}
-		if ( FCKAsciiMath.IsFormula( current_node ) )
-		{
-			return current_node ;
-		}
-		if ( current_node.parentNode )
-		{
-			current_node = current_node.parentNode ;
-		}
-		else
-		{
-			break ;
-		}
-	}
-	return null ;
+    var current_node = node ;
+    while ( current_node )
+    {
+        if ( !current_node.nodeName )
+        {
+            continue ;
+        }
+        if ( current_node.nodeName.IEquals( 'body', 'table' ) )
+        {
+            break ;
+        }
+        if ( FCKAsciiMath.IsFormula( current_node ) )
+        {
+            return current_node ;
+        }
+        if ( current_node.parentNode )
+        {
+            current_node = current_node.parentNode ;
+        }
+        else
+        {
+            break ;
+        }
+    }
+    return null ;
 }
 
 FCKAsciiMath.IsParsed = function( node )
 {
-	return ( node.getElementsByTagName( 'math' )[0] || node.getElementsByTagName( 'img' )[0] ) ? true : false ;
+    return ( node.getElementsByTagName( 'math' )[0] || node.getElementsByTagName( 'img' )[0] ) ? true : false ;
 }
 
 FCKAsciiMath.GetFormula = function( node )
 {
-	var result = '' ;
-	if ( FCKAsciiMath.IsFormula( node ) )
-	{
-		if ( FCKAsciiMath.IsParsed( node ) )
-		{
-			if ( node.title )
-			{
-				result = node.title ;
-			}
-		}
-		else
-		{
-			result = node.innerHTML ;
-		}
-	}
-	if ( result ) {
-		var start = result.indexOf( '`' ) ;
-		if ( start != -1 ) {
-			start = start + 1 ;
-			var stop = result.indexOf( '`', start ) ;
-			if ( stop == -1 ) stop = result.length ;
-			result = result.substring( start, stop ) ;
-		}
-	} else {
-		result = '';
-	}
-	return result ;
+    var result = '' ;
+    if ( FCKAsciiMath.IsFormula( node ) )
+    {
+        if ( FCKAsciiMath.IsParsed( node ) )
+        {
+            if ( node.title )
+            {
+                result = node.title ;
+            }
+        }
+        else
+        {
+            result = node.innerHTML ;
+        }
+    }
+    if ( result ) {
+        var start = result.indexOf( '`' ) ;
+        if ( start != -1 ) {
+            start = start + 1 ;
+            var stop = result.indexOf( '`', start ) ;
+            if ( stop == -1 ) stop = result.length ;
+            result = result.substring( start, stop ) ;
+        }
+    } else {
+        result = '';
+    }
+    return result ;
 }
 
 FCKAsciiMath.Delete = function()
 {
-	var oSpanAM = FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) ;
-	if ( oSpanAM )
-	{
-		FCK.Selection.SelectNode( oSpanAM ) ;
-	}
-	else
-	{
-		return ;
-	}
-
-	if ( FCKBrowserInfo.IsIE )
-	{
-		// For IE: Before deletion, we have to move the selection outside the formula
-		// in order to prevent "Unspecified error".
-		var span_target = FCK.EditorDocument.createElement( 'span' ) ;
-		span_target.innerHTML = ' ' ;
-		span_target = oSpanAM.parentNode.insertBefore( span_target, oSpanAM ) ;
-		FCK.Selection.SelectNode( span_target ) ;
-	}
-
-	FCK.Selection.Delete() ;
-
-	if ( FCKBrowserInfo.IsIE )
-	{
-		FCKUndo.SaveUndoStep() ;
-		oSpanAM.parentNode.removeChild( oSpanAM ) ;
-	}
+    var oSpanAM = FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) ;
+    if ( oSpanAM )
+    {
+        FCK.Selection.SelectNode( oSpanAM ) ;
+    }
+    else
+    {
+        return ;
+    }
+
+    if ( FCKBrowserInfo.IsIE )
+    {
+        // For IE: Before deletion, we have to move the selection outside the formula
+        // in order to prevent "Unspecified error".
+        var span_target = FCK.EditorDocument.createElement( 'span' ) ;
+        span_target.innerHTML = ' ' ;
+        span_target = oSpanAM.parentNode.insertBefore( span_target, oSpanAM ) ;
+        FCK.Selection.SelectNode( span_target ) ;
+    }
+
+    FCK.Selection.Delete() ;
+
+    if ( FCKBrowserInfo.IsIE )
+    {
+        FCKUndo.SaveUndoStep() ;
+        oSpanAM.parentNode.removeChild( oSpanAM ) ;
+    }
 }
 
 var FCKAsciiMathProcessor = FCKDocumentProcessor.AppendNew() ;
 
 FCKAsciiMathProcessor.ProcessDocument = function( document )
 {
-	var spans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
-	var span ;
-	var i = spans.length - 1 ;
-	while ( i >= 0 && ( span = spans[i--] ) )
-	{
-		if ( FCKAsciiMath.IsFormula( span ) && !FCKAsciiMath.IsParsed ( span ) )
-		{
-			var clone = span.cloneNode( true ) ;
-			clone.title = span.innerHTML ;
-			AMprocessNode( clone, false ) ;
-
-			clone.setAttribute( '_fckfakelement', 'true', 0 ) ;
-			clone.setAttribute( '_fckrealelement', FCKTempBin.AddElement( span ), 0 ) ;
-
-			// To disable resizing.
-			clone.onresizestart = function()
-			{
-				FCK.EditorWindow.event.returnValue = false ;
-				return false ;
-			}
-
-			span.parentNode.insertBefore( clone, span ) ;
-			span.parentNode.removeChild( span ) ;
-		}
-	}
+    var spans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
+    var span ;
+    var i = spans.length - 1 ;
+    while ( i >= 0 && ( span = spans[i--] ) )
+    {
+        if ( FCKAsciiMath.IsFormula( span ) && !FCKAsciiMath.IsParsed ( span ) )
+        {
+            var clone = span.cloneNode( true ) ;
+            clone.title = span.innerHTML ;
+            AMprocessNode( clone, false ) ;
+
+            clone.setAttribute( '_fckfakelement', 'true', 0 ) ;
+            clone.setAttribute( '_fckrealelement', FCKTempBin.AddElement( span ), 0 ) ;
+
+            // To disable resizing.
+            clone.onresizestart = function()
+            {
+                FCK.EditorWindow.event.returnValue = false ;
+                return false ;
+            }
+
+            span.parentNode.insertBefore( clone, span ) ;
+            span.parentNode.removeChild( span ) ;
+        }
+    }
 }
 
 FCKAsciiMath.SetListeners = function()
 {
-	if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
-	{
-		return ;
-	}
-
-	if ( !FCKBrowserInfo.IsIE )
-	{
-		// On Gecko we must do this trick so the user select all the SPAN when clicking on it.
-		FCK.EditorDocument.addEventListener( 'click', function( e )
-			{
-				var formula_container = FCKAsciiMath.FindFormulaContainer( e.target ) ;
-				if ( formula_container )
-				{
-					FCKSelection.SelectNode( formula_container ) ;
-				}
-			}, true
-		) ;
-
-		// On Gecko-like browsers we have to prevent editing the parsed formula in the editor.
-		FCK.EditorDocument.addEventListener( 'keypress', function( e )
-			{
-				var key = e.keyCode || e.which ;
-				switch ( key )
-				{
-					// Only keys for moving the cursor should be enabled.
-					case 37: // Left
-					case 39: // Right
-					case 38: // Up
-					case 40: // Down
-					case 36: // Home
-					case 35: // End
-					case 33: // Pg Up
-					case 34: // Pg Down
-						break ;
-					// Deletion.
-					case 8:  // Backspace
-					case 46: // Del
-						if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
-						{
-							FCKAsciiMath.Delete() ;
-							if ( e.preventDefault ) e.preventDefault() ;
-							if ( e.stopPropagation ) e.stopPropagation() ;
-							break ;
-						}
-					default:
-						if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
-						{
-							// We are inside a formula, block edition.
-							if ( e.preventDefault ) e.preventDefault() ;
-							if ( e.stopPropagation ) e.stopPropagation() ;
-						}
-						break ;
-				}
-			}, true
-		) ;
-	}
-	else
-	{
-		FCKAsciiMath.KeyDownIE = function( e )
-		{
-			if ( !e ) e = window.event ;
-			var key = e.keyCode ;
-			switch ( key )
-			{
-				// Deletion.
-				case 8:  // Backspace
-				case 46: // Del
-					if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
-					{
-						FCKAsciiMath.Delete() ;
-						e.cancelBubble = true ;
-						break ;
-					}
-				default:
-					break ;
-			}
-		}
-
-		FCKTools.AddEventListener( FCK.EditorDocument.body, 'keydown', FCKAsciiMath.KeyDownIE ) ;
-	}
+    if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+    {
+        return ;
+    }
+
+    if ( !FCKBrowserInfo.IsIE )
+    {
+        // On Gecko we must do this trick so the user select all the SPAN when clicking on it.
+        FCK.EditorDocument.addEventListener( 'click', function( e )
+            {
+                var formula_container = FCKAsciiMath.FindFormulaContainer( e.target ) ;
+                if ( formula_container )
+                {
+                    FCKSelection.SelectNode( formula_container ) ;
+                }
+            }, true
+        ) ;
+
+        // On Gecko-like browsers we have to prevent editing the parsed formula in the editor.
+        FCK.EditorDocument.addEventListener( 'keypress', function( e )
+            {
+                var key = e.keyCode || e.which ;
+                switch ( key )
+                {
+                    // Only keys for moving the cursor should be enabled.
+                    case 37: // Left
+                    case 39: // Right
+                    case 38: // Up
+                    case 40: // Down
+                    case 36: // Home
+                    case 35: // End
+                    case 33: // Pg Up
+                    case 34: // Pg Down
+                        break ;
+                    // Deletion.
+                    case 8:  // Backspace
+                    case 46: // Del
+                        if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
+                        {
+                            FCKAsciiMath.Delete() ;
+                            if ( e.preventDefault ) e.preventDefault() ;
+                            if ( e.stopPropagation ) e.stopPropagation() ;
+                            break ;
+                        }
+                    default:
+                        if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
+                        {
+                            // We are inside a formula, block edition.
+                            if ( e.preventDefault ) e.preventDefault() ;
+                            if ( e.stopPropagation ) e.stopPropagation() ;
+                        }
+                        break ;
+                }
+            }, true
+        ) ;
+    }
+    else
+    {
+        FCKAsciiMath.KeyDownIE = function( e )
+        {
+            if ( !e ) e = window.event ;
+            var key = e.keyCode ;
+            switch ( key )
+            {
+                // Deletion.
+                case 8:  // Backspace
+                case 46: // Del
+                    if ( FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) )
+                    {
+                        FCKAsciiMath.Delete() ;
+                        e.cancelBubble = true ;
+                        break ;
+                    }
+                default:
+                    break ;
+            }
+        }
+
+        FCKTools.AddEventListener( FCK.EditorDocument.body, 'keydown', FCKAsciiMath.KeyDownIE ) ;
+    }
 }
 
 FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAsciiMath.SetListeners ) ;
 
 // We need to attach the script AsciiMathML.js after editing a full page content.
-// There is no appropriate event to be captured, so the following method has been chosen for modification.
+// There is no appropriate event to be captured, so the method FCK.UpdateLinkedField() has been chosen for modification.
+FCKAsciiMath.UpdateLinkedField = FCK.UpdateLinkedField ;
 FCK.UpdateLinkedField = function()
 {
-	// Added code.
-	if ( FCKConfig.FullPage )
-	{
-		var html = FCK.EditorDocument.getElementsByTagName('html')[0] ;
-		var head ;
-		if ( typeof html == 'object' )
-		{
-			head = html.getElementsByTagName( 'HEAD' )[0] ;
-		}
-
-		if ( typeof head == 'object' )
-		{
-			var has_formula = false ;
-			var spans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
-			var span ;
-			var i = spans.length - 1 ;
-			while ( i >= 0 && ( span = spans[i--] ) )
-			{
-				if ( FCKAsciiMath.IsFormula( span ) )
-				{
-					has_formula = true ;
-					break ;
-				}
-			}
-
-			var has_script = false ;
-			var head_data = FCK.GetData( false );
-			if ( head_data )
-			{
-				head_data = head_data.toString().match( /<head\s?[^>]*>(.*?)<\/head\s*>/i ) ;
-				if ( head_data && head_data.toString().indexOf( 'ASCIIMathML.js' ) != -1 )
-				{
-					has_script = true ;
-				}
-			}
-
-			if ( has_formula && !has_script )
-			{
-				// TODO: This fragment works in WYSIWYG mode only.
-				script = FCK.EditorDocument.createElement( 'script' ) ;
-				script.setAttribute( 'src', FCKConfig.ScriptASCIIMathML ) ;
-				script.setAttribute( 'type', 'text/javascript' ) ;
-				head.appendChild( script ) ;
-			}
-		}
-	}
-	// End added code.
-
-	var value = FCK.GetData( FCKConfig.FormatOutput ) ;
-
-	if ( FCKConfig.HtmlEncodeOutput )
-		value = FCKTools.HTMLEncode( value ) ;
-
-	FCK.LinkedField.value = value ;
-	FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ;
+    if ( FCKConfig.FullPage )
+    {
+        var html = FCK.EditorDocument.getElementsByTagName('html')[0] ;
+        var head ;
+        if ( typeof html == 'object' )
+        {
+            head = html.getElementsByTagName( 'HEAD' )[0] ;
+        }
+
+        if ( typeof head == 'object' )
+        {
+            var has_formula = false ;
+            var spans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
+            var span ;
+            var i = spans.length - 1 ;
+            while ( i >= 0 && ( span = spans[i--] ) )
+            {
+                if ( FCKAsciiMath.IsFormula( span ) )
+                {
+                    has_formula = true ;
+                    break ;
+                }
+            }
+
+            var has_script = false ;
+            var head_data = FCK.GetData( false );
+            if ( head_data )
+            {
+                head_data = head_data.toString().match( /<head[^>]*>(.*?)<\/head\s*>/i ) ;
+                if ( head_data && head_data.toString().indexOf( 'ASCIIMathML.js' ) != -1 )
+                {
+                    has_script = true ;
+                }
+            }
+
+            if ( has_formula && !has_script )
+            {
+                // TODO: This fragment works in WYSIWYG mode only.
+                script = FCK.EditorDocument.createElement( 'script' ) ;
+                script.setAttribute( 'src', FCKConfig.ScriptASCIIMathML ) ;
+                script.setAttribute( 'type', 'text/javascript' ) ;
+                head.appendChild( script ) ;
+            }
+        }
+    }
+
+    // Calling the original method FCK.UpdateLinkedField().
+    FCKAsciiMath.UpdateLinkedField() ;
 } ;

File diff suppressed because it is too large
+ 0 - 0
main/inc/lib/fckeditor/editor/plugins/asciimath/fckplugin_compressed.js


+ 51 - 0
main/inc/lib/fckeditor/editor/plugins/asciisvg/fckplugin.js

@@ -54,3 +54,54 @@ FCK.RegisterDoubleClickHandler(
         }
     }, null
 ) ;
+
+var FCKAsciiSvg = new Object() ;
+
+// We need to attach automaticaly the script AsciiMathML.js when saving a full page.
+FCKAsciiSvg.UpdateLinkedField = FCK.UpdateLinkedField ;
+FCK.UpdateLinkedField = function()
+{
+    if ( FCKConfig.FullPage )
+    {
+        var html = FCK.EditorDocument.getElementsByTagName('html')[0] ;
+        var head ;
+        var body ;
+        if ( typeof html == 'object' )
+        {
+            head = html.getElementsByTagName( 'HEAD' )[0] ;
+        }
+
+        if ( typeof head == 'object' )
+        {
+            var doc_data = FCK.GetData( false );
+            var has_graph = false ;
+            var has_script = false ;
+
+            if ( doc_data )
+            {
+                if ( doc_data.toString().match( /<embed[^>]*sscr=[^>]*>/i ) )
+                {
+                    has_graph = true ;
+                }
+
+                head_data = doc_data.toString().match( /<head[^>]*>(.*?)<\/head\s*>/i ) ;
+                if ( head_data && head_data.toString().indexOf( 'ASCIIMathML.js' ) != -1 )
+                {
+                    has_script = true ;
+                }
+            }
+
+            if ( has_graph && !has_script )
+            {
+                // TODO: This fragment works in WYSIWYG mode only.
+                script = FCK.EditorDocument.createElement( 'script' ) ;
+                script.setAttribute( 'src', FCKConfig.ScriptASCIIMathML ) ;
+                script.setAttribute( 'type', 'text/javascript' ) ;
+                head.appendChild( script ) ;
+            }
+        }
+    }
+
+    // Calling the original method FCK.UpdateLinkedField().
+    FCKAsciiSvg.UpdateLinkedField() ;
+} ;

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/asciisvg/fckplugin_compressed.js

@@ -1 +1 @@
-if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};var notifyIfNoMathML=false;var alertIfNoMathML=false;var notifyIfNoSVG=false;var alertIfNoSVG=false;var translateASCIIMath=false;FCKCommands.RegisterCommand('asciisvg',new FCKDialogCommand(FCKLang['DlgAsciiSvg'],FCKLang['DlgAsciiSvgGraphEditor'],FCKConfig.PluginsPath+'asciisvg/fck_asciisvg.html',700,600));var oAsciiSvgItem=new FCKToolbarButton('asciisvg',FCKLang['DlgAsciiSvg']);oAsciiSvgItem.IconPath=FCKConfig.PluginsPath+'asciisvg/asciisvg.gif';FCKToolbarItems.RegisterItem('asciisvg',oAsciiSvgItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (B.tagName=='IMG'&&B.getAttribute('_fckasciisvg')){A.AddSeparator();A.AddItem('asciisvg',FCKLang['DlgAsciiSvg'],oAsciiSvgItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (A.tagName=='IMG'&&A.getAttribute('_fckasciisvg')){FCKCommands.GetCommand('asciisvg').Execute();}},null);
+if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};var notifyIfNoMathML=false;var alertIfNoMathML=false;var notifyIfNoSVG=false;var alertIfNoSVG=false;var translateASCIIMath=false;FCKCommands.RegisterCommand('asciisvg',new FCKDialogCommand(FCKLang['DlgAsciiSvg'],FCKLang['DlgAsciiSvgGraphEditor'],FCKConfig.PluginsPath+'asciisvg/fck_asciisvg.html',700,600));var oAsciiSvgItem=new FCKToolbarButton('asciisvg',FCKLang['DlgAsciiSvg']);oAsciiSvgItem.IconPath=FCKConfig.PluginsPath+'asciisvg/asciisvg.gif';FCKToolbarItems.RegisterItem('asciisvg',oAsciiSvgItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (B.tagName=='IMG'&&B.getAttribute('_fckasciisvg')){A.AddSeparator();A.AddItem('asciisvg',FCKLang['DlgAsciiSvg'],oAsciiSvgItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (A.tagName=='IMG'&&A.getAttribute('_fckasciisvg')){FCKCommands.GetCommand('asciisvg').Execute();}},null);var FCKAsciiSvg={};FCKAsciiSvg.UpdateLinkedField=FCK.UpdateLinkedField;FCK.UpdateLinkedField=function(){if (FCKConfig.FullPage){var A=FCK.EditorDocument.getElementsByTagName('html')[0];var B;var C;if (typeof A=='object'){B=A.getElementsByTagName('HEAD')[0];};if (typeof B=='object'){var D=FCK.GetData(false);var E=false;var F=false;if (D){if (D.toString().match(/<embed[^>]*sscr=[^>]*>/i)){E=true;};head_data=D.toString().match(/<head[^>]*>(.*?)<\/head\s*>/i);if (head_data&&head_data.toString().indexOf('ASCIIMathML.js')!=-1){F=true;}};if (E&&!F){script=FCK.EditorDocument.createElement('script');script.setAttribute('src',FCKConfig.ScriptASCIIMathML);script.setAttribute('type','text/javascript');B.appendChild(script);}}};FCKAsciiSvg.UpdateLinkedField();};

+ 18 - 14
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@@ -1182,22 +1182,26 @@ FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
     }
     else if ( fakeClass == 'FCK__Video' || fakeClass == 'FCK__AsciiSvg' )
     {
-        var width = realElement.width ;
-        var height = realElement.height ;
-        if ( width )
-        {
-            oImg.style.width = FCKTools.ConvertHtmlSizeToStyle( width.toString() ) ;
-        }
-        if ( height )
+        try
         {
-            oImg.style.height = FCKTools.ConvertHtmlSizeToStyle( height.toString() ) ;
-        }
-        if ( realElement.style.width ) {
-            oImg.style.width = realElement.style.width ;
-        }
-        if ( realElement.style.height ) {
-            oImg.style.height = realElement.style.height ;
+            var width = realElement.width ;
+            var height = realElement.height ;
+            if ( width )
+            {
+                oImg.style.width = FCKTools.ConvertHtmlSizeToStyle( width.toString() ) ;
+            }
+            if ( height )
+            {
+                oImg.style.height = FCKTools.ConvertHtmlSizeToStyle( height.toString() ) ;
+            }
+            if ( realElement.style.width ) {
+                oImg.style.width = realElement.style.width ;
+            }
+            if ( realElement.style.height ) {
+                oImg.style.height = realElement.style.height ;
+            }
         }
+        catch ( ex ) { }
     }
 
     // Setting attributes for detection purpose.

File diff suppressed because it is too large
+ 0 - 0
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin_compressed.js


Some files were not shown because too many files changed in this diff