Ticket #2940: 2940.patch

File 2940.patch, 8.2 KB (added by Frederico Caldeira Knabben, 16 years ago)
  • _source/core/ckeditor_base.js

     
    1212// Must be updated on changes in the script, as well as updated in the
    1313// ckeditor_source.js and ckeditor_basic_source.js files.
    1414
    15 // if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',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)?(?:_source)?.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;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
     15// if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp)d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
    1616
    1717// #### Raw code
    1818// ATTENTION: read the above "Compressed Code" notes when changing this code.
     
    2727         */
    2828        window.CKEDITOR = (function()
    2929        {
    30                 return /** @lends CKEDITOR */ {
     30                var CKEDITOR =
     31                /** @lends CKEDITOR */
     32                {
    3133
    3234                        /**
    3335                         * A constant string unique for each release of CKEditor. Its value
     
    7476
    7577                        /**
    7678                         * Contains the full URL for the CKEditor installation directory.
     79                         * It's possible to manually provide the base path by setting a
     80                         * global variable named CKEDITOR_BASEPATH. This global variable
     81                         * must be set "before" the editor script loading.
    7782                         * @type String
    7883                         * @example
    7984                         * alert( <b>CKEDITOR.basePath</b> );  // "http://www.example.com/ckeditor/" (e.g.)
     
    8489                                // var basePath in "core/loader.js".
    8590
    8691                                // Find out the editor directory path, based on its <script> tag.
    87                                 var path = '';
    88                                 var scripts = document.getElementsByTagName( 'script' );
     92                                var path = window.CKEDITOR_BASEPATH || '';
    8993
    90                                 for ( var i = 0 ; i < scripts.length ; i++ )
     94                                if ( !path )
    9195                                {
    92                                         var match = scripts[i].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i );
     96                                        var scripts = document.getElementsByTagName( 'script' );
    9397
    94                                         if ( match )
     98                                        for ( var i = 0 ; i < scripts.length ; i++ )
    9599                                        {
    96                                                 path = match[1];
    97                                                 break;
     100                                                var match = scripts[i].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i );
     101
     102                                                if ( match )
     103                                                {
     104                                                        path = match[1];
     105                                                        break;
     106                                                }
    98107                                        }
    99108                                }
    100109
     
    117126                         * Gets the full URL for CKEditor resources. By default, URLs
    118127                         * returned by this function contains a querystring parameter ("t")
    119128                         * set to the {@link CKEDITOR.timestamp} value.
     129                         * It's possible to provide a custom implementation to this
     130                         * function by setting a global variable named CKEDITOR_GETURL.
     131                         * This global variable must be set "before" the editor script
     132                         * loading. If the custom implementation returns nothing, the
     133                         * default implementation is used.
    120134                         * @returns {String} The full URL.
    121135                         * @example
    122136                         * // e.g. http://www.example.com/ckeditor/skins/default/editor.css?t=87dm
     
    140154                                return resource;
    141155                        }
    142156                };
     157
     158                // Make it possible to override the getUrl function with a custom
     159                // implementation pointing to a global named CKEDITOR_GETURL.
     160                var newGetUrl = window.CKEDITOR_GETURL;
     161                if ( newGetUrl )
     162                {
     163                        var originalGetUrl = CKEDITOR.getUrl;
     164                        CKEDITOR.getUrl = function ( resource )
     165                        {
     166                                return newGetUrl.call( CKEDITOR, resource ) ||
     167                                        originalGetUrl.call( CKEDITOR, resource );
     168                        }
     169                }
     170               
     171                return CKEDITOR;
    143172        })();
    144173}
    145174
  • ckeditor_basic_source.js

     
    55
    66// Compressed version of core/ckeditor_base.js. See original for instructions.
    77/*jsl:ignore*/
    8 if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',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)?(?:_source)?.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;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
     8if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp)d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
    99/*jsl:end*/
    1010
    1111// Uncomment the following line to have a new timestamp generated for each
  • ckeditor_source.js

     
    55
    66// Compressed version of core/ckeditor_base.js. See original for instructions.
    77/*jsl:ignore*/
    8 if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',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)?(?:_source)?.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;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
     8if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp)d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
    99/*jsl:end*/
    1010
    1111// Uncomment the following line to have a new timestamp generated for each
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy