-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.html
36 lines (26 loc) · 1.46 KB
/
demo.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
<html>
<head>
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="ui/style/style.css" rel="stylesheet">
<script data-main="browser-main.js" src="lib/require/require.js"></script>
</head>
<body>
<p class="loading-message">Loading...</p>
<p data-bind="visible:sheet().items().length == 0">Click somewhere...</p>
<script id="sheetItemTemplate" type="text/html">
<div class="sheetItem" data-bind="style: {left:position().x, top:position().y}, css:{beingEdited:isEditing()}, click:startEditing">
<input placeholder='name' data-bind='visible:isEditing, value:requestedName'>
<span data-bind="visible:!isEditing(), text: name() ? name() + ':' : '' "></span>
<input autofocus="autofocus" placeholder='value expression' data-bind="visible:isEditing, value:definition, valueUpdate:'afterkeydown', returnKey: stopEditing"></input>
<span data-bind="visible:!isEditing(), text:value, attr:{title:definition}"></span>
</div>
</script>
<div id="control-area">
<input type='button' data-bind="click:save" value='Save'></button>
<input type='button' data-bind="click:load, enable:loadButtonEnabled" value='Load'></button>
<input id="loadingJSON" data-bind="value:loadingJSON"></input>
</div>
<div id="sheetArea" style="width:100%" data-bind="template:{name:'sheetItemTemplate', foreach:sheet().items}, click:sheet().clicked">
</div>
</body>
</html>