Skip to content

Commit ab70aec

Browse files
authored
Merge pull request #20 from easycoder/dev
Distribution file set
2 parents 3e8e084 + 7080a45 commit ab70aec

File tree

15 files changed

+2056
-10
lines changed

15 files changed

+2056
-10
lines changed

dist/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# EasyCoder distribution file set
1+
# EasyCoder server files
22

3-
Here are the files that can be used to create standalone EasyCoder applications. Not all will be needed for any given application but it's probably simplest to copy them all. The main `easycoder.js` contains everything that will be needed for a wide range of applications. Extra functionality is supplied by the files in the `plugins` folder. These will be requested where they are needed, using the `require` keyword.
4-
5-
The files in the `plugin` folder are simply copies of the source set at `js`. The two files `easycoder.js` and `easycoder-min.js` are built from their sources; the latter is a minimized version of the former.
3+
These are mostly server-side files. The most significant are 2 small REST servers written in PHP and Python, which perform the same functions. The former is for setting up a `localhost` server and the latter is for use on LAMP servers.
64

7-
To use EasyCoder, put the entire `easycoder` folder onto your webserver (giving it any suitable name) and in your HTML page header call for `easycoder.js` or `easycoder-min.js` (the former is more useful for debugging). This will call in other files as it needs them.
5+
The files `easycoder.php`, `ec-rest.txt` and `readme.txt` are for WordPress installations.

dist/easycoder.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Plugin Name: EasyCoder
4+
* Plugin URI: https://easycoder.software
5+
* Description: Control the appearance and behavior of your posts and pages by embedding simple English-like scripts, without the need to learn JavaScript.
6+
* Version: 2.6.0
7+
* Author: EasyCoder Software
8+
* Author URI: https://easycoder.software
9+
*/
10+
// Exit if accessed directly
11+
if ( ! defined( 'ABSPATH' ) ) {
12+
exit;
13+
}
14+
15+
// The EasyCoder library
16+
add_action('wp_enqueue_scripts', 'easycoder_enqueue_script', 2);
17+
function easycoder_enqueue_script() {
18+
wp_enqueue_script('easycoder_script', plugin_dir_url( __FILE__ )
19+
. 'easycoder-min.js', array(), '2.5.6');
20+
}
21+
22+
// Set up default plugin and REST scripts
23+
add_action('init', 'setup_default_files', 1 );
24+
function setup_default_files() {
25+
$pluginDir = plugin_dir_path( __FILE__ );
26+
27+
mkdir(ABSPATH . 'easycoder');
28+
if (!file_exists(ABSPATH . 'easycoder/plugins.js')) {
29+
copy($pluginDir . 'plugins-sample.js', ABSPATH . 'easycoder/plugins.js');
30+
}
31+
if (!file_exists(ABSPATH . 'easycoder/rest-local.php')) {
32+
copy($pluginDir . 'rest-local-sample.php', ABSPATH . 'easycoder/rest-local.php');
33+
}
34+
}
35+
36+
?>

dist/ec-rest.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The properties file for EasyCoder
2+
# It is required mostly by the REST server - see the documentation
3+
# Modify as required and install it above the root of your WordPress installation (if possible)
4+
# Rename it to {your website URL}.txt
5+
# Do not include the braces shown below
6+
7+
# The URL of the MySQL server
8+
sqlhost={your mysql server}
9+
10+
# The name of the database user
11+
sqluser={your mysql user name}
12+
13+
# The database password
14+
sqlpassword={your mysql password}
15+
16+
# The database to use
17+
sqldatabase={the name of your database}
18+
19+
# An encrypted password, if needed, e.g. for restricted admin access to your site.
20+
# If you use 'rest get Result from `_verify/` cat {password}'
21+
# the REST server will encrypt the value of {password} and compare it with
22+
# the value held here. It will return 'yes' if there is a match; 'no' if not
23+
# and place it in the Result variable.
24+
# You can create a hash value using this URL:
25+
# {Your website}/wp-content/plugins/easycoder/rest.php/_hash/{password}
26+
password={encrypted password}

