Skip to content

Commit

Permalink
#139 GUI, start a specification for the configuration file format.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajvincent committed Nov 26, 2017
1 parent 7e0269b commit 7d0893c
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -706,5 +706,8 @@ <h2>Add a function (or other object)</h2>
<div id="iframe-box">
<iframe src="gui/blob/BlobLoader.html" id="BlobLoader"></iframe>
</div>
<div>
<a href="gui/specification.html">Configuration file format specification</a>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions docs/gui/spec-render.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
window.addEventListener("load", function() {
let editor = CodeMirrorManager.buildNewEditor(
document.getElementById("root-source"),
{readOnly: true}
);
editor.setSize(800, 300);

editor = CodeMirrorManager.buildNewEditor(
document.getElementById("distortions"),
{readOnly: true}
);
editor.setSize(800, 300);
}, true);
153 changes: 153 additions & 0 deletions docs/gui/specification.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<!DOCTYPE html>
<html>
<head>
<title>Distortions GUI Configuration File Specification</title>

<base href="../">
<meta charset="UTF-8">

<script type="application/javascript"
src="libraries/codemirror-5.25.2/lib/codemirror.js"></script>
<link rel="stylesheet"
href="libraries/codemirror-5.25.2/lib/codemirror.css">
<script type="application/javascript"
src="libraries/codemirror-5.25.2/addon/fold/foldcode.js"></script>
<script type="application/javascript"
src="libraries/codemirror-5.25.2/addon/fold/foldgutter.js"></script>
<script type="application/javascript"
src="libraries/codemirror-5.25.2/addon/fold/brace-fold.js"></script>
<script type="application/javascript"
src="libraries/codemirror-5.25.2/addon/fold/comment-fold.js"></script>
<script type="application/javascript"
src="libraries/codemirror-5.25.2/addon/fold/indent-fold.js"></script>
<link rel="stylesheet"
href="libraries/codemirror-5.25.2/addon/fold/foldgutter.css">
<script type="application/javascript"
src="libraries/codemirror-5.25.2/mode/javascript/javascript.js"></script>

<script type="application/javascript"
src="gui/utilities/CodeMirrorManager.js"
></script>

<script type="application/javascript"
src="gui/spec-render.js"></script>
</head>
<body>
<h1>Distortions GUI Configuration File Specification</h1>
<h2>Root structure</h2>
<textarea id="root-source">{
/* Configuration of the script environment the GUI should work with. */
"configurationSetup": {
/* True if the files are in a zip archive the user provides,
false if the user must provide files manually. */
"useZip": true,
"commonFiles": [
/* String[] of relative paths to source code files defining the
objects the Membrane is supposed to reflect and/or distort. */
],
/* a floating point number representing this format version */
"formatVersion": 1.0,

/* UTC datetime stamp for when this was last generated.
"lastUpdated": "",

/* String[] of user comments. Optional. */
"comments": [],
},

"membrane": {
/* source code of membrane's passthrough function, or null */
"passThrough": "",

/* String[] of user comments. Optional. */
"comments": [],
},

"preGraphSources": [

],

"graphs": [
{
"name": "", /* String for the graph name */
"isSymbol": false, /* true if the graph name is a Symbol */

/* source code of object graph's passthrough function, or null */
"passThrough": "",

"distortions": [
/* Distortions configuration objects */
],

"proxyListeners": [
/* Source code for proxy listeners on this graph, after the distortions
listener has run. */
],

"functionListeners": [
/* Source code for function listeners on this graph. */
],

/* String[] of user comments. Optional. */
"comments": [],
}
],

"postGraphSources": [

]
}
</textarea>


<h2>Distortions configuration objects</h2>
<textarea id="distortions">{
/* String name of the object in the source code. */
"objectName": "",

/* True if the object is a function. */
"isFunction": true,

"getExample": "",

"valueByName": {
"filterOwnKeys": [],
"proxyTraps": [],
"inheritFilter": false,
"storeUnknownAsLocal": false,
"requireLocalDelete": false,
"useShadowTarget": false,
"truncateArgList": false,
"whitelistFilter": null,
"notesPerKey": {
},
"comments": []
},

"valueByFilter": {
/* same shape as "valueByName" above */
},
"filterToMatch": "",

"prototype": {
/* same shape as "valueByName" above */
},

"instance": {
/* same shape as "valueByName" above */
},

"argument:this": {
/* same shape as "valueByName" above */
},

"argument:0" {
/* same shape as "valueByName" above */
},

/* String[] of user comments. Optional. */
"comments": [],
}
</textarea>
</body>
</html>

0 comments on commit 7d0893c

Please sign in to comment.