-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
64 lines (55 loc) · 2.21 KB
/
popup.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
<!doctype html>
<html>
<head>
<title>Getting Started Extension's Popup</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"/>
</head>
<body class="mainBody" id="mainBody">
<h1>This is my trusted language resource</h1>
<form class="form border-bottom pb-2">
<label class="form-label" for="termInput">Term to translate</label>
<input id="termInput" type="text" class="form-control" data-bind="value: term"/>
<button class="btn btn-primary mt-2" type="submit" id="searchBtn" data-bind="click: search, disable: loading">
<span data-bind="text: loading() ? 'Loading' : 'Search'"></span>
</button>
</form>
<!-- ko if: !loading() -->
<div class="mt-2" data-bind="if: !loading() && hasSearchedSomething()">
<div data-bind="if: !loading()" class="mt-3 mb-3">
<h2 class="text-center">EN -> PL</h2>
<ul data-bind="foreach: translations" class="mt-2 list-group">
<li class="list-group-item">
<strong data-bind="text: term"></strong>:
<span data-bind="text: translations.join(', ')"></span>
</li>
</ul>
</div>
<div class="mt-3 mb-3" data-bind="if: !loading()">
<h2 class="text-center">EN dictionary</h2>
<ul data-bind="foreach: results" class="mt-2 list-group">
<li class="list-group-item" data-bind="css: {'list-group-item-primary': highlight}">
<div>
<strong data-bind="text: term"></strong>
<!-- ko if: pronunciation -->
<span data-bind="text: '/' + pronunciation + '/'"></span>
<!-- /ko -->
</div>
<div data-bind="if: definition">
<blockquote class="blockquote">
<p data-bind="text: definition"></p>
</blockquote>
</div>
</li>
</ul>
</div>
<!-- ko if: !loading() && results().length === 0 -->
<div>
<h2>No results...</h2>
</div>
<!-- /ko -->
</div>
<!-- /ko -->
<script src="dist/popup.js"></script>
</body>
</html>