X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fckeditor_base.js;h=c1db640fa61ddcfc893dc683d2536cc319144e7d;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=f50a539238e7426fa09a05ac2bdf47f2fc19a9bd;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/core/ckeditor_base.js b/_source/core/ckeditor_base.js index f50a539..c1db640 100644 --- a/_source/core/ckeditor_base.js +++ b/_source/core/ckeditor_base.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -12,7 +12,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Must be updated on changes in the script, as well as updated in the // ckeditor_source.js and ckeditor_basic_source.js files. -// if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.0.2',rev:'4760',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=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;})(); +// if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.1',rev:'6398',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=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;})(); // #### Raw code // ATTENTION: read the above "Compressed Code" notes when changing this code. @@ -20,9 +20,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !window.CKEDITOR ) { /** - * This is the API entry point. The entire CKEditor code runs under this object. * @name CKEDITOR - * @namespace + * @namespace This is the API entry point. The entire CKEditor code runs under this object. * @example */ window.CKEDITOR = (function() @@ -43,24 +42,25 @@ if ( !window.CKEDITOR ) // The production implementation contains a fixed timestamp, unique // for each release, generated by the releaser. // (Base 36 value of each component of YYMMDDHH - 4 chars total - e.g. 87bm == 08071122) - timestamp : '9BIB', + timestamp : 'B1CB4XQ', /** * Contains the CKEditor version number. * @type String * @example - * alert( CKEDITOR.version ); // e.g. 'CKEditor 3.0 Beta' + * alert( CKEDITOR.version ); // e.g. 'CKEditor 3.4.1' */ - version : '3.0.2', + version : '3.5.1', /** * Contains the CKEditor revision number. - * Revision number is incremented automatically after each modification of CKEditor source code. + * The revision number is incremented automatically, following each + * modification to the CKEditor source code. * @type String * @example * alert( CKEDITOR.revision ); // e.g. '3975' */ - revision : '4760', + revision : '6398', /** * Private object used to hold core stuff. It should not be used out of @@ -77,11 +77,11 @@ if ( !window.CKEDITOR ) *
  • basic_loaded: the basic API features are available.
  • *
  • basic_ready: the basic API is ready to load the full core code.
  • *
  • loading: the full API is being loaded.
  • - *
  • ready: the API can be fully used.
  • + *
  • loaded: the API can be fully used.
  • * * @type String * @example - * if ( CKEDITOR.status == 'ready' ) + * if ( CKEDITOR.status == 'loaded' ) * { * // The API can now be fully used. * } @@ -123,7 +123,7 @@ if ( !window.CKEDITOR ) // In IE (only) the script.src string is the raw valued entered in the // HTML. Other browsers return the full resolved URL instead. - if ( path.indexOf('://') == -1 ) + if ( path.indexOf(':/') == -1 ) { // Absolute path. if ( path.indexOf( '/' ) === 0 ) @@ -133,18 +133,24 @@ if ( !window.CKEDITOR ) path = location.href.match( /^[^\?]*\/(?:)/ )[0] + path; } + if ( !path ) + throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'; + return path; })(), /** * Gets the full URL for CKEditor resources. By default, URLs * returned by this function contains a querystring parameter ("t") - * set to the {@link CKEDITOR.timestamp} value. + * set to the {@link CKEDITOR.timestamp} value.
    + *
    * It's possible to provide a custom implementation to this * function by setting a global variable named CKEDITOR_GETURL. * This global variable must be set "before" the editor script - * loading. If the custom implementation returns nothing, the + * loading. If the custom implementation returns nothing (==null), the * default implementation is used. + * @param {String} resource The resource to which get the full URL. + * It may be a full, absolute or relative URL. * @returns {String} The full URL. * @example * // e.g. http://www.example.com/ckeditor/skins/default/editor.css?t=87dm @@ -159,11 +165,11 @@ if ( !window.CKEDITOR ) getUrl : function( resource ) { // If this is not a full or absolute path. - if ( resource.indexOf('://') == -1 && resource.indexOf( '/' ) !== 0 ) + if ( resource.indexOf(':/') == -1 && resource.indexOf( '/' ) !== 0 ) resource = this.basePath + resource; // Add the timestamp, except for directories. - if ( this.timestamp && resource.charAt( resource.length - 1 ) != '/' ) + if ( this.timestamp && resource.charAt( resource.length - 1 ) != '/' && !(/[&?]t=/).test( resource ) ) resource += ( resource.indexOf( '?' ) >= 0 ? '&' : '?' ) + 't=' + this.timestamp; return resource;