diff --git a/iwsy/.htaccess b/iwsy/.htaccess deleted file mode 100644 index 6cd7730..0000000 --- a/iwsy/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -RewriteCond %{HTTPS} !=on -RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] diff --git a/iwsy/README.md b/iwsy/README.md deleted file mode 100644 index dab86bb..0000000 --- a/iwsy/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# IWSY - -IWSY is I Wanna Show You, a web app for building slide shows and presentations that embed in web pages. It is **not** in any way a PowerPoint clone. The complete source and documentation are here, but the latter uses enhanced MarkDown and is best viewed on the [IWSY](https://iwannashowyou.com) website itself, where there is also a quickstart tutorial. diff --git a/iwsy/demo.html b/iwsy/demo.html deleted file mode 100644 index 73787c1..0000000 --- a/iwsy/demo.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - -
- -
- - - - diff --git a/iwsy/favicon.gif b/iwsy/favicon.gif deleted file mode 100644 index e69de29..0000000 diff --git a/iwsy/favicon.ico b/iwsy/favicon.ico deleted file mode 100644 index ed89efe..0000000 Binary files a/iwsy/favicon.ico and /dev/null differ diff --git a/iwsy/index.html b/iwsy/index.html deleted file mode 100644 index 756217c..0000000 --- a/iwsy/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/iwsy/iwsy.js b/iwsy/iwsy.js deleted file mode 100644 index 3c0b5c4..0000000 --- a/iwsy/iwsy.js +++ /dev/null @@ -1,1431 +0,0 @@ -// eslint-disable-next-line no-unused-vars -const IWSY = (playerElement, scriptObject) => { - - let player = playerElement; - let script = scriptObject; - let homeScript = script; - let thePath = `resources/scripts`; - let afterRun; - let plugins; - let timeouts = []; - let intervals = []; - - // Set up all the blocks - const setupBlocks = () => { - for (const block of script.blocks) { - const current = {}; - for (const name in block.defaults) { - current[name] = block.defaults[name]; - } - block.current = current; - block.vfx = []; - } - }; - - const pause = step => { - if (script.speed === `scan`) { - step.next(); - return; - } - addTimeoutTimer(setTimeout(() => { - step.next(); - }, script.runMode === `manual` ? 0 : step.duration * 1000)); - }; - - // Get the bounding rectangle of a block - const getBlockRect = (block, r) => { - const left = block.defaults.left; - const top = block.defaults.top; - const width = block.defaults.width; - const height = block.defaults.height; - if (isNaN(left) || isNaN(top) || isNaN(width) || isNaN(height)) { - return rect; - } - const w = r.width / 1000; - const h = r.height / 1000; - const rect = {}; - rect.width = width * w; - rect.height = height * h; - rect.left = left * w; - rect.top = top * h; - return rect; - }; - - // Create a block - const createBlock = block => { - let rect = { - width: player.clientWidth, - height: player.clientHeight, - left: 0, - top: 0 - }; - if (block.defaults.parent) { - for (b of script.blocks) { - if (b.defaults.name === block.defaults.parent) { - rect = getBlockRect(b, rect); - break; - } - } - } - const w = rect.width / 1000; - const h = rect.height / 1000; - const l = rect.left; - const t = rect.top; - const defaults = block.defaults; - const element = document.createElement(`div`); - player.appendChild(element); - block.element = element; - if (script.speed === `scan`) { - element.style.display = `none`; - } - element.style.position = `absolute`; - element.style.opacity = `0.0`; - let val = defaults.left; - if (isNaN(val)) { - element.style.left = val; - } else { - val *= w; - element.style.left = `calc(${l}px + ${val}px)`; - } - val = defaults.top; - if (isNaN(val)) { - element.style.left = val; - } else { - val *= h; - element.style.top = `calc(${t}px + ${val}px)`; - } - val = defaults.width; - if (!isNaN(val)) { - val = `${val * w}px`; - } - element.style.width = val; - val = defaults.height; - if (!isNaN(val)) { - val = `${val * h}px`; - } - element.style.height = val; - if (defaults.background) { - element.style.background = defaults.background; - } - element.style[`background-size`] = `cover`; - element.style.border = defaults.border; - element.style[`overflow`] = `hidden`; - element.style[`display`] = `none`; - element.style[`opacity`] = `0`; - val = defaults.textMarginLeft; - if (!isNaN(val)) { - val *= w; - } - const marginLeft = val; - val = defaults.textMarginTop; - if (!isNaN(val)) { - val *= h; - } - const marginTop = val; - const text = document.createElement(`div`); - element.appendChild(text); - block.textPanel = text; - text.style.position = `absolute`; - text.style.left = marginLeft; - text.style.top = marginTop; - text.style.width = `calc(100% - ${marginLeft}px - ${marginLeft}px)`; - text.style.height = `calc(100% - ${marginTop}px - ${marginTop}px)`; - text.style[`font-family`] = defaults.fontFamily; - val = defaults.fontSize; - if (!isNaN(val)) { - val *= h; - } - text.style[`font-size`] = `${val}px`; - text.style[`font-weight`] = defaults.fontWeight; - text.style[`font-style`] = defaults.fontStyle; - text.style.color = defaults.fontColor; - text.style[`text-align`] = defaults.textAlign; - }; - - // No operation - const noop = step => { - step.next(); - }; - - // Set the content of one or more blocks - const setcontent = step => { - const imagesToLoad = []; - const imagesLoading = []; - let continueFlag = true; - for (const item of step.blocks) - { - for (const block of script.blocks) { - if (block.defaults.name === item.block) { - if (!block.element) { - createBlock(block); - } - for (const text of script.content) { - if (text.name === item.content) { - const converter = new showdown.Converter({ - extensions: [`IWSY`] - }); - const converted = converter.makeHtml(text.content.split(`%0a`).join(`\n`)); - const tag = converted.match(/data-slide="([\w-_.]*)"/); - if (tag) { - for (const sVFX of script.vfx) { - if (sVFX.name === tag[1]) { - const vfx = { - block, - container: block.textPanel, - name: sVFX.name, - type: sVFX.type, - aspect: sVFX.aspect, - url: sVFX.url, - duration: sVFX.duration, - startsize: 100, - startxoff: 0, - startyoff: 0, - endsize: sVFX.endsize, - endxoff: sVFX.endxoff, - endyoff: sVFX.endyoff - }; - block.vfx.push(vfx); - continueFlag = false; - block.textPanel.innerHTML = converted; - imagesToLoad.push(vfx); - imagesLoading.push(vfx); - - if (vfx.url[0] === `=`) { - const lastVFX = vfx.url.slice(1); - for (pVFX of script.vfx) { - if (pVFX.name === lastVFX) { - vfx.url = pVFX.url; - vfx.startsize = pVFX.endsize; - vfx.startxoff = pVFX.endxoff; - vfx.startyoff = pVFX.endyoff; - break; - } - } - } - break; - } - } - } else { - block.textPanel.innerHTML = converted; - } - break; - } - } - block.element.style.display = step.display; - break; - } - } - } - for (const vfx of imagesToLoad) { - const image = new Image(); - vfx.image = image; - image.vfx = vfx; - image.id = vfx.name; - image.src = vfx.url; - image.addEventListener(`load`, (event) => { - const image = event.target; - const vfx = image.vfx; - initImage(vfx); - const index = imagesLoading.indexOf(vfx); - if (index > -1) { - imagesLoading.splice(index, 1); - } - if (imagesLoading.length === 0) { - step.next(); - } - }); - vfx.block.textPanel.appendChild(image); - } - if (continueFlag) { - step.next(); - } - }; - - // Set the visibility of a block - const setVisibility = (block, showHide) => { - if (showHide) { - block.element.style.opacity = `1.0`; - block.element.style.display = `block`; - } else { - block.element.style.opacity = `0.0`; - block.element.style.display = `none`; - } - }; - - // Show or hide a block - const doShowHide = (step, showHide) => { - for (const name of step.blocks) - { - for (const block of script.blocks) { - if (block.defaults.name === name) { - if (!block.element) { - createBlock(block); - } - setVisibility(block, showHide); - break; - } - } - } - step.next(); - }; - - const show = step => { - doShowHide(step, true); - }; - - const hide = step => { - doShowHide(step, false); - }; - - addIntervalTimer = (interval) => { - if (!Array.isArray(intervals)) { - intervals = []; - } - intervals.push(interval); - }; - - clearIntervalTimer = interval => { - clearInterval(interval); - const pos = intervals.indexOf(interval); - intervals.splice(pos, 1); - }; - - addTimeoutTimer = (timeout) => { - if (!Array.isArray(timeouts)) { - timeouts = []; - } - timeouts.push(timeout); - }; - - clearAllTimers = () => { - while (intervals.length) { - clearInterval(intervals[0]); - intervals.splice(0, 1); - } - while (timeouts.length) { - clearTimeout(timeouts[0]); - timeouts.splice(0, 1); - } - }; - - // Animate a fade - const animateFade = (timestamp, vfx) => { - if (script.stop) { - return; - } - if (vfx.start === undefined) { - vfx.start = timestamp; - } - const elapsed = timestamp - vfx.start; - if (elapsed < vfx.duration) { - const ratio = 0.5 - Math.cos(Math.PI * elapsed / vfx.duration) / 2; - for (const block of vfx.stepBlocks) - { - block.element.style.opacity = vfx.upDown ? ratio : 1.0 - ratio; - } - requestAnimationFrame(timestamp => { - animateFade(timestamp, vfx); - }); - } else { - for (const block of vfx.stepBlocks) - { - block.element.style.opacity = vfx.upDown ? 1 : 0; - block.element.style.display = vfx.upDown ? `block` :`none`; - } - if (!vfx.continueFlag) { - if (script.runMode === `manual`) { - enterManualMode(vfx.step); - } else { - vfx.step.next(); - } - } - } - }; - - // Fade up or down - const doFade = (step, upDown) => { - const stepBlocks = []; - for (const name of step.blocks) { - script.blocks.every((block) => { - if (block.defaults.name === name) { - stepBlocks.push(block); - if (!block.element) { - createBlock(block); - } - return false; - } - return true; - }); - } - if (script.speed === `scan`) { - for (const block of stepBlocks) - { - if (upDown) { - block.element.style.opacity = `1.0`; - block.element.style.display = `block`; - } else { - block.element.style.opacity = `0.0`; - block.element.style.display = `none`; - } - } - step.next(); - } else { - for (const block of stepBlocks) - { - block.element.style.display = `block`; - } - const vfx = {}; - vfx.step = step; - vfx.stepBlocks = stepBlocks; - vfx.upDown = upDown; - vfx.duration = step.duration * 1000; - vfx.continueFlag = step.continue === `yes`; - requestAnimationFrame(timestamp => { - animateFade(timestamp, vfx); - }); - if (vfx.continueFlag) { - step.next(); - } - } - }; - - const fadeup = step => { - doFade(step, true); - }; - - const fadedown = step => { - doFade(step, false); - }; - - const initImage = vfx => { - const container = vfx.container; - const image = vfx.image; - let aspectW = 4; - let aspectH = 3; - const colon = vfx.aspect.indexOf(`:`); - if (colon) { - aspectW = vfx.aspect.slice(0,colon); - aspectH = vfx.aspect.slice(colon + 1); - } - const ratio = aspectW / aspectH; - const width = container.offsetWidth; - const height = width / ratio; - container.style.height = `${Math.round(height)}px`; - container.style.display = `inline-block`; - container.style.overflow = `hidden`; - - const realWidth = image.naturalWidth; - const realHeight = image.naturalHeight; - const realRatio = realWidth / realHeight; - let w; - let h; - if (ratio < realRatio) { - h = height; - w = height * realRatio; - } else { - w = width; - h = width / realRatio; - } - const w2 = w * vfx.endsize / 100; - const h2 = h * vfx.endsize / 100; - w *= vfx.startsize / 100; - h *= vfx.startsize / 100; - const xoff = -width * vfx.startxoff / 100; - const yoff = -height * vfx.startyoff / 100; - const xoff2 = -width * vfx.endxoff / 100; - const yoff2 = -height * vfx.endyoff / 100; - - vfx.w = w; - vfx.w2 = w2; - vfx.h = h; - vfx.h2 = h2; - vfx.xoff = xoff; - vfx.xoff2 = xoff2; - vfx.yoff = yoff; - vfx.yoff2 = yoff2; - - image.style.position = `absolute`; - image.style.width = `${w}px`; - image.style.height = `${h}px`; - image.style.left = `${xoff}px`; - image.style.top = `${yoff}px`; - }; - - // Animate a pan-zoom - const animatePanzoom = (timestamp, vfx) => { - if (script.stop) { - return; - } - if (vfx.start === undefined) { - vfx.start = timestamp; - } - const image = vfx.image; - const elapsed = timestamp - vfx.start; - const duration = vfx.duration * 1000; - if (elapsed < duration) { - const ratio = 0.5 - Math.cos(Math.PI * elapsed / duration) / 2; - // console.log(ratio); - image.style.width = `${vfx.w + (vfx.w2 - vfx.w) * ratio}px`; - image.style.height = `${vfx.h + (vfx.h2 - vfx.h) * ratio}px`; - image.style.left = `${vfx.xoff + (vfx.xoff2 - vfx.xoff) * ratio}px`; - image.style.top = `${vfx.yoff + (vfx.yoff2 - vfx.yoff) * ratio}px`; - requestAnimationFrame(timestamp => { - animatePanzoom(timestamp, vfx); - }); - } else { - image.style.width = `${vfx.w2}px`; - image.style.height = `${vfx.h2}px`; - image.style.left = `${vfx.xoff2}px`; - image.style.top = `${vfx.yoff2}px`; - // Remove the vfx now we've done with it - const index = vfx.block.vfx.indexOf(vfx); - if (index > -1) { - vfx.block.vfx.splice(index, 1); - } - } - }; - - // Animate a block - const animate = step => { - for (const block of script.blocks) { - if (block.defaults.name === step.block) { - for (const vfx of block.vfx) { - console.log(` VFX ${vfx.name}`); - const vfxElement = vfx.container; - vfxElement.style.position = `relative`; - vfxElement.style.display = `inline-block`; - for (const item of script.vfx) { - if (item.name === vfx.name) { - if (!Array.isArray(step.vfx)) { - step.vfx = []; - } - step.vfx.push(item); - delete(vfx.start); - if (script.speed === `scan`) { - vfx.image.style.width = `${vfx.w2}px`; - vfx.image.style.height = `${vfx.h2}px`; - vfx.image.style.left = `${vfx.xoff2}px`; - vfx.image.style.top = `${vfx.yoff2}px`; - } else { - vfx.step = step; - requestAnimationFrame(timestamp => { - animatePanzoom(timestamp, vfx); - }); - } - break; - } - } - if (step.vfx.length === 0) { - step.next(); - } - } - break; - } - } - // An animation is not a transition, so move on immediately - step.next(); - }; - - // Run a pan-zoom (for testing animations) - const panzoom = arg => { - player.innerText = ``; - const vfx = JSON.parse(arg); - vfx.container = player; - vfx.startsize = 100; - vfx.startxoff = 0; - vfx.startyoff = 0; - let url; - if (vfx.url[0] === `=`) { - const name = vfx.url.slice(1); - for (const vfx2 of script.vfx) { - if (name === vfx2.name) { - url = vfx2.url; - vfx.startsize = vfx2.endsize; - vfx.startxoff = vfx2.endxoff; - vfx.startyoff = vfx2.endyoff; - break; - } - } - } else { - url = vfx.url; - } - const image = new Image(); - vfx.image = image; - image.src = url; - image.addEventListener(`load`, () => { - initImage(vfx); - requestAnimationFrame(timestamp => { - animatePanzoom(timestamp, vfx); - }); - }); - player.appendChild(image); - }; - - // Animate a crossfade - const animateCrossfade = (timestamp, vfx) => { - if (script.stop) { - return; - } - if (vfx.start === undefined) { - vfx.start = timestamp; - } - const elapsed = timestamp - vfx.start; - if (elapsed < vfx.duration) { - const ratio = 0.5 - Math.cos(Math.PI * elapsed / vfx.duration) / 2; - vfx.block.element.style.opacity = 1.0 - ratio; - vfx.element.style.opacity = ratio; - requestAnimationFrame(timestamp => { - animateCrossfade(timestamp, vfx); - }); - } else { - vfx.block.textPanel.innerHTML = vfx.newText; - if (vfx.content.url) { - vfx.block.element.style.background = `url("${vfx.content.url}")`; - } - vfx.block.element.style[`background-size`] = `cover`; - vfx.block.element.style.opacity = 1.0 ; - removeElement(vfx.element); - if (!vfx.continueFlag) { - if (script.runMode === `manual`) { - enterManualMode(step); - } else { - vfx.step.next(); - } - } - } - }; - - // Handle a crossfade - const crossfade = step => { - for (const content of script.content) { - if (content.name === step.target) { - const converter = new showdown.Converter({ - extensions: [`IWSY`] - }); - const newText = converter.makeHtml(content.content.split(`%0a`).join(`\n`)); - for (const block of script.blocks) { - if (block.defaults.name === step.block) { - if (block.element === undefined) { - throw Error(`Block '${block.defaults.name}' has no DOM element.`); - } - if (script.speed === `scan`) { - block.textPanel.innerHTML = newText; - step.next(); - } else { - const continueFlag = step.continue === `yes`; - const element = document.createElement(`div`); - player.appendChild(element); - element.style.position = `absolute`; - element.style.opacity = `0.0`; - element.style.left = block.element.style.left; - element.style.top = block.element.style.top; - element.style.width = block.element.style.width; - element.style.height = block.element.style.height; - if (block.element.style.background) { - element.style.background = block.element.style.background; - } - element.style.border = block.element.style.border; - element.style[`border-radius`] = block.element.style[`border-radius`]; - const text = document.createElement(`div`); - element.appendChild(text); - text.style.position = `absolute`; - text.style.left = block.textPanel.style.left; - text.style.top = block.textPanel.style.top; - text.style.width = block.textPanel.style.width; - text.style[`font-family`] = block.textPanel.style[`font-family`]; - text.style[`font-size`] = block.textPanel.style[`font-size`]; - text.style[`font-weight`] = block.textPanel.style[`font-weight`]; - text.style[`font-style`] = block.textPanel.style[`font-style`]; - text.style[`text-align`] = block.textPanel.style[`text-align`]; - text.style.color = block.textPanel.style.color; - text.innerHTML = newText; - const vfx = {}; - vfx.step = step; - vfx.block = block; - vfx.element = element; - vfx.content = content; - vfx.newText = newText; - vfx.duration = step.duration * 1000; - vfx.continueFlag = continueFlag; - requestAnimationFrame(timestamp => { - animateCrossfade(timestamp, vfx); - }); - - if (continueFlag) { - step.next(); - } - } - break; - } - } - break; - } - } - }; - - // Compute a block size - const setComputedBlockSize = (block, target, ratio) => { - const boundingRect = player.getBoundingClientRect(); - const w = boundingRect.width / 1000; - const h = boundingRect.height / 1000; - let width = block.current.width; - if (!isNaN(width)) { - width *= w; - } - let height = block.current.height; - if (!isNaN(height)) { - height *= h; - } - let endWidth = target.defaults.width; - if (!isNaN(endWidth)) { - endWidth *= w; - } - let endHeight = target.defaults.height; - if (!isNaN(endHeight)) { - endHeight *= h; - } - block.element.style.width = - `${width + (endWidth - width) * ratio}px`; - block.element.style.height = - `${height + (endHeight - height) * ratio}px`; - }; - - // Compute a block position - const setComputedBlockPosition = (block, target, ratio) => { - const boundingRect = player.getBoundingClientRect(); - const w = boundingRect.width / 1000; - const h = boundingRect.height / 1000; - let left = block.current.left; - if (!isNaN(left)) { - left *= w; - } - let top = block.current.top; - if (!isNaN(top)) { - top *= h; - } - let endLeft = target.defaults.left; - if (!isNaN(endLeft)) { - endLeft *= w; - } - let endTop = target.defaults.top; - if (!isNaN(endTop)) { - endTop *= h; - } - block.element.style.left = left + (endLeft - left) * ratio; - block.element.style.top = top + (endTop - top) * ratio; - }; - - // Compute a font size - const setComputedFontSize = (block, target, ratio) => { - const h = Math.round(player.getBoundingClientRect().height) / 1000; - let size = block.current.fontSize; - if (!isNaN(size)) { - size *= h; - } - let endSize = target.defaults.fontSize; - if (!isNaN(endSize)) { - endSize *= h; - } - block.textPanel.style[`font-size`] = - `${size + (endSize - size) * ratio}px`; - }; - - // Compute a font color - const setComputedFontColor = (block, target, ratio) => { - const color = block.current.fontColor; - const endColor = target.defaults.fontColor; - const rStart = parseInt(color.slice(1, 3), 16); - const gStart = parseInt(color.slice(3, 5), 16); - const bStart = parseInt(color.slice(5, 7), 16); - const rFinish = parseInt(endColor.slice(1, 3), 16); - const gFinish = parseInt(endColor.slice(3, 5), 16); - const bFinish = parseInt(endColor.slice(5, 7), 16); - const red = rStart + Math.round((rFinish - rStart) * ratio); - const green = gStart + Math.round((gFinish - gStart) * ratio); - const blue = bStart + Math.round((bFinish - bStart) * ratio); - const r = (`0` + red.toString(16)).slice(-2); - const g = (`0` + green.toString(16)).slice(-2); - const b = (`0` + blue.toString(16)).slice(-2); - block.textPanel.style.color = `#${r}${g}${b}`; - }; - - // Handle a single step of a transition - const doTransitionStep = (block, target, ratio) => { - setComputedBlockSize(block, target, ratio); - setComputedBlockPosition(block, target, ratio); - setComputedFontSize(block, target, ratio); - setComputedFontColor(block, target, ratio); - }; - - // Set the final state of a transition - const setFinalState = (block, target) => - { - block.current.width = target.defaults.width; - block.current.height = target.defaults.height; - block.current.left = target.defaults.left; - block.current.top = target.defaults.top; - block.current.fontColor = target.defaults.fontColor; - block.current.fontSize = target.defaults.fontSize; - }; - - // Animate a transition - const animateTransition = (timestamp, vfx) => { - if (script.stop) { - return; - } - if (vfx.start === undefined) { - vfx.start = timestamp; - } - const elapsed = timestamp - vfx.start; - if (elapsed < vfx.duration) { - const ratio = 0.5 - Math.cos(Math.PI * elapsed / vfx.duration) / 2; - try { - doTransitionStep(vfx.block, vfx.target, ratio); - requestAnimationFrame(timestamp => { - animateTransition(timestamp, vfx); - }); - } catch (err) { - console.log(err); - } - } else { - setFinalState(vfx.block,vfx.target); - if (!vfx.continueFlag) { - if (script.runMode === `manual`) { - enterManualMode(step); - } else { - vfx.step.next(); - } - } - } - }; - - // Handle a transition - const transition = step => { - let block = null; - let target = null; - script.blocks.every(item => { - if (item.defaults.name === step.block) { - block = item; - } - if (item.defaults.name === step.target) { - target = item; - } - return true; - }); - if (typeof block.element === `undefined`) { - throw Error(`Block '${block.defaults.name}' has not been set up`); - } - block.element.style.opacity = 1; - block.element.style.display = `block`; - if (script.speed === `scan`) { - doTransitionStep(block, target, 1.0); - setFinalState(block,target); - step.next(); - } else { - const continueFlag = step.continue === `yes`; - const vfx = {}; - vfx.step = step; - vfx.block = block; - vfx.target = target; - vfx.duration = step.duration * 1000; - vfx.continueFlag = continueFlag; - requestAnimationFrame(timestamp => { - animateTransition(timestamp, vfx); - }); - if (continueFlag) { - step.next(); - } - } - }; - - // Remove all the blocks from the player - const removeBlocks = () => { - if (Array.isArray(script.blocks)) { - for (const block of script.blocks) { - if (block.element) { - removeElement(block.element); - delete(block.element); - } - } - } - }; - - // Remove an element - const removeElement = element => { - const parent = element.parentElement; - if (parent) { - parent.removeChild(element); - } - }; - - // Load a plugin action - const load = step => { - if (script.speed === `scan`) { - step.next(); - } else { - const element = document.createElement(`script`); - element.src = step.url; - element.onload = () => { - console.log(`Plugin ${element.src} loaded`); - step.next(); - }; - element.onerror = () => { - throw Error(`Can't load plugin ${step.url}`); - }; - document.head.appendChild(element); - } - }; - - // Initialize the presentation - const init = step => { - if (step.title) { - document.title = step.title; - } - if (step.css) { - setHeadStyle(step.css.split(`%0a`).join(`\n`)); - } - 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); - if (document.fullscreenElement) { - player.style.width = window.innerWidth; - player.style.height = window.innerHeight; - player.style.border = ``; - } else { - const height = Math.round(parseFloat(player.offsetWidth) * aspectH / aspectW); - player.style.height = `${Math.round(height)}px`; - player.style.border = step.border; - } - } - player.style.position = `relative`; - player.style.overflow = `hidden`; - player.style.cursor = `none`; - if (step.background) { - player.style.background = step.background.split(`"`).join(`"`); - } - player.style[`background-size`] = `cover`; - } - step.next(); - }; - - // Scan the script - const scan = () => { - removeBlocks(); - setupBlocks(); - player.innerHTML = ``; - initScript(); - script.speed = `scan`; - doStep(script.steps[0]); - }; - - // Go to a specified label - const goto = step => { - const index = script.labels[step.target]; - if (typeof index !== `undefined`) { - nextStep = script.steps[index]; - doStep(nextStep); - } else { - throw Error(`Unknown label '${step.target}`); - } - }; - - // Restore the cursor - const restoreCursor = () => { - player.style.cursor = `pointer`; - script = homeScript; - if (afterRun) { - afterRun(); - } - }; - - // Set up Showdown - const setupShowdown = () => { - if (typeof showdown === `undefined`) { - require(`js`, `https://cdn.rawgit.com/showdownjs/showdown/1.9.1/dist/showdown.min.js`, - () => { - showdown.extension(`IWSY`, { - type: `lang`, - filter: function (text) { - return text.replace(/~([^~]+)~/g, function (match, group) { - return decodeShowdown(group); - }); - } - }); - }); - } - }; - - // Decode special Showdown tags - const decodeShowdown = group => { - if (group.slice(0, 5) === `code:`) { - return `${group.slice(5)}`; - } - if (group.slice(0, 5) === `html:`) { - return group.slice(5); - } - if (group.slice(0, 4) === `img:`) { - const data = group.slice(4); - const pipe = data.indexOf(`|`); - if (pipe > 0) { - const src = data.slice(0, pipe); - const classes = data.slice(pipe + 1).split(` `); - const styles = []; - for (const item of classes) { - setImageStyles(item, styles); - } - return ``; - } - } - if (group.slice(0, 4) === `vfx:`) { - const styles = []; - let slide = ``; - const items = group.slice(4).split(` `); - for (const item of items) { - if (!setImageStyles(item, styles)) { - slide = item; - } - } - return `
`; - } - return group; - }; - - // Set the image styles - const setImageStyles = (item, styles) => { - if (item.endsWith(`%`)) { - styles.push(`width:${item}`); - } else if (item.startsWith(`{`) && item.endsWith(`}`)) { - styles.push(item.slice(1, -1)); - } else { - switch (item) { - case `left`: - styles.push(`float:left;margin-right:1em`); - break; - case `center`: - styles.push(`position:absolute;left:50%;top:0;transform:translate(-50%, 0)`); - break; - case `right`: - styles.push(`float:right;margin-left:1em`); - break; - case `clear`: - styles.push(`clear:both`); - break; - case `border`: - styles.push(`padding:2px;border:1px solid black`); - break; - default: - return false; - } - } - return true; - }; - - // Load a JS or CSS library - const require = (type, src, cb) => { - let prefix = ``; - if (src[0] == `/`) { - prefix = window.location + `/`; - } - const element = document.createElement(type === `css` ? `link` : `script`); - switch (type) { - case `css`: - element.type = `text/css`; - element.href = `${prefix}${src}`; - element.rel = `stylesheet`; - break; - case `js`: - element.type = `text/javascript`; - element.src = `${prefix}${src}`; - break; - default: - return; - } - element.onload = function () { - console.log(`Library ${prefix}${src} loaded`); - cb(); - }; - document.head.appendChild(element); - }; - - // Set a HEAD style - const setHeadStyle = (styleName, styleValue) => { - for (let i = 0; i < document.head.childNodes.length; i++) { - let node = document.head.childNodes[i]; - if (node.tagName === `STYLE`) { - let data = node.innerHTML; - if (data.indexOf(`${styleName} `) === 0) { - document.head.removeChild(node); - break; - } - } - } - var style = document.createElement(`style`); - style.className = `iwsy-css`; - style.innerHTML = `${styleName} ${styleValue}`; - document.head.appendChild(style); - }; - - // Release the presentation to continue - const release = () => { - player.style.cursor = `none`; - document.removeEventListener(`click`, release); - document.addEventListener(`click`, () => { - script.runMode = `manual`; - }); - document.onkeydown = () => { - script.runMode = `manual`; - }; - doStep(script.nextStep); - }; - - // Manual mode. Set up listeners and wait for the user - const enterManualMode = step => { - script.nextStep = step ? script.steps[step.index + 1] : script.steps[0]; - player.style.cursor = `pointer`; - document.addEventListener(`click`, release); - document.onkeydown = event => { - switch (event.code) { - case `Space`: - case `ArrowRight`: - document.onkeydown = null; - script.runMode = `manual`; - release(); - break; - case `ArrowLeft`: - break; - case `Enter`: - document.addEventListener(`click`, () => { - script.runMode = `manual`; - }); - player.style.cursor = `none`; - script.runMode = `auto`; - release(); - break; - } - return true; - }; - }; - - // Initialize the script - const initScript = () => { - document.onkeydown = null; - player.style.position = `relative`; - player.style.overflow = `hidden`; - player.style.cursor = `none`; - script.speed = `normal`; - script.labels = {}; - script.stop = false; - script.scanFinished = false; - removeStyles(); - for (const block of script.blocks) { - const element = block.element; - if (element != null && typeof element !== `undefined`) { - removeElement(element); - block.element = null; - } - } - player.innerHTML = null; - script.steps.forEach((step, index) => { - step.index = index; - if (typeof step.label !== `undefined`) { - script.labels[step.label] = index; - } - if (index < script.steps.length - 1) { - step.next = () => { - const nextStep = script.steps[step.index + 1]; - if (script.scanFinished) { - script.scanFinished = false; - } else { - if (script.speed === `scan` && nextStep.index === script.scanTarget) { - script.speed = `normal`; - script.scanFinished = true; - } - if (script.runMode == `auto` || script.speed === `scan`) { - setTimeout(() => { - if (script.stop) { - // script.stop = false; - restoreCursor(); - } else { - doStep(nextStep); - } - }, 0); - } else { - doStep(nextStep); - } - } - }; - } - else { - step.next = () => { - console.log(`Step ${index + 1}: Finished`); - restoreCursor(); - }; - } - }); - setupBlocks(); - }; - - const actions = { - init, - noop, - setcontent, - show, - hide, - fadeup, - fadedown, - animate, - crossfade, - transition, - pause, - goto, - load - }; - - // Process a single step - const doStep = step => { - try { - if (!step) { - return; - } - if (step.title) { - console.log(`Step ${step.index}: ${step.title}`); - } else { - console.log(`Step ${step.index}: ${step.action}`); - } - - const onStepCB = script.onStepCB; - if (step.action === `chain`) { - const runMode = script.runMode; - if (step.mode === `static`) { - script = window.localStorage.getItem(step.script); - if (onStepCB) { - onStepCB(-1); - } - initScript(); - script.runMode = runMode; - doStep(script.steps[1]); - } else { - fetch(`${thePath}/${step.script}?v=${Date.now()}`) - .then(response => { - if (response.status >= 400) { - throw Error(`Unable to load ${step.script}: ${response.status}`); - } - response.json().then(data => { - script = data; - if (onStepCB) { - onStepCB(-1); - } - initScript(); - script.runMode = runMode; - doStep(script.steps[1]); - }); - }) - .catch(err => { - console.log(`Fetch Error :${err}`); - }); - return; - } - } - - const actionName = step.action.split(` `).join(``); - let handler = actions[actionName]; - if (script.runMode === `auto`) { - if (typeof handler === `undefined`) { - handler = plugins[actionName]; - if (typeof handler === `undefined`) { - throw Error(`Unknown action: '${step.action}'`); - } - } - if (onStepCB) { - onStepCB(step.index); - } - try { - handler(step); - } catch (err) { - console.log(`Step ${step.index} (${step.action}): ${err}`); - alert(`Step ${step.index} (${step.action}): ${err}`); - } - } else { - try { - handler(step); - } catch (err) { - console.log(JSON.stringify(step,0,2) + `\n` + JSON.stringify(handler,0,2)); - console.log(`Step ${step.index} (${step.action}): ${err}`); - alert(`Step ${step.index} (${step.action}): ${err}`); - } - } - } - catch (err) { - console.log(`Step error: ${err}`); - throw Error(err); - } - }; - - /////////////////////////////////////////////////////////////////////////////// - // These are all the exported functions - - // Get the script - const getScript = () => { - return script; - }; - - // Set the script - const setScript = newScript => { - removeBlocks(); - script = newScript; - initScript(); - }; - - // Set the path (for 'embed') - const setPath = path => { - thePath = path; - }; - - // Go to a specified step number - const gotoStep = target => { - script.scanTarget = target; - script.runMode = `manual`; - scan(); - }; - - // Show a block - const block = blockIndex => { - player.innerHTML = ``; - const w = player.getBoundingClientRect().width / 1000; - const h = player.getBoundingClientRect().height / 1000; - script.blocks.forEach((block, index) => { - const defaults = block.defaults; - const element = document.createElement(`div`); - player.appendChild(element); - if (script.speed === `scan`) { - element.style.display = `none`; - } - element.style.position = `absolute`; - element.style.opacity = `0.5`; - let val = defaults.left; - if (!isNaN(val)) { - val *= w; - } - element.style.left = val; - val = defaults.top; - if (!isNaN(val)) { - val *= h; - } - element.style.top = val; - val = defaults.width; - if (!isNaN(val)) { - val = `${val * w - 2}px`; - } else { - val = `calc(${val} - 2px)`; - } - element.style.width = val; - val = defaults.height; - if (!isNaN(val)) { - val = `${val * h - 2}px`; - } else { - val = `calc(${val} - 2px)`; - } - element.style.height = val; - element.style[`font-size`] = `${h * 40}px`; - element.innerHTML = defaults.name; - if (index == blockIndex) { - element.style.background = `#ddffdd`; - element.style.border = `1px solid #00ff00`; - element.style[`font-weight`] = `bold`; - element.style[`z-index`] = 10; - element.style.color = `#006600`; - } else { - element.style.border = `1px solid #ff0000`; - element.style[`text-align`] = `right`; - element.style[`z-index`] = 0; - element.style.color = `#ff0000`; - } - }); - }; - - // Run the presentation - const run = (mode, startMode, then) => { - try { - player.innerHTML = ``; - // homeScript = JSON.parse(JSON.stringify(script)); - afterRun = then; - initScript(); - if (mode === `fullscreen`) { - if (document.fullscreenElement) { - document.exitFullscreen(); - } else { - player.requestFullscreen(); - document.onfullscreenchange = () => { - if (document.fullscreenElement) { - player = document.fullscreenElement; - script.nextStep = script.steps[0]; - switch (startMode) { - case `auto`: - script.runMode = `auto`; - release(); - break; - case `manual`: - script.runMode = `manual`; - release(); - break; - case `wait`: - script.runMode = `manual`; - enterManualMode(null); - break; - } - } else { - player = playerElement; - script.stop = true; - } - }; - } - } else { - script.runMode = `auto`; - doStep(script.steps[0]); - } - } catch (err) { - console.log(`Run error: ${err}`); - throw Error(err); - } - }; - - // Stop the run - const stop = () => { - clearAllTimers(); - script.stop = true; - }; - - // Set a step callback - const onStep = onStepCB => { - script.onStepCB = onStepCB; - }; - - // Remove all the CSS styles - const removeStyles = () => { - const styles = document.getElementsByClassName(`iwsy-css`); - for (const style of styles) { - style.parentNode.removeChild(style); - } - }; - - /////////////////////////////////////////////////////////////////////////// - - setupShowdown(); - initScript(); - return { - getScript, - setScript, - setPath, - gotoStep, - block, - run, - stop, - onStep, - removeStyles, - panzoom - }; -}; \ No newline at end of file diff --git a/iwsy/iwsystart.js b/iwsy/iwsystart.js deleted file mode 100644 index f69bf66..0000000 --- a/iwsy/iwsystart.js +++ /dev/null @@ -1,75 +0,0 @@ -window.onload = () => { - const createCORSRequest = (url) => { - let xhr = new XMLHttpRequest(); - if (`withCredentials` in xhr) { - - // Check if the XMLHttpRequest object has a "withCredentials" property. - // "withCredentials" only exists on XMLHTTPRequest2 objects. - xhr.open(`GET`, url, true); - - } else if (typeof XDomainRequest != `undefined`) { - - // Otherwise, check if XDomainRequest. - // XDomainRequest only exists in IE, and is IE's way of making CORS requests. - xhr = new XDomainRequest(); - xhr.open(`GET`, url); - - } else { - - // Otherwise, CORS is not supported by the browser. - xhr = null; - - } - return xhr; - }; - - const start = mode => { - const container = document.getElementById(`iwsy-container`); - const scriptElement = document.getElementById(`iwsy-script`); - const path = scriptElement.innerText; - if (scriptElement) { - const request = createCORSRequest(`${path}?v=${Math.floor(Date.now())}`); - if (!request) { - throw Error(`Unable to access the JSON script`); - } - - request.onload = () => { - if (200 <= request.status && request.status < 400) { - const script = JSON.parse(request.responseText); - const iwsy = IWSY(container, script); - const slash = path.lastIndexOf(`/`); - iwsy.setPath(path.slice(0, slash + 1)); - iwsy.onStep(() => { - }); - iwsy.run(`fullscreen`, mode, () => { - console.log(`All done`); - }); - } else { - throw Error(`Unable to access the JSON script`); - } - }; - - request.onerror = () => { - throw Error(`Unable to access the JSON script`); - }; - - request.send(); - } - }; - - // Wait for a click/tap or a keypress to start - const listener = document.addEventListener(`click`, () => { - document.removeEventListener(`click`, listener); - start(`auto`); - }); - document.onkeydown = event => { - document.onkeydown = null; - if (event.code === `Enter`) { - start(`auto`); - } - else { - start(`manual`); - } - return true; - }; -}; diff --git a/iwsy/resources/README.md b/iwsy/resources/README.md deleted file mode 100644 index 2238294..0000000 --- a/iwsy/resources/README.md +++ /dev/null @@ -1,3 +0,0 @@ - # IWSY resources - - These are all the resources - scripts, images and text files - called for by the website. diff --git a/iwsy/resources/ecs/README.md b/iwsy/resources/ecs/README.md deleted file mode 100644 index 7d10ea6..0000000 --- a/iwsy/resources/ecs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# EasyCoder scripts - -The entire IWSY UI is a web application driven by EasyCoder scripts in this folder. The "home" script is `iwsy.js` and this loads others as it needs them. `scripted` is a color-coded editor for EasyCoder script files, that runs in `scripted.html`. \ No newline at end of file diff --git a/iwsy/resources/ecs/blocks.txt b/iwsy/resources/ecs/blocks.txt deleted file mode 100644 index 7967497..0000000 --- a/iwsy/resources/ecs/blocks.txt +++ /dev/null @@ -1,284 +0,0 @@ -! Blocks - - script Blocks - - import div Container and variable Presentation - - div Panel - div Editor - div Title - div Table - div Row - div Cell - div Empty - input PropertyInput - select BlockSelect - button EditButton - button SaveButton - img ShowBlock - img AddBlock - img Up - img DeleteBlock - a Link - variable Blocks - variable Block - variable Block2 - variable BlockNames - variable ParentBlock - variable Defaults - variable PropertyDefaults - variable ParentDefaults - variable PropertyNames - variable PropertyName - variable SelectedBlock - variable SavedIndex - variable Parent - variable Message - variable N - variable M - variable NBlocks - variable CDN - - get CDN from storage as `.cdn` - - put -1 into SelectedBlock - - rest get PropertyNames from CDN cat `/resources/json/propertyNames.json` - rest get PropertyDefaults from CDN cat `/resources/json/propertyDefaults.json` - - on message go to Start - set ready - stop - -Start: - if the message is `save` - begin - gosub to SaveSelectedBlock - stop - end - -Restart: - put property `blocks` of Presentation into Blocks - clear Container - create Panel in Container - set the style of Panel to `height:100%;display:flex;flex-direction:column` - create Row in Panel - set the style of Row to `height:2em;display:flex` - create Title in Row - set the style of Title to - `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em` - set the content of Title to `Blocks` - create Cell in Row - set the style of Cell to `width:1.4em;text-align:center` - create Link in Cell - create AddBlock in Link - set the style of AddBlock to `width:1em;margin-top:0.1em` - set attribute `src` of AddBlock to CDN cat `/resources/icon/plus.png` - on click AddBlock - begin - set Defaults to object - put 0 into N - while N is less than the json count of PropertyNames - begin - put element N of PropertyNames into PropertyName - set property PropertyName of Defaults to property PropertyName of PropertyDefaults - add 1 to N - end - set Block to object - set property `defaults` of Block to Defaults - json add Block to Blocks - set property `blocks` of Presentation to Blocks - go to Restart - end - - put the json count of Blocks into NBlocks - if NBlocks is greater than 0 - begin - set the elements of ShowBlock to NBlocks - set the elements of EditButton to NBlocks - set the elements of SaveButton to NBlocks - set the elements of Editor to NBlocks - set the elements of Up to NBlocks - set the elements of DeleteBlock to NBlocks - end - create Table in Panel - set the style of Table to `flex:1;width:100%;overflow-y:scroll` - put 0 into N - while N is less than NBlocks - begin - index EditButton to N - index Up to N - index DeleteBlock to N - index Editor to N - create Row in Table - set the style of Row to `margin-bottom:0.2em` - create Cell in Row - set the style of Cell to `width:100%;display:flex` - create Link in Cell - index ShowBlock to N - create ShowBlock in Link - set the style of ShowBlock to `width:1em;margin:0.1em 0.2em 0 0` - set attribute `src` of ShowBlock to CDN cat `/resources/icon/binoculars.png` - create EditButton in Cell - set the style of EditButton to `flex:1` - put element N of Blocks into Block - put property `defaults` of Block into Defaults - set the text of EditButton to property `name` of Defaults - if N is 0 - begin - create Empty in Cell - set the style of Empty to `width:1em;margin:0.2em 0 0 0.2em` - end - else - begin - create Link in Cell - create Up in Link - set the style of Up to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of Up to CDN cat `/resources/icon/up.png` - end - create Link in Cell - create DeleteBlock in Link - set the style of DeleteBlock to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of DeleteBlock to CDN cat `/resources/icon/stop.png` - create Editor in Row - set the style of Editor to `margin:0.5em;border:1px solid black;padding:0.2em;display:none` - add 1 to N - end - on click ShowBlock - begin - set Message to object - set property `action` of Message to `block` - set property `block` of Message to the index of ShowBlock - send Message to parent - end - on click EditButton - begin - if the elements of EditButton is not greater than the index of EditButton stop - put the index of EditButton into SavedIndex - gosub to SaveSelectedBlock - put SavedIndex into SelectedBlock - put 0 into N - while N is less than NBlocks - begin - if N is not SelectedBlock - begin - index EditButton to N - set style `background-color` of EditButton to `#eee` - index Editor to N - set style `display` of Editor to `none` - clear Editor - end - add 1 to N - end - index EditButton to SelectedBlock - index Editor to SelectedBlock - index SaveButton to SelectedBlock - if style `display` of Editor is `none` - begin - set style `background-color` of EditButton to `lightgray` - set style `display` of Editor to `block` - put element SelectedBlock of Blocks into Block - put property `defaults` of Block into Defaults - put the json count of PropertyNames into N - set the elements of PropertyInput to N - put 0 into N - while N is less than the json count of PropertyNames - begin - create Row in Editor - set the style of Row to `display:flex` - put element N of PropertyNames into PropertyName - create Cell in Row - set the style of Cell to `width:8em;padding-left:0.5em` - set the content of Cell to PropertyName - if PropertyName is `parent` - begin - put property PropertyName of Defaults into Parent - set BlockNames to array - json add `` to BlockNames - put 0 into M - while M is less than the json count of Blocks - begin - if M is not SelectedBlock - begin - put element M of Blocks into ParentBlock - put property `defaults` of ParentBlock into ParentDefaults - json add property `name` of ParentDefaults to BlockNames - end - add 1 to M - end - create BlockSelect in Row - set the style of BlockSelect to `flex:1;height:1.5em` - set BlockSelect from BlockNames as Parent - end - else - begin - index PropertyInput to N - create PropertyInput in Row - set the style of PropertyInput to `flex:1;height:1.5em` - set the text of PropertyInput to property PropertyName of Defaults - end - add 1 to N - end - create Row in Editor - create SaveButton in Row - set the style of SaveButton to `width:100%` - set the text of SaveButton to `Save` - on click SaveButton gosub to SaveSelectedBlock - end - else - begin - clear Editor - set style `display` of Editor to `none` - end - end - on click Up - begin - put the index of Up into N - put element N of Blocks into Block - take 1 from N - put element N of Blocks into Block2 - set element N of Blocks to Block - add 1 to N - set element N of Blocks to Block2 - set property `blocks` of Presentation to Blocks - put -1 into SelectedBlock - go to Restart - end - on click DeleteBlock - begin - put the index of DeleteBlock into N - json delete element N of Blocks - set property `blocks` of Presentation to Blocks - put -1 into SelectedBlock - go to Restart - end - stop - -! Save the seleced block -SaveSelectedBlock: - if SelectedBlock is -1 return - index EditButton to SelectedBlock - put element SelectedBlock of Blocks into Block - put 0 into N - while N is less than the json count of PropertyNames - begin - put element N of PropertyNames into PropertyName - if PropertyName is `parent` set property PropertyName of Defaults to BlockSelect - else - begin - index PropertyInput to N - set property PropertyName of Defaults to the text of PropertyInput - end - add 1 to N - end - set the text of EditButton to property `name` of Defaults - set property `defaults` of Block to Defaults - set element SelectedBlock of Blocks to Block - set property `blocks` of Presentation to Blocks - -! Tell the parent to refresh the script - set Message to object - set property `action` of Message to `refresh` - set property `source` of Message to `blocks` - send Message to parent - return \ No newline at end of file diff --git a/iwsy/resources/ecs/content.txt b/iwsy/resources/ecs/content.txt deleted file mode 100644 index 92db7fd..0000000 --- a/iwsy/resources/ecs/content.txt +++ /dev/null @@ -1,235 +0,0 @@ -! Content - - script Content - - import div Container and variable Presentation - - div Panel - div Editor - div Title - div Table - div Row - div Cell - div Empty - input ItemNameInput - textarea TextArea - button EditButton - button SaveButton - img AddItem - img Up - img DeleteItem - a Link - variable Items - variable Item - variable Item2 - variable ItemNames - variable ItemName - variable SelectedItem - variable SavedIndex - variable Message - variable N - variable NumItems - variable Content - variable CDN - - get CDN from storage as `.cdn` - - put -1 into SelectedItem - - on message go to Start - set ready - stop - -Start: - if the message is `save` - begin - gosub to SaveSelectedItem - stop - end - -Restart: - put property `content` of Presentation into Items - set ItemNames to array - put 0 into N - while N is less than the json count of Items - begin - put element N of Items into Item - json add property `name` of Item to ItemNames - add 1 to N - end - - clear Container - create Panel in Container - set the style of Panel to `height:100%;display:flex;flex-direction:column` - create Row in Panel - set the style of Row to `height:2em;display:flex` - create Title in Row - set the style of Title to - `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em` - set the content of Title to `Content Items` - create Cell in Row - set the style of Cell to `width:1.4em;text-align:center` - create Link in Cell - create AddItem in Link - set the style of AddItem to `width:1em;margin-top:0.1em` - set attribute `src` of AddItem to CDN cat `/resources/icon/plus.png` - on click AddItem - begin - set Item to object - set property `name` of Item to `New content` - set property `content` of Item to empty - json add Item to Items - set property `content` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - - put the json count of Items into NumItems - if NumItems is greater than 0 - begin - set the elements of EditButton to NumItems - set the elements of Editor to NumItems - set the elements of SaveButton to NumItems - set the elements of Up to NumItems - set the elements of DeleteItem to NumItems - set the elements of ItemNameInput to NumItems - set the elements of TextArea to NumItems - end - create Table in Panel - set the style of Table to `flex:1;width:100%;overflow-y:scroll` - put 0 into N - while N is less than NumItems - begin - index EditButton to N - index Up to N - index DeleteItem to N - index Editor to N - index ItemNameInput to N - put element N of Items into Item - put property `name` of Item into ItemName - create Row in Table - set the style of Row to `margin-bottom:0.2em` - create Cell in Row - set the style of Cell to `width:100%;display:flex` - create EditButton in Cell - set the style of EditButton to `height:2em;flex:1` - set the text of EditButton to ItemName - if N is 0 - begin - create Empty in Cell - set the style of Empty to `width:1em;margin:0.2em 0 0 0.2em` - end - else - begin - create Link in Cell - create Up in Link - set the style of Up to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of Up to CDN cat `/resources/icon/up.png` - end - create Link in Cell - create DeleteItem in Link - set the style of DeleteItem to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of DeleteItem to CDN cat `/resources/icon/stop.png` - create Editor in Row - set the style of Editor to `margin:0.5em;border:1px solid black;padding:0.2em;display:none` - add 1 to N - end - on click EditButton - begin - if the elements of EditButton is not greater than the index of EditButton stop - put the index of EditButton into SavedIndex - gosub to SaveSelectedItem - put SavedIndex into SelectedItem - put 0 into N - while N is less than NumItems - begin - if N is not SelectedItem - begin - index EditButton to N - set style `background` of EditButton to `#eee` - index Editor to N - set style `display` of Editor to `none` - clear Editor - end - add 1 to N - end - index EditButton to SelectedItem - index ItemNameInput to SelectedItem - index TextArea to SelectedItem - index SaveButton to SelectedItem - index Editor to SelectedItem - if style `display` of Editor is `none` - begin - set style `display` of Editor to `block` - put element SelectedItem of Items into Item - set style `background-color` of EditButton to `lightgray` - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Name` - create ItemNameInput in Row - set the style of ItemNameInput to `flex:1` - set the text of ItemNameInput to property `name` of Item - create TextArea in Editor - set the style of TextArea to `width:100%;max-width:100%;height:20em` - put property `content` of Item into Content - replace `%0a` with newline in Content - set the content of TextArea to Content - create SaveButton in Editor - set the style of SaveButton to `width:100%` - set the text of SaveButton to `Save` - on click SaveButton gosub to SaveSelectedItem - end - else - begin - clear Editor - set style `display` of Editor to `none` - end - end - on click Up - begin - put the index of Up into N - put element N of Items into Item - take 1 from N - put element N of Items into Item2 - set element N of Items to Item - add 1 to N - set element N of Items to Item2 - set property `content` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - on click DeleteItem - begin - put the index of DeleteItem into N - put property `content` of Presentation into Items - json delete element N of Items - set property `content` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - stop - -! Save the selected content -SaveSelectedItem: - if SelectedItem is -1 return - index ItemNameInput to SelectedItem - index EditButton to SelectedItem - put element SelectedItem of Items into Item - set property `name` of Item to the text of ItemNameInput - set the text of EditButton to the text of ItemNameInput - index TextArea to SelectedItem - put the content of TextArea into Content - replace newline with `%0a` in Content - replace `"` with `"` in Content - set property `content` of Item to Content - set element SelectedItem of Items to Item - set property `content` of Presentation to Items - -! Tell the parent to refresh the script - set Message to object - set property `action` of Message to `refresh` - set property `source` of Message to `content` - send Message to parent - return \ No newline at end of file diff --git a/iwsy/resources/ecs/fileman.txt b/iwsy/resources/ecs/fileman.txt deleted file mode 100644 index 57faa60..0000000 --- a/iwsy/resources/ecs/fileman.txt +++ /dev/null @@ -1,305 +0,0 @@ -! File Manager - - script FileManager - - import div Container - - div Panel - div FileListing - div FileRow - div Scroller - div Uploader - div Buttons - div Location - div URLPanel - span UploadStatus - progress UploadProgress - input UploadFile - input URL - button CopyURLButton - button CloseButton - button NewFolderButton - button UploadButton - button DeleteButton - a FileName - img Icon - img Image - variable Mobile - variable FileCount - variable File - variable Name - variable Type - variable Source - variable Content - variable Home - variable UserRecord - variable Email - variable Password - variable AdminPassword - variable CurrentPath - variable FilePath - variable Path - variable N - variable Even - variable IsHome - variable Post - - get IsHome from storage as `.ishome` - get AdminPassword from storage as `.password` - - if portrait - begin - if mobile set Mobile else clear Mobile - end - - create Panel in Container - if Mobile set the style of Panel to `background:#ffe` - else set the style of Panel to `width:100%;height:100%` - - create Uploader in Panel - set the style of Uploader to `width:100%;padding:0.5em 0;font-size:80%;text-align:center` - create UploadFile in Uploader - set the style of UploadFile to `font-family:serif;color:black` - set attribute `type` of UploadFile to `file` - set attribute `name` of UploadFile to `Source` - create UploadStatus in Uploader - set the style of UploadStatus to `font-family:serif;color:black` - create UploadProgress in Uploader - set style `margin-left` of UploadProgress to `0.5em` - set attribute `value` of UploadProgress to 0 - set attribute `max` of UploadProgress to 100 - - create Buttons in Panel - set the style of Buttons to `display:flex;margin-bottom:0.5em` - create UploadButton in Buttons - set the style of UploadButton to `flex:1;width:150px;height:40px;font-family:sans;color:black` - set the text of UploadButton to `Upload` - on click UploadButton go to Upload - create NewFolderButton in Buttons - set the style of NewFolderButton to `flex:1;width:150px;height:40px;font-family:sans;color:black` - set the text of NewFolderButton to `New Folder` - create DeleteButton in Buttons - set the style of DeleteButton to `flex:1;width:150px;height:40px;font-family:sans;color:black` - set the text of DeleteButton to `Delete` - create CloseButton in Buttons - set the style of CloseButton to `flex:1;width:150px;height:40px;font-family:sans;color:black` - set the text of CloseButton to `Close` - on click CloseButton go to Exit - - create FileListing in Panel - set the style of FileListing to `width:100%;height:80%;text-align:center` - create Location in FileListing - set the style of Location to `width:100%;text-align:left;color:black;padding:0 0.5em` - - create URLPanel in FileListing - set the style of URLPanel to `display:none` - create URL in URLPanel - set the style of URL to `flex:1;text-align:left;font-family:sans;color:black;padding:0 0.5em` - create CopyURLButton in URLPanel - set the style of CopyURLButton to `width:8em;margin:0.2em 0.5em 0.2em 1em` - set the text of CopyURLButton to `Copy URL` - set attribute `title` of CopyURLButton to `Copy the URL of this image` - - create Scroller in FileListing - set the style of Scroller to `width:100%;height:100%;text-align:left;overflow-y:scroll;font-family:mono` - create Image in FileListing - set the style of Image to `margin:0 auto;max-width:100%;max-height:100%` - - on click CopyURLButton copy URL - - on click NewFolderButton - begin - put prompt `Name of folder:` with `new` into Path - if Path is empty stop - replace ` ` with `-` in Path - put CurrentPath cat `/` cat Path into Path - rest post to `mkdir/resources/` cat Path or - begin - alert `Failed to create a directory.` - stop - end - goto Browser - end - - on message go to Show - set ready - stop - -Show: - set style `display` of Container to `block` - - if IsHome is `true` - begin - get UserRecord from storage as `.user` - put property `email` of UserRecord into Email - get Password from storage as `user.password` - put property `home` of UserRecord into Home - put `users/` cat Home cat `/` cat property `id` of UserRecord into Home - put Home cat `/images` into Home - end - else put `images` into Home - get CurrentPath from storage as `.filepath` - if CurrentPath is empty put Home into CurrentPath - -! Build the list -Browser: - put CurrentPath into storage as `.filepath` - if IsHome is `true` - begin - rest get Content from `ulist/` cat Email cat `/` cat Password cat `/` cat CurrentPath cat `?v=` cat now - or begin - alert `Failed to list files.` - put empty into storage as `.filepath` - stop - end - end - else - begin - rest get Content from `list/` cat AdminPassword cat `/` cat CurrentPath cat `?v=` cat now - or begin - alert `Failed to list files.` - put empty into storage as `.filepath` - stop - end - end - put CurrentPath into Path - set the content of Location to `Current path: ` cat Path - 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 - clear Scroller - set Even - - if CurrentPath is not Home - begin - create FileRow in Scroller - set the style of FileRow to `width:90%;padding:0.5em 1em;text-align:left` - create Icon in FileRow - set the style of Icon to `float:left;margin-right:0.5em;width:20px` - set attribute `src` of Icon to `/resources/icon/arrow-back.png` - create FileName in FileRow - set the content of FileName to `(back to previous folder)` - on click FileName - begin - put the position of the last `/` in CurrentPath into N - put left N of CurrentPath into CurrentPath - go to Browser - end - end - - set the elements of FileName to FileCount - put 0 into N - while N is less than FileCount - begin - index File to N - put element N of Content into File - put property `name` of File into Name - put property `type` of File into Type - create FileRow in Scroller - set the style of FileRow to `clear:both;padding:0.5em 1em;text-align:left` - if Even set style `background` of FileRow to `#eee` - create Icon in FileRow - set the style of Icon to `float:left;margin-right:0.5em;width:20px` - if Type is `dir` put `folder.png` into Source - else if Type is `img` put `image.png` into Source - else if Type is `txt` put `text.png` into Source - else if Type is `doc` put `document.png` into Source - else put `unknown.png` into Source - set attribute `src` of Icon to `/resources/icon/` cat Source - index FileName to N - create FileName in FileRow - set the content of FileName to Name - on click FileName go to SelectFile - toggle Even - add 1 to N - end - - on click DeleteButton - begin - if FileCount is 0 - begin - put Path into CurrentPath - if IsHome is `true` put `udelete/` cat Email cat `/` cat Password cat `/` cat CurrentPath into Post - else put `delete/` cat AdminPassword cat `/` cat CurrentPath into Post - rest post to Post or - begin - alert `Failed to delete a file.` - stop - end - put the position of the last `/` in CurrentPath into N - put left N of CurrentPath into CurrentPath - go to Browser - end - else - begin - alert `Folder is not empty` - end - end - - stop - -SelectFile: - index File to the index of FileName - put property `type` of File into Type - if Type is `dir` - begin - put CurrentPath cat `/` cat the content of FileName into CurrentPath - goto Browser - end - if Type is `img` - begin - set style `display` of Uploader to `none` - set style `display` of UploadButton to `none` - set style `display` of NewFolderButton to `none` - set style `display` of Location to `none` - set style `display` of URLPanel to `flex` - - set style `display` of Scroller to `none` - set style `display` of Image to `block` - put CurrentPath cat `/` cat property `name` of File into FilePath - set attribute `src` of Image to `/resources/` cat FilePath cat `?v=` cat now - on click CloseButton go to CloseMedia - set the text of URL to `resources/` cat FilePath - on click DeleteButton - begin - if IsHome is `true` put `udelete/` cat Email cat `/` cat Password cat `/` cat FilePath into Post - else put `delete/` cat AdminPassword cat `/` cat FilePath into Post - rest post to Post or - begin - alert `Failed to delete the image.` - stop - end - go to CloseMedia - end - end - stop - -CloseMedia: - set style `display` of Image to `none` - set style `display` of Scroller to `block` - set style `display` of Uploader to `inline-block` - set style `display` of UploadButton to `inline-block` - set style `display` of NewFolderButton to `inline-block` - set the content of Location to `Current path: ` cat CurrentPath - set style `display` of Location to `block` - set style `display` of URLPanel to `none` - on click CloseButton go to Exit - go to Browser - -Upload: - if UploadFile is empty alert `Please choose a file to upload` - else - begin - put CurrentPath into Path - if IsHome is `true` put `uupload/` cat Email cat `/` cat Password cat `/` cat Path into Path - else put `upload/` cat AdminPassword cat `/` cat Path into Path - upload UploadFile to Path with UploadProgress and UploadStatus - goto Browser - end - stop - -Exit: - set style `display` of Container to `none` - stop \ No newline at end of file diff --git a/iwsy/resources/ecs/help.txt b/iwsy/resources/ecs/help.txt deleted file mode 100644 index 1907e49..0000000 --- a/iwsy/resources/ecs/help.txt +++ /dev/null @@ -1,193 +0,0 @@ -! Help Manager - - script HelpManager - - import div Container - - div Player - callback DecoratorCallback - a Link - variable Mobile - variable Page - variable Content - variable Payload - variable ImageCount - variable LinkCount - variable HasEmbed - variable Embed - variable Function - variable Data - variable Source - variable Style - variable Item - variable Len - variable N - variable IsHome - variable CDN - - get IsHome from storage as `.ishome` - get CDN from storage as `.cdn` - - if portrait - begin - if mobile set Mobile else clear Mobile - end - - set style `position` of Container to `relative` - set style `padding` of Container to `0 1em` - set style `overflow-y` of Container to `scroll` - - load showdown - on DecoratorCallback go to Decorate - - on message - begin - if the message is `stop` - begin - if HasEmbed iwsy stop - end - else go to Show - end - set ready - stop - -Show: - set style `display` of Container to `block` - get Page from storage as `.help` -GetPage: - clear HasEmbed - if Page is empty - begin - put `iwsy` into Page - put Page into storage as `.help` - end - put 0 into ImageCount - put 0 into LinkCount - iwsy remove styles - rest get Content from CDN cat `/resources/help/` cat Page cat `.md?v=` cat now - or begin - put empty into Page - go to GetPage - end - put Page into storage as `.help` - set the content of Container to showdown decode Content with DecoratorCallback - scroll Container to 0 - set the elements of Link to LinkCount - put 0 into N - while N is less than LinkCount - begin - index Link to N - attach Link to `ec-link-` cat N - add 1 to N - end - on click Link - begin - if HasEmbed iwsy stop - put attribute `data-page` of Link into Page - go to GetPage - end - if HasEmbed - begin - attach Player to `iwsy-embed` - put attribute `data-url` of Player into Data - rest get Embed from Data cat `?v=` cat now - put the position of the last `/` in Data into N - add 1 to N - put left N of Data into Data - iwsy load Player Embed - iwsy path Data - iwsy run - end - stop - -!------------------------------------------------------------------------------ -! This is the Showdown extension. - -! Decorate is called for every occurrence of ~...~ in the topic data -Decorate: - put the payload of DecoratorCallback into Payload - if Payload is `iwsy` put `` into Payload - else if Payload is `clear` put `
` into Payload - else - begin - put the position of `:` in Payload into N - if N is greater than 0 - begin - put left N of Payload into Function - add 1 to N - put from N of Payload into Data - if Function is `m` - put `` cat Data cat `` into Payload - else if Function is `img` gosub to ProcessImage - else if Function is `page` gosub to ProcessPage - else if Function is `embed` gosub to ProcessEmbed - end - end - set the payload of DecoratorCallback to Payload - stop - -! Process an image, including positioning and class information -ProcessImage: - put the position of `|` in Data into N - if N is -1 - begin - put `` into Payload - add 1 to ImageCount - return - end - put left N of Data into Source - add 1 to N - put from N of Data into Data - json split Data on `,` into Data - put empty into Style - put 0 into N - while N is less than the json count of Data - begin - put element N of Data into Item - if Item is `left` put Style cat `float:left;` into Style - else if Item is `right` put Style cat `float:right;` into Style - else if Item is `center` put Style cat `margin:0 auto;` into Style - else if Item is `border` put Style cat `padding:2px;border:1px solid black;` into Style - else if Item is `clear` put Style cat `clear:both;` into Style - else if Item is `icon` put Style cat `height:0.9em;position:relative;top:0.05em` into Style - else if right 1 of Item is `%` put Style cat `width:` cat Item cat `;` into Style - else - begin - if left 1 of Item is not `{` go to NextItem - if right 1 of Item is not `}` go to NextItem - put from 1 of Item into Item - put the length of Item into Len - take 1 from Len - put left Len of Item into Item - put Style cat Item cat `;` into Style - end - NextItem: - add 1 to N - end - put `` into Payload - add 1 to ImageCount - return - -! Process a request for a new page -ProcessPage: - put the position of `:` in Data into N - if N is -1 return - put left N of Data into Page - add 1 to N - put from N of Data into Data - put `` cat Data cat `` into Payload - add 1 to LinkCount - return - -! Process a request for an embedded presentation -ProcessEmbed: - put `
` into Payload - set HasEmbed - return - -Exit: - set style `display` of Container to `none` - stop \ No newline at end of file diff --git a/iwsy/resources/ecs/iwsy.txt b/iwsy/resources/ecs/iwsy.txt deleted file mode 100644 index 40665b2..0000000 --- a/iwsy/resources/ecs/iwsy.txt +++ /dev/null @@ -1,1050 +0,0 @@ -! IWSY - - script IWSY - - div Body - div Left - div Right - div Masthead - div Title - div Subtitle - div Controls - div ContentDiv - div Buttons - div Tabs - div StepsPanel - div BlocksPanel - div ContentPanel - div VFXPanel - div JSONPanel - div Player - div UserPanel - div FileManPanel - div HelpPanel - div Mask - table Table - tr TR - td TD - input Status - input ScriptName - button SectionButton - img New - img Open - img Save - img RunStop - img FullScreen - img Delete - img User - img FileMan - img Help - img Gear - img FSPrompt - a Link - module StepsModule - module BlocksModule - module ContentModule - module VFXModule - module JSONModule - module UserModule - module FileManModule - module HelpModule - variable Mobile - variable Resources - variable CDN - variable LastSavedState - variable Content - variable Script - variable Presentation - variable OriginalPresentation - variable Name - variable AdminPassword - variable Valid - variable Static - variable CallStack - variable Message - variable Section - variable Item - variable CurrentScriptName - variable Action - variable Running - variable UserRecord - variable UserHome - variable UserEmail - variable UserPassword - variable IsHome - variable Args - variable Protocol - variable Domain - variable Arg - variable N - - ! The browser - div Overlay - div Scroller - div Media - div FileListing - div FileRow - div LowerPanel - button CloseButton - a FileName - variable Alpha - variable FileList - variable FileCount - variable File - variable Files - variable FileIsOpen - - clear styles - clear body - - rest path `/rest.php` - - json parse url the location as Args - put property `protocol` of Args into Protocol - put property `domain` of Args into Domain - - put `https://easycoder.github.io/iwsy` into CDN -! Test if site is on a static host - clear Static - rest get Item from Protocol cat Domain cat `/rest.php/test` - or begin - print `Static website` - set Static - clear IsHome - go to Start - end - - if Domain is `iwannashowyou.com` set IsHome else clear IsHome - -! Not static, so see if the launcher has provided a CDN - get Item from storage as `.cdn` - if Item is not empty put Item into CDN - -! If the debug flag is set use admin storage but local CDN - get Item from storage as `.debug` - if Item is `true` set Static - -Start: - iwsy init CDN - put Static into storage as `.static` - put IsHome into storage as `.ishome` - put CDN into storage as `.cdn` - put empty into CallStack - history set - on restore - begin - put the json count of CallStack into N - end - if portrait - begin - if mobile set Mobile else clear Mobile - end - - put empty into storage as `.user` - - set the title to `IWSY` - create Body - set the style of Body to `width:100%;height:100%;position:relative` - if not Mobile set style `display` of Body to `flex` - -! The left-hand panel - create Left in Body - set the style of Left to `flex:1;height:100%;border-right:1px solid black;margin-right:0.5em;` - cat `display:flex;flex-direction:column;max-width:50%` - - create Masthead in Left - set the style of Masthead to - `border:0.2em solid purple;text-align:center;color:lemonchiffon;background:darkmagenta;position:relative` - create Title in Masthead - set the style of Title to `font-size:4em;font-weight:bold` - set the content of Title to `I Wanna Show You` - create Subtitle in Masthead - set the style of Subtitle to - `position:relative;top:-0.5em;font-size:1.5em;font-weight:bold;font-style:italic` - set the content of Subtitle to `powerful web-based presentations` - - create Controls in Left - set the style of Controls to `padding:0 0.5em` - - create Buttons in Controls - set the style of Buttons to `width:100%;padding:0.5em 0;position:relative` - - create Table in Controls - 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 `Script name` - - create TD in TR - set the style of TD to `width:8em` - create ScriptName in TD - set the style of ScriptName to `width:100%` - - create TD in TR - set the style of TD to `width:2em;text-align:center` - create Link in TD - create Gear in Link - set the style of Gear to `height:1em` - set attribute `src` of Gear to CDN cat `/resources/icon/gear.png` - set attribute `title` of Gear to `Settings & Information` - - create TD in TR - set the style of TD to `color:green` - create Status in TD - set the style of Status to `width:100%;text-align:right;padding-right:0.5em` - set attribute `readonly` of Status to `readonly` - - create Link in Buttons - create New in Link - set the style of New to `width:40px;margin-right:0.5em` - set attribute `src` of New to CDN cat `/resources/icon/new.png` - set attribute `title` of New to `New` - create Link in Buttons - create Open in Link - set the style of Open to `width:40px;margin-right:0.5em` - set attribute `src` of Open to CDN cat `/resources/icon/open.png` - set attribute `title` of Open to `Open` - create Link in Buttons - create Save in Link - set the style of Save to `width:40px;margin-right:1.5em` - set attribute `src` of Save to CDN cat `/resources/icon/save.png` - set attribute `title` of Save to `Save` - create Link in Buttons - create Delete in Link - set the style of Delete to `width:40px;margin-right:1.5em` - set attribute `src` of Delete to CDN cat `/resources/icon/trash.png` - set attribute `title` of Delete to `Delete` - if not Static - begin - create Link in Buttons - create FileMan in Link - set the style of FileMan to `width:40px;margin-right:1.5em` - set attribute `src` of FileMan to CDN cat `/resources/icon/fileman.png` - set attribute `title` of FileMan to `File Manager` - end - create Link in Buttons - create RunStop in Link - set the style of RunStop to `width:40px;margin-right:0.5em` - set attribute `src` of RunStop to CDN cat `/resources/icon/run.png` - set attribute `title` of RunStop to `Run` - create Link in Buttons - create FullScreen in Link - set the style of FullScreen to `width:40px;margin-right:1.5em` - set attribute `src` of FullScreen to CDN cat `/resources/icon/fullscreen.png` - set attribute `title` of FullScreen to `Run full-screen` - create Link in Buttons - create Help in Link - set the style of Help to `width:40px;margin-right:1.5em` - set attribute `src` of Help to CDN cat `/resources/icon/help.png` - set attribute `title` of Help to `Help` - if IsHome - begin - create Link in Buttons - create User in Link - set the style of User to `width:40px;position:absolute;top:0.5em;right:0.5em` - set attribute `src` of User to CDN cat `/resources/icon/user.png` - set attribute `title` of User to `Login` - on click User go to DoUser - end - - create Player in Left - set the style of Player to `margin:0.5em` - - create FileManPanel in Left - set the style of FileManPanel to `flex:1;display:none;margin-top:0.5em;border-top:1px solid black` - - create HelpPanel in Left - set the style of HelpPanel to `flex:1;display:none;margin-top:0.5em;border-top:1px solid black;overflow:scroll` - -! The right-hand panel - create Right in Body - set the style of Right to `flex:1;height:100%;display:flex;flex-direction:column;overflow:hidden` - - create ContentDiv in Right - set the style of ContentDiv to `width:100%;height:100%;position:relative` - - create Tabs in ContentDiv - set the style of Tabs to `width:100%;padding:0.5em 0;text-align:center;display:flex` - set the elements of SectionButton to 5 - - index SectionButton to 0 - create SectionButton in Tabs - set the style of SectionButton to `flex:1;background-color:lightgray;margin-right:0.2em` - set the content of SectionButton to `Steps` - set attribute `title` of SectionButton to `Show the Steps manager` - create StepsPanel in ContentDiv - set the style of StepsPanel to `position:absolute;left:0;top:2.5em;width:100%;height:calc(100% - 2.5em)` - - index SectionButton to 1 - create SectionButton in Tabs - set the style of SectionButton to `flex:1;background-color:#eee;margin-right:0.2em` - set the content of SectionButton to `Blocks` - set attribute `title` of SectionButton to `Show the Blocks manager` - create BlocksPanel in ContentDiv - set the style of BlocksPanel to `position:absolute;left:0;top:2.5em;width:100%;height:calc(100% - 2.5em)` - - index SectionButton to 2 - create SectionButton in Tabs - set the style of SectionButton to `flex:1;background-color:#eee;margin-right:0.2em` - set the content of SectionButton to `Content` - set attribute `title` of SectionButton to `Show the Content manager` - create ContentPanel in ContentDiv - set the style of ContentPanel to `position:absolute;left:0;top:2.5em;width:100%;height:calc(100% - 2.5em)` - - index SectionButton to 3 - create SectionButton in Tabs - set the style of SectionButton to `flex:1;background-color:#eee;margin-right:0.2em` - set the content of SectionButton to `VFX` - set attribute `title` of SectionButton to `Show the VFX manager` - create VFXPanel in ContentDiv - set the style of VFXPanel to `position:absolute;left:0;top:2.5em;width:100%;height:calc(100% - 2.5em)` - - index SectionButton to 4 - create SectionButton in Tabs - set the style of SectionButton to `flex:1;background-color:#eee` - set the content of SectionButton to `JSON` - set attribute `title` of SectionButton to `Import and Export` - create JSONPanel in ContentDiv - set the style of JSONPanel to `position:absolute;left:0;top:2.5em;width:100%;height:calc(100% - 2.5em)` - - put 0 into Section - index SectionButton to 0 - on click SectionButton - begin - put the index of SectionButton into N - gosub to SelectSection - end - -! Create the file browser - 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 LowerPanel in FileListing - - create CloseButton in LowerPanel - set the style of CloseButton to `margin-left:2em` - set the text of CloseButton to `Close` - - put empty into LastSavedState - put empty into UserRecord - put empty into storage as `user.home` - - on click New - begin - if Presentation is not LastSavedState - begin - if confirm `Content has changed. Do you want to save it?` - begin - put the content of ScriptName into Name - if Name is empty - begin - gosub to SetStatusRed - set the text of Status to `No script name has been given` - go to ResetStatus - end - if UserRecord gosub to SavePresentation - else put Presentation into storage as Name - end - end - clear FileIsOpen - clear Player - clear Running - iwsy stop - set attribute `src` of RunStop to CDN cat `/resources/icon/run.png` - set the content of ScriptName to empty - put empty into CurrentScriptName - gosub to CreateNewPresentation - iwsy script Presentation - put Presentation into LastSavedState - gosub to UpdateCurrentSection - end - - on click Open go to DoOpen - - on click Save - begin - gosub to SaveChanges - put the content of ScriptName into Name - if Name is empty - begin - gosub to SetStatusRed - set the text of Status to `No script name has been given` - go to ResetStatus - end - if the position of `.json` in Name is -1 put Name cat `.json` into Name - replace ` ` with `_` in Name - set the content of ScriptName to Name - if Name is not CurrentScriptName put empty into LastSavedState - if Presentation is not LastSavedState - begin - gosub to SavePresentation - put Presentation into LastSavedState - gosub to SetStatusGreen - set the text of Status to `Presentation '` cat Name cat `' saved` - put Name into CurrentScriptName - fork to ResetStatus - end - else - begin - gosub to SetStatusGreen - set the text of Status to `Nothing has changed` - fork to ResetStatus - end - end - - on click Delete - begin - put the content of ScriptName into Name - if Name is empty - begin - gosub to SetStatusGreen - set the text of Status to `Nothing to delete` - go to ResetStatus - end - if confirm `Are you sure you want to delete "` cat Name cat `"?` gosub to DeletePresentation - end - - on click Gear - begin - if CurrentScriptName - begin - gosub to SetStatusGreen - set the text of Status to Protocol cat Domain cat `?` cat UserHome cat `/scripts/` cat CurrentScriptName - set attribute `title` of Status to `Click text to copy to clipboard` - on click Status - begin - copy Status - on click Status stop - set the text of Status to `Address copied` - go to ResetStatus - end - end - end - - on click FileMan - begin - gosub to CheckAdminPassword - if AdminPassword is empty stop - if Running stop - if Static stop - if FileManModule is not running - begin - print `Load FileMan module` - print CDN - rest get Script from CDN cat `/resources/ecs/fileman.txt?v=` cat now - run Script with FileManPanel as FileManModule - end - set style `display` of Player to `none` - set style `display` of HelpPanel to `none` - if HelpModule is running send `stop` to HelpModule - set style `display` of FileManPanel to `block` - send to FileManModule - end - - on click Help go to ShowHelp - on click RunStop go to DoRunStop - on click FullScreen go to RunFullScreen - - gosub to CreateNewPresentation - put Presentation into LastSavedState - gosub to SetupSteps - gosub to SetupBlocks - gosub to SetupContent - gosub to SetupVFX - gosub to SetupJSON - put 0 into N - gosub to SelectSection - clear Running - iwsy load Player Presentation - - create UserPanel in Controls - if IsHome - begin - rest get Script from CDN cat `/resources/ecs/user.txt?v=` cat now - run Script with UserPanel as UserModule - send to UserModule - end - - on message - begin - put the message into Message - put property `action` of Message into Action - if Action is `goto` - begin - if not Running iwsy goto property `index` of Message - end - else if Action is `refresh` - begin - iwsy script Presentation - set style `display` of StepsPanel to `none` - set style `display` of BlocksPanel to `none` - set style `display` of ContentPanel to `none` - if Section is 0 set style `display` of StepsPanel to `block` - else if Section is 1 set style `display` of BlocksPanel to `block` - else if Section is 2 set style `display` of ContentPanel to `block` - end - else if Action is `block` - begin - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `none` - if HelpModule is running send `stop` to HelpModule - set style `display` of Player to `block` - put property `block` of Message into N - iwsy block N - end - else if Action is `user` - begin - put property `user` of Message into UserRecord - put UserRecord into storage as `.user` - put property `home` of UserRecord into UserHome - put UserHome cat `/` cat property `id` of UserRecord into UserHome - put UserHome into storage as `user.home` -! iwsy path Resources cat `/users/` cat UserHome cat `/scripts/` - put property `email` of UserRecord into UserEmail - get UserPassword from storage as `user.password` - set attribute `src` of User to CDN cat `/resources/icon/user-loggedin.png` - set attribute `title` of User to `Logged in as ` cat property `name` of UserRecord - gosub to SetStatusGreen - set the text of Status to `Logged in as '` cat Name cat property `name` of UserRecord cat `'` - fork to ResetStatus - end - else if Action is `panzoom` - begin - set style `display` of Player to `block` - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `none` - iwsy panzoom property `item` of Message - end - end - - wait 10 ticks - - put property `arg` of Args into Arg - if Arg includes `.json` - begin - rest get Presentation from Protocol cat Domain cat `/` cat Resources cat `/users/` cat Arg cat `?v=` cat now - gosub to NotifyModules - iwsy script Presentation - set style `display` of Player to `block` - create Mask in Body - set the style of Mask to `position:absolute;top:0;left:0;width:100%;height:100%;background:black` - create FSPrompt in Mask - set the style of FSPrompt to - `width:50%;height:50%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)` - set attribute `src` of FSPrompt to CDN cat `/resources/img/fullscreen.png` - on click FSPrompt go to FullScreenManual - on key - begin - if the key is `Enter` go to FullScreenAuto - else if the key is `ArrowRight` go to FullScreenManual - else if the key is ` ` go to FullScreenManual - end - end - else - begin - put empty into Arg - get Item from storage as `alreadyrun` - if Item is empty fork to ShowHelp - end - - stop - -CheckAdminPassword: - get AdminPassword from storage as `.password` - if AdminPassword is empty put prompt `Please type the admin password` with `` into AdminPassword - rest get Valid from `verify/` cat AdminPassword - or begin - alert `Unable to verify password.` - put empty into storage as `.password` - end - if Valid is `yes` put AdminPassword into storage as `.password` - return - -DoUser: - if UserRecord - begin - put empty into UserRecord - put empty into storage as `.user` - set attribute `src` of User to CDN cat `/resources/icon/user.png` - set attribute `title` of User to `Login` - gosub to SetStatusRed - set the text of Status to `Not logged in` - put empty into storage as `user.email` - put empty into storage as `user.password` - go to ResetStatus - end - else send `login` to UserModule - stop - -FullScreenAuto: - remove element Mask - iwsy run fullscreen auto then - begin - clear Running - on click FSPrompt stop - on key stop - end - set Running - stop - -FullScreenManual: - remove element Mask - iwsy run fullscreen manual then - begin - clear Running - on click FSPrompt stop - on key stop - end - set Running - stop - -ShowHelp: - if Running stop - if HelpModule is running send `stop` to HelpModule - else - begin - require js - `https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/showdown.js?v=` cat now - rest get Script from CDN cat `/resources/ecs/help.txt?v=` cat now - run Script with HelpPanel as HelpModule - end - set style `display` of Player to `none` - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `block` - send to HelpModule - stop - -SavePresentation: - put Presentation into Content - json format Content - if Static go to SaveToStorage - if UserRecord go to SaveToUser - if IsHome go to SaveToStorage - gosub to CheckAdminPassword - if AdminPassword is empty return - rest post Content to `save/` cat AdminPassword cat `/scripts/` cat Name - return - -SaveToUser: - rest post Content to `usave/` cat UserEmail cat `/` cat UserPassword cat `/` - cat `users/` cat UserHome cat `/scripts/` cat Name - return - -SaveToStorage: - put Presentation into storage as Name - return - -DeletePresentation: - if Static go to DeleteFromStorage - if UserRecord go to DeleteFromUser - if IsHome go to DeleteFromStorage - gosub to CheckAdminPassword - if AdminPassword is empty return - rest post Content to `delete/` cat AdminPassword cat `/scripts/` cat Name - return - -DeleteFromUser: - rest post Content to `udelete/` cat UserEmail cat `/` cat UserPassword cat `/` - cat `users/` cat UserHome cat `/scripts/` cat Name - return - -DeleteFromStorage: - remove Name from storage - return - -CreateNewPresentation: - set Presentation to object - set Content to object - set property `title` of Content to `Init` - set property `action` of Content to `init` - set property `label` of Content to `` - set property `aspect ratio` of Content to `16:9` - set property `background` of Content to `` - set property `border` of Content to `1px solid black` - set Item to array - json add Content to Item - set property `steps` of Presentation to Item - set Item to array - set property `blocks` of Presentation to Item - set property `content` of Presentation to Item - set property `vfx` of Presentation to Item - json format Presentation - return - -SetupSteps: - if StepsModule is not running - begin - print `Load Steps module` - rest get Script from CDN cat `/resources/ecs/steps.txt?v=` cat now - run Script with StepsPanel and Presentation as StepsModule - end - return - -SetupBlocks: - if BlocksModule is not running - begin - print `Load Blocks module` - rest get Script from CDN cat `/resources/ecs/blocks.txt?v=` cat now - run Script with BlocksPanel and Presentation as BlocksModule - end - return - -SetupContent: - if ContentModule is not running - begin - print `Load Content module` - rest get Script from CDN cat `/resources/ecs/content.txt?v=` cat now - run Script with ContentPanel and Presentation as ContentModule - end - return - -SetupVFX: - if VFXModule is not running - begin - print `Load VFX module` - rest get Script from CDN cat `/resources/ecs/vfx.txt?v=` cat now - run Script with VFXPanel and Presentation as VFXModule - end - return - -SetupJSON: - if JSONModule is not running - begin - print `Load JSON module` - rest get Script from CDN cat `/resources/ecs/json.txt?v=` cat now - run Script with JSONPanel and Presentation as JSONModule - end - return - -! Select one of the sections -SelectSection: - if Running return - gosub to SaveChanges - index SectionButton to Section - set style `background-color` of SectionButton to `#eee` - put N into Section - index SectionButton to Section - set style `background-color` of SectionButton to `lightgray` - -! Update the current section -UpdateCurrentSection: - set style `display` of StepsPanel to `none` - set style `display` of BlocksPanel to `none` - set style `display` of ContentPanel to `none` - set style `display` of VFXPanel to `none` - set style `display` of JSONPanel to `none` - if Section is 0 - begin - set style `display` of StepsPanel to `block` - send to StepsModule - end - else if Section is 1 - begin - set style `display` of BlocksPanel to `block` - send to BlocksModule - end - else if Section is 2 - begin - set style `display` of ContentPanel to `block` - send to ContentModule - end - else if Section is 3 - begin - set style `display` of VFXPanel to `block` - send to VFXModule - end - else if Section is 4 - begin - set style `display` of JSONPanel to `block` - send to JSONModule - end - return - -SaveChanges: - if Running gosub to StopRun - send `save` to StepsModule - send `save` to BlocksModule - send `save` to ContentModule - send `save` to VFXModule - send `save` to JSONModule - return - -DoOpen: - clear FileIsOpen - if Presentation is not LastSavedState - begin - if confirm `Content has changed. Do you want to save it?` - begin - if UserRecord gosub to SavePresentation - else put Content into storage as Name - 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 - if Static go to OpenFromStorage - if UserRecord go to OpenFromUser - if IsHome go to OpenFromStorage - - gosub to CheckAdminPassword - if AdminPassword is empty stop - rest get Files from `list/` cat AdminPassword cat `/scripts?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 `json` json add property `name` of Item to Content - add 1 to N - end - go to ProcessFiles - -OpenFromUser: - rest get Files from `ulist/` cat UserEmail cat `/` cat UserPassword cat `/` - cat `users/` cat UserHome cat `/scripts?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 `json` json add property `name` of Item to Content - add 1 to N - end - go to ProcessFiles - -OpenFromStorage: - get Files from storage - 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 left 1 of Item is not `.` - begin - if the position of `.json` in Item is not -1 json add Item to Content - end - add 1 to N - end - go to ProcessFiles - -ProcessFiles: - 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 0 into N - while N is less than FileCount - begin - index File to N - index FileName to N - put `
` - cat `
` 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 - 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 LastSavedState into Content - go to CloseBrowser - end - stop - -SelectFile: - index File to the index of FileName - set the content of ScriptName to File - put File into CurrentScriptName - - if Static go to SelectFromStorage - if UserRecord go to SelectFromUser - if IsHome go to SelectFromStorage - - rest get Presentation from Protocol cat Domain cat `/resources/scripts/` cat File cat `?v=` cat now - go to UseFile - -SelectFromUser: - if UserRecord rest get Presentation from - Protocol cat Domain cat `/resources/users/` cat UserHome cat `/scripts/` cat File cat `?v=` cat now - go to UseFile - -SelectFromStorage: - get Presentation from storage as File - -UseFile: - gosub to NotifyModules - json format Presentation - put Presentation into LastSavedState - gosub to UpdateCurrentSection - gosub to SetStatusGreen - set the text of Status to `Presentation '` cat File cat `' loaded` - fork to ResetStatus - clear Running - set attribute `src` of RunStop to CDN cat `/resources/icon/run.png` - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `none` - if HelpModule is running send `stop` to HelpModule - set style `display` of Player to `block` - iwsy script Presentation - -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` - stop - -SetStatusRed: - set style `color` of Status to `red` - return - -SetStatusGreen: - set style `color` of Status to `green` - return - -ResetStatus: - wait 2 - set the text of Status to `` - set attribute `title` of Status to `` - stop - -StopRun: - iwsy stop - clear Running - gosub to ClearStepsButtons - set attribute `src` of RunStop to CDN cat `/resources/icon/run.png` - return - -DoRunStop: - if Running gosub to StopRun - else - begin - put property `steps` of Presentation into Item - if the json count of Item is 1 stop - if HelpModule is running send `stop` to HelpModule - set style `display` of Player to `block` - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `none` - gosub to ClearStepsButtons - set attribute `src` of RunStop to CDN cat `/resources/icon/runstop.png` - - put 0 into N - gosub to SelectSection - set Running - - iwsy onstep - begin - put the iwsy step into N - if N is -1 - begin - put the iwsy script into Presentation - go to PrepareScript - end - else - begin - set Message to object - set property `action` of Message to `step` - set property `step` of Message to N - send Message to StepsModule - end - end - - put Presentation into OriginalPresentation - set style `display` of HelpPanel to `none` - if HelpModule is running send `stop` to HelpModule - set Message to object - set property `action` of Message to `running` - send Message to StepsModule - iwsy run then - begin - gosub to ClearStepsButtons - set attribute `src` of RunStop to CDN cat `/resources/icon/run.png` - clear Running - put OriginalPresentation into Presentation - go to PrepareScript - end - end - stop - -PrepareScript: - gosub to NotifyModules - put Presentation into LastSavedState - gosub to UpdateCurrentSection - stop - -NotifyModules: - send to StepsModule - send to BlocksModule - send to ContentModule - send to VFXModule - send to JSONModule - return - -RunFullScreen: - put property `steps` of Presentation into Item - if the json count of Item is 1 stop - if HelpModule is running send `stop` to HelpModule - set style `display` of Player to `block` - set style `display` of FileManPanel to `none` - set style `display` of HelpPanel to `none` - iwsy init CDN - iwsy script Presentation - if Running iwsy stop - else iwsy run fullscreen - toggle Running - stop - -ClearStepsButtons: - set Message to object - set property `action` of Message to `clear` - send Message to StepsModule - return diff --git a/iwsy/resources/ecs/json.txt b/iwsy/resources/ecs/json.txt deleted file mode 100644 index 3c013fc..0000000 --- a/iwsy/resources/ecs/json.txt +++ /dev/null @@ -1,110 +0,0 @@ -! JSON - - script JSON - - import div Container and variable Presentation - - div Panel - div Row - select SectionSelector - textarea Script - button SaveButton - variable Sections - variable Section - variable Content - variable LastSaved - - set Sections to array - json add `All` to Sections - json add `Steps` to Sections - json add `Blocks` to Sections - json add `Content` to Sections - json add `VFX` to Sections - - on message go to Start - set ready - stop - -Start: - if the message is `save` - begin - stop - end - - clear Container - create Panel in Container - set the style of Panel to `height:100%;display:flex;flex-direction:column` - - create Row in Panel - set the style of Row to `font-size:1.2em;font-weight:bold;margin-bottom:0.2em` - set the content of Row to `Section: ` - - create SectionSelector in Row - set the style of SectionSelector to `height:1.5em` - set SectionSelector from Sections as `All` - on change SectionSelector - begin - if Script is not LastSaved - begin - if confirm `Content has changed. Do you want to save it?` - begin - if Section set property Section of Presentation to Script - else put Script into Presentation - end - end - if SectionSelector is `All` - begin - put empty into Section - put Presentation into Content - go to SS2 - end - else if SectionSelector is `Steps` - begin - put `steps` into Section - go to SelectSection - end - else if SectionSelector is `Blocks` - begin - put `blocks` into Section - go to SelectSection - end - else if SectionSelector is `Content` - begin - put `content` into Section - go to SelectSection - end - else if SectionSelector is `VFX` - begin - put `vfx` into Section - go to SelectSection - end - end - - create Script in Panel - set the style of Script to `flex:1;width:100%` - - set the content of Script to Presentation - put Presentation into LastSaved - - create SaveButton in Panel - set the style of SaveButton to `display:block;width:100%` - set the text of SaveButton to `Save` - on click SaveButton - begin - if Section set property Section of Presentation to Script - else put Script into Presentation - put Script into LastSaved - json format Presentation - end - - put empty into Section - put Presentation into Content - go to SS2 - -SelectSection: - put property Section of Presentation into Content -SS2: - json format Content - put Content into LastSaved - set the content of Script to Content - stop \ No newline at end of file diff --git a/iwsy/resources/ecs/scripted.txt b/iwsy/resources/ecs/scripted.txt deleted file mode 100644 index d47c00e..0000000 --- a/iwsy/resources/ecs/scripted.txt +++ /dev/null @@ -1,280 +0,0 @@ -! 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 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 - - rest path `rest.php` - - 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: ` - 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/` cat Password cat `/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/` cat Password cat `/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/` cat Password cat `/ecs/' cat CurrentName - codemirror attach to ContentEditor - codemirror set content of ContentEditor to Content - end - else - begin - codemirror attach to ContentEditor - codemirror set content of ContentEditor to Content - stop - 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/` cat Password cat `/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 `
` - cat `
` 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 \ No newline at end of file diff --git a/iwsy/resources/ecs/steps.txt b/iwsy/resources/ecs/steps.txt deleted file mode 100644 index e94c1e1..0000000 --- a/iwsy/resources/ecs/steps.txt +++ /dev/null @@ -1,1215 +0,0 @@ -! Steps - - script Steps - - import div Container and variable Presentation - - div Panel - div StepsPanel - div BlockTable - div BlockRow - div BlockData - div Row - div Row1 - div Cell - div Editor - div Title - div Empty - hr HR - button StepButton - button Header - button InsertBefore - button Save - button InsertAfter - table Table - tr TR - td TD - select ActionSelect - select DisplaySelect - select BlockSelect - select ContentSelect - select TargetSelect - select ContinueSelect - select ChainSelect - input InitInput - input TitleInput - input LabelInput - input DurationInput - input TargetInput - input URLInput - textarea InitCSS - img AddStep - img Up - img UpContent - img PlusIcon - img DeleteContent - img DeleteStep - img ShowStep - a Link - variable Static - variable IsHome - variable CDN - variable Steps - variable Step - variable Step2 - variable SelectedStep - variable CurrentStep - variable Action - variable Blocks - variable Block - variable Defaults - variable Contents - variable Content - variable Target - variable Duration - variable URL - variable Names - variable Name - variable Name2 - variable Item - variable Mode - variable ActionNames - variable InitProperties - variable InitProperty - variable BlockNames - variable ContentNames - variable DisplayTypes - variable ContinueTypes - variable ChainNames - variable Options - variable Response - variable Message - variable Running - variable SavedIndex - variable TargetText - variable Email - variable Password - variable AdminPassword - variable Valid - variable UserHome - variable Files - variable FileCount - variable UserRecord - variable N - variable B - - put -1 into SelectedStep - - get Static from storage as `.static` - get IsHome from storage as `.ishome` - get CDN from storage as `.cdn` - - clear Container - create Panel in Container - set the style of Panel to `width:100%;height:100%;display:flex;flex-direction:column` - create StepsPanel in Panel - set the style of StepsPanel to `flex:1;overflow-y:scroll` - - on message go to Start - set ready - stop - -Start: - if the message is empty go to Start2 - - put the message into Message - gosub to SetupArrays - if Message is `save` - begin - if SelectedStep is not -1 - begin - gosub to SaveCurrentStep - put -1 into SelectedStep - end - stop - end - if property `action` of Message is `clear` - begin - clear Running - put 0 into N - while N is less than the elements of StepButton - begin - index StepButton to N - set style `background-color` of StepButton to `#eee` - add 1 to N - end - stop - end - if property `action` of Message is `running` - begin - set Running - stop - end - if property `action` of Message is `step` - begin - put property `step` of Message into N - if N is less than the json count of Steps - begin - index StepButton to N - set style `background-color` of StepButton to `#cfc` - end - stop - end - -Start2: - gosub to SetupArrays - set style `display` of Panel to `flex` - set style `flex-direction` of Panel to `column` - clear StepsPanel - create Row in StepsPanel - set the style of Row to `display:flex` - create Title in Row - set the style of Title to - `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em` - set the content of Title to `Steps` - create Cell in Row - set the style of Cell to `width:1.4em;text-align:center` - create Link in Cell - create AddStep in Link - set the style of AddStep to `width:1em;margin-top:0.1em` - set attribute `src` of AddStep to CDN cat `/resources/icon/plus.png` - on click AddStep go to AddNewStep - - gosub to SetupArrays - put 0 into N - while N is less than the json count of Steps - begin - index StepButton to N - create Row in StepsPanel - set the style of Row to `width:100%` - create Row1 in Row - set the style of Row1 to `display:flex;margin-bottom:0.2em` - create Cell in Row1 - set the style of Cell to `width:1.4em;text-align:center` - create Link in Cell - index ShowStep to N - create ShowStep in Link - set the style of ShowStep to `width:1em;margin-top:0.1em` - set attribute `src` of ShowStep to CDN cat `/resources//icon/binoculars.png` - create StepButton in Row1 - set the style of StepButton to `flex:1` - put element N of Steps into CurrentStep - set the text of StepButton to property `title` of CurrentStep - create Cell in Row1 - if N is less than 2 - begin - create Empty in Cell - set the style of Empty to `width:1em;margin:0.2em 0 0 0.2em` - end - else - begin - create Link in Cell - index Up to N - create Up in Link - set the style of Up to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of Up to `/resources/icon/up.png` - end - create Cell in Row1 - if N is 0 - begin - create Empty in Cell - set the style of Empty to `width:1.4em;margin-top:0.1em` - end - else - begin - set the style of Cell to `width:1.4em;text-align:center` - index DeleteStep to N - create Link in Cell - create DeleteStep in Link - set the style of DeleteStep to `width:1em;margin-top:0.1em` - set attribute `src` of DeleteStep to `/resources/icon/stop.png` - end - index Editor to N - create Editor in Row - if N is 0 - begin - create HR in StepsPanel - end - add 1 to N - end - on click StepButton - begin - put the index of StepButton into SavedIndex - gosub to SaveCurrentStep - put SelectedStep into N - put SavedIndex into SelectedStep - if SelectedStep is N - begin - index Editor to N - set style `display` of Editor to `none` - index StepButton to N - set style `background-color` of StepButton to `#eee` - gosub to SaveCurrentStep - put -1 into SelectedStep - end - else - begin - if N is not -1 - begin - put 0 into N - while N is less than the elements of StepButton - begin - index Editor to N - set style `display` of Editor to `none` - index StepButton to N - set style `background-color` of StepButton to `#eee` - add 1 to N - end - end - index StepButton to SelectedStep - set style `background-color` of StepButton to `lightgray` - index Editor to SelectedStep - set style `display` of Editor to `block` - put element SelectedStep of Steps into CurrentStep - go to EditStep - end - end - on click Up - begin - put the index of Up into N - put element N of Steps into Step - take 1 from N - put element N of Steps into Step2 - set element N of Steps to Step - add 1 to N - set element N of Steps to Step2 - set property `steps` of Presentation to Steps - go to Restart - end - on click DeleteStep - begin - put the index of DeleteStep into N - json delete element N of Steps - set property `steps` of Presentation to Steps - put -1 into SelectedStep - go to Restart - end - on click ShowStep - begin - if Running stop - put 0 into N - while N is less than the json count of Steps - begin - index StepButton to N - set style `background-color` of StepButton to `#eee` - add 1 to N - end - put the index of ShowStep into N - index StepButton to N - set style `background-color` of StepButton to `#ccf` - set Message to object - set property `action` of Message to `goto` - set property `index` of Message to N - send Message to parent - end - -! Set up the fixed lists - set ActionNames to array - json add `noop` to ActionNames - json add `set content` to ActionNames - json add `show` to ActionNames - json add `hide` to ActionNames - json add `pause` to ActionNames - json add `fade up` to ActionNames - json add `fade down` to ActionNames - json add `animate` to ActionNames - json add `crossfade` to ActionNames - json add `transition` to ActionNames - json add `goto` to ActionNames -! json add `load` to ActionNames - json add `chain` to ActionNames - set InitProperties to array - json add `aspect ratio` to InitProperties - json add `background` to InitProperties - json add `border` to InitProperties - json add `css` to InitProperties - set DisplayTypes to array - json add `block` to DisplayTypes - json add `hidden` to DisplayTypes - set ContinueTypes to array - json add `yes` to ContinueTypes - json add `no` to ContinueTypes - - put property `steps` of Presentation into Steps - put -1 into SelectedStep - clear Running - - stop - -! Set up all the arrays -SetupArrays: - put property `steps` of Presentation into Steps - put the json count of Steps into N - set the elements of ShowStep to N - set the elements of StepButton to N - set the elements of Up to N - set the elements of DeleteStep to N - set the elements of TitleInput to N - set the elements of LabelInput to N - set the elements of DurationInput to N - set the elements of URLInput to N - set the elements of TargetInput to N - set the elements of ChainSelect to N - set the elements of DisplaySelect to N - set the elements of ContinueSelect to N - set the elements of Editor to N - put property `blocks` of Presentation into Blocks - put property `content` of Presentation into Contents - return - -! Add a new step to the list -AddNewStep: - gosub to CreateNewStep - json add CurrentStep to Steps - go to ASA3 - -! Add a step before the current one -AddStepBefore: - put the json count of Steps into N - set CurrentStep to object - json add CurrentStep to Steps - go to ASA2 - -! Add a step after the current one -AddStepAfter: - put the json count of Steps into N - set CurrentStep to object - json add CurrentStep to Steps - add 1 to SelectedStep -ASA2: - while N is greater than SelectedStep - begin - take 1 from N - put element N of Steps into CurrentStep - add 1 to N - set element N of Steps to CurrentStep - take 1 from N - end - gosub to CreateNewStep - set element SelectedStep of Steps to CurrentStep -ASA3: - set property `steps` of Presentation to Steps - -Restart: - set Message to object - set property `action` of Message to `refresh` - send Message to parent - go to Start2 - -CreateNewStep: - set CurrentStep to object - set property `title` of CurrentStep to `New step` - set property `action` of CurrentStep to `` - set property `label` of CurrentStep to `` - return - -! Edit a single step -EditStep: - put property `blocks` of Presentation into Blocks - set BlockNames to array - put 0 into N - while N is less than the json count of Blocks - begin - put element N of Blocks into Block - put property `defaults` of Block into Defaults - json add property `name` of Defaults to BlockNames - add 1 to N - end -! put property `content` of Presentation into Contents - set ContentNames to array - put 0 into N - while N is less than the json count of Contents - begin - put element N of Contents into Content - json add property `name` of Content to ContentNames - add 1 to N - end - put element SelectedStep of Steps into CurrentStep - - clear Editor - create Table in Editor - -ReloadStepEditor: - set the style of Table to `width:100%` - put property `action` of CurrentStep into Action - if SelectedStep is not 0 - begin - create TR in Table - create TD in TR - set the content of TD to `Action:` - create TD in TR - create ActionSelect in TD - set the style of ActionSelect to `width:100%` - set ActionSelect from ActionNames as Action - end - - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Name:` - create TD in TR - index TitleInput to SelectedStep - create TitleInput in TD - set the style of TitleInput to `width:100%` - set the content of TitleInput to property `title` of CurrentStep - if SelectedStep is not 0 - begin - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Label:` - create TD in TR - index LabelInput to SelectedStep - create LabelInput in TD - set the style of LabelInput to `width:100%` - set the content of LabelInput to property `label` of CurrentStep - end - - if Action is `init` gosub to EditInit - else if Action is `set content` gosub to EditSetContent - else if Action is `show` gosub to EditShow - else if Action is `hide` gosub to EditHide - else if Action is `pause` gosub to EditPause - else if Action is `fade up` gosub to EditFadeUp - else if Action is `fade down` gosub to EditFadeDown - else if Action is `animate` gosub to EditAnimate - else if Action is `crossfade` gosub to EditCrossfade - else if Action is `transition` gosub to EditTransition - else if Action is `goto` gosub to EditGoto - else if Action is `load` gosub to EditLoad - else if Action is `chain` gosub to EditChain - else - begin - end - on change ActionSelect - begin - set Response - if Action is not empty - begin - if not confirm `Changing the action will remove all step data. Do you want to continue?` - clear Response - end - if Response - begin - index StepButton to SelectedStep - index TitleInput to SelectedStep - set property `title` of CurrentStep to the text of TitleInput - put the selected item in ActionSelect into Action - gosub to CreateNewAction - clear Table - go to ReloadStepEditor - end - else set ActionSelect from ActionNames as property `action` of CurrentStep - end - -! Add the buttons below the table - create TR in Table - create TD in TR - create TD in TR - set the style of TD to `padding-bottom:0.2em` - create InsertBefore in TD - set the style of InsertBefore to `width:calc(100% / 3)` - if SelectedStep is 0 set the text of InsertBefore to `---` - else - begin - set the text of InsertBefore to `Add Step Before` - on click InsertBefore go to AddStepBefore - end - create Save in TD - set the style of Save to `width:calc(100% / 3)` - set the text of Save to `Save` - on click Save gosub to SaveCurrentStep - create InsertAfter in TD - set the style of InsertAfter to `width:calc(100% / 3)` - set the text of InsertAfter to `Add Step After` - on click InsertAfter go to AddStepAfter - stop - -! Editors for the various Action types - -EditInit: - create TR in Table - create TD in TR - set the content of TD to `Properties:` - create TD in TR - create BlockTable in TD - set the style of BlockTable to `width:100%;border:1px solid gray` - put the json count of InitProperties into N - set the elements of InitInput to N - put 0 into B - while B is less than N - begin - put element B of InitProperties into InitProperty - create BlockRow in BlockTable - set the style of BlockRow to `display:flex` - create Cell in BlockRow - set the style of Cell to `width:6em;padding-left:0.2em` - set the content of Cell to InitProperty - if InitProperty is `css` - begin - create InitCSS in BlockRow - set the style of InitCSS to `flex:1;height:20em` - put property InitProperty of CurrentStep into Item - replace `%0a` with newline in Item - replace `"` with `"` in Item - set the content of InitCSS to Item - end - else - begin - index InitInput to B - create InitInput in BlockRow - set the style of InitInput to `flex:1` - put property InitProperty of CurrentStep into Item - replace `"` with `"` in Item - set the content of InitInput to Item - end - add 1 to B - end - return - -EditSetContent: - create TR in Table - create TD in TR - set the content of TD to `Display:` - create TD in TR - index DisplaySelect to SelectedStep - create DisplaySelect in TD - set the style of DisplaySelect to `width:100%` - put property `display` of CurrentStep into Options - if Options is not `block` put `hidden` into Options - set DisplaySelect from DisplayTypes as Options - - create TR in Table - create TD in TR - set the content of TD to `Blocks:` - create TD in TR - create BlockTable in TD - set the style of BlockTable to `margin:0.2em 0.5em 0 0;border:1px solid gray` -ReloadBlocks: - clear BlockTable - create BlockRow in BlockTable - set the style of BlockRow to `display:flex` - create Header in BlockRow - set the style of Header to `flex:1` - set the content of Header to `Blocks` - create Header in BlockRow - set the style of Header to `flex:1` - set the content of Header to `Content` - create BlockData in BlockRow - set the style of BlockData to `width:2.8em;text-align:center` - create Link in BlockData - create PlusIcon in Link - set the style of PlusIcon to `width:1em;margin-top:0.1em` - set attribute `src` of PlusIcon to `/resources/icon/plus.png` - on click PlusIcon - begin - gosub to SaveCurrentStep - set Block to object - set property `block` of Block to empty - set property `content` of Block to empty - json add Block to Blocks - set property `blocks` of CurrentStep to Blocks - clear Table - go to ReloadStepEditor - end - put property `blocks` of CurrentStep into Blocks - put the json count of Blocks into N - set the elements of BlockSelect to N - set the elements of ContentSelect to N - set the elements of UpContent to N - set the elements of DeleteContent to N - put 0 into B - while B is less than N - begin - put element B of Blocks into Block - create BlockRow in BlockTable - set the style of BlockRow to `display:flex` - index BlockSelect to B - create BlockSelect in BlockRow - set the style of BlockSelect to `flex:1` - set BlockSelect from BlockNames as property `block` of Block - index ContentSelect to B - create ContentSelect in BlockRow - set the style of ContentSelect to `flex:1` - set ContentSelect from ContentNames as property `content` of Block - if B is 0 - begin - create BlockData in BlockRow - set the style of BlockData to `width:1.4em` - end - else - begin - create BlockData in BlockRow - set the style of BlockData to `width:1.4em;text-align:center` - index UpContent to B - create Link in BlockData - create UpContent in Link - set the style of UpContent to `width:1em;margin:0.1em 0 0 0.2em` - set attribute `src` of UpContent to `/resources/icon/up.png` - end - create BlockData in BlockRow - set the style of BlockData to `width:1.4em;text-align:center` - index DeleteContent to B - create Link in BlockData - create DeleteContent in Link - set the style of DeleteContent to `width:1em;margin-top:0.1em` - set attribute `src` of DeleteContent to `/resources/icon/stop.png` - add 1 to B - end - on change BlockSelect - begin - put the index of BlockSelect into N - put element N of Blocks into Block - set property `block` of Block to BlockSelect - set element N of Blocks to Block - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - end - on change ContentSelect - begin - put the index of ContentSelect into N - put element N of Blocks into Block - set property `content` of Block to ContentSelect - set element N of Blocks to Block - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - end - on click UpContent - begin - put the index of UpContent into N - put element N of Blocks into Name - take 1 from N - put element N of Blocks into Name2 - set element N of Blocks to Name - add 1 to N - set element N of Blocks to Name2 - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - set property `steps` of Presentation to Steps - go to ReloadBlocks - end - on click DeleteContent - begin - put the index of DeleteContent into N - json delete element N of Blocks - set property `blocks` of CurrentStep to Blocks - clear Table - go to ReloadStepEditor - end - return - -EditShow: -EditHide: - gosub to EditBlockList - return - -EditPause: - gosub to EditDuration - return - -EditFadeUp: -EditFadeDown: - gosub to EditBlockList - gosub to EditDuration - gosub to EditContinue - return - -EditAnimate: - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Block:` - create TD in TR - set the elements of BlockSelect to 1 - put property `block` of CurrentStep into Block - create BlockRow in TD - create BlockSelect in BlockRow - set the style of BlockSelect to `width:100%` - set BlockSelect from BlockNames as Block - gosub to EditContinue - return - -EditCrossfade: - put ContentNames into Names - put `New text` into TargetText - gosub to EditBlockAndTarget - return - -EditTransition: - put BlockNames into Names - put `Target` into TargetText - gosub to EditBlockAndTarget - return - -EditGoto: - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Target:` - create TD in TR - index TargetInput to SelectedStep - create TargetInput in TD - set the style of TargetInput to `width:100%` - set the content of TargetInput to property `target` of CurrentStep - return - -EditLoad: - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `URL:` - create TD in TR - index URLInput to SelectedStep - create URLInput in TD - set the style of URLInput to `width:100%` - set the content of URLInput to property `url` of CurrentStep - return - -EditChain: - get UserRecord from storage as `.user` - get Email from storage as `user.email` - get Password from storage as `user.password` - get UserHome from storage as `user.home` - set ChainNames to array - - if Static is `static` go to EditChainFromStorage - if UserRecord go to EditChainFromUser - -EditChainFromAdmin: - get AdminPassword from storage as `.password` - if AdminPassword is empty put prompt `Please type the admin password` with `` into AdminPassword - rest get Valid from `verify/` cat AdminPassword - or begin - alert `Unable to verify password.` - put empty into storage as `.password` - end - if Valid is `yes` put AdminPassword into storage as `.password` - else return - - rest get Files from `list/` cat AdminPassword cat `/scripts` - put the json count of Files into FileCount - put 0 into N - while N is less than FileCount - begin - put element N of Files into Item - if property `type` of Item is `json` json add property `name` of Item to ChainNames - add 1 to N - end - go to ProcessChainNames - -EditChainFromUser: - rest get Files from `ulist/` cat Email cat `/` cat Password cat `/` - cat `users/` cat UserHome cat `/scripts` - put the json count of Files into FileCount - put 0 into N - while N is less than FileCount - begin - put element N of Files into Item - if property `type` of Item is `json` json add property `name` of Item to ChainNames - add 1 to N - end - go to ProcessChainNames - -EditChainFromStorage: - get Files from storage - put the json count of Files into FileCount - put 0 into N - while N is less than FileCount - begin - put element N of Files into Item - if left 1 of Item is not `.` - begin - if the position of `.json` in Item is not -1 json add Item to ChainNames - end - add 1 to N - end - -ProcessChainNames: - json sort ChainNames - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Script:` - create TD in TR - index ChainSelect to SelectedStep - create ChainSelect in TD - set the style of ChainSelect to `width:100%` - put property `script` of CurrentStep into Name - set ChainSelect from ChainNames as Name - return - -EditBlockList: - create TR in Table - create TD in TR - set the content of TD to `Blocks:` - create TD in TR - create BlockTable in TD - set the style of BlockTable to `width:100%;border:1px solid gray` - create BlockRow in BlockTable - set the style of BlockRow to `display:flex` - create Header in BlockRow - set the style of Header to `flex:1` - set the content of Header to `Blocks` - create BlockData in BlockRow - set the style of BlockData to `width:2em;text-align:center` - create Link in BlockData - create PlusIcon in Link - set the style of PlusIcon to `width:1em;margin-top:0.1em` - set attribute `src` of PlusIcon to `/resources/icon/plus.png` - on click PlusIcon - begin - gosub to SaveCurrentStep - json add empty to Blocks - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - clear Table - go to ReloadStepEditor - end - put property `blocks` of CurrentStep into Blocks - if Blocks is empty set Blocks to array - put the json count of Blocks into N - set the elements of BlockSelect to N - set the elements of DeleteContent to N - put 0 into B - while B is less than N - begin - put element B of Blocks into Block - create BlockRow in BlockTable - set the style of BlockRow to `display:flex` - index BlockSelect to B - create BlockSelect in BlockRow - set the style of BlockSelect to `flex:1` - set BlockSelect from BlockNames as Block - create BlockData in BlockRow - set the style of BlockData to `width:2em;text-align:center` - index DeleteContent to B - create Link in BlockData - create DeleteContent in Link - set the style of DeleteContent to `width:1em;margin-top:0.1em` - set attribute `src` of DeleteContent to `/resources/icon/stop.png` - add 1 to B - end - on change BlockSelect - begin - put the index of BlockSelect into N - set element N of Blocks to the selected item in BlockSelect - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - end - on click DeleteContent - begin - put the index of DeleteContent into N - json delete element N of Blocks - set property `blocks` of CurrentStep to Blocks - set element SelectedStep of Steps to CurrentStep - clear Table - go to ReloadStepEditor - end - return - -EditBlockAndTarget: - create TR in Table - create TD in TR - set the content of TD to `Block:` - create TD in TR - set the elements of BlockSelect to 1 - put property `block` of CurrentStep into Block - create BlockRow in TD - create BlockSelect in BlockRow - set the style of BlockSelect to `width:100%` - set BlockSelect from BlockNames as Block - create TR in Table - create TD in TR - set the content of TD to TargetText - create TD in TR - put property `target` of CurrentStep into Target - create BlockRow in TD - create TargetSelect in BlockRow - set the style of TargetSelect to `width:100%` - set TargetSelect from Names as Target - gosub to EditDuration - gosub to EditContinue - return - -EditDuration: - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Duration:` - create TD in TR - index DurationInput to SelectedStep - create DurationInput in TD - set the style of DurationInput to `width:100%` - set the content of DurationInput to property `duration` of CurrentStep - return - -EditContinue: - create TR in Table - create TD in TR - set the style of TD to `width:6em` - set the content of TD to `Continue:` - create TD in TR - index ContinueSelect to SelectedStep - create ContinueSelect in TD - set the style of ContinueSelect to `width:100%` - put property `continue` of CurrentStep into Options - if not Options put `no` into Options - set ContinueSelect from ContinueTypes as Options - return - -! Create a new action with a full set of empty properties -CreateNewAction: - index TitleInput to SelectedStep - if the text of TitleInput is empty - begin - set property `title` of CurrentStep to `New step: ` cat Action - end - set property `action` of CurrentStep to Action - set property `label` of CurrentStep to empty - if Action is `init` - begin - put 0 into N - while N is less than the json count of InitProperties - begin - put element N of InitProperties into InitProperty - set property InitProperty of CurrentStep to empty - add 1 to N - end - set property `aspect ratio` of CurrentStep to `WW:HH` - end - else if Action is `set content` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - end - else if Action is `show` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - end - else if Action is `hide` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - end - else if Action is `pause` - begin - put property `duration` of CurrentStep into Duration - if Duration is empty set property `duration` of CurrentStep to 1 - end - else if Action is `fade up` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - put property `duration` of CurrentStep into Duration - if Duration is empty set property `duration` of CurrentStep to 1 - end - else if Action is `fade down` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - put property `duration` of CurrentStep into Duration - if Duration is empty set property `duration` of CurrentStep to 1 - end - else if Action is `crossfade` - begin - put property `duration` of CurrentStep into Duration - if Duration is empty set property `duration` of CurrentStep to 1 - end - else if Action is `transition` - begin - put property `duration` of CurrentStep into Duration - if Duration is empty set property `duration` of CurrentStep to 1 - end - else if Action is `goto` - begin - put property `target` of CurrentStep into Target - if Target is empty set property `target` of CurrentStep to `******` - end - else if Action is `load` - begin - put property `url` of CurrentStep into URL - if URL is empty set property `url` of CurrentStep to `******` - end - set element SelectedStep of Steps to CurrentStep - set property `steps` of Presentation to Steps - return - -! Save the current step -SaveCurrentStep: - if SelectedStep is -1 return - index TitleInput to SelectedStep - put element SelectedStep of Steps into CurrentStep - set property `title` of CurrentStep to the text of TitleInput - index StepButton to SelectedStep - set the text of StepButton to the content of TitleInput - index LabelInput to SelectedStep - if SelectedStep is not 0 set property `label` of CurrentStep to the content of LabelInput - put property `action` of CurrentStep into Action - if Action is `init` - begin - put 0 into N - while N is less than the json count of InitProperties - begin - put element N of InitProperties into InitProperty - index InitInput to N - if InitProperty is `css` - begin - put the content of InitCSS into Item - replace newline with `%0a` in Item - end - else put InitInput into Item - replace `"` with `"` in Item - set property InitProperty of CurrentStep to Item - add 1 to N - end - end - else if Action is `set content` - begin - index DisplaySelect to SelectedStep - set property `display` of CurrentStep to DisplaySelect - set Blocks to array - put 0 into N - while N is less than the elements of BlockSelect - begin - index BlockSelect to N - index ContentSelect to N - set Item to object - set property `block` of Item to BlockSelect - set property `content` of Item to ContentSelect - json add Item to Blocks - add 1 to N - end - set property `blocks` of CurrentStep to Blocks - end - else if Action is `show` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - end - else if Action is `hide` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - end - else if Action is `fade up` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - index DurationInput to SelectedStep - set property `duration` of CurrentStep to DurationInput - index ContinueSelect to SelectedStep - set property `continue` of CurrentStep to ContinueSelect - end - else if Action is `fade down` - begin - put property `blocks` of CurrentStep into Blocks - if Blocks is empty - begin - set Blocks to array - set property `blocks` of CurrentStep to Blocks - end - index DurationInput to SelectedStep - set property `duration` of CurrentStep to DurationInput - index ContinueSelect to SelectedStep - set property `continue` of CurrentStep to ContinueSelect - end - else if Action is `animate` - begin - set property `block` of CurrentStep to BlockSelect - index ContinueSelect to SelectedStep - set property `continue` of CurrentStep to ContinueSelect - end - else if Action is `crossfade` - begin - set property `block` of CurrentStep to BlockSelect - set property `target` of CurrentStep to TargetSelect - index DurationInput to SelectedStep - set property `duration` of CurrentStep to DurationInput - index ContinueSelect to SelectedStep - set property `continue` of CurrentStep to ContinueSelect - end - else if Action is `transition` - begin - set property `block` of CurrentStep to BlockSelect - set property `target` of CurrentStep to TargetSelect - index DurationInput to SelectedStep - set property `duration` of CurrentStep to DurationInput - index ContinueSelect to SelectedStep - set property `continue` of CurrentStep to ContinueSelect - end - else if Action is `pause` - begin - index DurationInput to SelectedStep - set property `duration` of CurrentStep to DurationInput - end - else if Action is `goto` - begin - index TargetInput to SelectedStep - set property `target` of CurrentStep to TargetInput - end - else if Action is `load` - begin - put property `url` of CurrentStep into URL - if URL is empty set property `url` of CurrentStep to `******` - end - else if Action is `chain` - begin - index ChainSelect to SelectedStep - set property `script` of CurrentStep to ChainSelect - if Static put `static` into Mode - else if UserRecord - begin - put `user` into Mode - set property `path` of CurrentStep to Email cat `/` cat Password cat `/` - cat `users/` cat UserHome cat `/scripts/` - end - else - begin - put `admin` into Mode - set property `path` of CurrentStep to `/resources/scripts/` - end - set property `mode` of CurrentStep to Mode - end - index URLInput to SelectedStep - set element SelectedStep of Steps to CurrentStep - set property `steps` of Presentation to Steps - -! Tell the parent to refresh the script - set Message to object - set property `action` of Message to `refresh` - set property `source` of Message to `steps` - send Message to parent - return \ No newline at end of file diff --git a/iwsy/resources/ecs/user.txt b/iwsy/resources/ecs/user.txt deleted file mode 100644 index e00eaf0..0000000 --- a/iwsy/resources/ecs/user.txt +++ /dev/null @@ -1,378 +0,0 @@ -! Users - - script User - - import div Container - - div LoginDiv - div ItemDiv - div ButtonDiv - div EmailDiv - div ResetDiv - div PasswordDiv - div Password2Div - div NameDiv - div ConfirmationDiv - label Label - label Reset - label Back - input EmailInput - input ResetInput - input PasswordInput - input Password2Input - input NameInput - input ConfirmationInput - button LoginButton - button RegisterButton - button ResetPasswordButton - a Link - variable LabelWidth - variable FieldWidth - variable FieldHeight - variable Record - variable PasswordHash - variable ConfirmationCode - variable UserName - variable Email - variable Password - variable Validated - variable Message - - put 25 into LabelWidth - put 78 into FieldWidth - put `height:2em` into FieldHeight - - set the style of Container to `padding-top:0.5em` - - create LoginDiv in Container - set the style of LoginDiv to `padding:0.5em;border:1px solid black;display:none` - - create EmailDiv in LoginDiv - set the style of EmailDiv to `display:flex` - create Label in EmailDiv - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Email:` - create EmailInput in EmailDiv - set the style of EmailInput to FieldHeight cat `;padding:4px;flex:` cat FieldWidth - set the size of EmailInput to 40 - - create PasswordDiv in LoginDiv - set the style of PasswordDiv to `display:flex` - create Label in PasswordDiv - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Password:` - create PasswordInput in PasswordDiv - set the style of PasswordInput to FieldHeight cat `;flex:` cat FieldWidth - set the size of PasswordInput to 40 - set attribute `type` of PasswordInput to `password` - - create Password2Div in LoginDiv - set the style of Password2Div to `display:none` - create Label in Password2Div - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Password (again):` - create Password2Input in Password2Div - set the style of Password2Input to FieldHeight cat `;flex:` cat FieldWidth - set the size of Password2Input to 40 - set attribute `type` of Password2Input to `password` - - create ResetDiv in LoginDiv - set the style of ResetDiv to `display:none` - create Label in ResetDiv - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Reset Code:` - create ResetInput in ResetDiv - set the style of ResetInput to FieldHeight cat `;padding:4px;flex:` cat FieldWidth - set the size of ResetInput to 6 - - create NameDiv in LoginDiv - set the style of NameDiv to `display:none` - create Label in NameDiv - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Name or Nickname:` - create NameInput in NameDiv - set the style of NameInput to FieldHeight cat `;padding:4px;flex:` cat FieldWidth - set the size of NameInput to 40 - - create ConfirmationDiv in LoginDiv - set the style of ConfirmationDiv to `display:none` - create Label in ConfirmationDiv - set the style of Label to `padding-top:0.8em;flex:` cat LabelWidth - set the content of Label to `Confirmation Code:` - create ConfirmationInput in ConfirmationDiv - set the style of ConfirmationInput to FieldHeight cat `;padding:4px;flex:` cat FieldWidth - set the size of ConfirmationInput to 6 - - create ItemDiv in LoginDiv - set the style of ItemDiv to `display:flex;margin-top:0.5em` - create Label in ItemDiv - set the style of Label to `flex:` cat LabelWidth - - create ButtonDiv in ItemDiv - set the style of ButtonDiv to `flex:` cat FieldWidth - create LoginButton in ButtonDiv - set the style of LoginButton to `margin-right:1em` - set the text of LoginButton to `Login` - on click LoginButton go to ProcessLogin - create RegisterButton in ButtonDiv - set the style of RegisterButton to `margin-right:1em` - set the text of RegisterButton to `Register` - on click RegisterButton go to Register - create ResetPasswordButton in ButtonDiv - set style `display` of ResetPasswordButton to `none` - set the text of ResetPasswordButton to `Reset Password` - on click ResetPasswordButton go to ResetPassword2 - create Link in ButtonDiv - set the style of Link to `margin-left:3em` - create Reset in Link - set the text of Reset to `I lost my password` - on click Reset go to ResetPassword - create Link in ButtonDiv - set the style of Link to `margin-left:3em` - create Back in Link - set style `display` of Back to `none` - set the text of Back to `Back` - on click Back go to GoBack - - on message - begin - put the message into Message - if Message is `login` go to ShowLoginForm - else go to Start - end - set ready - stop - -! Start the user manager -Start: - get Email from storage as `user.email` - get Password from storage as `user.password` - if Email is empty stop - if Password is empty stop - go to SetupLogin - -! Show the login form -ShowLoginForm: - set the content of EmailInput to `` - set the content of PasswordInput to `` - set style `display` of LoginDiv to `block` - stop - -! Preload email and password fields -SetupLogin: - set the content of EmailInput to Email - set the content of PasswordInput to Password - -! Process a login request -ProcessLogin: - if EmailInput is empty go to FillAllFields - if PasswordInput is empty go to FillAllFields - rest get Record from `email/` cat EmailInput - if Record is empty go to NoRecord - if property `email` of Record is not EmailInput go to NoRecord - put property `password` of Record into Password - replace `/` with `~` in Password - rest get Validated from `validate/` cat Password cat `/` cat PasswordInput - if Validated is `yes` - begin - gosub to SetStorage - set style `display` of LoginDiv to `none` - gosub to DoLoggedIn - stop - end - -! Deal with no record error -NoRecord: - gosub to ClearStorage - alert `No record exists or incorrect password for ` cat EmailInput cat `.` - stop - -! Logged in, so tell the parent and hide the interface -DoLoggedIn: - gosub to SetStorage - set Message to object - set property `action` of Message to `user` - set property `user` of Message to Record - send Message to parent - set style `display` of LoginDiv to `none` - return - -ClearStorage: - put empty into storage as `user.email` - put empty into storage as `user.password` - return - -SetStorage: - put EmailInput into storage as `user.email` - put PasswordInput into storage as `user.password` - return - -! Register as new user -Register: - set style `display` of PasswordDiv to `flex` - set style `display` of Password2Div to `flex` - set style `display` of ResetDiv to `none` - set style `display` of NameDiv to `flex` - set style `display` of LoginButton to `none` - set style `display` of RegisterButton to `inline-block` - set style `display` of ResetPasswordButton to `none` - set style `display` of Reset to `none` - set style `display` of Back to `inline` - on click RegisterButton go to ProcessRegistration - stop - -! Process the registration -ProcessRegistration: - if EmailInput is empty go to FillAllFields - if PasswordInput is empty go to FillAllFields - if Password2Input is empty go to FillAllFields - if NameInput is empty go to FillAllFields - if PasswordInput is not Password2Input - begin - alert `Passwords do not match` - stop - end - - rest get Record from `email/` cat EmailInput - if Record is not empty go to EmailExists - rest get Record from `name/` cat NameInput - if Record is not empty go to NameExists - - put random 900000 into ConfirmationCode - add 100000 to ConfirmationCode - set Record to object - set property `from` of Record to `admin@iwannashowyou.com` - set property `to` of Record to EmailInput - set property `subject` of Record to `Confirmation code` - set property `message` of Record to `` - cat `Hi ` cat NameInput cat `

