-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglossary-table.html
More file actions
101 lines (93 loc) · 3.35 KB
/
glossary-table.html
File metadata and controls
101 lines (93 loc) · 3.35 KB
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
<!DOCTYPE html>
<html>
<!-- alias dbf="cd '/Users/parinkat/Parinkats DBF/0 - ParinDBFResources/glossary'; Python -m SimpleHTTPServer 9999 &; open http://localhost:9999/" -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>DBF Spiritual Glossary</title>
<link rel="stylesheet" href="./bootstrap.min.css">
<script src="./angular.min.js"></script>
<style>
</style>
</head>
<body class="alert-dark">
<div ng-app="myApp" ng-controller="myController">
<nav class="navbar navbar-dark bg-dark">
<div class="container">
<div class="row">
<div class="col">
<img style="width: 100px;height: 45px;" src="logo-small.png">
</div>
<!-- <div class="col">
<img style="width: 200px;height: 45px;" src="banner.jpeg">
</div> -->
<div class="col">
<div class="navbar-brand">DBF Spiritual Glossary</div>
</div>
</div>
</div>
</nav>
<br>
<div class="container">
<div class="table-responsive">
<table class="table align-middle table-hover alert-light">
<thead class="table-dark">
<tr>
<th>#</th>
<th>
<!-- Word -->
<input type="text" ng-model="search" placeholder="search" autofocus />
</th>
<th>Meaning
</th>
</tr>
</thead>
<!--TABLE ROWS WITH A FILTER-->
<tbody>
<tr ng-repeat="word in words | filter : search">
<td>{{word.id}}</td>
<td>
<b>
{{word.word}}
</b>
</td>
<td>
{{word.meaning}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
<script>
angular.module("myApp", [])
.controller('myController', ['$scope', '$http', '$location', function($scope, $http, $location) {
$scope.search = $location.search().search;
var request = {
method: 'get',
url: './glossary.json',
dataType: 'json',
contentType: "application/json"
};
$scope.words = {};
$http(request)
.success(function(jsonData) {
$scope.words = transform(jsonData);
})
.error(function() {
$scope.words = [];
});
function transform(wordsObject) {
let words = [];
let id = 1;
for (let word in wordsObject) {
words.push({ id: id++, word: word, meaning: wordsObject[word] });
}
return words;
}
}]);
</script>
<script src="./bootstrap.bundle.min.js"></script>
</html>