Skip to content

Commit

Permalink
Loader is never used without ckeditor.js which sets basePath.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Jul 29, 2014
1 parent 1e2724e commit 53d3032
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions core/loader.js
Expand Up @@ -76,39 +76,6 @@ if ( !CKEDITOR.loader ) {
'creators/inline': []
};

var basePath = ( function() {
// This is a copy of CKEDITOR.basePath, but requires the script having
// "_source/loader.js".
if ( CKEDITOR && CKEDITOR.basePath )
return CKEDITOR.basePath;

// Find out the editor directory path, based on its <script> tag.
var path = '';
var scripts = document.getElementsByTagName( 'script' );

for ( var i = 0; i < scripts.length; i++ ) {
var match = scripts[ i ].src.match( /(^|.*?[\\\/])(?:_source\/)?core\/loader.js(?:\?.*|;.*)?$/i );

if ( match ) {
path = match[ 1 ];
break;
}
}

// 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 ) {
// Absolute path.
if ( path.indexOf( '/' ) === 0 )
path = location.href.match( /^.*?:\/\/[^\/]*/ )[ 0 ] + path;
// Relative path.
else
path = location.href.match( /^[^\?]*\// )[ 0 ] + path;
}

return path;
} )();

var timestamp = ( CKEDITOR && CKEDITOR.timestamp ) || ( new Date() ).valueOf(); // %REMOVE_LINE%
/* // %REMOVE_LINE%
* The production implementation contains a fixed timestamp // %REMOVE_LINE%
Expand All @@ -120,7 +87,7 @@ if ( !CKEDITOR.loader ) {
if ( CKEDITOR && CKEDITOR.getUrl )
return CKEDITOR.getUrl( resource );

return basePath + resource + ( resource.indexOf( '?' ) >= 0 ? '&' : '?' ) + 't=' + timestamp;
return CKEDITOR.basePath + resource + ( resource.indexOf( '?' ) >= 0 ? '&' : '?' ) + 't=' + timestamp;
};

var pendingLoad = [];
Expand Down

0 comments on commit 53d3032

Please sign in to comment.