Skip to content

Add Mostrami #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions dist/easycoder-min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/easycoder.js
Original file line number Diff line number Diff line change
@@ -5349,8 +5349,8 @@ const EasyCoder_Browser = {
target = document.getElementById(targetId);
}
const styleValue = program.getValue(command.styleValue);
if (!symbol.value[symbol.index]) {
program.runtimeError(command.lino, `Variable '${symbol.name}' has not been assigned.`);
if (!symbol.element[symbol.index]) {
program.runtimeError(command.lino, `Variable '${symbol.name}' has no DOM element.`);
return 0;
}
switch (command.type) {
@@ -8367,7 +8367,7 @@ const EasyCoder = {
}
},
};
EasyCoder.version = `2.7.0`;
EasyCoder.version = `2.7.1`;
EasyCoder.timestamp = Date.now();
console.log(`EasyCoder loaded; waiting for page`);

6 changes: 3 additions & 3 deletions dist/easycoder.php
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
* Plugin Name: EasyCoder
* Plugin URI: https://easycoder.software
* Description: Control the appearance and behavior of your posts and pages by embedding simple English-like scripts, without the need to learn JavaScript.
* Version: 2.7.0
* Version: 2.7.1
* Author: EasyCoder Software
* Author URI: https://easycoder.software
*/
@@ -16,9 +16,9 @@
add_action('wp_enqueue_scripts', 'easycoder_enqueue_script', 2);
function easycoder_enqueue_script() {
wp_enqueue_script('easycoder_script',
'https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js', array(), '2.7.0');
'https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js', array(), '2.7.1');
// wp_enqueue_script('easycoder_script', 'https://rembrandt.easycoder.software/dist/easycoder.js',
array(), '2.7.0');
array(), '2.7.1');
}

// Set up default plugin and REST scripts
3 changes: 3 additions & 0 deletions dist/readme.txt
Original file line number Diff line number Diff line change
@@ -54,6 +54,9 @@ For tutorials and a programmers' reference see our [EasyCoder Software Codex](ht

== Changelog ==

= 2.7.1 04-may 2020 =
* Fix bug in 'set styles'

= 2.7.0 04-may 2020 =
* Added 'click left' and 'click top'