dist/readme.txt

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
=== EasyCoder Plugin ===
2+
3+
Donate link: https://easycoder.software
4+
Contributors: gtanyware
5+
Tags: code, compiler, css, customise, customize, debug, debugger, DSL, interactivity, graphics, javascript, program, programming, rest, script, scripting, tracer, webservice
6+
Requires at least: 4.4
7+
Requires PHP: 5.2
8+
Tested up to: 5.2
9+
Stable tag: trunk
10+
License: GPLv2 or later
11+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12+
13+
Control the appearance and behavior of your posts and pages by embedding simple English-like scripts, without the need to learn JavaScript
14+
15+
== Description ==
16+
17+
*EasyCoder* is a programming language written in JavaScript/ECMAScript6 and packaged as a browser plugin. It is known to work with popular browsers such as Chrome and Firefox on Windows or Linux, as well as on current iOS and Android devices.
18+
19+
*EasyCoder* is for non-programmers, who generally find JavaScript hard to learn. Not everyone wants to be a professional programmer; most just want to achieve results with the minimum of effort. The work done by JavaScript in a web page mostly uses a small fraction of its capabilities, so we've taken the more common requirements and packaged them up in an English-like script syntax. Some of the things you may want to do are
20+
21+
* Change the appearance of a screen element by modifying its CSS attributes. You may want something a little - or a lot - different to what your theme provides
22+
* Show and hide parts of your content, avoiding the need to reload the page by putting everything in at the start and selecting which parts of it to show
23+
* React to button clicks and other events by altering the appearance or revealing content as above
24+
* Retrieve content from web services using REST and JSON
25+
* Draw and animate simple graphics
26+
* Create a Google Map, put markers on it and intearct with the map and the markers
27+
* Use CodeMirror to create a unique color-coded text editor
28+
* Include the CKEditor rich text editor in your pages
29+
* Include the Showdown markdown converter in your pages
30+
31+
*EasyCoder* provides a simple syntax to do all these things, at about the same level of complexity and readability as SQL or Excel macros. It's a full programming language, though, capable of making complex logical decisions.
32+
33+
*EasyCoder* scripts are embedded in your page or post, inside a special "preformatted" tag. When the page loads, *EasyCoder* looks for this element then compiles and runs the script it contains. When it interacts with HTML elements it attaches their IDs to its own variables, so your HTML and its controlling script are in the same file.
34+
35+
The *EasyCoder* core module is currently about 60k bytes in its minimised form and it downloads its own plugin modules from a growing library. Its performance is good because it precompiles scripts - a process that takes jus a few tens of milliseconds - and the compiled code for each command is only a thin wrapper around the corresponding JavaScript functionality.
36+
37+
When *EasyCoder* detects an error, either in compilation or at runtime, it opens a popup window with a friendly error message that tries to tell you what went wrong and where in the script it happened.
38+
39+
As a further help when developing scripts, *EasyCoder* has a single-step tracer where you can decide which variables to display for each step of your script. To use this feature you add another special "preformatted" section to your page and add the 'trace' command in your script where you want tracing to start. See the [Documentation](https://easycoder.software/documentation).
40+
41+
*EasyCoder* has a fully pluggable architecture. This means any JavaScript development team can make their own plugins, that 'wrap' *EasyCoder* functionality round their products so WordPress site developers can use them without the need to learn JavaScript. Plugins can be served from any website without any need to notify EasyCoder Software.
42+
43+
== Documentation ==
44+
45+
Extensive documentation is available at our [documentation](https://easycoder.software/documentation)page.
46+
47+
== Examples ==
48+
49+
A range of example scripts can be seen at our [examples](https://easycoder.software/examples) page.
50+
51+
== Learning resources ==
52+
53+
For tutorials and a programmers' reference see our [EasyCoder Software Codex](https://codex.easycoder.software).
54+
55+
== Changelog ==
56+
57+
= 2.6.0 21-feb 2020 =
58+
* Added a VFX plugin; many other updates & bug fixes
59+
60+
= 2.5.6 14-dec-2019 =
61+
* Fix bug in REST handling errors
62+
63+
= 2.5.5 12-dec-2019 =
64+
* Fix problems with exit(); replace program with name in objects
65+
66+
= 2.5.4 10-dec-2019 =
67+
* Fixed bug in parent script handling
68+
69+
= 2.5.3 09-dec-2019 =
70+
* Revised run/import handling & minor additions
71+
72+
= 2.5.2 05-oct-2019 =
73+
* Fix bugs in drag & drop and others
74+
75+
= 2.5.1 30-aug-2019 =
76+
* CORS, bug fixes
77+
78+
= 2.5.0 26-aug-2019 =
79+
* Drag & drop
80+
81+
= 2.4.6 09-aug-2019 =
82+
* Minor updates to gmap and others
83+
84+
= 2.4.5 24-jul-2019 =
85+
* Update version number
86+
87+
= 2.4.4 21-jul-2019 =
88+
* Add 'or' clause to 'attach'
89+
90+
= 2.4.3 5-jul-2019 =
91+
* Refactor for faster tokenizing
92+
93+
= 2.4.2 22-jun-2019 =
94+
* Fix another bug in REST server
95+
96+
= 2.4.1 18-jun-2019 =
97+
* Fix bug in REST server
98+
99+
= 2.4.0 18-jun-2019 =
100+
* Sorting & filtering; added the script editor
101+
102+
= 2.3.1 7-jun-2019 =
103+
* Bug fixes & updates to support learn-to-code
104+
105+
= 2.3.0 16-may-2019 =
106+
* All JS modues version-numbered; split json into json/rest
107+
108+
= 2.2.6 12-may-2019 =
109+
* Updated 'require'; replaced missing sample file
110+
111+
= 2.2.5 9-may-2019 =
112+
* Updated 'require'; replaced missing sample file
113+
114+
= 2.2.4 1-may-2019 =
115+
* Handler for on leave
116+
117+
= 2.2.3 29-apr-2019 =
118+
* Detect portrait and landscape
119+
120+
= 2.2.2 1-apr-2019 =
121+
* Added date formatting
122+
123+
= 2.2.1 17-mar-2019 =
124+
* New plugin: anagrams. Various changes/optimisations/bugfixes
125+
126+
= 2.2.0 25-feb-2019 =
127+
* New plugins: gmap and showdown.
128+
129+
= 2.1.9 21-jan-2019 =
130+
* Code checked by eslint.
131+
132+
= 2.1.8 16-dec-2018 =
133+
* All UI components can be created programmatically.
134+
135+
= 2.1.7 09-dec-2018 =
136+
* Moved local files out of plugins folder.
137+
138+
= 2.1.6 07-dec-2018 =
139+
* Fixed bugs in plugin loader.
140+
141+
= 2.1.5 06-dec-2018 =
142+
* Improvements to REST; new UI package.
143+
144+
= 2.1.4 18-nov-2018 =
145+
* Bug fixes and minor improvements.
146+
147+
= 2.1.3 29-oct-2018 =
148+
* Revised REST functionality.
149+
150+
= 2.1.2 26-oct-2018 =
151+
* Better error handling and reporting.
152+
153+
= 2.1.1 25-oct-2018 =
154+
* Added some more REST functions and a REST server.
155+
156+
= 2.1.0 21-oct-2018 =
157+
* Change from curly braces to backticks.
158+
159+
= 2.0.1 18-oct-2018 =
160+
* Bug fixes.
161+
162+
= 2.0.0 17-oct-2018 =
163+
* New pluggable architecture.
164+
165+
= 1.5.3 11-oct-2018 =
166+
* Added 'replace'; fixed bugs.
167+
168+
= 1.5.2 =
169+
* Added some minor features, fixed bugs.
170+
171+
= 1.5.1 =
172+
* Fix some REST bugs.
173+
174+
= 1.5.0 =
175+
* Added sin, cos & tan trig functions; left and right substring operators; json shuffle.
176+
177+
= 1.4.0 =
178+
* Added alias variables.
179+
180+
= 1.3.0 =
181+
* Added width/height, modulo and array data assignment. Various other bug fixes.
182+
183+
= 1.2.0 =
184+
* Added new features to groups and other graphics items.
185+
186+
= 1.1.1 =
187+
* Bug fix
188+
189+
= 1.1.0 =
190+
* Added graphics features based on SVG.
191+
192+
= 1.0.0 =
193+
* Initial release version.

dist/rest-local-sample.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/////////////////////////////////////////////////////////////////////////
3+
// GET
4+
function get_local($conn, $request) {
5+
$table = $request[0];
6+
array_shift($request);
7+
$action = $request[0];
8+
array_shift($request);
9+
switch ($action) {
10+
default:
11+
http_response_code(404);
12+
print "Unrecognised action '$action' requested.";
13+
break;
14+
}
15+
}
16+
17+
/////////////////////////////////////////////////////////////////////////
18+
// POST
19+
function post_local($conn, $request) {
20+
$ts = time();
21+
$table = $request[0];
22+
array_shift($request);
23+
$action = $request[0];
24+
switch ($action) {
25+
default:
26+
http_response_code(404);
27+
print "Unrecognised action '$action' requested.";
28+
break;
29+
}
30+
}
31+
?>

0 commit comments

Comments
 (0)