diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 2007838..0000000 --- a/docs/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -
- - - - - - - - -"); - w.document.write(toOWM(editor.getSession().getDocument().getValue())); - w.document.write(""); - }); - apply.addEventListener('click', function(){ - console.log("rendering") - renderGraph() - }) - - annotations.addEventListener('click', function(){ - console.log("rendering") - renderGraph() - }) - - // Since apparently HTMLCollection does not implement the oh so convenient array functions - HTMLOptionsCollection.prototype.indexOf = function(name) { - for (let i = 0; i < this.length; i++) { - if (this[i].value == name) { - return i; - } - } - - return -1; - }; - - restoreContent(); - /* come from sharing */ - const params = new URLSearchParams(location.search.substring(1)); - - if (params.has('raw')) { - editor.getSession().setValue(params.get('raw')); - renderGraph(); - } else if (params.has('wtg')) { - let wtgText = params.get('wtg'); // "some_value"export - console.log(wtgText); - var content = base64ToArrayBuffer(wtgText); - if (content!=null) { - decompress(content,"gzip").then(function(result) { - console.log(result); - editor.getSession().setValue(result); - renderGraph(); - - }); - } - } else if (params.has('compressed')) { - const compressed = params.get('compressed'); - } else if (params.has('url')) { - const url = params.get('url'); - let ok = false; - fetch(url) - .then(res => { - ok = res.ok; - return res.text(); - }) - .then(res => { - if (!ok) { - throw { message: res }; - } - - editor.getSession().setValue(res); - renderGraph(); - }).catch(e => { - show_error(e); - }); - } else if (location.hash.length > 1) { - editor.getSession().setValue(decodeURIComponent(location.hash.substring(1))); - } else if (editor.getValue()) { // Init - renderGraph(); - } - - function compress(string, encoding) { - const byteArray = new TextEncoder().encode(string); - const cs = new CompressionStream(encoding); - const writer = cs.writable.getWriter(); - writer.write(byteArray); - writer.close(); - return new Response(cs.readable).arrayBuffer(); - } - - function decompress(byteArray, encoding) { - const cs = new DecompressionStream(encoding); - const writer = cs.writable.getWriter(); - writer.write(byteArray); - writer.close(); - return new Response(cs.readable).arrayBuffer().then(function (arrayBuffer) { - return new TextDecoder().decode(arrayBuffer); - }); - } - - function arrayBufferToBase64( buffer ) { - var binary = ''; - var bytes = new Uint8Array( buffer ); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode( bytes[ i ] ); - } - return window.btoa( binary ); - } - - function base64ToArrayBuffer(base64) { - var binary_string = window.atob(base64); - var len = binary_string.length; - var bytes = new Uint8Array( len ); - for (var i = 0; i < len; i++) { - bytes[i] = binary_string.charCodeAt(i); - } - return bytes.buffer; - } - function setSample() { - editor.getSession().setValue(` -title: sample map // title is optional -/*************** - value chain -****************/ - -business - cup of tea -public - cup of tea -cup of tea - cup -cup of tea -- tea -cup of tea --- hot water -hot water - water -hot water -- kettle -kettle - power - -/*************** - definitions -****************/ - -// you can inline the evolution -business: |....|....|...x.|.........| - -public: |....|....|....|.x...| - -// or create blocks -cup of tea: { - evolution: |....|....|..x..|........| - color: Green // you can set colors -} -cup: { - type: buy - evolution: |....|....|....|....x....| -} -tea: { - type: buy - evolution: |....|....|....|.....x....| -} -hot water: { - evolution: |....|....|....|....x....| - color: Blue -} -water: { - type: outsource - evolution: |....|....|....|.....x....| -} - -// you can set the evolution with a > -kettle: { - type: build - evolution: |...|...x.|..>.|.......| -} -power: { - type: pipeline - evolution: |...|...|....x|.....>..| -} - -stage1: genesis / concept -stage2: custom / emerging -stage3: product / converging -stage4: commodity / accepted - `); - } - - }; - //})(document); diff --git a/docs/style.css b/docs/style.css deleted file mode 100644 index fda4aec..0000000 --- a/docs/style.css +++ /dev/null @@ -1,202 +0,0 @@ -body { - overflow: hidden; - margin: 0 0; -} - -#editor { - margin: 0; - position: absolute; - top: 0; - bottom: 0; - right: 75%; - left: 0; -} - -#review { - margin: 0; - position: absolute; - top: 50px; - bottom: 0; - right: 0; - left: 25%; - overflow: scroll; -} - -#options { - margin: 0; - position: fixed; - left: 25%; - width: 100%; -} - -#options { - flex: 0 0 auto; - background: #eee; - border-bottom: 1px solid #ccc; - padding: 8px; - overflow: hidden; -} - -#options label { - margin-right: 8px; -} - -#options #raw.disabled { - opacity: 0.5; -} - -#shareurl { - display: none; -} - -#status { - width: 100%; - position: fixed; - bottom: 0; - display: block; - color: #FFF; - z-index: 999; -} - -#review svg { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -#review #text { - font-size: 12px; - font-family: monaco, courier, monospace; - white-space: pre; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - overflow: auto; -} - -#review img { - display: block; - margin: 0 auto; -} - -#review.working svg, #output.error svg, -#review.working #text, #output.error #text, -#review.working img, #output.error img { - opacity: 0.4; -} - -#review.error #error { - display: inherit; -} - -#review #error { - display: none; - position: absolute; - top: 20px; - left: 20px; - margin-right: 20px; - background: red; - color: white; - z-index: 1; -} - -#sample { - font: bold 12px Arial; - text-decoration: none; - background-color: #EEEEEE; - color: #333333; - padding: 2px 6px 2px 6px; - border-top: 1px solid #CCCCCC; - border-right: 1px solid #333333; - border-bottom: 1px solid #333333; - border-left: 1px solid #CCCCCC; -} -#download { - font: bold 12px Arial; - text-decoration: none; - background-color: #EEEEEE; - color: #333333; - padding: 2px 6px 2px 6px; - border-top: 1px solid #CCCCCC; - border-right: 1px solid #333333; - border-bottom: 1px solid #333333; - border-left: 1px solid #CCCCCC; -} -#toowm { - font: bold 12px Arial; - text-decoration: none; - background-color: #EEEEEE; - color: #333333; - padding: 2px 6px 2px 6px; - border-top: 1px solid #CCCCCC; - border-right: 1px solid #333333; - border-bottom: 1px solid #333333; - border-left: 1px solid #CCCCCC; -} - -/* The switch - the box around the slider */ -.switch { - position: relative; - display: inline-block; - width: 40px; - height: 23px; -} - -/* Hide default HTML checkbox */ -.switch input { - opacity: 0; - width: 0; - height: 0; -} - -/* The slider */ -.slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #ccc; - -webkit-transition: .4s; - transition: .4s; -} - -.slider:before { - position: absolute; - content: ""; - height: 15px; - width: 15px; - left: 4px; - bottom: 4px; - background-color: white; - -webkit-transition: .4s; - transition: .4s; -} - -input:checked + .slider { - background-color: #2196F3; -} - -input:focus + .slider { - box-shadow: 0 0 1px #2196F3; -} - -input:checked + .slider:before { - -webkit-transform: translateX(17px); - -ms-transform: translateX(17px); - transform: translateX(17px); -} - -/* Rounded sliders */ -.slider.round { - border-radius: 17px; -} - -.slider.round:before { - border-radius: 50%; -}