Skip to content

Commit e5790a6

Browse files
authored
Merge pull request #79 from easycoder/dev
Move subproject
2 parents 11d7c2e + d33bb3e commit e5790a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3620
-62
lines changed

iwsy/.htaccess

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
RewriteCond %{HTTPS} !=on
2+
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

iwsy/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Mostrami
2+
3+
Mostrami - "Show me" in Italian - is a GUI presentation package analagous to PowerPoint but for web-based editing and delivery. It is _not_ a PowerPoint clone, nor does it seek to be compatible in any way. It provides an editing environment that maintains a live view of the presentation at the step being edited. All editing is done by typing values; mouse-based editing may be added later.
4+
5+
Mostrami differs from PowerPoint in being step-based rather than slide-based. A step is any change to what is currently showing on the screen. If you wish to retain the notion of 'slides' you can regard a slide as an accumulation of a number of steps. Every slide consists of at least one step but there is no upper limit to the number.
6+
7+
PowerPoint includes a rich set of graphical elements. Mostrami relies more on _actions_, the simplest of which is a cut from one piece of content to another. Mostrami presentations tend to be dynamic, with smooth transitions from one step to the next. The program is modular and permits the addition of plugins to perform any desired effect. Its architecture separates structure and content to allow either to be changed independently of the other.
8+
9+
Mostrami creates files in the JSON::Presenter format, allowing them to be delivered using that engine.
10+
11+
Mostrami runs in any browser and is usable on a PC or a mobile devices.
12+
13+
This project is under development.

iwsy/favicon.gif

Loading

iwsy/favicon.ico

2.19 KB
Binary file not shown.

iwsy/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<html>
2+
<head>
3+
<meta charset="UTF-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<script src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=2.7.1'></script>
6+
<!--script src='dist/easycoder.js?v=2.7.1'></script-->
7+
</head>
8+
9+
<body>
10+
11+
<pre id="easycoder-rest" style="display:none">rest.php</pre>
12+
<pre id="easycoder-script" style="display:none">
13+
! I Wanna Show You
14+
15+
script Launcher
16+
17+
variable Script
18+
rest get Script from `/resources/ecs/main.txt?v=` cat now
19+
run Script
20+
21+
</body>
22+
</html>

mostrami/jsonPresenter.js renamed to iwsy/iwannashowyou.js

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
1-
// JSON::Presenter
1+
// IWSY
22