4 changes: 2 additions & 2 deletions js/easycoder/Browser.js
Original file line number Diff line number Diff line change
@@ -2284,8 +2284,8 @@ const EasyCoder_Browser = {
target = document.getElementById(targetId);
}
const styleValue = program.getValue(command.styleValue);
if (!symbol.value[symbol.index]) {
program.runtimeError(command.lino, `Variable '${symbol.name}' has not been assigned.`);
if (!symbol.element[symbol.index]) {
program.runtimeError(command.lino, `Variable '${symbol.name}' has no DOM element.`);
return 0;
}
switch (command.type) {
2 changes: 1 addition & 1 deletion js/easycoder/EasyCoder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EasyCoder.version = `2.7.0`;
EasyCoder.version = `2.7.1`;
EasyCoder.timestamp = Date.now();
console.log(`EasyCoder loaded; waiting for page`);

20 changes: 20 additions & 0 deletions mostrami/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>

<div id="jp-container" style="text-align:center;width:100%">
<b>JSON::Presenter</b><br>
Click/Tap or key Space/RightArrow to start in manual mode<br>
Click/Tap or key Space/RightArrow to advance<br>
Key Enter to start in auto mode<br>
Click/Tap to exit auto mode
</div>
<pre id="jp-script" style="display:none">resources/json/test.json</pre>
<script src="jsonPresenter.js"></script>

</body>
</html>
Empty file added mostrami/favicon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/favicon.ico
Binary file not shown.
22 changes: 22 additions & 0 deletions mostrami/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type='text/javascript' src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=200521'></script>
</head>

<body>

<pre id="easycoder-rest" style="display:none">rest.php</pre>
<pre id="easycoder-script" style="display:none">
! EasyCoder Presenter

script Launcher

variable Script
require js `https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/codemirror.js?v=` cat now
rest get Script from `/resources/ecs/presenter.txt`
run Script

</body>
</html>
814 changes: 814 additions & 0 deletions mostrami/jsonPresenter.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mostrami/properties.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
password=$2y$10$Kazqoaw6fGfV22bp3otJeO6Xra4bCsBJXq6JVAV07qOkHNDIFevWG
3 changes: 3 additions & 0 deletions mostrami/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# JSON::Presenter resources

These are all the resources - scripts, images and text files - called for by the website.
12 changes: 12 additions & 0 deletions mostrami/resources/ecs/blocks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! Blocks

script Blocks

import div Panel and variable Presentation

on message go to Start
set ready
stop

Start:
stop
12 changes: 12 additions & 0 deletions mostrami/resources/ecs/container.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! Container

script Container

import div Panel and variable Presentation

on message go to Start
set ready
stop

Start:
stop
12 changes: 12 additions & 0 deletions mostrami/resources/ecs/content.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! Content

script Content

import div Panel and variable Presentation

on message go to Start
set ready
stop

Start:
stop
12 changes: 12 additions & 0 deletions mostrami/resources/ecs/defaults.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! Defaults

script Defaults

import div Panel and variable Presentation

on message go to Start
set ready
stop

Start:
stop
12 changes: 12 additions & 0 deletions mostrami/resources/ecs/globals.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! Globals

script Globals

import div Panel and variable Presentation

on message go to Start
set ready
stop

Start:
stop
570 changes: 570 additions & 0 deletions mostrami/resources/ecs/presenter.txt

Large diffs are not rendered by default.

258 changes: 258 additions & 0 deletions mostrami/resources/ecs/scripted.ecs
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
! Script Editor

script ScriptEditor

div Body
div Container
div Buttons
div ScriptName
div ContentDiv
input NameEditor
textarea ContentEditor
span Status
span Span
button Open
button Save
button Delete
variable Name
variable CurrentName
variable Content
variable Current

! The browser
div Overlay
div Scroller
div Media
div FileListing
div FileRow
button CloseButton
a FileName
variable Alpha
variable FileList
variable FileCount
variable File
variable Files
variable N
variable FileIsOpen
variable Item

set the title to `Script Editor`

create Body
create Container in Body
set the style of Container to `width:70%;margin:0 auto;background #ffe`

create Buttons in Container
set the style of Buttons to `text-align:center`

create Open in Buttons
set the style of Open to `margin-right:0.5em`
set the text of Open to `Open`
create Save in Buttons
set the text of Save to `Save`
set the style of Save to `margin-right:4em`
create Delete in Buttons
set the text of Delete to `Delete`
create Status in Buttons
set the style of Status to `position:absolute;float:right;padding-left:2em;color:green`

create ScriptName in Container
set the style of ScriptName to `display:flex;margin:0.5em 0`
create Span in ScriptName
set the style of Span to `flex:15`
set the content of Span to `Script name:&nbsp;`
create NameEditor in ScriptName
set the style of NameEditor to `flex:85;display:inline-block`
set the size of NameEditor to 40

create ContentDiv in Container
set the style of ContentDiv to `width:100%;height:85%;border:1px solid lightgray`

create ContentEditor in ContentDiv
set the style of ContentEditor to `width:100%;height:100%`

codemirror init basic profile `/easycoder/plugins/codemirror-ecs.js`
require css `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/dialog/dialog.css`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/dialog/dialog.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/search.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/searchcursor.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/jump-to-line.js`

create Overlay in Body
set the style of Overlay to
`position:absolute;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.0);display:none`

create Media in Overlay
set style of Media to `display:none;width:100%;height:100%;text-align:center`

create FileListing in Media
set the style of FileListing to
`display:none;width:50%;height:75%;margin:auto;background-color:white;`
cat `padding:2em 2em 3em 2em;text-align:center;position: absolute;top: 50%;left: 50%;`
cat `transform: translateX(-50%) translateY(-50%)`

create Scroller in FileListing
set the style of Scroller to `height:100%;overflow:scroll;text-align:left`

create CloseButton in FileListing
set the text of CloseButton to `Close`

codemirror attach to ContentEditor
codemirror set content of ContentEditor to Content
set FileIsOpen

put empty into Current

on click Save
begin
put the content of NameEditor into Name
if Name is empty
begin
set the content of Status to `No script name has been given`
go to ResetStatus
end
replace ` ` with `_` in Name
codemirror close ContentEditor
put the content of ContentEditor into Content
if Content is not Current
begin
rest post Content to `_save/ecs~` cat Name
put Content into Current
set the content of Status to `Script '` cat Name cat `' saved`
fork to ResetStatus
end
else
begin
set the content of Status to `Nothing has changed`
fork to ResetStatus
end
codemirror attach to ContentEditor
end

on click Open go to DoOpen

on click Delete
begin
put the content of NameEditor into Name
if Name is empty
begin
alert `Nothing to delete.`
stop
end
if confirm `Are you sure you want to delete '` cat Name cat `'?`
begin
codemirror close ContentEditor
rest post to `_delete/ecs~` cat Name
set the content of Status to `Script '` cat Name cat `' deleted`
set the content of NameEditor to empty
put empty into Content
set the content of ContentEditor to Content
put Content into Current
go to ResetStatus
end
end
stop

DoOpen:
if FileIsOpen codemirror close ContentEditor
put the content of ContentEditor into Content
if Content is not Current
begin
if confirm `Content has changed. Do you want to save it?`
begin
rest post Content to `_save/ecs~` cat CurrentName
end
end

! Animate the background
set style `display` of Overlay to `block`
put 0 into Alpha
while Alpha is less than 8
begin
set style `background-color` of Overlay to `rgba(0,0,0,0.` cat Alpha cat `)`
wait 4 ticks
add 1 to Alpha
end
wait 10 ticks

! Make the browser panel visible
set style `display` of Media to `block`
set style `display` of FileListing to `inline-block`

! Fill the browser with content from the server
rest get Files from `_list/ecs`
put the json count of Files into FileCount
put empty into Content
put 0 into N
while N is less than FileCount
begin
put element N of Files into Item
if property `type` of Item is `ecs` json add Item to Content
if property `type` of Item is `json` json add Item to Content
add 1 to N
end
json sort Content
put empty into FileList
put the json count of Content into FileCount
set the elements of File to FileCount
set the elements of FileName to FileCount
! Add a row for each file
put empty into FileList
put 0 into N
while N is less than FileCount
begin
index File to N
index FileName to N
put `<div id="ec-file-row-INDEX" style="clear:both;padding:0.25em 0;">`
cat `<a id="ec-file-name-INDEX" href="#"></a></div>` into File
replace `INDEX` with N in File
if N is even replace `ODDEVEN` with `ec-even` in File
else replace `ODDEVEN` with `ec-odd` in File
put FileList cat File into FileList
add 1 to N
end

set the content of Scroller to FileList
! Add the document names
put 0 into N
while N is less than FileCount
begin
index File to N
index FileName to N
put element N of Content into File
attach FileRow to `ec-file-row-` cat N
attach FileName to `ec-file-name-` cat N
put property `name` of File into File
set the content of FileName to File
if N is even set style `background` of FileRow to `lightgray`
on click FileName go to SelectFile
add 1 to N
end
on click CloseButton
begin
put Current into Content
go to CloseBrowser
end
stop

SelectFile:
index File to the index of FileName
set the content of NameEditor to File
rest get Content from `/resources/ecs/` cat File
put Content into Current
set the content of Status to `Script '` cat File cat `' loaded`
fork to ResetStatus
set the title to File

CloseBrowser:
set style `background-color` of Overlay to `rgba(0,0,0,0.0)`
set style `display` of Overlay to `none`
set style `display` of Media to `none`
codemirror attach to ContentEditor
codemirror set content of ContentEditor to Content
stop

ResetStatus:
wait 2
set the content of Status to ``
stop
271 changes: 271 additions & 0 deletions mostrami/resources/ecs/scripted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
! Script editor

script ScriptEditor

div Body
div Container
div Buttons
div ScriptName
div ContentDiv
input NameEditor
textarea ContentEditor
span Status
span Span
button Open
button Save
button Delete
variable Name
variable CurrentName
variable Content
variable Current
variable Password
variable Valid

! The browser
div Overlay
div Scroller
div Media
div FileListing
div FileRow
button CloseButton
a FileName
variable Alpha
variable FileList
variable FileCount
variable File
variable Files
variable N
variable FileIsOpen
variable Item

set the title to `Script Editor`

get Password from storage as `.password`
if Password is empty
put prompt `Please type the admin password` with `` into Password
rest get Valid from `_verify/` cat Password
or begin
print Valid
alert `Unable to verify password.`
put empty into storage as `.password`
end
if Valid is `yes` put Password into storage as `.password`

create Body
create Container in Body
set the style of Container to `width:70%;margin:0 auto;background #ffe`

create Buttons in Container
set the style of Buttons to `text-align:center`

create Open in Buttons
set the style of Open to `margin-right:0.5em`
set the text of Open to `Open`
create Save in Buttons
set the text of Save to `Save`
set the style of Save to `margin-right:4em`
create Delete in Buttons
set the text of Delete to `Delete`
create Status in Buttons
set the style of Status to `position:absolute;float:right;padding-left:2em;color:green`

create ScriptName in Container
set the style of ScriptName to `display:flex;margin:0.5em 0`
create Span in ScriptName
set the style of Span to `flex:15`
set the content of Span to `Script name:&nbsp;`
create NameEditor in ScriptName
set the style of NameEditor to `flex:85;display:inline-block`
set the size of NameEditor to 40

create ContentDiv in Container
set the style of ContentDiv to `width:100%;height:85%;border:1px solid lightgray`

create ContentEditor in ContentDiv
set the style of ContentEditor to `width:100%;height:100%`

codemirror init basic profile `https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/codemirror-ecs.js`
require css `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/dialog/dialog.css`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/dialog/dialog.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/search.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/searchcursor.js`
require js `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/search/jump-to-line.js`

create Overlay in Body
set the style of Overlay to
`position:absolute;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.0);display:none`

create Media in Overlay
set style of Media to `display:none;width:100%;height:100%;text-align:center`

create FileListing in Media
set the style of FileListing to
`display:none;width:50%;height:75%;margin:auto;background-color:white;`
cat `padding:2em 2em 3em 2em;text-align:center;position: absolute;top: 50%;left: 50%;`
cat `transform: translateX(-50%) translateY(-50%)`

create Scroller in FileListing
set the style of Scroller to `height:100%;overflow:scroll;text-align:left`

create CloseButton in FileListing
set the text of CloseButton to `Close`

codemirror attach to ContentEditor
codemirror set content of ContentEditor to Content
set FileIsOpen

put empty into Current

on click Save
begin
put the content of NameEditor into Name
if Name is empty
begin
set the content of Status to `No script name has been given`
go to ResetStatus
end
replace ` ` with `_` in Name
if the position of `.txt` in Name is -1 put Name cat `.txt` into Name
codemirror close ContentEditor
put the content of ContentEditor into Content
if Content is not Current
begin
rest post Content to `_save/resources/ecs/` cat Name
put Content into Current
set the content of Status to `Script '` cat Name cat `' saved`
fork to ResetStatus
end
else
begin
set the content of Status to `Nothing has changed`
fork to ResetStatus
end
codemirror attach to ContentEditor
end

on click Open go to DoOpen

on click Delete
begin
put the content of NameEditor into Name
if Name is empty
begin
alert `Nothing to delete.`
stop
end
if confirm `Are you sure you want to delete '` cat Name cat `'?`
begin
codemirror close ContentEditor
rest post to `_delete/resources/ecs/` cat Name
set the content of Status to `Script '` cat Name cat `' deleted`
set the content of NameEditor to empty
put empty into Content
set the content of ContentEditor to Content
put Content into Current
go to ResetStatus
end
end
stop

DoOpen:
if FileIsOpen codemirror close ContentEditor
put the content of ContentEditor into Content
if Content is not Current
begin
if confirm `Content has changed. Do you want to save it?`
begin
rest post Content to `_save/resources/ecs/' cat CurrentName
end
end

