Ticket #2940: 2940.patch
File 2940.patch, 8.2 KB (added by , 16 years ago) |
---|
-
_source/core/ckeditor_base.js
12 12 // Must be updated on changes in the script, as well as updated in the 13 13 // ckeditor_source.js and ckeditor_basic_source.js files. 14 14 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;})(); 16 16 17 17 // #### Raw code 18 18 // ATTENTION: read the above "Compressed Code" notes when changing this code. … … 27 27 */ 28 28 window.CKEDITOR = (function() 29 29 { 30 return /** @lends CKEDITOR */ { 30 var CKEDITOR = 31 /** @lends CKEDITOR */ 32 { 31 33 32 34 /** 33 35 * A constant string unique for each release of CKEditor. Its value … … 74 76 75 77 /** 76 78 * 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. 77 82 * @type String 78 83 * @example 79 84 * alert( <b>CKEDITOR.basePath</b> ); // "http://www.example.com/ckeditor/" (e.g.) … … 84 89 // var basePath in "core/loader.js". 85 90 86 91 // 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 || ''; 89 93 90 for ( var i = 0 ; i < scripts.length ; i++)94 if ( !path ) 91 95 { 92 var match = scripts[i].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);96 var scripts = document.getElementsByTagName( 'script' ); 93 97 94 if ( match)98 for ( var i = 0 ; i < scripts.length ; i++ ) 95 99 { 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 } 98 107 } 99 108 } 100 109 … … 117 126 * Gets the full URL for CKEditor resources. By default, URLs 118 127 * returned by this function contains a querystring parameter ("t") 119 128 * 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. 120 134 * @returns {String} The full URL. 121 135 * @example 122 136 * // e.g. http://www.example.com/ckeditor/skins/default/editor.css?t=87dm … … 140 154 return resource; 141 155 } 142 156 }; 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; 143 172 })(); 144 173 } 145 174 -
ckeditor_basic_source.js
5 5 6 6 // Compressed version of core/ckeditor_base.js. See original for instructions. 7 7 /*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;}};})();};8 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;})(); 9 9 /*jsl:end*/ 10 10 11 11 // Uncomment the following line to have a new timestamp generated for each -
ckeditor_source.js
5 5 6 6 // Compressed version of core/ckeditor_base.js. See original for instructions. 7 7 /*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;}};})();};8 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;})(); 9 9 /*jsl:end*/ 10 10 11 11 // Uncomment the following line to have a new timestamp generated for each