-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
150 lines (135 loc) · 5.37 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="PearsonAPI SDK Dictionary Sample">
<meta name="author" content="Lawrie Nichols/Toby Simms">
<title>PearsonAPI SDK Dictionary Sample</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap-theme.min.css">
<link href="css/launch.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script>
<script src="lib/handlebars.js"></script>
<script src="lib/ICanHandlebarz.js"></script>
<script src="lib/pearson_sdk.js"></script>
<script src="lib/jquery.xdomainrequest.min.js"></script>
<script src="lib/app.js"></script>
<!-- Template for displaying the list of results found -->
<script id="template_entries" type='text/html'>
<div>
<div class="panel-group" id="accordion">
{{#results}}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#{{id}}">
<em>{{headword}}</em> </a> {{#if homnum}}<sup>{{homnum}}</sup>{{/if}} {{#if part_of_speech}}<span class="label label-primary">{{part_of_speech}}</span>{{/if}}
<span style="float:right" class="label label-warning">{{datasets.[0]}}</span>
</h4>
</div>
<div id="{{id}}" class="panel-collapse collapse">
<div class="panel-body">
</div>
</div>
</div>
{{/results}}
</div>
</script>
<!-- Template for displaying the 'pronunciations' for a given entry -->
<script id="partial_prons" class="partial" type='text/html'>
<p>
{{#if ipa}}(ipa) {{ipa}}{{/if}}
{{#if kk}}(kk) {{kk}}{{/if}}
{{#audio}}<a class="audio"><span class="glyphicon glyphicon-volume-up"><audio><source src="http://api.pearson.com{{url}}"></audio></span></a>{{/audio}}
{{#lang}} ({{.}}) {{/lang}}
</p>
</script>
<!-- Template for displaying the 'senses' for a given entry -->
<script id="partial_sense" class="partial" type='text/html'>
<li>
{{#if definition}}<p>{{definition}} </p>{{/if}}
{{#if translation}}<p>{{translation}} </p>{{/if}}
{{#if subsenses}}
<ol type="a">
{{#each subsenses}}
{{> partial_sense}}
{{/each}}
</ol>
{{/if}}
{{#if examples}}
<ol type="i">
{{#examples}}
<li><em style="font-size:90%">{{text}}</em>
{{#audio}}<a class="audio"><span class="glyphicon glyphicon-volume-up"><audio><source src="http://api.pearson.com{{url}}"></audio></span></a>{{/audio}}
</li>
{{/examples}}
</ol>
{{/if}}
</li>
</script>
<!-- Template for displaying an 'entry'. Note this includes other templates -->
<script id="template_entry" type='text/html'>
<h4>{{headword}} {{#if gramatical_info}}<span style="font-size:75%">[{{gramatical_info.type}}]</span>{{/if}}</h4>
{{#audio}}<a class="audio"><span class="glyphicon glyphicon-volume-up"><audio><source src="http://api.pearson.com{{url}}"></audio></span></a>{{/audio}}
{{#if images}}
<img style="float:right" src="{{expandUrl images.0.url}}"/>
{{/if}}
{{#if pronunciations}}
<h4><span class="label label-default">pronunciation</span></h4>
{{#pronunciations}}
{{>partial_prons}}
{{/pronunciations}}
{{/if}}
<h4><span class="label label-default">senses</span></h4>
<ol>
{{#each senses}}
{{> partial_sense}}
{{/each}}
</ol>
{{#if examples}}
<h4><span class="label label-default">examples</span></h4>
<ol>
{{#examples}}
<li>{{text}}</li>
{{/examples}}
</ol>
{{/if}}
</script>
</head>
<body>
<div class="container">
<h3>PearsonAPI Dictionaries sample application</h3>
<form id="search_form" action="" class="navbar-form">
<div class="input-group">
<input id="searchbox" type="Search" placeholder="headword..." class="form-control" />
<div class="input-group-btn">
<button class="btn btn-info">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<br/>
<div id="datasets" class="btn-group" data-toggle="buttons">
<label class="btn btn-info">
<input type="checkbox" value="ldoce5"> LDOCE5
</label>
<label class="btn btn-info">
<input type="checkbox" value="lasde"> LASDE
</label>
<label class="btn btn-info">
<input type="checkbox" value="ldec"> LDEC
</label>
<label class="btn btn-info">
<input type="checkbox" value="wordwise"> WordWise
</label>
</div>
<br/>
<div id="pagination"></div>
</form>
<div id="entries"></div> <!-- make this hidden by default -->
</div>
</body>
</html>