Browse Source

Feature #2132 - "asciimath" and "asciisvg" plug-ins: Reduction of the heights of the dialogs, so they to fit on screen resolution 1024x768.

Ivan Tcholakov 14 years ago
parent
commit
c3f38c8dbb

+ 28 - 28
main/inc/lib/fckeditor/editor/plugins/asciimath/fck_asciimath.html

@@ -10,23 +10,23 @@
  *	by Free Software Foundation, Inc. (http://www.gnu.org/licenses/lgpl.html)
 -->
 <html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>AsciiMath Editor</title>
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-		<meta name="robots" content="noindex, nofollow" />
+    <head>
+        <title>AsciiMath Editor</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta name="robots" content="noindex, nofollow" />
 
-		<script type="text/javascript">
+        <script type="text/javascript">
 document.write( '<scr' + 'ipt type="text/javascript" src="' + window.parent.frameElement._DialogArguments.Editor.FCKConfig.ScriptASCIIMathML + '"><\/scr' + 'ipt>' ) ;
-		</script>
+        </script>
 
-		<script src="../../dialog/common/fck_dialog_common.js" type="text/javascript"></script>
-		<script src="fck_asciimath.js" type="text/javascript"></script>
+        <script src="../../dialog/common/fck_dialog_common.js" type="text/javascript"></script>
+        <script src="fck_asciimath.js" type="text/javascript"></script>
 
-		<script type="text/javascript">
+        <script type="text/javascript">
 document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
-		</script>
+        </script>
 
-		<style type="text/css">
+        <style type="text/css">
 
 body, td, input, textarea, select, label, button { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; }
 form { padding: 0px; margin: 0px; }
@@ -34,37 +34,37 @@ form p { margin-top: 5px; margin-bottom: 5px; }
 
 #clickInput
 {
-	width: 100%;
-	border-collapse: collapse;
-	background-color: white;
-	text-align: center;
+    width: 100%;
+    border-collapse: collapse;
+    background-color: white;
+    text-align: center;
 }
 #clickInput td
 {
-	border: 1px solid gray;
-	font-size: 1.1em;
+    border: 1px solid gray;
+    font-size: 1.1em;
 }
 
 #inputText, #outputNode
 {
-	padding: 5px;
-	background-color: white;
-	width: 98%;
-	height: 130px;
-	font-size: 1.3em;
-	border: 1px solid darkgrey;
-	overflow: auto;
+    padding: 5px;
+    background-color: white;
+    width: 98%;
+    height: 80px;
+    font-size: 1.3em;
+    border: 1px solid darkgrey;
+    overflow: auto;
 }
 
 .Hand
 {
-	cursor: pointer;
-	cursor: hand;
+    cursor: pointer;
+    cursor: hand;
 }
 
-		</style>
+        </style>
 
-	</head>
+    </head>
 <body scroll="no" style="overflow: hidden;">
 
 <!--

+ 173 - 173
main/inc/lib/fckeditor/editor/plugins/asciimath/fck_asciimath.js

@@ -54,229 +54,229 @@ var mathfontsize = "1.1em" ;
 var oSpanAM = FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) ;
 if ( oSpanAM )
 {
-	FCK.Selection.SelectNode( oSpanAM ) ;
+    FCK.Selection.SelectNode( oSpanAM ) ;
 }
 
 function LoadSelection()
 {
-	GetE( 'inputText' ).value = FCKAsciiMath.GetFormula( oSpanAM ) ;
-	Preview() ;
+    GetE( 'inputText' ).value = FCKAsciiMath.GetFormula( oSpanAM ) ;
+    Preview() ;
 }
 
 function Ok()
 {
-	if ( FCKBrowserInfo.IsIE )
-	{
-		if ( oSpanAM )
-		{
-			FCK.Selection.SelectNode( oSpanAM ) ;
-			// For IE: Before updating, 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 = '&nbsp;' ;
-			span_target = oSpanAM.parentNode.insertBefore( span_target, oSpanAM ) ;
-			FCK.Selection.SelectNode( span_target ) ;
-		}
-	}
-
-	var formula = GetE( 'inputText' ).value ;
-
-	if ( formula != '' )
-	{
-		FCK.InsertHtml( '<span class="AM">`' + formula + '`<\/span>' ) ;
-	}
-	else
-	{
-		FCK.Selection.Delete() ;
-	}
-
-	if ( FCKBrowserInfo.IsIE )
-	{
-		if ( oSpanAM )
-		{
-			FCKUndo.SaveUndoStep() ;
-			oSpanAM.parentNode.removeChild( oSpanAM ) ;
-		}
-	}
-
-	return true ;
+    if ( FCKBrowserInfo.IsIE )
+    {
+        if ( oSpanAM )
+        {
+            FCK.Selection.SelectNode( oSpanAM ) ;
+            // For IE: Before updating, 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 = '&nbsp;' ;
+            span_target = oSpanAM.parentNode.insertBefore( span_target, oSpanAM ) ;
+            FCK.Selection.SelectNode( span_target ) ;
+        }
+    }
+
+    var formula = GetE( 'inputText' ).value ;
+
+    if ( formula != '' )
+    {
+        FCK.InsertHtml( '<span class="AM">`' + formula + '`<\/span>' ) ;
+    }
+    else
+    {
+        FCK.Selection.Delete() ;
+    }
+
+    if ( FCKBrowserInfo.IsIE )
+    {
+        if ( oSpanAM )
+        {
+            FCKUndo.SaveUndoStep() ;
+            oSpanAM.parentNode.removeChild( oSpanAM ) ;
+        }
+    }
+
+    return true ;
 }
 
 window.onload = function()
 {
-	// Translate the dialog box texts.
-	oEditor.FCKLanguageManager.TranslatePage( document ) ;
+    // Translate the dialog box texts.
+    oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
-	// Initialization of the script ASCIIMathML.js.
-	init() ;
+    // Initialization of the script ASCIIMathML.js.
+    init() ;
 
-	// Load the selected element information (if any).
-	LoadSelection() ;
+    // Load the selected element information (if any).
+    LoadSelection() ;
 
-	dialog.SetAutoSize( true ) ;
+    dialog.SetAutoSize( true ) ;
 
-	// When MathML is available show the button "Show MathML code".
-	if ( !noMathML ) {
-		GetE( 'show_mathml' ).style.display = '' ;
-	}
+    // When MathML is available show the button "Show MathML code".
+    if ( !noMathML ) {
+        GetE( 'show_mathml' ).style.display = '' ;
+    }
 
-	// Activate the "OK" button.
-	dialog.SetOkButton( true ) ;
+    // Activate the "OK" button.
+    dialog.SetOkButton( true ) ;
 
-	var inputField = GetE( 'inputText' ) ;
-	inputField.focus() ;
+    var inputField = GetE( 'inputText' ) ;
+    inputField.focus() ;
 }
 
 function Set( string )
 {
-	var inputField = GetE( 'inputText' ) ;
-	inputField.value += string ;
-	Preview() ;
-	inputField.focus() ;
-	return false ;
+    var inputField = GetE( 'inputText' ) ;
+    inputField.value += string ;
+    Preview() ;
+    inputField.focus() ;
+    return false ;
 }
 
 function Clear()
 {
-	var inputField = GetE( 'inputText' ) ;
-	inputField.value = '' ;
-	Preview() ;
-	inputField.focus() ;
-	return false ;
+    var inputField = GetE( 'inputText' ) ;
+    inputField.value = '' ;
+    Preview() ;
+    inputField.focus() ;
+    return false ;
 }
 
 function Delete()
 {
-	Clear();
-	dialog.Ok();
+    Clear();
+    dialog.Ok();
 }
 
 function Preview()
 {
-	if ( GetE( 'inputText' ).value != '' )
-	{
-		var str = GetE( 'inputText' ).value ;
-		var outnode = GetE( 'outputNode' ) ;
-		var newnode = createElementXHTML( 'div' ) ;
-		newnode.setAttribute( 'id', 'outputNode' ) ;
-		outnode.parentNode.replaceChild( newnode, outnode ) ;
-		outnode = GetE( 'outputNode' ) ;
-		var n = outnode.childNodes.length ;
-		for ( var i = 0; i < n; i++ )
-		{
-			outnode.removeChild( outnode.firstChild ) ;
-		}
-		outnode.appendChild( document.createComment( '`' + str + '`' ) ) ;
-		AMprocessNode( outnode, true ) ;
-		if ( FCKLang['DlgAsciiMathShowMathML'] )
-		{
-			GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathShowMathML'] ;
-		}
-	}
-	else
-	{
-		var outnode = GetE( 'outputNode' ) ;
-		var n = outnode.childNodes.length ;
-		for ( var i = 0; i < n; i++ )
-		{
-			outnode.removeChild( outnode.firstChild ) ;
-		}
-	}
+    if ( GetE( 'inputText' ).value != '' )
+    {
+        var str = GetE( 'inputText' ).value ;
+        var outnode = GetE( 'outputNode' ) ;
+        var newnode = createElementXHTML( 'div' ) ;
+        newnode.setAttribute( 'id', 'outputNode' ) ;
+        outnode.parentNode.replaceChild( newnode, outnode ) ;
+        outnode = GetE( 'outputNode' ) ;
+        var n = outnode.childNodes.length ;
+        for ( var i = 0; i < n; i++ )
+        {
+            outnode.removeChild( outnode.firstChild ) ;
+        }
+        outnode.appendChild( document.createComment( '`' + str + '`' ) ) ;
+        AMprocessNode( outnode, true ) ;
+        if ( FCKLang['DlgAsciiMathShowMathML'] )
+        {
+            GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathShowMathML'] ;
+        }
+    }
+    else
+    {
+        var outnode = GetE( 'outputNode' ) ;
+        var n = outnode.childNodes.length ;
+        for ( var i = 0; i < n; i++ )
+        {
+            outnode.removeChild( outnode.firstChild ) ;
+        }
+    }
 }
 
 function AMnode2string( inNode, indent )
 {
-	// thanks to James Frazer for contributing an initial version of this function
-	var i, str = '' ;
-	if ( inNode.nodeType == 1 )
-	{
-		var name = inNode.nodeName.toLowerCase() ; // (IE fix)
-		str = '\r' + indent + '<' + name ;
-		for ( i = 0; i < inNode.attributes.length; i++ )
-		{
-			if ( inNode.attributes[i].nodeValue != 'italic' &&
-				inNode.attributes[i].nodeValue != '' &&  //stop junk attributes
-				inNode.attributes[i].nodeValue != 'inherit' && // (mostly IE)
-				inNode.attributes[i].nodeValue != undefined &&
-				inNode.attributes[i].nodeName[0] != '-' )
-			{
-				str += ' ' + inNode.attributes[i].nodeName + '=' + '"' + inNode.attributes[i].nodeValue + '"' ;
-			}
-		}
-		if ( name == 'math' )
-		{
-			str += ' xmlns="http://www.w3.org/1998/Math/MathML"' ;
-		}
-		str += '>' ;
-		for ( i = 0; i < inNode.childNodes.length; i++ )
-		{
-			str += AMnode2string( inNode.childNodes[i], indent + '  ' ) ;
-		}
-		if ( name != 'mo' && name != 'mi' && name != 'mn' ) str += '\r' + indent ;
-		str += '</' + name + '>' ;
-	}
-	else if( inNode.nodeType == 3 )
-	{
-		var st = inNode.nodeValue ;
-		for ( i = 0; i < st.length; i++ )
-		{
-			if ( st.charCodeAt( i ) < 32 || st.charCodeAt( i ) > 126 )
-			{
-				str += '&#' + st.charCodeAt( i ) + ';' ;
-			}
-			else if ( st.charAt(i) == '<' && indent != '  ' ) str += '&lt;' ;
-			else if ( st.charAt(i) == '>' && indent != '  ' ) str += '&gt;' ;
-			else if ( st.charAt(i) == '&' && indent != '  ' ) str += '&amp;' ;
-			else str += st.charAt( i ) ;
-		}
-	}
-	return str ;
+    // thanks to James Frazer for contributing an initial version of this function
+    var i, str = '' ;
+    if ( inNode.nodeType == 1 )
+    {
+        var name = inNode.nodeName.toLowerCase() ; // (IE fix)
+        str = '\r' + indent + '<' + name ;
+        for ( i = 0; i < inNode.attributes.length; i++ )
+        {
+            if ( inNode.attributes[i].nodeValue != 'italic' &&
+                inNode.attributes[i].nodeValue != '' &&  //stop junk attributes
+                inNode.attributes[i].nodeValue != 'inherit' && // (mostly IE)
+                inNode.attributes[i].nodeValue != undefined &&
+                inNode.attributes[i].nodeName[0] != '-' )
+            {
+                str += ' ' + inNode.attributes[i].nodeName + '=' + '"' + inNode.attributes[i].nodeValue + '"' ;
+            }
+        }
+        if ( name == 'math' )
+        {
+            str += ' xmlns="http://www.w3.org/1998/Math/MathML"' ;
+        }
+        str += '>' ;
+        for ( i = 0; i < inNode.childNodes.length; i++ )
+        {
+            str += AMnode2string( inNode.childNodes[i], indent + '  ' ) ;
+        }
+        if ( name != 'mo' && name != 'mi' && name != 'mn' ) str += '\r' + indent ;
+        str += '</' + name + '>' ;
+    }
+    else if( inNode.nodeType == 3 )
+    {
+        var st = inNode.nodeValue ;
+        for ( i = 0; i < st.length; i++ )
+        {
+            if ( st.charCodeAt( i ) < 32 || st.charCodeAt( i ) > 126 )
+            {
+                str += '&#' + st.charCodeAt( i ) + ';' ;
+            }
+            else if ( st.charAt(i) == '<' && indent != '  ' ) str += '&lt;' ;
+            else if ( st.charAt(i) == '>' && indent != '  ' ) str += '&gt;' ;
+            else if ( st.charAt(i) == '&' && indent != '  ' ) str += '&amp;' ;
+            else str += st.charAt( i ) ;
+        }
+    }
+    return str ;
 }
 
 function ShowMathML()
 {
-	if ( GetE( 'inputText' ).value != '' )
-	{
-		var math = GetE( 'outputNode' ).getElementsByTagName( 'math' )[0] ;
-		if ( math )
-		{
-			var width ;
-			if ( GetE( 'outputNode' ).offsetWidth )
-			{
-				width = GetE( 'outputNode' ).offsetWidth ;
-			}
-
-			math.parentNode.innerHTML = '<pre>' + FCKTools.HTMLEncode( AMnode2string( math, '' ) ) + '</pre>' ;
-
-			if ( width && FCKBrowserInfo.IsGecko )
-			{
-				GetE( 'outputNode' ).style.width = width + 'px' ;
-			}
-
-			if ( FCKLang['DlgAsciiMathFormulaPreview'] )
-			{
-				GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathFormulaPreview'] ;
-			}
-		}
-		else
-		{
-			Preview() ;
-		}
-	}
-	else
-	{
-		Preview() ;
-	}
+    if ( GetE( 'inputText' ).value != '' )
+    {
+        var math = GetE( 'outputNode' ).getElementsByTagName( 'math' )[0] ;
+        if ( math )
+        {
+            var width ;
+            if ( GetE( 'outputNode' ).offsetWidth )
+            {
+                width = GetE( 'outputNode' ).offsetWidth ;
+            }
+
+            math.parentNode.innerHTML = '<pre>' + FCKTools.HTMLEncode( AMnode2string( math, '' ) ) + '</pre>' ;
+
+            if ( width && FCKBrowserInfo.IsGecko )
+            {
+                GetE( 'outputNode' ).style.width = width + 'px' ;
+            }
+
+            if ( FCKLang['DlgAsciiMathFormulaPreview'] )
+            {
+                GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathFormulaPreview'] ;
+            }
+        }
+        else
+        {
+            Preview() ;
+        }
+    }
+    else
+    {
+        Preview() ;
+    }
 }
 
 // Highlighting formulas.
 
 function over(td)
 {
-	td.className = 'LightBackground Hand' ;
+    td.className = 'LightBackground Hand' ;
 }
 
 function out(td)
 {
-	td.className = 'Hand' ;
+    td.className = 'Hand' ;
 }

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