! Animate the background
set style `display` of Overlay to `block`
put 0 into Alpha
while Alpha is less than 8
begin
set style `background-color` of Overlay to `rgba(0,0,0,0.` cat Alpha cat `)`
wait 4 ticks
add 1 to Alpha
end
wait 10 ticks

! Make the browser panel visible
set style `display` of Media to `block`
set style `display` of FileListing to `inline-block`

! Fill the browser with content from the server
rest get Files from `_list/ecs?v=` cat now
put the json count of Files into FileCount
put empty into Content
put 0 into N
while N is less than FileCount
begin
put element N of Files into Item
if property `type` of Item is `txt` json add Item to Content
add 1 to N
end
json sort Content
put empty into FileList
put the json count of Content into FileCount
set the elements of File to FileCount
set the elements of FileName to FileCount
! Add a row for each file
put empty into FileList
put 0 into N
while N is less than FileCount
begin
index File to N
index FileName to N
put `<div id="ec-file-row-INDEX" style="clear:both;padding:0.25em 0;">`
cat `<a id="ec-file-name-INDEX" href="#"></a></div>` into File
replace `INDEX` with N in File
if N is even replace `ODDEVEN` with `ec-even` in File
else replace `ODDEVEN` with `ec-odd` in File
put FileList cat File into FileList
add 1 to N
end