` - cat `Please use this code to confirm your registration at I Wanna Show You:
` - cat `

` cat ConfirmationCode cat `

` - cat `If you did not request this email, please ignore it and no action will be taken.` - cat `` - rest post Record to `user` - set style `display` of ConfirmationDiv to `flex` - set the text of RegisterButton to `Confirm registration` - wait 10 ticks - alert `We have sent a confirmation code to ` cat Email cat `.` cat newline - cat `When it arrives, type or paste it in the "Confirmation Code" box ` - cat `and click "Confirm Registration".` - on click RegisterButton - begin - if ConfirmationInput is not ConfirmationCode - begin - alert `Invalid confirmation code - no action taken.` - stop - end - gosub to SetStorage - set Record to object - set property `email` of Record to EmailInput - rest get PasswordHash from `hash/` cat PasswordInput - set property `password` of Record to PasswordHash - set property `name` of Record to NameInput - rest post Record to `user` - set style `display` of ConfirmationDiv to `none` - set the text of RegisterButton to `Register` - gosub to DoLoggedIn - end - stop - -! Email is already in use -EmailExists: - alert `A record already exists for ` cat EmailInput cat `.` - stop - -! Name is already in use -NameExists: - alert `A record already exists for ` cat NameInput cat `.` - stop - -! One or more fileds are empty -FillAllFields: - alert `Please fill in all the fields.` - stop - -! Reset the password -ResetPassword: - set style `display` of ResetDiv to `none` - set style `display` of PasswordDiv to `none` - set style `display` of Password2Div to `none` - set style `display` of LoginButton to `none` - set style `display` of RegisterButton to `none` - set style `display` of ResetPasswordButton to `inline-block` - set style `display` of Reset to `none` - set style `display` of Back to `inline-block` - wait 10 ticks - alert `Please type the email you used for your registration then click Reset Password.` - on click ResetPasswordButton go to ResetPassword2 - stop - -! Process the password reset -ResetPassword2: - if EmailInput is empty go to FillAllFields - rest get Record from `email/` cat EmailInput - if Record is empty - begin - alert ` No record exists for ` cat EmailInput cat `.` - go to Register - end - put property `name` of Record into UserName - put random 900000 into ConfirmationCode - add 100000 to ConfirmationCode - set Record to object - set property `from` of Record to `admin@iwannashowyou.com` - set property `to` of Record to EmailInput - set property `subject` of Record to `Password reset key` - set property `message` of Record to `` - cat `Hi ` cat NameInput cat `

