Skip to content

Commit 98f5333

Browse files
authored
Merge pull request #1 from easycoder/dev
Dev
2 parents e43f210 + 220ef6c commit 98f5333

File tree

8 files changed

+43
-37
lines changed

8 files changed

+43
-37
lines changed

easycoder/easycoder-min.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

easycoder/easycoder.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,9 @@ const EasyCoder = {
38783878
}
38793879
const script = document.createElement(`script`);
38803880
script.type = `text/javascript`;
3881-
script.src = `${src}?ver=${EasyCoder.version}`;
3881+
let location = document.scripts[0].src;
3882+
location = location.substring(0, location.indexOf(`/easycoder.js`));
3883+
script.src = `${location}/${src}?ver=${EasyCoder.version}`;
38823884
script.onload = function () {
38833885
console.log(`${Date.now() - EasyCoder.timestamp} ms: Plugin ${src} loaded`);
38843886
onload();
@@ -3913,7 +3915,8 @@ const EasyCoder = {
39133915
console.log(`${Date.now() - this.timestamp} ms: Load ${path}/easycoder/plugins.js`);
39143916
const script = document.createElement(`script`);
39153917
let location = document.scripts[0].src;
3916-
script.src = `${window.location.origin}${path}/easycoder/plugins.js?ver=${this.version}`;
3918+
location = location.substring(0, location.indexOf(`/easycoder.js`));
3919+
script.src = `${location}/plugins.js?ver=${this.version}`;
39173920
script.type = `text/javascript`;
39183921
script.onload = () => {
39193922
EasyCoder_Plugins.getGlobalPlugins(
@@ -4346,7 +4349,7 @@ const EasyCoder_Value = {
43464349
return value;
43474350
}
43484351
};
4349-
EasyCoder.version = `2.6.0`;
4352+
EasyCoder.version = `2.6.1`;
43504353
EasyCoder.timestamp = Date.now();
43514354
console.log(`EasyCoder loaded; waiting for page`);
43524355

easycoder/easycoder.zip

78 Bytes
Binary file not shown.

easycoder/plugins.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,37 @@ const EasyCoder_Plugins = {
1919
setPluginCount(6); // *** IMPORTANT *** the number of plugins you will be adding
2020

2121
getPlugin(`browser`,
22-
`/easycoder/plugins/browser.js`,
22+
`/plugins/browser.js`,
2323
function () {
2424
addPlugin(`browser`, EasyCoder_Browser);
2525
});
2626

2727
getPlugin(`json`,
28-
`/easycoder/plugins/json.js`,
28+
`/plugins/json.js`,
2929
function () {
3030
addPlugin(`json`, EasyCoder_Json);
3131
});
3232

3333
getPlugin(`rest`,
34-
`/easycoder/plugins/rest.js`,
34+
`/plugins/rest.js`,
3535
function () {
3636
addPlugin(`rest`, EasyCoder_Rest);
3737
});
3838

3939
getPlugin(`svg`,
40-
`/easycoder/plugins/svg.js`,
40+
`/plugins/svg.js`,
4141
function () {
4242
addPlugin(`svg`, EasyCoder_SVG);
4343
});
4444

4545
getPlugin(`showdown`,
46-
`/easycoder/plugins/showdown.js`,
46+
`/plugins/showdown.js`,
4747
function () {
4848
addPlugin(`showdown`, EasyCoder_Showdown);
4949
});
5050

5151
getPlugin(`vfx`,
52-
`/easycoder/plugins/vfx.js`,
52+
`/plugins/vfx.js`,
5353
function () {
5454
addPlugin(`vfx`, EasyCoder_VFX);
5555
});
@@ -61,48 +61,48 @@ const EasyCoder_Plugins = {
6161
/*
6262
* This lets you add a plugin before launching a script, using the 'plugin' command.
6363
* You must provide a case for every plugin you will be adding;
64-
* use 'ckeditor' as the pattern to follow.
64+
* use any one of them as the pattern to follow.
6565
*/
6666

6767
switch (name) {
6868
case `codemirror`:
6969
getPlugin(name,
70-
`/easycoder/plugins/codemirror.js`,
70+
`/plugins/codemirror.js`,
7171
function () {
7272
addPlugin(name, EasyCoder_CodeMirror, callback);
7373
});
7474
break;
7575
case `ckeditor`:
7676
getPlugin(name,
77-
`/easycoder/plugins/ckeditor.js`,
77+
`/plugins/ckeditor.js`,
7878
function () {
7979
addPlugin(name, EasyCoder_CKEditor, callback);
8080
});
8181
break;
8282
case `ui`:
8383
getPlugin(name,
84-
`/easycoder/plugins/ui.js`,
84+
`/plugins/ui.js`,
8585
function () {
8686
addPlugin(name, EasyCoder_UI, callback);
8787
});
8888
break;
8989
case `anagrams`:
9090
getPlugin(name,
91-
`/easycoder/plugins/anagrams.js`,
91+
`/plugins/anagrams.js`,
9292
function () {
9393
addPlugin(name, EasyCoder_Anagrams, callback);
9494
});
9595
break;
9696
case `gmap`:
9797
getPlugin(name,
98-
`/easycoder/plugins/gmap.js`,
98+
`/plugins/gmap.js`,
9999
function () {
100100
addPlugin(name, EasyCoder_GMap, callback);
101101
});
102102
break;
103103
case `wof`:
104104
getPlugin(name,
105-
`/easycoder/plugins/wof.js`,
105+
`/plugins/wof.js`,
106106
function () {
107107
addPlugin(name, EasyCoder_WOF, callback);
108108
});

js/EasyCoder-Cordova.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EasyCoder.version = `2.6.0`;
1+
EasyCoder.version = `2.6.1`;
22
EasyCoder.timestamp = Date.now();
33

44
const app = {

js/EasyCoder-ST.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EasyCoder.version = `2.6.0`;
1+
EasyCoder.version = `2.6.1`;
22
EasyCoder.timestamp = Date.now();
33

44
function EasyCoder_Startup() {

js/EasyCoder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EasyCoder.version = `2.6.0`;
1+
EasyCoder.version = `2.6.1`;
22
EasyCoder.timestamp = Date.now();
33
console.log(`EasyCoder loaded; waiting for page`);
44

js/easycoder/Main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ const EasyCoder = {
387387
}
388388
const script = document.createElement(`script`);
389389
script.type = `text/javascript`;
390-
script.src = `${src}?ver=${EasyCoder.version}`;
390+
let location = document.scripts[0].src;
391+
location = location.substring(0, location.indexOf(`/easycoder.js`));
392+
script.src = `${location}/${src}?ver=${EasyCoder.version}`;
391393
script.onload = function () {
392394
console.log(`${Date.now() - EasyCoder.timestamp} ms: Plugin ${src} loaded`);
393395
onload();
@@ -419,10 +421,11 @@ const EasyCoder = {
419421
},
420422

421423
loadPluginJs: function(path) {
422-
console.log(`${Date.now() - this.timestamp} ms: Load ${path}/easycoder/plugins.js`);
423-
const script = document.createElement(`script`);
424424
let location = document.scripts[0].src;
425-
script.src = `${window.location.origin}${path}/easycoder/plugins.js?ver=${this.version}`;
425+
location = location.substring(0, location.indexOf(`/easycoder.js`));
426+
console.log(`${Date.now() - this.timestamp} ms: Load ${location}/plugins.js`);
427+
const script = document.createElement(`script`);
428+
script.src = `${location}/plugins.js?ver=${this.version}`;
426429
script.type = `text/javascript`;
427430
script.onload = () => {
428431
EasyCoder_Plugins.getGlobalPlugins(

0 commit comments

Comments
 (0)