set the content of Scroller to FileList
! Add the document names
put 0 into N
while N is less than FileCount
begin
index File to N
index FileName to N
put element N of Content into File
attach FileRow to `ec-file-row-` cat N
attach FileName to `ec-file-name-` cat N
put property `name` of File into File
set the content of FileName to File
if N is even set style `background` of FileRow to `lightgray`
on click FileName go to SelectFile
add 1 to N
end
on click CloseButton
begin
put Current into Content
go to CloseBrowser
end
stop

SelectFile:
index File to the index of FileName
set the content of NameEditor to File
rest get Content from `/resources/ecs/` cat File cat `?v=` cat now
put Content into Current
set the content of Status to `Script '` cat File cat `' loaded`
fork to ResetStatus
set the title to `Script Editor - ` cat File

CloseBrowser:
set style `background-color` of Overlay to `rgba(0,0,0,0.0)`
set style `display` of Overlay to `none`
set style `display` of Media to `none`
codemirror attach to ContentEditor
codemirror set content of ContentEditor to Content
stop

ResetStatus:
wait 2
set the content of Status to ``
stop
194 changes: 194 additions & 0 deletions mostrami/resources/ecs/steps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
! Steps

script Steps

import div Panel and variable Presentation

div StepsPanel
div EditPanel
button Step
table Table
tr TR
td TD
input TitleInput
input ActionInput
input BlocksInput
input BlockInput
input TargetInput
input TypesInput
input DurationInput
input URLInput
variable Steps
variable Comment
variable Action
variable Blocks
variable Block
variable Target
variable Types
variable Duration
variable URL
variable Item
variable N
variable S

