Changeset 84
- Timestamp:
- 04/24/05 23:43:57 (8 years ago)
- Location:
- branches/unified_backend
- Files:
-
- 2 added
- 10 modified
- 1 moved
-
README.txt (moved) (moved from branches/unified_backend/README.TXT) (1 diff)
-
README_DEVELOPERS.txt (modified) (5 diffs)
-
RELEASE_NOTES.txt (added)
-
TODO.txt (added)
-
ddt.js (modified) (8 diffs)
-
devutils/ddtpreproc.php.in (modified) (2 diffs)
-
examples/full_example-body.html (modified) (1 diff)
-
examples/simple_example.html (modified) (8 diffs)
-
htmlarea.js (modified) (170 diffs)
-
plugins/ContextMenu/context-menu.js (modified) (1 diff)
-
plugins/EnterParagraphs/enter-paragraphs.js (modified) (1 diff)
-
plugins/Stylist/stylist.js (modified) (2 diffs)
-
popups/about.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/unified_backend/README.txt
r72 r84 2 2 Xinha Unified Backend Branch. 3 3 4 by: Yermo Lamers http://www.formvista.com/contact.html 4 by: Yermo Lamers of DTLink,LLC 5 http://www.formvista.com/contact.html 5 6 6 7 The Unified Backend Branch code has been released under the same terms -
branches/unified_backend/README_DEVELOPERS.txt
r72 r84 4 4 Development Info 5 5 6 by: Yermo Lamers 6 by: Yermo Lamers of DTLink Software 7 7 http://www.formvista.com 8 8 … … 44 44 in-line text replacement for some specific tags. 45 45 46 ddtpreproc.php - not done46 ddtpreproc.php 47 47 48 48 Javascript does not seem to have a version of PHP's … … 52 52 javascript source files to patch in file and line numbers to 53 53 every _ddt() call. 54 55 If you are working on the source files and add or delete lines just 56 rerun the ddtpreproc.php script from the xinha_ub root directory. It 57 will recurse through all the .js files in the directory tree. 54 58 55 59 makedocs.pl … … 116 120 To further make my life easier and come up to speed, I've added 117 121 trace messages to virtually every method using a contributed version 118 of my DDT debug-trace-message-to-textarea class. These messages can 119 be turned on and off on a per-class basis using the ddtOn() method. 122 of my DDT debug-trace-message-to-popup window class. 120 123 121 There is also a global trace message object included in the full_example-body.html 122 file to trace out the editor startup. At that point the page is not completely 123 constructed so a popup window is used to house these trace messages. 124 You will need to turn off any popup blockers in order to see the debugging 125 trace messages. 126 127 These messages can be turned on and off on a per-class basis using the ddtOn() method. 128 (See examples/simple_example.html) 124 129 125 130 What's nice is you can quickly get a feel for the order in which things happen 126 131 and which methods are invoked for what events. 127 128 Unfortunately, the trace message infrastructure adds a tremendous amount of processing129 and size to the distribution. With all debug messages turned on, this branch of130 Xinha is pretty much unuseable as an editor.131 132 132 133 The concept is to do development on the trace enabled version of the code and then … … 136 137 of Xinha .. a development version with all debugging intact and a runtime version 137 138 that has been stripped. (this has served me extremely well in formVista development) 138 139 Debug trace messages can be enabled in one of two ways:140 141 1. uncommenting the _ddtOn() calls in the example HTML page and in htmlarea.js142 2. clicking the new '<>' icons which turn on trace messages143 139 144 140 ---------------------------------------------------------- -
branches/unified_backend/ddt.js
r72 r84 29 29 * @author Yermo Lamers 30 30 * @package ddt 31 * 32 * @todo find source of spurious document not well formed error on reload. 31 33 */ 32 34 … … 39 41 // 2005-04-12 YmL: 40 42 // . expanded for use in Xinha. 43 // 44 // 2005-04-22 YmL: 45 // . now uses a popup window for all messages. 46 // writing to a textarea was simply too slow. 41 47 // ----------------------------- 42 48 … … 44 50 * DDT constructor. 45 51 * 52 * @param name name identifying the object sending the debug messages. 53 * 46 54 * @class Debugging Trace Message class. 47 55 * … … 59 67 // descriptive named used as a title for the trace box. 60 68 61 this.textarea_name = name; 62 63 // hopefully unique name to avoid conflicts with existing elements. 64 65 this.textarea_id = "DDT_" + name; 69 this.name = name; 70 66 71 } 67 72 else 68 73 { 69 this. textarea_name = "DDT";74 this.name = "DDT"; 70 75 } 71 76 72 77 // by default messages are off. 73 78 74 this.textarea = null;75 76 79 this.state = "off"; 77 78 } 80 this.popup = null; 81 82 } 83 84 // ------------------------------------------- 85 86 /** 87 * turn on debugging messages optionally opening the debug window. 88 * 89 * the original design used a textarea on the page but this made debugging 90 * startup code difficult. The design has been changed to send debug messages 91 * to a popup window. Instead of appending to a textarea messages are now 92 * written to the window, which is much faster. 93 * 94 * Instead of using separate areas for each object that might send a message 95 * debug messages are tagged with the name of the object sending the message. 96 * 97 * You will need to turn off popup blockers in order for this to work. 98 */ 99 100 DDT.prototype._ddtOn = function() 101 { 102 103 // if the popup hasn't been opened yet, open it. 104 105 if ( this.popup == null ) 106 { 107 108 // open the popup window 109 110 this.popup = window.open( "", "ddt_popup", 111 "toolbar=no,menubar=no,personalbar=no,width=800,height=450," + 112 "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); 113 114 // it's possible that the window was left open or we are another object 115 // sharing the same window. 116 117 if ( typeof this.popup.document.getElementsByTagName("p")[0] == 'undefined' ) 118 { 119 120 var content = "<html><body><p>DDT</p><p><a href=\"javascript:document.write( '<hr>');\">ADD SEPARATOR</a></p></body></html>"; 121 this.popup.document.write( content ); 122 123 var header = this.popup.document.createElement( "h3" ); 124 var message = this.popup.document.createTextNode( "_ddt Trace Messages" ); 125 header.appendChild( message ); 126 this.popup.document.body.appendChild( header ); 127 128 } // end of if the popup document hadn't been created. 129 130 } // end of if the popup had not been opened. 131 132 this.state = "on"; 133 134 }; // end of _ddtOn() 79 135 80 136 // -------------------------------- 81 137 82 138 /** 83 * turn on debugging messages and optionally create the text area. 84 */ 85 86 DDT.prototype._ddtOn = function() 87 { 88 89 // if the text area hasn't been created yet, create it. 90 91 if (( this.textarea = document.getElementById( this.textarea_id )) == null ) 92 { 93 94 var header = document.createElement( "h3" ); 95 var message = document.createTextNode( "Trace messages for " + this.textarea_name ); 96 header.appendChild( message ); 97 98 this.textarea = document.createElement("textarea"); 99 100 // name it so we can reuse it; avoid naming conflicts with existing textareas. 101 102 this.textarea.id = this.textarea_id; 103 104 this.textarea.style.width = "85%"; 105 this.textarea.style.height = "15em"; 106 107 document.body.appendChild( header ); 108 document.body.appendChild(this.textarea); 109 } 110 111 // clear the text area. 112 113 this.textarea.value = ""; 114 115 this.state = "on"; 116 117 }; // end of ddtOn 118 119 // -------------------------------- 120 121 /** 122 * turn off debugging messages 139 * turn off debugging messages. 123 140 */ 124 141 125 142 DDT.prototype._ddtOff = function() 126 143 { 127 this.textarea.value = "";128 this.textarea = null;129 144 this.state = "off"; 130 145 } … … 146 161 } 147 162 148 // -------------------------------------------149 150 /**151 * use a popup textarea for debugging152 *153 * there are cases where one would like to debug javascript code while a page154 * is being constructed. This function raises a popup window, puts a textarea in it.155 * subsequent debug trace messages are sent to the window.156 *157 * You will need to turn off popup blockers in order for this to work.158 */159 160 DDT.prototype._ddtOnPopup = function()161 {162 163 // if the text area hasn't been created yet, create it.164 165 if ( this.textarea == null )166 {167 168 // open the popup window169 170 var popup = window.open( "", "ddt_popup",171 "toolbar=no,menubar=no,personalbar=no,width=800,height=250," +172 "scrollbars=no,resizable=yes,modal=yes,dependable=yes");173 174 // it's possible that the window was left open between loads so check to see175 // if the text area already exists176 177 if (( this.textarea = popup.document.getElementById( this.textarea_id )) == null )178 {179 180 var content = "<html><body><p>ddt</p></body></html";181 popup.document.write( content );182 183 var header = popup.document.createElement( "h3" );184 var message = popup.document.createTextNode( "Trace messages for " + this.textarea_name );185 header.appendChild( message );186 187 this.textarea = popup.document.createElement("textarea");188 189 // name it so we can reuse it; avoid naming conflicts with existing textareas.190 191 this.textarea.id = this.textarea_id;192 193 this.textarea.style.width = "95%";194 this.textarea.style.height = "15em";195 196 popup.document.body.appendChild( header );197 popup.document.body.appendChild(this.textarea);198 199 } // end of if textarea did not already exist.200 201 } // end of if this object did not have a textarea set.202 203 this.textarea.value = "";204 this.state = "on";205 206 }; // end of ddtOnPopup()207 208 163 // -------------------------------- 209 164 210 165 /** 211 * turn off debugging messages in popup. 212 */ 213 214 DDT.prototype._ddtOffPopup = function() 215 { 216 this.textarea.value = ""; 217 this.textarea = null; 218 this.state = "off"; 219 } 220 221 // ---------------------------------- 222 223 /** 224 * toggle debug message on/off state in popup. 225 */ 226 227 DDT.prototype._ddtTogglePopup = function() 166 * log a message 167 * 168 * writes a debugging trace message to debug popup if trace messages for this 169 * object have been turned on. 170 */ 171 172 DDT.prototype._ddt = function( file, line, msg ) 228 173 { 229 174 230 175 if ( this.state == "on" ) 231 this._ddtOff(); 232 else 233 this._ddtOnPopup(); 234 235 } 236 237 // -------------------------------- 238 239 /** 240 * log a message 241 * 242 * dumps a debugging message to debug textarea if trace messages for this 243 * object have been turned on. 244 */ 245 246 DDT.prototype._ddt = function( msg ) 247 { 248 249 if ( this.state == "on" ) 250 { 251 this.textarea.value += msg + "\n"; 176 { 177 this.popup.document.write( "(" + this.name + ") " + file + ":" + line + " - " + msg + "<br>\n" ); 252 178 } 253 179 … … 263 189 */ 264 190 265 DDT.prototype._ddtDumpObject = function( msg, obj ) 266 { 267 268 if ( this.textarea != null ) 191 DDT.prototype._ddtDumpObject = function( file, line, msg, obj ) 192 { 193 194 this._ddt( "ddt.js","194", file, line, msg ); 195 196 for (var x in obj) 269 197 { 270 198 271 this.textarea.value += msg + "\n"; 272 273 for (var x in obj) 274 { 275 276 this.textarea.value += " " + x + "\n"; 277 } 278 199 if ( typeof obj[x] == 'string' ) 200 { 201 202 // avoid getting caught by ddtpreproc.php script. 203 204 this._ddt( 205 file, line, "member - '" + x + "' = '" + obj[x].substr(0,40) + "'" 206 ); 207 } 208 else 209 { 210 this._ddt( 211 file, line, "member - '" + x + "'" 212 ); 213 } 279 214 } 280 215 … … 288 223 * displays a tree of html elements. Design based on method from htmlarea.js 289 224 * 225 * @see ddtpreproc.php 290 226 * @param root top of tree to display 291 227 * @param level depth level. … … 297 233 var ns = HTMLArea.is_ie ? root.scopeName : root.prefix; 298 234 299 this._ddt(level + "- " + tag + " [" + ns + "]"); 235 // FIXME: separated on multiple lines to avoid being picked 236 // up by ddtpreproc.php 237 238 this._ddt( 239 ":","0", level + "- " + tag + " [" + ns + "]" 240 ); 300 241 301 242 for (i = root.firstChild; i; i = i.nextSibling) -
branches/unified_backend/devutils/ddtpreproc.php.in
r72 r84 1 1 #![@@PHP@@] 2 <?php 2 3 3 4 // [NOSTRIP … … 20 21 // NOSTRIP] 21 22 22 23 // TO BE DEVELOPED 23 // attempt to prevent this script from being run through the webserver. 24 25 if ( @$_SERVER["HTTP_HOST"] != NULL ) 26 die( "No" ); 27 28 /** 29 * ddtpreproc 30 * 31 * Since Javascript does not seem to have variables similar to __FILE__ and 32 * __LINE__ from php, this script pre-processes .js files to patch in file and 33 * line numbers into all _ddt() calls. 34 * 35 * After making an editing pass through the .js files, this script should be 36 * called to update the line numbers. 37 * 38 * @package xinha 39 * @subpackage devutils 40 * @author Yermo Lamers 41 * @copyright DTLink, LLC 2005 42 * 43 * @todo handle multi-line comments. 44 * @todo handle nested ");" 45 * @todo distinguish between _ddt( $file, $line, $msg ) and _ddt( "file", "100", "message" ); 46 */ 47 48 // -------------------------------------------------- 49 50 /** 51 * primitive ddt() placeholder. 52 * 53 * edit this function to turn on debugging messages. 54 */ 55 56 function _ddt( $file, $line, $msg ) 57 { 58 59 // uncomment this line to turn on debugging messages. 60 61 print( basename( $file ) . ":$line - $msg\n" ); 62 63 } 64 65 /* ----------------------------------------------------- */ 66 67 /** 68 * recursive apply 69 * 70 * recurse through a directory looking for files that match the given expression 71 * and apply the given function. 72 */ 73 74 function rapply( $path, $regex, $function ) 75 { 76 77 _ddt( __FILE__, __LINE__, "rapply(): top with path '$path', regex '$regex', function '$function'" ); 78 79 // does the directory or file exist? 80 81 if ( !file_exists( $path )) 82 return false ; 83 84 // if path is not a directory, and it matches the regex, apply the function. 85 86 if ( !is_dir( $path ) ) 87 { 88 89 if ( preg_match( $regex, $path ) ) 90 { 91 92 if ( ! $function( $path ) ) 93 { 94 95 _ddt( __FILE__, __LINE__, "rapply(): function '$function' returned false" ); 96 97 return false ; 98 } 99 } 100 101 return true ; 102 } 103 else 104 { 105 106 // process the entries in the directory 107 108 if (( $dh = opendir($path)) === false ) 109 { 110 _ddt( __FILE__, __LINE__, "rapply(): unable to open directory '$path'" ); 111 112 return false ; 113 } 114 115 while (false !== ($filename = readdir( $dh ))) 116 { 117 if (( $filename != ".") && ( $filename != ".." )) 118 { 119 if ( ! rapply( "$path/$filename", $regex, $function )) 120 { 121 return false ; 122 } 123 } 124 } 125 126 closedir($dh); 127 128 return true ; 129 130 } // end of if it's a directory 131 132 } // end of rapply() 133 134 // -------------------------------------------------------------- 135 136 /** 137 * process _ddt() calls in a javascript file. 138 * 139 * Adds in file and linenumber arguments to all _ddt() calls 140 * in a javascript file. Handles the case where no file and line 141 * info has been added (a fresh debug statement) and where ones 142 * are already present. 143 * 144 * @todo handle rare case of multiple ddt() calls on a single line. 145 * @todo improve ddt identification regex so that it handles embedded ); 146 */ 147 148 function procDDT( $path ) 149 { 150 151 _ddt( __FILE__, __LINE__, "procDDT(): top with path '$path'" ); 152 153 if ( !file_exists( $path ) ) 154 { 155 _ddt( __FILE__, __LINE__, "procDDT(): file '$path' does not exist" ); 156 return false; 157 } 158 159 // load into an array. loop over each line in the array doing the replace. 160 // then write the whole thing out. 161 162 if (( $content_array = file( $path )) === false ) 163 { 164 165 _ddt( __FILE__, __LINE__, "procDDT(): file() returned false on '$path'" ); 166 return false; 167 } 168 169 _ddt( __FILE__, __LINE__, "procDDT(): read in file with '" . count( $content_array ) . "' lines" ); 170 171 // now loop over the array doing a search and replace 172 173 foreach ( $content_array as $index => $line ) 174 { 175 176 // do we have a _ddt() call with existing file and line numbers? 177 // 178 // we make a nasty assmption here that ); will not be present inside the debug message. 179 // Doing the double regex here is wasteful ... 180 181 $line_number = $index + 1; 182 183 if ( preg_match( "/_ddt\([\s]*\"[^,]+\"[\s]*,[\s]*\"[0-9]+\"[\s]*,.*?\);/", $line ) ) 184 { 185 186 _ddt( __FILE__, __LINE__, "procDDT(): found an existing file/line ddt on line $index" ); 187 188 $content_array[ $index ] = preg_replace( "/_ddt\([\s]*\"[^,]+\"[\s]*,[\s]*\"[0-9]+\"[\s]*,[\s]*(.*?)[\s]*\);/", "_ddt( \"" . basename( $path ) . "\",\"$line_number\", $1 );", $line ); 189 190 } 191 else if ( preg_match( "/_ddt\((.*?)\);/", $line ) ) 192 { 193 194 _ddt( __FILE__, __LINE__, "procDDT(): found a new ddt on line $index" ); 195 196 $content_array[ $index ] = preg_replace( "/_ddt\((.*?)\);/", "_ddt( \"" . basename( $path ) . "\",\"$line_number\", $1 );", $line ); 197 198 _ddt( __FILE__, __LINE__, "procDDT(): existing line changed to '" . $content_array[$index] . "'" ); 199 } 200 201 } // end of foreach. 202 203 // write the thing out. 204 205 if (( $fh = fopen( $path, "w" )) == NULL ) 206 { 207 208 _ddt( __FILE__, __LINE__, "procDDT(): unable to open '$path' for writing" ); 209 210 return false; 211 212 } 213 214 foreach ( $content_array as $index => $line ) 215 fputs( $fh, $line ); 216 217 fclose( $fh ); 218 219 _ddt( __FILE__, __LINE__, "procDDT(): bottom" ); 220 221 return true; 222 223 } // end of procDDT() 224 225 // ------------------------------------------------------------------ 226 227 // check usage. 228 229 if ( $argc != 2 ) 230 { 231 die( "Usage: ddtpreproc.php path_to_xinha_root\n" ); 232 } 233 234 $dir_path = $argv[1]; 235 236 if ( ! file_exists( $dir_path ) ) 237 { 238 die( "Path '$dir_path' does not exist\n" ); 239 } 240 241 // recurse through the directory applying the procDDT function on all 242 // files ending in ".js". 243 244 rapply( $dir_path, "/.*js$/", "procDDT" ); 245 246 // END 247 248 ?> -
branches/unified_backend/examples/full_example-body.html
r72 r84 38 38 39 39 <script type="text/javascript"> 40 // var startupDDT = new DDT( "startup_trace" );41 // startupDDT._ddtOnPopup();40 var startupDDT = new DDT( "startup" ); 41 startupDDT._ddtOn(); 42 42 </script> 43 43 -
branches/unified_backend/examples/simple_example.html
r72 r84 40 40 <script type="text/javascript"> 41 41 42 var startupDDT = new DDT( "startup" ); 43 42 44 // uncomment the following if you would like to trace out the 43 45 // startup functions. This only works in the debugging version 44 46 // of Xinha_ub, not the runtime. 45 // 46 47 // var startupDDT = new DDT( "startup_trace" ); 48 // startupDDT._ddtOnPopup(); 47 48 startupDDT._ddtOn(); 49 49 50 50 </script> … … 69 69 // at the end.) 70 70 71 startupDDT._ddt( "simple_example.html", "71", "Setting up xinha_init()" ); 72 71 73 xinha_init = xinha_init ? xinha_init : function() 72 74 { 75 76 startupDDT._ddt( "simple_example.html", "76", "xinha_init called from window.onload handler for simple_example.html" ); 77 73 78 /** STEP 1 *************************************************************** 74 79 * First, what are the plugins you will be using in the editors on this … … 88 93 // by default. 89 94 95 startupDDT._ddt( "simple_example.html", "92", "calling HTMLArea.loadplugins()" ); 96 90 97 if ( !HTMLArea.loadPlugins( xinha_plugins_minimal, xinha_init)) return; 91 98 92 99 /** STEP 2 *************************************************************** 93 100 * Now, what are the names of the textareas you will be turning into 94 * editors? 101 * editors? For this example we're only loading 1 editor. 95 102 ************************************************************************/ 96 103 97 104 xinha_editors = xinha_editors ? xinha_editors : 98 105 [ 99 'TextArea1', 100 'TextArea2' 106 'TextArea1' 101 107 ]; 102 108 … … 114 120 *************************************************************************/ 115 121 122 startupDDT._ddt( "simple_example.html", "119", "calling HTMLArea.Config()" ); 123 116 124 xinha_config = xinha_config ? xinha_config : new HTMLArea.Config(); 117 125 … … 132 140 * editors. 133 141 ************************************************************************/ 142 143 startupDDT._ddt( "simple_example.html", "140", "calling HTMLArea.makeEditors()" ); 134 144 135 145 xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins_minimal); … … 145 155 ************************************************************************/ 146 156 157 xinha_editors.TextArea1.config.width = 700; 158 xinha_editors.TextArea1.config.height = 350; 147 159 148 160 /** STEP 5 *************************************************************** … … 151 163 ************************************************************************/ 152 164 165 startupDDT._ddt( "simple_example.html", "160", "calling HTMLArea.startEditors()" ); 166 153 167 HTMLArea.startEditors(xinha_editors); 154 168 155 169 } // end of xinha_init() 156 170 157 window.onload = xinha_init; 171 // window.onload = xinha_init; 172 158 173 </script> 159 174 </head> … … 177 192 <textarea id="TextArea1" name="TextArea1" rows="10" cols="80" style="width:100%"> 178 193 This is the content of TextArea1 from xinha_ub/examples/simple_example.html.<br> 179 The two extra <b><></b> buttons on the toolbars are to turn on two sections of 180 debugging trace messages. The first turns on trace messages in the HTMLArea 181 object which appear in a text area below. The second turns on trace messages in the 182 HTMLArea static methods which appear in a popup box. <br><br> 183 These trace messages can also be turned on from the simple_example.html file or 184 from within htmlarea.js 185 </textarea> 186 <br> 187 <br> 188 <textarea id="TextArea2" name="TextArea2" rows="10" cols="80" style="width:100%"> 189 This is the content of TextArea2 from xinha_ub/examples/simple_example.html. 194 In order to see the new debugging trace messages you will need to turn off 195 popup blockers for this site.<br> 196 These trace messages can also be turned on/off from within simple_example.html by 197 commenting out or uncomments the _ddtOn() line. The same applies to the trace 198 messages inside the HTMLArea object in htmlarea.js. 190 199 </textarea> 191 200 -
branches/unified_backend/htmlarea.js
r72 r84 149 149 * construction. This is a shorthand to clean up the calls in 150 150 * all these methods. 151 */ 152 153 HTMLArea._ddt = function( msg ) 154 { 151 * 152 * @see ddtpreproc.php 153 */ 154 155 HTMLArea._ddt = function( file, line, msg ) 156 { 157 158 // FIXME: separated onto multiple lines to avoid being 159 // picked up by ddtpreproc.php. 155 160 156 161 if ( typeof startupDDT != 'undefined' ) 157 startupDDT._ddt( msg ); 162 startupDDT._ddt( 163 file,line, msg 164 ); 158 165 159 166 } … … 428 435 ["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"], 429 436 ["killword","removeformat","toggleborders","lefttoright", "righttoleft", "separator","htmlmode","about"] 430 431 // [STRIP432 ,["object_debug_toggle"]433 ,["static_debug_toggle"]434 // STRIP]435 437 436 438 ]; … … 652 654 killword: [ "Clear MSOffice tags", ["ed_buttons_main.gif",4,3], false, function(e) {e.execCommand("killword");} ] 653 655 654 // [STRIP655 ,object_debug_toggle: [ "Toggle Debug of HTMLArea object", ["ed_buttons_main.gif",7,0], true, function(e) {e.ddt._ddtToggle();} ]656 ,static_debug_toggle: [ "Toggle Debug of HTMLArea static methods (popup)", ["ed_buttons_main.gif",7,0], true, function(e) {e.ddt._ddtTogglePopup();} ]657 // STRIP]658 659 656 }; // end of btnList definition 660 657 … … 727 724 // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists."); 728 725 729 HTMLArea._ddt( "registerButton(): WARNING [HTMLArea.Config::registerDropdown]: A dropdown with the same ID already exists.");726 HTMLArea._ddt( "htmlarea.js","726", "registerButton(): WARNING [HTMLArea.Config::registerDropdown]: A dropdown with the same ID already exists." ); 730 727 } 731 728 … … 733 730 { 734 731 // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists."); 735 HTMLArea._ddt( " registerbutton(): WARNING [HTMLArea.Config::registerDropdown]:A button with the same ID already exists.");732 HTMLArea._ddt( "htmlarea.js","732", "registerbutton(): WARNING [HTMLArea.Config::registerDropdown]:A button with the same ID already exists." ); 736 733 } 737 734 … … 763 760 { 764 761 // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists."); 765 HTMLArea._ddt( "registerDropdown(): WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");762 HTMLArea._ddt( "htmlarea.js","762", "registerDropdown(): WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists." ); 766 763 } 767 764 … … 769 766 { 770 767 // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists."); 771 HTMLArea._ddt( "registerDropdown(): WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");768 HTMLArea._ddt( "htmlarea.js","768", "registerDropdown(): WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists." ); 772 769 } 773 770 … … 829 826 { 830 827 831 HTMLArea._ddt( " loadScript(): Top with url '" + url + "' and plugin '" + plugin + "'" );828 HTMLArea._ddt( "htmlarea.js","828", "loadScript(): Top with url '" + url + "' and plugin '" + plugin + "'" ); 832 829 833 830 if (plugin) … … 873 870 { 874 871 875 HTMLArea._ddt( " init(): top" );872 HTMLArea._ddt( "htmlarea.js","872", "init(): top" ); 876 873 877 874 var head = document.getElementsByTagName("head")[0]; … … 899 896 // MSIE is not ready. 900 897 901 HTMLArea._ddt( " init(): MSIE ready state not ready '" + window.event.srcElement.readyState + "'" );898 HTMLArea._ddt( "htmlarea.js","898", "init(): MSIE ready state not ready '" + window.event.srcElement.readyState + "'" ); 902 899 903 900 return; … … 909 906 { 910 907 var url = HTMLArea._scripts[current++]; 908 909 // as we load scripts update the window title bar. 910 911 911 document.title = "[HTMLArea: loading script " + current + "/" + HTMLArea._scripts.length + "]"; 912 912 var script = document.createElement("script"); … … 914 914 script.src = url; 915 915 916 HTMLArea._ddt( " loadNextScript(): loading '" + url + "'" );916 HTMLArea._ddt( "htmlarea.js","916", "loadNextScript(): loading '" + url + "'" ); 917 917 918 918 // the magic step. evt depends on the browser (See above) … … 925 925 document.title = savetitle; 926 926 927 HTMLArea._ddt( " loadNextScript(): end of list reached. Firing HTMLAreaonLoad handler which is '" + HTMLArea.onLoad + "'" );927 HTMLArea._ddt( "htmlarea.js","927", "loadNextScript(): end of list reached. Firing HTMLAreaonLoad handler which is '" + HTMLArea.onLoad + "'" ); 928 928 929 929 // fire the onLoad handler. See HTMLArea.onload() up top. … … 932 932 HTMLArea.onload(); 933 933 } 934 }; 935 936 HTMLArea._ddt( "init(): calling first loadNextScript()" ); 934 935 }; // end of in-line loadNextScript() function. 936 937 HTMLArea._ddt( "htmlarea.js","937", "init(): calling first loadNextScript()" ); 937 938 938 939 // start the chain of script loading. … … 951 952 { 952 953 953 HTMLArea._ddt( " replaceAll(): top" );954 HTMLArea._ddt( "htmlarea.js","954", "replaceAll(): top" ); 954 955 955 956 var tas = document.getElementsByTagName("textarea"); … … 966 967 { 967 968 968 HTMLArea._ddt( " replace(): top with id '" + id + "'" );969 HTMLArea._ddt( "htmlarea.js","969", "replace(): top with id '" + id + "'" ); 969 970 970 971 var ta = HTMLArea.getElementById("textarea", id); … … 996 997 { 997 998 998 HTMLArea._ddt( " ==makeBtnImg(): top" );999 HTMLArea._ddt( "htmlarea.js","999", "makeBtnImg(): top" ); 999 1000 1000 1001 if(!doc) doc = document; … … 1064 1065 i_contain.appendChild(img); 1065 1066 1066 HTMLArea._ddt( " ==makeBtnImg(): bottom" );1067 HTMLArea._ddt( "htmlarea.js","1067", "makeBtnImg(): bottom" ); 1067 1068 1068 1069 return i_contain; … … 1098 1099 { 1099 1100 1100 HTMLArea._ddt( " loadPlugin(): loading plugin '" + pluginName + "'" );1101 HTMLArea._ddt( "htmlarea.js","1101", "loadPlugin(): loading plugin '" + pluginName + "'" ); 1101 1102 1102 1103 // Might already be loaded … … 1105 1106 { 1106 1107 1107 HTMLArea._ddt( " loadPlugins(): plugin '" + pluginName + "' already loaded" );1108 HTMLArea._ddt( "htmlarea.js","1108", "loadPlugin(): plugin '" + pluginName + "' already loaded" ); 1108 1109 1109 1110 if (callback) 1110 1111 { 1111 1112 1112 HTMLArea._ddt( " loadPlugins(): calling plugin '" + pluginName + "' callback" );1113 HTMLArea._ddt( "htmlarea.js","1113", "loadPlugin(): calling plugin '" + pluginName + "' callback" ); 1113 1114 1114 1115 callback(); … … 1120 1121 var dir = this.getPluginDir(pluginName); 1121 1122 var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g, 1122 function (str, l1, l2, l3) { 1123 function (str, l1, l2, l3) 1124 { 1123 1125 return l1 + "-" + l2.toLowerCase() + l3; 1124 }).toLowerCase() + ".js";1126 }).toLowerCase() + ".js"; 1125 1127 1126 1128 var plugin_file = dir + "/" + plugin; … … 1128 1130 if ( callback ) 1129 1131 { 1130 HTMLArea._ddt( " loadPlugin(): callback defined. Using _loadback() to load plugin" );1132 HTMLArea._ddt( "htmlarea.js","1132", "loadPlugin(): callback defined. Using _loadback() to load plugin" ); 1131 1133 1132 1134 HTMLArea._loadback(plugin_file, callback); … … 1134 1136 else 1135 1137 { 1136 HTMLArea._ddt( " loadPlugin(): callback not defined. writing javascript include line to document." );1138 HTMLArea._ddt( "htmlarea.js","1138", "loadPlugin(): callback not defined. writing javascript include line to document." ); 1137 1139 1138 1140 document.write("<script type='text/javascript' src='" + plugin_file + "'></script>"); … … 1149 1151 * files. This method is called before the HTMLArea object is 1150 1152 * constructed. 1153 * 1154 * @todo stop needlessly cloning the plugins array on each recursion. 1151 1155 */ 1152 1156 … … 1154 1158 { 1155 1159 1156 HTMLArea._ddt( " loadPlugins(): top" );1160 HTMLArea._ddt( "htmlarea.js","1160", "loadPlugins(): top - cloning plugins array." ); 1157 1161 1158 1162 // make a copy of the plugins array that we'll chip away at. … … 1171 1175 var poppedPlugin = nuPlugins.pop(); 1172 1176 1173 HTMLArea._ddt( " loadPlugins(): plugin '" + poppedPlugin + "' was already loaded" );1177 HTMLArea._ddt( "htmlarea.js","1177", "loadPlugins(): plugin '" + poppedPlugin + "' was already loaded" ); 1174 1178 1175 1179 } … … 1186 1190 { 1187 1191 1188 HTMLArea._ddt( " loadPlugins(): no plugins left to load" );1192 HTMLArea._ddt( "htmlarea.js","1192", "loadPlugins(): no plugins left to load" ); 1189 1193 1190 1194 return true; … … 1192 1196 1193 1197 // personally, I find this using a function definition as an argument to a method 1194 // really ugly. Here's we're pulling off the current plugin to load (argument 1), 1198 // really ugly (not that there's much of an alternative in Javascript). 1199 // 1200 // Here's we're pulling off the current plugin to load (argument 1), 1195 1201 // and setting the "callback function" (the function that's called after the plugin 1196 1202 // javascript file is successfully loaded) to run loadPlugins .. essentially 1197 1203 // an indirect recursive algorithm. 1204 // 1205 // FIXME: Because of this little algorithm the nuPlugins array gets 1206 // cloned on each recursion. 1198 1207 1199 1208 HTMLArea.loadPlugin( nuPlugins.pop(), … … 1210 1219 ); // this is the end of the HTMLArea.loadPlugin() recursive call. 1211 1220 1212 HTMLArea._ddt( " loadPlugins(): end" );1221 HTMLArea._ddt( "htmlarea.js","1221", "loadPlugins(): end" ); 1213 1222 1214 1223 return false; … … 1225 1234 { 1226 1235 1227 HTMLArea._ddt( " refreshPlugin(): top" );1236 HTMLArea._ddt( "htmlarea.js","1236", "refreshPlugin(): top" ); 1228 1237 1229 1238 if (typeof plugin.onGenerate == "function") 1230 1239 { 1231 HTMLArea._ddt( " refreshPlugin(): onGenerate is a function. calling onGenerate for '" + plugin + "'" );1240 HTMLArea._ddt( "htmlarea.js","1240", "refreshPlugin(): onGenerate is a function. calling onGenerate for '" + plugin + "'" ); 1232 1241 plugin.onGenerate(); 1233 1242 } … … 1235 1244 if (typeof plugin.onGenerateOnce == "function") 1236 1245 { 1237 HTMLArea._ddt( " refreshPlugin(): onGenerateOnce is a function. calling onGenerateOnce for '" + plugin + "'" );1246 HTMLArea._ddt( "htmlarea.js","1246", "refreshPlugin(): onGenerateOnce is a function. calling onGenerateOnce for '" + plugin + "'" ); 1238 1247 plugin.onGenerateOnce(); 1239 1248 plugin.onGenerateOnce = null; … … 1252 1261 var url = _editor_url || ''; 1253 1262 1254 HTMLArea._ddt( " loadStyle(): top with style '" + style + "' and plugin '" + plugin + "'" );1263 HTMLArea._ddt( "htmlarea.js","1263", "loadStyle(): top with style '" + style + "' and plugin '" + plugin + "'" ); 1255 1264 1256 1265 if (typeof plugin != "undefined") … … 1270 1279 head.appendChild(link); 1271 1280 1272 HTMLArea._ddt( " loadStyle(): appending '" + link+ "' to document" );1281 HTMLArea._ddt( "htmlarea.js","1281", "loadStyle(): appending '" + link.href + "' to document" ); 1273 1282 1274 1283 //document.write("<style type='text/css'>@import url(" + url + ");</style>"); … … 1303 1312 { 1304 1313 1305 HTMLArea._ddt( " getInnerText(): top" );1314 HTMLArea._ddt( "htmlarea.js","1314", "getInnerText(): top" ); 1306 1315 1307 1316 var txt = '', i; … … 1324 1333 * returns a clone of the given object 1325 1334 * 1335 * recurses through all the members of an object, which may contain nested 1336 * objects and/or arrays, and constructs a complete copy. 1326 1337 */ 1327 1338 … … 1329 1340 { 1330 1341 1331 HTMLArea._ddt( " cloneObject(): top" );1342 HTMLArea._ddt( "htmlarea.js","1342", "cloneObject(): top" ); 1332 1343 1333 1344 if (!obj) return null; … … 1339 1350 if (obj.constructor.toString().indexOf("function Array(") == 1) 1340 1351 { 1352 1353 HTMLArea._ddt( "htmlarea.js","1353", "cloneObject(): contructing an array object." ); 1354 1341 1355 newObj = obj.constructor(); 1342 1356 } … … 1345 1359 if (obj.constructor.toString().indexOf("function Function(") == 1) 1346 1360 { 1361 1362 HTMLArea._ddt( "htmlarea.js","1362", "cloneObject(): cloning an function object." ); 1363 1347 1364 newObj = obj; // just copy reference to it 1348 1365 } 1349 else for (var n in obj) 1350 { 1351 var node = obj[n]; 1352 if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); } 1353 else { newObj[n] = node; } 1354 } 1366 else 1367 { 1368 1369 HTMLArea._ddt( "htmlarea.js","1369", "cloneObject(): copying object members." ); 1370 1371 for (var n in obj) 1372 { 1373 var node = obj[n]; 1374 1375 if (typeof node == 'object') 1376 { 1377 newObj[n] = HTMLArea.cloneObject(node); 1378 } 1379 else 1380 { 1381 newObj[n] = node; 1382 } 1383 } 1384 1385 } // end of else we weren't passed an array or function object. 1355 1386 1356 1387 return newObj; 1357 1388 1358 }; 1389 }; // end of HTMLArea.cloneObject() 1359 1390 1360 1391 // ---------------------------------------------------------- … … 1369 1400 { 1370 1401 1371 HTMLArea._ddt( " checkSupportedBrowser(): top" );1402 HTMLArea._ddt( "htmlarea.js","1402", "checkSupportedBrowser(): top" ); 1372 1403 1373 1404 if (HTMLArea.is_gecko) … … 1405 1436 { 1406 1437 1407 HTMLArea._ddt( " getElementById(): top with tag '" + tag + "' id '" + id + "'" );1438 HTMLArea._ddt( "htmlarea.js","1438", "getElementById(): top with tag '" + tag + "' id '" + id + "'" ); 1408 1439 1409 1440 var el, i, objs = document.getElementsByTagName(tag); … … 1427 1458 { 1428 1459 1429 HTMLArea._ddt( " _postback() : top with url '" + url + "'" );1460 HTMLArea._ddt( "htmlarea.js","1460", "_postback() : top with url '" + url + "'" ); 1430 1461 1431 1462 var req = null; … … 1479 1510 { 1480 1511 1481 HTMLArea._ddt( " _getback(): top" );1512 HTMLArea._ddt( "htmlarea.js","1512", "_getback(): top" ); 1482 1513 1483 1514 var req = null; … … 1521 1552 { 1522 1553 1523 HTMLArea._ddt( " _geturlcontent(): top with url '" + url + "'" );1554 HTMLArea._ddt( "htmlarea.js","1554", "_geturlcontent(): top with url '" + url + "'" ); 1524 1555 1525 1556 var req = null; … … 1556 1587 { 1557 1588 1558 HTMLArea._ddt( " arrayContainsArray(): top" );1589 HTMLArea._ddt( "htmlarea.js","1589", "arrayContainsArray(): top" ); 1559 1590 1560 1591 var all_found = true; … … 1591 1622 { 1592 1623 1593 HTMLArea._ddt( " arrayFilter(): top" );1624 HTMLArea._ddt( "htmlarea.js","1624", "arrayFilter(): top" ); 1594 1625 1595 1626 var new_a = [ ]; … … 1628 1659 { 1629 1660 1630 HTMLArea._ddt( " _loadlang(): top" );1661 HTMLArea._ddt( "htmlarea.js","1661", "_loadlang(): top" ); 1631 1662 1632 1663 if(typeof _editor_lcbackend == "string") … … 1685 1716 { 1686 1717 1687 HTMLArea._ddt( " _lc: top with string '" + string + "'" );1718 HTMLArea._ddt( "htmlarea.js","1718", "_lc: top with string '" + string + "'" ); 1688 1719 1689 1720 if(_editor_lang == "en") … … 1727 1758 { 1728 1759 1729 HTMLArea._ddt( "h asDisplayedChildren(): top" );1760 HTMLArea._ddt( "htmlarea.js","1760", "hasDisplayedChildren(): top" ); 1730 1761 1731 1762 var children = el.childNodes; … … 1749 1780 /** 1750 1781 * _loadback() 1782 * 1783 * load a script file in the "background" and when finished invoked a provided 1784 * callback. 1751 1785 */ 1752 1786 … … 1754 1788 { 1755 1789 1756 HTMLArea._ddt( " _loadback(): top with src '" + src + "'" );1790 HTMLArea._ddt( "htmlarea.js","1790", "_loadback(): top with src '" + src + "'" ); 1757 1791 1758 1792 var head = document.getElementsByTagName("head")[0]; 1793 1794 // cross browser support. Basically this event gets fired when the 1795 // script has been completely loaded. We hook the callback into the 1796 // event. This gives us a way to be notified when the script has finished 1797 // loading. MSIE and Gecko use different events for this purpose. 1798 1759 1799 var evt = HTMLArea.is_ie ? "onreadystatechange" : "onload"; 1760 1800 … … 1770 1810 head.appendChild(script); 1771 1811 1772 }; 1812 HTMLArea._ddt( "htmlarea.js","1812", "_loadback(): script tag to load javascript file appended to head section." ); 1813 1814 }; // end of _loadback() 1773 1815 1774 1816 // ----------------------------------------------------- … … 1781 1823 { 1782 1824 1783 HTMLArea._ddt( " collectionToArray(): top" );1825 HTMLArea._ddt( "htmlarea.js","1825", "collectionToArray(): top" ); 1784 1826 1785 1827 var array = [ ]; … … 1801 1843 { 1802 1844 1803 HTMLArea._ddt( "makeEditors(): top" ); 1804 1805 if(typeof default_config == 'function') 1806 { 1845 HTMLArea._ddt( "htmlarea.js","1845", "makeEditors(): top" ); 1846 1847 if ( typeof default_config == 'function') 1848 { 1849 1850 HTMLArea._ddt( "htmlarea.js","1850", "makeEditors(): default config is a function" ); 1807 1851 default_config = default_config(); 1808 1852 } … … 1811 1855 for(var x = 0; x < editor_names.length; x++) 1812 1856 { 1857 1858 HTMLArea._ddt( "htmlarea.js","1858", "makeEditors(): making editor '" + editor_names[x] + "' and copying in cloned default_config" ); 1859 1813 1860 editors[editor_names[x]] = new HTMLArea(editor_names[x], HTMLArea.cloneObject(default_config)); 1814 if(plugin_names) 1861 1862 if ( plugin_names ) 1815 1863 { 1816 1864 for(var i = 0; i < plugin_names.length; i++) 1817 1865 { 1866 1867 HTMLArea._ddt( "htmlarea.js","1867", "makeEditors(): registering plugin '" + plugin_names[i] + "' for editor '" + editor_names[x] + "'" ); 1868 1818 1869 editors[editor_names[x]].registerPlugin(eval(plugin_names[i])); 1819 1870 } … … 1827 1878 1828 1879 /** 1829 * startEditors() 1880 * startEditors() - front end to generate() 1881 * 1882 * loops through all editors on the page and generates each. 1830 1883 */ 1831 1884 … … 1833 1886 { 1834 1887 1835 HTMLArea._ddt( " startEditors(): top" );1888 HTMLArea._ddt( "htmlarea.js","1888", "startEditors(): top" ); 1836 1889 1837 1890 for(var i in editors) … … 1852 1905 { 1853 1906 1854 HTMLArea._ddt( " _makeColor(): top" );1907 HTMLArea._ddt( "htmlarea.js","1907", "_makeColor(): top" ); 1855 1908 1856 1909 if (typeof v != "number") … … 2018 2071 { 2019 2072 2020 HTMLArea._ddt( " getHTMLWrapper(): top" );2073 HTMLArea._ddt( "htmlarea.js","2073", "getHTMLWrapper(): top" ); 2021 2074 2022 2075 var html = ""; … … 2216 2269 { 2217 2270 2218 HTMLArea._ddt( " addClasses(): top" );2271 HTMLArea._ddt( "htmlarea.js","2271", "addClasses(): top" ); 2219 2272 2220 2273 if(el != null) … … 2250 2303 { 2251 2304 2252 HTMLArea._ddt( " removeClasses(): top" );2305 HTMLArea._ddt( "htmlarea.js","2305", "removeClasses(): top" ); 2253 2306 2254 2307 var existing = el.className.trim().split(); … … 2362 2415 HTMLArea._addEvent = function(el, evname, func) 2363 2416 { 2417 2418 HTMLArea._ddt( "htmlarea.js","2418", "_addEvent(): adding event for '" + evname + "' func '" + func.toString().substring(0,100) + "'" ); 2419 2364 2420 if (HTMLArea.is_ie) 2365 2421 { … … 2478 2534 // create a ddt debug trace object. textarea is a string here. 2479 2535 2480 this.ddt = new DDT( textarea );2536 this.ddt = new DDT( textarea ); 2481 2537 2482 2538 // uncomment to turn on debugging messages. 2483 2539 2484 //this.ddt._ddtOn();2540 this.ddt._ddtOn(); 2485 2541 // STRIP] 2486 2542 2487 this.ddt._ddt( "HTMLArea(): DDT Trace System Initialized.");2543 this.ddt._ddt( "htmlarea.js","2543", "HTMLArea(): DDT Trace System Initialized." ); 2488 2544 2489 2545 this._htmlArea = null; … … 2539 2595 } // end of if we are a supported browser. 2540 2596 2541 this.ddt._ddt( " HTMLArea(): end" );2597 this.ddt._ddt( "htmlarea.js","2597", "HTMLArea(): end" ); 2542 2598 2543 2599 }; // end of HTMLArea() constructor … … 2552 2608 { 2553 2609 2554 this.ddt._ddt( " _createToolbar(): top" );2610 this.ddt._ddt( "htmlarea.js","2610", "_createToolbar(): top" ); 2555 2611 2556 2612 var editor = this; // to access this in nested functions … … 2579 2635 { 2580 2636 2581 this.ddt._ddt( " registerPanel(): top with side '" + side + "'" );2637 this.ddt._ddt( "htmlarea.js","2637", "registerPanel(): top with side '" + side + "'" ); 2582 2638 2583 2639 if(!side) side = 'right'; … … 2622 2678 { 2623 2679 2624 this.ddt._ddt( " _createToolbar1(): top" );2680 this.ddt._ddt( "htmlarea.js","2680", "_createToolbar1(): top" ); 2625 2681 2626 2682 // creates a new line in the toolbar … … 2629 2685 { 2630 2686 2631 editor.ddt._ddt( " newLine(): top" );2687 editor.ddt._ddt( "htmlarea.js","2687", "newLine(): top" ); 2632 2688 2633 2689 var table = document.createElement("table"); … … 2665 2721 { 2666 2722 2667 HTMLArea._ddt( " ==setButtonStatus() : top with id '" + id + "' value '" + newval + '"' );2723 HTMLArea._ddt( "htmlarea.js","2723", "setButtonStatus() : top with id '" + id + "' value '" + newval + '"' ); 2668 2724 2669 2725 var oldval = this[id]; … … 2721 2777 { 2722 2778 2723 HTMLArea._ddt( " ==createSelect(): top with text '" + txt + "'" );2779 HTMLArea._ddt( "htmlarea.js","2779", "createSelect(): top with text '" + txt + "'" ); 2724 2780 2725 2781 var options = null; … … 2805 2861 } 2806 2862 2807 HTMLArea._ddt( " createSelect(): end" );2863 HTMLArea._ddt( "htmlarea.js","2863", "createSelect(): end" ); 2808 2864 2809 2865 return el; … … 2820 2876 { 2821 2877 2822 editor.ddt._ddt( " createButton(): top with text '" + txt + "'" );2878 editor.ddt._ddt( "htmlarea.js","2878", "createButton(): top with text '" + txt + "'" ); 2823 2879 2824 2880 // the element that will be created … … 3040 3096 { 3041 3097 3042 this.ddt._ddt( " _createStatusBar(): top" );3098 this.ddt._ddt( "htmlarea.js","3098", "_createStatusBar(): top" ); 3043 3099 3044 3100 var statusbar = document.createElement("div"); … … 3074 3130 { 3075 3131 3076 this.ddt._ddt( " generate(): top" );3132 this.ddt._ddt( "htmlarea.js","3132", "generate(): top" ); 3077 3133 3078 3134 var editor = this; // we'll need "this" in some nested functions … … 3088 3144 if (typeof EnterParagraphs == 'undefined') 3089 3145 { 3146 3147 this.ddt._ddt( "htmlarea.js","3147", "generate(): mozParaHandler config set to 'best'. Loading EnterParagraphs" ); 3148 3090 3149 EnterParagraphs = 'null'; 3091 3150 HTMLArea._loadback … … 3138 3197 textarea.parentNode.insertBefore(htmlarea, textarea); 3139 3198 3199 this.ddt._ddt( "htmlarea.js","3199", "generate(): creating toolbar" ); 3200 3140 3201 // creates & appends the toolbar 3141 3202 this._createToolbar(); … … 3164 3225 // } 3165 3226 3227 this.ddt._ddt( "htmlarea.js","3227", "generate(): adding panels" ); 3228 3166 3229 // Add the panels 3167 3230 for(var i in this._panels) … … 3169 3232 innerEditor.appendChild(this._panels[i].div); 3170 3233 } 3234 3235 this.ddt._ddt( "htmlarea.js","3235", "generate(): creating Status Bar" ); 3171 3236 3172 3237 // creates & appends the status bar … … 3195 3260 { 3196 3261 3197 this.ddt._ddt( " generate(): f.onsubmit(): top" );3262 this.ddt._ddt( "htmlarea.js","3262", "generate(): f.onsubmit(): top" ); 3198 3263 3199 3264 var a = this.__msh_prevOnSubmit; … … 3234 3299 { 3235 3300 3236 this.ddt._ddt( " generate(): f.onreset(): top" );3301 this.ddt._ddt( "htmlarea.js","3301", "generate(): f.onreset(): top" ); 3237 3302 3238 3303 var a = this.__msh_prevOnReset; … … 3269 3334 textarea.style.display = "none"; 3270 3335 3336 this.ddt._ddt( "htmlarea.js","3336", "generate(): calculating starting size" ); 3337 3271 3338 // Calculate the starting size, EXCLUDING THE TOOLBAR & STATUS BAR (always) 3272 3339 var height = null; … … 3305 3372 this.notifyOn('panel_change',function(){editor.setInnerSize();}); 3306 3373 3307 this.ddt._ddt( " generate(): bottom before timeout call to initIframe()" );3374 this.ddt._ddt( "htmlarea.js","3374", "generate(): bottom before timeout call to initIframe()" ); 3308 3375 3309 3376 // IMPORTANT: we have to allow Mozilla a short time to recognize the … … 3327 3394 var editor = this; 3328 3395 3329 this.ddt._ddt( " initFrame(): top" );3396 this.ddt._ddt( "htmlarea.js","3396", "initFrame(): top" ); 3330 3397 3331 3398 try … … 3417 3484 editor._iframe.contentWindow, 3418 3485 ["mousedown"], 3419 function() { editor.activateEditor(); } 3420 ); 3486 function() 3487 { 3488 3489 editor.ddt._ddt( "htmlarea.js","3489", "_iframe.contentWindow mouse down event. activating editor" ); 3490 editor.activateEditor(); 3491 } 3492 ); 3421 3493 } 3422 3494 else … … 3428 3500 // intercept some events; for updating the toolbar & keyboard handlers 3429 3501 3430 HTMLArea._addEvents 3431 (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"], 3432 function (event) { 3502 HTMLArea._addEvents( doc, 3503 ["keydown", "keypress", "mousedown", "mouseup", "drag"], 3504 function (event) 3505 { 3433 3506 return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event); 3434 });3507 }); 3435 3508 3436 3509 // check if any plugins have registered refresh handlers … … 3442 3515 } 3443 3516 3444 if (typeof editor._onGenerate == "function") { editor._onGenerate();} 3517 // do not become cross-eyed and think this is the same as the 3518 // statement that follows it. note the "_" 3519 3520 if (typeof editor._onGenerate == "function") 3521 { 3522 editor._onGenerate(); 3523 } 3445 3524 3446 3525 setTimeout(function() { … … 3475 3554 { 3476 3555 3477 this.ddt._ddt( " setInnerSize(): top with width '" + width + "' height '" + height + "'" );3556 this.ddt._ddt( "htmlarea.js","3556", "setInnerSize(): top with width '" + width + "' height '" + height + "'" ); 3478 3557 3479 3558 if (typeof width == 'undefined' || width == null) … … 3603 3682 HTMLArea.prototype.addPanel = function(side) 3604 3683 { 3684 3685 this.ddt._ddt( "htmlarea.js","3685", "addPanel() : top with side '" + side + "'" ); 3686 3605 3687 var div = document.createElement('div'); 3606 3688 div.side = side; … … 3620 3702 HTMLArea.prototype.removePanel = function(panel) 3621 3703 { 3704 3705 this.ddt._ddt( "htmlarea.js","3705", "removePanel() : top" ); 3706 3622 3707 this._panels[panel.side].div.removeChild(panel); 3623 3708 var clean = [ ]; … … 3633 3718 this.notifyOf('panel_change', {'action':'remove','panel':panel}); 3634 3719 3635 } 3720 } // end of removePanel() 3636 3721 3637 3722 /** … … 3641 3726 HTMLArea.prototype.hidePanel = function(panel) 3642 3727 { 3728 3729 this.ddt._ddt( "htmlarea.js","3729", "hidePanel() : top" ); 3730 3643 3731 if (panel) 3644 3732 { … … 3654 3742 HTMLArea.prototype.showPanel = function(panel) 3655 3743 { 3744 3745 this.ddt._ddt( "htmlarea.js","3745", "showPanel() : top" ); 3746 3656 3747 if ( panel ) 3657 3748 { … … 3667 3758 HTMLArea.prototype.hidePanels = function(sides) 3668 3759 { 3760 3761 this.ddt._ddt( "htmlarea.js","3761", "hidePanels() : top" ); 3762 3669 3763 if(typeof sides == 'undefined') 3670 3764 { … … 3691 3785 HTMLArea.prototype.showPanels = function(sides) 3692 3786 { 3787 3788 this.ddt._ddt( "htmlarea.js","3788", "showPanels() : top" ); 3789 3693 3790 if(typeof sides == 'undefined') 3694 3791 { … … 3708 3805 } 3709 3806 3807 // ------------------------------------------------------------------- 3808 3710 3809 /** 3711 3810 * activateEditor … … 3715 3814 { 3716 3815 3717 this.ddt._ddt( " activateEditor(): top" );3816 this.ddt._ddt( "htmlarea.js","3816", "activateEditor(): top - called by '" + HTMLArea.prototype.activateEditor.caller.toString().substring(0,100) + "'" ); 3718 3817 3719 3818 if (HTMLArea.is_gecko && this._doc.designMode != 'on') … … 3721 3820 3722 3821 try{HTMLArea.last_on.designMode = 'off';} catch(e) { } 3822 3823 this.ddt._ddt( "htmlarea.js","3823", "activateEditor(): _iframe.style.display is '" + this._iframe.style.display + "'" ); 3723 3824 3724 3825 if(this._iframe.style.display == 'none') … … 3730 3831 else 3731 3832 { 3833 3834 this.ddt._ddt( "htmlarea.js","3834", "activateEditor(): setting designMode to on" ); 3835 3732 3836 this._doc.designMode = 'on'; 3733 3837 } … … 3735 3839 else 3736 3840 { 3841 3842 this.ddt._ddt( "htmlarea.js","3842", "activateEditor(): Setting contentEditable to true" ); 3843 3737 3844 this._doc.body.contentEditable = true; 3738 3845 } … … 3740 3847 HTMLArea.last_on = this._doc; 3741 3848 3849 this.ddt._ddt( "htmlarea.js","3849", "activateEditor(): end" ); 3850 3742 3851 } // end of activateEditor() 3743 3852 3853 // -------------------------------------------------------------- 3854 3744 3855 /** 3745 3856 * deactivateEditor() … … 3749 3860 { 3750 3861 3751 this.ddt._ddt( " deactivateEditor(): top" );3862 this.ddt._ddt( "htmlarea.js","3862", "deactivateEditor(): top" ); 3752 3863 3753 3864 if (HTMLArea.is_gecko && this._doc.designMode == 'on') … … 3762 3873 } 3763 3874 3875 // -------------------------------------------------------------- 3764 3876 3765 3877 /** … … 3849 3961 { 3850 3962 3851 this.ddt._ddt( " setFullHTML(): top" );3963 this.ddt._ddt( "htmlarea.js","3963", "setFullHTML(): top" ); 3852 3964 3853 3965 var save_multiline = RegExp.multiline; … … 3889 4001 * registerPlugin() 3890 4002 * 3891 * Create the specified plugin and register it with this HTMLArea 4003 * Create the specified plugin and register it with this HTMLArea instance. 3892 4004 * return the plugin created to allow refresh when necessary 3893 4005 */ … … 3896 4008 { 3897 4009 3898 this.ddt._ddt( " registerPlugin(): top" );4010 this.ddt._ddt( "htmlarea.js","4010", "registerPlugin(): top" ); 3899 4011 3900 4012 var plugin = arguments[0]; … … 3918 4030 { 3919 4031 3920 this.ddt._ddt( " registerPlugin2(): top" );4032 this.ddt._ddt( "htmlarea.js","4032", "registerPlugin2(): top" ); 3921 4033 3922 4034 if (typeof plugin == "string") … … 3926 4038 { 3927 4039 3928 this.ddt._ddt( " registerPlugin2(): INTERNAL ERROR: plugin is undefined. " );4040 this.ddt._ddt( "htmlarea.js","4040", "registerPlugin2(): INTERNAL ERROR: plugin is undefined. " ); 3929 4041 3930 4042 /* FIXME: This should never happen. But why does it do? */ … … 4000 4112 var editor = this; 4001 4113 4002 this.ddt._ddt( " _wordClean(): top" );4114 this.ddt._ddt( "htmlarea.js","4114", "_wordClean(): top" ); 4003 4115 4004 4116 var stats = … … 4117 4229 // this.forceRedraw(); 4118 4230 4119 this.ddt._ddt( " _wordClean(): bottom" );4231 this.ddt._ddt( "htmlarea.js","4231", "_wordClean(): bottom" ); 4120 4232 4121 4233 this.updateToolbar(); … … 4132 4244 { 4133 4245 4134 this.ddt._ddt( " _clearFonts(): top" );4246 this.ddt._ddt( "htmlarea.js","4246", "_clearFonts(): top" ); 4135 4247 4136 4248 var D = this.getInnerHTML(); … … 4170 4282 { 4171 4283 4172 this.ddt._ddt( " _splitBlock(): top" );4284 this.ddt._ddt( "htmlarea.js","4284", "_splitBlock(): top" ); 4173 4285 4174 4286 this._doc.execCommand('formatblock', false, '<div>'); … … 4184 4296 { 4185 4297 4186 this.ddt._ddt( " forceRedraw(): top" );4298 this.ddt._ddt( "htmlarea.js","4298", "forceRedraw(): top" ); 4187 4299 4188 4300 this._doc.body.style.visibility = "hidden"; … … 4202 4314 { 4203 4315 4204 this.ddt._ddt( " forceRedraw(): top _editMode is '" + this._editMode + "'" );4316 this.ddt._ddt( "htmlarea.js","4316", "focusEditor(): top _editMode is '" + this._editMode + "'" ); 4205 4317 4206 4318 switch (this._editMode) … … 4250 4362 { 4251 4363 4252 this.ddt._ddt( " _undoTakeSnapshot(): top" );4364 this.ddt._ddt( "htmlarea.js","4364", "_undoTakeSnapshot(): top" ); 4253 4365 4254 4366 ++this._undoPos; … … 4287 4399 { 4288 4400 4289 this.ddt._ddt( " undo(): top" );4401 this.ddt._ddt( "htmlarea.js","4401", "undo(): top" ); 4290 4402 4291 4403 if (this._undoPos > 0) … … 4306 4418 { 4307 4419 4308 this.ddt._ddt( " redo(): top" );4420 this.ddt._ddt( "htmlarea.js","4420", "redo(): top" ); 4309 4421 4310 4422 if (this._undoPos < this._undoQueue.length - 1) … … 4325 4437 { 4326 4438 4327 this.ddt._ddt( " disableToolbar(): top" );4439 this.ddt._ddt( "htmlarea.js","4439", "disableToolbar(): top" ); 4328 4440 4329 4441 if(typeof except == 'undefined') … … 4357 4469 { 4358 4470 4359 this.ddt._ddt( " enableToolbar(): top" );4471 this.ddt._ddt( "htmlarea.js","4471", "enableToolbar(): top" ); 4360 4472 4361 4473 this.updateToolbar(); … … 4374 4486 var ancestors = null; 4375 4487 4376 this.ddt._ddt( " updateToolbar(): top" );4488 this.ddt._ddt( "htmlarea.js","4488", "updateToolbar(): top" ); 4377 4489 4378 4490 if (!text) … … 4388 4500 { 4389 4501 4390 this.ddt._ddt( " updateToolbar(): INTERNAL ERROR" );4502 this.ddt._ddt( "htmlarea.js","4502", "updateToolbar(): INTERNAL ERROR" ); 4391 4503 4392 4504 // hell knows why we get here; this … … 4470 4582 { 4471 4583 4472 this.ddt._ddt( " updateToolbar(): INTERNAL ERROR" );4584 this.ddt._ddt( "htmlarea.js","4584", "updateToolbar(): INTERNAL ERROR" ); 4473 4585 4474 4586 // the impossible really happens. … … 4689 4801 } 4690 4802 4803 this.ddt._ddt( "htmlarea.js","4803", "updateToolbar(): end" ); 4804 4691 4805 } // end of updateToolbar() 4692 4806 … … 4703 4817 { 4704 4818 4705 this.ddt._ddt( " insertNodeAtSelection(): top" );4819 this.ddt._ddt( "htmlarea.js","4819", "insertNodeAtSelection(): top" ); 4706 4820 4707 4821 if (!HTMLArea.is_ie) … … 4776 4890 { 4777 4891 4778 this.ddt._ddt( " getParentElement(): top" );4892 this.ddt._ddt( "htmlarea.js","4892", "getParentElement(): top" ); 4779 4893 4780 4894 if (typeof sel == 'undefined') … … 4843 4957 { 4844 4958 4845 this.ddt._ddt( " getAllAncestors(): top" );4959 this.ddt._ddt( "htmlarea.js","4959", "getAllAncestors(): top" ); 4846 4960 4847 4961 var p = this.getParentElement(); … … 4868 4982 HTMLArea.prototype._getFirstAncestor = function(sel, types) 4869 4983 { 4984 4985 this.ddt._ddt( "htmlarea.js","4985", "_getFirstAncestor(): top" ); 4986 4870 4987 var prnt = this._activeElement(sel); 4871 4988 if(prnt == null) … … 4921 5038 { 4922 5039 4923 this.ddt._ddt( " _activeElement(): top" );5040 this.ddt._ddt( "htmlarea.js","5040", "_activeElement(): top" ); 4924 5041 4925 5042 if(sel == null) return null; 4926 if(this._selectionEmpty(sel)) return null; 5043 if ( this._selectionEmpty(sel) ) 5044 { 5045 this.ddt._ddt( "htmlarea.js", "5046", "_activeElement(): _selectionEmpty returned true. Returning null" ); 5046 return null; 5047 } 4927 5048 4928 5049 if(HTMLArea.is_ie) … … 4979 5100 if(! sel.isCollapsed) 4980 5101 { 5102 5103 this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): selection is not collapsed" ); 5104 4981 5105 if(sel.anchorNode.nodeType == 1) 4982 5106 { 5107 this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): nodeType is 1. Returning sel.anchorNode" ); 5108 4983 5109 return sel.anchorNode; 4984 5110 } 4985 5111 } 5112 5113 this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): bottom" ); 5114 4986 5115 return null; 4987 5116 } … … 4998 5127 { 4999 5128 5000 this.ddt._ddt( "_selectionEmpty(): top" ); 5001 5002 if(!sel) return true; 5129 this.ddt._ddt( "htmlarea.js","5117", "_selectionEmpty(): top" ); 5130 5131 if (!sel) 5132 { 5133 this.ddt._ddt( "htmlarea.js","5131", "_selectionEmpty(): no selection" ); 5134 return true; 5135 } 5003 5136 5004 5137 if(HTMLArea.is_ie) … … 5008 5141 else if(typeof sel.isCollapsed != 'undefined') 5009 5142 { 5143 this.ddt._ddt( "htmlarea.js", "5141", "_selectionEmpty(): isCollapsed" ); 5010 5144 return sel.isCollapsed; 5011 5145 } 5012 5146 5147 this.ddt._ddt( "htmlarea.js", "5141", "_selectionEmpty(): bottom. returning true." ); 5148 5013 5149 return true; 5014 5150 … … 5024 5160 { 5025 5161 5026 this.ddt._ddt( " _getAncestorBlock(): top" );5162 this.ddt._ddt( "htmlarea.js","5143", "_getAncestorBlock(): top" ); 5027 5163 5028 5164 // Scan upwards to find a block level element that we can change or apply to … … 5081 5217 { 5082 5218 5083 this.ddt._ddt( " _createImplicitBlock(): top" );5219 this.ddt._ddt( "htmlarea.js","5200", "_createImplicitBlock(): top" ); 5084 5220 5085 5221 // expand it until we reach a block element in either direction … … 5227 5363 { 5228 5364 5229 this.ddt._ddt( " selectNodeContents(): top" );5365 this.ddt._ddt( "htmlarea.js","5346", "selectNodeContents(): top" ); 5230 5366 5231 5367 this.focusEditor(); … … 5288 5424 { 5289 5425 5290 this.ddt._ddt( " insertHTML(): top" );5426 this.ddt._ddt( "htmlarea.js","5407", "insertHTML(): top" ); 5291 5427 5292 5428 var sel = this._getSelection(); … … 5325 5461 { 5326 5462 5327 this.ddt._ddt( " surroundHTML(): top" );5463 this.ddt._ddt( "htmlarea.js","5444", "surroundHTML(): top" ); 5328 5464 5329 5465 var html = this.getSelectedHTML(); … … 5342 5478 { 5343 5479 5344 this.ddt._ddt( " getSelectedHTML(): top" );5480 this.ddt._ddt( "htmlarea.js","5461", "getSelectedHTML(): top" ); 5345 5481 5346 5482 var sel = this._getSelection(); … … 5502 5638 { 5503 5639 5504 this.ddt._ddt( " _insertImage(): top" );5640 this.ddt._ddt( "htmlarea.js","5621", "_insertImage(): top" ); 5505 5641 5506 5642 var editor = this; // for nested functions … … 5585 5721 { 5586 5722 5587 this.ddt._ddt( " _insertTable(): top" );5723 this.ddt._ddt( "htmlarea.js","5704", "_insertTable(): top" ); 5588 5724 5589 5725 var sel = this._getSelection(); … … 5677 5813 { 5678 5814 5679 this.ddt._ddt( " _comboSelected(): top" );5815 this.ddt._ddt( "htmlarea.js","5796", "_comboSelected(): top" ); 5680 5816 5681 5817 this.focusEditor(); … … 5717 5853 { 5718 5854 5719 this.ddt._ddt( " execCommand(): top with cmdId '" + cmdID + "'" );5855 this.ddt._ddt( "htmlarea.js","5836", "execCommand(): top with cmdId '" + cmdID + "'" ); 5720 5856 5721 5857 var editor = this; // for nested functions … … 5848 5984 { 5849 5985 5850 this.ddt._ddt( " _editorEvent(): top" );5986 this.ddt._ddt( "htmlarea.js","5967", "_editorEvent(): top with event type '" + ev.type + "'" ); 5851 5987 5852 5988 var editor = this; … … 5872 6008 if (keyEvent) 5873 6009 { 6010 6011 this.ddt._ddt( "htmlarea.js","5992", "_editorEvent(): keyEvent" ); 6012 6013 // loop over all the plugins and pass this event to any that have 6014 // an onKeyPress() method. 6015 5874 6016 for (var i in editor.plugins) 5875 6017 { 5876 6018 var plugin = editor.plugins[i].instance; 6019 6020 // to make it easier to figure out what kind of object we're talking to 6021 // I've added a name member. This change has not yet been applied to 6022 // all plugins. 6023 6024 this.ddt._ddtDumpObject( "htmlarea.js","5994", "_editorEvent(): plugin '" + ( plugin.name ? plugin.name : "unknown" ) + "' has members:", plugin ); 6025 5877 6026 if (typeof plugin.onKeyPress == "function") 6027 { 6028 6029 this.ddt._ddt( "htmlarea.js","6010", "_editorEvent(): keyEvent - invoking onKeyPress method in plugin '" + ( plugin.name ? plugin.name : "unknown" ) + "'" ); 6030 5878 6031 if (plugin.onKeyPress(ev)) 6032 { 6033 6034 this.ddt._ddt( "htmlarea.js","6015", "_editorEvent(): keyEvent - onKeyPress() returned false. Returning false" ); 5879 6035 return false; 6036 } 6037 6038 } // end of if this plugin had a KeyPress handler. 6039 5880 6040 } 5881 6041 } … … 5883 6043 if (keyEvent && ev.ctrlKey && !ev.altKey) 5884 6044 { 6045 6046 this.ddt._ddt( "htmlarea.js","6027", "_editorEvent(): control key key event" ); 6047 5885 6048 var sel = null; 5886 6049 var range = null; … … 5891 6054 { 5892 6055 case 'a': 6056 6057 this.ddt._ddt( "htmlarea.js","6038", "_editorEvent(): cntrl-a select all" ); 6058 5893 6059 if (!HTMLArea.is_ie) 5894 6060 { … … 5906 6072 // simple key commands follow 5907 6073 5908 case 'b': cmd = "bold"; break; 5909 case 'i': cmd = "italic"; break; 5910 case 'u': cmd = "underline"; break; 5911 case 's': cmd = "strikethrough"; break; 5912 case 'l': cmd = "justifyleft"; break; 5913 case 'e': cmd = "justifycenter"; break; 5914 case 'r': cmd = "justifyright"; break; 5915 case 'j': cmd = "justifyfull"; break; 5916 case 'z': cmd = "undo"; break; 5917 case 'y': cmd = "redo"; break; 5918 case 'v': if (HTMLArea.is_ie || editor.config.htmlareaPaste) { cmd = "paste"; } break; 5919 case 'n': cmd = "formatblock"; value = HTMLArea.is_ie ? "<p>" : "p"; break; 5920 5921 case '0': cmd = "killword"; break; 6074 case 'b': 6075 6076 this.ddt._ddt( "htmlarea.js","6057", "_editorEvent(): cntrl-b bold" ); 6077 cmd = "bold"; 6078 break; 6079 6080 case 'i': 6081 6082 this.ddt._ddt( "htmlarea.js","6063", "_editorEvent(): cntrl-i italics" ); 6083 cmd = "italic"; 6084 break; 6085 6086 case 'u': 6087 6088 this.ddt._ddt( "htmlarea.js","6069", "_editorEvent(): cntrl-u underline" ); 6089 cmd = "underline"; 6090 break; 6091 6092 case 's': 6093 6094 this.ddt._ddt( "htmlarea.js","6075", "_editorEvent(): cntrl-s strikethrough" ); 6095 cmd = "strikethrough"; 6096 break; 6097 6098 case 'l': 6099 6100 this.ddt._ddt( "htmlarea.js","6081", "_editorEvent(): cntrl-l justify left" ); 6101 cmd = "justifyleft"; 6102 break; 6103 6104 case 'e': 6105 6106 this.ddt._ddt( "htmlarea.js","6087", "_editorEvent(): cntrl-e justify center" ); 6107 cmd = "justifycenter"; 6108 break; 6109 6110 case 'r': 6111 6112 this.ddt._ddt( "htmlarea.js","6093", "_editorEvent(): cntrl-r justify right" ); 6113 cmd = "justifyright"; 6114 break; 6115 6116 case 'j': 6117 6118 this.ddt._ddt( "htmlarea.js","6099", "_editorEvent(): cntrl-j justify full" ); 6119 cmd = "justifyfull"; 6120 break; 6121 6122 case 'z': 6123 6124 this.ddt._ddt( "htmlarea.js","6105", "_editorEvent(): cntrl-z undo" ); 6125 cmd = "undo"; 6126 break; 6127 6128 case 'y': 6129 6130 this.ddt._ddt( "htmlarea.js","6111", "_editorEvent(): cntrl-y redo" ); 6131 cmd = "redo"; 6132 break; 6133 6134 case 'v': 6135 6136 this.ddt._ddt( "htmlarea.js","6117", "_editorEvent(): cntrl-v paste" ); 6137 if (HTMLArea.is_ie || editor.config.htmlareaPaste) 6138 { 6139 cmd = "paste"; 6140 } 6141 break; 6142 6143 case 'n': 6144 6145 6146 this.ddt._ddt( "htmlarea.js","6127", "_editorEvent(): cntrl-n format block" ); 6147 cmd = "formatblock"; 6148 value = HTMLArea.is_ie ? "<p>" : "p"; 6149 break; 6150 6151 case '0': 6152 6153 this.ddt._ddt( "htmlarea.js","6134", "_editorEvent(): cntrl-O kill word" ); 6154 cmd = "killword"; 6155 break; 5922 6156 5923 6157 // headings … … 5929 6163 case '6': 5930 6164 6165 this.ddt._ddt( "htmlarea.js","6146", "_editorEvent(): cntrl-[1-6] heading" ); 5931 6166 cmd = "formatblock"; 5932 6167 value = "h" + key; … … 5939 6174 if (cmd) 5940 6175 { 6176 this.ddt._ddt( "htmlarea.js","6157", "_editorEvent(): executing simple command '" + cmd + "'" ); 5941 6177 // execute simple command 5942 6178 this.execCommand(cmd, false, value); … … 5990 6226 5991 6227 return a; 5992 } 6228 } // end of in-line function definition. 5993 6229 5994 6230 switch(ev.which) … … 6000 6236 case 32: 6001 6237 { 6238 6239 this.ddt._ddt( "htmlarea.js","6220", "_editorEvent(): entered a space" ); 6240 6002 6241 if(s && s.isCollapsed && s.anchorNode.nodeType == 3 && s.anchorNode.data.length > 3 && s.anchorNode.data.indexOf('.') >= 0) 6003 6242 { … … 6040 6279 default : 6041 6280 { 6281 6282 this.ddt._ddt( "htmlarea.js","6263", "_editorEvent(): keycode is '" + ev.keyCode + "' which (normal key) is '" + ev.which + "'" ); 6283 6284 // is it an escape character or ... 6285 6042 6286 if(ev.keyCode == 27 || (this._unlinkOnUndo && ev.ctrlKey && ev.which == 122) ) 6043 6287 { … … 6051 6295 else if(ev.which || ev.keyCode == 8 || ev.keyCode == 46) 6052 6296 { 6297 6298 // backspace or period? 6299 6300 this.ddt._ddt( "htmlarea.js","6281", "_editorEvent(): normal key or backspace or period" ); 6301 6053 6302 this._unlinkOnUndo = false; 6054 6303 … … 6057 6306 // See if we might be changing a link 6058 6307 var a = this._getFirstAncestor(s, 'a'); 6059 if(!a) break; // not an anchor 6308 6309 if (!a) 6310 { 6311 this.ddt._ddt( "htmlarea.js","6292", "_editorEvent(): not an anchor" ); 6312 break; // not an anchor 6313 } 6314 6060 6315 if(!a._updateAnchTimeout) 6061 6316 { … … 6103 6358 { 6104 6359 case 13: // KEY enter 6360 6361 this.ddt._ddt( "htmlarea.js","6342", "_editorEvent(): enter key handling" ); 6362 6105 6363 if (HTMLArea.is_gecko && !ev.shiftKey && this.config.mozParaHandler == 'dirty' ) 6106 6364 { … … 6112 6370 case 8: // KEY backspace 6113 6371 case 46: // KEY delete 6372 6373 this.ddt._ddt( "htmlarea.js","6354", "_editorEvent(): delete or backspace handling" ); 6374 6114 6375 if (HTMLArea.is_gecko && !ev.shiftKey) 6115 6376 { … … 6138 6399 }, 100); 6139 6400 6401 this.ddt._ddt( "htmlarea.js","6382", "_editorEvent(): bottom" ); 6402 6140 6403 }; // end of _editorEvent() 6141 6404 … … 6148 6411 HTMLArea.prototype.convertNode = function(el, newTagName) 6149 6412 { 6150 this.ddt._ddt( " convertNode(): top" );6413 this.ddt._ddt( "htmlarea.js","6394", "convertNode(): top" ); 6151 6414 6152 6415 var newel = this._doc.createElement(newTagName); … … 6194 6457 { 6195 6458 6196 this.ddt._ddt( " dom_checkBackspace(): top" );6459 this.ddt._ddt( "htmlarea.js","6440", "dom_checkBackspace(): top" ); 6197 6460 6198 6461 var self = this; … … 6461 6724 { 6462 6725 6463 this.ddt._ddt( " scrollToElement(): top" );6726 this.ddt._ddt( "htmlarea.js","6707", "scrollToElement(): top" ); 6464 6727 6465 6728 if(HTMLArea.is_gecko) … … 6534 6797 { 6535 6798 6536 this.ddt._ddt( " outwardHtml(): top" );6799 this.ddt._ddt( "htmlarea.js","6780", "outwardHtml(): top" ); 6537 6800 6538 6801 html = html.replace(/<(\/?)b(\s|>|\/)/ig, "<$1strong$2"); … … 6567 6830 { 6568 6831 6569 this.ddt._ddt( " inwardHtml(): top" );6832 this.ddt._ddt( "htmlarea.js","6813", "inwardHtml(): top" ); 6570 6833 6571 6834 // Midas uses b and i instead of strong and em, um, hello, … … 6601 6864 { 6602 6865 6603 this.ddt._ddt( " outwardSpecialReplacements(): top" );6866 this.ddt._ddt( "htmlarea.js","6847", "outwardSpecialReplacements(): top" ); 6604 6867 6605 6868 for(var i in this.config.specialReplacements) … … 6625 6888 HTMLArea.prototype.inwardSpecialReplacements = function(html) 6626 6889 { 6627 this.ddt._ddt( " inwardSpecialReplacements(): top" );6890 this.ddt._ddt( "htmlarea.js","6871", "inwardSpecialReplacements(): top" ); 6628 6891 6629 6892 // alert("inward"); … … 6653 6916 { 6654 6917 6655 this.ddt._ddt( " fixRelativeLinks(): top" );6918 this.ddt._ddt( "htmlarea.js","6899", "fixRelativeLinks(): top" ); 6656 6919 6657 6920 if (typeof this.config.stripSelfNamedAnchors != 'undefined' && this.config.stripSelfNamedAnchors) … … 6699 6962 { 6700 6963 6701 this.ddt._ddt( " stripBaseURL(): top" );6964 this.ddt._ddt( "htmlarea.js","6945", "stripBaseURL(): top" ); 6702 6965 6703 6966 var baseurl = this.config.baseURL; … … 6727 6990 { 6728 6991 6729 this.ddt._ddt( " getInnerHTML(): top" );6992 this.ddt._ddt( "htmlarea.js","6973", "getInnerHTML(): top" ); 6730 6993 6731 6994 if(!this._doc.body) return ''; … … 6764 7027 { 6765 7028 6766 this.ddt._ddt( " setHTML(): top" );7029 this.ddt._ddt( "htmlarea.js","7010", "setHTML(): top" ); 6767 7030 6768 7031 switch (this._editMode) … … 6836 7099 { 6837 7100 6838 this.ddt._ddt( " _createRange(): top" );7101 this.ddt._ddt( "htmlarea.js","7082", "_createRange(): top" ); 6839 7102 6840 7103 if (HTMLArea.is_ie) … … 6872 7135 { 6873 7136 6874 this.ddt._ddt( " notifyOn(): top" );7137 this.ddt._ddt( "htmlarea.js","7118", "notifyOn(): top" ); 6875 7138 6876 7139 if(typeof this._notifyListeners[ev] == 'undefined') … … 6892 7155 { 6893 7156 6894 this.ddt._ddt( " notifyOf(): top" );7157 this.ddt._ddt( "htmlarea.js","7138", "notifyOf(): top" ); 6895 7158 6896 7159 if(this._notifyListeners[ev]) … … 6919 7182 { 6920 7183 6921 this.ddt._ddt( " _popupDialog(): top with url '" + url + "' action '" + action + "'" );7184 this.ddt._ddt( "htmlarea.js","7165", "_popupDialog(): top with url '" + url + "' action '" + action + "'" ); 6922 7185 6923 7186 Dialog(this.popupURL(url), action, init); … … 7012 7275 { 7013 7276 7014 this.ddt._ddt( " registerPlugins(): top" );7277 this.ddt._ddt( "htmlarea.js","7258", "registerPlugins(): top" ); 7015 7278 7016 7279 if(plugin_names) -
branches/unified_backend/plugins/ContextMenu/context-menu.js
r60 r84 25 25 license : "htmlArea" 26 26 }; 27 28 /** 29 * name member for debugging 30 * 31 * This member is used to identify objects of this class in debugging 32 * messages. 33 */ 34 35 ContextMenu.prototype.name = "ContextMenu"; 27 36 28 37 ContextMenu.prototype.onGenerate = function() { -
branches/unified_backend/plugins/EnterParagraphs/enter-paragraphs.js
r37 r84 20 20 license : "htmlArea" 21 21 }; 22 23 /** 24 * name member for debugging 25 * 26 * This member is used to identify objects of this class in debugging 27 * messages. 28 */ 29 30 EnterParagraphs.prototype.name = "EnterParagraphs"; 22 31 23 32 // Whitespace Regex -
branches/unified_backend/plugins/Stylist/stylist.js
r60 r84 5 5 6 6 HTMLArea.Config.prototype.css_style = { }; 7 7 8 8 9 /** … … 518 519 }; 519 520 521 /** 522 * name member for debugging 523 * 524 * This member is used to identify objects of this class in debugging 525 * messages. 526 */ 527 528 Stylist.prototype.name = "Stylist"; 529 520 530 Stylist.prototype.onGenerate = function() 521 531 { -
branches/unified_backend/popups/about.html
r72 r84 17 17 this file will match the version of the repository. 18 18 19 [@@7 6@@]19 [@@77@@] 20 20 21 21 -->
