Opened 4 years ago

#1610 new defect

Xinha errors for IE10

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version: trunk
Severity: major Keywords:
Cc:

Description

I just installed Xinha 0.96.1 for a project and it worked with FF & Chrome & IE8-9, but failed for IE10 such that the toolbar was never displayed (major failure). The messages were about using length on a null or something that wasn't an object.

I did manage to fix it by changing XinhaCore?.js and thought I'd share...

Kevin Brannen
kbrannen a-t corp.hrsmart.com

diff --git a/htdocs/xinha/XinhaCore.js b/back/htdocs/xinha/XinhaCore.js
index 07f3d0b..ec475e4 100644
--- a/htdocs/xinha/XinhaCore.js
+++ b/htdocs/xinha/XinhaCore.js
@@ -1389,6 +1389,7 @@ Xinha.Config.prototype.addToolbarElement = function(id, where, position)
   }
   
   for ( i = 0; i < toolbar.length; ++i ) {
+    if (!toolbar[i]) continue;
     a = toolbar[i];
     for ( j = 0; j < a.length; ++j ) {
       // check if button/select box exists
@@ -1401,6 +1402,7 @@ Xinha.Config.prototype.addToolbarElement = function(id, where, position)
 
   for ( i = 0; !found && i < toolbar.length; ++i )
   {
+    if (!toolbar[i]) continue;
     a = toolbar[i];
     for ( j = 0; !found && j < a.length; ++j )
     {
@@ -1569,7 +1571,7 @@ Xinha.prototype._createToolbar = function ()
       for(var i = 0; i < e.childNodes.length; i++) if(e.tagName) noselect(e.childNodes(i));
     }
        }
-       if(Xinha.is_ie) noselect(toolbar);
+       if(Xinha.is_ie && Xinha.ie_version < 9) noselect(toolbar);
 
 
        this._htmlArea.appendChild(toolbar);      
@@ -1990,6 +1992,7 @@ Xinha.prototype._createToolbar1 = function (editor, toolbar, tb_objects)
       this.config.toolbar[i] = ['separator'];
     }
     var group = this.config.toolbar[i];
+    if (!group) continue;
 
     for ( var j = 0; j < group.length; ++j )
     {
@@ -2380,6 +2383,7 @@ Xinha.prototype.generate = function ()
   var toolbar = editor.config.toolbar;
   for ( i = toolbar.length; --i >= 0; )
   {
+    if (!toolbar[i]) continue;
     for ( var j = toolbar[i].length; --j >= 0; )
     {
       switch (toolbar[i][j])

(end)

Change History (0)

Note: See TracTickets for help on using tickets.