create EditPanel in Panel
set the style of EditPanel to `height:auto;border:1px solid gray;margin:0.5em 0;padding:1em`

create StepsPanel in Panel
set the style of StepsPanel to `flex:1;overflow-y:scroll`

on message go to Start
set ready
stop

Start:
set style `display` of Panel to `flex`
set style `flex-direction` of Panel to `column`

put property `steps` of Presentation into Steps
set the elements of Step to the json count of Steps
put 0 into N
while N is less than the elements of Step
begin
index Step to N
create Step in StepsPanel
set the style of Step to `width:100%;font-size:1.2em;margin:0.2em 0`
put element N of Steps into Item
gosub to CheckActionSyntax
set the text of Step to property `comment` of Item
add 1 to N
end
on click Step
begin
put the index of Step into S
put 0 into N
while N is less than the elements of Step
begin
index Step to N
set style `background` of Step to ``
add 1 to N
end
put element S of Steps into Item
index Step to S
set style `background` of Step to `lightgray`
go to EditStep
end
return

CheckActionSyntax:
put property `action` of Item into Action
put property `comment` of Item into Comment
if Comment is empty set property `comment` of Item to Action
if Action is `set content`
begin
put property `blocks` of Item into Blocks
if Blocks is empty
begin
set Blocks to array
set property `blocks` of Item to Blocks
end
end
else if Action is `show`
begin
put property `blocks` of Item into Blocks
if Blocks is empty
begin
set Blocks to array
set property `blocks` of Item to Blocks
end
end
else if Action is `hide`
begin
put property `blocks` of Item into Blocks
if Blocks is empty
begin
set Blocks to object
set property `blocks` of Item to Blocks
end
end
else if Action is `pause`
begin
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `hold`
begin
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `fade up`
begin
put property `blocks` of Item into Blocks
if Blocks is empty
begin
set Blocks to array
set property `blocks` of Item to Blocks
end
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `fade down`
begin
put property `blocks` of Item into Blocks
if Blocks is empty
begin
set Blocks to array
set property `blocks` of Item to Blocks
end
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `crossfade`
begin
put property `block` of Item into Block
if Block is empty set property `block` of Item to `******`
put property `target` of Item into Target
if Target is empty set property `target` of Item to `******`
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `transition`
begin
put property `types` of Item into Types
if Types is empty
begin
set Types to array
set property `types` of Item to Types
end
put property `target` of Item into Target
if Target is empty set property `target` of Item to `******`
put property `duration` of Item into Duration
if Duration is empty set property `duration` of Item to 1
end
else if Action is `goto`
begin
put property `target` of Item into Target
if Target is empty set property `target` of Item to `******`
end
else if Action is `load`
begin
put property `url` of Item into URL
if URL is empty set property `url` of Item to `******`
end
return

EditStep:
clear EditPanel
create Table in EditPanel
set the style of Table to `width:100%`
create TR in Table
create TD in TR
set the style of TD to `width:6em`
set the content of TD to `Title:`
create TD in TR
create TitleInput in TD
set the style of TitleInput to `width:100%`
set the content of TitleInput to property `comment` of Item
create TR in Table
create TD in TR
set the content of TD to `Action:`
create TD in TR
create ActionInput in TD
set the style of ActionInput to `width:100%`
set the content of ActionInput to property `action` of Item
stop
Binary file added mostrami/resources/icon/apple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/arrow-back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/arrow-forward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/binoculars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/cycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/document.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/duckthink.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/exit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/gear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/media.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/runstop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mostrami/resources/icon/stop.png
Binary file added mostrami/resources/icon/teacher.png
Binary file added mostrami/resources/icon/tools.png
Binary file added mostrami/resources/icon/trash.png
Binary file added mostrami/resources/icon/unknown.png
Binary file added mostrami/resources/icon/up.png
Binary file added mostrami/resources/img/flowers.jpg
Binary file added mostrami/resources/img/moon.jpg
255 changes: 255 additions & 0 deletions mostrami/resources/json/demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"global": {
"title": "JSON::Presenter",
"description": "A demo presentation that outlines some features of JSON::Presenter",
"aspectW": 160,
"aspectH": 89
},
"container": {
"border": "1px solid black",
"background": "black"
},
"defaults": {
"fontFamily": "Times New Roman,serif",
"fontSize": 40,
"fontWeight": "normal",
"fontStyle": "normal",
"fontColor": "white",
"textAlign": "left",
"textMarginLeft": 0,
"textMarginTop": 0,
"blockLeft": 0,
"blockTop": 0,
"blockWidth": 1000,
"blockBackground": "none",
"blockBorder": "none",
"blockBorderRadius": 0
},
"blocks": {
"title": {
"blockTop": 300,
"blockHeight": 300,
"textAlign": "center",
"fontSize": 200,
"fontWeight": "bold",
"fontColor": "#800000"
},
"title 2": {
"blockTop": 50,
"blockHeight": 150,
"textAlign": "center",
"fontSize": 100,
"fontWeight": "bold",
"fontColor": "#dddd00"
},
"body": {
"blockLeft": 80,
"blockTop": 240,
"blockWidth": 840,
"blockHeight": 800,
"fontFamily": "Helvetica,sans-serif",
"fontColor": "#dddddd"
},
"body right": {
"blockLeft": 500,
"blockTop": 200,
"blockWidth": 420,
"blockHeight": 800,
"fontFamily": "Helvetica,sans-serif",
"fontColor": "#dddddd"
},
"left image": {
"blockLeft": 80,
"blockTop": 200,
"blockWidth": 370,
"blockHeight": 700,
"blockBorder": "1px solid black",
"blockBorderRadius": "1em"
}
},
"content": {
"presenter title": {
"type": "text",
"content": "JSON::Presenter"
},
"slide 1": {
"type": "text",
"content": [
"JSON::Presenter is a presentation format using JSON scripts, and an engine that runs those scripts in a browser to create presentations. These may be similar to those created using PowerPoint or they can be considerably more elaborate, with extensive animation and even sound. In some cases they can take the place of video yet still offer a dynamic experience.",

"Presentations can run from any host, including static; all you need is one CDN-hosted JavaScript file and you're good to go.",

"The JSON::Presenter engine is pure JavaScript. It can be used with any JavaScript framework, or with none."
]
},
"slide 2": {
"type": "text",
"content": [
"JSON::Presenter offers a range of block types and transitions that make it easy to create slick, effective presentations.",

"This short demo illustrates some of the features of the system."
]
},
"slide 3": {
"type": "text",
"content": [
"Text and image blocks can be manipulated in a variety of different ways.",

"Any block can be resized or moved; text can be substituted or have its size or color change; images can be assigned to blocks. Any block can be faded or transformed using animations.",

"The JSON::Presenter scripting language uses simple data JSON structures and is easy to read or write."
]
},
"flowers": {
"type": "image",
"url": "img/flowers.jpg"
},
"moon": {
"type": "image",
"url": "img/moon.jpg"
}
},
"steps": [
{
"comment": "------------------------------- Pause before we start",
"action": "pause",
"duration": 2,
"label": "start"
},
{
"comment": "---------------------------------- Set up the content",
"action": "set content",
"blocks": [
{
"block": "title",
"content": "presenter title"
},
{
"block": "body",
"content": "slide 1"
},
{
"block": "left image",
"content": "flowers"
}
]
},
{
"comment": "----------------------------- Fade up the intro title",
"action": "fade up",
"blocks": "title",
"duration": 3
},
{
"comment": "-------------------------------------- Wait 4 seconds",
"action": "hold",
"duration": 4
},
{
"comment": "-------------------------------- Transition the title",
"action": "transition",
"type": [
"block position",
"block size",
"font color",
"font size"
],
"block": "title",
"target": "title 2",
"duration": 1,
"continue": true
},
{
"comment": "----------------------------- Pause for half a second",
"action": "pause",
"duration": 0.5
},
{
"comment": "-------------------------------- Show the first slide",
"action": "fade up",
"blocks": "body",
"duration": 1
},
{
"comment": "------------------------------------- Wait 10 seconds",
"action": "hold",
"duration": 10
},
{
"comment": "-------------------------------- Change the body text",
"action": "crossfade",
"block": "body",
"target": "slide 2",
"duration": 1
},
{
"comment": "-------------------------------------- Wait 5 seconds",
"action": "hold",
"duration": 5
},
{
"comment": "-------------------------- Move the body to the right",
"action": "transition",
"type": [
"block position",
"block size"
],
"block": "body",
"target": "body right",
"duration": 1
},
{
"comment": "----------------------------- Fade up the image block",
"action": "fade up",
"blocks": "left image",
"duration": 2
},
{
"comment": "-------------------------------------- Wait 8 seconds",
"action": "hold",
"duration": 8
},
{
"comment": "--------------------------------- Crossfade the image",
"action": "crossfade",
"block": "left image",
"target": "moon",
"duration": 1
},
{
"comment": "-------------------------------------- Wait 2 seconds",
"action": "hold",
"duration": 2
},
{
"comment": "-------------------------------- Change the body text",
"action": "set content",
"block": "body",
"content": "slide 3"
},
{
"comment": "------------------------------------- Wait 10 seconds",
"action": "hold",
"duration": 10
},
{
"comment": "------------------------ Fade down the title and body",
"action": "fade down",
"blocks": [
"title",
"body",
"left image"
],
"duration": 3
},
{
"comment": "----------------------------------------------- Reset",
"action": "reset"
},
{
"comment": "-------------------------------- Go back to the start",
"action": "goto",
"target": "start"
}
]
}
263 changes: 263 additions & 0 deletions mostrami/resources/json/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
{
"global": {
"title": "JSON::Presenter",
"description": "A demo presentation that outlines some features of JSON::Presenter",
"aspectW": 160,
"aspectH": 89
},
"container": {
"border": "1px solid black",
"background": "black"
},
"defaults": {
"fontFamily": "Times New Roman,serif",
"fontSize": 40,
"fontWeight": "normal",
"fontStyle": "normal",
"fontColor": "white",
"textAlign": "left",
"textMarginLeft": 0,
"textMarginTop": 0,
"blockLeft": 0,
"blockTop": 0,
"blockWidth": 1000,
"blockBackground": "none",
"blockBorder": "none",
"blockBorderRadius": 0
},
"blocks": {
"title": {
"blockTop": 300,
"blockHeight": 300,
"textAlign": "center",
"fontSize": 200,
"fontWeight": "bold",
"fontColor": "#800000"
},
"title 2": {
"blockTop": 50,
"blockHeight": 150,
"textAlign": "center",
"fontSize": 100,
"fontWeight": "bold",
"fontColor": "#dddd00"
},
"body": {
"blockLeft": 80,
"blockTop": 240,
"blockWidth": 840,
"blockHeight": 800,
"fontFamily": "Helvetica,sans-serif",
"fontColor": "#dddddd"
},
"body right": {
"blockLeft": 500,
"blockTop": 200,
"blockWidth": 420,
"blockHeight": 800,
"fontFamily": "Helvetica,sans-serif",
"fontColor": "#dddddd"
},
"left image": {
"blockLeft": 80,
"blockTop": 200,
"blockWidth": 370,
"blockHeight": 700,
"blockBorder": "1px solid black",
"blockBorderRadius": "1em"
}
},
"content": {
"presenter title": {
"type": "text",
"content": "JSON::Presenter"
},
"slide 1": {
"type": "text",
"content": [
"JSON::Presenter is a presentation format using JSON scripts, and an engine that runs those scripts in a browser to create presentations. These may be similar to those created using PowerPoint or they can be considerably more elaborate, with extensive animation and even sound. In some cases they can take the place of video yet still offer a dynamic experience.",

"Presentations can run from any host, including static; all you need is one CDN-hosted JavaScript file and you're good to go.",

"The JSON::Presenter engine is pure JavaScript. It can be used with any JavaScript framework, or with none."
]
},
"slide 2": {
"type": "text",
"content": [
"JSON::Presenter offers a range of block types and transitions that make it easy to create slick, effective presentations.",

"This short demo illustrates some of the features of the system."
]
},
"slide 3": {
"type": "text",
"content": [
"Text and image blocks can be manipulated in a variety of different ways.",

"Any block can be resized or moved; text can be substituted or have its size or color change; images can be assigned to blocks. Any block can be faded or transformed using animations.",

"The JSON::Presenter scripting language uses simple data JSON structures and is easy to read or write."
]
},
"flowers": {
"type": "image",
"url": "resources/img/flowers.jpg"
},
"moon": {
"type": "image",
"url": "resources/img/moon.jpg"
}
},
"steps": [
{
"comment": "-------------------------------- Load the test module",
"action": "load",
"url": "resources/plugins/test.js"
},
{
"comment": "------------------------------- Pause before we start",
"action": "pause",
"duration": 2,
"label": "start"
},
{
"comment": "---------------------------------- Set up the content",
"action": "set content",
"blocks": [
{
"block": "title",
"content": "presenter title"
},
{
"block": "body",
"content": "slide 1"
},
{
"block": "left image",
"content": "flowers"
}
]
},
{
"comment": "----------------------------- Fade up the intro title",
"action": "fade up",
"blocks": "title",
"duration": 3
},
{
"comment": "-------------------------------------- Wait 4 seconds",
"action": "hold",
"duration": 4
},
{
"comment": "-------------------------------- Transition the title",
"action": "transition",
"type": [
"block position",
"block size",
"font color",
"font size"
],
"block": "title",
"target": "title 2",
"duration": 1,
"continue": true
},
{
"comment": "----------------------------- Pause for half a second",
"action": "pause",
"duration": 0.5
},
{
"comment": "-------------------------------- Show the first slide",
"action": "fade up",
"blocks": "body",
"duration": 1
},
{
"comment": "--------------------------------- Run the test plugin",
"action": "test",
"block": "title",
"duration": 0.5
},
{
"comment": "------------------------------------- Wait 10 seconds",
"action": "hold",
"duration": 10
},
{
"comment": "-------------------------------- Change the body text",
"action": "crossfade",
"block": "body",
"target": "slide 2",
"duration": 1,
"label": "loop"
},
{
"comment": "-------------------------------------- Wait 5 seconds",
"action": "hold",
"duration": 5
},
{
"comment": "-------------------------- Move the body to the right",
"action": "transition",
"type": [
"block position",
"block size"
],
"block": "body",
"target": "body right",
"duration": 1
},
{
"comment": "----------------------------- Fade up the image block",
"action": "fade up",
"blocks": "left image",
"duration": 2
},
{
"comment": "-------------------------------------- Wait 8 seconds",
"action": "hold",
"duration": 8
},
{
"comment": "--------------------------------- Crossfade the image",
"action": "crossfade",
"block": "left image",
"target": "moon",
"duration": 1
},
{
"comment": "-------------------------------------- Wait 2 seconds",
"action": "hold",
"duration": 2
},
{
"comment": "-------------------------------- Change the body text",
"action": "set content",
"block": "body",
"content": "slide 3"
},
{
"comment": "------------------------------------- Wait 10 seconds",
"action": "hold",
"duration": 10
},
{
"comment": "------------------------ Fade down the title and body",
"action": "fade down",
"blocks": [
"title",
"body",
"left image"
],
"duration": 3
},
{
"comment": "-------------------------------- Go back to the start",
"action": "goto",
"target": "start"
}
]
}
32 changes: 32 additions & 0 deletions mostrami/resources/plugins/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const JSON_Presenter_Test = step => {
if (step.script.speed === `scan`) {
step.next();
} else {
const animSteps = Math.round(step.duration * 25);
let animStep = 0;
let interval = setInterval(() => {
if (animStep < animSteps) {
const ratio = 0.5 - Math.cos(Math.PI * animStep / animSteps) / 2;
const block = step.script.blocks[step.block];
block.element.style[`opacity`] = 1.0 - ratio;
animStep++;
} else {
clearInterval(interval);
animStep = 0;
interval = setInterval(() => {
if (animStep < animSteps) {
const ratio = 0.5 - Math.cos(Math.PI * animStep / animSteps) / 2;
const block = step.script.blocks[step.block];
block.element.style[`opacity`] = ratio;
animStep++;
} else {
clearInterval(interval);
step.next();
}
}, 40);
}
}, step.script.speed === `normal` ? 40 : 400);
}
};

JSON_Presenter.plugins.test = JSON_Presenter_Test;
1 change: 1 addition & 0 deletions mostrami/resources/properties.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
password=$2y$10$Kazqoaw6fGfV22bp3otJeO6Xra4bCsBJXq6JVAV07qOkHNDIFevWG
546 changes: 546 additions & 0 deletions mostrami/rest.php

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions mostrami/scripted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Script Editor</title>
<script type='text/javascript' src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=200413'></script>
</head>

<body>
<pre id="easycoder-rest" style="display:none">rest.php</pre>
<pre id="easycoder-script" style="display:none">
! EasyCoder Script Editor

script Launcher

variable Script
require js `https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/codemirror.js?v=` cat now
rest get Script from `/resources/ecs/scripted.txt`
run Script
</pre>
</body>

</html>
6 changes: 3 additions & 3 deletions server/easycoder.php
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
* Plugin Name: EasyCoder
* Plugin URI: https://easycoder.software
* Description: Control the appearance and behavior of your posts and pages by embedding simple English-like scripts, without the need to learn JavaScript.
* Version: 2.7.0
* Version: 2.7.1
* Author: EasyCoder Software
* Author URI: https://easycoder.software
*/
@@ -16,9 +16,9 @@
add_action('wp_enqueue_scripts', 'easycoder_enqueue_script', 2);
function easycoder_enqueue_script() {
wp_enqueue_script('easycoder_script',
'https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js', array(), '2.7.0');
'https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js', array(), '2.7.1');
// wp_enqueue_script('easycoder_script', 'https://rembrandt.easycoder.software/dist/easycoder.js',
array(), '2.7.0');
array(), '2.7.1');
}

// Set up default plugin and REST scripts
3 changes: 3 additions & 0 deletions server/readme.txt
Original file line number Diff line number Diff line change
@@ -54,6 +54,9 @@ For tutorials and a programmers' reference see our [EasyCoder Software Codex](ht

== Changelog ==

= 2.7.1 04-may 2020 =
* Fix bug in 'set styles'

= 2.7.0 04-may 2020 =
* Added 'click left' and 'click top'