Skip to content

Commit 43da2aa

Browse files
authored
Merge pull request #2 from easycoder/dev
Update doc
2 parents 98f5333 + 02a5192 commit 43da2aa

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

easycoder/easycoder-min.js

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

easycoder/easycoder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3912,10 +3912,10 @@ const EasyCoder = {
39123912
},
39133913

39143914
loadPluginJs: function(path) {
3915-
console.log(`${Date.now() - this.timestamp} ms: Load ${path}/easycoder/plugins.js`);
3916-
const script = document.createElement(`script`);
39173915
let location = document.scripts[0].src;
39183916
location = location.substring(0, location.indexOf(`/easycoder.js`));
3917+
console.log(`${Date.now() - this.timestamp} ms: Load ${location}/plugins.js`);
3918+
const script = document.createElement(`script`);
39193919
script.src = `${location}/plugins.js?ver=${this.version}`;
39203920
script.type = `text/javascript`;
39213921
script.onload = () => {

easycoder/easycoder.zip

-8 Bytes
Binary file not shown.

easycoder/plugins.js

Lines changed: 12 additions & 12 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-
`/plugins/browser.js`,
22+
`plugins/browser.js`,
2323
function () {
2424
addPlugin(`browser`, EasyCoder_Browser);
2525
});
2626

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

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

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

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

5151
getPlugin(`vfx`,
52-
`/plugins/vfx.js`,
52+
`plugins/vfx.js`,
5353
function () {
5454
addPlugin(`vfx`, EasyCoder_VFX);
5555
});
@@ -67,42 +67,42 @@ const EasyCoder_Plugins = {
6767
switch (name) {
6868
case `codemirror`:
6969
getPlugin(name,
70-
`/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-
`/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-
`/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-
`/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-
`/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-
`/plugins/wof.js`,
105+
`plugins/wof.js`,
106106
function () {
107107
addPlugin(name, EasyCoder_WOF, callback);
108108
});

resources/md/intro.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
# Introduction #
2-
So you've built yourself a website and you'd like to add some interactivity. For this you need a program - otherwise known as a script - and some element on your page to make interactive. You may have been told that JavaScript is your only option and you may have already tried it and found it rather intimidating; if so, here's a simpler alternative. (Note for WordPress users: these instructions also apply to you; check /WP/ for some further details.)
2+
So you've built yourself a website and you'd like to add some interactivity. For this you need a program - otherwise known as a script - and some element on your page to make interactive. You may have been told that JavaScript is your only option and you may have already tried it and found it rather intimidating; if so, here's a simpler alternative. (Note for WordPress users: a plugin is available for ~ec~; just search for it by name. It also has [its own website](https://easycoder.software)).
33

44
To help you get started, let's do something super simple. I'm assuming you already have access to your own hosting plan or are able to borrow some space on a friend's site. If you haven't yet built any kind of working web page - from the level of Hello, World upwards - I recommend you get familiar with that first; it's rather outside the scope of these instructions.
55

6-
Once you have edit access to an empty server directory, download [helloworld.zip](#) into it and unzip it. If all is well, when you type the URL of the site into your browser the message **Hello, world!** should appear at the top of the window.
6+
Once you have edit access to an empty server directory, create an `index.html` file with the following contents:
77

8-
Then open `index.html` into your editor. This is the file we'll be using for this short demo. Replace the existing `<body>...</body>` section with the following:
8+
```
9+
<html>
10+
<head>
11+
<meta charset="UTF-8">
12+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
13+
<script type='text/javascript' src='https://cdn.jsdelivr.net/gh
14+
/easycoder/easycoder.github.io@master/easycoder/easycoder.js'></script>
15+
</head>
16+
17+
<body>
18+
19+
<pre id="easycoder-script" style="display:none">
20+
21+
alert `Hello, world!`
22+
23+
</pre>
24+
25+
</body>
26+
</html>
27+
```
28+
29+
If all is well, when you type the URL of the site into your browser the message **Hello, world!** should appear at the top of the window.
30+
31+
The upper half of the file is the _HEAD_ of the document. In here is a call to load the ~ec~ JavaScript engine that we'll be using instead of regular JavaScript. It's called from a _Content Delivery Network_ that takes files from the main source-code repository for ~ec~. Don't worry if this is all a bit too technical; it's not necessary to understand in order to use it.
32+
33+
The lower half of the file is the _BODY_ of the document, which contains everything your users are going to see. This example, being as simple as you can get, has a single element, a preformatted (`<pre>`) element, inside which is the 1-line script that displays the popup message you just saw. ~ec~ scripts look a lot like English, and like human languages they use very few symbols. It's very easy to learn the basics and whatever you write always goes inside the `<pre>` element we see here.
34+
35+
Now open `index.html` into your editor. This is the file we'll be using for this short demo. Replace the existing `<body>...</body>` section with the following:
936

1037
/1/
1138
Load the page into your browser and check the text appears. Note that only text that's outside of any angle braces will appear; the rest is all HTML tags. In this case there's a single ~code:&lt;div&gt;~ (division) that contains our text; it also has an identifier string that we'll use shortly.

0 commit comments

Comments
 (0)