Changeset 2128

Show
Ignore:
Timestamp:
2008-06-24 17:59:21 (7 months ago)
Author:
fredck
Message:

Introduced JavaScript Lint in the dev tools. It has been configured to be as strict as possible. All warnings have been fixed.

Location:
CKEditor/branches/prototype
Files:
7 added
1 removed
21 modified

Legend:

Unmodified
Added
Removed
  • CKEditor/branches/prototype/ckeditor_basic.js

    r2117 r2128  
    2121 
    2222// Compressed version of core/ckeditor_base.js. See original for instructions. 
     23/*jsl:ignore*/ 
    2324if (!window.CKEDITOR){window.CKEDITOR=(function(){return {_:{},status:'unloaded',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')==0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})()};})();}; 
     25/*jsl:end*/ 
    2426 
    2527// Set the script name to be loaded by the loader. 
  • CKEditor/branches/prototype/ckeditor.js

    r2117 r2128  
    2121 
    2222// Compressed version of core/ckeditor_base.js. See original for instructions. 
     23/*jsl:ignore*/ 
    2324if (!window.CKEDITOR){window.CKEDITOR=(function(){return {_:{},status:'unloaded',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')==0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})()};})();}; 
     25/*jsl:end*/ 
    2426 
    2527if ( CKEDITOR.loader ) 
  • CKEditor/branches/prototype/_samples/sample01.html

    r2117 r2128  
    4545        <div id="code"> 
    4646                <pre> 
    47 &lt;p&gt; 
     47&lt;form action=""&gt; 
     48  &lt;p&gt; 
    4849    &lt;label for="editor1"&gt; 
    49         Editor 1:&lt;/label&gt;&lt;br /&gt; 
     50      Editor 1:&lt;/label&gt;&lt;br /&gt; 
    5051    &lt;textarea id="editor1" name="editor1" class="ckeditor" rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt; 
    51 &lt;/p&gt; 
    52 &lt;p&gt; 
     52  &lt;/p&gt; 
     53  &lt;p&gt; 
    5354    &lt;label for="editor2"&gt; 
    54         Editor 2:&lt;/label&gt;&lt;br /&gt; 
     55      Editor 2:&lt;/label&gt;&lt;br /&gt; 
    5556    &lt;textarea id="editor2" name="editor2" class="ckeditor" rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt; 
    56 &lt;/p&gt; 
    57 &lt;p&gt; 
     57  &lt;/p&gt; 
     58  &lt;p&gt; 
    5859    &lt;input type="submit" value="Submit" /&gt; 
    59 &lt;/p&gt; 
     60  &lt;/p&gt; 
     61&lt;/form&gt; 
    6062</pre> 
    6163        </div> 
  • CKEditor/branches/prototype/_samples/sample02.html

    r2083 r2128  
    5353        <div id="code"> 
    5454                <pre> 
    55 TODO 
     55&lt;form action=""&gt; 
     56  &lt;p&gt; 
     57    &lt;label for="editor1"&gt; 
     58      Editor 1:&lt;/label&gt;&lt;br /&gt; 
     59    &lt;textarea name="editor1" rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt; 
     60    &lt;script type="text/javascript"&gt; 
     61    //&lt;![CDATA[ 
     62 
     63      CKEDITOR.replace( 'editor1' ); 
     64 
     65    //]]&gt; 
     66    &lt;/script&gt; 
     67  &lt;/p&gt; 
     68  &lt;p&gt; 
     69    &lt;input type="submit" value="Submit" /&gt; 
     70  &lt;/p&gt; 
     71&lt;/form&gt; 
    5672</pre> 
    5773        </div> 
  • CKEditor/branches/prototype/_samples/sample.js

    r2083 r2128  
    9898                        var alsoBrowsers = ''; 
    9999 
    100                         for ( key in env ) 
     100                        for ( var key in env ) 
    101101                        { 
    102102                                if ( browsers[ key ] ) 
  • CKEditor/branches/prototype/_source/core/ajax.js

    r2083 r2128  
    4949 
    5050                return ( xhr.readyState == 4 && 
    51                                 (       ( xhr.status >= 200 && xhr.status < 300 ) 
    52                                         || xhr.status == 304 
    53                                         || xhr.status == 0 
    54                                         || xhr.status == 1223 ) ); 
     51                                (       ( xhr.status >= 200 && xhr.status < 300 ) || 
     52                                        xhr.status == 304 || 
     53                                        xhr.status === 0 || 
     54                                        xhr.status == 1223 ) ); 
    5555        }; 
    5656 
     
    103103 
    104104        return  /** @lends CKEDITOR.ajax */ { 
    105          
     105 
    106106                /** 
    107107                 * Loads data from an URL as plain text. 
  • CKEditor/branches/prototype/_source/core/ckeditor_base.js

    r2117 r2128  
    9999                                { 
    100100                                        // Absolute path. 
    101                                         if ( path.indexOf( '/' ) == 0 ) 
     101                                        if ( path.indexOf( '/' ) === 0 ) 
    102102                                                path = location.href.match( /^.*?:\/\/[^\/]*/ )[0] + path; 
    103103                                        // Relative path. 
  • CKEditor/branches/prototype/_source/core/ckeditor_basic.js

    r2098 r2128  
    9191 
    9292                        if ( !textarea ) 
    93                         { 
    9493                                throw '[CKEDITOR.replace] The <textarea> with id or name "' + elementOrIdOrName + '" was not found.'; 
    95                                 return; 
    96                         } 
    9794                } 
    9895 
  • CKEditor/branches/prototype/_source/core/dom/element.js

    r2117 r2128  
    5454        temp.innerHTML = html; 
    5555        return new CKEDITOR.dom.element( temp.firstChild ); 
    56 } 
     56}; 
    5757 
    5858CKEDITOR.dom.element.prototype = 
     
    7676        { 
    7777                element.$.parentNode.insertBefore( this.$, element.$ ); 
    78         }, 
    79          
    80         insertHtmlAfter : function( html ) 
    81         { 
    82                 var temp = new CKEDITOR.dom.element( 'div' ); 
    83                 temp.setHtml( html ); 
    84                  
    85                 docFrag.innerHTML = html; 
    86                  
    8778        }, 
    8879 
  • CKEditor/branches/prototype/_source/core/editor.js

    r2117 r2128  
    124124        // Basic config class to inherit the default settings from CKEDITOR.config. 
    125125        var config = function() 
    126         {} 
     126        {}; 
    127127        config.prototype = CKEDITOR.config; 
    128128 
  • CKEditor/branches/prototype/_source/core/event.js

    r2117 r2128  
    4848                this.name = eventName; 
    4949                this.listeners = []; 
    50         } 
     50        }; 
    5151 
    5252        eventEntry.prototype = 
  • CKEditor/branches/prototype/_source/core/loader.js

    r2100 r2128  
    8383                        { 
    8484                                // Absolute path. 
    85                                 if ( path.indexOf( '/' ) == 0 ) 
     85                                if ( path.indexOf( '/' ) === 0 ) 
    8686                                        path = location.href.match( /^.*?:\/\/[^\/]*/ )[0] + path; 
    8787                                // Relative path. 
  • CKEditor/branches/prototype/_source/core/resourcemanager.js

    r2117 r2128  
    8282 
    8383                // Nothing to load, just call the callback. 
    84                 if ( total == 0 ) 
     84                if ( !total ) 
    8585                { 
    8686                        callback.call( scope || window, names ); 
     
    104104                for ( var i = 0 ; i < names.length ; i++ ) 
    105105                { 
    106                         var name = names[ i ]; 
     106                        name = names[ i ]; 
    107107 
    108108                        // If not loaded already. 
  • CKEditor/branches/prototype/_source/core/scriptloader.js

    r2098 r2128  
    5959                                                        callback.call( scope || CKEDITOR, true ); 
    6060                                                } 
    61                                         } 
     61                                        }; 
    6262                                } 
    6363                                else 
     
    6666                                        { 
    6767                                                callback.call( scope || CKEDITOR, true ); 
    68                                         } 
     68                                        }; 
    6969 
    7070                                        // FIXME: Opera and Safari will not fire onerror. 
     
    7373                                        { 
    7474                                                callback.call( scope || CKEDITOR, false ); 
    75                                         } 
     75                                        }; 
    7676                                } 
    7777                        } 
  • CKEditor/branches/prototype/_source/core/test.js

    r2083 r2128  
    1919 * == END LICENSE == 
    2020 */ 
     21 
     22/*jsl:import ../tests/yuitest.js*/  
    2123 
    2224/** 
  • CKEditor/branches/prototype/_source/core/tools.js

    r2098 r2128  
    121121                        for ( var value, i = 0 ; 
    122122                                i < length && ( ( value = object[i] ) || 1) && callback.call( scope, value, i ) !== false ; i++ ) 
    123                         {} 
     123                        { /*jsl:pass*/ } 
    124124                } 
    125125        }, 
  • CKEditor/branches/prototype/_source/tests/core/editor.html

    r2091 r2128  
    3838                { 
    3939                        // Pass in-page settings to the instance. 
    40                         CKEDITOR.replace( 'editor2', { test1 : 'ball', theme : 'test_theme' } ); 
     40                        CKEDITOR.replace( 'editor2', { test1 : 'ball', baseHref : 'test' } ); 
    4141 
    4242                        var config = CKEDITOR.instances.editor2.config; 
    4343 
    4444                        assert.areSame( 'ball', config.test1, '"test1" doesn\'t match' ); 
    45                         assert.areSame( 'test_theme', config.theme, '"theme" doesn\'t match' ); 
     45                        assert.areSame( 'test', config.baseHref, '"baseHref" doesn\'t match' ); 
    4646 
    4747                        // All other settings must match CKEDITOR.config. 
    4848                        for ( var prop in CKEDITOR.config ) 
    4949                        { 
    50                                 if ( prop != 'test1' && prop != 'theme' ) 
     50                                if ( prop != 'test1' && prop != 'baseHref' ) 
    5151                                        assert.areSame( CKEDITOR.config[ prop ], config[ prop ], '"' + prop + '" doesn\'t match' ); 
    5252                        } 
     
    7070                                                                        assert.areSame( 'Ok', config.test_custom2, '"test_custom1" doesn\'t match' ); 
    7171                                                                        assert.areSame( 'ball', config.test1, '"test1" doesn\'t match' ); 
    72                                                                         assert.areSame( 'test_theme', config.theme, '"theme" doesn\'t match' ); 
     72                                                                        assert.areSame( 'test', config.baseHref, '"baseHref" doesn\'t match' ); 
    7373 
    7474                                                                        // All other settings must match CKEDITOR.config. 
    7575                                                                        for ( var prop in CKEDITOR.config ) 
    7676                                                                        { 
    77                                                                                 if ( prop != 'customConfig' && prop != 'test_custom1' && prop != 'test_custom2' && prop != 'test1' && prop != 'theme' ) 
     77                                                                                if ( prop != 'customConfig' && prop != 'test_custom1' && prop != 'test_custom2' && prop != 'test1' && prop != 'baseHref' ) 
    7878                                                                                        assert.areSame( CKEDITOR.config[ prop ], config[ prop ], '"' + prop + '" doesn\'t match' ); 
    7979                                                                        } 
     
    8484 
    8585                        // Pass in-page settings to the instance. 
    86                         CKEDITOR.replace( 'editor3', { customConfig : '_editor/custom_config_1.js', test1 : 'ball', theme : 'test_theme' } ); 
     86                        CKEDITOR.replace( 'editor3', { customConfig : '_editor/custom_config_1.js', test1 : 'ball', baseHref : 'test' } ); 
    8787 
    8888                        this.wait(); 
  • CKEditor/branches/prototype/_source/tests/core/scriptloader.html

    r2083 r2128  
    1919                        CKEDITOR.scriptLoader.loadCode( 'var test="Testing!";' ); 
    2020 
     21                        /*jsl:ignore*/ 
    2122                        assert.areEqual( 'Testing!', test ); 
     23                        /*jsl:end*/ 
    2224                }, 
    2325 
     
    2931                                testCase.resume( function() 
    3032                                        { 
     33                                                /*jsl:ignore*/ 
    3134                                                assert.areSame( 'Test!', testVar ); 
     35                                                /*jsl:end*/ 
    3236                                        } ); 
    3337                        }; 
  • CKEditor/branches/prototype/_source/tests/core/tools.html

    r2083 r2128  
    4545                                prop4 : fakeObj, 
    4646                                prop5 : fakeArray 
    47                         } 
     47                        }; 
    4848 
    4949                        CKEDITOR.tools.extend( target, 
  • CKEditor/branches/prototype/_source/tests/test.js

    r2090 r2128  
    1919 * == END LICENSE == 
    2020 */ 
     21 
     22/*jsl:import yuitest.js*/  
    2123 
    2224// Inject the YUI Test files into the page. 
     
    8587 
    8688                runner.run(); 
    87         } 
     89        }; 
    8890})(); 
  • CKEditor/branches/prototype/_source/tests/yuitest.js

    r2092 r2128  
    1 /* 
     1/*jsl:ignoreall*/ 
     2/* 
    23Copyright (c) 2008, Yahoo! Inc. All rights reserved. 
    34Code licensed under the BSD License: