1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet-playground.git synced 2024-05-19 17:38:37 +03:00

Salet playground WIP

This commit is contained in:
Alexander Yakovlev 2017-02-22 13:30:25 +07:00
parent 39ac028fca
commit 2616c3c7c2
3 changed files with 104 additions and 743 deletions

View file

@ -2,31 +2,14 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Create a new tinker - JSTinker</title>
<title>Salet playground</title>
<!-- Latest jQuery from Google CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Crypto JS -->
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<!-- Beautify Web - HTML, CSS, JS -->
<script src="js/beautify-web/beautify-html.js"></script>
<script src="js/beautify-web/beautify-css.js"></script>
<script src="js/beautify-web/beautify.js"></script>
<!-- Ace Editor -->
<script src="js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<!-- Together -->
<script src="https://togetherjs.com/togetherjs-min.js"></script>
<!-- JSTinker Scripts -->
<script src="js/jstinker.js"></script>
<!-- Bootstrap Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Bootstrap Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- JSTinker Style -->
<link rel="stylesheet" href="css/jstinker.css" type="text/css">
<!-- Bootstrap Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
@ -38,7 +21,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> JSTinker</a>
<a class="navbar-brand" href="#"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Salet playground</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
@ -53,442 +36,59 @@
<!-- Sidebar -->
<div id="sidebar">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<!-- Frameworks & Extensions -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Frameworks & Extensions
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="dropdown">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
No-Library (pure JS)
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu1" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="dropdown-header">jQuery</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery Compat (edge)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery (edge)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 2.1.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 2.0.2</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.11.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.10.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.9.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.8.3</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.7.2</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jQuery 1.6.4</a></li>
<li role="presentation" class="dropdown-header">Prototype</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Prototype 1.7.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Prototype 1.6.1.0</a></li>
<li role="presentation" class="dropdown-header">YUI</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.17.2</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.16.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.14.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.10.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.8.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.7.3</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.6.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 3.5.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">YUI 2.8.0r4</a></li>
<li role="presentation" class="dropdown-header">No-Library</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">No-Library (pure JS)</a></li>
<li role="presentation" class="dropdown-header">Dojo</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo (nightly)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.10.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.9.4</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.8.7</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.7.6</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.6.2</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Dojo 1.5.3</a></li>
<li role="presentation" class="dropdown-header">Processing</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Processing.js 1.4.7</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Processing.js 1.4.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Processing.js 1.3.6</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Processing.js 1.2.3</a></li>
<li role="presentation" class="dropdown-header">ExtJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">ExtJS 4.2.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">ExtJS 4.1.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">ExtJS 4.1.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">ExtJS 3.4.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">ExtJS 3.1.0</a></li>
<li role="presentation" class="dropdown-header">Raphael</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Raphael 2.1.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Raphael 1.5.2 (min)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Raphael 1.4</a></li>
<li role="presentation" class="dropdown-header">RightJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">RightJS 2.3.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">RightJS 2.1.1</a></li>
<li role="presentation" class="dropdown-header">Three.js</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Three.js r54</a></li>
<li role="presentation" class="dropdown-header">Zepto</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Zepto 1.0rc1</a></li>
<li role="presentation" class="dropdown-header">Enyo</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo (nightly)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo 2.5.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo 2.4.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo 2.2.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo 2.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Enyo 2.0.1</a></li>
<li role="presentation" class="dropdown-header">Shipyard</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Shipyard (nightly)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Shipyard 0.2</a></li>
<li role="presentation" class="dropdown-header">Knockout.js</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Knockout.js 3.0.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Knockout.js 2.3.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Knockout.js 2.2.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Knockout.js 2.1.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Knockout.js 2.0.0</a></li>
<li role="presentation" class="dropdown-header">The X Toolkit</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">The X Toolkit edge</a></li>
<li role="presentation" class="dropdown-header">AngularJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">AngularJS 1.2.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">AngularJS 1.1.1</a></li>
<li role="presentation" class="dropdown-header">Ember</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Ember 1.3.1</a></li>
<li role="presentation" class="dropdown-header">Underscore</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Underscore 1.4.4</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Underscore 1.4.3</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Underscore 1.3.3</a></li>
<li role="presentation" class="dropdown-header">Bonsai</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Bonsai 0.4.1</a></li>
<li role="presentation" class="dropdown-header">KineticJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">KineticJS 4.3.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">KineticJS 4.0.5</a></li>
<li role="presentation" class="dropdown-header">FabricJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">FabricJS 1.4.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">FabricJS 1.2.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">FabricJS 0.9</a></li>
<li role="presentation" class="dropdown-header">qooxdoo</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">qooxdoo 2.1</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">qooxdoo 2.0.3</a></li>
<li role="presentation" class="dropdown-header">D3</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">D3 3.0.4</a></li>
<li role="presentation" class="dropdown-header">CreateJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">CreateJS 2013.09.25</a></li>
<li role="presentation" class="dropdown-header">WebApp Install</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">WebApp Install 0.1</a></li>
<li role="presentation" class="dropdown-header">Thorax</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Thorax 2.0.0rc6</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Thorax 2.0.0rc3</a></li>
<li role="presentation" class="dropdown-header">Paper.js</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Paper.js 0.22</a></li>
<li role="presentation" class="dropdown-header">React</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">React 0.9.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">React 0.8.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">React 0.4.0</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">React 0.3.2</a></li>
<li role="presentation" class="dropdown-header">svg.js</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">svg.js 0.x (latest)</a></li>
<li role="presentation" class="dropdown-header">Minified</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Minified 1.0 beta1</a></li>
<li role="presentation" class="dropdown-header">jTypes</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">jTypes 2.1.0</a></li>
<li role="presentation" class="dropdown-header">Lo-Dash</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Lo-Dash 2.2.1</a></li>
<li role="presentation" class="dropdown-header">Brick</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Brick edge</a></li>
<li role="presentation" class="dropdown-header">RactiveJS</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">RactiveJS Latest</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">RactiveJS Edge</a></li>
<li role="presentation" class="dropdown-header">Vue</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Vue (edge)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">Vue 0.11.0</a></li>
</ul>
</div>
</div>
<br>
<div class="dropdown">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-expanded="true">
onLoad
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu2" role="menu" aria-labelledby="dropdownMenu2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="">onLoad</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">onDomReady</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">No wrap - in head</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">No wrap - in body</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Tinker Options -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
Tinker Options
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<input type="text" placeholder="Name your Tinker">
<textarea placeholder="Description"></textarea>
<div class="checkbox">
<label>
<input type="checkbox"></input><span class="chk_lbl">Normalize css</span>
</label>
</div>
<p>Body tag</p>
<input type="text">
<p>DTD</p>
<div class="dropdown">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu3" data-toggle="dropdown" aria-expanded="true">
HTML 5
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu3" role="menu" aria-labelledby="dropdownMenu3">
<li role="presentation"><a role="menuitem" tabindex="-1" href="">XHTML 1.0 Strict</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">XHTML 1.0 Transitional</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">HTML 5</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">HTML 4.01 Strict</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">HTML 4.01 Transitional</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">HTML 4.01 Frameset</a></li>
</ul>
</div>
</div>
<p>Framework script attribute</p>
<input type="text" placeholder="ie. data-type=''">
</div>
</div>
</div>
<!-- External Resources -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
External Resources
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
<input type="text" class="ext_res" placeholder="JavaScript/CSS URI">
<button type="button" class="btn btn-default add">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
<!-- Languages -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFour">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
Languages
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<div class="dropdown langcontainer">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle langbutton" type="button" id="dropdownMenu4" data-toggle="dropdown" aria-expanded="true">
HTML
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu4" role="menu" aria-labelledby="dropdownMenu4">
<li role="presentation"><a role="menuitem" tabindex="-1" href="">HTML</a></li>
</ul>
</div>
</div>
<div class="dropdown langcontainer langright">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle langbutton" type="button" id="dropdownMenu5" data-toggle="dropdown" aria-expanded="true">
CSS
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu5" role="menu" aria-labelledby="dropdownMenu5">
<li role="presentation"><a role="menuitem" tabindex="-1" href="">CSS</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">SCSS</a></li>
</ul>
</div>
</div>
<div class="dropdown langcontainer">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle langbutton" type="button" id="dropdownMenu6" data-toggle="dropdown" aria-expanded="true">
JavaScript
<span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-menu" id="dropdownMenu6" role="menu" aria-labelledby="dropdownMenu6">
<li role="presentation"><a role="menuitem" tabindex="-1" href="">JavaScript</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">CoffeeScript</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="">JavaScript 1.7</a></li>
</ul>
</div>
</div>
<div class="dropdown langcontainer langright">
<div class="btn-group">
<button class="btn btn-default langbutton" type="button" id="dropdownMenu7" data-toggle="dropdown" aria-expanded="true">
Results
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Ajax Requests
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFive">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
Ajax Requests
</a>
</h4>
</div>
<div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive">
<div class="panel-body">
Stuff
</div>
</div>
</div> -->
<!-- Legal, Credits and Links -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingSix">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="true" aria-controls="collapseSix">
Legal, Credits and Links
</a>
</h4>
</div>
<div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix">
<div class="panel-body">
<p>Created and maintained by <a title="John's homepage" href="http://johncipponeri.github.io/">John Cipponeri</a>.</p>
<p>CSS Design by <a title="Gianni's Twitter" href="https://twitter.com/Hazulu">@Hazulu</a></p>
<p>Hosted by <a href="https://pages.github.com/">GitHub Pages</a>.</p>
<p>Special thanks to <a href="http://jsfiddle.net" target="_new">JSFiddle</a> as this is an open source clone of it.</p>
<p><strong>License</strong></p>
<p>All code belongs to the poster and no license is enforced.</p>
<p>JSTinker or its author are not responsible or liable for any loss or damage of any kind during the usage of provided code.</p>
<p><strong>Links</strong></p>
For updates please follow my
<a href="http://twitter.com/johncipponeri/" target="_new">tweets</a>
</div>
</div>
</div>
</div>
<div class="panel-body">
<p>You write in HTML, SCSS and CoffeeScript. Press Run to play your game.</p>
<h4>Legal and Credits</h4>
<p>Original JSTinker by <a title="John's homepage" href="http://johncipponeri.github.io/">John Cipponeri</a>.</p>
<p>CSS Design by <a title="Gianni's Twitter" href="https://twitter.com/Hazulu">@Hazulu</a></p>
<p>Salet is MIT license.</p>
<p>You own what you write. The code that runs here belongs to you only.</p>
<p>The code is not saved anywhere. We are not responsible for any loss.</p>
<h4>Links</h4>
<p><a href="https://salet.su">Salet website</a></p>
</div>
</div><!-- /sidebar -->
<div class="editors">
<div class="top">
<!-- HTML Editor -->
<div class="editorContainer">
<div class="editor" id="html-editor"></div>
<div class="editor" id="html-editor">&lt;div id="page"&gt;
&lt;div class="fixed container"&gt;
&lt;div id="tools_wrapper" class="row"&gt;
&lt;div class='ways'&gt;
&lt;ul class="nav nav-pills" id="ways"&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="buttons"&gt;
&lt;button id="night" class="btn btn-outline-primary"&gt;Night mode&lt;/button&gt;
&lt;button id="erase" class="btn btn-outline-danger">Restart&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt; &lt;!-- End of div.tools_wrapper --&gt;
&lt;/div&gt;
&lt;div class="container"&gt;
&lt;div id="content_wrapper" class="row"&gt;
&lt;div id="content" class="content"&gt;&lt;/div&gt;
&lt;a name="end_of_content"&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt; &lt;!-- End of div.page --&gt;</div>
</div>
<!-- CSS EDitor -->
<div class="editorContainer">
<div class="editor" id="css-editor"></div>
<div class="editor" id="css-editor">
</div>
</div>
</div>
<div class="bottom">
<!-- JS Editor -->
<div class="editorContainer">
<div class="editor" id="js-editor"></div>
<div class="editor" id="js-editor">
</div>
</div>
<!-- Preview -->
<div class="editorContainer">
<iframe class="editor" id="preview" name="result" sandbox="allow-forms allow-popups allow-scripts allow-same-origin" frameborder="0">
<iframe class="editor" id="preview" name="result" frameborder="0">
#document
</iframe>
</div>
@ -496,7 +96,25 @@
</div>
</div>
<!-- Latest jQuery from Google CDN -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- Crypto JS -->
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<!-- Beautify Web - HTML, CSS, JS -->
<script src="js/beautify-web/beautify-html.js"></script>
<script src="js/beautify-web/beautify-css.js"></script>
<script src="js/beautify-web/beautify.js"></script>
<!-- Ace Editor -->
<script src="js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<!-- Together -->
<script src="https://togetherjs.com/togetherjs-min.js"></script>
<!-- SASS and CoffeeScript -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.12.4/coffee-script.min.js' type='text/javascript'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/sass.js/0.10.3/sass.min.js' type='text/javascript'></script>
<!-- JSTinker Scripts -->
<script src="js/jstinker.js"></script>
<!-- Set Editor Modes -->
<script>
ace.require("ace/ext/language_tools");

View file

@ -1,277 +1,4 @@
$("document").ready(function() {
var libs = {};
// List of Frameworks & Extensions
var frameworks = {
// jQuery
"jQuery Compat (edge)": "http://code.jquery.com/jquery-git.js",
"jQuery (edge)": "http://code.jquery.com/jquery-compat-git.js",
"jQuery 2.1.0": "http://code.jquery.com/jquery-2.1.0.js",
"jQuery 2.0.2": "http://code.jquery.com/jquery-2.0.2.js",
"jQuery 1.10.1": "http://code.jquery.com/jquery-1.10.1.js",
"jQuery 1.9.1": "http://code.jquery.com/jquery-1.9.1.js",
"jQuery 1.8.3": "http://code.jquery.com/jquery-1.8.3.js",
"jQuery 1.7.2": "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js",
"jQuery 1.6.4": "http://code.jquery.com/jquery-1.6.4.js",
// Prototype
"Prototype 1.7.1": "https://ajax.googleapis.com/ajax/libs/prototype/1.7.1/prototype.js",
"Prototype 1.6.1.0": "http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js",
// YUI
"YUI 3.17.2": "http://yui.yahooapis.com/3.17.2/build/yui/yui-min.js",
"YUI 3.16.0": "http://fiddle.jshell.net/_display/yui.yahooapis.com/3.16.0/build/yui/yui-min.js",
"YUI 3.14.0": "http://yui.yahooapis.com/3.14.0/build/yui/yui-min.js",
"YUI 3.10.1": "http://yui.yahooapis.com/3.10.1/build/yui/yui.js",
"YUI 3.8.0": "http://yui.yahooapis.com/3.8.0/build/yui/yui-min.js",
"YUI 3.7.3": "http://yui.yahooapis.com/3.7.3/build/yui/yui-min.js",
"YUI 3.6.0": "http://yui.yahooapis.com/3.6.0/build/yui/yui.js",
"YUI 3.5.0": "http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js",
"YUI 2.8.0r4": "http://ajax.googleapis.com/ajax/libs/yui/2.8.0r4/build/yuiloader/yuiloader-min.js",
// Dojo
"Dojo Nightly": "http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/dojo.js",
"Dojo 1.10.1": "http://ajax.googleapis.com/ajax/libs/dojo/1.10.1/dojo/dojo.js",
"Dojo 1.9.4": "http://ajax.googleapis.com/ajax/libs/dojo/1.9.4/dojo/dojo.js",
"Dojo 1.8.7": "http://ajax.googleapis.com/ajax/libs/dojo/1.8.7/dojo/dojo.js",
"Dojo 1.7.6": "http://ajax.googleapis.com/ajax/libs/dojo/1.7.6/dojo/dojo.js",
"Dojo 1.6.2": "http://ajax.googleapis.com/ajax/libs/dojo/1.6.2/dojo/dojo.xd.js",
"Dojo 1.5.3": "http://ajax.googleapis.com/ajax/libs/dojo/1.5.3/dojo/dojo.xd.js",
// Processing.js
"Processing.js 1.4.7": "http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.7/processing.min.js",
"Processing.js 1.4.1": "http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing.min.js",
"Processing.js 1.3.6": "http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.3.6/processing.min.js",
"Processing.js 1.2.3": "http://processingjs.org/content/download/processing-js-1.2.3/processing-1.2.3.js",
// ExtJS
"ExtJS 4.2.0": "http://cdn.sencha.io/ext-4.2.0-gpl/ext-all.js",
"ExtJS 4.1.1": "http://cdn.sencha.io/ext-4.1.1-gpl/ext-all.js",
"ExtJS 4.1.0": "http://fiddle.jshell.net/js/lib/extjs-4.1.0/ext-all.js",
"ExtJS 3.4.0": "http://cdn.sencha.io/ext-3.4.0/adapter/ext/ext-base.js", // + Next
"ExtJS 3.1.0": "http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core-debug.js",
// Raphael
"Raphael 2.1.0": "http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js",
"Raphael 1.5.2 (min)": "http://fiddle.jshell.net/js/lib/raphael-1.5.2-min.js",
"Raphael 1.4": "http://fiddle.jshell.net/js/lib/raphael1.4.js",
// RightJS
"RightJS 2.3.1": "http://cdn.rightjs.org/right-2.3.1.js",
"RightJS 2.1.1": "http://fiddle.jshell.net/js/lib/right.js",
// Three.js
"Three.js r54": "http://cdnjs.cloudflare.com/ajax/libs/three.js/r54/three.min.js",
// Zepto
"Zepto 1.0rc1": "http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js",
// Enyo
// Shipyard
"Shipyard (nightly)": "http://static.seanmonstar.com/shipyard/shipyard-nightly.js",
"Shipyard 0.2": "http://static.seanmonstar.com/shipyard/shipyard-all-v0.2.0.js",
// Knockout.js
"Knockout.js 3.0.0": "http://knockoutjs.com/downloads/knockout-3.0.0.js",
"Knockout.js 2.3.0": "http://cdnjs.cloudflare.com/ajax/libs/knockout/2.3.0/knockout-min.js",
"Knockout.js 2.2.1": "http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.1/knockout-min.js",
"Knockout.js 2.1.0": "http://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min.js",
"Knockout.js 2.0.0": "http://cdnjs.cloudflare.com/ajax/libs/knockout/2.0.0/knockout-min.js",
// The X Toolkit
"The X Toolkit edge": "http://get.goxtk.com/xtk_edge.js",
// AngularJS
"AngularJS 1.2.1": "http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.js",
"AngularJS 1.1.1": "http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js",
// Ember
"Ember 1.3.1": "http://http//builds.emberjs.com/tags/v1.3.1/ember.prod.js",
// Underscore
"Underscore 1.4.4": "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js",
"Underscore 1.4.3": "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js",
"Underscore 1.3.3": "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js",
// Bonsai
"Bonsai 0.4.1": "http://cdnjs.cloudflare.com/ajax/libs/bonsai/0.4.1/bonsai.min.js",
// KineticJS
"KineticJS 4.3.1": "http://cdnjs.cloudflare.com/ajax/libs/kineticjs/4.3.1/kinetic.min.js",
"KineticJS 4.0.5": "http://www.kineticjs.com/download/v4.0.5/kinetic-v4.0.5.min.js",
// FabricJS
"FabricJS 1.4.0": "http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js",
"FabricJS 1.2.0": "http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.2.0/fabric.all.min.js",
"FabricJS 0.9": "http://fabricjs.com/lib/fabric.js",
// qooxdoo
"qooxdoo 2.1": "http://cdnjs.cloudflare.com/ajax/libs/qooxdoo/2.1/q.min.js",
"qooxdoo 2.0.3": "http://cdnjs.cloudflare.com/ajax/libs/qooxdoo/2.0.3/q.min.js",
// D3
"D3 3.0.4": "http://d3js.org/d3.v3.min.js",
// CreateJS
"CreateJS 2013.09.25": "http://code.createjs.com/createjs-2013.09.25.combined.js",
// WebApp Install
"WebApp Install 0.1": "http://fiddle.jshell.net/js/lib/webapp_install.js",
// Thorax
"Thorax 2.0.0rc6": "http://cdnjs.cloudflare.com/ajax/libs/thorax/2.0.0rc6/thorax.js",
"Thorax 2.0.0rc3": "http://cdnjs.cloudflare.com/ajax/libs/thorax/2.0.0rc3/thorax.js",
// Paper.js
"Paper.js 0.22": "http://cdnjs.cloudflare.com/ajax/libs/paper.js/0.22/paper.js",
// React
"React 0.9.0": "http://cdnjs.cloudflare.com/ajax/libs/react/0.9.0/react.js",
"React 0.8.0": "http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/react.js",
"React 0.4.0": "http://fb.me/react-0.4.0.js",
"React 0.3.2": "http://dragon.ak.fbcdn.net/hphotos-ak-ash3/851559_337624843031740_50442_n.js",
// svg.js
"svg.js 0.x (latest)": "http://s3-eu-west-1.amazonaws.com/svgjs/svg.js",
// Minified
"Minified 1.0 beta1": "http://minifiedjs.com/download/minified-web-src.js",
// jTypes
"jTypes 2.1.0": "http://cdn.jtypes.com/jtypes-2.1.0.js",
// Lo-Dash
"Lo-Dash 2.2.1": "http://cdn.jsdelivr.net/lodash/2.1.0/lodash.compat.js",
// Brick
"Brick edge": "http://mozbrick.github.io/dist/brick.js",
// RactiveJS
"RactiveJS Latest": "http://cdn.ractivejs.org/latest/ractive.js",
"RactiveJS Edge": "http://cdn.ractivejs.org/edge/ractive.js",
// Vue
"Vue (edge)": "http://vuejs.org/js/vue.js",
"Vue 0.11.0": "http://cdnjs.cloudflare.com/ajax/libs/vue/0.11.0/vue.min.js"
};
var frameworks_css = {
"jQuery UI 1.10.3": "http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/css/base/jquery-ui.css",
"Bootstrap 3.2.0": "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css",
"Bootstrap 2.3.2": "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css",
"jQuery UI 1.9.2": "http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"
};
var frameworks_extras = {
"jQuery Compat (edge)": {
"QUnit 1.12.0": "http://code.jquery.com/qunit/qunit-1.12.0.js",
"jQuery UI 1.10.3": "http://code.jquery.com/jquery-git.js",
"Firebug Lite 1.4.0": "http://cdnjs.cloudflare.com/ajax/libs/firebug-lite/1.4.0/firebug-lite.js",
"jQuery Lint (edge)": "http://fiddle.jshell.net/js/lib/jquery.lint.js"
},
"jQuery (edge)": {
"jQuery UI 1.8.5": "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js",
"QUnit": "http://github.com/jquery/qunit/raw/master/qunit/qunit.js",
"Firebug Lite": "https://getfirebug.com/firebug-lite-debug.js",
"jQuery UI 1.8.9": "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js",
"jQuery Lint": "http://fiddle.jshell.net/js/lib/jquery.lint.js"
},
"jQuery 2.1.0": {
"Bootstrap 3.2.0": "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js",
"Bootstrap 2.3.2": "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"
},
"jQuery 2.0.2": {
"Migrate 1.2.1": "http://code.jquery.com/jquery-migrate-1.2.1.js",
"jQuery UI 1.10.3": "http://code.jquery.com/ui/1.10.3/jquery-ui.js"
},
"jQuery 1.9.1": {
"Migrate 1.1.0": "http://code.jquery.com/jquery-migrate-1.1.0.js",
"jQuery UI 1.9.2": "http://code.jquery.com/ui/1.9.2/jquery-ui.js"
},
"jQuery 1.8.3": {
"jQuery UI 1.9.2": "http://code.jquery.com/ui/1.9.2/jquery-ui.js"
},
"jQuery 1.7.2": {
"jQuery UI 1.8.18": "http://code.jquery.com/ui/1.8.18/jquery-ui.min.js",
"jQuery Lint (13 June '11)": "http://fiddle.jshell.net/js/lib/jquery.lint-11-06.js",
"Bootstrap 2.0.2 (js only)": "http://fiddle.jshell.net/js/lib/bootstrap-2.0.2.js",
},
"Prototype 1.7.1": {
"script.aculo.us 1.9": "http://fiddle.jshell.net/js/lib/scriptaculous-js-1.9.0/src/scriptaculous.js",
"Scripty 2.0b1": "http://fiddle.jshell.net/js/lib/s2-b.js"
},
"Prototype 1.6.1.0": {
"script.aculo.us 1.8.3": "http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js",
"Scripty2 2.0.0-a5": "http://fiddle.jshell.net/js/lib/s2.js"
},
"ExtJS 3.4.0": {
"Ext All Debug": "http://cdn.sencha.io/ext-3.4.0/ext-all-debug.js"
},
"Underscore 1.4.4": {
"Backbone LocalStorage": "http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js",
"Backbone ModelBinder": "http://cdnjs.cloudflare.com/ajax/libs/backbone.modelbinder/0.1.3/Backbone.ModelBinder-min.js",
"Backbone 1.0": "http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone.js"
},
"Undersocre 1.4.3": {
"Backbone 0.9.10": "http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.10/backbone-min.js",
"Backbone LocalStorage": "http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js",
"Backbone ModelBinder": "http://cdnjs.cloudflare.com/ajax/libs/backbone.modelbinder/0.1.3/Backbone.ModelBinder-min.js"
},
"Underscore 1.3.3": {
"Backbone 0.9.2": "http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js",
"Backbone LocalStorage": "http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js",
"Backbone ModelBinder": "http://cdnjs.cloudflare.com/ajax/libs/backbone.modelbinder/0.1.3/Backbone.ModelBinder-min.js"
},
"React 0.8.0": {
"JSXTransformer.js 0.8.0": "http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/JSXTransformer.js"
},
"React 0.4.0": {
"JSXTransformer.js 0.4.0": "http://fb.me/JSXTransformer-0.4.0.js"
},
"React 0.3.2": {
"JSXTransformer.js 0.3.2": "http://dragon.ak.fbcdn.net/hphotos-ak-prn1/851582_580035725361422_42012_n.js"
},
"Brick edge": {
"Brick CSS": "http://mozbrick.github.io/dist/brick.css"
}
};
// Frameworks & Extensions Dropdown
$("#dropdownMenu1 li a").click(function(event){
event.preventDefault();
$(".extra").remove();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
var lib_extras = frameworks_extras[selText];
for (extra in lib_extras)
dropdown.append("<div class='extra checkbox'><label><input type='checkbox'></input><span class='chk_lbl'>" + extra + "</span></label></div>");
});
// Script Injection Dropdown
$("#dropdownMenu2 li a").click(function(event){
event.preventDefault();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
});
// Doctype Dropdown
$("#dropdownMenu3 li a").click(function(event){
event.preventDefault();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
});
// HTML Dropdown
$("#dropdownMenu4 li a").click(function(event){
event.preventDefault();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
});
// CSS Dropdown
$("#dropdownMenu5 li a").click(function(event){
event.preventDefault();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
});
// Javascript Dropdown
$("#dropdownMenu6 li a").click(function(event){
event.preventDefault();
var dropdown = $(this).parents('.btn-group');
var selText = $(this).text();
dropdown.find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
});
// RUN Button
$("#btnRun").click(function(event) {
event.preventDefault();
@ -282,39 +9,16 @@ $("document").ready(function() {
var script = ace.edit("js-editor").getSession().getValue();
var html = ace.edit("html-editor").getSession().getValue();
var dropdownMenu1Sel = $("#dropdownMenu1").parents('.btn-group').find('.dropdown-toggle').text().trim();
var lib = frameworks[dropdownMenu1Sel];
var extra_libs = []
$("#dropdownMenu1").parents('.btn-group').find('input:checked').parent().each(
function(){ extra_libs.push($(this).text().trim());}
);
var dropdownMenu2Sel = $("#dropdownMenu2").parents('.btn-group').find('.dropdown-toggle').text().trim();
previewDoc.write("<!DOCTYPE html>");
previewDoc.write("<html>");
previewDoc.write("<html lang='en'>");
previewDoc.write("<head>");
previewDoc.write("<style type='text/css'>" + css + "</style>");
if (lib)
previewDoc.write("<script src=" + lib + " type='text/javascript'></script>");
for (var i in extra_libs)
{
if (extra_libs[i] in frameworks_css)
previewDoc.write("<style type='text/css' src=" + frameworks_css[extra_libs[i]] + "></style>");
if (lib in frameworks_extras)
previewDoc.write("<script src=" + frameworks_extras[lib][extra_libs[i]] + " type='text/javascript'></script>");
}
if (dropdownMenu2Sel == "onLoad")
previewDoc.write("<script type='text/javascript'>window.onload = function() {" + script + "}</script>");
//else if (dropdownMenu2Sel == "onDomready")
//
else if (dropdownMenu2Sel == "No wrap - in head")
previewDoc.write("<script type='text/javascript'>" + script + "</script>");
previewDoc.write("</head>");
previewDoc.write("<body>");
previewDoc.write(html);
if (dropdownMenu2Sel == "No wrap - in body")
previewDoc.write("<script type='text/javascript'>" + script + "</script>");
previewDoc.write('<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">');
sass.compile(css, function(result) {
previewDoc.write("<style type='text/css'>" + result + "</style>");
});
previewDoc.write("<script src='https://code.jquery.com/jquery-3.1.1.min.js' type='text/javascript'></script>");
previewDoc.write("<script src='js/salet.min.js' type='text/javascript'></script>");
previewDoc.write("<script type='text/javascript'>window.onload = function() {" + coffee.compile(script) + "}</script>");
previewDoc.write("</body>");
previewDoc.write("</html>");
previewDoc.close();

39
js/salet.min.js vendored Normal file
View file

@ -0,0 +1,39 @@
(function(){var r,p,t,u,v,w,n,x,y,z,A;y=function(d){var b,f;if(null==d||"string"!==typeof d||""===d)return"";b=d.split("\n");f=b.filter(function(a){return function(a){return""!==a}}(this)).map(function(a){return function(a){return a.match(/^\s+/)}}(this)).map(function(a){return null===a?"":a[0]}).reduce(function(a,c){return c.length<a.length?c:a});return""===f?d:b.map(function(a){return a.replace(new RegExp("^"+f),"")}).join("\n")};window.markdown=function(d){if(null==d)return"";typeof d===Function&&
(d=d());d=d.toString();return marked(y(d),{smartypants:!0})};Function.prototype.fcall=Function.prototype.call;Boolean.prototype.fcall=function(){return this};String.prototype.fcall=function(){return this};n=function(d,b){return console.assert(d,b)};x=function(d,b){return"<a href='./_inv_"+b+"' class='once'>"+d+"</a>"};Array.prototype.remove=function(d){var b;if(-1<(d=this.indexOf(d)))return[].splice.apply(this,[d,d-d+1].concat(b=[])),b};A=function(d,b){return"<a href='./_act_"+b+"' class='once'>"+
d+"</a>"};z=function(d,b){window.unitname=b;return d=d.replace(/\{\{(.+)\}\}/g,function(d,a){b=window.unitname;window.unitname=void 0;return A(a,b)})};w=function(){return function(d){var b,f;this.init=function(){$("#page").on("click","a",function(a){var c;a.preventDefault();a=$(this);c=a.attr("href");(a.hasClass("once")||c.match(/[?&]once[=&]?/))&&salet.view.clearLinks(c);if(c.match(salet.linkRe))return salet.processClick(c)});$("#load").on("click","a",function(a){return window.location.reload()});
if(this.hasLocalStorage())return $(document).on("click","#erase",function(a){a.preventDefault();return salet.eraseSave()}),$(document).on("click","#save",function(a){a.preventDefault();return salet.saveGame()})};this.disableSaving=function(){return $("#save").addClass("disabled")};this.enableSaving=function(){return $("#save").removeClass("disabled")};this.enableErasing=function(){return $("#erase").removeClass("disabled")};this.disableErasing=function(){return $("#erase").addClass("disabled")};this.enableLoading=
function(){return $("#load").removeClass("disabled")};this.disableLoading=function(){return $("#load").addClass("disabled")};this.scrollTopTo=function(a){return $("html,body").stop().animate({scrollTop:a},500)};this.scrollBottomTo=function(a){return this.scrollTopTo(a-$(window).height())};this.scrollToBottom=function(){return this.scrollTopTo($("html").height()-$(window).height())};this.clearContent=function(a){var c;null==a&&(a="#content");"#content"===a&&(c=document.getElementById("intro"),null!=
c&&(c.innerHTML=""));return document.querySelector(a).innerHTML=""};this.prepareContent=function(a){"function"===typeof a&&(a=a());a instanceof $&&(a=a[0].outerHTML);return a.toString()};this.write=function(a){return function(c,e){null==e&&(e="#current-room");return a.append(c,e)}}(this);this.append=function(a,c){var e,l;null==c&&(c="#content");if(null!=a&&""!==a){a=this.prepareContent(a);if(e=$(c))return l=markdown(a),e.promise().done(function(){return e.append(l)}),l;e=$("#content");e.html(a);return e.html()}};
this.replace=function(a,c){var e;if(""!==a)return a=this.prepareContent(a),e=$(c),e.promise().done(function(){return e.html(a)})};this.clearLinks=function(a,c){var e,l,b,d;a?(null==c&&(c="#page"),d=$(c).find("a[href='"+a+"']")):(null==c&&(c="#content"),d=$(c).find("a"));l=0;for(b=d.length;l<b;l++){e=d[l];e=$(e);if(!a&&(e.hasClass("sticky")||e.attr("href").match(/[?&]sticky[=&]?/)))return;e.replaceWith($("<span>").addClass("ex_link").html(e.html()))}return!0};this.writeChoices=function(a){var c,e,
l,b,d,f,h,m,q;if(null!=a&&0!==a.length){b=salet.getCurrentRoom();l=$("<ul>").addClass("options");c=d=0;for(f=a.length;d<f;c=++d)q=a[c],m=salet.rooms[q],n(m,"unknown_situation".l({id:q})),m!==b&&((h=m.optionText.fcall(m,b.name))||(h="choice".l({number:c+1})),e=$("<li>"),c=$("<span>"),m.canChoose.fcall(this,b)&&(c=$("<a>").attr({href:q})),c.html(h),e.html(c),l.append(e));return this.write(l)}};this.mark_all_links_old=function(){return $("#page .new").removeClass("new")};this.removeTransient=function(a){return function(c){var e;
null==c&&(c=void 0);e="#content";c&&(e=".room-"+c);c=$(e+" .transient");c=c.add(e+" .options");c=c.add($(e+" a").filter(function(){return $(this).attr("href").match(/[?&]transient[=&]?/)}));a.hideBlock(c,!0);return a.clearLinks(void 0,e)}}(this);this.endOutputTransaction=function(){var a,c,e,l,b;if(salet.interactive&&(a=$(".new"),0!==a.length))return b=$(window).height(),l=0,e=a.first().offset().top,a=a.last().offset().top+a.last().height(),c=a-e,$(".options").not(".new").length&&(l=$(".options").not("new").height()),
c>b-l-50?this.scrollTopTo(e-.25*b-l):e>$("body").height()-b?this.scrollToBottom():this.scrollBottomTo(a+100-l)};this.hasLocalStorage=function(){return null!=window.localStorage};this.fixClicks=function(){return $("body").on("click","ul.options li",function(a){a=$("a",this);if(0<a.length)return $(a.get(0)).click()})};this.showBlock=function(a){return salet.interactive?$(a).slideDown("slow",function(){return $(a).fadeTo(500,1)}):$(a).show()};this.hideBlock=function(a,c){var e;null==c&&(c=!1);a=$(a);
if(!salet.interactive)return c?a.remove():a.hide();e=function(){return $(this).remove()};!1===c&&(e=void 0);a.finish().fadeTo(500,0,function(){return a.slideUp(250,e)})};this.updateWays=function(a,c){var e,l,b,d,f,h;if(null!==document.getElementById("ways")&&(e="",a)){d=[];l=0;for(b=a.length;l<b;l++)h=a[l],null!=salet.rooms[h]?(f=salet.rooms[h].title.fcall(this,c),e+="<li class='nav-item'><a class='nav-link' href='"+h+"'>"+f+"</a></li>",this.replace(e,"#ways"),d.push(this.showBlock(".ways #ways_hint"))):
d.push(this.hideBlock(".ways #ways_hint",!1));return d}};this.cycleLink=function(a){return"<a href='./_replacer_cyclewriter' class='cycle' id='cyclewriter'>"+a+"</a>"};for(b in d)f=d[b],this[b]=f;return this}}();v=function(){return function(d){var b,f;if(null==d.name)return console.error("Trying to create a unit with no name"),null;this.order=0;this.visible=!0;this.look=function(a){return function(c){if(a.dsc&&""!==a.dsc&&a.visible)return c=a.dsc.fcall(a,c).toString(),z(c,a.name)}}(this);this.takeable=
!1;this.display="";this.take=function(a){return function(){return"You take the "+a.display+"."}}(this);this.act=function(a){return function(){return"You don't find anything extraordinary about the "+a.display+"."}}(this);this.dsc=function(a){return function(){return"You see a {{"+a.display+"}} here."}}(this);this.inv=function(a){return function(){return"It's a "+a.display+"."}}(this);this.location="";this.put=function(a){return function(c){return null!=salet.rooms[c]?salet.rooms[c].take(a):console.error("Could not find location "+
c+" for a unit "+a.name)}}(this);this["delete"]=function(a){return function(c){null==c&&(c=!1);!1===c&&(c=a.location);return salet.rooms[c].drop(a)}}(this);for(b in d)f=d[b],this[b]=f}}();window.unit=function(d,b){null==b&&(b={});b.name=d;return new v(b)};r=function(){return function(d){var b,f;this.inventory=[];this.take=function(a){return function(c){return a.inventory.push(c)}}(this);this.drop=function(a){return function(c){var e,b,d,f;f=a.inventory;b=0;for(d=f.length;b<d;b++)if(e=f[b],e.name===
c)return a.inventory.remove(e),!0;return!1}}(this);this.has=function(a){return function(c){var e,b,d,f;f=a.inventory;b=0;for(d=f.length;b<d;b++)if(e=f[b],e.name===c)return!0;return!1}}(this);this.listinv=function(a){return function(c){var e,b,d,f;f=a.inventory;b=0;for(d=f.length;b<d;b++)if(e=f[b],e.name===c)return x(e.display,e.name)}}(this);this.inv=function(a){return function(c){var e,b,d,f;f=a.inventory;b=0;for(d=f.length;b<d;b++)if(e=f[b],e.name===c)return e.inv.fcall(e)}}(this);for(b in d)f=
d[b],this[b]=f;return this}}();u=function(){return function(d){var b,f;this.visited=0;this.title=this.name="Room";this.units=[];this.canChoose=this.canView=!0;this.displayOrder=this.priority=1;this.canExit=this.canSave=!0;this.tags=[];this.ways=[];this.choices="";this.optionText="Choice";this.extendSection=this.dsc=!1;this.clear=!0;this.exit=function(a){return function(a){return!0}}(this);this.enter=function(a){return function(a){return!0}}(this);this.entering=function(a){return function(c,e){var b,
d;null==e&&(e=!1);if(c!==a.name&&null!=salet.rooms[c]&&null!=salet.rooms[c].canExit&&(!1===salet.rooms[c].canExit||!1===salet.rooms[c].canExit.fcall(salet.rooms[c],a.name))&&!1===e)return salet.doTransitionTo(c,!0);a.clear&&null!=c&&salet.view.clearContent();null==salet.rooms[c]||a.clear||(!1===salet.rooms[c].extendSection?salet.view.removeTransient(c):salet.view.removeTransient());c!==a.name&&null!=salet.rooms[c]&&(a.visited++,null!=salet.rooms[c].exit&&salet.rooms[c].exit(a.name));null!=window.history.pushState&&
window.history.pushState(a.name,a.title);a.enter&&a.enter(c);a.extendSection||(b=a.classes?" "+a.classes.join(" "):"",d=document.getElementById("current-room"),null!=d&&d.removeAttribute("id"),salet.view.append("<section id='current-room' data-room='"+a.name+"' class='room-"+a.name+b+"'></section>"));c!==a.name&&null!=a.before&&salet.view.write(markdown(a.before.fcall(a,c)));salet.view.write(a.look(c));c!==a.name&&null!=a.after&&salet.view.write(markdown(a.after.fcall(a,c)));null!=a.beforeChoices&&
a.beforeChoices.fcall(a,c);a.choices&&salet.view.writeChoices(salet.getSituationIdChoices(a.choices,a.maxChoices));null!=a.afterChoices&&a.afterChoices.fcall(a,c);if(salet.autosave&&a.canSave)return salet.saveGame()}}(this);this.look=function(a){return function(c){var e,b,d,f,g,h;salet.view.updateWays(a.ways,a.name);g="";a.dsc&&""!==a.dsc&&(e=a.dsc.fcall(a,c).toString(),g+=markdown(e));e=[];f=a.units;b=0;for(d=f.length;b<d;b++)h=f[b],h.name&&"function"===typeof h.look&&h.look(c)&&e.push({order:h.order,
content:h.look(c)});e.sort(function(a,c){return a.order-c.order});b=0;for(d=e.length;b<d;b++)c=e[b],g+=" "+c.content;return markdown(g)}}(this);this.take=function(a){return function(c){c.location=a.name;return a.units.push(c)}}(this);this.drop=function(a){return function(c){var e,b,d,f;d=a.units;e=0;for(b=d.length;e<b;e++)if(f=d[e],f.name===c)return a.units.splice(a.units.indexOf(f),1),f.location=null,a.units}}(this);this.act=function(a){return function(c){var b,d,f,k,g;if(f=c.match(/^_(act|cycle|inv)_(.+)$/)){if("inv"===
f[1])return salet.view.write(salet.character.inv(f[2]));k=a.units;b=0;for(d=k.length;b<d;b++)if(g=k[b],g.name===f[2]&&"act"===f[1]){if(g.takeable)return salet.character.take(g),a.drop(f[2]),salet.view.write(g.take.fcall(g).toString());if(null!=g.act)return salet.view.write(g.act.fcall(g))}console.error("Could not find "+f[2]+" in current room.")}b=c.match(/^_(\w+)_(.+)$/);f={writer:function(b){b=a.writers[b].fcall(a,c);b=markdown(b);return salet.view.write(b)},replacer:function(b){var e;e=a.writers[b].fcall(a,
c);return salet.view.replace(e,"#"+b)},inserter:function(b){var e;e=a.writers[b].fcall(a,c);e=markdown(e);return salet.view.write(e,"#"+b)}};if(b){k=[b[1],b[2]];d=k[0];k=k[1];if(!a.writers.hasOwnProperty(b[2]))throw Error("Tried to call undefined writer: "+c);return f[d](k)}if(a.actions.hasOwnProperty(c))return a.actions[c].call(a,c);throw Error("Tried to call undefined action: "+c);}}(this);this.register=function(a){return function(){return null==a.name?(console.error("Room has no name"),a):salet.rooms[a.name]=
a}}(this);this.writers={cyclewriter:function(a){return function(){var c,b,d;d=a.cycle;"function"===typeof d&&(d=d());c=window.localStorage.getItem("cycleIndex");null==c&&(c=0);b=d[c];c++;c===d.length&&(c=0);window.localStorage.setItem("cycleIndex",c);return salet.view.cycleLink(b)}}(this)};this.link=function(a){return function(c){if(salet.rooms[c])return a.ways.push(c)}}(this);this.bilink=function(a){return function(c){var b;if(b=salet.rooms[c])return a.link(c),b.link(a.name)}}(this);for(b in d)f=
d[b],this[b]=f;return this}}();window.room=function(d,b){null==b&&(b={});b.name=d;return(new u(b)).register()};p=function(){function d(b){null==b&&(b="en");this.lang=document.getElementsByTagName("html")[0].getAttribute("lang")||b}d.prototype.strings={en:{choice:"Choice {number}",link_not_valid:"The link '{link}' doesn't appear to be valid.",link_no_action:"A link with a situation of '.', must have an action.",unknown_room:"Room not found: {id}.",erase_message:"This will permanently delete this character and immediately return you to the start of the game. Are you sure?",
dice_string_error:"Couldn't interpret your dice string: '{string}'."}};d.prototype.push=function(b,d){return null!=this.strings[b]?this.strings[b]=$.extend(this.strings[b],d):this.strings[b]=d};d.prototype.localize=function(b,d){var a;null==d&&(d=this.lang);return null!=this.strings[d]&&(a=this.strings[d][b])?a:b};return d}();window.i18n=new p;String.prototype.l=function(d){var b,f;b=window.i18n.localize(this);if("function"===typeof b)b=b(d);else if(d)for(f in d)b=b.replace(new RegExp("\\{"+f+"\\}"),
d[f]);return b};t=function(){function d(b){var d;this.seed=b;this.multiplier=1664525;this.modulo=4294967296;this.offset=1013904223;null!=this.seed&&0<=(d=this.seed)&&d<this.modulo||(this.seed=(new Date).valueOf()*(new Date).getMilliseconds()%this.modulo)}d.prototype.seed=function(b){return this.seed=b};d.prototype.getSeed=function(){return this.seed};d.prototype.randn=function(){return this.seed=(this.multiplier*this.seed+this.offset)%this.modulo};d.prototype.randf=function(){return this.randn()/
this.modulo};d.prototype.rand=function(b){return Math.floor(this.randf()*b)};d.prototype.randRange=function(b,d){return b+this.rand(d-b)};d.prototype.randomInt=function(b){return this.rand(b)};d.prototype.dice=function(b,d,a){var c,e;null==b&&(b=1);null==a&&(a=0);for(c=e=0;0<=b?c<=b:c>=b;0<=b?++c:--c)e=1+Math.floor(this.randf()*d);a&&(e+=a);return e};d.prototype.diceString=function(b){var d,a;d=b.match(/^([1-9][0-9]*)?d([%FA]|[1-9][0-9]*)([-+][1-9][0-9]*)?$/);if(!d)throw Error("dice_string_error".l({string:b}));
a=1;b=0;d[1]&&(a=parseInt(d[1],10));d[3]&&(b=parseInt(d[3],10));switch(d[2]){case "F":d=3;b-=2*a;break;case "%":d=100;break;default:d=parseInt(d[2],10)}return this.dice(a,d,b)};return d}();p=function(){return function(d){var b,f;this.character=new r;this.game_id=null;this.game_version="1.0";this.autoload=this.autosave=!0;this.rnd=null;this.time=0;this.rooms={};this.start="start";this.linkRe=/^([0-9A-Za-z_-]+|\.)(\/([0-9A-Za-z_-]+))?$/;this.init=function(){};this.enter=function(a,c){};this.afterEnter=
function(a,c){};this.beforeAction=function(a,c){};this.afterAction=function(a,c){};this.exit=function(a,c){};this.getSituationIdChoices=function(a,c){var b,d,f,k,g,h,m;f=0;"string"===typeof a&&(a=[a]);b=[];f=0;for(d=a.length;f<d;f++)if(k=a[f],"#"===k.substr(0,1))for(g=this.getRoomsTagged(k.substr(1)),h=0,m=g.length;h<m;h++)k=g[h],b.push(k);else b.push(k);d=this.getCurrentRoom();f=[];g=0;for(k=b.length;g<k;g++)m=b[g],h=this.rooms[m],n(h,"unknown_room".l({id:m})),h.canView.fcall(this,d,h)&&f.push({priority:h.priority,
id:m,displayOrder:h.displayOrder});f.sort(function(a,c){return c.priority-a.priority});b=[];null!=c&&f.length>c&&(f=f.slice(-c));g=0;for(k=f.length;g<k;g++)d=f[g],b.push({id:d.id,displayOrder:d.displayOrder});b.sort(function(a,c){return a.displayOrder-c.displayOrder});g=[];k=0;for(d=b.length;k<d;k++)f=b[k],g.push(f.id);return g};this.progress={seed:null,sequence:[],path:[],saveTime:null};this.current=null;this.interactive=!0;this.linkStack=this.startTime=null;this.getCurrentRoom=function(){return this.current?
this.rooms[this.current]:null};this.getSaveId=function(){return"salet_"+this.game_id+"_"+this.game_version};this.processLink=function(a){if(null!==this.linkStack)this.linkStack.push(a);else{this.view.mark_all_links_old();this.linkStack=[];for(this.processOneLink(a);0<this.linkStack.length;)a=this.linkStack.shift(),this.processOneLink(a);this.linkStack=null;this.view.endOutputTransaction();return this.view.enableSaving()}};this.goTo=function(a){return this.processClick(a)};this.processOneLink=function(a){var c,
b,d;if(c=a.match(this.linkRe))return a=this.checkTimer(),b=c[1],c=c[3],"."!==b&&b!==this.current?this.doTransitionTo(b):c&&(d=this.getCurrentRoom())&&(b=!1,this.beforeAction&&(b=this.beforeAction(d,c)),!0!==b&&d.act(c),this.afterAction&&this.afterAction(d,c)),this.view.append(a);console.error("link_not_valid".l());console.error(a)};this.processClick=function(a){var c;this.time=.001*(new Date).getTime()-this.startTime;if(c=a.match(this.linkRe)[1])if(c="."===c?this.getCurrentRoom():this.getRoom(c),
n(c,"unknown_room".l({id:c})),!c.canSave)return this.processLink(a);this.progress.sequence.push({link:a,when:this.time});null!=this.getRoom(a)&&this.progress.path.push(a);return this.processLink(a)};this.goBack=function(a){null==a&&(a=2);window.history.back();if(1===this.progress.path.length)a=this.start;else if(this.progress.path.length>a)a=this.progress.path[this.progress.path.length-a];else return this.goBack(a-1);return this.processClick(a)};this.doTransitionTo=function(a,c){var b,d,f;null==c&&
(c=!1);f=this.current;d=this.getCurrentRoom();b=this.rooms[a];n(b,"unknown_room".l({id:a}));d&&this.exit&&this.exit(f,a,c);this.current=a;this.enter&&this.enter(f,a,c);b.entering(f,c);if(this.afterEnter)return this.afterEnter(f,a,c)};this.eraseSave=function(a){var c;null==a&&(a=!1);c=this.getSaveId();if(localStorage.getItem(c)&&(a||confirm("erase_message".l())))return localStorage.removeItem(c),window.location.reload()};this.getRoomsTagged=function(a){var c,b,d,f,k,g,h;h=[];k=this.rooms;for(b in k)for(c=
k[b],g=c.tags,d=0,f=g.length;d<f;d++)if(c=g[d],c===a){h.push(b);break}return h};this.saveGame=function(){var a;a=.001*(new Date).getTime();this.progress.saveTime=a-this.startTime;localStorage.setItem(this.getSaveId(),JSON.stringify({progress:this.progress}));this.view.disableSaving();this.view.enableErasing();return this.view.enableLoading()};this.loadGame=function(a){var c,b,d;if(this.interactive){this.progress=a.progress;this.character=new r;this.rnd=new t(this.progress.seed);this.init();this.interactive=
!1;b=this.progress.sequence;a=0;for(c=b.length;a<c;a++)d=b[a],this.time=d.when,this.processLink(d.link);this.interactive=!0;a=.001*(new Date).getTime();return a-this.progress.saveTime}};this.view=new w;this.getSave=function(){var a;this.getSaveId();a=!1;this.view.hasLocalStorage()&&(a=localStorage.getItem(this.getSaveId()),a=JSON.parse(a));return a};this.beginGame=function(){var a;this.view.fixClicks();if((a=this.getSave())&&this.autoload)try{return this.loadGame(a),this.view.disableSaving(),this.view.enableErasing()}catch(c){return console.log("There was an error loading your save. The save will be overwritten."),
console.error(c)}else return this.rnd=new t,this.progress.seed=this.rnd.getSeed(),this.progress.sequence=[{link:this.start,when:0}],this.startTime=.001*(new Date).getTime(),this.init(),this.doTransitionTo(this.start)};this.getRoom=function(a){if(null!=this.rooms[a])return this.rooms[a]};this.here=function(){return this.getCurrentRoom()};this.isVisited=function(a){return(a=this.getRoom(a))?!!a.visited:0};this.timers={};this.addTimer=function(a,c,b,d){null==b&&(b=!1);null==d&&(d=1);this.timers[a]={step:d,
repeatable:b,action:c,set:this.progress.sequence.length};return this.timers};this.dropTimer=function(a){return delete this.timers[a]};this.resetTimer=function(a){return this.timers[a].set=this.progress.sequence.length};this.checkTimer=function(){var a,c,b,d;if(0===Object.keys(this.timers).length)return"";c="";a=this.timers;for(d in a)b=a[d],this.progress.sequence.length-b.set===b.step&&(c+="\n\n"+b.action.fcall(this),b.repeatable||this.dropTimer(d));return c};for(b in d)f=d[b],this[b]=f;return this}}();
window.salet=new p;salet.view.init()}).call(this);