@@ -25,7 +25,7 @@ var alertIfNoSVG = false;
 var translateASCIIMath = false ;
 
 // Registering the related command.
-FCKCommands.RegisterCommand( 'asciimath', new FCKDialogCommand( FCKLang['DlgAsciiMath'], FCKLang['DlgAsciiMath'], FCKConfig.PluginsPath + 'asciimath/fck_asciimath.html', 800, 610 ) ) ;
+FCKCommands.RegisterCommand( 'asciimath', new FCKDialogCommand( FCKLang['DlgAsciiMath'], FCKLang['DlgAsciiMath'], FCKConfig.PluginsPath + 'asciimath/fck_asciimath.html', 800, 560 ) ) ;
 
 // Create the "asciimath" toolbar button.
 var oAsciiMathItem = new FCKToolbarButton( 'asciimath', FCKLang['DlgAsciiMath'] ) ;

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


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

@@ -279,7 +279,7 @@ function UpdatePreview()
     sscr = commands ;
     alignm = GetE( 'alignment' ).value ;
 
-    var preview = FCK.ResizeToFit( width, height, 680, 280 ) ;
+    var preview = FCK.ResizeToFit( width, height, 680, 230 ) ;
     var widthPreview = preview[ 0 ] ;
     var heightPreview = preview[ 1 ] ;
 

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

@@ -24,7 +24,7 @@ var alertIfNoSVG = false;
 var translateASCIIMath = false ;
 
 // Registering the related command.
-FCKCommands.RegisterCommand( 'asciisvg', new FCKDialogCommand( FCKLang['DlgAsciiSvg'], FCKLang['DlgAsciiSvgGraphEditor'], FCKConfig.PluginsPath + 'asciisvg/fck_asciisvg.html', 750, 600 ) ) ;
+FCKCommands.RegisterCommand( 'asciisvg', new FCKDialogCommand( FCKLang['DlgAsciiSvg'], FCKLang['DlgAsciiSvgGraphEditor'], FCKConfig.PluginsPath + 'asciisvg/fck_asciisvg.html', 750, 550 ) ) ;
 
 // Create the "asciisvg" toolbar button.
 var oAsciiSvgItem = new FCKToolbarButton( 'asciisvg', FCKLang['DlgAsciiSvg'] ) ;

+ 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',750,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();};
+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',750,550));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();};

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