Changeset 84


Ignore:
Timestamp:
04/24/05 23:43:57 (15 years ago)
Author:
yermol
Message:

_ddt() trace system now writes to a popup window resulting in much faster execution.
_ddt() messages now identifiy file, line and source of trace message.
_ddt() popup window has "add hr" link
ddtpreprop.php script added to patch in file and line numbers.
full_example-body.html and simple_example.html bugfix to not double-call xinha-init.
simple_example.html now only loads a single Xinha instance.

Location:
branches/unified_backend
Files:
2 added
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/unified_backend/README.txt

    r72 r84  
    22Xinha Unified Backend Branch. 
    33 
    4 by: Yermo Lamers http://www.formvista.com/contact.html 
     4by: Yermo Lamers of DTLink,LLC 
     5http://www.formvista.com/contact.html 
    56 
    67The Unified Backend Branch code has been released under the same terms 
  • branches/unified_backend/README_DEVELOPERS.txt

    r72 r84  
    44                    Development Info 
    55 
    6 by: Yermo Lamers 
     6by: Yermo Lamers of DTLink Software 
    77http://www.formvista.com 
    88 
     
    4444  in-line text replacement for some specific tags. 
    4545 
    46 ddtpreproc.php - not done 
     46ddtpreproc.php 
    4747 
    4848  Javascript does not seem to have a version of PHP's  
     
    5252  javascript source files to patch in file and line numbers to 
    5353  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. 
    5458 
    5559makedocs.pl 
     
    116120To further make my life easier and come up to speed, I've added  
    117121trace 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.  
     122of my DDT debug-trace-message-to-popup window class.  
    120123 
    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. 
     124You will need to turn off any popup blockers in order to see the debugging 
     125trace messages.  
     126 
     127These messages can be turned on and off on a per-class basis using the ddtOn() method.  
     128(See examples/simple_example.html) 
    124129 
    125130What's nice is you can quickly get a feel for the order in which things happen 
    126131and which methods are invoked for what events. 
    127  
    128 Unfortunately, the trace message infrastructure adds a tremendous amount of processing  
    129 and size to the distribution. With all debug messages turned on, this branch of 
    130 Xinha is pretty much unuseable as an editor. 
    131132 
    132133The concept is to do development on the trace enabled version of the code and then 
     
    136137of Xinha .. a development version with all debugging intact and a runtime version 
    137138that 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.js 
    142 2. clicking the new '<>' icons which turn on trace messages  
    143139 
    144140---------------------------------------------------------- 
  • branches/unified_backend/ddt.js

    r72 r84  
    2929* @author Yermo Lamers 
    3030* @package ddt 
     31*  
     32* @todo find source of spurious document not well formed error on reload. 
    3133*/ 
    3234 
     
    3941// 2005-04-12 YmL: 
    4042//      .       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. 
    4147// ----------------------------- 
    4248 
     
    4450* DDT constructor. 
    4551* 
     52* @param name name identifying the object sending the debug messages. 
     53* 
    4654* @class Debugging Trace Message class.  
    4755* 
     
    5967        // descriptive named used as a title for the trace box. 
    6068 
    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 
    6671        } 
    6772else 
    6873        { 
    69         this.textarea_name = "DDT"; 
     74        this.name = "DDT"; 
    7075        } 
    7176 
    7277// by default messages are off. 
    7378 
    74 this.textarea = null; 
    75  
    7679this.state = "off"; 
    77  
    78 } 
     80this.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 
     100DDT.prototype._ddtOn = function() 
     101{ 
     102 
     103// if the popup hasn't been opened yet, open it. 
     104 
     105if ( 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 
     132this.state = "on"; 
     133 
     134}; // end of _ddtOn() 
    79135 
    80136// -------------------------------- 
    81137 
    82138/** 
    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. 
    123140*/ 
    124141 
    125142DDT.prototype._ddtOff = function() 
    126143{ 
    127 this.textarea.value = ""; 
    128 this.textarea = null; 
    129144this.state = "off"; 
    130145} 
     
    146161} 
    147162 
    148 // ------------------------------------------- 
    149  
    150 /** 
    151 * use a popup textarea for debugging 
    152 * 
    153 * there are cases where one would like to debug javascript code while a page 
    154 * 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 window 
    169  
    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 see 
    175         // if the text area already exists 
    176  
    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  
    208163// -------------------------------- 
    209164 
    210165/** 
    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 
     172DDT.prototype._ddt = function( file, line, msg )  
    228173{ 
    229174 
    230175if ( 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" ); 
    252178        } 
    253179 
     
    263189*/ 
    264190 
    265 DDT.prototype._ddtDumpObject = function( msg, obj ) 
    266 { 
    267  
    268 if ( this.textarea != null ) 
     191DDT.prototype._ddtDumpObject = function( file, line, msg, obj ) 
     192{ 
     193 
     194this._ddt( "ddt.js","194", file, line, msg ); 
     195 
     196for (var x in obj) 
    269197   { 
    270198 
    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                } 
    279214   } 
    280215 
     
    288223* displays a tree of html elements. Design based on method from htmlarea.js 
    289224* 
     225* @see ddtpreproc.php 
    290226* @param root top of tree to display 
    291227* @param level depth level. 
     
    297233var ns = HTMLArea.is_ie ? root.scopeName : root.prefix; 
    298234 
    299 this._ddt(level + "- " + tag + " [" + ns + "]"); 
     235// FIXME: separated on multiple lines to avoid being picked 
     236// up by ddtpreproc.php 
     237 
     238this._ddt(  
     239        ":","0", level + "- " + tag + " [" + ns + "]"  
     240        ); 
    300241 
    301242for (i = root.firstChild; i; i = i.nextSibling) 
  • branches/unified_backend/devutils/ddtpreproc.php.in

    r72 r84  
    11#![@@PHP@@] 
     2<?php 
    23 
    34// [NOSTRIP 
     
    2021// NOSTRIP] 
    2122 
    22  
    23 // TO BE DEVELOPED 
     23// attempt to prevent this script from being run through the webserver. 
     24 
     25if ( @$_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 
     56function _ddt( $file, $line, $msg ) 
     57{ 
     58 
     59// uncomment this line to turn on debugging messages. 
     60 
     61print( 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 
     74function 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 
     81if ( !file_exists( $path )) 
     82        return  false ; 
     83 
     84// if path is not a directory, and it matches the regex, apply the function. 
     85 
     86if ( !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        } 
     103else 
     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 
     148function procDDT( $path ) 
     149{ 
     150 
     151_ddt( __FILE__, __LINE__, "procDDT(): top with path '$path'" ); 
     152 
     153if ( !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 
     162if (( $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 
     173foreach ( $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 
     205if (( $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 
     214foreach ( $content_array as $index => $line ) 
     215        fputs( $fh, $line ); 
     216 
     217fclose( $fh ); 
     218 
     219_ddt( __FILE__, __LINE__, "procDDT(): bottom" ); 
     220 
     221return true; 
     222 
     223}       // end of procDDT() 
     224 
     225// ------------------------------------------------------------------ 
     226 
     227// check usage.  
     228 
     229if ( $argc != 2 ) 
     230        { 
     231        die( "Usage: ddtpreproc.php path_to_xinha_root\n" ); 
     232        } 
     233 
     234$dir_path = $argv[1]; 
     235 
     236if ( ! 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 
     244rapply( $dir_path, "/.*js$/", "procDDT" ); 
     245 
     246// END 
     247 
     248?> 
  • branches/unified_backend/examples/full_example-body.html

    r72 r84  
    3838 
    3939  <script type="text/javascript"> 
    40   // var startupDDT = new DDT( "startup_trace" ); 
    41   // startupDDT._ddtOnPopup(); 
     40   var startupDDT = new DDT( "startup" ); 
     41   startupDDT._ddtOn(); 
    4242  </script> 
    4343   
  • branches/unified_backend/examples/simple_example.html

    r72 r84  
    4040  <script type="text/javascript"> 
    4141 
     42  var startupDDT = new DDT( "startup" ); 
     43 
    4244  // uncomment the following if you would like to trace out the  
    4345  // startup functions. This only works in the debugging version 
    4446  // of Xinha_ub, not the runtime. 
    45   // 
    46  
    47   // var startupDDT = new DDT( "startup_trace" ); 
    48   // startupDDT._ddtOnPopup(); 
     47 
     48  startupDDT._ddtOn(); 
    4949 
    5050  </script> 
     
    6969         // at the end.) 
    7070 
     71   startupDDT._ddt( "simple_example.html", "71", "Setting up xinha_init()" ); 
     72 
    7173    xinha_init = xinha_init ? xinha_init : function() 
    7274    { 
     75 
     76           startupDDT._ddt( "simple_example.html", "76", "xinha_init called from window.onload handler for simple_example.html" ); 
     77 
    7378      /** STEP 1 *************************************************************** 
    7479       * First, what are the plugins you will be using in the editors on this 
     
    8893                // by default. 
    8994 
     95           startupDDT._ddt( "simple_example.html", "92", "calling HTMLArea.loadplugins()" ); 
     96 
    9097      if ( !HTMLArea.loadPlugins( xinha_plugins_minimal, xinha_init)) return; 
    9198 
    9299      /** STEP 2 *************************************************************** 
    93100       * 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. 
    95102       ************************************************************************/ 
    96103 
    97104      xinha_editors = xinha_editors ? xinha_editors : 
    98105      [ 
    99         'TextArea1', 
    100         'TextArea2' 
     106        'TextArea1' 
    101107      ]; 
    102108 
     
    114120       *************************************************************************/ 
    115121 
     122            startupDDT._ddt( "simple_example.html", "119", "calling HTMLArea.Config()" ); 
     123 
    116124       xinha_config = xinha_config ? xinha_config : new HTMLArea.Config(); 
    117125 
     
    132140       * editors. 
    133141       ************************************************************************/ 
     142 
     143      startupDDT._ddt( "simple_example.html", "140", "calling HTMLArea.makeEditors()" ); 
    134144 
    135145      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins_minimal); 
     
    145155       ************************************************************************/ 
    146156 
     157       xinha_editors.TextArea1.config.width  = 700; 
     158       xinha_editors.TextArea1.config.height = 350; 
    147159 
    148160      /** STEP 5 *************************************************************** 
     
    151163       ************************************************************************/ 
    152164 
     165      startupDDT._ddt( "simple_example.html", "160", "calling HTMLArea.startEditors()" ); 
     166 
    153167      HTMLArea.startEditors(xinha_editors); 
    154168 
    155169    }  // end of xinha_init() 
    156170 
    157     window.onload = xinha_init; 
     171    // window.onload = xinha_init; 
     172 
    158173  </script> 
    159174</head> 
     
    177192    <textarea id="TextArea1" name="TextArea1" rows="10" cols="80" style="width:100%"> 
    178193         This is the content of TextArea1 from xinha_ub/examples/simple_example.html.<br> 
    179          The two extra <b>&lt;&gt;</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. 
    190199         </textarea> 
    191200 
  • branches/unified_backend/htmlarea.js

    r72 r84  
    149149* construction. This is a shorthand to clean up the calls in 
    150150* all these methods.  
    151 */ 
    152  
    153 HTMLArea._ddt = function( msg ) 
    154   { 
     151* 
     152* @see ddtpreproc.php 
     153*/ 
     154 
     155HTMLArea._ddt = function( file, line, msg ) 
     156  { 
     157 
     158  // FIXME: separated onto multiple lines to avoid being 
     159  // picked up by ddtpreproc.php. 
    155160 
    156161  if ( typeof startupDDT != 'undefined' ) 
    157      startupDDT._ddt( msg ); 
     162    startupDDT._ddt(  
     163      file,line, msg  
     164      ); 
    158165 
    159166  } 
     
    428435      ["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"], 
    429436      ["killword","removeformat","toggleborders","lefttoright", "righttoleft", "separator","htmlmode","about"] 
    430  
    431                 // [STRIP 
    432                 ,["object_debug_toggle"] 
    433                 ,["static_debug_toggle"] 
    434                 // STRIP] 
    435437 
    436438    ]; 
     
    652654    killword:      [ "Clear MSOffice tags", ["ed_buttons_main.gif",4,3], false, function(e) {e.execCommand("killword");} ] 
    653655 
    654     // [STRIP 
    655     ,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  
    659656    };  // end of btnList definition 
    660657 
     
    727724    // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists."); 
    728725   
    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." ); 
    730727    } 
    731728 
     
    733730    { 
    734731    // 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." ); 
    736733    } 
    737734 
     
    763760    { 
    764761         // 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." ); 
    766763    } 
    767764 
     
    769766    { 
    770767         // 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." ); 
    772769    } 
    773770 
     
    829826  { 
    830827 
    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 + "'" ); 
    832829 
    833830  if (plugin) 
     
    873870  { 
    874871 
    875   HTMLArea._ddt( "init(): top" ); 
     872  HTMLArea._ddt( "htmlarea.js","872", "init(): top" ); 
    876873 
    877874  var head = document.getElementsByTagName("head")[0]; 
     
    899896      // MSIE is not ready. 
    900897 
    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 + "'" ); 
    902899 
    903900      return; 
     
    909906      { 
    910907      var url = HTMLArea._scripts[current++]; 
     908 
     909                // as we load scripts update the window title bar. 
     910 
    911911      document.title = "[HTMLArea: loading script " + current + "/" + HTMLArea._scripts.length + "]"; 
    912912      var script = document.createElement("script"); 
     
    914914      script.src = url; 
    915915 
    916       HTMLArea._ddt( "loadNextScript(): loading '" + url + "'" ); 
     916      HTMLArea._ddt( "htmlarea.js","916", "loadNextScript(): loading '" + url + "'" ); 
    917917 
    918918      // the magic step. evt depends on the browser (See above) 
     
    925925      document.title = savetitle; 
    926926 
    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 + "'" ); 
    928928 
    929929           // fire the onLoad handler. See HTMLArea.onload() up top.  
     
    932932      HTMLArea.onload(); 
    933933      } 
    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()" ); 
    937938 
    938939  // start the chain of script loading. 
     
    951952  { 
    952953 
    953   HTMLArea._ddt( "replaceAll(): top" ); 
     954  HTMLArea._ddt( "htmlarea.js","954", "replaceAll(): top" ); 
    954955 
    955956  var tas = document.getElementsByTagName("textarea"); 
     
    966967  { 
    967968 
    968   HTMLArea._ddt( "replace(): top with id '" + id + "'" ); 
     969  HTMLArea._ddt( "htmlarea.js","969", "replace(): top with id '" + id + "'" ); 
    969970 
    970971  var ta = HTMLArea.getElementById("textarea", id); 
     
    996997  { 
    997998 
    998   HTMLArea._ddt( "== makeBtnImg(): top" ); 
     999  HTMLArea._ddt( "htmlarea.js","999", "makeBtnImg(): top" ); 
    9991000 
    10001001  if(!doc) doc = document; 
     
    10641065  i_contain.appendChild(img); 
    10651066 
    1066   HTMLArea._ddt( "== makeBtnImg(): bottom" ); 
     1067  HTMLArea._ddt( "htmlarea.js","1067", "makeBtnImg(): bottom" ); 
    10671068 
    10681069  return i_contain; 
     
    10981099{ 
    10991100 
    1100   HTMLArea._ddt( "loadPlugin(): loading plugin '" + pluginName + "'" ); 
     1101  HTMLArea._ddt( "htmlarea.js","1101", "loadPlugin(): loading plugin '" + pluginName + "'" ); 
    11011102 
    11021103  // Might already be loaded 
     
    11051106    { 
    11061107 
    1107     HTMLArea._ddt( "loadPlugins(): plugin '" + pluginName + "' already loaded" ); 
     1108    HTMLArea._ddt( "htmlarea.js","1108", "loadPlugin(): plugin '" + pluginName + "' already loaded" ); 
    11081109 
    11091110    if (callback) 
    11101111      { 
    11111112 
    1112       HTMLArea._ddt( "loadPlugins(): calling plugin '" + pluginName + "' callback" ); 
     1113      HTMLArea._ddt( "htmlarea.js","1113", "loadPlugin(): calling plugin '" + pluginName + "' callback" ); 
    11131114 
    11141115      callback(); 
     
    11201121  var dir = this.getPluginDir(pluginName); 
    11211122  var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g, 
    1122           function (str, l1, l2, l3) { 
     1123          function (str, l1, l2, l3)  
     1124                           { 
    11231125            return l1 + "-" + l2.toLowerCase() + l3; 
    1124           }).toLowerCase() + ".js"; 
     1126            }).toLowerCase() + ".js"; 
    11251127 
    11261128  var plugin_file = dir + "/" + plugin; 
     
    11281130  if ( callback ) 
    11291131    { 
    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" ); 
    11311133 
    11321134    HTMLArea._loadback(plugin_file, callback); 
     
    11341136  else 
    11351137    { 
    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." ); 
    11371139 
    11381140    document.write("<script type='text/javascript' src='" + plugin_file + "'></script>"); 
     
    11491151* files. This method is called before the HTMLArea object is 
    11501152* constructed. 
     1153* 
     1154* @todo stop needlessly cloning the plugins array on each recursion. 
    11511155*/ 
    11521156 
     
    11541158  { 
    11551159 
    1156   HTMLArea._ddt( "loadPlugins(): top" ); 
     1160  HTMLArea._ddt( "htmlarea.js","1160", "loadPlugins(): top - cloning plugins array." ); 
    11571161 
    11581162  // make a copy of the plugins array that we'll chip away at. 
     
    11711175      var poppedPlugin = nuPlugins.pop(); 
    11721176 
    1173       HTMLArea._ddt( "loadPlugins(): plugin '" + poppedPlugin + "' was already loaded" ); 
     1177      HTMLArea._ddt( "htmlarea.js","1177", "loadPlugins(): plugin '" + poppedPlugin + "' was already loaded" ); 
    11741178 
    11751179      } 
     
    11861190    { 
    11871191 
    1188     HTMLArea._ddt( "loadPlugins(): no plugins left to load" ); 
     1192    HTMLArea._ddt( "htmlarea.js","1192", "loadPlugins(): no plugins left to load" ); 
    11891193 
    11901194    return true; 
     
    11921196 
    11931197  // 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),  
    11951201  // and setting the "callback function" (the function that's called after the plugin 
    11961202  // javascript file is successfully loaded) to run loadPlugins .. essentially  
    11971203  // an indirect recursive algorithm. 
     1204  // 
     1205  // FIXME: Because of this little algorithm the nuPlugins array gets 
     1206  // cloned on each recursion.  
    11981207 
    11991208  HTMLArea.loadPlugin( nuPlugins.pop(), 
     
    12101219    );  // this is the end of the HTMLArea.loadPlugin() recursive call. 
    12111220 
    1212   HTMLArea._ddt( "loadPlugins(): end" ); 
     1221  HTMLArea._ddt( "htmlarea.js","1221", "loadPlugins(): end" ); 
    12131222 
    12141223  return false; 
     
    12251234  { 
    12261235 
    1227   HTMLArea._ddt( "refreshPlugin(): top" ); 
     1236  HTMLArea._ddt( "htmlarea.js","1236", "refreshPlugin(): top" ); 
    12281237 
    12291238  if (typeof plugin.onGenerate == "function") 
    12301239    { 
    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 + "'" ); 
    12321241    plugin.onGenerate(); 
    12331242    } 
     
    12351244  if (typeof plugin.onGenerateOnce == "function")  
    12361245    { 
    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 + "'" ); 
    12381247    plugin.onGenerateOnce(); 
    12391248    plugin.onGenerateOnce = null; 
     
    12521261  var url = _editor_url || ''; 
    12531262 
    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 + "'" ); 
    12551264   
    12561265  if (typeof plugin != "undefined")  
     
    12701279  head.appendChild(link); 
    12711280 
    1272   HTMLArea._ddt( "loadStyle(): appending '" + link + "' to document" ); 
     1281  HTMLArea._ddt( "htmlarea.js","1281", "loadStyle(): appending '" + link.href + "' to document" ); 
    12731282 
    12741283  //document.write("<style type='text/css'>@import url(" + url + ");</style>"); 
     
    13031312  { 
    13041313 
    1305   HTMLArea._ddt( "getInnerText(): top" ); 
     1314  HTMLArea._ddt( "htmlarea.js","1314", "getInnerText(): top" ); 
    13061315 
    13071316  var txt = '', i; 
     
    13241333* returns a clone of the given object 
    13251334* 
     1335* recurses through all the members of an object, which may contain nested 
     1336* objects and/or arrays, and constructs a complete copy. 
    13261337*/ 
    13271338 
     
    13291340  { 
    13301341 
    1331   HTMLArea._ddt( "cloneObject(): top" ); 
     1342  HTMLArea._ddt( "htmlarea.js","1342", "cloneObject(): top" ); 
    13321343 
    13331344  if (!obj) return null; 
     
    13391350  if (obj.constructor.toString().indexOf("function Array(") == 1)  
    13401351    { 
     1352 
     1353    HTMLArea._ddt( "htmlarea.js","1353", "cloneObject(): contructing an array object." ); 
     1354 
    13411355    newObj = obj.constructor(); 
    13421356    } 
     
    13451359  if (obj.constructor.toString().indexOf("function Function(") == 1)  
    13461360    { 
     1361 
     1362    HTMLArea._ddt( "htmlarea.js","1362", "cloneObject(): cloning an function object." ); 
     1363 
    13471364    newObj = obj; // just copy reference to it 
    13481365    }  
    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. 
    13551386 
    13561387  return newObj; 
    13571388 
    1358   }; 
     1389  };  // end of HTMLArea.cloneObject()   
    13591390 
    13601391// ---------------------------------------------------------- 
     
    13691400  { 
    13701401 
    1371   HTMLArea._ddt( "checkSupportedBrowser(): top" ); 
     1402  HTMLArea._ddt( "htmlarea.js","1402", "checkSupportedBrowser(): top" ); 
    13721403 
    13731404  if (HTMLArea.is_gecko)  
     
    14051436  { 
    14061437 
    1407   HTMLArea._ddt( "getElementById(): top with tag '" + tag + "' id '" + id + "'" ); 
     1438  HTMLArea._ddt( "htmlarea.js","1438", "getElementById(): top with tag '" + tag + "' id '" + id + "'" ); 
    14081439 
    14091440  var el, i, objs = document.getElementsByTagName(tag); 
     
    14271458  { 
    14281459 
    1429   HTMLArea._ddt( "_postback() : top with url '" + url + "'" ); 
     1460  HTMLArea._ddt( "htmlarea.js","1460", "_postback() : top with url '" + url + "'" ); 
    14301461 
    14311462  var req = null; 
     
    14791510  { 
    14801511 
    1481   HTMLArea._ddt( "_getback(): top" ); 
     1512  HTMLArea._ddt( "htmlarea.js","1512", "_getback(): top" ); 
    14821513 
    14831514  var req = null; 
     
    15211552  { 
    15221553 
    1523   HTMLArea._ddt( "_geturlcontent(): top with url '" + url + "'" ); 
     1554  HTMLArea._ddt( "htmlarea.js","1554", "_geturlcontent(): top with url '" + url + "'" ); 
    15241555 
    15251556  var req = null; 
     
    15561587  { 
    15571588 
    1558   HTMLArea._ddt( "arrayContainsArray(): top" ); 
     1589  HTMLArea._ddt( "htmlarea.js","1589", "arrayContainsArray(): top" ); 
    15591590 
    15601591  var all_found = true; 
     
    15911622  { 
    15921623 
    1593   HTMLArea._ddt( "arrayFilter(): top" ); 
     1624  HTMLArea._ddt( "htmlarea.js","1624", "arrayFilter(): top" ); 
    15941625 
    15951626  var new_a = [ ]; 
     
    16281659  { 
    16291660 
    1630   HTMLArea._ddt( "_loadlang(): top" ); 
     1661  HTMLArea._ddt( "htmlarea.js","1661", "_loadlang(): top" ); 
    16311662 
    16321663  if(typeof _editor_lcbackend == "string") 
     
    16851716  { 
    16861717 
    1687   HTMLArea._ddt( "_lc: top with string '" + string + "'" ); 
     1718  HTMLArea._ddt( "htmlarea.js","1718", "_lc: top with string '" + string + "'" ); 
    16881719 
    16891720  if(_editor_lang == "en") 
     
    17271758  { 
    17281759 
    1729   HTMLArea._ddt( "hasDisplayedChildren(): top" ); 
     1760  HTMLArea._ddt( "htmlarea.js","1760", "hasDisplayedChildren(): top" ); 
    17301761 
    17311762  var children = el.childNodes; 
     
    17491780/** 
    17501781* _loadback() 
     1782* 
     1783* load a script file in the "background" and when finished invoked a provided 
     1784* callback. 
    17511785*/ 
    17521786 
     
    17541788  { 
    17551789 
    1756   HTMLArea._ddt( "_loadback(): top with src '" + src + "'" ); 
     1790  HTMLArea._ddt( "htmlarea.js","1790", "_loadback(): top with src '" + src + "'" ); 
    17571791 
    17581792  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 
    17591799  var evt = HTMLArea.is_ie ? "onreadystatechange" : "onload"; 
    17601800 
     
    17701810  head.appendChild(script); 
    17711811 
    1772   }; 
     1812  HTMLArea._ddt( "htmlarea.js","1812", "_loadback(): script tag to load javascript file appended to head section." ); 
     1813 
     1814  };  // end of _loadback() 
    17731815 
    17741816// ----------------------------------------------------- 
     
    17811823  { 
    17821824 
    1783   HTMLArea._ddt( "collectionToArray(): top" ); 
     1825  HTMLArea._ddt( "htmlarea.js","1825", "collectionToArray(): top" ); 
    17841826 
    17851827  var array = [ ]; 
     
    18011843  { 
    18021844 
    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" ); 
    18071851    default_config = default_config(); 
    18081852    } 
     
    18111855  for(var x = 0; x < editor_names.length; x++) 
    18121856    { 
     1857 
     1858         HTMLArea._ddt( "htmlarea.js","1858", "makeEditors(): making editor '" + editor_names[x] + "' and copying in cloned default_config" ); 
     1859 
    18131860    editors[editor_names[x]] = new HTMLArea(editor_names[x], HTMLArea.cloneObject(default_config)); 
    1814     if(plugin_names) 
     1861 
     1862    if ( plugin_names ) 
    18151863      { 
    18161864      for(var i = 0; i < plugin_names.length; i++) 
    18171865        { 
     1866 
     1867                  HTMLArea._ddt( "htmlarea.js","1867", "makeEditors(): registering plugin '" + plugin_names[i] + "' for editor '" + editor_names[x] + "'" ); 
     1868                   
    18181869        editors[editor_names[x]].registerPlugin(eval(plugin_names[i])); 
    18191870        } 
     
    18271878 
    18281879/** 
    1829 * startEditors() 
     1880* startEditors() - front end to generate() 
     1881* 
     1882* loops through all editors on the page and generates each. 
    18301883*/ 
    18311884 
     
    18331886  { 
    18341887 
    1835   HTMLArea._ddt( "startEditors(): top" ); 
     1888  HTMLArea._ddt( "htmlarea.js","1888", "startEditors(): top" ); 
    18361889 
    18371890  for(var i in editors) 
     
    18521905  { 
    18531906 
    1854   HTMLArea._ddt( "_makeColor(): top" ); 
     1907  HTMLArea._ddt( "htmlarea.js","1907", "_makeColor(): top" ); 
    18551908 
    18561909  if (typeof v != "number")  
     
    20182071  { 
    20192072 
    2020   HTMLArea._ddt( "getHTMLWrapper(): top" ); 
     2073  HTMLArea._ddt( "htmlarea.js","2073", "getHTMLWrapper(): top" ); 
    20212074 
    20222075  var html = ""; 
     
    22162269  { 
    22172270 
    2218   HTMLArea._ddt( "addClasses(): top" ); 
     2271  HTMLArea._ddt( "htmlarea.js","2271", "addClasses(): top" ); 
    22192272 
    22202273  if(el != null) 
     
    22502303  { 
    22512304 
    2252   HTMLArea._ddt( "removeClasses(): top" ); 
     2305  HTMLArea._ddt( "htmlarea.js","2305", "removeClasses(): top" ); 
    22532306 
    22542307  var existing    = el.className.trim().split(); 
     
    23622415HTMLArea._addEvent = function(el, evname, func)  
    23632416  { 
     2417 
     2418  HTMLArea._ddt( "htmlarea.js","2418", "_addEvent(): adding event for '" + evname + "' func '" + func.toString().substring(0,100) + "'" ); 
     2419 
    23642420  if (HTMLArea.is_ie)  
    23652421    { 
     
    24782534    // create a ddt debug trace object. textarea is a string here. 
    24792535 
    2480     this.ddt = new DDT( textarea ); 
     2536        this.ddt = new DDT( textarea ); 
    24812537 
    24822538    // uncomment to turn on debugging messages. 
    24832539 
    2484     // this.ddt._ddtOn(); 
     2540    this.ddt._ddtOn(); 
    24852541    // STRIP] 
    24862542 
    2487     this.ddt._ddt("HTMLArea(): DDT Trace System Initialized."); 
     2543    this.ddt._ddt( "htmlarea.js","2543", "HTMLArea(): DDT Trace System Initialized." ); 
    24882544 
    24892545    this._htmlArea = null; 
     
    25392595    }  // end of if we are a supported browser. 
    25402596 
    2541   this.ddt._ddt( "HTMLArea(): end" ); 
     2597  this.ddt._ddt( "htmlarea.js","2597", "HTMLArea(): end" ); 
    25422598 
    25432599  };  // end of HTMLArea() constructor 
     
    25522608  { 
    25532609 
    2554   this.ddt._ddt( "_createToolbar(): top" ); 
     2610  this.ddt._ddt( "htmlarea.js","2610", "_createToolbar(): top" ); 
    25552611 
    25562612  var editor = this;    // to access this in nested functions 
     
    25792635  { 
    25802636 
    2581   this.ddt._ddt( "registerPanel(): top with side '" + side + "'" ); 
     2637  this.ddt._ddt( "htmlarea.js","2637", "registerPanel(): top with side '" + side + "'" ); 
    25822638 
    25832639  if(!side) side = 'right'; 
     
    26222678  { 
    26232679 
    2624   this.ddt._ddt( "_createToolbar1(): top" ); 
     2680  this.ddt._ddt( "htmlarea.js","2680", "_createToolbar1(): top" ); 
    26252681 
    26262682  // creates a new line in the toolbar 
     
    26292685    { 
    26302686 
    2631          editor.ddt._ddt( "newLine(): top" ); 
     2687         editor.ddt._ddt( "htmlarea.js","2687", "newLine(): top" ); 
    26322688 
    26332689    var table = document.createElement("table"); 
     
    26652721    { 
    26662722 
    2667          HTMLArea._ddt( "== setButtonStatus() : top with id '" + id + "' value '" + newval + '"' ); 
     2723         HTMLArea._ddt( "htmlarea.js","2723", "setButtonStatus() : top with id '" + id + "' value '" + newval + '"' ); 
    26682724 
    26692725    var oldval = this[id]; 
     
    27212777    { 
    27222778 
    2723          HTMLArea._ddt( "== createSelect(): top with text '" + txt + "'" ); 
     2779         HTMLArea._ddt( "htmlarea.js","2779", "createSelect(): top with text '" + txt + "'" ); 
    27242780 
    27252781    var options = null; 
     
    28052861      } 
    28062862 
    2807          HTMLArea._ddt( "createSelect(): end" ); 
     2863         HTMLArea._ddt( "htmlarea.js","2863", "createSelect(): end" ); 
    28082864 
    28092865    return el; 
     
    28202876    { 
    28212877 
    2822          editor.ddt._ddt( "createButton(): top with text '" + txt + "'" ); 
     2878         editor.ddt._ddt( "htmlarea.js","2878", "createButton(): top with text '" + txt + "'" ); 
    28232879 
    28242880    // the element that will be created 
     
    30403096  { 
    30413097 
    3042   this.ddt._ddt( "_createStatusBar(): top" ); 
     3098  this.ddt._ddt( "htmlarea.js","3098", "_createStatusBar(): top" ); 
    30433099 
    30443100  var statusbar = document.createElement("div"); 
     
    30743130  { 
    30753131 
    3076   this.ddt._ddt( "generate(): top" ); 
     3132  this.ddt._ddt( "htmlarea.js","3132", "generate(): top" ); 
    30773133 
    30783134  var editor = this;    // we'll need "this" in some nested functions 
     
    30883144        if (typeof EnterParagraphs == 'undefined') 
    30893145          { 
     3146 
     3147                         this.ddt._ddt( "htmlarea.js","3147", "generate(): mozParaHandler config set to 'best'. Loading EnterParagraphs" ); 
     3148 
    30903149          EnterParagraphs = 'null'; 
    30913150          HTMLArea._loadback 
     
    31383197  textarea.parentNode.insertBefore(htmlarea, textarea); 
    31393198 
     3199  this.ddt._ddt( "htmlarea.js","3199", "generate(): creating toolbar" ); 
     3200 
    31403201  // creates & appends the toolbar 
    31413202  this._createToolbar(); 
     
    31643225  // } 
    31653226 
     3227  this.ddt._ddt( "htmlarea.js","3227", "generate(): adding panels" ); 
     3228 
    31663229  // Add the panels 
    31673230  for(var i in this._panels) 
     
    31693232    innerEditor.appendChild(this._panels[i].div); 
    31703233    } 
     3234 
     3235  this.ddt._ddt( "htmlarea.js","3235", "generate(): creating Status Bar" ); 
    31713236 
    31723237  // creates & appends the status bar 
     
    31953260        { 
    31963261 
    3197                   this.ddt._ddt( "generate(): f.onsubmit(): top" ); 
     3262                  this.ddt._ddt( "htmlarea.js","3262", "generate(): f.onsubmit(): top" ); 
    31983263 
    31993264        var a = this.__msh_prevOnSubmit; 
     
    32343299        { 
    32353300 
    3236         this.ddt._ddt( "generate(): f.onreset(): top" ); 
     3301        this.ddt._ddt( "htmlarea.js","3301", "generate(): f.onreset(): top" ); 
    32373302 
    32383303        var a = this.__msh_prevOnReset; 
     
    32693334  textarea.style.display = "none"; 
    32703335 
     3336  this.ddt._ddt( "htmlarea.js","3336", "generate(): calculating starting size" ); 
     3337 
    32713338  // Calculate the starting size, EXCLUDING THE TOOLBAR & STATUS BAR (always) 
    32723339  var height = null; 
     
    33053372  this.notifyOn('panel_change',function(){editor.setInnerSize();}); 
    33063373 
    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()" ); 
    33083375 
    33093376  // IMPORTANT: we have to allow Mozilla a short time to recognize the 
     
    33273394  var editor = this; 
    33283395 
    3329   this.ddt._ddt( "initFrame(): top" ); 
     3396  this.ddt._ddt( "htmlarea.js","3396", "initFrame(): top" ); 
    33303397 
    33313398  try 
     
    34173484        editor._iframe.contentWindow, 
    34183485        ["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        ); 
    34213493    } 
    34223494  else 
     
    34283500  // intercept some events; for updating the toolbar & keyboard handlers 
    34293501 
    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                   { 
    34333506         return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event); 
    3434        }); 
     3507         }); 
    34353508 
    34363509  // check if any plugins have registered refresh handlers 
     
    34423515    } 
    34433516 
    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         } 
    34453524 
    34463525  setTimeout(function() { 
     
    34753554  { 
    34763555 
    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 + "'" ); 
    34783557 
    34793558  if (typeof width == 'undefined' || width == null) 
     
    36033682HTMLArea.prototype.addPanel = function(side) 
    36043683  { 
     3684 
     3685  this.ddt._ddt( "htmlarea.js","3685", "addPanel() : top with side '" + side + "'" ); 
     3686 
    36053687  var div = document.createElement('div'); 
    36063688  div.side = side; 
     
    36203702HTMLArea.prototype.removePanel = function(panel) 
    36213703  { 
     3704 
     3705  this.ddt._ddt( "htmlarea.js","3705", "removePanel() : top" ); 
     3706 
    36223707  this._panels[panel.side].div.removeChild(panel); 
    36233708  var clean = [ ]; 
     
    36333718  this.notifyOf('panel_change', {'action':'remove','panel':panel}); 
    36343719 
    3635   } 
     3720  }  // end of removePanel() 
    36363721 
    36373722/** 
     
    36413726HTMLArea.prototype.hidePanel = function(panel) 
    36423727  { 
     3728 
     3729  this.ddt._ddt( "htmlarea.js","3729", "hidePanel() : top" ); 
     3730 
    36433731  if (panel) 
    36443732    { 
     
    36543742HTMLArea.prototype.showPanel = function(panel) 
    36553743  { 
     3744 
     3745  this.ddt._ddt( "htmlarea.js","3745", "showPanel() : top" ); 
     3746 
    36563747  if ( panel ) 
    36573748    { 
     
    36673758HTMLArea.prototype.hidePanels = function(sides) 
    36683759  { 
     3760 
     3761  this.ddt._ddt( "htmlarea.js","3761", "hidePanels() : top" ); 
     3762 
    36693763  if(typeof sides == 'undefined') 
    36703764    { 
     
    36913785HTMLArea.prototype.showPanels = function(sides) 
    36923786  { 
     3787 
     3788  this.ddt._ddt( "htmlarea.js","3788", "showPanels() : top" ); 
     3789 
    36933790  if(typeof sides == 'undefined') 
    36943791    { 
     
    37083805  } 
    37093806 
     3807// ------------------------------------------------------------------- 
     3808 
    37103809/** 
    37113810* activateEditor 
     
    37153814  { 
    37163815 
    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) + "'" ); 
    37183817 
    37193818  if (HTMLArea.is_gecko && this._doc.designMode != 'on') 
     
    37213820 
    37223821    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 + "'" ); 
    37233824 
    37243825    if(this._iframe.style.display == 'none') 
     
    37303831    else 
    37313832      { 
     3833 
     3834                this.ddt._ddt( "htmlarea.js","3834", "activateEditor(): setting designMode to on" ); 
     3835 
    37323836      this._doc.designMode = 'on'; 
    37333837      } 
     
    37353839  else 
    37363840    { 
     3841 
     3842         this.ddt._ddt( "htmlarea.js","3842", "activateEditor(): Setting contentEditable to true" ); 
     3843 
    37373844    this._doc.body.contentEditable = true; 
    37383845    } 
     
    37403847  HTMLArea.last_on = this._doc; 
    37413848 
     3849  this.ddt._ddt( "htmlarea.js","3849", "activateEditor(): end" ); 
     3850 
    37423851  }  // end of activateEditor() 
    37433852 
     3853// -------------------------------------------------------------- 
     3854 
    37443855/** 
    37453856* deactivateEditor() 
     
    37493860  { 
    37503861 
    3751   this.ddt._ddt( "deactivateEditor(): top" ); 
     3862  this.ddt._ddt( "htmlarea.js","3862", "deactivateEditor(): top" ); 
    37523863 
    37533864  if (HTMLArea.is_gecko && this._doc.designMode == 'on') 
     
    37623873  } 
    37633874 
     3875// -------------------------------------------------------------- 
    37643876 
    37653877/** 
     
    38493961  { 
    38503962 
    3851   this.ddt._ddt( "setFullHTML(): top" ); 
     3963  this.ddt._ddt( "htmlarea.js","3963", "setFullHTML(): top" ); 
    38523964 
    38533965  var save_multiline = RegExp.multiline; 
     
    38894001* registerPlugin() 
    38904002* 
    3891 * Create the specified plugin and register it with this HTMLArea 
     4003* Create the specified plugin and register it with this HTMLArea instance. 
    38924004* return the plugin created to allow refresh when necessary 
    38934005*/ 
     
    38964008  { 
    38974009 
    3898   this.ddt._ddt( "registerPlugin(): top" ); 
     4010  this.ddt._ddt( "htmlarea.js","4010", "registerPlugin(): top" ); 
    38994011 
    39004012  var plugin = arguments[0]; 
     
    39184030  { 
    39194031 
    3920   this.ddt._ddt( "registerPlugin2(): top" ); 
     4032  this.ddt._ddt( "htmlarea.js","4032", "registerPlugin2(): top" ); 
    39214033 
    39224034  if (typeof plugin == "string") 
     
    39264038    { 
    39274039 
    3928          this.ddt._ddt( "registerPlugin2(): INTERNAL ERROR: plugin is undefined. " ); 
     4040         this.ddt._ddt( "htmlarea.js","4040", "registerPlugin2(): INTERNAL ERROR: plugin is undefined. " ); 
    39294041 
    39304042    /* FIXME: This should never happen. But why does it do? */ 
     
    40004112  var editor = this; 
    40014113 
    4002   this.ddt._ddt( "_wordClean(): top" ); 
     4114  this.ddt._ddt( "htmlarea.js","4114", "_wordClean(): top" ); 
    40034115 
    40044116  var stats =  
     
    41174229  // this.forceRedraw(); 
    41184230 
    4119   this.ddt._ddt( "_wordClean(): bottom" ); 
     4231  this.ddt._ddt( "htmlarea.js","4231", "_wordClean(): bottom" ); 
    41204232 
    41214233  this.updateToolbar(); 
     
    41324244  { 
    41334245 
    4134   this.ddt._ddt( "_clearFonts(): top" ); 
     4246  this.ddt._ddt( "htmlarea.js","4246", "_clearFonts(): top" ); 
    41354247   
    41364248  var D = this.getInnerHTML(); 
     
    41704282  { 
    41714283 
    4172   this.ddt._ddt( "_splitBlock(): top" ); 
     4284  this.ddt._ddt( "htmlarea.js","4284", "_splitBlock(): top" ); 
    41734285 
    41744286  this._doc.execCommand('formatblock', false, '<div>'); 
     
    41844296  { 
    41854297 
    4186   this.ddt._ddt( "forceRedraw(): top" ); 
     4298  this.ddt._ddt( "htmlarea.js","4298", "forceRedraw(): top" ); 
    41874299 
    41884300  this._doc.body.style.visibility = "hidden"; 
     
    42024314  { 
    42034315 
    4204   this.ddt._ddt( "forceRedraw(): top _editMode is '" + this._editMode + "'" ); 
     4316  this.ddt._ddt( "htmlarea.js","4316", "focusEditor(): top _editMode is '" + this._editMode + "'" ); 
    42054317 
    42064318  switch (this._editMode)  
     
    42504362  { 
    42514363 
    4252   this.ddt._ddt( "_undoTakeSnapshot(): top" ); 
     4364  this.ddt._ddt( "htmlarea.js","4364", "_undoTakeSnapshot(): top" ); 
    42534365 
    42544366  ++this._undoPos; 
     
    42874399  { 
    42884400 
    4289   this.ddt._ddt( "undo(): top" ); 
     4401  this.ddt._ddt( "htmlarea.js","4401", "undo(): top" ); 
    42904402 
    42914403  if (this._undoPos > 0)  
     
    43064418  { 
    43074419 
    4308   this.ddt._ddt( "redo(): top" ); 
     4420  this.ddt._ddt( "htmlarea.js","4420", "redo(): top" ); 
    43094421 
    43104422  if (this._undoPos < this._undoQueue.length - 1)  
     
    43254437  { 
    43264438 
    4327   this.ddt._ddt( "disableToolbar(): top" ); 
     4439  this.ddt._ddt( "htmlarea.js","4439", "disableToolbar(): top" ); 
    43284440 
    43294441  if(typeof except == 'undefined') 
     
    43574469  { 
    43584470 
    4359   this.ddt._ddt( "enableToolbar(): top" ); 
     4471  this.ddt._ddt( "htmlarea.js","4471", "enableToolbar(): top" ); 
    43604472 
    43614473  this.updateToolbar(); 
     
    43744486  var ancestors = null; 
    43754487 
    4376   this.ddt._ddt( "updateToolbar(): top" ); 
     4488  this.ddt._ddt( "htmlarea.js","4488", "updateToolbar(): top" ); 
    43774489 
    43784490  if (!text)  
     
    43884500                    { 
    43894501 
    4390                          this.ddt._ddt( "updateToolbar(): INTERNAL ERROR" ); 
     4502                         this.ddt._ddt( "htmlarea.js","4502", "updateToolbar(): INTERNAL ERROR" ); 
    43914503 
    43924504          // hell knows why we get here; this 
     
    44704582                    { 
    44714583 
    4472                          this.ddt._ddt( "updateToolbar(): INTERNAL ERROR" ); 
     4584                         this.ddt._ddt( "htmlarea.js","4584", "updateToolbar(): INTERNAL ERROR" ); 
    44734585 
    44744586          // the impossible really happens. 
     
    46894801    } 
    46904802 
     4803  this.ddt._ddt( "htmlarea.js","4803", "updateToolbar(): end" ); 
     4804 
    46914805  }  // end of updateToolbar() 
    46924806 
     
    47034817  { 
    47044818 
    4705   this.ddt._ddt( "insertNodeAtSelection(): top" ); 
     4819  this.ddt._ddt( "htmlarea.js","4819", "insertNodeAtSelection(): top" ); 
    47064820 
    47074821  if (!HTMLArea.is_ie)  
     
    47764890  { 
    47774891 
    4778   this.ddt._ddt( "getParentElement(): top" ); 
     4892  this.ddt._ddt( "htmlarea.js","4892", "getParentElement(): top" ); 
    47794893 
    47804894  if (typeof sel == 'undefined') 
     
    48434957  { 
    48444958 
    4845   this.ddt._ddt( "getAllAncestors(): top" ); 
     4959  this.ddt._ddt( "htmlarea.js","4959", "getAllAncestors(): top" ); 
    48464960 
    48474961  var p = this.getParentElement(); 
     
    48684982HTMLArea.prototype._getFirstAncestor = function(sel, types) 
    48694983  { 
     4984 
     4985  this.ddt._ddt( "htmlarea.js","4985", "_getFirstAncestor(): top" ); 
     4986 
    48704987  var prnt = this._activeElement(sel); 
    48714988  if(prnt == null) 
     
    49215038  { 
    49225039 
    4923   this.ddt._ddt( "_activeElement(): top" ); 
     5040  this.ddt._ddt( "htmlarea.js","5040", "_activeElement(): top" ); 
    49245041 
    49255042  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         } 
    49275048 
    49285049  if(HTMLArea.is_ie) 
     
    49795100    if(! sel.isCollapsed) 
    49805101      { 
     5102 
     5103                this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): selection is not collapsed" ); 
     5104 
    49815105      if(sel.anchorNode.nodeType == 1) 
    49825106        { 
     5107                  this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): nodeType is 1. Returning sel.anchorNode" ); 
     5108 
    49835109        return sel.anchorNode; 
    49845110        } 
    49855111      } 
     5112 
     5113    this.ddt._ddt( "htmlarea.js","5099", "_activeElement(): bottom" ); 
     5114 
    49865115    return null; 
    49875116    } 
     
    49985127  { 
    49995128 
    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         } 
    50035136 
    50045137  if(HTMLArea.is_ie) 
     
    50085141  else if(typeof sel.isCollapsed != 'undefined') 
    50095142    { 
     5143         this.ddt._ddt( "htmlarea.js", "5141", "_selectionEmpty(): isCollapsed" ); 
    50105144    return sel.isCollapsed; 
    50115145    } 
    50125146 
     5147  this.ddt._ddt( "htmlarea.js", "5141", "_selectionEmpty(): bottom. returning true." ); 
     5148 
    50135149  return true; 
    50145150 
     
    50245160  { 
    50255161 
    5026   this.ddt._ddt( "_getAncestorBlock(): top" ); 
     5162  this.ddt._ddt( "htmlarea.js","5143", "_getAncestorBlock(): top" ); 
    50275163 
    50285164  // Scan upwards to find a block level element that we can change or apply to 
     
    50815217  { 
    50825218 
    5083   this.ddt._ddt( "_createImplicitBlock(): top" ); 
     5219  this.ddt._ddt( "htmlarea.js","5200", "_createImplicitBlock(): top" ); 
    50845220 
    50855221  // expand it until we reach a block element in either direction 
     
    52275363  { 
    52285364 
    5229   this.ddt._ddt( "selectNodeContents(): top" ); 
     5365  this.ddt._ddt( "htmlarea.js","5346", "selectNodeContents(): top" ); 
    52305366 
    52315367  this.focusEditor(); 
     
    52885424  { 
    52895425 
    5290   this.ddt._ddt( "insertHTML(): top" ); 
     5426  this.ddt._ddt( "htmlarea.js","5407", "insertHTML(): top" ); 
    52915427 
    52925428  var sel = this._getSelection(); 
     
    53255461  { 
    53265462 
    5327   this.ddt._ddt( "surroundHTML(): top" ); 
     5463  this.ddt._ddt( "htmlarea.js","5444", "surroundHTML(): top" ); 
    53285464 
    53295465  var html = this.getSelectedHTML(); 
     
    53425478  { 
    53435479 
    5344   this.ddt._ddt( "getSelectedHTML(): top" ); 
     5480  this.ddt._ddt( "htmlarea.js","5461", "getSelectedHTML(): top" ); 
    53455481 
    53465482  var sel = this._getSelection(); 
     
    55025638  { 
    55035639 
    5504   this.ddt._ddt( "_insertImage(): top" ); 
     5640  this.ddt._ddt( "htmlarea.js","5621", "_insertImage(): top" ); 
    55055641 
    55065642  var editor = this;    // for nested functions 
     
    55855721  { 
    55865722 
    5587   this.ddt._ddt( "_insertTable(): top" ); 
     5723  this.ddt._ddt( "htmlarea.js","5704", "_insertTable(): top" ); 
    55885724 
    55895725  var sel = this._getSelection(); 
     
    56775813  { 
    56785814 
    5679   this.ddt._ddt( "_comboSelected(): top" ); 
     5815  this.ddt._ddt( "htmlarea.js","5796", "_comboSelected(): top" ); 
    56805816 
    56815817  this.focusEditor(); 
     
    57175853  { 
    57185854 
    5719   this.ddt._ddt( "execCommand(): top with cmdId '" + cmdID + "'" ); 
     5855  this.ddt._ddt( "htmlarea.js","5836", "execCommand(): top with cmdId '" + cmdID + "'" ); 
    57205856 
    57215857  var editor = this;    // for nested functions 
     
    58485984  { 
    58495985 
    5850   this.ddt._ddt( "_editorEvent(): top" ); 
     5986  this.ddt._ddt( "htmlarea.js","5967", "_editorEvent(): top with event type '" + ev.type + "'" ); 
    58515987 
    58525988  var editor = this; 
     
    58726008  if (keyEvent) 
    58736009    { 
     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 
    58746016    for (var i in editor.plugins) 
    58756017      { 
    58766018      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 
    58776026      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                                                                                                                                                                                                                                                                                                                                  
    58786031        if (plugin.onKeyPress(ev)) 
     6032          { 
     6033 
     6034                         this.ddt._ddt( "htmlarea.js","6015", "_editorEvent(): keyEvent - onKeyPress() returned false. Returning false" ); 
    58796035          return false; 
     6036                         } 
     6037 
     6038                  } // end of if this plugin had a KeyPress handler. 
     6039 
    58806040      } 
    58816041    } 
     
    58836043  if (keyEvent && ev.ctrlKey && !ev.altKey) 
    58846044    { 
     6045 
     6046         this.ddt._ddt( "htmlarea.js","6027", "_editorEvent(): control key key event" ); 
     6047 
    58856048    var sel = null; 
    58866049    var range = null; 
     
    58916054           { 
    58926055      case 'a': 
     6056 
     6057                  this.ddt._ddt( "htmlarea.js","6038", "_editorEvent(): cntrl-a select all" ); 
     6058 
    58936059        if (!HTMLArea.is_ie)  
    58946060                    { 
     
    59066072      // simple key commands follow 
    59076073 
    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; 
    59226156 
    59236157      // headings 
     
    59296163      case '6': 
    59306164 
     6165                  this.ddt._ddt( "htmlarea.js","6146", "_editorEvent(): cntrl-[1-6] heading" ); 
    59316166        cmd = "formatblock"; 
    59326167        value = "h" + key; 
     
    59396174    if (cmd)  
    59406175           { 
     6176      this.ddt._ddt( "htmlarea.js","6157", "_editorEvent(): executing simple command '" + cmd + "'" ); 
    59416177      // execute simple command 
    59426178      this.execCommand(cmd, false, value); 
     
    59906226 
    59916227        return a; 
    5992         } 
     6228        }  // end of in-line function definition. 
    59936229 
    59946230      switch(ev.which) 
     
    60006236        case 32: 
    60016237          { 
     6238 
     6239                         this.ddt._ddt( "htmlarea.js","6220", "_editorEvent(): entered a space" ); 
     6240 
    60026241          if(s && s.isCollapsed && s.anchorNode.nodeType == 3 && s.anchorNode.data.length > 3 && s.anchorNode.data.indexOf('.') >= 0) 
    60036242            { 
     
    60406279        default : 
    60416280          { 
     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 
    60426286          if(ev.keyCode == 27 || (this._unlinkOnUndo && ev.ctrlKey && ev.which == 122) ) 
    60436287            { 
     
    60516295          else if(ev.which || ev.keyCode == 8 || ev.keyCode == 46) 
    60526296            { 
     6297 
     6298                                // backspace or period?  
     6299 
     6300            this.ddt._ddt( "htmlarea.js","6281", "_editorEvent(): normal key or backspace or period" ); 
     6301 
    60536302            this._unlinkOnUndo = false; 
    60546303 
     
    60576306              // See if we might be changing a link 
    60586307              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 
    60606315              if(!a._updateAnchTimeout) 
    60616316                { 
     
    61036358      { 
    61046359      case 13: // KEY enter 
     6360 
     6361                 this.ddt._ddt( "htmlarea.js","6342", "_editorEvent(): enter key handling" ); 
     6362 
    61056363        if (HTMLArea.is_gecko && !ev.shiftKey && this.config.mozParaHandler == 'dirty' ) 
    61066364          { 
     
    61126370      case 8: // KEY backspace 
    61136371      case 46: // KEY delete 
     6372 
     6373                 this.ddt._ddt( "htmlarea.js","6354", "_editorEvent(): delete or backspace handling" ); 
     6374 
    61146375        if (HTMLArea.is_gecko && !ev.shiftKey)  
    61156376                    { 
     
    61386399    }, 100); 
    61396400 
     6401  this.ddt._ddt( "htmlarea.js","6382", "_editorEvent(): bottom" ); 
     6402 
    61406403  };  // end of _editorEvent() 
    61416404 
     
    61486411HTMLArea.prototype.convertNode = function(el, newTagName)  
    61496412  { 
    6150   this.ddt._ddt( "convertNode(): top" ); 
     6413  this.ddt._ddt( "htmlarea.js","6394", "convertNode(): top" ); 
    61516414 
    61526415  var newel = this._doc.createElement(newTagName); 
     
    61946457  { 
    61956458 
    6196   this.ddt._ddt( "dom_checkBackspace(): top" ); 
     6459  this.ddt._ddt( "htmlarea.js","6440", "dom_checkBackspace(): top" ); 
    61976460 
    61986461  var self = this; 
     
    64616724  { 
    64626725 
    6463   this.ddt._ddt( "scrollToElement(): top" ); 
     6726  this.ddt._ddt( "htmlarea.js","6707", "scrollToElement(): top" ); 
    64646727 
    64656728  if(HTMLArea.is_gecko) 
     
    65346797  { 
    65356798 
    6536   this.ddt._ddt( "outwardHtml(): top" ); 
     6799  this.ddt._ddt( "htmlarea.js","6780", "outwardHtml(): top" ); 
    65376800 
    65386801  html = html.replace(/<(\/?)b(\s|>|\/)/ig, "<$1strong$2"); 
     
    65676830  { 
    65686831 
    6569   this.ddt._ddt( "inwardHtml(): top" ); 
     6832  this.ddt._ddt( "htmlarea.js","6813", "inwardHtml(): top" ); 
    65706833 
    65716834  // Midas uses b and i instead of strong and em, um, hello, 
     
    66016864  { 
    66026865 
    6603   this.ddt._ddt( "outwardSpecialReplacements(): top" ); 
     6866  this.ddt._ddt( "htmlarea.js","6847", "outwardSpecialReplacements(): top" ); 
    66046867 
    66056868  for(var i in this.config.specialReplacements) 
     
    66256888HTMLArea.prototype.inwardSpecialReplacements = function(html) 
    66266889  { 
    6627   this.ddt._ddt( "inwardSpecialReplacements(): top" ); 
     6890  this.ddt._ddt( "htmlarea.js","6871", "inwardSpecialReplacements(): top" ); 
    66286891 
    66296892  // alert("inward"); 
     
    66536916  { 
    66546917 
    6655   this.ddt._ddt( "fixRelativeLinks(): top" ); 
     6918  this.ddt._ddt( "htmlarea.js","6899", "fixRelativeLinks(): top" ); 
    66566919 
    66576920  if (typeof this.config.stripSelfNamedAnchors != 'undefined' && this.config.stripSelfNamedAnchors) 
     
    66996962  { 
    67006963 
    6701   this.ddt._ddt( "stripBaseURL(): top" ); 
     6964  this.ddt._ddt( "htmlarea.js","6945", "stripBaseURL(): top" ); 
    67026965 
    67036966  var baseurl = this.config.baseURL; 
     
    67276990  { 
    67286991 
    6729   this.ddt._ddt( "getInnerHTML(): top" ); 
     6992  this.ddt._ddt( "htmlarea.js","6973", "getInnerHTML(): top" ); 
    67306993 
    67316994  if(!this._doc.body) return ''; 
     
    67647027  { 
    67657028   
    6766   this.ddt._ddt( "setHTML(): top" ); 
     7029  this.ddt._ddt( "htmlarea.js","7010", "setHTML(): top" ); 
    67677030 
    67687031  switch (this._editMode)  
     
    68367099  { 
    68377100 
    6838   this.ddt._ddt( "_createRange(): top" ); 
     7101  this.ddt._ddt( "htmlarea.js","7082", "_createRange(): top" ); 
    68397102 
    68407103  if (HTMLArea.is_ie)  
     
    68727135  { 
    68737136 
    6874   this.ddt._ddt( "notifyOn(): top" ); 
     7137  this.ddt._ddt( "htmlarea.js","7118", "notifyOn(): top" ); 
    68757138 
    68767139  if(typeof this._notifyListeners[ev] == 'undefined') 
     
    68927155  { 
    68937156 
    6894   this.ddt._ddt( "notifyOf(): top" ); 
     7157  this.ddt._ddt( "htmlarea.js","7138", "notifyOf(): top" ); 
    68957158 
    68967159  if(this._notifyListeners[ev]) 
     
    69197182  { 
    69207183 
    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 + "'" ); 
    69227185 
    69237186  Dialog(this.popupURL(url), action, init); 
     
    70127275  { 
    70137276 
    7014   this.ddt._ddt( "registerPlugins(): top" ); 
     7277  this.ddt._ddt( "htmlarea.js","7258", "registerPlugins(): top" ); 
    70157278 
    70167279  if(plugin_names) 
  • branches/unified_backend/plugins/ContextMenu/context-menu.js

    r60 r84  
    2525        license       : "htmlArea" 
    2626}; 
     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 
     35ContextMenu.prototype.name = "ContextMenu"; 
    2736 
    2837ContextMenu.prototype.onGenerate = function() { 
  • branches/unified_backend/plugins/EnterParagraphs/enter-paragraphs.js

    r37 r84  
    2020  license       : "htmlArea" 
    2121}; 
     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 
     30EnterParagraphs.prototype.name = "EnterParagraphs"; 
    2231 
    2332// Whitespace Regex 
  • branches/unified_backend/plugins/Stylist/stylist.js

    r60 r84  
    55 
    66HTMLArea.Config.prototype.css_style = { }; 
     7 
    78 
    89/** 
     
    518519}; 
    519520 
     521/** 
     522* name member for debugging 
     523* 
     524* This member is used to identify objects of this class in debugging 
     525* messages. 
     526*/ 
     527 
     528Stylist.prototype.name = "Stylist"; 
     529 
    520530Stylist.prototype.onGenerate = function() 
    521531{ 
  • branches/unified_backend/popups/about.html

    r72 r84  
    1717this file will match the version of the repository. 
    1818 
    19 [@@76@@] 
     19[@@77@@] 
    2020 
    2121--> 
Note: See TracChangeset for help on using the changeset viewer.