/* editControl - a WYSIWYG edit control using iFrames and designMode Copyright (C) 2009-2020 Peter Hutten-Czapski Version 1.6 now about 600 lines of code NEW in 0.2 button styles, links, select box NEW in 0.3 help, date, rule, select all, and clean functions NEW in 0.4 code completely rewritten, more functions including images and now more modular and can support IE, including spelling for IE under 300 lines NEW in 0.5 template loading with support for placeholder form letter fields NEW in 0.8 minor code cleanup and bugfixes NEW in 1.1 first commit to cvs NEW in 1.2 bugfix for button style mouse behavior and 5 more buttons/functions NEW in 1.3 support for IE template loading, cut, copy, paste buttons/functions NEW in 1.3i grafted on compatibility with signature and faxing features NEW in 1.4 support for Firefox FF18+ browsers (ionMonkey series) NEW in 1.5 restored support for images, measurements and user template default values lost in 1.3i NEW in 1.6 restored button support for newest Firefox ESR 24 NEW in 2.0 added support for page break and file attachment and font awesome revision date Nov 15, 2020 * Requirements: DesignMode and other Dom 2 methods * Mozilla 1.3+ IE 5.5+ Netscape 6+ Opera 9+ Konqueror 3.5.7+ Safari 1.3+ Chrome * designed for and tested on Firefox 2 - 20. Tested on Opera 10, Chromium 25 and IE 6/7 This is a simplistic emulation of Xinha and TinyMCE javascript texteditors Released under the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. * * * * * USAGE: Put the following snippit in your webpage where you want the control to appear * Put editControl.js, blank.rtl in the same directory as the webpage * * * * //some of the optional configuration variables with their defaults go here // cfg_width = '700'; //editor control width in pixels // cfg_height = '400'; //editor control height in pixels // cfg_layout = '[select-block]|[bold][italic]|[unordered][ordered][rule]|[undo][redo]|[indent][outdent][select-all][clean]|[clock][help]
[edit-area]'; // [select-block] an option list for paragraph and header styles // [select-face] an option list for selecting font face // [select-size] an option list for selecting font size // [select-template] an option list for selecting base content and style // | a cosmetic seperator bar // [bold] a button that toggles bold of the selected text // [italic] a button that toggles emphasis text // [underlined] a button that toggles underlined text // [strike] a button that toggles strike trough text // [subscript] a button that toggles subscript text // [superscript] a button that toggles superscript text // [text-colour] a button that applies text colour // [hilight] a button that applies text high lighting colour // [left] a button that left justifies text // [center] a button that center justifies text // [full] a button that fully justifies text // [right] a button that right justifies text // [unordered]a button that creates a bulleted list // [ordered] a button that creates an ordered list // [rule]a button that creates a horizontal rule // [undo]a button that undoes the last action(s) // [redo]a button that redoes the last action(s) // [heading1] inserts a heading IF select-block is not available // [indent]a button that indents the text // [outdent]a button that outdents the text // [select-all]a button that selects all text // [clean]a button that removes font formatting from all selected text // [table]a button that inserts a table // [link]a button that inserts a URL of a link // [image]a button that inserts an image // [date] a button that adds the current date to the form // [clock] a button that adds the current time to the form // [help] a button that loads a help window // [spell] a button that invokes a spell checker // [cut] a button that cuts the selected text // [copy] a button that copies to windows clipboard // [delete] a button that deletes the selected content // [attach] a button that attaches Documents and other files to the RTL // [npage] a button that inserts a page break // [export] a button that exports the iframe contents in html to a rtl file // [edit] a button that edits the current template // deprecated [paste] a button that pastes from the windows clipboard for IE // deprecated [spell] a button that pastes from the windows clipboard for IE //
an embedded html element; you can add them freely in the layout // [edit-area] the location of the iFrame that contains the editor insertEditControl(); // Initialise the edit control // To set the HTML contents of this edit control use JavaScript to call: seteditControlContents(IdString,html) // - e.g. for putting "bar" into a control called "foo", call seteditControlContents("foo","

bar

"); // To retrieve the HTML contents of this edit control call: editControlContents(string) // - e.g. for a control called "foo", call editControlContents("foo"); */ //GLOBALS var cfg_layout = '[select-block]|[bold][italic]|[unordered][ordered][rule]|[undo][redo]|[indent][outdent][select-all][clean]|[clock][spell][help]
[edit-area]'; var cfg_formatblock = '