Skip to content

Move subproject #79

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 5 commits into from
May 30, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions iwsy/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
13 changes: 13 additions & 0 deletions iwsy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Mostrami

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.

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.

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.

Mostrami creates files in the JSON::Presenter format, allowing them to be delivered using that engine.

Mostrami runs in any browser and is usable on a PC or a mobile devices.

This project is under development.
Empty file added iwsy/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 iwsy/favicon.ico
Binary file not shown.
22 changes: 22 additions & 0 deletions iwsy/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 src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=2.7.1'></script>
<!--script src='dist/easycoder.js?v=2.7.1'></script-->
</head>

<body>

<pre id="easycoder-rest" style="display:none">rest.php</pre>
<pre id="easycoder-script" style="display:none">
! I Wanna Show You

script Launcher

variable Script
rest get Script from `/resources/ecs/main.txt?v=` cat now
run Script

</body>
</html>
89 changes: 50 additions & 39 deletions mostrami/jsonPresenter.js → iwsy/iwannashowyou.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
// JSON::Presenter
// IWSY

const JSON_Presenter = (container, script) => {
const IWSY = (container, script) => {

let mode = `manual`;
let clicked = false;

const containerStyles = [
`border`,
`background`
];
const defaults = [
`fontFace`,
`fontWeight`,
`fontStyle`,
`textAlign`,
`fontColor`,
`blockLeft`,
`blockTop`,
`blockWidth`,
`blockHeight`,
`blockBackground`
];

// Initialize all the blocks
const initBlocks = () => {
const defaults = script.defaults;
Expand Down Expand Up @@ -292,6 +275,19 @@ const JSON_Presenter = (container, script) => {
// Fade up or down
const doFade = (step, upDown) => {
const stepBlocks = step.blocks;
for (const b of stepBlocks) {
const block = script.blocks[b];
if (!block.element) {
switch (block.type) {
case `text`:
createTextBlock(block);
break;
case `image`:
createImageBlock(block);
break;
}
}
}
if (script.speed === `scan`) {
if (Array.isArray(stepBlocks)) {
for (const block of stepBlocks)
Expand Down Expand Up @@ -656,7 +652,33 @@ const JSON_Presenter = (container, script) => {
}
};

// Initialize the presenttion
const init = step => {
if (step.title) {
document.title = step.title;
}
const aspect = step[`aspect ratio`];
if (aspect) {
const colon = aspect.indexOf(`:`);
if (colon > 0) {
const aspectW = aspect.substr(0, colon);
const aspectH = aspect.substr(colon + 1);
script.container = container;
const height = Math.round(parseFloat(container.offsetWidth) * aspectH / aspectW);
container.style.height = `${Math.round(height)}px`;
container.style.position = `relative`;
container.style.overflow = `hidden`;
container.style.cursor = `none`;
container.style[`background-size`] = `cover`;
}
container.style[`border`] = step[`border`];
container.style[`background`] = step[`background`];
}
step.next();
};

const actions = {
init,
setcontent,
show,
hide,
Expand All @@ -683,16 +705,16 @@ const JSON_Presenter = (container, script) => {
}
}
} else {
if (step.comment) {
console.log(`Step ${step.index}: ${step.comment}`);
if (step.title) {
console.log(`Step ${step.index}: ${step.title}`);
} else {
console.log(`Step ${step.index}: ${step.action}`);
}
}
const actionName = step.action.split(` `).join(``);
let handler = actions[actionName];
if (typeof handler === `undefined`) {
handler = JSON_Presenter.plugins[actionName];
handler = IWSY.plugins[actionName];
if (typeof handler === `undefined`) {
throw Error(`Unknown action: '${step.action}'`);
}
Expand All @@ -701,29 +723,18 @@ const JSON_Presenter = (container, script) => {
};

// Initialization
const init = () => {
const setup = () => {
container.innerHTML = ``;
document.removeEventListener(`click`, init);
if (mode === `auto`) {
document.addEventListener(`click`, onClick);
}
document.onkeydown = null;
if (script.global.title) {
document.title = script.global.title;
}
script.container.element = container;
const height = Math.round(parseFloat(container.offsetWidth)
* script.global.aspectH / script.global.aspectW);
container.style.height = `${Math.round(height)}px`;
script.container = container;
container.style.position = `relative`;
container.style.overflow = `hidden`;
container.style.cursor = 'none';
container.style[`background-size`] = `cover`;
for (const property of containerStyles) {
if (typeof script.container[property] !== 'undefined') {
container.style[property] = script.container[property];
}
}
script.speed = `normal`;
script.labels = {};
for (const [index, step] of script.steps.entries()) {
Expand All @@ -747,7 +758,7 @@ const JSON_Presenter = (container, script) => {
}
};
}
JSON_Presenter.plugins = {};
IWSY.plugins = {};
initBlocks();
preloadImages();
doStep(script.steps[0]);
Expand All @@ -759,7 +770,7 @@ const JSON_Presenter = (container, script) => {
if (event.code === `Enter`) {
mode = `auto`;
}
init();
setup();
return true;
};
};
Expand Down Expand Up @@ -789,7 +800,7 @@ window.onload = () => {
return xhr;
};

const scriptElement = document.getElementById(`jp-script`);
const scriptElement = document.getElementById(`iwsy-script`);
if (scriptElement) {
const request = createCORSRequest(`${scriptElement.innerText}?v=${Math.floor(Date.now())}`);
if (!request) {
Expand All @@ -799,7 +810,7 @@ window.onload = () => {
request.onload = () => {
if (200 <= request.status && request.status < 400) {
const script = JSON.parse(request.responseText);
JSON_Presenter(document.getElementById(`jp-container`), script);
IWSY(document.getElementById(`iwsy-container`), script);
} else {
throw Error(`Unable to access the JSON script`);
}
Expand Down
1 change: 1 addition & 0 deletions iwsy/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 iwsy/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.
Loading