diff --git a/static/fontello/LICENSE.txt b/static/fontello/LICENSE.txt new file mode 100644 index 0000000..de42058 --- /dev/null +++ b/static/fontello/LICENSE.txt @@ -0,0 +1,12 @@ +Font license info + + +## Entypo + + Copyright (C) 2012 by Daniel Bruce + + Author: Daniel Bruce + License: SIL (http://scripts.sil.org/OFL) + Homepage: http://www.entypo.com + + diff --git a/static/fontello/README.txt b/static/fontello/README.txt new file mode 100644 index 0000000..a91438a --- /dev/null +++ b/static/fontello/README.txt @@ -0,0 +1,75 @@ +This webfont is generated by http://fontello.com open source project. + + +================================================================================ +Please, note, that you should obey original font licences, used to make this +webfont pack. Details available in LICENSE.txt file. + +- Usually, it's enough to publish content of LICENSE.txt file somewhere on your + site in "About" section. + +- If your project is open-source, usually, it will be ok to make LICENSE.txt + file publically available in your repository. + +- Fonts, used in Fontello, don't require a clickable link on your site. + But any kind of additional authors crediting is welcome. +================================================================================ + + +Comments on archive content +--------------------------- + +- /font/* - fonts in different formats + +- /css/* - different kinds of css, for all situations. Should be ok with + twitter bootstrap. Also, you can skip style and assign icon classes + directly to text elements, if you don't mind about IE7. + +- demo.html - demo file, to show your webfont content + +- LICENSE.txt - license info about source fonts, used to build your one. + +- config.json - keeps your settings. You can import it back into fontello + anytime, to continue your work + + +Why so many CSS files ? +----------------------- + +Because we like to fit all your needs :) + +- basic file, .css - is usually enough, it contains @font-face + and character code definitions + +- *-ie7.css - if you need IE7 support, but still don't wish to put char codes + directly into html + +- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face + rules, but still wish to benefit from css generation. That can be very + convenient for automated asset build systems. When you need to update font - + no need to manually edit files, just override old version with archive + content. See fontello source code for examples. + +- *-embedded.css - basic css file, but with embedded WOFF font, to avoid + CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain. + We strongly recommend to resolve this issue by `Access-Control-Allow-Origin` + server headers. But if you ok with dirty hack - this file is for you. Note, + that data url moved to separate @font-face to avoid problems with + + + + + + + +
+

+ fontello + font demo +

+ +
+
+
+
icon-gauge0xe801
+
icon-github0xe803
+
icon-help0xe804
+
icon-play0xe805
+
+
+
icon-pause0xe806
+
icon-fast-forward0xe807
+
icon-fast-backward0xe808
+
icon-plus0xe810
+
+
+
icon-minus0xe811
+
icon-cw0xe812
+
+
+ + + \ No newline at end of file diff --git a/static/fontello/font/fontello.eot b/static/fontello/font/fontello.eot new file mode 100644 index 0000000..2ef7ade Binary files /dev/null and b/static/fontello/font/fontello.eot differ diff --git a/static/fontello/font/fontello.svg b/static/fontello/font/fontello.svg new file mode 100644 index 0000000..068fa60 --- /dev/null +++ b/static/fontello/font/fontello.svg @@ -0,0 +1,21 @@ + + + +Copyright (C) 2016 by original authors @ fontello.com + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/fontello/font/fontello.ttf b/static/fontello/font/fontello.ttf new file mode 100644 index 0000000..b267aaa Binary files /dev/null and b/static/fontello/font/fontello.ttf differ diff --git a/static/fontello/font/fontello.woff b/static/fontello/font/fontello.woff new file mode 100644 index 0000000..4302f45 Binary files /dev/null and b/static/fontello/font/fontello.woff differ diff --git a/static/rewot.css b/static/rewot.css new file mode 100644 index 0000000..d343c95 --- /dev/null +++ b/static/rewot.css @@ -0,0 +1,186 @@ +body { + background-color: black; + color: silver; + font-family: monospace; + margin-right: 19rem; +} + +h1, h2, h3, h4, h5, h6 { + color: seagreen; +} + +a { + color: dodgerblue; + text-decoration: none; +} + +a:hover { + color: skyblue; +} + +/*nav { + position: fixed; + background: black; + z-index: 10; + top: 0; + right: 0; + padding: .5rem; + border-left: 1px dashed gray; + border-bottom: 1px dashed gray; + text-align: right; +} +nav ul { + margin: 0; + padding: 0; +} +nav ul li { + list-style: none; + padding-bottom: .5rem; +} +nav ul li:last-child { + padding-bottom: 0; +} +header { + position: fixed; + background: black; + top: 0; + left: 0; + width: 100%; + height: 3rem; + border-bottom: 1px dashed gray; + padding-left: 2rem; + z-index: 9; +} +header h1, header h2 { + height: 2rem; + display: inline-block; + color: coral; +} +main#replay { + white-space: pre-wrap; +} +textarea { + width: 75%; + height: 30rem; +} +footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: 2rem; + border-top: 1px dashed gray; + line-height: 2rem; + background: black; +} +/* +footer ul { + margin: 0; + padding: 0; +} +footer ul li { + list-style: none; + display: inline-block; + padding-left: 1rem; +} +footer ul li.divider { + color: green; + font-size: 1rem; +} +footer i { + font-size: x-large; +} +span.header_mod { + visibility: hidden; +} +.notice { + color: yellow; +}*/ + + + +div.top { + position: fixed; + right: 0; + top: 0; + width: 10em; + text-align: center; +} + +div.top h1 { + font-size: xx-large; + border-bottom: 1px solid seagreen; + margin-bottom: 0; +} + +div.top h1 a { + color: coral; +} + +div.top ul { + margin: 0; + padding: 0; +} + +div.top ul li { + list-style: none; + display: inline-block; + margin: 0; + padding-top: .5rem; + padding-right: .5rem; + width: 100%; +} + +div.bottom { + position: fixed; + right: 0; + bottom: 0; + width: 10rem; + text-align: right; + padding: .5rem; +} + +div.bottom table { + display: inline-block; +} + + +div.bottom i { + font-size: xx-large; +} + +.green { + color: seagreen; +} + +div.notice { + color: seagreen; + padding: 1rem; +} + +div.notice span { + color: yellow; +} + +progress[value] { + width: 3rem; + height: 1rem; +} + +main#main { + /*white-space: pre-wrap;*/ +} + +div.replay-div { + display: none; + white-space: pre-wrap; +} + +div.replay-div-visible { + display: block; +} + +textarea { + width: 40rem; + height: 20rem; +} diff --git a/static/rewot.js b/static/rewot.js new file mode 100644 index 0000000..272ec2b --- /dev/null +++ b/static/rewot.js @@ -0,0 +1,200 @@ +"use strict"; + +var counter = 1; +var elmain = document.getElementById("main"); +var direction = "forward"; +var fast_forward_lines = 0; +var json = null; +var lineno = 0; +var pausedid = null; +var playing = false; +var speed = 1; +var timeout = null; + +function scroll(el) { + var de = document.documentElement; + + if ((el.offsetTop < de.scrollTop) || + (el.offsetTop + el.offsetHeight > de.scrollTop + de.clientHeight)) { + el.scrollIntoView(); + } +} + +function add_line(line, visible) { + var div = document.createElement("div"); + div.classList.add("replay-div"); + div.id = "replay-div-" + counter; + div.innerHTML = line || "\n"; + elmain.appendChild(div); + + if (visible) { + div.classList.add("replay-div-visible"); + scroll(div); + } + + counter += 1; + return counter - 1; +} + +function notice(msg, now) { + var s = '
**** ' + msg; + return add_line(s, now); +} + +function del_line(id) { + var el = document.getElementById("replay-div-" + id); + if (el) { + el.parentNode.removeChild(el); + } +} + +function finished() { + playing = false; + notice('Finished ' + + (json.meta.title || json.meta.id) + '', true); + document.getElementById("play_pause").className = "icon-play"; +} + +function forward() { + direction = "forward"; + return false; +} + +function xhr_load() { + this.callback.apply(this, this.arguments); +} + +function xhr_error() { + console.error(this.statusText); +} + +function fetch_json(url, callback) { + var xhr = new XMLHttpRequest(); + xhr.callback = callback; + xhr.onload = xhr_load; + xhr.onerror = xhr_error; + xhr.open("get", url, true); + xhr.send(null); +} + +function load_log_lines() { + json = JSON.parse(this.responseText); + + if (!json) { + notice("Loading failed", true); + return; + } + + var ready = notice((json.meta.title || json.meta.id) + + ' loaded Play', false); + + json.log.forEach(function(line) { + json.log[line.lineno - 1].lineid = + add_line(line.line, false); + }); + + document.getElementById("progress").max = json.log.length; + document.title = "ReWoT :: " + (json.meta.title || json.meta.id); + document.getElementById("play_pause").className = "icon-play"; + update_progress(); + show_line(ready); +} + +function load_log(url) { + fetch_json(url, load_log_lines); + return false; +} + +function play_pause() { + var el = document.getElementById("play_pause"); + + if (playing) { + if (timeout) { + window.clearTimeout(timeout); + } + pausedid = notice("Paused", true); + playing = false; + document.getElementById("play_pause").className = "icon-play"; + } else { + if (json) { + playing = true; + document.getElementById("play_pause").className = "icon-pause"; + if (pausedid) { + del_line(pausedid); + } + if (lineno > json.log.slice(-1)[0].lineno) { + lineno = json.log.slice(-1)[0].lineno; + } else if (lineno < 1) { + lineno = 1; + } + replay_log(); + } else { + notice("No replay loaded", true); + } + } + return false; +} + +function replay_log() { + if (!json.log[lineno] || !playing) { + return; + } + + show_line(json.log[lineno].lineid); + + if (direction == "forward") { + lineno += 1; + } else { + hide_line(json.log[lineno].lineid); + lineno -= 1; + } + + if (json.log[lineno]) { + if (fast_forward_lines) { + fast_forward_lines -= 1; + replay_log(); + } else { + var d = parseFloat(json.log[lineno].delta) * speed; + if (d > 4000) { + d = 4000; + } + timeout = setTimeout(replay_log, d); + } + update_lineno(); + update_progress(); + } else { + finished(); + } +} + +function reverse() { + direction = "reverse"; + return false; +} + +function show_line(id) { + var el = document.getElementById("replay-div-" + id); + if (!!el) { + el.classList.add("replay-div-visible"); + scroll(el); + } +} + +function hide_line(id) { + var el = document.getElementById("replay-div-" + id); + if (!!el) { + el.classList.remove("replay-div-visible"); + } +} + +function update_lineno() { + document.getElementById("lineno").innerHTML = json.log[lineno].lineno; +} + +function update_progress() { + var el = document.getElementById("progress"); + el.value = json.log[lineno].lineno; + el.title = json.log[lineno].lineno + " / " + el.max; +} + +