-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (43 loc) · 1.77 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<script src="lib/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="lib/bootstrap.min.css">
<script src="script.js"></script>
<script src="lib/fileSaver.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/bootstrap.min.js"></script>
</head>
<body ng-app="jsonGenerator">
<div ng-controller="myController as controller" class="container">
<h1 class="text-center" ng-dblclick="controller.editTitle()" title="Double-click to edit this title.">{{controller.generatedJson.title}}</h1>
<div ng-repeat="row in controller.generatedJson.rows">
<div class="row">
<div class="col-sm-4">
<textarea ng-model="row.key" class="text-bold" auto-resize
ng-focus="controller.selectedRowIndex = $index;" ng-blur="controller.selectedRowIndex = null;"></textarea>
</div>
<div class="col-sm-8">
<textarea ng-model="row.value" auto-resize></textarea>
</div>
</div>
<hr>
</div>
<div class="row">
<div class="col-sm-12">
<button ng-click="controller.addKey('Type here...', null)">Add new row</button>
<button ng-show="controller.selectedRowIndex !== null" ng-click="controller.deleteRow(controller.selectedRowIndex)">Delete selected row</button>
</div>
</div>
<hr>
<button ng-click="controller.loadFile()">Load JSON</button>
<button ng-click="controller.saveFile('generated.json')">Save JSON</button>
<button ng-click="controller.resetJson()">Clear</button>
<hr>
<input type="checkbox" ng-model="showJson"> Show JSON
<pre ng-show="showJson">{{ controller.generatedJson | json }}</pre>
</div>
<script src="directives/textarea-resizer.js"></script>
</body>
</html>