File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -3912,8 +3912,11 @@ const EasyCoder = {
3912
3912
} ,
3913
3913
3914
3914
loadPluginJs : function ( path ) {
3915
- let location = document . scripts [ 0 ] . src ;
3916
- location = location . substring ( 0 , location . indexOf ( `/easycoder.js` ) ) ;
3915
+ let location = path ;
3916
+ if ( ! location ) {
3917
+ location = document . scripts [ 0 ] . src ;
3918
+ location = location . substring ( 0 , location . indexOf ( `/easycoder.js` ) ) ;
3919
+ }
3917
3920
console . log ( `${ Date . now ( ) - this . timestamp } ms: Load ${ location } /plugins.js` ) ;
3918
3921
const script = document . createElement ( `script` ) ;
3919
3922
script . src = `${ location } /plugins.js?ver=${ this . version } ` ;
@@ -3929,7 +3932,7 @@ const EasyCoder = {
3929
3932
} ;
3930
3933
script . onerror = ( ) => {
3931
3934
if ( path ) {
3932
- this . loadPluginJs ( path . slice ( 0 , path . lastIndexOf ( `/` ) ) ) ;
3935
+ this . loadPluginJs ( null ) ;
3933
3936
} else {
3934
3937
this . reportError ( {
3935
3938
message : `Can't load plugins.js`
@@ -3950,7 +3953,7 @@ const EasyCoder = {
3950
3953
pathname = `` ;
3951
3954
}
3952
3955
if ( typeof EasyCoder_Plugins === `undefined` ) {
3953
- this . loadPluginJs ( pathname ) ;
3956
+ this . loadPluginJs ( ` ${ window . location . href } plugins.js` ) ;
3954
3957
} else {
3955
3958
this . pluginsPath = pathname ;
3956
3959
EasyCoder_Plugins . getGlobalPlugins (
Original file line number Diff line number Diff line change @@ -421,8 +421,11 @@ const EasyCoder = {
421
421
} ,
422
422
423
423
loadPluginJs : function ( path ) {
424
- let location = document . scripts [ 0 ] . src ;
425
- location = location . substring ( 0 , location . indexOf ( `/easycoder.js` ) ) ;
424
+ let location = path ;
425
+ if ( ! location ) {
426
+ location = document . scripts [ 0 ] . src ;
427
+ location = location . substring ( 0 , location . indexOf ( `/easycoder.js` ) ) ;
428
+ }
426
429
console . log ( `${ Date . now ( ) - this . timestamp } ms: Load ${ location } /plugins.js` ) ;
427
430
const script = document . createElement ( `script` ) ;
428
431
script . src = `${ location } /plugins.js?ver=${ this . version } ` ;
@@ -438,7 +441,7 @@ const EasyCoder = {
438
441
} ;
439
442
script . onerror = ( ) => {
440
443
if ( path ) {
441
- this . loadPluginJs ( path . slice ( 0 , path . lastIndexOf ( `/` ) ) ) ;
444
+ this . loadPluginJs ( null ) ;
442
445
} else {
443
446
this . reportError ( {
444
447
message : `Can't load plugins.js`
@@ -459,7 +462,7 @@ const EasyCoder = {
459
462
pathname = `` ;
460
463
}
461
464
if ( typeof EasyCoder_Plugins === `undefined` ) {
462
- this . loadPluginJs ( pathname ) ;
465
+ this . loadPluginJs ( ` ${ window . location . href } plugins.js` ) ;
463
466
} else {
464
467
this . pluginsPath = pathname ;
465
468
EasyCoder_Plugins . getGlobalPlugins (
You can’t perform that action at this time.
0 commit comments