From c7e06ccf2ecb1e93a63b7054f41ff04c290f358b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 29 Dec 2010 22:34:11 +0100 Subject: [PATCH 01/17] Feature #2479 rev. introduction tool bar --- .../toolbars/extended/introduction.php | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/main/inc/lib/fckeditor/toolbars/extended/introduction.php b/main/inc/lib/fckeditor/toolbars/extended/introduction.php index bc1ee9c30b..15cabd415d 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/introduction.php +++ b/main/inc/lib/fckeditor/toolbars/extended/introduction.php @@ -7,37 +7,46 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, asciimath, DocProps, Templates don't run ok here. fckeditor_wiris_openFormulaEditor,fckeditor_wiris_openCAS don't run ok here. + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('NewPage','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex','asciimath'), + array('UnorderedList','OrderedList','Rule'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','Save','NewPage','Preview'), - array('Cut','Copy','Paste','PasteText','PasteWord','-','Print'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','YouTube','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks','Source') + array('Save','NewPage','Templates','-','Preview','Print'), + array('Cut','Copy','Paste','PasteText','PasteWord'), + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','asciimath','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks','Source'), + array('FitWindow') + ); // Sets whether the toolbar can be collapsed/expanded or not. From 33a4cf01189c102522ff4a451054a1dd69f55acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 29 Dec 2010 23:09:02 +0100 Subject: [PATCH 02/17] Feature #2479 rev. introduction tool bar disabled asciimath because does not run --- main/inc/lib/fckeditor/toolbars/extended/introduction.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/fckeditor/toolbars/extended/introduction.php b/main/inc/lib/fckeditor/toolbars/extended/introduction.php index 15cabd415d..e37c80df30 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/introduction.php +++ b/main/inc/lib/fckeditor/toolbars/extended/introduction.php @@ -8,7 +8,7 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options //NOTE: Does not include Replace because it is redundant, being in the same tab to Find -//TODO: DocProps, asciimath, DocProps, Templates don't run ok here. fckeditor_wiris_openFormulaEditor,fckeditor_wiris_openCAS don't run ok here. +//TODO: DocProps, asciimath don't run ok here. Templates loses styles // Hide/show SpellCheck buttom if ((api_get_setting('allow_spellcheck') == 'true')) { @@ -22,7 +22,7 @@ else{ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteWord'), array('Undo','Redo'), - array('Link','Image','flvPlayer','Table','mimetex','asciimath'), + array('Link','Image','flvPlayer','Table','mimetex'), array('UnorderedList','OrderedList','Rule'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), @@ -36,7 +36,7 @@ $config['ToolbarSets']['Maximized'] = array( array('Cut','Copy','Paste','PasteText','PasteWord'), array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), array('Link','Unlink','Anchor','Glossary'), - array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','asciimath','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), '/', array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), From 885978218fd3a46f175d8102473f8787e8b2f8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 29 Dec 2010 23:09:39 +0100 Subject: [PATCH 03/17] Feature #2479 rev. training description tool bar --- .../extended/training_description.php | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/main/inc/lib/fckeditor/toolbars/extended/training_description.php b/main/inc/lib/fckeditor/toolbars/extended/training_description.php index b901a857fa..e426266748 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/training_description.php +++ b/main/inc/lib/fckeditor/toolbars/extended/training_description.php @@ -7,37 +7,46 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, asciimath, don't run ok here. Templates loses styles + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('NewPage','Save','FitWindow','PasteWord','-','Undo','Redo'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','Source'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex'), + array('UnorderedList','OrderedList','Rule'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','Save','NewPage','Preview'), - array('Cut','Copy','Paste','PasteText','PasteWord','-','Print'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','YouTube','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks','Source') + array('Save','NewPage','Templates','-','Preview','Print'), + array('Cut','Copy','Paste','PasteText','PasteWord'), + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks','Source'), + array('FitWindow') + ); // Sets whether the toolbar can be collapsed/expanded or not. From 2a22fa225c7df1aaaab956cf860a221de0abd683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Thu, 30 Dec 2010 00:19:08 +0100 Subject: [PATCH 04/17] Feature #2479 rev. notebook tool bars and add outdent and indent to wiki, documents, introduction and training description --- .../fckeditor/toolbars/extended/documents.php | 2 +- .../toolbars/extended/documents_student.php | 3 +- .../toolbars/extended/introduction.php | 2 +- .../fckeditor/toolbars/extended/notebook.php | 57 ++++++++++-------- .../toolbars/extended/notebook_student.php | 58 +++++++++++-------- .../extended/training_description.php | 2 +- .../lib/fckeditor/toolbars/extended/wiki.php | 2 +- .../toolbars/extended/wiki_student.php | 2 +- .../fckeditor/toolbars/extended/wiki_task.php | 2 +- 9 files changed, 74 insertions(+), 56 deletions(-) diff --git a/main/inc/lib/fckeditor/toolbars/extended/documents.php b/main/inc/lib/fckeditor/toolbars/extended/documents.php index d5aa8603b0..67363273b3 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/documents.php +++ b/main/inc/lib/fckeditor/toolbars/extended/documents.php @@ -23,7 +23,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteWord'), array('Undo','Redo'), array('Link','Image','flvPlayer','Table','mimetex','asciimath'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/documents_student.php b/main/inc/lib/fckeditor/toolbars/extended/documents_student.php index 4fda9677c2..4a3c97b143 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/documents_student.php +++ b/main/inc/lib/fckeditor/toolbars/extended/documents_student.php @@ -9,6 +9,7 @@ //NOTE: Does not include Replace because it is redundant, being in the same tab to Find //TODO: DocProps, fckeditor_wiris_openFormulaEditor,fckeditor_wiris_openCAS don't run ok here. +//NOTE: ONLY FOR TEACHERS: source, insert html // Hide/show SpellCheck buttom if ((api_get_setting('allow_spellcheck') == 'true')) { @@ -23,7 +24,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteWord'), array('Undo','Redo'), array('Link','Image','flvPlayer','Table','mimetex','asciimath'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/introduction.php b/main/inc/lib/fckeditor/toolbars/extended/introduction.php index e37c80df30..a5d60c74fe 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/introduction.php +++ b/main/inc/lib/fckeditor/toolbars/extended/introduction.php @@ -23,7 +23,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteWord'), array('Undo','Redo'), array('Link','Image','flvPlayer','Table','mimetex'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/notebook.php b/main/inc/lib/fckeditor/toolbars/extended/notebook.php index f6299b24a6..249105c805 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/notebook.php +++ b/main/inc/lib/fckeditor/toolbars/extended/notebook.php @@ -7,37 +7,46 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, ASCIIMath don't run ok here. + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('Save','FitWindow','-','PasteWord','-','Undo','Redo'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','Save','NewPage','Preview'), - array('Cut','Copy','Paste','PasteText','PasteWord','-','Print'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('mimetex','Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','YouTube','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks','Source') + array('Save','NewPage','Templates','-','Preview','Print'), + array('Cut','Copy','Paste','PasteText','PasteWord'), + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks','Source'), + array('FitWindow') + ); // Sets whether the toolbar can be collapsed/expanded or not. diff --git a/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php b/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php index 0207567f42..a3da1d5046 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php +++ b/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php @@ -7,40 +7,48 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, ASCIIMath don't run ok here. +//NOTE: ONLY FOR TEACHERS: source, insert html + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('Save','FitWindow','-','PasteWord','-','Undo','Redo'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight'), - array('ShowBlocks') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','Save','NewPage','Preview'), + array('Save','NewPage','Templates','-','Preview','Print'), array('Cut','Copy','Paste','PasteText','PasteWord'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('mimetex','Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks') + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks'), + array('FitWindow') + ); - // Sets whether the toolbar can be collapsed/expanded or not. // Possible values: true , false //$config['ToolbarCanCollapse'] = true; diff --git a/main/inc/lib/fckeditor/toolbars/extended/training_description.php b/main/inc/lib/fckeditor/toolbars/extended/training_description.php index e426266748..2420105356 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/training_description.php +++ b/main/inc/lib/fckeditor/toolbars/extended/training_description.php @@ -23,7 +23,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteWord'), array('Undo','Redo'), array('Link','Image','flvPlayer','Table','mimetex'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/wiki.php b/main/inc/lib/fckeditor/toolbars/extended/wiki.php index 3d27c2057f..8f77a0e178 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/wiki.php +++ b/main/inc/lib/fckeditor/toolbars/extended/wiki.php @@ -24,7 +24,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteText'), array('Undo','Redo'), array('Wikilink','Link','Image','flvPlayer','Table','mimetex'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php b/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php index e7077954c3..0811d14633 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php +++ b/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php @@ -25,7 +25,7 @@ $config['ToolbarSets']['Normal'] = array( array('Save','NewPage','Templates','-','PasteText'), array('Undo','Redo'), array('Wikilink','Link','Image','flvPlayer','Table','mimetex'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') diff --git a/main/inc/lib/fckeditor/toolbars/extended/wiki_task.php b/main/inc/lib/fckeditor/toolbars/extended/wiki_task.php index dd84970cf3..9e513783e9 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/wiki_task.php +++ b/main/inc/lib/fckeditor/toolbars/extended/wiki_task.php @@ -24,7 +24,7 @@ $config['ToolbarSets']['Normal'] = array( array('NewPage','Templates','-','PasteText'), array('Undo','Redo'), array('Link','Image','flvPlayer','Table','mimetex'), - array('UnorderedList','OrderedList','Rule'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), array('FontFormat','FontName','Bold','Italic','Underline','TextColor','BGColor'), array('FitWindow') From ca822434f130ed9e612c173038432880af823ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Thu, 30 Dec 2010 00:28:34 +0100 Subject: [PATCH 05/17] Feature #2479 rev. announcements tool bars --- .../toolbars/extended/announcements.php | 57 +++++++++++-------- .../extended/announcements_student.php | 57 +++++++++++-------- 2 files changed, 66 insertions(+), 48 deletions(-) diff --git a/main/inc/lib/fckeditor/toolbars/extended/announcements.php b/main/inc/lib/fckeditor/toolbars/extended/announcements.php index f673c0d422..4fd37466dc 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/announcements.php +++ b/main/inc/lib/fckeditor/toolbars/extended/announcements.php @@ -7,37 +7,46 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, ASCIIMath don't run ok here. + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('Save','FitWindow','PasteWord','-','Undo','Redo'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','-','Save','NewPage','Preview'), - array('Cut','Copy','Paste','PasteText','PasteWord','-','Print'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','YouTube','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks','Source') + array('Save','NewPage','Templates','-','Preview','Print'), + array('Cut','Copy','Paste','PasteText','PasteWord'), + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks','Source'), + array('FitWindow') + ); // Sets whether the toolbar can be collapsed/expanded or not. diff --git a/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php b/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php index 185c510bf1..d962d078c9 100755 --- a/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php +++ b/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php @@ -7,38 +7,47 @@ // For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options +//NOTE: Does not include Replace because it is redundant, being in the same tab to Find +//TODO: DocProps, ASCIIMath don't run ok here. +//NOTE: ONLY FOR TEACHERS: source, insert html + +// Hide/show SpellCheck buttom +if ((api_get_setting('allow_spellcheck') == 'true')) { + $VSpellCheck='SpellCheck'; +} +else{ + $VSpellCheck=''; +} + // This is the visible toolbar set when the editor has "normal" size. $config['ToolbarSets']['Normal'] = array( - array('Save','FitWindow','PasteWord','-','Undo','Redo'), - array('Link','Unlink','Anchor'), - array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'), - array('Table','SpecialChar'), - array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('Bold','Italic','Underline'), - array('JustifyLeft','JustifyCenter','JustifyRight'), - array('ShowBlocks') + array('Save','NewPage','Templates','-','PasteWord'), + array('Undo','Redo'), + array('Link','Image','flvPlayer','Table','mimetex'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'), + array('FitWindow') ); // This is the visible toolbar set when the editor is maximized. // If it has not been defined, then the toolbar set for the "normal" size is used. $config['ToolbarSets']['Maximized'] = array( - array('FitWindow','-','Save','NewPage','Preview'), + array('Save','NewPage','Templates','-','Preview','Print'), array('Cut','Copy','Paste','PasteText','PasteWord'), - array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), - array('Link','Unlink','Anchor'), - '/', - array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'), - array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'), - array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), - array('Rule','SpecialChar'), - array('Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','googlemaps','Smiley'), - '/', - array('Style','FontFormat','FontName','FontSize'), - array('TextColor','BGColor'), - array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'), - array('ShowBlocks') + array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'), + array('Link','Unlink','Anchor','Glossary'), + array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'), +'/', + array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'), + array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'), + array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'), + array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'), + array($VSpellCheck), + array('Style','FontFormat','FontName','FontSize'), + array('PageBreak','ShowBlocks'), + array('FitWindow') + ); // Sets whether the toolbar can be collapsed/expanded or not. From 2af3626acbe26cfc2eb813ae036ba83220aa876b Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Thu, 30 Dec 2010 17:51:33 +0200 Subject: [PATCH 06/17] Feature #2132 - Development of "asciisvg" plug-in (2), unfinished work. --- .../fckeditor/editor/plugins/asciisvg/d.svg | 8 + .../editor/plugins/asciisvg/fck_asciisvg.html | 83 +++- .../editor/plugins/asciisvg/fck_asciisvg.js | 433 +++++++++++++++++- .../editor/plugins/asciisvg/fckplugin.js | 2 +- .../plugins/asciisvg/fckplugin_compressed.js | 2 +- 5 files changed, 521 insertions(+), 7 deletions(-) create mode 100644 main/inc/lib/fckeditor/editor/plugins/asciisvg/d.svg diff --git a/main/inc/lib/fckeditor/editor/plugins/asciisvg/d.svg b/main/inc/lib/fckeditor/editor/plugins/asciisvg/d.svg new file mode 100644 index 0000000000..7403c650c8 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/asciisvg/d.svg @@ -0,0 +1,8 @@ + + + + diff --git a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html index 1980d84f00..2d44604c6d 100644 --- a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html +++ b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html @@ -2,7 +2,7 @@ pow(a,b) + // na --> n*a + // (...)d --> (...)*d + // n! --> factorial(n) + // sin^-1 --> arcsin etc. + //while ^ in string, find term on left and right + //slice and concat new formula string + //parenthesizes the function variables + st = st.replace("[","("); + st = st.replace("]",")"); + st = st.replace(/arc(sin|cos|tan)/g,"a#r#c $1"); + if (varlist != null) { + var reg = new RegExp("(sqrt|ln|log|sin|cos|tan|sec|csc|cot|abs)[\(]","g"); + st = st.replace(reg,"$1#("); + var reg = new RegExp("("+varlist+")("+varlist+")$","g"); + st = st.replace(reg,"($1)($2)"); + var reg = new RegExp("("+varlist+")(a#|sqrt|ln|log|sin|cos|tan|sec|csc|cot|abs)","g"); + st = st.replace(reg,"($1)$2"); + var reg = new RegExp("("+varlist+")("+varlist+")([^a-df-zA-Z\(#])","g"); // 6/1/09 readded \( for f(350/x) + st = st.replace(reg,"($1)($2)$3"); //get xy3 + //var reg = new RegExp("("+varlist+")("+varlist+")(\w*[^\(#])","g"); + //st = st.replace(reg,"($1)($2)$3"); //get xysin + var reg = new RegExp("([^a-df-zA-Z#])("+varlist+")([^a-df-zA-Z#])","g"); + st = st.replace(reg,"$1($2)$3"); + var reg = new RegExp("^("+varlist+")([^a-df-zA-Z])","g"); + st = st.replace(reg,"($1)$2"); + var reg = new RegExp("([^a-df-zA-Z])("+varlist+")$","g"); + st = st.replace(reg,"$1($2)"); + } + st = st.replace(/#/g,""); + st = st.replace(/a#r#c\s+(sin|cos|tan)/g,"arc$1"); + st = st.replace(/\s/g,""); + st = st.replace(/(Sin|Cos|Tan|Sec|Csc|Cot|Arc|Abs|Log|Ln)/g, matchtolower); + st = st.replace(/log_(\d+)\(/,"nthlog($1,"); + st = st.replace(/log/g,"logten"); + + if (st.indexOf("^-1")!=-1) { + st = st.replace(/sin\^-1/g,"arcsin"); + st = st.replace(/cos\^-1/g,"arccos"); + st = st.replace(/tan\^-1/g,"arctan"); + st = st.replace(/sec\^-1/g,"arcsec"); + st = st.replace(/csc\^-1/g,"arccsc"); + st = st.replace(/cot\^-1/g,"arccot"); + st = st.replace(/sinh\^-1/g,"arcsinh"); + st = st.replace(/cosh\^-1/g,"arccosh"); + st = st.replace(/tanh\^-1/g,"arctanh"); + st = st.replace(/sech\^-1/g,"arcsech"); + st = st.replace(/csch\^-1/g,"arccsch"); + st = st.replace(/coth\^-1/g,"arccoth"); + } + + st = st.replace(/root\((\d+)\)\(/,"nthroot($1,"); + //st = st.replace(/E/g,"(EE)"); + st = st.replace(/([0-9])E([\-0-9])/g,"$1(EE)$2"); + + st = st.replace(/^e$/g,"(E)"); + st = st.replace(/pi/g,"(pi)"); + st = st.replace(/^e([^a-zA-Z])/g,"(E)$1"); + st = st.replace(/([^a-zA-Z])e$/g,"$1(E)"); + + st = st.replace(/([^a-zA-Z])e([^a-zA-Z])/g,"$1(E)$2"); + st = st.replace(/([0-9])([\(a-zA-Z])/g,"$1*$2"); + st = st.replace(/(!)([0-9\(])/g,"$1*$2"); + //want to keep scientific notation + st= st.replace(/([0-9])\*\(EE\)([\-0-9])/,"$1e$2"); + + + st = st.replace(/\)([\(0-9a-zA-Z])/g,"\)*$1"); + + var i,j,k, ch, nested; + while ((i=st.indexOf("^"))!=-1) { + + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + //find right argument + if (i==st.length-1) return "Error: missing argument"; + k = i+1; + ch = st.charAt(k); + nch = st.charAt(k+1); + if (ch>="0" && ch<="9" || (ch=="-" && nch!="(") || ch==".") {// look for signed (decimal) number + k++; + while (k="0" && ch<="9") k++; + if (ch==".") { + k++; + while (k="0" && ch<="9") k++; + } + } else if (ch=="(" || (ch=="-" && nch=="(")) {// look for matching closing bracket and function name + if (ch=="-") { k++;} + nested = 1; + k++; + while (k0) { + ch = st.charAt(k); + if (ch=="(") nested++; + else if (ch==")") nested--; + k++; + } + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + k++; + while (k="a" && ch<="z" || + ch>="A" && ch<="Z") k++; + if (ch=='(' && st.slice(i+1,k).match(/^(sin|cos|tan|sec|csc|cot|logten|log|ln|exp|arcsin|arccos|arctan|arcsec|arccsc|arccot|sinh|cosh|tanh|sech|csch|coth|arcsinh|arccosh|arctanh|arcsech|arccsch|arccoth|sqrt|abs|nthroot)$/)) { + nested = 1; + k++; + while (k0) { + ch = st.charAt(k); + if (ch=="(") nested++; + else if (ch==")") nested--; + k++; + } + } + } else { + return "Error: incorrect syntax in "+st+" at position "+k; + } + st = st.slice(0,j+1)+"safepow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+ + st.slice(k); + } + while ((i=st.indexOf("!"))!=-1) { + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1); + } + return st; +} + + +function slopefield(fun,dx,dy) { + var g = fun; + if (typeof fun=="string") + eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }"); + var gxy,x,y,u,v,dz; + if (dx==null) dx=1; + if (dy==null) dy=1; + dz = Math.sqrt(dx*dx+dy*dy)/6; + var x_min = Math.ceil(xmin/dx); + var y_min = Math.ceil(ymin/dy); + for (x = x_min; x <= xmax; x += dx) + for (y = y_min; y <= ymax; y += dy) { + gxy = g(x,y); + if (!isNaN(gxy)) { + if (Math.abs(gxy)=="Infinity") {u = 0; v = dz;} + else {u = dz/Math.sqrt(1+gxy*gxy); v = gxy*u;} + line([x-u,y-v],[x+u,y+v]); + } + } +} + + +//ASCIIsvgAddon.js dumped here +function drawPictures() { + drawPics() +} + +//ShortScript format: +//xmin,xmax,ymin,ymax,xscl,yscl,labels,xgscl,ygscl,width,height plotcommands(see blow) +//plotcommands: type,eq1,eq2,startmaker,endmarker,xmin,xmax,color,strokewidth,strokedash +function parseShortScript(sscript,gw,gh) { + if (sscript == null) { + initialized = false; + sscript = picture.sscr; + } + + var sa= sscript.split(","); + + if (gw && gh) { + sa[9] = gw; + sa[10] = gh; + sscript = sa.join(","); + picture.setAttribute("sscr", sscript); + } + picture.setAttribute("width", sa[9]); + picture.setAttribute("height", sa[10]); + picture.style.width = sa[9] + "px"; + picture.style.height = sa[10] + "px"; + + if (sa.length > 10) { + commands = 'setBorder(5);'; + commands += 'width=' +sa[9] + '; height=' +sa[10] + ';'; + commands += 'initPicture(' + sa[0] +','+ sa[1] +','+ sa[2] +','+ sa[3] + ');'; + commands += 'axes(' + sa[4] +','+ sa[5] +','+ sa[6] +','+ sa[7] +','+ sa[8]+ ');'; + + var inx = 11; + var eqnlist = 'Graphs: '; + + while (sa.length > inx+9) { + commands += 'stroke="' + sa[inx+7] + '";'; + commands += 'strokewidth="' + sa[inx+8] + '";' + //commands += 'strokedasharray="' + sa[inx+9] + '";' + if (sa[inx+9] != "") { + commands += 'strokedasharray="' + sa[inx+9].replace(/\s+/g,',') + '";'; + } + if (sa[inx]=="slope") { + eqnlist += "dy/dx="+sa[inx+1] + "; "; + commands += 'slopefield("' + sa[inx+1] + '",' + sa[inx+2] + ',' + sa[inx+2] + ');'; + } else { + if (sa[inx]=="func") { + eqnlist += "y="+sa[inx+1] + "; "; + eqn = '"' + sa[inx+1] + '"'; + } else if (sa[inx] == "polar") { + eqnlist += "r="+sa[inx+1] + "; "; + eqn = '["cos(t)*(' + sa[inx+1] + ')","sin(t)*(' + sa[inx+1] + ')"]'; + } else if (sa[inx] == "param") { + eqnlist += "[x,y]=["+sa[inx+1] + "," + sa[inx+2] + "]; "; + eqn = '["' + sa[inx+1] + '","'+ sa[inx+2] + '"]'; + } + + + if (typeof eval(sa[inx+5]) == "number") { + // if ((sa[inx+5]!='null')&&(sa[inx+5].length>0)) { + //commands += 'myplot(' + eqn +',"' + sa[inx+3] + '","' + sa[inx+4]+'",' + sa[inx+5] + ',' + sa[inx+6] +');'; + commands += 'plot(' + eqn +',' + sa[inx+5] + ',' + sa[inx+6] +',null,null,' + sa[inx+3] + ',' + sa[inx+4] +');'; + + } else { + commands += 'plot(' + eqn +',null,null,null,null,' + sa[inx+3] + ',' + sa[inx+4]+');'; + } + } + inx += 10; + } + + try { + eval(commands); + } catch (e) { + setTimeout(function() {parseShortScript(sscript,gw,gh)},100); + //alert("Graph not ready"); + } + + picture.setAttribute("alt",eqnlist); + //picture.setAttribute("width", sa[9]); + //picture.setAttribute("height", sa[9]); + + return commands; + } +} + + + + +function drawPics() { + var index, nd; + pictures = document.getElementsByTagName("embed"); + // might be needed if setTimeout on parseShortScript isn't working + if (!ASnoSVG) { + try { + for (var i = 0; i < pictures.length; i++) { + if (pictures[i].getAttribute("sscr")!='' || pictures[i].getAttribute("script")!='') { + if (pictures[i].getSVGDocument().getElementById("root") == null) { + setTimeout(drawPics,100); + return; + } + } + } + } catch (e) { + setTimeout(drawPics,100); + return; + } + } + var len = pictures.length; + + + for (index = 0; index < len; index++) { + picture = ((!ASnoSVG && isIE) ? pictures[index] : pictures[0]); + // for (index = len-1; index >=0; index--) { + // picture = pictures[index]; + + if (!ASnoSVG) { + initialized = false; + var sscr = picture.getAttribute("sscr"); + if ((sscr != null) && (sscr != "")) { //sscr from editor + try { + parseShortScript(sscr); + } catch (e) {} + } else { + src = picture.getAttribute("script"); //script from showplot + if ((src!=null) && (src != "")) { + try { + with (Math) eval(src); + } catch(err) {alert(err+"\n"+src)} + } + } + } else { + if (picture.getAttribute("sscr")!='') { + n = document.createElement('img'); + n.setAttribute("style",picture.getAttribute("style")); + n.setAttribute("src",AScgiloc+'?sscr='+encodeURIComponent(picture.getAttribute("sscr"))); + pn = picture.parentNode; + pn.replaceChild(n,picture); + } + + } + + } +} + +//modified by David Lippman from original in AsciiSVG.js by Peter Jipsen +//added min/max type: 0:nothing, 1:arrow, 2:open dot, 3:closed dot +function plot(fun,x_min,x_max,points,id,min_type,max_type) { + var pth = []; + var f = function(x) { return x }, g = fun; + var name = null; + if (typeof fun=="string") + eval("g = function(x){ with(Math) return "+mathjs(fun)+" }"); + else if (typeof fun=="object") { + eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }"); + eval("g = function(t){ with(Math) return "+mathjs(fun[1])+" }"); + } + if (typeof x_min=="string") { name = x_min; x_min = xmin } + else name = id; + var min = (x_min==null?xmin:x_min); + var max = (x_max==null?xmax:x_max); + if (max <= min) { return null;} + //else { + var inc = max-min-0.000001*(max-min); + inc = (points==null?inc/200:inc/points); + var gt; +//alert(typeof g(min)) + for (var t = min; t <= max; t += inc) { + gt = g(t); + if (!(isNaN(gt)||Math.abs(gt)=="Infinity")) pth[pth.length] = [f(t), gt]; + } + path(pth,name); + if (min_type == 1) { + arrowhead(pth[1],pth[0]); + } else if (min_type == 2) { + dot(pth[0], "open"); + } else if (min_type == 3) { + dot(pth[0], "closed"); + } + if (max_type == 1) { + arrowhead(pth[pth.length-2],pth[pth.length-1]); + } else if (max_type == 2) { + dot(pth[pth.length-1], "open"); + } else if (max_type == 3) { + dot(pth[pth.length-1], "closed"); + } + + return p; + //} +} + +//end ASCIIsvgAddon.js dump + +function updateCoords(ind) { + switchTo("picture"+(ind+1)); + var gx=getX(), gy=getY(); + if ((xmax-gx)*xunitlength > 6*fontsize || (gy-ymin)*yunitlength > 2*fontsize) + text([xmax,ymin],"("+gx.toFixed(2)+", "+gy.toFixed(2)+")", + "aboveleft","AScoord"+ind,""); + else text([xmax,ymin]," ","aboveleft","AScoord"+ind,""); +} + + +function updateCoords0() {updateCoords(0)} +function updateCoords1() {updateCoords(1)} +function updateCoords2() {updateCoords(2)} +function updateCoords3() {updateCoords(3)} +function updateCoords4() {updateCoords(4)} +function updateCoords5() {updateCoords(5)} +function updateCoords6() {updateCoords(6)} +function updateCoords7() {updateCoords(7)} +function updateCoords8() {updateCoords(8)} +function updateCoords9() {updateCoords(9)} +ASfn = [function() {updatePicture(0)}, + function() {updatePicture(1)}, + function() {updatePicture(2)}, + function() {updatePicture(3)}, + function() {updatePicture(4)}, + function() {updatePicture(5)}, + function() {updatePicture(6)}, + function() {updatePicture(7)}, + + function() {updatePicture(8)}, + function() {updatePicture(9)}]; +ASupdateCoords = [function() {updateCoords(0)}, + function() {updateCoords(1)}, + function() {updateCoords(2)}, + function() {updateCoords(3)}, + function() {updateCoords(4)}, + function() {updateCoords(5)}, + function() {updateCoords(6)}, + function() {updateCoords(7)}, + function() {updateCoords(8)}, + function() {updateCoords(9)}]; + + +// GO1.1 Generic onload by Brothercake +// http://www.brothercake.com/ +//onload function +function generic() +{ + drawPictures(); +}; +//setup onload function +if(typeof window.addEventListener != 'undefined') +{ + //.. gecko, safari, konqueror and standard + window.addEventListener('load', generic, false); +} +else if(typeof document.addEventListener != 'undefined') +{ + //.. opera 7 + document.addEventListener('load', generic, false); +} +else if(typeof window.attachEvent != 'undefined') +{ + //.. win/ie + window.attachEvent('onload', generic); +} +//** remove this condition to degrade older browsers +else +{ + //.. mac/ie5 and anything else that gets this far + //if there's an existing onload function + if(typeof window.onload == 'function') + { + //store it + var existing = onload; + //add new onload handler + window.onload = function() + { + //call existing onload function + existing(); + //call generic onload function + generic(); + }; + } + else + { + //setup onload function + window.onload = generic; + } +} + + +if (checkIfSVGavailable) { + checkifSVGavailable = false; + nd = isSVGavailable(); + ASnoSVG = nd!=null; +} diff --git a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html index 2d44604c6d..c4829cf756 100644 --- a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html +++ b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html @@ -15,7 +15,8 @@ @@ -85,27 +86,27 @@ End with: -xmax: -xscl: +xmin: +xmax: +xscl:    -ymin: -ymax: -yscl: +ymin: +ymax: +yscl:
-Show axis labels: -Show XY grid: +Show axis labels: +Show XY grid:    Resize to: by - +
Graphs: - diff --git a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.js b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.js index c54987c55f..5432a7d819 100644 --- a/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.js +++ b/main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.js @@ -40,6 +40,14 @@ var showasciiformulaonhover = false ; // Font size of the formulas in this dialog. var mathfontsize = "1.1em" ; +var noSVG = ASnoSVG ; // Temporarily added. +var width = 300 ; +var height = 200 ; +var alignm = 'middle' ; +//var sscr = '' ; +var sscr = '-7.5,7.5,-5,5,1,1,1,1,1,300,200' ; +//var isnew = null ; +var isnew = true ; function LoadSelection() { @@ -98,7 +106,6 @@ var AsciisvgDialog = sscr: '-7.5,7.5,-5,5,1,1,1,1,1,300,200' , //isnew: null , isnew: true , - AScgiloc: null , init : function() { @@ -110,16 +117,13 @@ var AsciisvgDialog = this.height = tinyMCEPopup.getWindowArg( 'height' ) ; this.isnew = tinyMCEPopup.getWindowArg( 'isnew' ) ; this.sscr = tinyMCEPopup.getWindowArg( 'sscr' ) ; - */ - //this.AScgiloc = tinyMCEPopup.getWindowArg( 'AScgiloc' ) ; - this.AScgiloc = AScgiloc ; - /* + this.AScgiloc = tinyMCEPopup.getWindowArg( 'AScgiloc' ) ; this.alignm = tinyMCEPopup.getWindowArg( 'alignm' ) ; */ if ( noSVG ) { - GetE( 'preview' ).innerHTML = '' ; + GetE( 'preview' ).innerHTML = '' ; } else { @@ -143,13 +147,13 @@ var AsciisvgDialog = { aligntxt = 'vertical-align: ' + this.alignm + '; float: none;' ; } - tinyMCEPopup.editor.execCommand( 'mceInsertContent', false, '') ; + tinyMCEPopup.editor.execCommand( 'mceInsertContent', false, '') ; } else { el = tinyMCEPopup.editor.selection.getNode() ; ed.dom.setAttrib( el , 'sscr' , this.sscr ) ; - ed.dom.setAttrib( el , 'src' , this.AScgiloc + '?sscr=' + encodeURIComponent( this.sscr ) ) ; + ed.dom.setAttrib( el , 'src' , AScgiloc + '?sscr=' + encodeURIComponent( this.sscr ) ) ; ed.dom.setAttrib( el , 'width' , this.width ) ; ed.dom.setAttrib( el , 'height' , this.height ) ; ed.dom.setStyle( el , 'width' , this.width + 'px' ) ; @@ -214,7 +218,7 @@ var AsciisvgDialog = graphs.options[ graphs.options.length ] = newopt ; graphs.selectedIndex = graphs.options.length - 1 ; - this.graphit() ; + UpdatePreview() ; GetE( 'equation' ).focus() ; } , @@ -235,7 +239,7 @@ var AsciisvgDialog = graphs.options[ graphs.selectedIndex ] = null ; if ( graphs.options.length > 0 ) { this.loadeqn() ; } } - this.graphit() ; + UpdatePreview() ; GetE( 'equation' ).focus() ; } , @@ -294,18 +298,18 @@ var AsciisvgDialog = this.sscr = commands ; this.alignm = GetE( 'alignment' ).value ; - if ( noSVG ) - { - pvimg = GetE( 'previewimg' ) ; - pvimg.src = this.AScgiloc + '?sscr=' + encodeURIComponent(commands) ; - //ed.dom.setStyle( pvimg, 'width' , this.width + 'px' ) ; - //ed.dom.setStyle( pvimg, 'height' , this.height + 'px' ) ; - } - else - { + //if ( noSVG ) + //{ + // pvimg = GetE( 'previewimg' ) ; + // pvimg.src = AScgiloc + '?sscr=' + encodeURIComponent(commands) ; + // //ed.dom.setStyle( pvimg, 'width' , this.width + 'px' ) ; + // //ed.dom.setStyle( pvimg, 'height' , this.height + 'px' ) ; + //} + //else + //{ pvsvg = GetE( 'previewsvg' ) ; parseShortScript( commands , this.width , this.height ) ; - } + //} } , changetype : function() @@ -486,7 +490,7 @@ var AsciisvgDialog = default: GetE( 'alignment' ).selectedIndex = 0 ; break ; } - //this.graphit() ; + //UpdatePreview() ; } , chgtext : function( tag , text )