Ticket #2037: 2037.patch

File 2037.patch, 1.0 KB (added by Alfonso Martínez de Lizarrondo, 15 years ago)

Proposed SVN patch

  • editor/_source/internals/fckdebug.js

     
    5454        }
    5555        catch ( e ) {}   // Ignore errors
    5656}
     57
     58/**
     59        This will work only in Opera and in Firefox with Firebug installed
     60        It outputs any object or message to the error console instead of opening a new window
     61*/
     62FCKDebug.OutputInConsole = function( anyObject )
     63{
     64        if ( typeof(console) == 'object' && console.debug )
     65        {
     66                console.debug( anyObject ) ;
     67                return ;
     68        }
     69        if ( typeof(opera) == 'object' && opera.postError )
     70        {
     71                opera.postError( anyObject ) ;
     72                return ;
     73        }
     74
     75        if ( location.protocol == 'chrome:' )
     76        {
     77                var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
     78                                                                                                                                         .getService(Components.interfaces.nsIConsoleService);
     79                consoleService.logStringMessage("FCKeditor: " + anyObject);
     80                return ;
     81        }       
     82       
     83        this.Output(anyObject) ;
     84}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy