This repository has been archived by the owner on Nov 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.html
170 lines (150 loc) · 5.72 KB
/
frame.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="blockly/blockly_compressed.js"></script>
<script src="blockly/blocks_compressed.js"></script>
<script src="blockly/msg/js/en.js"></script>
<script src="blockly/generators/python.js"></script>
<script src="blockly/generators/python/text.js"></script>
<script src="blockly/generators/python/math.js"></script>
<!-- Hiding my oauth token -->
<script src="src/oauth_token.js"></script>
<script src="src/lib/js-yaml.min.js"></script>
<script src="src/lib/ramda.min.js"></script>
<script src="src/lib/async-mds.js"></script>
<script src="src/lib/octokat.js"></script>
<script src="src/utils.js"></script>
<script src="src/metaMDS_block_creation.js"></script>
<script src="src/concept_loader.js"></script>
<script src="src/github_loader.js"></script>
<script src="src/code_editor.js"></script>
<script src="src/mds_editor.js"></script>
<script src="src/lib/example_concepts/yaml_concepts.js"></script>
<!-- Codemirror -->
<link rel="stylesheet" href="src/css/codemirror.css">
<script src="src/lib/codemirror.js"></script>
<script src="src/lib/vim.js"></script>
<script src="src/lib/yaml.js"></script>
<script src="src/lib/jquery-2.1.3.min.js"></script>
<script src="src/lib/bootstrap-3.3.4-dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="src/lib/bootstrap-3.3.4-dist/css/bootstrap.min.css">
<script src="src/lib/jquery.nouislider.min.js"></script>
<link rel="stylesheet" href="src/lib/bootstrap-material-design/css/roboto.min.css">
<link rel="stylesheet" href="src/lib/bootstrap-material-design/css/material-fullpalette.min.css">
<link rel="stylesheet" href="src/lib/bootstrap-material-design/css/ripples.min.css">
<script src="src/lib/bootstrap-material-design/js/ripples.min.js"></script>
<script src="src/lib/bootstrap-material-design/js/material.min.js"></script>
<style>
html, body {
background-color: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
}
.blocklySvg {
height: 100%;
width: 100%;
}
.main {
display: table;
}
#workspace-container {
position: absolute;
height: 36px;
top: 0;
width: 100%;
margin: 0;
}
.workspace-main {
position: absolute;
width: 100%;
top: 40px;
bottom: 100px;
}
.workspace-footer {
position: absolute;
width: 100%;
bottom: 0;
height: 50px;
}
#working-container {
height: 100%;
}
#toolbox-container {
float: left;
height: 100%;
width: 50%;
}
#editor-container {
background: gray;
float: right;
position: absolute;
height: 100%;
width: 50%;
}
</style>
<script>
var yaml = jsyaml;
function init() {
var editor = new MDSEditor({
openProjectBtn: document.getElementById('open-project'),
loginBtn: document.getElementById('login'),
logoutBtn: document.getElementById('logout')
});
// Download, Save buttons
document.getElementById('download').onclick = editor.downloadActiveWorkspace.bind(editor);
document.getElementById('save').onclick = editor.saveProject.bind(editor);
document.getElementById('toggle-editor').onclick = editor.toggleCodeEditor.bind(editor);
// Update the layout on resize
var editorContainer = document.getElementById('editor-container'),
toolboxContainer = document.getElementById('toolbox-container');
var updateLayout = function() {
// Get width, left
var rect = toolboxContainer.getBoundingClientRect(),
pos = rect.left + rect.width;
// Set left of editorContainer
editorContainer.style.left = pos+'px';
// Fix the height, width
// TODO
};
window.onresize = updateLayout;
if(typeof onIPyHook !== 'undefined' && typeof(onIPyHook) === 'function') {
onIPyHook(editor);
}
}
</script>
</head>
<body onload="init()">
<div class="main">
<div id="workspace-container" class="btn-group btn-group-justified">
<a href="javascript:void(0)" class="btn btn-default">Loading...</a>
</div>
<div class="workspace-main">
<div id="tag-container" class="btn-group-horizontal">
<a href="javascript:void(0)" class="btn btn-default">Loading...</a>
</div>
<div id='working-container'>
<div class="" id="toolbox-container"></div>
<textarea class="" id="editor-container"></textarea>
</div>
</div>
<xml id="toolbox" style="display: none"></xml>
<div id="tag-container"></div>
<div class="workspace-footer">
<div class="pull-left">
<a id="login" href="javascript:void(0)" class="btn btn-info">Login</a>
<a id="logout" href="javascript:void(0)" style="display:none" class="btn btn-warning">Logout</a>
<a id="open-project" href="javascript:void(0)" class="btn btn-info">Open Project</a>
</div>
<div class="pull-right">
<a id="toggle-editor" href="javascript:void(0)" class="btn btn-success">Edit Text</a>
<a id="download" href="javascript:void(0)" class="btn btn-success">Download YAML</a>
<a id="save" href="javascript:void(0)" class="btn btn-success">Commit</a>
</div>
</div>
</div>
</body>
<!-- Download button -->
</html>