Changeset 396


Ignore:
Timestamp:
10/22/05 04:21:38 (14 years ago)
Author:
gogo
Message:

Apply #403

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r395 r396  
    145145    for(var i in panels) 
    146146    { 
     147      if (!panels[i].container) continue; // prevent iterating over wrong type 
    147148      panels[i].div = panels[i].container; // legacy 
    148149      panels[i].container.className = 'panels ' + i; 
     
    477478  for (var i in this.btnList) { 
    478479    var btn = this.btnList[i]; 
    479     if(typeof btn[1] != 'string') 
     480    if (typeof btn != 'object') continue; // prevent iterating over wrong type 
     481    if (typeof btn[1] != 'string') 
    480482    { 
    481483      btn[1][0] = _editor_url + this.imgURL + btn[1][0]; 
     
    882884       
    883885      for (var i in options) { 
     886        if (typeof(options[i]) != 'string') continue;  // prevent iterating over wrong type 
    884887        var op = document.createElement("option"); 
    885888        op.innerHTML = HTMLArea._lc(i); 
     
    20182021  for (var i in this.plugins) { 
    20192022    var plugin = this.plugins[i].instance; 
    2020     if (typeof plugin.onMode == "function") plugin.onMode(mode); 
     2023    if (plugin && typeof plugin.onMode == "function") plugin.onMode(mode); 
    20212024  } 
    20222025}; 
     
    21942197// refresh plugin by calling onGenerate or onGenerateOnce method. 
    21952198HTMLArea.refreshPlugin = function(plugin) { 
    2196   if (typeof plugin.onGenerate == "function") 
     2199  if (plugin && typeof plugin.onGenerate == "function") 
    21972200    plugin.onGenerate(); 
    2198   if (typeof plugin.onGenerateOnce == "function") { 
     2201  if (plugin && typeof plugin.onGenerateOnce == "function") { 
    21992202    plugin.onGenerateOnce(); 
    22002203    plugin.onGenerateOnce = null; 
     
    24602463      continue; 
    24612464    } 
     2465    if (typeof(btn.state) != 'function') continue;  // prevent iterating over wrong type 
    24622466    btn.state("enabled", false); 
    24632467  } 
     
    25552559    var cmd = i; 
    25562560    var inContext = true; 
     2561    if (typeof(btn.state) != 'function') continue;  // prevent iterating over wrong type 
    25572562    if (btn.context && !text) { 
    25582563      inContext = false; 
     
    26362641        for(var i in this.config['formatblock']) 
    26372642        { 
    2638           blocks[blocks.length] = this.config['formatblock'][i]; 
     2643          if (typeof(this.config['formatblock'][i]) == 'string')  // prevent iterating over wrong type 
     2644          { 
     2645            blocks[blocks.length] = this.config['formatblock'][i]; 
     2646          } 
    26392647        } 
    26402648 
     
    27462754  for (var i in this.plugins) { 
    27472755    var plugin = this.plugins[i].instance; 
    2748     if (typeof plugin.onUpdateToolbar == "function") 
     2756    if (plugin && typeof plugin.onUpdateToolbar == "function") 
    27492757      plugin.onUpdateToolbar(); 
    27502758  } 
     
    35643572    { 
    35653573      var plugin = editor.plugins[i].instance; 
    3566       if (typeof plugin.onKeyPress == "function") 
     3574      if (plugin && typeof plugin.onKeyPress == "function") 
    35673575        if (plugin.onKeyPress(ev)) 
    35683576          return false; 
     
    41924200    var from = this.config.specialReplacements[i]; 
    41934201    var to   = i; 
     4202    if (typeof(from.replace) != 'function' || typeof(to.replace) != 'function') continue;  // prevent iterating over wrong type     
    41944203    // alert('out : ' + from + '=>' + to); 
    41954204    var reg = new RegExp(from.replace(HTMLArea.RE_Specials, '\\$1'), 'g'); 
     
    42074216    var from = i; 
    42084217    var to   = this.config.specialReplacements[i]; 
     4218 
     4219    if (typeof(from.replace) != 'function' || typeof(to.replace) != 'function') continue;  // prevent iterating over wrong type 
    42094220    // alert('in : ' + from + '=>' + to); 
    42104221    // 
  • trunk/popups/about.html

    r162 r396  
    5757    "</tr></thead><tbody>"; 
    5858  for (var i in editor.plugins) { 
     59    if (typeof info != 'object' || !info.name || typeof info.name !='string')   continue; 
    5960    var info = editor.plugins[i]; 
    6061    html += "<tr><td>" + info.name + " v" + info.version + "</td>" + 
Note: See TracChangeset for help on using the changeset viewer.