3-
const JSON_Presenter = (container, script) => {
3+
const IWSY = (container, script) => {
44

55
let mode = `manual`;
66
let clicked = false;
77

8-
const containerStyles = [
9-
`border`,
10-
`background`
11-
];
12-
const defaults = [
13-
`fontFace`,
14-
`fontWeight`,
15-
`fontStyle`,
16-
`textAlign`,
17-
`fontColor`,
18-
`blockLeft`,
19-
`blockTop`,
20-
`blockWidth`,
21-
`blockHeight`,
22-
`blockBackground`
23-
];
24-
258
// Initialize all the blocks
269
const initBlocks = () => {
2710
const defaults = script.defaults;
@@ -292,6 +275,19 @@ const JSON_Presenter = (container, script) => {
292275
// Fade up or down
293276
const doFade = (step, upDown) => {
294277
const stepBlocks = step.blocks;
278+
for (const b of stepBlocks) {
279+
const block = script.blocks[b];
280+
if (!block.element) {
281+
switch (block.type) {
282+
case `text`:
283+
createTextBlock(block);
284+
break;
285+
case `image`:
286+
createImageBlock(block);
287+
break;
288+
}
289+
}
290+
}
295291
if (script.speed === `scan`) {
296292
if (Array.isArray(stepBlocks)) {
297293
for (const block of stepBlocks)
@@ -656,7 +652,33 @@ const JSON_Presenter = (container, script) => {
656652
}
657653
};
658654

655+
// Initialize the presenttion
656+
const init = step => {
657+
if (step.title) {
658+
document.title = step.title;
659+
}
660+
const aspect = step[`aspect ratio`];
661+
if (aspect) {
662+
const colon = aspect.indexOf(`:`);
663+
if (colon > 0) {
664+
const aspectW = aspect.substr(0, colon);
665+
const aspectH = aspect.substr(colon + 1);
666+
script.container = container;
667+
const height = Math.round(parseFloat(container.offsetWidth) * aspectH / aspectW);
668+
container.style.height = `${Math.round(height)}px`;
669+
container.style.position = `relative`;
670+
container.style.overflow = `hidden`;
671+
container.style.cursor = `none`;
672+
container.style[`background-size`] = `cover`;
673+
}
674+
container.style[`border`] = step[`border`];
675+
container.style[`background`] = step[`background`];
676+
}
677+
step.next();
678+
};
679+
659680
const actions = {
681+
init,
660682
setcontent,
661683
show,
662684
hide,
@@ -683,16 +705,16 @@ const JSON_Presenter = (container, script) => {
683705
}
684706
}
685707
} else {
686-
if (step.comment) {
687-
console.log(`Step ${step.index}: ${step.comment}`);
708+
if (step.title) {
709+
console.log(`Step ${step.index}: ${step.title}`);
688710
} else {
689711
console.log(`Step ${step.index}: ${step.action}`);
690712
}
691713
}
692714
const actionName = step.action.split(` `).join(``);
693715
let handler = actions[actionName];
694716
if (typeof handler === `undefined`) {
695-
handler = JSON_Presenter.plugins[actionName];
717+
handler = IWSY.plugins[actionName];
696718
if (typeof handler === `undefined`) {
697719
throw Error(`Unknown action: '${step.action}'`);
698720
}
@@ -701,29 +723,18 @@ const JSON_Presenter = (container, script) => {
701723
};
702724

703725
// Initialization
704-
const init = () => {
726+
const setup = () => {
705727
container.innerHTML = ``;
706728
document.removeEventListener(`click`, init);
707729
if (mode === `auto`) {
708730
document.addEventListener(`click`, onClick);
709731
}
710732
document.onkeydown = null;
711-
if (script.global.title) {
712-
document.title = script.global.title;
713-
}
714-
script.container.element = container;
715-
const height = Math.round(parseFloat(container.offsetWidth)
716-
* script.global.aspectH / script.global.aspectW);
717-
container.style.height = `${Math.round(height)}px`;
733+
script.container = container;
718734
container.style.position = `relative`;
719735
container.style.overflow = `hidden`;
720736
container.style.cursor = 'none';
721737
container.style[`background-size`] = `cover`;
722-
for (const property of containerStyles) {
723-
if (typeof script.container[property] !== 'undefined') {
724-
container.style[property] = script.container[property];
725-
}
726-
}
727738
script.speed = `normal`;
728739
script.labels = {};
729740
for (const [index, step] of script.steps.entries()) {
@@ -747,7 +758,7 @@ const JSON_Presenter = (container, script) => {
747758
}
748759
};
749760
}
750-
JSON_Presenter.plugins = {};
761+
IWSY.plugins = {};
751762
initBlocks();
752763
preloadImages();
753764
doStep(script.steps[0]);
@@ -759,7 +770,7 @@ const JSON_Presenter = (container, script) => {
759770
if (event.code === `Enter`) {
760771
mode = `auto`;
761772
}
762-
init();
773+
setup();
763774
return true;
764775
};
765776
};
@@ -789,7 +800,7 @@ window.onload = () => {
789800
return xhr;
790801
};
791802

792-
const scriptElement = document.getElementById(`jp-script`);
803+
const scriptElement = document.getElementById(`iwsy-script`);
793804
if (scriptElement) {
794805
const request = createCORSRequest(`${scriptElement.innerText}?v=${Math.floor(Date.now())}`);
795806
if (!request) {
@@ -799,7 +810,7 @@ window.onload = () => {
799810
request.onload = () => {
800811
if (200 <= request.status && request.status < 400) {
801812
const script = JSON.parse(request.responseText);
802-
JSON_Presenter(document.getElementById(`jp-container`), script);
813+
IWSY(document.getElementById(`iwsy-container`), script);
803814
} else {
804815
throw Error(`Unable to access the JSON script`);
805816
}

iwsy/properties.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
password=$2y$10$Kazqoaw6fGfV22bp3otJeO6Xra4bCsBJXq6JVAV07qOkHNDIFevWG

iwsy/resources/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# JSON::Presenter resources
2+
3+
These are all the resources - scripts, images and text files - called for by the website.

0 commit comments

Comments
 (0)