` - cat `Please use this code to confirm your password reset request at I Wanna Show You:
` - cat `

` cat ConfirmationCode cat `

` - cat `If you did not request this email, please ignore it and no action will be taken.` - cat `` - rest post Record to `user` - set style `display` of ResetDiv to `flex` - set style `display` of PasswordDiv to `flex` - set the content of PasswordInput to `` - set style `display` of Password2Div to `flex` - set the content of Password2Input to `` - set the text of ConfirmationInput to `` - on click ResetPasswordButton go to ResetPassword3 - wait 10 ticks - alert `We have sent a password reset code to ` cat Email cat `.` cat newline - cat `When it arrives, use it on this screen to confirm your new password.` - stop - -! Confirm new password -ResetPassword3: - if PasswordInput is empty go to FillAllFields - if Password2Input is empty go to FillAllFields - if PasswordInput is not Password2Input - begin - alert `Passwords do not match` - stop - end - if ResetInput is not ConfirmationCode - begin - alert `Invalid password reset code - no action taken.` - stop - end - set Record to object - set property `email` of Record to EmailInput - rest get PasswordHash from `hash/` cat PasswordInput - set property `password` of Record to PasswordHash - set property `name` of Record to UserName - rest post Record to `user` - gosub to SetStorage - go to DoLoggedIn - -! Go back to the initial state -GoBack: - set style `display` of ResetDiv to `none` - set style `display` of PasswordDiv to `flex` - set style `display` of Password2Div to `none` - set style `display` of NameDiv to `none` - set style `display` of LoginButton to `inline-block` - set style `display` of Reset to `inline` - set style `display` of Back to `none` - on click RegisterButton go to Register - stop \ No newline at end of file diff --git a/iwsy/resources/ecs/vfx.txt b/iwsy/resources/ecs/vfx.txt deleted file mode 100644 index 715a6d2..0000000 --- a/iwsy/resources/ecs/vfx.txt +++ /dev/null @@ -1,354 +0,0 @@ -! VFX - - script VFX - - import div Container and variable Presentation - - div Panel - div Editor - div Title - div Table - div Row - div Cell - div Empty - input ItemNameInput - input AspectRatioInput - input URLInput - input DurationInput - input EndSizeInput - input EndXOffsetInput - input EndYOffsetInput - select VFXTypeSelect - button EditButton - button ShowButton - button SaveButton - img AddItem - img Up - img DeleteItem - a Link - variable Items - variable Item - variable Item2 - variable ItemName - variable SelectedItem - variable SavedIndex - variable Message - variable N - variable NumItems - variable VFXTypes - variable Value - - put -1 into SelectedItem - set VFXTypes to array - json add `panzoom` to VFXTypes - - on message go to Start - set ready - stop - -Start: - if the message is `save` - begin - gosub to SaveSelectedItem - stop - end - -Restart: - put property `vfx` of Presentation into Items - if Items is empty set Items to array - - clear Container - create Panel in Container - set the style of Panel to `width:100%;height:100%;display:flex;flex-direction:column` - create Row in Panel - set the style of Row to `height:2em;display:flex` - create Title in Row - set the style of Title to - `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em` - set the content of Title to `VFX Items` - create Cell in Row - set the style of Cell to `width:1.4em;text-align:center` - create Link in Cell - create AddItem in Link - set the style of AddItem to `width:1em;margin-top:0.1em` - set attribute `src` of AddItem to `/resources/icon/plus.png` - set attribute `title` of AddItem to `Add VFX item` - on click AddItem - begin - set Item to object - set property `name` of Item to `New vfx` - json add Item to Items - set property `vfx` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - - put the json count of Items into NumItems - if NumItems is greater than 0 - begin - set the elements of EditButton to NumItems - set the elements of Editor to NumItems - set the elements of ShowButton to NumItems - set the elements of SaveButton to NumItems - set the elements of Up to NumItems - set the elements of DeleteItem to NumItems - set the elements of ItemNameInput to NumItems - set the elements of VFXTypeSelect to NumItems - set the elements of AspectRatioInput to NumItems - set the elements of URLInput to NumItems - set the elements of DurationInput to NumItems - set the elements of EndSizeInput to NumItems - set the elements of EndXOffsetInput to NumItems - set the elements of EndYOffsetInput to NumItems - end - create Table in Panel - set the style of Table to `flex:1;width:100%;overflow-y:scroll` - put 0 into N - while N is less than NumItems - begin - index EditButton to N - index Up to N - index DeleteItem to N - index Editor to N - index ItemNameInput to N - put element N of Items into Item - put property `name` of Item into ItemName - create Row in Table - set the style of Row to `margin-bottom:0.2em` - create Cell in Row - set the style of Cell to `width:100%;display:flex` - create EditButton in Cell - set the style of EditButton to `height:2em;flex:1` - set the text of EditButton to ItemName - if N is 0 - begin - create Empty in Cell - set the style of Empty to `width:1em;margin:0.2em 0 0 0.2em` - end - else - begin - create Link in Cell - create Up in Link - set the style of Up to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of Up to `/resources/icon/up.png` - end - create Link in Cell - create DeleteItem in Link - set the style of DeleteItem to `width:1em;margin:0.2em 0 0 0.2em` - set attribute `src` of DeleteItem to `/resources/icon/stop.png` - create Editor in Row - set the style of Editor to `margin:0.5em;border:1px solid black;padding:0.2em;display:none;flex-direction:column` - add 1 to N - end - on click EditButton - begin - if the elements of EditButton is not greater than the index of EditButton stop - put the index of EditButton into SavedIndex - gosub to SaveSelectedItem - put SavedIndex into SelectedItem - put 0 into N - while N is less than NumItems - begin - if N is not SelectedItem - begin - index EditButton to N - set style `background` of EditButton to `#eee` - index Editor to N - set style `display` of Editor to `none` - clear Editor - end - add 1 to N - end - index EditButton to SelectedItem - index ItemNameInput to SelectedItem - index VFXTypeSelect to SelectedItem - index AspectRatioInput to SelectedItem - index URLInput to SelectedItem - index DurationInput to SelectedItem - index EndSizeInput to SelectedItem - index EndXOffsetInput to SelectedItem - index EndYOffsetInput to SelectedItem - index ShowButton to SelectedItem - index SaveButton to SelectedItem - index Editor to SelectedItem - if style `display` of Editor is `none` - begin - set style `display` of Editor to `flex` - set style `background-color` of EditButton to `lightgray` - put element SelectedItem of Items into Item -ReloadEditor: - clear Editor - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Type` - create VFXTypeSelect in Row - set the style of VFXTypeSelect to `flex:1` - set VFXTypeSelect from VFXTypes as property `type` of Item - on change VFXTypeSelect - begin - gosub to SaveSelectedItem - set property `type` of Item to VFXTypeSelect - set element SelectedItem of Items to Item - go to ReloadEditor - end - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Name` - create ItemNameInput in Row - set the style of ItemNameInput to `flex:1` - set the text of ItemNameInput to property `name` of Item - if VFXTypeSelect is `panzoom` - begin - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Aspect` - create AspectRatioInput in Row - set the style of AspectRatioInput to `flex:1` - put property `aspect` of Item into Value - if Value is empty put `4:3` into Value - set the text of AspectRatioInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Image` - create URLInput in Row - set the style of URLInput to `flex:1` - put property `url` of Item into Value - if Value is empty put empty into Value - set the text of URLInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Duration` - create DurationInput in Row - set the style of DurationInput to `flex:1` - put property `duration` of Item into Value - set the text of DurationInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `End Size` - create EndSizeInput in Row - set the style of EndSizeInput to `flex:1` - put property `endsize` of Item into Value - set the text of EndSizeInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `End Xoff` - create EndXOffsetInput in Row - set the style of EndXOffsetInput to `flex:1` - put property `endxoff` of Item into Value - set the text of EndXOffsetInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `End Yoff` - create EndYOffsetInput in Row - set the style of EndYOffsetInput to `flex:1` - put property `endyoff` of Item into Value - set the text of EndYOffsetInput to Value - end - create Row in Editor - set the style of Row to `height:2em;display:flex;margin-top:0.5em` - create SaveButton in Row - set the style of SaveButton to `flex:1;margin-right:0.2em` - set the text of SaveButton to `Save` - on click SaveButton gosub to SaveSelectedItem - create ShowButton in Row - set the style of ShowButton to `flex:1;margin-left:0.2em` - set the text of ShowButton to `Show` - on click ShowButton - begin - gosub to SaveSelectedItem - put element SelectedItem of Items into Item - set Message to object - set property `action` of Message to `panzoom` - set property `item` of Message to Item - send Message to parent - end - end - else - begin - clear Editor - set style `display` of Editor to `none` - end - end - on click Up - begin - put the index of Up into N - put element N of Items into Item - take 1 from N - put element N of Items into Item2 - set element N of Items to Item - add 1 to N - set element N of Items to Item2 - set property `vfx` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - on click DeleteItem - begin - put the index of DeleteItem into N - put property `vfx` of Presentation into Items - json delete element N of Items - set property `vfx` of Presentation to Items - put -1 into SelectedItem - go to Restart - end - stop - -! Save the selected content -SaveSelectedItem: - if SelectedItem is -1 return - if the json count of Items is 0 return - index ItemNameInput to SelectedItem - index VFXTypeSelect to SelectedItem - index AspectRatioInput to SelectedItem - index EditButton to SelectedItem - put element SelectedItem of Items into Item - put ItemNameInput into Value - replace ` ` with `-` in Value - set the text of ItemNameInput to Value - set the text of EditButton to Value - set property `name` of Item to Value - if property `type` of Item is `panzoom` - begin - index AspectRatioInput to SelectedItem - index URLInput to SelectedItem - index DurationInput to SelectedItem - index EndSizeInput to SelectedItem - index EndXOffsetInput to SelectedItem - index EndYOffsetInput to SelectedItem - set property `aspect` of Item to AspectRatioInput - set property `url` of Item to URLInput - set property `duration` of Item to DurationInput - set property `endsize` of Item to EndSizeInput - set property `endxoff` of Item to EndXOffsetInput - set property `endyoff` of Item to EndYOffsetInput - end - set element SelectedItem of Items to Item - set property `vfx` of Presentation to Items - -! Tell the parent to refresh the script - set Message to object - set property `action` of Message to `refresh` - set property `source` of Message to `vfx` - send Message to parent - return \ No newline at end of file diff --git a/iwsy/resources/help/about.md b/iwsy/resources/help/about.md deleted file mode 100644 index c9a43a5..0000000 --- a/iwsy/resources/help/about.md +++ /dev/null @@ -1,11 +0,0 @@ -~page:contents:Contents~ - -## About us - -~iwsy~ is a client-size all-JavaScript web application, currently under development by a small independent software development team. - -## Contact us - -All enquiries should be sent to [info@iwannashowyou.com](mailto:info@iwannashowyou.com). - -We are keen to collaborate with anyone who may have ideas for improving the website and the range of features it provides. Enquiries should be made in the first instance to the email address given above. diff --git a/iwsy/resources/help/action-animate.md b/iwsy/resources/help/action-animate.md deleted file mode 100644 index 0fcbc48..0000000 --- a/iwsy/resources/help/action-animate.md +++ /dev/null @@ -1,37 +0,0 @@ -~page:contents:Contents~ - -# The `animate` action - -This action a visual effect on the content of a bock. At present there is only pan/zoom, used to create the "Ken Burns" effect that makes still photos look a little like video. - -~img:https://easycoder.github.io/iwsy/resources/help/img/animate.png|100%~ - -This action performs a visual effect on one or more blocks. Each of the blocks has content which contains a special Markdown extension that defines the visual effect to be applied. The format is - -~m:~vfx:100% manarola~~ - -where ~m:manarola~ is the name of the effect in the ~m:VFX~ section of the script. You can have any number of animations in a single content block, though more than one is usually over-doing it. - -The parameters needed for the effect are given by adding an item in the ~m:VFX~ section: - -~img:https://easycoder.github.io/iwsy/resources/help/img/panzoom.png|100%~ - -Here the type is defined as a ~m:panzoom~ (it's currently the only option available). The name then follows. Next we have the aspect ratio of the container that holds the image being manipulated, the URL of that image and the duration of the effect in seconds. - -The effect works by magnifying the image and using the container as a "window" onto a part of the magnified image. By moving the window and altering the magnification we achieve the pan and zoom effect. - -There are 2 groups of 3 parameters, one for the start of the effect and the other for the end. Each of the sets of values are as follows: - - 1. the size (magnification). - 1. the offset of the left-hand edge of the image from the left-hand edge of the container. Negative values cause the image to position to the left of the container, so in general the values will all be negative or zero. - 1. the offset of the top edge of the image from the top of the container. Negative values cause the top of the image to position above the container. - -In all cases the values are expressed as a percentage of the container width or height. - -The animation follows a cosine function that causes it to start slowly, accelerate towards the middle of the effect the deccelerate towards the end, giving a smooth start and finish. - -To use a sequence of images, each with its own Ken Burns specification, fade down the current item and fade up the next, in each case with the ~m:continue~ flag set to ~m:yes~, then follow these with the animation itself. With the right fade duration this will give you a smooth transition during the period the animation is moving at its slowest. You may also have to ensure the images are preloaded (cached) to avoid stuttering as a new animation starts. - -You can see an example running on the ~page:iwsy:Home~ page of this documentation. - -Next: ~page:action-pause:Pause~ diff --git a/iwsy/resources/help/action-chain.md b/iwsy/resources/help/action-chain.md deleted file mode 100644 index b381690..0000000 --- a/iwsy/resources/help/action-chain.md +++ /dev/null @@ -1,7 +0,0 @@ -~page:contents:Contents~ - -# The `chain` action - -Large, dynamic presentations or slideshows may have dozens or even hundreds of steps, making then increasingly difficult to manage or even to visualize. However, presentations are linear entities that usually comprise a number of independent sections, one following another. If you are working on the introduction part of your show, the rest of it is of little immediate interest - it may as well be another presentation completely. - -To take advantage of this structual feature of the average presentation, ~iwsy~ provides the ~m:chain~ action, which terminates the current show, loads a new one and starts it running. As long as you provide a suitable "bridge" the effect is seamless. Each of the sections can be a full presentation in its own right and can be developed independently of all the others. diff --git a/iwsy/resources/help/action-crossfade.md b/iwsy/resources/help/action-crossfade.md deleted file mode 100644 index f9d3906..0000000 --- a/iwsy/resources/help/action-crossfade.md +++ /dev/null @@ -1,23 +0,0 @@ -~page:contents:Contents~ - -# The `crossfade` action - -This action crossfades the text of a block, replacing it with new content. - -~img:https://easycoder.github.io/iwsy/resources/help/img/action-crossfade.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions. - -The **Block** property is the block that will be handled by this step. - -The **Target** property is the **Content** item that will replace the text currently in the block. - -The **Duration** property is the time in seconds the crossfade should take. - -The **Continue** is **true** or **false**. It governs whether the next step should run at the same time as this one (**true**) or if it should wait until the effect has completed (**false**). - -When this action runs, the text of the block is replaced by that of the text held in **Target**. The original text is faded down and the new is faded up at the same time, over the duration given. A similar effet can be obtained using **fade up** and **fade down**, but **crossfade** has the advantage that the result is in the same block as before, so if you are running a set of slides where the text in a block keeps changing, then the **crossfade** is much simpler. - -Fades and other animated effects run at 25 frames/sec, as a compromise between visual smoothness and processing requirements. - -Next: ~page:action-transition:Transition a block~ diff --git a/iwsy/resources/help/action-fade.md b/iwsy/resources/help/action-fade.md deleted file mode 100644 index a634655..0000000 --- a/iwsy/resources/help/action-fade.md +++ /dev/null @@ -1,21 +0,0 @@ -~page:contents:Contents~ - -# The `fade up` and `fade down` actions - -This action fades one or more blocks up or down by varying their opacity. - -~img:https://easycoder.github.io/iwsy/resources/help/img/action-fade.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions. - -The **Blocks** property is a list of blocks that will be handled by this step. Add another block to the list by clicking the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ button. - -The **Duration** property is the time in seconds the fade should take. - -The **Continue** is **true** or **false**. It governs whether the next step should run at the same time as this one (**true**) or if it should wait until the fade has completed (**false**). A common use for this is to implement a crossfade, where one scene dissoves into another. The **fade down** and **fade up** steps both have the same **Duration** and the first one has **Continue** set **true**. There's also a separate **Crossfade** action; see the documentation ~page:action-crossfade:here~. - -When this action runs the blocks referenced are all faded at the same time. You can change the order of display by moving blocks up the list using the ~img:https://easycoder.github.io/iwsy/resources/icon/up.png|icon~ buttons. (This has no effect on the show; it's just a convenience for the programmer.) You can delete any block using the ~img:https://easycoder.github.io/iwsy/resources/icon/stop.png|icon~ buttons. - -Fades and other animated effects run at 25 frames/sec, as a compromise between visual smoothness and processing requirements. - -Next: ~page:action-crossfade:Crossfade~ diff --git a/iwsy/resources/help/action-init.md b/iwsy/resources/help/action-init.md deleted file mode 100644 index 2253df3..0000000 --- a/iwsy/resources/help/action-init.md +++ /dev/null @@ -1,19 +0,0 @@ -~page:contents:Contents~ - -# The `init` action - -Every ~iwsy~ presentation starts with an `init` action, which defines the environment in which the presentation will run. The editor looks like this: - -~img:https://easycoder.github.io/iwsy/resources/help/img/editor-init.png|100%~ - -Here there are a set of _properties_ relating to the `init` action. All these are editable. The Title is there for your convenience; it has no affect on the presentation. The properties are as follows: - - - `aspect` `ratio` is a pair of numbers that govern the size of the display area. The width is that of the container provided to IWSY by the web page. Sometimes the height will also be defined, in which case you should clear the `aspect` `ratio` field. In most cases, though, the height is not given. You can decide what it should be in relation to the width. The default is a 16:9 widescreen format but other common choices are 4:3 (old-style TV) and 1:1 (square). You can adjust these values to fill the screen exactly. Some experimentation may be needed, and once you've discovered a ratio that works for your computer you can use it in all presentations. - - - `background` is for the entire screen. By default it has no value, making it transparent. The values you use here are standard CSS background styles, which include using images. - - - `border` is also for the screen. A default value is provided. When you started IWSY the left-hand side of the screen will have shown this outline before the help panel replaced it. - - - `css` is any set of global style values you wish to set up for your presentation. These will be added to the HEAD of your document. Typical uses are to set a color for headers or to adjust margins on specific elements. - -Next: ~page:action-set-content:Set the content of blocks~ diff --git a/iwsy/resources/help/action-pause.md b/iwsy/resources/help/action-pause.md deleted file mode 100644 index a0834fb..0000000 --- a/iwsy/resources/help/action-pause.md +++ /dev/null @@ -1,13 +0,0 @@ -~page:contents:Contents~ - -# The `pause` action - -This action pauses the presentation for a given nmber of seconds. - -~img:https://easycoder.github.io/iwsy/resources/help/img/pause.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions. - -The **Duration** property is the time in seconds the pause should take. - -Next: ~page:action-chain:Chain~ diff --git a/iwsy/resources/help/action-set-content.md b/iwsy/resources/help/action-set-content.md deleted file mode 100644 index d73e69e..0000000 --- a/iwsy/resources/help/action-set-content.md +++ /dev/null @@ -1,15 +0,0 @@ -~page:contents:Contents~ - -# The `set content` action - -This action calls blocks into existence and assigns content to them. Here's a typical example: - -~img:https://easycoder.github.io/iwsy/resources/help/img/setup-all-blocks.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions, so that just leaves **Blocks**. This is a list of blocks that will be handled by this step. For each one a **content** items is defined; blocks that are just used to hold a background image or color will leave this empty. Add another block to the list by clicking the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ button. - -When this action runs the blocks are created in the order they are listed, so a block lower down the list will mask one that's higher up if they overlap. You can change the order of display by moving blocks up using the ~img:https://easycoder.github.io/iwsy/resources/icon/up.png|icon~ buttons. You can delete any block using the ~img:https://easycoder.github.io/iwsy/resources/icon/stop.png|icon~ buttons. - -Setting content does not make a block visible. To do that you need either ~page:action-show-hide:show~ or ~page:action-fade:fade up~. - -Next: ~page:action-show-hide:Show or hide blocks~ diff --git a/iwsy/resources/help/action-show-hide.md b/iwsy/resources/help/action-show-hide.md deleted file mode 100644 index d48c751..0000000 --- a/iwsy/resources/help/action-show-hide.md +++ /dev/null @@ -1,13 +0,0 @@ -~page:contents:Contents~ - -# The `show` and `hide` actions - -This action shows or hides one or more blocks. - -~img:https://easycoder.github.io/iwsy/resources/help/img/action-show.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions, so that just leaves **Blocks**. This is a list of blocks that will be handled by this step. Add another block to the list by clicking the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ button. - -When this action runs the blocks referenced are all made visible or invisible. You can change the order of display by moving blocks up the list using the ~img:https://easycoder.github.io/iwsy/resources/icon/up.png|icon~ buttons. (This has no effect on the show; it's just a convenience for the programmer.) You can delete any block using the ~img:https://easycoder.github.io/iwsy/resources/icon/stop.png|icon~ buttons. - -Next: ~page:action-fade:Fade up and down~ diff --git a/iwsy/resources/help/action-transition.md b/iwsy/resources/help/action-transition.md deleted file mode 100644 index d750767..0000000 --- a/iwsy/resources/help/action-transition.md +++ /dev/null @@ -1,32 +0,0 @@ -~page:contents:Contents~ - -# The `transition` action - -This action performs any combination of zoom, move and changing text size and/or color. - -~img:https://easycoder.github.io/iwsy/resources/help/img/zoom-title.png|100%~ - -The **Action**, **Name** and **Label** properties are present for all actions. - -The **Block** property is the block that will be handled by this step. - -The **Target** property is a block whose attributes represent the _target_ of the transition. - -The **Duration** property is the time in seconds the transition should take. - -The **Continue** is **true** or **false**. It governs whether the next step should run at the same time as this one (**true**) or if it should wait until the effect has completed (**false**). - -When this action runs, the attributes of the named block are gradually transitioned into those held by the target block. This is done for the block size and position, the size of the text and the color of the text. A variety of effects can be achieved with this, such as - - - Blocks can be moved in any direction; even off the screen completely - - Blocks can be resized - - The size of text can be increased or decreased - - The color of text can be changed - -All of these effects apply to text blocks; the first two also apply to blocks that just have a background image. - -When the color of text is to be changed, the size values in both **Block** and **Target** must be expressed in the form **#RRGGBB**, where **RRGGBB** carries the hex values of the red, green and blue components of the color. - -Fades and other animated effects run at 25 frames/sec, as a compromise between visual smoothness and processing requirements. - -Next: ~page:action-animate:Animate~ diff --git a/iwsy/resources/help/buttons.md b/iwsy/resources/help/buttons.md deleted file mode 100644 index d23916a..0000000 --- a/iwsy/resources/help/buttons.md +++ /dev/null @@ -1,29 +0,0 @@ -~page:contents:Contents~ - -# The Buttons panel - -Above this Help page, under the banner, is a panel of buttons. The job of each button is as follows: - -~img:https://easycoder.github.io/iwsy/resources/icon/new|png:{float:left;height:2em;margin-right:1em}~ Start a new presentation. This clears the workspace. If you have unsaved work it will prompt you to save it. - -~img:https://easycoder.github.io/iwsy/resources/icon/open.png|{float:left;height:2em;margin-right:1em}~ Open a saved presentation. This displays a list of all presentations and lets you select one. Note that if you are not a registered user, presentations will be saved into your browser's private space. For registered users they are saved to the ~iwsy~ website, into a space allocated to that user. - -If you have unsaved work you will be prompted to save it before opening the list. - -~img:https://easycoder.github.io/iwsy/resources/icon/save.png|{float:left;height:2em;margin-right:1em}~ Save your current work. It will be saved using whatever name is shown in the **Script name** box below the buttons. If this box is empty you will be prompted for a name. Files all have ~m:.json~ extensions; if this is omitted it will be added. - -~img:https://easycoder.github.io/iwsy/resources/icon/trash.png|{float:left;height:2em;margin-right:1em}~ Delete the current presentation. You will be prompted to confirm before the delete goes ahead. - -~img:https://easycoder.github.io/iwsy/resources/icon/fileman.png|{float:left;height:2em;margin-right:1em}~ Open the image manager. This shows you all the images you have uploaded to our server. If you are not registered, this button is non-operational. - -~img:https://easycoder.github.io/iwsy/resources/icon/run.png|{float:left;height:2em;margin-right:1em}~ Run your presentation. A player is created in the spacce currently occupied by this Help page and the presentation runs without manual intervention. The button changes to ~img:https://easycoder.github.io/iwsy/resources/icon/runstop.png|icon~. If you click this the presentation will stop. - -~img:https://easycoder.github.io/iwsy/resources/icon/fullscreen.png|{float:left;height:2em;margin-right:1em}~ Run your presentation in full-screen mode. This is the mode you will use when connected to an overhead projector, for example. - -In fullscreen mode the presentation waits for a mouse click or a button press. A mouse click or either of the space or right-arrow keys will cause the presentation to start in manual mode, where it stops after each visual change and waits for you to click or press again. If you press the Enter key the presentation will run according to the timing given by its individual steps. You can interrupt this my clicking or by pressing space or right-arrow. - -In some cases the browser will report the screen size incorrectly and some backgrounds will not show properly; if this happens it's best to select full-screen mode in your browser before clicking this button. - -~img:https://easycoder.github.io/iwsy/resources/icon/help.png|{float:left;height:2em;margin-right:1em}~ Display this help at the page you were last viewing. - -~img:https://easycoder.github.io/iwsy/resources/icon/trash.png|{float:left;height:2em;margin-right:1em}~ Login or Register. This displays the ~page:users:Login panel~. diff --git a/iwsy/resources/help/contents.md b/iwsy/resources/help/contents.md deleted file mode 100644 index ec319cb..0000000 --- a/iwsy/resources/help/contents.md +++ /dev/null @@ -1,43 +0,0 @@ -~page:iwsy:Home and Introduction~ - -# ~iwsy~ Help - Contents - -~page:quickstart:Quickstart tutorial~ **Beginners start here!** - -~page:quickstart2:Quickstart tutorial, part 2~ - -~page:quickstart3:Quickstart tutorial, part 3~ - -~page:users:User registration and login~ - -~page:buttons:The Buttons panel~ - -~page:project:The Project panel~ - -~page:about:About us, contacts etc.~ - -## Actions - -~page:action-init:The "init" action~ - -~page:action-set-content:The "set content" action~ - -~page:action-show-hide:The "show" and "hide" actions~ - -~page:action-fade:The "fade up" and "fade down" actions~ - -~page:action-crossfade:The "crossfade" action~ - -~page:action-transition:The "transition" action~ - -~page:action-animate:The "animate" action~ - -~page:action-pause:The "pause" action~ - -~page:action-chain:The "chain" action~ - -## Technical - -~page:embed:How to embed a presentation~ - -~page:technical:Other technical stuff, statistics etc.~ diff --git a/iwsy/resources/help/embed.md b/iwsy/resources/help/embed.md deleted file mode 100644 index 967efa2..0000000 --- a/iwsy/resources/help/embed.md +++ /dev/null @@ -1,36 +0,0 @@ -~page:contents:Contents~ - -# How to embed a presentation - -To embed a presentation in your own web page you just need the ~iwsy~ runtime engine and a presentation script. The best place to start is with a stand-alone web page, which is coded like this: -
-``` - - - - - - - - - - -
- -
- - - - - -``` -
-All of the resources in this demo are loaded on demand from the CDN attached to the GitHub repository for ~iwsy~, which is part of [EasyCoder](https://easycoder.github.io). - -The ~m:head~ of the document requests 2 scripts. One is the ~iwsy~ runtime engine; the other is a launcher for the presentation, which waits for the page to load then starts things up. - -The ~m:body~ contains a ~m:<div>~ with an ID that is specific to ~iwsy~. Inside this is a graphic that holds instructions on how to run the presentation. Then finally there's a hidden ~<pre>~ element that holds the URL of the presentation script. - -## Doing your own embedding - -When you want to embed a presentation, some of the same things are needed. The ~iwsy~ engine is always required but the launcher function will be probably be provided by your own page code. You will need to study the code in ~m:iwsystart.js~ to see how to do this, but it should be no more than a single page of vanilla JavaScript. The container is the ~m:<div>~ on your page in which you want the show to run. The script can be provided in any way you like; it's just a text file that is passed to ~iwsy~ on startup. diff --git a/iwsy/resources/help/img/action-crossfade.png b/iwsy/resources/help/img/action-crossfade.png deleted file mode 100644 index 4084dbb..0000000 Binary files a/iwsy/resources/help/img/action-crossfade.png and /dev/null differ diff --git a/iwsy/resources/help/img/action-fade.png b/iwsy/resources/help/img/action-fade.png deleted file mode 100644 index c190b09..0000000 Binary files a/iwsy/resources/help/img/action-fade.png and /dev/null differ diff --git a/iwsy/resources/help/img/action-list.png b/iwsy/resources/help/img/action-list.png deleted file mode 100644 index 10e2225..0000000 Binary files a/iwsy/resources/help/img/action-list.png and /dev/null differ diff --git a/iwsy/resources/help/img/action-show.png b/iwsy/resources/help/img/action-show.png deleted file mode 100644 index d8e0f62..0000000 Binary files a/iwsy/resources/help/img/action-show.png and /dev/null differ diff --git a/iwsy/resources/help/img/animate.png b/iwsy/resources/help/img/animate.png deleted file mode 100644 index 161455f..0000000 Binary files a/iwsy/resources/help/img/animate.png and /dev/null differ diff --git a/iwsy/resources/help/img/editor-init.png b/iwsy/resources/help/img/editor-init.png deleted file mode 100644 index dbb808d..0000000 Binary files a/iwsy/resources/help/img/editor-init.png and /dev/null differ diff --git a/iwsy/resources/help/img/login.png b/iwsy/resources/help/img/login.png deleted file mode 100644 index 40cf36e..0000000 Binary files a/iwsy/resources/help/img/login.png and /dev/null differ diff --git a/iwsy/resources/help/img/new.png b/iwsy/resources/help/img/new.png deleted file mode 100644 index 670a256..0000000 Binary files a/iwsy/resources/help/img/new.png and /dev/null differ diff --git a/iwsy/resources/help/img/panzoom.png b/iwsy/resources/help/img/panzoom.png deleted file mode 100644 index 84dbb80..0000000 Binary files a/iwsy/resources/help/img/panzoom.png and /dev/null differ diff --git a/iwsy/resources/help/img/pause.png b/iwsy/resources/help/img/pause.png deleted file mode 100644 index 3b986bf..0000000 Binary files a/iwsy/resources/help/img/pause.png and /dev/null differ diff --git a/iwsy/resources/help/img/project.png b/iwsy/resources/help/img/project.png deleted file mode 100644 index 3c4712a..0000000 Binary files a/iwsy/resources/help/img/project.png and /dev/null differ diff --git a/iwsy/resources/help/img/register.png b/iwsy/resources/help/img/register.png deleted file mode 100644 index dbf72e9..0000000 Binary files a/iwsy/resources/help/img/register.png and /dev/null differ diff --git a/iwsy/resources/help/img/setup-all-blocks.png b/iwsy/resources/help/img/setup-all-blocks.png deleted file mode 100644 index 9d29ba2..0000000 Binary files a/iwsy/resources/help/img/setup-all-blocks.png and /dev/null differ diff --git a/iwsy/resources/help/img/user-loggedin.png b/iwsy/resources/help/img/user-loggedin.png deleted file mode 100644 index 3867c0c..0000000 Binary files a/iwsy/resources/help/img/user-loggedin.png and /dev/null differ diff --git a/iwsy/resources/help/img/user.png b/iwsy/resources/help/img/user.png deleted file mode 100644 index 87977a0..0000000 Binary files a/iwsy/resources/help/img/user.png and /dev/null differ diff --git a/iwsy/resources/help/img/zoom-title.png b/iwsy/resources/help/img/zoom-title.png deleted file mode 100644 index 83d365a..0000000 Binary files a/iwsy/resources/help/img/zoom-title.png and /dev/null differ diff --git a/iwsy/resources/help/iwsy.md b/iwsy/resources/help/iwsy.md deleted file mode 100644 index b9edfa4..0000000 --- a/iwsy/resources/help/iwsy.md +++ /dev/null @@ -1,43 +0,0 @@ -~page:contents:Contents~ - -**Beginners** - See our ~page:quickstart:quickstart tutorial~ - -# ~iwsy~ - I Wanna Show You - -## Embedded slideshows and presentations - -I Wanna Show You (~iwsy~, pronounced "You-zee" as an approximation to the initials) is a web app you can use to create slideshows that run under either manual control or unattended. Instead of being a PC application that's tied to the desktop, ~iwsy~ is entirely browser-based. ~iwsy~ presentations can run here in this web app, they can be embedded in other web pages or they can run as independent web pages. - -## An example - -Our ~page:quickstart:quickstart tutorial~ is a simplified version of the following demo: - -~embed:https://easycoder.github.io/iwsy/resources/scripts/demo.json~ - -## Quickstart tutorial - -These help pages contain everything there is to know about ~iwsy~, but there's a lot to read. Most people just want to get started quickly so we built a ~page:quickstart:quickstart tutorial~ where you can create a simple presentation - some slides with text and pictures - in an hour or so. Once you've completed this first step you'll have a pretty good idea of what ~iwsy~ is all about, and the rest of the help pages won't be nearly as intimidating. - -## Feature summary - -There are many slideshow/presentation packages, most being quite similar to PowerPoint. The aim here is not to create another clone but to tackle one or two of the things the others don't do so well. Top of the list is the ability to embed a show into another web page in a seamless manner. The development of ~iwsy~ is driven by the desire to meet this need rather than to excel at formal presentations. - -The other difference is in making the pages themselves dynamic. This covers a number of areas such as transitions, "Ken Burns" effects and the use of audio. - -The basic features of ~iwsy~ are: - - - A step editor, where you create a set of steps that together form your presentation - - A block editor, where you define templates to control where things appear on the screen - - A content editor, where you keep all the text that will be shown in your presentation - - A presentation viewer that runs your shows or displays any step - - A block viewer to visualise your blocks - - User management - each user has their own account and storage area - - Image management - users can create folders, upload/delete images and so on - - Built-in help - what you're reading - - A ~page:quickstart:quick-start tutorial~ - -## Background - -~iwsy~ started at the beginning of May 2020 with a need to embed a slide show in a web page, but rather than just a sequence of pictures I wanted something between that and a video. Videos are time-consuming to make and almost impossible to alter when changes happen to the things being described. Presentation packages such as PowerPoint, on the other hand, are very flexible when it comes to making changes but lack extensive animation features and are hard to embed in a web page. It seemed to me there was room between the two for a new type of product, and once the idea took hold it was hard to put down. It coincided with the Coronoavirus pandemic, which enforced solitude at home and provided the time for development to take place. - -~page:contents:Contents~ diff --git a/iwsy/resources/help/project.md b/iwsy/resources/help/project.md deleted file mode 100644 index 314d147..0000000 --- a/iwsy/resources/help/project.md +++ /dev/null @@ -1,40 +0,0 @@ -~page:contents:Contents~ - -# The Project panel - -The right-hand side of the screen holds the Project panel. When you start up - or after you click the ~img:https://easycoder.github.io/iwsy/resources/icon/new.png|icon~(New) button - it looks like this: -~img:https://easycoder.github.io/iwsy/resources/help/img/project.png|100%~ - -There are 5 sections. - -## 1 - Steps - -This lists the steps of your presentation. These are in some way analogous to the 'slides' of a PowerPoint presentation. A step is any action that affects the presentation, whether it causes a visual change or not. Every presentation starts with an `init` step where you define the size and proportions of your screen. This step is already provided, with its name on a clickable button. When you click the button it opens the ~page:action-init:`init` step editor~. All the action types are documented in their own pages - see the ~page:contents:Contents~. - -To the left of the button is a tiny ~img:/resources/icon/binoculars.png:icon~ binoculars symbol. When you click one of these the panel on the left - called the _player_ - shows you what the presentation looks like at this step. - -To the right of the button is a ~img:/resources/icon/plus.png:icon~ plus symbol, that when clicked adds a new step to the end of the presentation. See ~page:addStep:Adding a step~. - -## 2 - Blocks - -This lists the blocks used in your presentation. A block is a rectangular area of the screen that can contain text, an image or some of each. - -It's common to use the same layout for multiple slides in a presentation, and one of the problems with PowerPoint is how difficult it is to change a layout once set. Sometimes the only way is to edit the numerical coordinates of the text and other blocks on each slide; a time-consuming and error-prone task. - -~iwsy~ takes a different approach. You define all the different type of block that will be used, giving each one a name, then use them on as many slides as you like. To make changes you then just need to edit the block definition; all the slides that use it will take on the new size and position. See ~page:addBlock:Adding a block~. - -## 3 - Content - -This lists all the content text items used in your presentation. Each one is named. In the step editor you assign content to blocks by clicking names from a drop-down list. This makes it much easier to see what is where than by having the full text visible at each point. - -All content text is written using **_MarkDown_**; a format that is mostly plain text, plus simple markup tags to define headers and other text features. ~iwsy~ provides a set of custom MarkDown extensions that define image and other attributes. These help pages are written using the same system. See ~page:addContent:Adding content~. - -## 4 - VFX - -VFX stands for "Visual Effects". At this time we only have one; a pan and zoom. With this you can implement the "Ken Burns Effect", named after its inventor, a New York based documentary film maker. The effect is widely used in television to bring movement to still photos, without which the eye rapidly gets bored. The amount of movement can be very slight but the eye is tricked into thinking it's looking at video. The effect is demonstrated on our ~page:iwsy:Home and Introduction~ page. - -This section is where you supply all the data needed to achieve the effect for a single image. - -## 5 - JSON - -In this section you have a listing of the entire script as a JSON file. You can view and edit any of the sections or copy/paste. diff --git a/iwsy/resources/help/quickstart.md b/iwsy/resources/help/quickstart.md deleted file mode 100644 index 5565970..0000000 --- a/iwsy/resources/help/quickstart.md +++ /dev/null @@ -1,71 +0,0 @@ -~page:contents:Contents~ - -# ~iwsy~ Quickstart - -This tutorial will quickly take you through all the steps needed to build your first ~iwsy~ presentation. Everything you need is here and everything will be explained. You don't have to register with ~iwsy~ to try it out, so no messing around with login and registration screens. - -Presentations can be simple or they can be highly complex and detailed. The computer can't tell what's in your head so everything has to be spelled out in minute detail. With ~iwsy~, much of the work is in the preparation; deciding what the presentation should look like, its block positions and sizes, what transitions and effects are wanted and so on. Once these things are out of the way the remainder of the work gets a lot simpler. This tutorial covers some of the things you will need if you are to do any more than just present one static slide after another. It's likely you'll need at least an hour to complete this tutorial. - -The first thing to do is define a _block_. This is an area of the screen having a defined position and size, to contain text and/or images. - -## Your first block - -Click the **Blocks** button over in the right-hand panel, then click the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ at the right-hand end of the title row. Now click the button titled "New Block". You should get this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/newblock.png|100%~ - -Most of these default values are fine as they are; they describe a block that occupies the whole window area. Let's just change the ~m:name~ property to ~m:background~ and the ~m:background~ property to ~m:url('https://easycoder.github.io/iwsy/resources/help/quickstart/SemoigoDawn.jpg')~. Be sure to use single-quotes as shown. When the presentation runs, the effect will be to display a full-size image. This is what the panel should look like now: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/first-block.png|100%~ - -Now let's save our work. There's a **Save** button in the editor panel but this just anchors your changes and updates titles etc. You really need to save the entire project. If you are registered it will go to the ~iwsy~ website, but if not it will be saved to your browser's own storage space. Type the name ~m:quickstart~ in the **Script name** box under the main button bar, then click the ~img:https://easycoder.github.io/iwsy/resources/icon/save.png|icon~ icon in the button bar. It's highly recommended that you click this button regularly so you don't lose your work in the event of something going wrong. - -The effect I want to create is for the image to fade up out of the screen background. So let's go to to the **Steps** editor and make that happen. - -## Adding some steps - -The ~m:init~ step provides information about the container to be used for the show. Its default values are fine so there's no need to make any changes here. So we'll add a second step. Click the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ to add the new step, then click the **New step** button. You should see this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/newstep.png|100%~ - -Click in the Action box and a drop-down list appears of all the available step types: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/actions.png|100%~ - -We'll start with a short pause. When the browser switches to full-screen mode it displays a message for a couple of seconds so we'd like to wait for this to disappear before starting our show. Choose ~m:pause~, then set the ~m:Name~ property to ~m:pause before starting~. We'll have a 2-second pause so set the duration to 2 then click **Save**. - -Now click ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ again to add another step. It too starts as **New Step** so click that. As before, click to open the ~m:Action~ list. We want to set up (initialize) our background block,so choose ~m:set~ ~m:content~. Set the ~m:Name~ property to ~m:set up background~, then click **Save**. It should now look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/setup-background.png|100%~ - -The ~m:set~ ~m:content~ action lets you set up any number of blocks at the same time, though here we only have one. Click the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ in the **Blocks** row, then click the empty selector under the **Blocks** title. A drop-down list appears with the name of the block we created earlier: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/select-background-block.png|100%~ - -so select that. The block has no text, just the background defined in the block itself, so leave the **Content** drop-down list empty. Click the **Save** button for this step, then click the ~img:https://easycoder.github.io/iwsy/resources/icon/save.png|icon~ icon in the button bar. - -## Fading up - -Now we have a block with a background, so let's fade it up. Click ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ again or click the **Add step after** button. In the new step, open the editor, select the **fade up** action and give it the name ~m:fade up background~. It should look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/fade-up-background.png|100%~ - -This action lets you fade up as many blocks as you like simultaneously, so it provides you with the means to add a list. Here we only have a single block so we'll add that. Click the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ in the **Blocks** row, then click the empty selector in the new row and choose **background** again. Finally set the duration of the fade to a suitable value; say 2 (seconds). You can use decimal fractions here if you need to. It should now look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/fade-up-background2.png|100%~ - -If you haven't saved your project recently, do it now. - -## Watch it run! - -Now it's time to test your work, which will cause this help panel to disappear, but don't worry; you can bring it back by clicking the ~img:https://easycoder.github.io/iwsy/resources/icon/help.png|icon~ button in the toolbar. - -You have 2 run options. The ~img:https://easycoder.github.io/iwsy/resources/icon/run.png|icon~ button runs the presentation inside ~iwsy~, in the left-hand panel currently occupied by this Help page. The ~img:https://easycoder.github.io/iwsy/resources/icon/fullscreen.png|icon~ button runs it full-screen. Note: It is possible that the full-screen mode may not always start up properly; if you have trouble then put your browser into full-screen mode yourself before clicking ~img:https://easycoder.github.io/iwsy/resources/icon/fullscreen.png|icon~. - -Click the ~img:https://easycoder.github.io/iwsy/resources/icon/run.png|icon~ or ~img:https://easycoder.github.io/iwsy/resources/icon/fullscreen.png|icon~ icon in the button bar and enjoy watching your steps run! - -A couple of things to note. One is that as the presentation runs the steps in the editor take on green backgrounds. With only a single fade this happens too quickly to see, but in a longer presentation you can see where you are at all times. - -Another thing is that you can click the ~img:https://easycoder.github.io/iwsy/resources/icon/binoculars.png|icon~ icon for any step to see what the presentation looks like at that step. The program invisibly runs the entire presentation up to the step you clicked, then runs that step, giving the button a blue background. - -in ~page:quickstart2:Part 2~ we'll add some text to the presentation. diff --git a/iwsy/resources/help/quickstart/SemoigoDawn.jpg b/iwsy/resources/help/quickstart/SemoigoDawn.jpg deleted file mode 100644 index bffbab5..0000000 Binary files a/iwsy/resources/help/quickstart/SemoigoDawn.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/actions.png b/iwsy/resources/help/quickstart/actions.png deleted file mode 100644 index 7da139e..0000000 Binary files a/iwsy/resources/help/quickstart/actions.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/apricale.jpg b/iwsy/resources/help/quickstart/apricale.jpg deleted file mode 100644 index dcaa2c5..0000000 Binary files a/iwsy/resources/help/quickstart/apricale.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/buttons.png b/iwsy/resources/help/quickstart/buttons.png deleted file mode 100644 index 5148b7e..0000000 Binary files a/iwsy/resources/help/quickstart/buttons.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/center-title.png b/iwsy/resources/help/quickstart/center-title.png deleted file mode 100644 index fe427e9..0000000 Binary files a/iwsy/resources/help/quickstart/center-title.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/cinqueterre.jpg b/iwsy/resources/help/quickstart/cinqueterre.jpg deleted file mode 100644 index 0963d40..0000000 Binary files a/iwsy/resources/help/quickstart/cinqueterre.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/fade-down-bg.png b/iwsy/resources/help/quickstart/fade-down-bg.png deleted file mode 100644 index 617e69b..0000000 Binary files a/iwsy/resources/help/quickstart/fade-down-bg.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/fade-down.png b/iwsy/resources/help/quickstart/fade-down.png deleted file mode 100644 index 7a7ab7a..0000000 Binary files a/iwsy/resources/help/quickstart/fade-down.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/fade-up-background.png b/iwsy/resources/help/quickstart/fade-up-background.png deleted file mode 100644 index 971d6b2..0000000 Binary files a/iwsy/resources/help/quickstart/fade-up-background.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/fade-up-background2.png b/iwsy/resources/help/quickstart/fade-up-background2.png deleted file mode 100644 index 1f478c4..0000000 Binary files a/iwsy/resources/help/quickstart/fade-up-background2.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/fade-up-manarola.png b/iwsy/resources/help/quickstart/fade-up-manarola.png deleted file mode 100644 index 5ffceff..0000000 Binary files a/iwsy/resources/help/quickstart/fade-up-manarola.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/final-1.png b/iwsy/resources/help/quickstart/final-1.png deleted file mode 100644 index 2399e48..0000000 Binary files a/iwsy/resources/help/quickstart/final-1.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/final-2.png b/iwsy/resources/help/quickstart/final-2.png deleted file mode 100644 index aded2ce..0000000 Binary files a/iwsy/resources/help/quickstart/final-2.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/first-block.png b/iwsy/resources/help/quickstart/first-block.png deleted file mode 100644 index 0ead648..0000000 Binary files a/iwsy/resources/help/quickstart/first-block.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/imperia.jpg b/iwsy/resources/help/quickstart/imperia.jpg deleted file mode 100644 index dc682a3..0000000 Binary files a/iwsy/resources/help/quickstart/imperia.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/main-title.png b/iwsy/resources/help/quickstart/main-title.png deleted file mode 100644 index 996a300..0000000 Binary files a/iwsy/resources/help/quickstart/main-title.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-1.jpg b/iwsy/resources/help/quickstart/manarola-1.jpg deleted file mode 100644 index 02cf585..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-1.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-2.jpg b/iwsy/resources/help/quickstart/manarola-2.jpg deleted file mode 100644 index 9b9cdf3..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-2.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-content.png b/iwsy/resources/help/quickstart/manarola-content.png deleted file mode 100644 index 94d9232..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-content.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-photo.png b/iwsy/resources/help/quickstart/manarola-photo.png deleted file mode 100644 index 4487668..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-photo.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-text-2.png b/iwsy/resources/help/quickstart/manarola-text-2.png deleted file mode 100644 index 68a4055..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-text-2.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola-text.png b/iwsy/resources/help/quickstart/manarola-text.png deleted file mode 100644 index 24194c0..0000000 Binary files a/iwsy/resources/help/quickstart/manarola-text.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/manarola.jpg b/iwsy/resources/help/quickstart/manarola.jpg deleted file mode 100644 index 0de94fb..0000000 Binary files a/iwsy/resources/help/quickstart/manarola.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/new-block.png b/iwsy/resources/help/quickstart/new-block.png deleted file mode 100644 index 1660393..0000000 Binary files a/iwsy/resources/help/quickstart/new-block.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/new-content.png b/iwsy/resources/help/quickstart/new-content.png deleted file mode 100644 index 4ac29ad..0000000 Binary files a/iwsy/resources/help/quickstart/new-content.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/newblock.png b/iwsy/resources/help/quickstart/newblock.png deleted file mode 100644 index cc9533a..0000000 Binary files a/iwsy/resources/help/quickstart/newblock.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/newstep.png b/iwsy/resources/help/quickstart/newstep.png deleted file mode 100644 index f3be17a..0000000 Binary files a/iwsy/resources/help/quickstart/newstep.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/noli.jpg b/iwsy/resources/help/quickstart/noli.jpg deleted file mode 100644 index 7691d5a..0000000 Binary files a/iwsy/resources/help/quickstart/noli.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/pause.png b/iwsy/resources/help/quickstart/pause.png deleted file mode 100644 index 3b986bf..0000000 Binary files a/iwsy/resources/help/quickstart/pause.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/savona.jpg b/iwsy/resources/help/quickstart/savona.jpg deleted file mode 100644 index 38455cd..0000000 Binary files a/iwsy/resources/help/quickstart/savona.jpg and /dev/null differ diff --git a/iwsy/resources/help/quickstart/select-background-block.png b/iwsy/resources/help/quickstart/select-background-block.png deleted file mode 100644 index 81a7c36..0000000 Binary files a/iwsy/resources/help/quickstart/select-background-block.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/setup-all-blocks.png b/iwsy/resources/help/quickstart/setup-all-blocks.png deleted file mode 100644 index 9d29ba2..0000000 Binary files a/iwsy/resources/help/quickstart/setup-all-blocks.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/setup-background.png b/iwsy/resources/help/quickstart/setup-background.png deleted file mode 100644 index 3d6c5b7..0000000 Binary files a/iwsy/resources/help/quickstart/setup-background.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/setup-blocks-2.png b/iwsy/resources/help/quickstart/setup-blocks-2.png deleted file mode 100644 index a3297bd..0000000 Binary files a/iwsy/resources/help/quickstart/setup-blocks-2.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/setup-blocks.png b/iwsy/resources/help/quickstart/setup-blocks.png deleted file mode 100644 index dadfb4c..0000000 Binary files a/iwsy/resources/help/quickstart/setup-blocks.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/setup-manarola.png b/iwsy/resources/help/quickstart/setup-manarola.png deleted file mode 100644 index 9e96422..0000000 Binary files a/iwsy/resources/help/quickstart/setup-manarola.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart/zoom-title.png b/iwsy/resources/help/quickstart/zoom-title.png deleted file mode 100644 index 83d365a..0000000 Binary files a/iwsy/resources/help/quickstart/zoom-title.png and /dev/null differ diff --git a/iwsy/resources/help/quickstart2.md b/iwsy/resources/help/quickstart2.md deleted file mode 100644 index 80f521a..0000000 --- a/iwsy/resources/help/quickstart2.md +++ /dev/null @@ -1,55 +0,0 @@ -~page:contents:Contents~ - -# ~iwsy~ Quickstart, part 2 - -In ~page:quickstart:Part 1~ we created a presentation that just fades up a background panel. In this part we'll add some text to it and look at some of the actions available. - -After the background has appeared, let's hold it on the screen for a couple of seconds. As before, add a new step at the end of your presentation, then go into its editor and name it ~m:pause 2 seconds~. Click the empty selector next to the **Action** label and select the **pause** option. Set the **Duration** to ~m:2~ then save the step (or click ~img:/resources/icon/save.png:icon~ as before). - -We're going to bring up some text in the center of the screen, zooming it from a point below the center line. This presentation is to be some slides about villages in Liguria, the region of Italy that borders the northern Mediterranean, so let's create our first content item. Click the **Content** button and then the ~img:/resources/icon/plus.png:icon~ icon. Open the editor for the new item; it should look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/new-content.png|100%~ - -Set the name to ~m:Ligurian villages~ then put the same text into the empty box. As usual, save your work. - -What you've done is create a content item whose name is the same as its content (but it usually won't be). When you refer to the name in the **Steps** editor you get the content, so if you use the same content in several places this saves repeating it each time and ensures all the affected slides get changed at once. - -The title will end up in the middle of the screen, but to make it more challenging let's get it to zoom up from a point in the bottom third of the screen. For this we need 2 blocks. One holds the text and defines the starting point of the zoom effect. The other holds the final position of the block after the zoom has finished. - -Click the **Blocks** button and create 2 new blocks (I'm assuming you know how to do that; we covered it in ~page:quickstart:Part 1~). Make the first one look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/main-title.png|100%~ - -and the other like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/center-title.png|100%~ - -The differences are in the ~m:top~, ~m:height~ and ~m:fontSize~ values. The transition effect you'll be using animates the text as it moves from the first to the second state. It can also change the color of the text as it goes, but we're not doing that here. - -All of the numbers you see are _mils_ - that's thousandths of the width or height of the block's container, normally the window. (Though you can use the **parent** field to make a block a child of another block.) If you are proficient with CSS and would like to use its values you can do so, but the results can vary from one screen to another. The sharp-eyed may also be wondering why the **top** value of the second block is only set at 150; this is because the text renderer displays items as HTML ~m:>p<~ tags with margins and padding set by your browser. There are ways to get round this; see the detailed manual pages. - -You may like to note that in the **Blocks** panel each block has a ~img:https://easycoder.github.io/iwsy/resources/icon/binoculars.png|icon~ icon next to it. If you click one of these you will see where your block is on the screen. - -Now go to the **Steps** panel. The first thing to do is to initialize the **main title** block by adding it to the set of blocks that are initialized in the **set up background** step, so click this step to open its editor: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/setup-background.png|100%~ - -Click the ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png:icon~ in the **Blocks** row to add a new block. Select the **main title** block and then select **Ligurian villages** from the **Content** drop-down list. Change the name of the step to **set up blocks** and the result should be: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/setup-blocks-2.png|100%~ - -If you prefer, you can add a separate step to initialize each block, but in this case we'll do them all at the same time, in one place. - -The animated text effect is done with a **transition** action. Add a new step to your presentation, choose the action type **transition** and call it **zoom up title**. Set **block** to **main title** and **target** to **center title**: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/zoom-title.png|100%~ - -Now you can run your presentation again. The background will fade up first, then after a couple of seconds the text will zoom up. - -Add another pause, say 3 seconds, then another action, selecting **fade down**. Call it **fade down title and background**. Add 2 blocks, picking **main title** and **background**. Set the duration to 2 seconds. You should have this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/fade-down.png|100%~ - -Finally, add another pause of a second. - -In the ~page:quickstart3:final part of this tutorial~ we'll add the first of what might in a real presentation be a large number of similar slides, each one describing a different Ligurian village. diff --git a/iwsy/resources/help/quickstart3.md b/iwsy/resources/help/quickstart3.md deleted file mode 100644 index 3c54a79..0000000 --- a/iwsy/resources/help/quickstart3.md +++ /dev/null @@ -1,79 +0,0 @@ -~page:contents:Contents~ - -# ~iwsy~ Quickstart, part 3 - -In ~page:quickstart:Part 1~ and ~page:quickstart2:Part 2~ we created an introduction that fades up a background panel and zooms up a title. In this part we'll add some typical presentation page, one of what would often be many having a similar format. Our theme is Ligurian villages and here we'll add the first one; Manarola, one of the famous Cinque Terre villages. - -Click the **Content** button opposite, then click ~img:https://easycoder.github.io/iwsy/resources/icon/plus.png|icon~ to add a new content item. Set the name to ~m:Manarola~ then paste the following text into the empty box: - -> ~m:Cinque Terre - Manarola~ -> ~m:Romantic Manarola – a hamlet of Riomaggiore – spills down a ravine to the wild and rugged Cinque Terre coastline. Besides its natural beauty, the village is also famous for its sweet Sciacchetrà wine, celebrated by Gabriele D'Annunzio in one of his amazing poems. Manarola has brightly painted houses, priceless medieval relics and a tiny harbour that features a boat ramp and a swimming hole; to the north, on the way to Corniglia, there's a stunning viewpoint (Punta Bonfiglio) where visitors can enjoy a drink in a bar between the village’s cemetery and the sea. Everywhere is the scent of the lemon trees, thyme, rosemary and Mediterranean maquis; the grapevines – grown on terraces – embrace the village in a tight hug.~ - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-content.png|100%~ - -As usual, save your work, then click the **Blocks** button. We'll have a 2-column layout with text on one side and a photo on the other. Create 2 new blocks and edit them so they look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-text.png|100%~ - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-photo.png|100%~ - -Now Click the **Steps** button. We need a **set content** step; we could add to the one we created at the start but sometimes it makes more sense to do it where it will be used. Add a new step; pick the **set content** action, call it **setup manarola** then add a block; pick **manarola text** and for its content pick **manarola**. Make the step look like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/setup-manarola.png|100%~ - -This operation may need time to complete, so let's do it before the block is visible. Add a **pause** of 1 second. - -Now add another new step and get it looking like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/fade-up-manarola.png|100%~ - -This step operates on a pair of blocks, which will fade up concurrently. Note that the fade animation will not wait for the content to be ready before starting. Where text has embedded images it takes time to download and render them; this is done at the **set content** step so it's always best to have a pause just after to allow the processing work to complete. - -Now run your presentation. If everything is correct it should end up like this: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-1.jpg|100%~ - -This is OK but obviously needs a little tweaking here and there. Start with the **manarola text** block and adjust it a little, adding a text margin on the left (which also adds the same on the right): - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-text-2.png|100%~ - -Next, go to the **Content**, select the **Manarola** item and put `"## "` - that's 2 # characters and a space - in front of the first word (CINQUE). Then put a line break after MANAROLA. This will turn the first line into a level 2 header. - -Finally, add the following just in front of the word Romantic, at the start of the text: - -~m:~img:https://easycoder.github.io/iwsy/resources/help/quickstart/cinqueterre.jpg|left 50%~~ - -This adds an image into the text, using a custom addition to the MarkDown syntax. Everything between the 2 tildes (~) is treated as a special command. It starts with **img:**, which signifies it's an image tag. The URL of the image then follows, after which is another colon then some special tags, in this case one to force the image to "float" to the left and the other being to give it 50% of its container width. Those who are familar with CSS should have little trouble seeing what's happening here. The markup causes HTML to be generated to perform the desired task, but you can in fact insert HTML directly into the file if you need some feature we don't offer. (Though this somewhat negates the purpose of using MarkDown in the first place.) - -Run the presentation again: - -~img:https://easycoder.github.io/iwsy/resources/help/quickstart/manarola-2.jpg|100%~ - -Ah, this is a lot better. You may want to adjust the size of the font (in the **manarola text** block) so it fills the screen better, but you'll find you get different results on different browsers. For some reason, Chrome gives smaller text than Firefox does for the same numerical value. - -The rest of the items are similar to what we already have. Create another **Content** item called **Apricale**, with this content: - -> ~m:## Provincia di Imperia - Apricale~ -> ~m:~img:https://easycoder.github.io/iwsy/resources/help/quickstart/imperia.jpg|left 50%~Apricale is a picturesque small village to the north-east of Dolceacqua in western Liguria and surrounded by forested hills, included on the list of the 'most beautiful villages in Italy'.~ -> ~m:Just one of several attractive hill villages in this region, Apricale is compact and easy to explore. Most of the sights of interest are on or very close to the square in the centre of the village, although of course you will also want to follow the main street along the ridge to enjoy more views and to appreciate the medieval character of Apricale."~ - -Create a third village **Content** item called **Noli**: - -> ~m:## ## Provincia di Savona - Noli~ -> ~m:~img:https://easycoder.github.io/iwsy/resources/help/quickstart/savona.jpg|left 50%~The seaside village of Noli lies a few km west of Savona, in the central part of Liguria. Although popular with Italians it's scarcely known to anyone else outside of the area. It's a beautiful quiet and relatively unspoiled gem, with a good beach and right behind it the old town with pedestrian-only streets and a sprinkling of shops and restaurants, all preserving the ancient architecture and topped by a small castle. Although it lies on the main "Via Aurelia" coast road, all the through traffic now goes on the Autostrada, leaving Noli free from noisy vehicles. The coast road is also spectacular and it's well worth forsaking the motorway to explore the coastline between Savona and the busy resorts of Finale Ligure and Loano."~ - -Then create 2 more pairs of **Blocks** similar to the ones for **Manarola**, calling them **apricale text**, **apricale photo**, **noli text** and **noli photo**. The 3 text blocks are in fact identical; the photo blocks only differ by the name of the image file; these 2 are **apricale.jpg** and **noli.jpg**. - -Create a **set content** item for **Apricale** similar to the one for **Manarola**. - -Add a **pause** of a suitable length - say 10 seconds - to hold the **Manarola** page. - -The transitions from one village to the next comprise a fade-down and a fade-up, running concurrently. So for the **Manarola** to **Apricale** transition, add a new **Step**, choosing the **fade down** action. Add both the **manarola text** and **manarola photo** blocks, choose a suitable duration and set the **Continue** flag **true**. This will cause the next action to start without waiting for this one to complete. As both animations run concurrently they give the impression of a crossfade. - -The action in question is a new **fade up** action. Give it the **apricale text** and **apricale photo** blocks, use the same duration as the fade down but leave **Continue** **false**. - -By this time you should be able to handle the transition from **Apricale** to **Noli** without any help. - -As described earlier, after each pair of fade down and fade up, prepare the next item with **set content** and put in a 10-second pause. When you have finished, your presentation should run as a simplified version of the demo that appears on ~page:iwsy:the main Help page~. - -And with that we arrive at the end of the Quickstart tutorial. We've really only skimmed the surface but you should at least have an idea of what ~iwsy~ is all about and whether you're likely to want to use it. In the ~page:contents:Contents~ you'll find a lot more detail about all aspects of this web app, as well as contact details and an invitation to join the development team if you wish. diff --git a/iwsy/resources/help/start.md b/iwsy/resources/help/start.md deleted file mode 100644 index 42e01f3..0000000 --- a/iwsy/resources/help/start.md +++ /dev/null @@ -1,4 +0,0 @@ -~page:contents:Contents~ - -# Starting a project - diff --git a/iwsy/resources/help/technical.md b/iwsy/resources/help/technical.md deleted file mode 100644 index a0fb705..0000000 --- a/iwsy/resources/help/technical.md +++ /dev/null @@ -1,29 +0,0 @@ -~page:contents:Contents~ - -# Technical stuff - -The ~iwsy~ presentation engine is about 1200 lines of vanilla JavaScript. It can be loaded from a CDN and be included in any web page. To avoid name clashes it comprises a single JavaScript object called `IWSY`. - -Rather than relying on graphic libraries, ~iwsy~ leverages the power of CSS to create animated slideshows. A good deal of processing power is needed to achieve smooth animation but computer performance increases year by year, bringing improved graphic performance along with it. - -All of the animations and transitions in this package have a smooth start and finish, achieved wih a cosine function. - -## The UI - -The UI of this website is coded in [**_EasyCoder_**](easycoder.github.io), a high-level scripting language that takes plain text scripts and compiles them in the browser as they are required. **_EasyCoder_** scripts tend to be much shorter than their JavaScript equivalents, and more importantly they are readable by any intelligent person who understands the target domain, so the long term maintenance prospects of an **_EasyCoder_** website such as ~iwsy~ are good as there will always be someone around who can learn it quickly. - -The presentation engine itself can be used independently of the ~iwsy~ website. The project is [hosted on GitHub](https://github.com/easycoder/easycoder.github.io/tree/master/iwsy) as part of **_EasyCoder_** and enquiries are welcome from other programmers who are interested in contributing. The range of transition effects is currently limited so there is considerable scope for extension. An outline plug-in mechanism is present so it should be possible to enhance the system without major disruption each time. - -The UI comprises about 3500 lines of EasyCoder scripts. The longest of these, at about 1100 lines, compiles in under 40ms on mid-range (core-i5) hardware. - -[Pingdom Tools](https://tools.pingdom.com/) report a page load time of just over a second. - -## Structure - -The home page of a EasyCoder website is usually a bootloader for the application scripts themselves. These are plain text files that load on demand and are compiled on the fly by the EasyCoder runtime library. There is no build process and the only tool required is a text editor. - -User management is done with a small PHP REST module that runs on the server and keeps records either in a database or in file storage. Each user is allocated a directory on the server in which are their scripts and uploaded images, the latter which are scaled to a maximum width of 1200 pixels to avoid excessive file sizes. - -The ~iwsy~ website can be used without any login but the features available are restricted. In particular, the file manager is not available so if images are wanted they must be provided as independent URLs. Scripts can still be saved, but go into browser storage. - -~page:contents:Contents~ diff --git a/iwsy/resources/help/users.md b/iwsy/resources/help/users.md deleted file mode 100644 index ddfd5aa..0000000 --- a/iwsy/resources/help/users.md +++ /dev/null @@ -1,19 +0,0 @@ -~page:contents:Contents~ - -# User registration and login - -~iwsy~ can be used without registering, in which case you are an anonymous user of the system. This is OK if all you want to do is evaluate ~iwsy~, though not all its features will be available to you. Any presentations you create will be saved to your local browser storage area and will be unavailable anywhere else. If you later decide to log in you can transfer these presentations to your own private area on the ~iwsy~ website. - -## Registration - -On the left-hand side of the page, above this help panel, are a row of buttons with ~img:https://easycoder.github.io/iwsy/resources/icon/user.png:{width:1em}~ by itself at the right-hand end. This is the login button. When you click it a panel appears: - -~img:https://easycoder.github.io/iwsy/resources/help/img/login.png:100%~ - -To register as a user, click the **Register** button. The panel then changes to: - -~img:https://easycoder.github.io/iwsy/resources/help/img/register.png:100%~ - -Fill in all the fields and click **Register**. A popup message will appear, telling you to wait for a confirmation code to arrive by email. The registration form will have gained an extra line where you can type the 6-digit code that arrives. Click **Confirm Registration** and the form will disappear. The icon in the toolbar will now show ~img:https://easycoder.github.io/iwsy/resources/help/img/user-loggedin.png:{width:1em}~ to indicate you are registered and logged in. If you click this icon you will be logged out again. - -~page:project:The Project panel~ diff --git a/iwsy/resources/icon/apple.png b/iwsy/resources/icon/apple.png deleted file mode 100644 index 8b5223d..0000000 Binary files a/iwsy/resources/icon/apple.png and /dev/null differ diff --git a/iwsy/resources/icon/arrow-back.png b/iwsy/resources/icon/arrow-back.png deleted file mode 100644 index a375adc..0000000 Binary files a/iwsy/resources/icon/arrow-back.png and /dev/null differ diff --git a/iwsy/resources/icon/arrow-forward.png b/iwsy/resources/icon/arrow-forward.png deleted file mode 100644 index 0b128a4..0000000 Binary files a/iwsy/resources/icon/arrow-forward.png and /dev/null differ diff --git a/iwsy/resources/icon/binoculars.png b/iwsy/resources/icon/binoculars.png deleted file mode 100644 index 662cb85..0000000 Binary files a/iwsy/resources/icon/binoculars.png and /dev/null differ diff --git a/iwsy/resources/icon/book.png b/iwsy/resources/icon/book.png deleted file mode 100644 index 4ab688e..0000000 Binary files a/iwsy/resources/icon/book.png and /dev/null differ diff --git a/iwsy/resources/icon/cross.png b/iwsy/resources/icon/cross.png deleted file mode 100644 index e26d0c8..0000000 Binary files a/iwsy/resources/icon/cross.png and /dev/null differ diff --git a/iwsy/resources/icon/cycle.png b/iwsy/resources/icon/cycle.png deleted file mode 100644 index 5d07d8b..0000000 Binary files a/iwsy/resources/icon/cycle.png and /dev/null differ diff --git a/iwsy/resources/icon/document.png b/iwsy/resources/icon/document.png deleted file mode 100644 index 9fff790..0000000 Binary files a/iwsy/resources/icon/document.png and /dev/null differ diff --git a/iwsy/resources/icon/down.png b/iwsy/resources/icon/down.png deleted file mode 100644 index 6ad3480..0000000 Binary files a/iwsy/resources/icon/down.png and /dev/null differ diff --git a/iwsy/resources/icon/duckthink.jpg b/iwsy/resources/icon/duckthink.jpg deleted file mode 100644 index ce8acd4..0000000 Binary files a/iwsy/resources/icon/duckthink.jpg and /dev/null differ diff --git a/iwsy/resources/icon/edit.png b/iwsy/resources/icon/edit.png deleted file mode 100644 index 06146c4..0000000 Binary files a/iwsy/resources/icon/edit.png and /dev/null differ diff --git a/iwsy/resources/icon/exit.png b/iwsy/resources/icon/exit.png deleted file mode 100644 index d62aa95..0000000 Binary files a/iwsy/resources/icon/exit.png and /dev/null differ diff --git a/iwsy/resources/icon/fileman.png b/iwsy/resources/icon/fileman.png deleted file mode 100644 index 8bfaa07..0000000 Binary files a/iwsy/resources/icon/fileman.png and /dev/null differ diff --git a/iwsy/resources/icon/folder.png b/iwsy/resources/icon/folder.png deleted file mode 100644 index 812fc81..0000000 Binary files a/iwsy/resources/icon/folder.png and /dev/null differ diff --git a/iwsy/resources/icon/fullscreen.png b/iwsy/resources/icon/fullscreen.png deleted file mode 100644 index 467b27c..0000000 Binary files a/iwsy/resources/icon/fullscreen.png and /dev/null differ diff --git a/iwsy/resources/icon/gear.png b/iwsy/resources/icon/gear.png deleted file mode 100644 index 6742ffd..0000000 Binary files a/iwsy/resources/icon/gear.png and /dev/null differ diff --git a/iwsy/resources/icon/heart.png b/iwsy/resources/icon/heart.png deleted file mode 100644 index 3fb40db..0000000 Binary files a/iwsy/resources/icon/heart.png and /dev/null differ diff --git a/iwsy/resources/icon/help.png b/iwsy/resources/icon/help.png deleted file mode 100644 index 8817c0b..0000000 Binary files a/iwsy/resources/icon/help.png and /dev/null differ diff --git a/iwsy/resources/icon/image.png b/iwsy/resources/icon/image.png deleted file mode 100644 index 30a8527..0000000 Binary files a/iwsy/resources/icon/image.png and /dev/null differ diff --git a/iwsy/resources/icon/iwsy.png b/iwsy/resources/icon/iwsy.png deleted file mode 100644 index 4c34060..0000000 Binary files a/iwsy/resources/icon/iwsy.png and /dev/null differ diff --git a/iwsy/resources/icon/left.png b/iwsy/resources/icon/left.png deleted file mode 100644 index 7a2e5ca..0000000 Binary files a/iwsy/resources/icon/left.png and /dev/null differ diff --git a/iwsy/resources/icon/list.png b/iwsy/resources/icon/list.png deleted file mode 100644 index 78fdf36..0000000 Binary files a/iwsy/resources/icon/list.png and /dev/null differ diff --git a/iwsy/resources/icon/media.png b/iwsy/resources/icon/media.png deleted file mode 100644 index d16c5fa..0000000 Binary files a/iwsy/resources/icon/media.png and /dev/null differ diff --git a/iwsy/resources/icon/new.png b/iwsy/resources/icon/new.png deleted file mode 100644 index 670a256..0000000 Binary files a/iwsy/resources/icon/new.png and /dev/null differ diff --git a/iwsy/resources/icon/open.png b/iwsy/resources/icon/open.png deleted file mode 100644 index a34aebb..0000000 Binary files a/iwsy/resources/icon/open.png and /dev/null differ diff --git a/iwsy/resources/icon/plus.png b/iwsy/resources/icon/plus.png deleted file mode 100644 index 6a8941c..0000000 Binary files a/iwsy/resources/icon/plus.png and /dev/null differ diff --git a/iwsy/resources/icon/reference.png b/iwsy/resources/icon/reference.png deleted file mode 100644 index d503a67..0000000 Binary files a/iwsy/resources/icon/reference.png and /dev/null differ diff --git a/iwsy/resources/icon/right.png b/iwsy/resources/icon/right.png deleted file mode 100644 index 9260b9a..0000000 Binary files a/iwsy/resources/icon/right.png and /dev/null differ diff --git a/iwsy/resources/icon/run.png b/iwsy/resources/icon/run.png deleted file mode 100644 index f48397e..0000000 Binary files a/iwsy/resources/icon/run.png and /dev/null differ diff --git a/iwsy/resources/icon/runstop.png b/iwsy/resources/icon/runstop.png deleted file mode 100644 index 46d7636..0000000 Binary files a/iwsy/resources/icon/runstop.png and /dev/null differ diff --git a/iwsy/resources/icon/save.png b/iwsy/resources/icon/save.png deleted file mode 100644 index e1ea3c2..0000000 Binary files a/iwsy/resources/icon/save.png and /dev/null differ diff --git a/iwsy/resources/icon/stop.png b/iwsy/resources/icon/stop.png deleted file mode 100644 index 3f7231c..0000000 Binary files a/iwsy/resources/icon/stop.png and /dev/null differ diff --git a/iwsy/resources/icon/teacher.png b/iwsy/resources/icon/teacher.png deleted file mode 100644 index e2a9eb8..0000000 Binary files a/iwsy/resources/icon/teacher.png and /dev/null differ diff --git a/iwsy/resources/icon/tools.png b/iwsy/resources/icon/tools.png deleted file mode 100644 index 5bb3101..0000000 Binary files a/iwsy/resources/icon/tools.png and /dev/null differ diff --git a/iwsy/resources/icon/trash.png b/iwsy/resources/icon/trash.png deleted file mode 100644 index 643fa22..0000000 Binary files a/iwsy/resources/icon/trash.png and /dev/null differ diff --git a/iwsy/resources/icon/unknown.png b/iwsy/resources/icon/unknown.png deleted file mode 100644 index dd56059..0000000 Binary files a/iwsy/resources/icon/unknown.png and /dev/null differ diff --git a/iwsy/resources/icon/up.png b/iwsy/resources/icon/up.png deleted file mode 100644 index 997a1bc..0000000 Binary files a/iwsy/resources/icon/up.png and /dev/null differ diff --git a/iwsy/resources/icon/user-loggedin.png b/iwsy/resources/icon/user-loggedin.png deleted file mode 100644 index 3867c0c..0000000 Binary files a/iwsy/resources/icon/user-loggedin.png and /dev/null differ diff --git a/iwsy/resources/icon/user.png b/iwsy/resources/icon/user.png deleted file mode 100644 index 87977a0..0000000 Binary files a/iwsy/resources/icon/user.png and /dev/null differ diff --git a/iwsy/resources/img/fullscreen.png b/iwsy/resources/img/fullscreen.png deleted file mode 100644 index b63dc81..0000000 Binary files a/iwsy/resources/img/fullscreen.png and /dev/null differ diff --git a/iwsy/resources/img/fullscreen.xcf b/iwsy/resources/img/fullscreen.xcf deleted file mode 100644 index f942865..0000000 Binary files a/iwsy/resources/img/fullscreen.xcf and /dev/null differ diff --git a/iwsy/resources/img/iwsy.xcf b/iwsy/resources/img/iwsy.xcf deleted file mode 100644 index bd42ce9..0000000 Binary files a/iwsy/resources/img/iwsy.xcf and /dev/null differ diff --git a/iwsy/resources/img/quickstart/SemoigoDawn.jpg b/iwsy/resources/img/quickstart/SemoigoDawn.jpg deleted file mode 100644 index bffbab5..0000000 Binary files a/iwsy/resources/img/quickstart/SemoigoDawn.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/action-crossfade.png b/iwsy/resources/img/quickstart/action-crossfade.png deleted file mode 100644 index 4084dbb..0000000 Binary files a/iwsy/resources/img/quickstart/action-crossfade.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/action-fade.png b/iwsy/resources/img/quickstart/action-fade.png deleted file mode 100644 index c190b09..0000000 Binary files a/iwsy/resources/img/quickstart/action-fade.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/action-show.png b/iwsy/resources/img/quickstart/action-show.png deleted file mode 100644 index d8e0f62..0000000 Binary files a/iwsy/resources/img/quickstart/action-show.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/actions.png b/iwsy/resources/img/quickstart/actions.png deleted file mode 100644 index 7da139e..0000000 Binary files a/iwsy/resources/img/quickstart/actions.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/apricale.jpg b/iwsy/resources/img/quickstart/apricale.jpg deleted file mode 100644 index 57c1880..0000000 Binary files a/iwsy/resources/img/quickstart/apricale.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/buttons.png b/iwsy/resources/img/quickstart/buttons.png deleted file mode 100644 index 5148b7e..0000000 Binary files a/iwsy/resources/img/quickstart/buttons.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/center-title.png b/iwsy/resources/img/quickstart/center-title.png deleted file mode 100644 index fe427e9..0000000 Binary files a/iwsy/resources/img/quickstart/center-title.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/cinqueterre.jpg b/iwsy/resources/img/quickstart/cinqueterre.jpg deleted file mode 100644 index 0963d40..0000000 Binary files a/iwsy/resources/img/quickstart/cinqueterre.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/fade-down-bg.png b/iwsy/resources/img/quickstart/fade-down-bg.png deleted file mode 100644 index 617e69b..0000000 Binary files a/iwsy/resources/img/quickstart/fade-down-bg.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/fade-up-background.png b/iwsy/resources/img/quickstart/fade-up-background.png deleted file mode 100644 index 971d6b2..0000000 Binary files a/iwsy/resources/img/quickstart/fade-up-background.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/fade-up-background2.png b/iwsy/resources/img/quickstart/fade-up-background2.png deleted file mode 100644 index 1f478c4..0000000 Binary files a/iwsy/resources/img/quickstart/fade-up-background2.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/fade-up-manarola.png b/iwsy/resources/img/quickstart/fade-up-manarola.png deleted file mode 100644 index 5ffceff..0000000 Binary files a/iwsy/resources/img/quickstart/fade-up-manarola.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/final-1.png b/iwsy/resources/img/quickstart/final-1.png deleted file mode 100644 index 2399e48..0000000 Binary files a/iwsy/resources/img/quickstart/final-1.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/final-2.png b/iwsy/resources/img/quickstart/final-2.png deleted file mode 100644 index aded2ce..0000000 Binary files a/iwsy/resources/img/quickstart/final-2.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/first-block.png b/iwsy/resources/img/quickstart/first-block.png deleted file mode 100644 index 8dc2461..0000000 Binary files a/iwsy/resources/img/quickstart/first-block.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/imperia.jpg b/iwsy/resources/img/quickstart/imperia.jpg deleted file mode 100644 index dc682a3..0000000 Binary files a/iwsy/resources/img/quickstart/imperia.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/main-title.png b/iwsy/resources/img/quickstart/main-title.png deleted file mode 100644 index 996a300..0000000 Binary files a/iwsy/resources/img/quickstart/main-title.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/manarola-content.png b/iwsy/resources/img/quickstart/manarola-content.png deleted file mode 100644 index f863a0f..0000000 Binary files a/iwsy/resources/img/quickstart/manarola-content.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/manarola-photo.png b/iwsy/resources/img/quickstart/manarola-photo.png deleted file mode 100644 index c6aa24d..0000000 Binary files a/iwsy/resources/img/quickstart/manarola-photo.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/manarola-text-2.png b/iwsy/resources/img/quickstart/manarola-text-2.png deleted file mode 100644 index 928d00c..0000000 Binary files a/iwsy/resources/img/quickstart/manarola-text-2.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/manarola-text.png b/iwsy/resources/img/quickstart/manarola-text.png deleted file mode 100644 index 24194c0..0000000 Binary files a/iwsy/resources/img/quickstart/manarola-text.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/manarola.jpg b/iwsy/resources/img/quickstart/manarola.jpg deleted file mode 100644 index cf7d941..0000000 Binary files a/iwsy/resources/img/quickstart/manarola.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/new-content.png b/iwsy/resources/img/quickstart/new-content.png deleted file mode 100644 index 4ac29ad..0000000 Binary files a/iwsy/resources/img/quickstart/new-content.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/newblock.png b/iwsy/resources/img/quickstart/newblock.png deleted file mode 100644 index cc9533a..0000000 Binary files a/iwsy/resources/img/quickstart/newblock.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/newstep.png b/iwsy/resources/img/quickstart/newstep.png deleted file mode 100644 index f3be17a..0000000 Binary files a/iwsy/resources/img/quickstart/newstep.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/noli.jpg b/iwsy/resources/img/quickstart/noli.jpg deleted file mode 100644 index 85096b1..0000000 Binary files a/iwsy/resources/img/quickstart/noli.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/pause.png b/iwsy/resources/img/quickstart/pause.png deleted file mode 100644 index 3b986bf..0000000 Binary files a/iwsy/resources/img/quickstart/pause.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/savona.jpg b/iwsy/resources/img/quickstart/savona.jpg deleted file mode 100644 index 38455cd..0000000 Binary files a/iwsy/resources/img/quickstart/savona.jpg and /dev/null differ diff --git a/iwsy/resources/img/quickstart/select-background-block.png b/iwsy/resources/img/quickstart/select-background-block.png deleted file mode 100644 index 81a7c36..0000000 Binary files a/iwsy/resources/img/quickstart/select-background-block.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/setup-all-blocks.png b/iwsy/resources/img/quickstart/setup-all-blocks.png deleted file mode 100644 index 9d29ba2..0000000 Binary files a/iwsy/resources/img/quickstart/setup-all-blocks.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/setup-background.png b/iwsy/resources/img/quickstart/setup-background.png deleted file mode 100644 index 3d6c5b7..0000000 Binary files a/iwsy/resources/img/quickstart/setup-background.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/setup-blocks.png b/iwsy/resources/img/quickstart/setup-blocks.png deleted file mode 100644 index dadfb4c..0000000 Binary files a/iwsy/resources/img/quickstart/setup-blocks.png and /dev/null differ diff --git a/iwsy/resources/img/quickstart/zoom-title.png b/iwsy/resources/img/quickstart/zoom-title.png deleted file mode 100644 index 83d365a..0000000 Binary files a/iwsy/resources/img/quickstart/zoom-title.png and /dev/null differ diff --git a/iwsy/resources/json/propertyDefaults.json b/iwsy/resources/json/propertyDefaults.json deleted file mode 100644 index 8f47a57..0000000 --- a/iwsy/resources/json/propertyDefaults.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "New block", - "parent": "", - "left": 0, - "top": 0, - "width": "1000", - "height": "1000", - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 50, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" -} diff --git a/iwsy/resources/json/propertyNames.json b/iwsy/resources/json/propertyNames.json deleted file mode 100644 index 26c4ec0..0000000 --- a/iwsy/resources/json/propertyNames.json +++ /dev/null @@ -1,19 +0,0 @@ -[ - "name", - "parent", - "left", - "top", - "width", - "height", - "background", - "border", - "borderRadius", - "fontFamily", - "fontSize", - "fontWeight", - "fontStyle", - "fontColor", - "textAlign", - "textMarginLeft", - "textMarginTop" -] diff --git a/iwsy/resources/plugins/test.js b/iwsy/resources/plugins/test.js deleted file mode 100644 index cd26523..0000000 --- a/iwsy/resources/plugins/test.js +++ /dev/null @@ -1,32 +0,0 @@ -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; diff --git a/iwsy/resources/scripts/demo.json b/iwsy/resources/scripts/demo.json deleted file mode 100644 index a0beda6..0000000 --- a/iwsy/resources/scripts/demo.json +++ /dev/null @@ -1,326 +0,0 @@ -{ - "steps": [ - { - "title": "Init", - "action": "init", - "label": "", - "aspect ratio": "160:89", - "background": "white", - "border": "1px solid black", - "css": "" - }, - { - "title": "pause before starting", - "action": "pause", - "label": "", - "duration": 2 - }, - { - "title": "set up background", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "background", - "content": "" - } - ], - "display": "hidden" - }, - { - "title": "fade up background", - "action": "fade up", - "label": "", - "blocks": [ - "background" - ], - "duration": 2, - "continue": false - }, - { - "title": "set up title and subtitle", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "main title", - "content": "main title" - }, - { - "block": "subtitle", - "content": "subtitle" - } - ], - "display": "hidden" - }, - { - "title": "zoom up title", - "action": "transition", - "label": "", - "blocks": [], - "duration": 2, - "block": "main title", - "target": "center title", - "continue": false - }, - { - "title": "pause", - "action": "pause", - "label": "", - "duration": 1 - }, - { - "title": "fade up subtitle", - "action": "fade up", - "label": "", - "blocks": [ - "subtitle" - ], - "duration": 1, - "continue": false - }, - { - "title": "pause", - "action": "pause", - "label": "", - "duration": 3 - }, - { - "title": "slide title left", - "action": "transition", - "label": "", - "duration": 3, - "block": "main title", - "target": "off left", - "continue": "yes" - }, - { - "title": "slide subtitle right", - "action": "transition", - "label": "", - "duration": 3, - "block": "subtitle", - "target": "off right", - "continue": "no" - }, - { - "title": "fade down background", - "action": "fade down", - "label": "", - "blocks": [ - "background" - ], - "duration": 3, - "continue": false - }, - { - "title": "set up 'For example'", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "message", - "content": "for example" - } - ] - }, - { - "title": "show 'For example'", - "action": "fade up", - "label": "", - "blocks": [ - "message" - ], - "duration": 0.5, - "continue": "" - }, - { - "title": "pause", - "action": "pause", - "label": "", - "duration": 4 - }, - { - "title": "hide text", - "action": "fade down", - "label": "", - "blocks": [ - "message" - ], - "duration": 0.5, - "continue": "" - }, - { - "title": "chain to liguria ", - "action": "chain", - "label": "", - "script": "liguria.json", - "path": "/resources/scripts/", - "mode": "admin" - } - ], - "blocks": [ - { - "defaults": { - "name": "background", - "parent": "", - "left": 0, - "top": 0, - "width": 1000, - "height": 1000, - "background": "url('https://easycoder.github.io/iwsy/resources/help/quickstart/SemoigoDawn.jpg')", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 50, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "main title", - "parent": "", - "left": 0, - "top": 800, - "width": 1000, - "height": 200, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 0, - "fontWeight": "", - "fontStyle": "", - "fontColor": "yellow", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "center title", - "parent": "", - "left": 0, - "top": 250, - "width": 1000, - "height": 700, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 80, - "fontWeight": "", - "fontStyle": "", - "fontColor": "yellow", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "subtitle", - "parent": "", - "left": 0, - "top": 450, - "width": 1000, - "height": 200, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 80, - "fontWeight": "", - "fontStyle": "", - "fontColor": "gold", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "off left", - "parent": "", - "left": -1000, - "top": 250, - "width": 1000, - "height": 700, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 80, - "fontWeight": "", - "fontStyle": "", - "fontColor": "yellow", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "off right", - "parent": "", - "left": 1000, - "top": 450, - "width": 1000, - "height": 200, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 80, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "message", - "parent": "", - "left": 0, - "top": 200, - "width": 1000, - "height": 800, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 70, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - } - ], - "content": [ - { - "name": "main title", - "content": "# I Wanna Show You" - }, - { - "name": "subtitle", - "content": "Embedded presentations and slide shows" - }, - { - "name": "for example", - "content": "## For example%0aHere are 3 slides from a presentation %0aabout villages in Liguria, Italy" - } - ], - "vfx": [] -} \ No newline at end of file diff --git a/iwsy/resources/scripts/liguria.json b/iwsy/resources/scripts/liguria.json deleted file mode 100644 index d35ee18..0000000 --- a/iwsy/resources/scripts/liguria.json +++ /dev/null @@ -1,557 +0,0 @@ -{ - "steps": [ - { - "title": "Init", - "action": "init", - "label": "", - "aspect ratio": "16:9", - "background": "white", - "border": "1px solid black", - "css": "" - }, - { - "title": "set up text blocks", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "manarola text", - "content": "Manarola" - }, - { - "block": "apricale text", - "content": "Apricale" - }, - { - "block": "noli text", - "content": "Noli" - } - ], - "display": "hidden" - }, - { - "title": "set up Manarola start", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "manarola photo", - "content": "Manarola start" - } - ], - "display": "block" - }, - { - "title": "set up Apricale start", - "action": "set content", - "label": "", - "duration": 9, - "blocks": [ - { - "block": "apricale photo", - "content": "Apricale start" - } - ], - "display": "block" - }, - { - "title": "set up Noli start", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "noli photo", - "content": "Noli start" - } - ], - "display": "block" - }, - { - "title": "---", - "action": "noop", - "label": "" - }, - { - "title": "position Manarola", - "action": "animate", - "label": "", - "block": "manarola photo", - "continue": "no" - }, - { - "title": "fade up Manarola", - "action": "fade up", - "label": "", - "blocks": [ - "manarola text", - "manarola photo" - ], - "duration": 3, - "continue": "no" - }, - { - "title": "set up Manarola finish", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "manarola photo", - "content": "Manarola finish" - } - ], - "display": "block" - }, - { - "title": "animate Manarola", - "action": "animate", - "label": "", - "block": "manarola photo", - "continue": "yes" - }, - { - "title": "pause 9 seconds", - "action": "pause", - "label": "", - "duration": 9 - }, - { - "title": "---", - "action": "noop", - "label": "" - }, - { - "title": "position Apricale", - "action": "animate", - "label": "", - "block": "apricale photo", - "continue": "no" - }, - { - "title": "setup Apricale finish", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "apricale photo", - "content": "Apricale finish" - } - ], - "continue": "no", - "display": "block" - }, - { - "title": "fade down Manarola", - "action": "fade down", - "label": "", - "duration": 1, - "blocks": [ - "manarola photo", - "manarola text" - ], - "continue": "yes" - }, - { - "title": "fade up Apricale", - "action": "fade up", - "label": "", - "blocks": [ - "apricale photo", - "apricale text" - ], - "duration": 1, - "continue": "yes" - }, - { - "title": "animate Apricale", - "action": "animate", - "label": "", - "block": "apricale photo", - "continue": "yes" - }, - { - "title": "pause 9 seconds", - "action": "pause", - "label": "", - "duration": 9 - }, - { - "title": "---", - "action": "noop", - "label": "" - }, - { - "title": "position Noli", - "action": "animate", - "label": "", - "block": "noli photo", - "continue": "no" - }, - { - "title": "set up Noli finish", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "noli photo", - "content": "Noli finish" - } - ], - "display": "block" - }, - { - "title": "fade down Apricale", - "action": "fade down", - "label": "", - "blocks": [ - "apricale photo", - "apricale text" - ], - "duration": 1, - "continue": "yes" - }, - { - "title": "fade up Noli", - "action": "fade up", - "label": "", - "blocks": [ - "noli photo", - "noli text" - ], - "duration": 1, - "continue": "yes" - }, - { - "title": "animate Noli", - "action": "animate", - "label": "", - "block": "noli photo", - "continue": "yes" - }, - { - "title": "pause 9 seconds", - "action": "pause", - "label": "", - "duration": 9 - }, - { - "title": "---", - "action": "noop", - "label": "" - }, - { - "title": "fade down Noli", - "action": "fade down", - "label": "", - "blocks": [ - "noli photo", - "noli text" - ], - "duration": 2, - "continue": "no" - }, - { - "title": "pause", - "action": "pause", - "label": "", - "duration": 1 - }, - { - "title": "set up message", - "action": "set content", - "label": "", - "blocks": [ - { - "block": "message", - "content": "and so on" - } - ] - }, - { - "title": "show the message", - "action": "fade up", - "label": "", - "blocks": [ - "message" - ], - "duration": 0.5, - "continue": "" - }, - { - "title": "pause", - "action": "pause", - "label": "", - "duration": 2 - }, - { - "title": "hide the message", - "action": "fade down", - "label": "", - "blocks": [ - "message" - ], - "duration": 0.5, - "continue": "no" - }, - { - "title": "chain to demo", - "action": "chain", - "label": "", - "script": "demo.json", - "path": "/resources/scripts/", - "blocks": [] - } - ], - "blocks": [ - { - "defaults": { - "name": "manarola text", - "parent": "", - "left": 0, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 32, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "left", - "textMarginLeft": 20, - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "manarola photo", - "parent": "", - "left": 500, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 50, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "apricale text", - "parent": "", - "left": 0, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 32, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "left", - "textMarginLeft": 20, - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "apricale photo", - "parent": "", - "left": 500, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 50, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "noli text", - "parent": "", - "left": 0, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 32, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "left", - "textMarginLeft": 20, - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "noli photo", - "parent": "", - "left": 500, - "top": 0, - "width": 500, - "height": 1000, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 50, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "", - "textMarginLeft": "", - "textMarginTop": "" - } - }, - { - "defaults": { - "name": "message", - "parent": "", - "left": 0, - "top": 200, - "width": 1000, - "height": 800, - "background": "", - "border": "", - "borderRadius": "", - "fontFamily": "", - "fontSize": 70, - "fontWeight": "", - "fontStyle": "", - "fontColor": "", - "textAlign": "center", - "textMarginLeft": "", - "textMarginTop": "" - } - } - ], - "content": [ - { - "name": "Manarola", - "content": "## Provincia di La Spezia - Manarola%0a~img:https://easycoder.github.io/iwsy/resources/help/quickstart/cinqueterre.jpg|left 50%~Romantic Manarola – a hamlet of Riomaggiore – spills down a ravine to the wild and rugged Cinque Terre coastline. Besides its natural beauty, the village is also famous for its sweet Sciacchetrà wine, celebrated by Gabriele D'Annunzio in one of his amazing poems. Manarola has brightly painted houses, priceless medieval relics and a tiny harbour that features a boat ramp and a swimming hole; to the north, on the way to Corniglia, there's a stunning viewpoint (Punta Bonfiglio) where visitors can enjoy a drink in a bar between the village’s cemetery and the sea. Everywhere is the scent of the lemon trees, thyme, rosemary and Mediterranean maquis; the grapevines – grown on terraces – embrace the village in a tight hug." - }, - { - "name": "Apricale", - "content": "## Provincia di Imperia - Apricale%0a~img:https://easycoder.github.io/iwsy/resources/help/quickstart/imperia.jpg|left 50%~Apricale is a picturesque small village to the north-east of Dolceacqua in western Liguria and surrounded by forested hills, included on the list of the 'most beautiful villages in Italy'.%0a%0aJust one of several attractive hill villages in this region, Apricale is compact and easy to explore. Most of the sights of interest are on or very close to the square in the centre of the village, although of course you will also want to follow the main street along the ridge to enjoy more views and to appreciate the medieval character of Apricale.%0a%0a%0a" - }, - { - "name": "Noli", - "content": "## Provincia di Savona - Noli%0a~img:https://easycoder.github.io/iwsy/resources/help/quickstart/savona.jpg|left 50%~The seaside village of Noli lies a few km west of Savona, in the central part of Liguria. Although popular with Italians it's scarcely known to anyone else outside of the area. It's a beautiful quiet and relatively unspoiled gem, with a good beach and right behind it the old town with pedestrian-only streets and a sprinkling of shops and restaurants, all preserving the ancient architecture and topped by a small castle. Although it lies on the main "Via Aurelia" coast road, all the through traffic now goes on the Autostrada, leaving Noli free from noisy vehicles. The coast road is also spectacular and it's well worth forsaking the motorway to explore the coastline between Savona and the busy resorts of Finale Ligure and Loano." - }, - { - "name": "and so on", - "content": "%0a... and so on.%0a%0aNow we'll chain back to the intro screen." - }, - { - "name": "Manarola start", - "content": "~vfx:manarola-start~" - }, - { - "name": "Manarola finish", - "content": "~vfx:manarola-finish~" - }, - { - "name": "Apricale start", - "content": "~vfx:apricale-start~" - }, - { - "name": "Apricale finish", - "content": "~vfx:apricale-finish~" - }, - { - "name": "Noli start", - "content": "~vfx:noli-start~" - }, - { - "name": "Noli finish", - "content": "~vfx:noli-finish~" - } - ], - "vfx": [ - { - "name": "manarola-start", - "type": "panzoom", - "aspect": "8:9", - "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/manarola.jpg", - "duration": 0, - "endsize": 100, - "endxoff": 50, - "endyoff": 0 - }, - { - "name": "manarola-finish", - "type": "panzoom", - "aspect": "8:9", - "url": "=manarola-start", - "duration": 10, - "endsize": 100, - "endxoff": 0, - "endyoff": 0 - }, - { - "name": "apricale-start", - "type": "panzoom", - "aspect": "8:9", - "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/apricale.jpg", - "duration": 0, - "endsize": 100, - "endxoff": 0, - "endyoff": 0 - }, - { - "name": "apricale-finish", - "type": "panzoom", - "aspect": "8:9", - "url": "=apricale-start", - "duration": 10, - "endsize": 100, - "endxoff": 50, - "endyoff": 0 - }, - { - "name": "noli-start", - "type": "panzoom", - "aspect": "8:9", - "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/noli.jpg", - "duration": 0, - "endsize": 100, - "endxoff": 0, - "endyoff": 0 - }, - { - "name": "noli-finish", - "type": "panzoom", - "aspect": "8:9", - "url": "=noli-start", - "duration": 10, - "endsize": 100, - "endxoff": 50, - "endyoff": 0 - } - ] -} diff --git a/iwsy/rest.php b/iwsy/rest.php deleted file mode 100644 index 48ce15d..0000000 --- a/iwsy/rest.php +++ /dev/null @@ -1,474 +0,0 @@ - 1) { - $props[$ss[0]] = $ss[1]; - } - } - fclose($file); - } - - // First, the commands that don't require a database connection. - switch ($method) { - case 'GET': - switch ($action) { - - case 'test': - // To check for a static server (if this is not present an error willl be thrown) - exit; - - case 'dist': - // To test if the EasyCoder distribution is present - if (!file_exists('dist')) { - http_response_code(404); - } - exit; - - case 'list': - // List the contents of a directory, starting at 'resources' - // Endpoint: {site root}/rest.php/list/password/[{path}] - $password = array_shift($request); - checkAdminPassword($password, $props['password']); - $path = getcwd() . '/'; - if (count($request)) { - $path .= 'resources/' . join('/', $request); - } - $files = scandir($path); - print '['; - // First list all the directories - $flag = false; - foreach ($files as $file) { - if (strpos($file, '.') !== 0) { - if (is_dir("$path/$file")) { - if ($flag) { - print ','; - } else { - $flag = true; - } - print "{\"name\":\"$file\",\"type\":\"dir\"}"; - } - } - } - // Now do the ordinary files - foreach ($files as $file) { - if (strpos($file, '.') !== 0) { - if (!is_dir("$path/$file")) { - if ($flag) { - print ','; - } else { - $flag = true; - } - $type = 'file'; - $p = strrpos($file, '.'); - if ($p > 0) { - $ext = substr($file, $p + 1); - $type = $ext; - switch (strtolower($ext)) { - case 'jpg': - case 'png': - case 'gif': - $type = 'img'; - break; - } - } - print "{\"name\":\"$file\",\"type\":\"$type\"}"; - } - } - } - print ']'; - exit; - - case 'hash': - // Get a hash of a value - // Endpoint: {site root}/rest.php/_hash/{value-to-hash} - print password_hash(join('/', $request), PASSWORD_DEFAULT); - exit; - - case 'verify': - // Verify a hash - // Endpoint: {site root}/rest.php/_verify/{value-to-verify} - print password_verify(join('/', $request), $props['password']) ? 'yes' : 'no'; - exit; - - case 'validate': - // Validate a hash - // Endpoint: {site root}/rest.php/validate/{encrypted-value}/{value-to-validate} - print password_verify($request[1], str_replace('~', '/', $request[0])) ? 'yes' : 'no'; - exit; - } - break; - - case 'POST': - switch ($action) { - case 'mkdir': - // Create a directory - // Endpoint: {site root}/rest.php/mkdir/{path} - $path = getcwd() . '/' . join('/', $request); - $path = preg_replace('/[^0-9\-.\/A-Za-z]/', '', $path); - logger("Create directory $path"); - print("Create directory $path"); - mkdir($path); - exit; - - case 'save': - // Save data to a file in the resources folder - // Endpoint: {site root}/rest.php/save/password/{path} - $password = array_shift($request); - checkAdminPassword($password, $props['password']); - $path = getcwd() . '/resources/' . join('/', $request); - $path = preg_replace('/[^0-9\-.\/A-Za-z]/', '', $path); - $p = strrpos($path, '/'); - $dir = substr($path, 0, $p); - mkdir($dir, 0777, true); - header("Content-Type: application/text"); - $content = stripslashes(file_get_contents("php://input")); - $p = strrpos($path, '.'); - $root = substr($path, 0, $p); - $ext = substr($path, $p); - file_put_contents($path, $content); - exit; - - case 'delete': - // Delete a file in the resources folder - // Endpoint: {site root}/rest.php/delete/password/{path} - $password = array_shift($request); - checkAdminPassword($password, $props['password']); - $path = getcwd() . '/resources/' . join('/', $request); - $path = preg_replace('/[^0-9\-.\/A-Za-z]/', '', $path); - if (is_dir($path)) { - rmdir($path); - } else { - unlink($path); - } - exit; - - case 'email': - // Send an email - // Endpoint: {site root}/rest.php/email - header("Content-Type: application/text"); - $value = stripslashes(file_get_contents("php://input")); - $json = json_decode($value); - $from = $json->from; - $to = $json->to; - $subject = $json->subject; - $message = $json->message; - $headers = "MIME-Version: 1.0\r\n"; - $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; - $headers .= "From: $from\r\n"; - mail($to, $subject, $message, "$headers\r\n"); - print "$headers\r\n$message"; - exit; - } - break; - } - - // The remaining commands require use of the database. - $conn = mysqli_connect($props['sqlhost'], $props['sqluser'], - $props['sqlpassword'], $props['sqldatabase']); - if (!$conn) - { - http_response_code(404); - die("Failed to connect to MySQL: " . mysqli_connect_error()); - } - mysqli_set_charset($conn,'utf8'); - - switch ($method) { - case 'GET': - get($conn, $props, $action, $request); - break; - - case 'POST': - post($conn, $props, $action, $request); - break; - - default: - http_response_code(400); - break; - } - - mysqli_close(); - exit; - - // Database GET - function get($conn, $props, $action, $request) { - switch ($action) { - case 'email': - // Endpoint: {site root}/rest.php/email/{email} - $email= $request[0]; - $email = preg_replace('/[^A-Za-z0-9@\-.\/]/', '', $email); - if ($email) { - logger("SELECT * from users WHERE email='$email'"); - $result = query($conn, "SELECT * from users WHERE email='$email'"); - if ($row = mysqli_fetch_object($result)) { - $response->id = $row->id; - $response->email = $row->email; - $response->password = $row->password; - $response->name = $row->name; - $response->home = $row->year . '/' . str_pad($row->day, 3, '0', STR_PAD_LEFT); - print json_encode($response); - } - } else { - http_response_code(404); - print "{\"message\":\"REST: Email is empty.\"}"; - } - break; - - case 'name': - // Endpoint: {site root}/rest.php/name/{name} - $name = $request[0]; - if ($name) { - $name = preg_replace("/[^A-Za-z0-9\-\'.\/]/", '', $name); - logger("SELECT * from users WHERE name='" . $request[0] . "'"); - $result = query($conn, "SELECT * from users WHERE name='$name'"); - if ($row = mysqli_fetch_object($result)) { - $response->id = $row->id; - $response->email = $row->email; - $response->password = $row->password; - $response->name = $row->name; - $response->home = $row->year . '/' . str_pad($row->day, 3, '0', STR_PAD_LEFT); - print json_encode($response); - } - } else { - http_response_code(404); - print "{\"message\":\"REST: Name is empty.\"}"; - } - break; - - case 'ulist': - // List the contents of a directory, starting at 'resources' - // Endpoint: {site root}/rest.php/ulist/email/password/[{path}] - $email = array_shift($request); - $password = array_shift($request); - checkUserPassword($conn, $email, $password); - $path = getcwd() . '/'; - if (count($request)) { - $path .= 'resources/' . join('/', $request); - } - $files = scandir($path); - print '['; - // First list all the directories - $flag = false; - foreach ($files as $file) { - if (strpos($file, '.') !== 0) { - if (is_dir("$path/$file")) { - if ($flag) { - print ','; - } else { - $flag = true; - } - print "{\"name\":\"$file\",\"type\":\"dir\"}"; - } - } - } - // Now do the ordinary files - foreach ($files as $file) { - if (strpos($file, '.') !== 0) { - if (!is_dir("$path/$file")) { - if ($flag) { - print ','; - } else { - $flag = true; - } - $type = 'file'; - $p = strrpos($file, '.'); - if ($p > 0) { - $ext = substr($file, $p + 1); - $type = $ext; - switch (strtolower($ext)) { - case 'jpg': - case 'png': - case 'gif': - $type = 'img'; - break; - } - } - print "{\"name\":\"$file\",\"type\":\"$type\"}"; - } - } - } - print ']'; - exit; - - default: - http_response_code(404); - print "{\"message\":\"REST: Unknown action '$action'.\"}"; - break; - } - } - - // POST - function post($conn, $props, $action, $request) { - $ts = time(); - switch ($action) { - - case 'user': - // Endpoint: {site root}/rest.php/user - header("Content-Type: application/json"); - $value = stripslashes(file_get_contents("php://input")); - $json = json_decode($value); - $email = $json->email; - $password = $json->password; - $name = $json->name; - // Check if this user is already present - $email = preg_replace('/[^A-Za-z0-9@\-.\/]/', '', $email); - $password = preg_replace('/[^A-Za-z0-9$\/.]/', '', $password); - $name = preg_replace("/[^A-Za-z0-9\-.\'\/]/", '', $name); - $result = query($conn, "SELECT id FROM users WHERE email='$email'"); - if ($row = mysqli_fetch_object($result)) { - // Yes, so update the record - logger("UPDATE users SET password='$password',name='$name',ts=$ts WHERE email='$email'"); - query($conn, "UPDATE users SET password='$password',name='$name',ts=$ts WHERE email='$email'"); - } else { - // No, so add a new record - $year = date('Y'); - $day = str_pad(date('z'), 3, '0', STR_PAD_LEFT); - logger("INSERT INTO users (email,password,name,year,day,ts) VALUES ('$email','$password','$name','$year','$day','$ts')"); - query($conn, "INSERT INTO users (email,password,name,year,day,ts) VALUES ('$email','$password','$name','$year','$day','$ts')"); - $id = $conn->insert_id; - mkdir("resources/users/$year/$day/$id", 0777, true); - } - mysqli_free_result($result); - break; - - case 'usave': - // Save a json script - // Endpoint: {site root}/rest.php/usave/email/password/{path} - $email = array_shift($request); - $password = array_shift($request); - checkUserPassword($conn, $email, $password); - $path = getcwd() . '/resources/' . join('/', $request); - $p = strrpos($path, '/'); - $dir = substr($path, 0, $p); - mkdir($dir, 0777, true); - header("Content-Type: application/text"); - $content = stripslashes(file_get_contents("php://input")); - $p = strrpos($path, '.'); - $root = substr($path, 0, $p); - $ext = substr($path, $p); - file_put_contents($path, $content); - exit; - - case 'udelete': - // Delete a file in the resources folder - // Endpoint: {site root}/rest.php/udelete/email/password/{path} - $email = array_shift($request); - $password = array_shift($request); - checkUserPassword($conn, $email, $password); - $path = getcwd() . '/resources/' . join('/', $request); - if (is_dir($path)) { - rmdir($path); - } else { - unlink($path); - } - exit; - - case 'upload': - // Upload a file (an image) to the current directory - // Endpoint: {site root}/rest.php/upload/email/password/{path} - $email = array_shift($request); - $password = array_shift($request); - checkUserPassword($conn, $email, $password); - $path = 'resources/' . join('/', $request); - mkdir($path, 0777, true); - $fileName = $_FILES['source']['name']; - $tempName = $_FILES['source']['tmp_name']; - $fileType = $_FILES['source']['type']; - $fileSize = $_FILES['source']['size']; - $fileError = $_FILES['source']['error']; - if (!move_uploaded_file($tempName, "$path/$fileName")) { - unlink($tempName); - http_response_code(400); - logger("Failed to upload $tempName to $path/$fileName.\ntempName: $tempName\nfileType: $fileType\nfileSize:$fileSize\nfileError: $fileError"); - } else { - logger("File $fileName uploaded successfully to $path/$fileName"); - $size = getimagesize("$path/$fileName"); - logger("$path/$fileName: width:".$size[0].", height:".$size[1]); - if ($size[0] > 1024) { - logger("mogrify -resize 1280x1280 $path/$fileName"); - system("mogrify -resize 1280x1280 $path/$fileName"); - } - } - exit; - - default: - http_response_code(400); - print "{\"message\":\"REST: Unknown action '$action' for 'users'.\"}"; - break; - } - } - - ///////////////////////////////////////////////////////////////////////// - // Check the admin password - function checkAdminPassword($password, $encrypted) - { - if (password_verify($password, $encrypted)) { - return; - } - http_response_code(403); - print "{\"message\":\"REST: Bad password.\"}"; - exit; - } - - ///////////////////////////////////////////////////////////////////////// - // Check a user password - function checkUserPassword($conn, $email, $password) - { - $result = query($conn, "SELECT password FROM users WHERE email='$email'"); - if ($row = mysqli_fetch_object($result)) { - $encrypted = $row->password; - if (password_verify($password, $encrypted)) { - return; - } - } - logger("User password check failed"); - http_response_code(403); - print "{\"message\":\"REST: Bad password.\"}"; - exit; - } - - ///////////////////////////////////////////////////////////////////////// - // Do an SQL query - function query($conn, $sql) - { - $result = mysqli_query($conn, $sql); - if (!$result) { - http_response_code(404); - logger('Error: '.mysqli_error($conn)); - die('Error: '.mysqli_error($conn)); - } - return $result; - } - - //////////////////////////////////////////////////////////////////////////// - // Log a message. - function logger($message) - { - $timestamp = time(); - $date = date("Y/m/d H:i", $timestamp); - if (!file_exists("log")) mkdir("log"); - $file = "log/".date("Y", $timestamp); - if (!file_exists($file)) mkdir($file); - $file.= "/".date("Ymd", $timestamp).".txt"; - $fp = fopen($file, "a+") or die("Can't open $file"); - fwrite($fp, "$date: $message\n"); - fclose($fp); - } -?> diff --git a/iwsy/scripted.html b/iwsy/scripted.html deleted file mode 100644 index f978196..0000000 --- a/iwsy/scripted.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Script Editor - - - - - - - - - diff --git a/iwsy/test.html b/iwsy/test.html deleted file mode 100644 index 29b1ced..0000000 --- a/iwsy/test.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - -
- I Wanna Show You
- Click/Tap or key Space/RightArrow to start in manual mode
- Click/Tap or key Space/RightArrow to advance
- Key Enter to start in auto mode
- Click/Tap to exit auto mode -
- - - - - diff --git a/js/plugins/iwsy.js b/js/plugins/iwsy.js deleted file mode 100644 index 074ffa6..0000000 --- a/js/plugins/iwsy.js +++ /dev/null @@ -1,335 +0,0 @@ -const EasyCoder_IWSY = { - - name: `EasyCoder_IWSY`, - - iwsy: { - }, - - IWSY: { - - compile: (compiler) => { - - const lino = compiler.getLino(); - const action = compiler.nextToken(); - switch (action) { - case `load`: - if (compiler.nextIsSymbol()) { - const playerRecord = compiler.getSymbolRecord(); - if (playerRecord.keyword === `div`) { - const script = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - player: playerRecord.name, - script - }); - return true; - } - } - break; - case `init`: - try { - const cdn = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - cdn - }); - return true; - } catch (err) { - throw Error(`iwsy init: No CDN URL given`); - } - case `stop`: - compiler.next(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action - }); - return true; - case `remove`: - if (compiler.nextTokenIs(`styles`)) { - compiler.next(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action: `removeStyles` - }); - return true; - } - return false; - case `path`: - const path = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - path - }); - return true; - case `script`: - const script = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - script - }); - return true; - case `goto`: - const target = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - target - }); - return true; - case `block`: - const block = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - block - }); - return true; - case `run`: - const pc = compiler.getPc(); - let mode = `normal`; - let startMode = `wait`; - if (compiler.nextToken() === `fullscreen`) { - mode = compiler.getToken(); - if ([`auto`, `manual`].includes(compiler.nextToken())) { - startMode = compiler.getToken(); - compiler.next(); - } - } - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - mode, - startMode, - then: 0 - }); - // Get the 'then' code, if any - if (compiler.tokenIs(`then`)) { - const goto = compiler.getPc(); - // Add a 'goto' to skip the 'then' - compiler.addCommand({ - domain: `core`, - keyword: `goto`, - goto: 0 - }); - // Fixup the link to the 'then' branch - compiler.getCommandAt(pc).then = compiler.getPc(); - // Process the 'then' branch - compiler.next(); - compiler.compileOne(true); - compiler.addCommand({ - domain: `core`, - keyword: `stop` - }); - // Fixup the 'goto' - compiler.getCommandAt(goto).goto = compiler.getPc(); - } - return true; - case `onstep`: - compiler.next(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action - }); - return compiler.completeHandler(); - case `panzoom`: - const spec = compiler.getNextValue(); - compiler.addCommand({ - domain: `iwsy`, - keyword: `iwsy`, - lino, - action, - spec - }); - return true; - default: - break; - } - return false; - }, - - run: (program) => { - const command = program[program.pc]; - const action = command.action; - let script; - switch (action) { - case `init`: - const cdn = program.getValue(command.cdn); - if (typeof IWSY === `undefined`) { - program.require(`js`, `${cdn}/iwsy.js`, - function () { - program.run(command.pc + 1); - }); - return 0; - } - break; - case `load`: - const playerRecord = program.getSymbolRecord(command.player); - const player = playerRecord.element[playerRecord.index]; - player.innerHTML = ``; - player.style.background = `none`; - player.style.border = `none`; - script = program.getValue(command.script); - try { - script = JSON.parse(script); - } catch (err) { - alert(`iwsy load: Badly formatted script`); - } - program.iwsyFunctions = IWSY(player, script); - break; - case `path`: - if (program.iwsyFunctions) { - program.iwsyFunctions.setPath(program.getValue(command.path)); - } - break; - case `script`: - script = program.getValue(command.script); - try { - script = JSON.parse(script); - } catch (err) { - alert(`iwsy script: Badly formatted script`); - } - if (program.iwsyFunctions) { - program.iwsyFunctions.setScript(script); - } - break; - case `goto`: - if (program.iwsyFunctions) { - program.iwsyFunctions.gotoStep(program.getValue(command.target)); - } - break; - case `block`: - if (program.iwsyFunctions) { - program.iwsyFunctions.block(program.getValue(command.block)); - } - break; - case `run`: - if (program.iwsyFunctions) { - program.iwsyFunctions.run(command.mode, command.startMode, () => { - program.run(command.then); - }); - return 0; - } - break; - case `stop`: - if (program.iwsyFunctions) { - program.iwsyFunctions.stop(); - } - break; - case `removeStyles`: - if (program.iwsyFunctions) { - program.iwsyFunctions.removeStyles(); - } - break; - case `onstep`: - const cb = command.pc + 2; - if (program.iwsyFunctions) { - program.iwsyFunctions.onStep(function(step) { - program.iwsyStep = step; - program.run(cb); - }); - } - break; - case `panzoom`: - const spec = program.getValue(command.spec); - if (program.iwsyFunctions) { - program.iwsyFunctions.panzoom(spec); - } - } - return command.pc + 1; - } - }, - - getHandler: (name) => { - switch (name) { - case `iwsy`: - return EasyCoder_IWSY.IWSY; - default: - return null; - } - }, - - run: program => { - const command = program[program.pc]; - const handler = EasyCoder_IWSY.getHandler(command.keyword); - if (!handler) { - program.runtimeError(command.lino, `Unknown keyword '${command.keyword}' in 'iwsy' package`); - } - return handler.run(program); - }, - - value: { - - compile: (compiler) => { - if (compiler.tokenIs(`the`)) { - if (compiler.nextTokenIs(`iwsy`)) { - const type = compiler.nextToken(); - if ([`script`, `step`].includes(type)) { - compiler.next(); - return { - domain: `iwsy`, - type - }; - } - } - } - return null; - }, - - get: (program, value) => { - switch (value.type) { - case `script`: - let script = null; - if (program.iwsyFunctions) { - script = program.iwsyFunctions.getScript(); - return { - type: `constant`, - numeric: false, - content: JSON.stringify(script) - }; - } - break; - case `step`: - return { - type: `constant`, - numeric: true, - content: program.iwsyStep - }; - } - return null; - } - }, - - condition: { - - compile: () => {}, - - test: () => {} - } -}; - -// eslint-disable-next-line no-unused-vars -EasyCoder.domain.iwsy = EasyCoder_IWSY;