This repository has been archived by the owner on May 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
options.html
executable file
·398 lines (342 loc) · 15.5 KB
/
options.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!DOCTYPE html>
<html ng-app="optionsApp" ng-csp>
<!-- use about controller for its manifest scope property -->
<head lang="en" data-ng-controller="about">
<meta charset="UTF-8">
<title>{{'options_page_title_prefix' | i18n}} - {{manifest.name}}</title>
<link href="static/css/angular-csp.css" rel="stylesheet">
<link href="static/css/bootstrap.min.css" rel="stylesheet">
<link href="static/css/angular.rangeSlider.css" rel="stylesheet">
<link href="css/options.css" rel="stylesheet">
<script src="static/js/jquery-3.4.1.min.js"></script>
<script src="static/js/angular.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/angular.rangeSlider.min.js"></script>
<script src="static/js/memorystream.js"></script>
<script src="static/js/pouchdb-6.4.3.min.js"></script>
<script src="static/js/pouchdb.replication-stream.min.js"></script>
<script src="static/js/pouchdb.load.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- use about controller for its manifest scope property -->
<a class="navbar-brand" data-ng-controller="about" ng-href="{{'extension_webstore_url' | i18n}}">
<!-- <img data-ng-src="{{manifest.icons['19']}}" style="margin-right: 1em; vertical-align: bottom"> -->
{{manifest.name}}
<span style="font-size: small;">{{manifest.version}}</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a target="_blank" href="https://www.dexterouslogic.com/assets/supersimplehighlighter/faq.html">{{'faq_title' | i18n}}</a></li>
<li><a ng-href="{{'extension_author_url' | i18n}}">©{{'copyright_year' | i18n}} {{ 'extension_author' | i18n }}</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<!--Nav Pills-->
<div class="col-xs-2">
<ul class="nav nav-pills nav-stacked" role="tablist">
<li class="active"><a href="#styles" role="tab" data-toggle="pill">
<!-- <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> -->
{{ 'styles' | i18n }}</a></li>
<li><a href="#bookmarks" role="tab" data-toggle="pill">
<!-- <span class="glyphicon glyphicon-book" aria-hidden="true"></span> -->
{{ 'bookmarks' | i18n }}</a></li>
<li><a href="#advanced" role="tab" data-toggle="pill">
<!-- <span class="glyphicon glyphicon-fire" aria-hidden="true"></span> -->
{{ 'advanced' | i18n }}</a></li>
<li><a href="#about" role="tab" data-toggle="pill">
<!-- <span class="glyphicon glyphicon-education" aria-hidden="true"></span> -->
{{ 'about' | i18n }}</a></li>
</ul>
</div>
<!--Nav Content-->
<div class="col-xs-9 tab-content">
<!-- 1 - Styles Pane-->
<div class="tab-pane active fade in" id="styles" ng-controller="styles">
<!-- Shared Modal Dialog-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalTitle" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form name="myForm" role="form">
<!--Header-->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">{{ 'close' | i18n }}</span>
</button>
<h4 class="modal-title" id="myModalTitle">{{modal.dialogTitle}}</h4>
</div>
<!--Body-->
<div class="modal-body">
<!--Title-->
<div class="form-group" ng-class="{'has-error': myForm.title.$invalid}">
<label class="control-label" for="myTitle">{{ 'highlight_title' | i18n }}</label>
<input class="form-control" name="title" id="myTitle" type="text" ng-model="modal.highlightDefinition.title" required>
<span ng-show="myForm.title.$error.required" class="help-block">
{{ 'required_highlight_title' | i18n }}
</span>
</div>
<!--Background Colour-->
<div class="form-group">
<label for="backgroundColour">{{ 'highlight_background_colour' | i18n }}</label>
<input type="color" class="form-control" id="backgroundColour" ng-model="modal.highlightDefinition.style['background-color']">
</div>
<!--Text Colour-->
<div class="form-group">
<label for="textColour">{{ 'highlight_text_colour' | i18n }}</label>
<input type="color" class="form-control" id="textColour"
ng-model="modal.highlightDefinition.style['color']" data-ng-disabled="modal.highlightDefinition.inherit_style_color">
</div>
<!--Inherit Text Color-->
<div class="checkbox">
<label>
<input type="checkbox" ng-model="modal.highlightDefinition.inherit_style_color">
{{ 'highlight_text_colour_inherit' | i18n }}
</label>
</div>
<!--Shortcut help-->
<div class="help-block">{{ 'highlight_help_keyboard_shortcut' | i18n }}</div>
</div>
<!--Footer-->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
{{ 'cancel' | i18n }}
</button>
<button type="button" class="btn btn-primary" data-ng-disabled="myForm.$invalid" data-ng-click="modal.onClickSave()">
{{modal.saveButtonTitle}}
</button>
</div>
</form>
</div>
</div>
</div>
<!--Highlight Definitions-->
<h2>{{ 'options_tab_page_header_sites' | i18n }}</h2>
<ul class="list-unstyled">
<li ng-repeat="hd in highlightDefinitions" class="token well-sm {{highlightClassName}} {{hd.className}}"
ng-click="onClickStyle($index)">
<!--Number (index+1)-->
<span class="number">{{$index + 1}}</span>
<!--title-->
<span>{{hd.title}}</span>
<!--hotkey-->
<kbd class="shortcut" ng-show="{{$index < commands.length && commands[$index].shortcut.length > 0}}">
{{ commands[$index].shortcut }}
</kbd>
<!--Delete Button-->
<button type="button" class="close" title="Remove Style" ng-click="onClickRemoveStyle(hd)">
<span aria-hidden="true">×</span>
<span class="sr-only">{{'close' | i18n}}</span>
</button>
</li>
</ul>
<!--TODO: move to new page-->
<div style="margin-top: 20px">
<!--Unselect after highlight-->
<div class="checkbox">
<label>
<input type="checkbox" ng-model="options.unselectAfterHighlight">
{{ 'highlight_unselect' | i18n }}
</label>
</div>
<!--Highlight box shadow enabled-->
<div class="checkbox">
<label>
<input type="checkbox" ng-model="options.enableHighlightBoxShadow">
{{ 'highlight_box_shadow' | i18n }}
</label>
</div>
<!--Opacity-->
<div class="row">
<h5>{{ 'highlight_opacity' | i18n }}</h5>
<div range-slider min="0.3" max="1.0" model-max="options.highlightBackgroundAlpha" attach-handle-values="true"
step="0.1" decimal-places="2" pin-handle="min" filter="alphaPercent"></div>
</div>
</div>
<!-- Buttons -->
<div class="row">
<button type="button" class="btn btn-danger" ng-click="onClickResetToDefaultStyles()">
{{ 'reset_default_styles' | i18n }}
</button>
<button type="button" class="btn btn-default pull-right" ng-click="onClickCreateNewStyle()">
{{ 'create_new_style' | i18n }}
</button>
</div>
</div>
<!-- 2 - Bookmarks Pane-->
<div class="tab-pane fade" id="bookmarks" ng-controller="bookmarks">
<form class="header form-inline">
<!-- Show page text -->
<div class="checkbox" style="margin-right: auto;">
<label>
<input type="checkbox" ng-model="options.showPageText">
{{ 'show_page_highlight_text' | i18n }}
</label>
</div>
<!-- Grouping & Direction -->
<div class="header-control header-control-group">
<select class="form-control" ng-model="options.groupBy">
<option value="title">{{'group_by_title' | i18n}}</option>
<option value="first_date">{{'group_by_first_date' | i18n}}</option>
<option value="last_date">{{'group_by_last_date' | i18n}}</option>
</select>
<button id="btn-sort-invert" class="btn btn-sm btn-default button-partner button-animate-transition"
type="button" title="{{'title_sort_direction' | i18n}}"
ng-class="{'sort-inverted': !options.ascendingOrder }"
ng-click="options.ascendingOrder = !options.ascendingOrder">
<span class="glyphicon glyphicon-sort" aria-hidden="true"></span>
</button>
</div>
<div class="header-control header-control-group">
<input type="search" class="form-control search" ng-model="documentFilterText"
placeholder="{{(options.showPageText ? 'placeholder_filter_highlights' : 'placeholder_filter_titles') | i18n}}" autofocus>
</div>
</form>
<!-- Only show if no items -->
<h1 class="pages-no-groups" ng-show="groupedDocs.length === 0">
{{ 'pages_empty' | i18n }}
</h1>
<ol class="list-unstyled list-grouped-pages">
<li ng-repeat="group in groupedDocs | filter:filters.group" class="page-group-list-item">
<h3 class="page-group-header" title="{{ !group.title ? ('untitled_page_group_tooltip' | i18n) : null }}">
{{ group.title || ('untitled_page_title' | i18n) }}
</h3>
<ol class="list-unstyled">
<li ng-repeat="doc in group.docs | filter:filters.document" id="{{doc._id}}" class="well-sm page"
ng-mouseenter="doc.hover=true" ng-mouseleave="doc.hover=false">
<!-- button to remove all highlights on this page -->
<button type="button" class="close" title="{{ 'remove_all_highlights' | i18n }}"
ng-click="onClickRemoveAllHighlights(doc, group)" ng-class="{'sr-only sr-only-focusable': !doc.hover}">
<span aria-hidden="true">×</span>
<span class="sr-only">{{ 'close' | i18n }}</span>
</button>
<!-- page title -->
<h5 class="page-title" ng-hide="options.groupBy === 'title' && !group.title">
<a href="{{doc.match}}" target="_blank">{{doc.title || ('untitled_page_title' | i18n) }}</a>
</h5>
<!-- page link -->
<cite>
<a href="{{doc.match}}" target="_blank" class="page-link">{{doc.match}}</a>
</cite>
<!-- text for all highlights -->
<ul class="list-inline page-text-list" ng-show="options.showPageText">
<li ng-repeat="t in doc.texts" class="list-inline page-text-list-item {{t.className}}" title="{{ t.date | date:'medium' }}">
{{ t.text || " " }}
<button type="button" class="list-item-close" ng-click="onClickRemoveHighlight(t.docId, doc)" title="{{ 'remove_highlight' | i18n }}"></button>
</li>
</ul>
</li>
</ol>
</li>
</ol>
<!-- row of buttons below list of pages -->
<div class="row row-buttons">
<button type="button" class="btn btn-danger pull-right" ng-class="{'disabled': groupedDocs.length === 0}" data-ng-click="onClickRemoveAllBookmarks()">
{{ 'text_remove_all_pages' | i18n }}
</button>
</div>
</div>
<!-- 3 - Experimental Pane-->
<div class="tab-pane fade" id="advanced" ng-controller="advanced">
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">{{ 'advanced_database_heading' | i18n }}</div>
<!-- List group -->
<ul class="list-group">
<li class="list-group-item">
<h5>{{ 'advanced_database_export_title' | i18n }}</h5>
<p>{{ 'advanced_database_export_description' | i18n }}</p>
<div class="row-buttons">
<button type="button" class="btn btn-default" data-ng-click="onClickExport()">
{{ 'advanced_database_export_button_text' | i18n }}
</button>
</div>
</li>
<li class="list-group-item">
<h5>{{ 'advanced_database_import_title' | i18n }}</h5>
<p>{{ 'advanced_database_import_description' | i18n }}</p>
<div class="row-buttons">
<span class="btn btn-danger btn-file">
{{ 'advanced_database_import_button_text' | i18n }}
<input type="file" id="files">
<!-- onchange="angular.element(this).scope().onFilesChange()"> -->
</span>
</div>
</li>
</ul>
</div>
</div>
<!-- 4 - About Pane-->
<div class="tab-pane fade" id="about" data-ng-controller="about">
<img data-ng-src="{{manifest.icons['256']}}" />
<h1>{{manifest.name}}</h1>
<h5>
Version {{manifest.version}}
<small><a target="_blank" href="https://www.dexterouslogic.com/assets/supersimplehighlighter/changelog.txt">{{'changelog' | i18n}}</a></small>
</h5>
<p>
<small>©{{'copyright_year' | i18n}}</small> <strong><a ng-href="{{'extension_author_url' | i18n}}">{{ 'extension_author' | i18n }}</a></strong>
</p>
<h4>{{'libraries' | i18n}}</h4>
<ul>
<li ng-repeat="library in libraries">
<a href="{{library.href}}">{{library.text}}</a>
</li>
</ul>
<h4>{{'licenses' | i18n}}</h4>
<div ng-repeat="item in licenses" class="cc">
<a href="{{item.work.href}}">{{item.work.text}}</a> by <a href="{{item.author.href}}">{{item.author.text}}</a> is
licensed under <a href="{{item.license.href}}">{{item.license.text}}</a>
</div>
<div class="row row-buttons">
<button type="button" class="btn btn-warning" data-ng-click="onClickRestoreAllWarnings()">
{{ 'restore_all_warnings' | i18n }}
</button>
</div>
<!--
<h4>{{'changelog' | i18n}}</h4>
<ul>
<li class="version" ng-repeat="unit in changelog">
<h5>{{unit.version}}</h5>
<ul class="list-unstyled">
<li ng-repeat="item in unit.items">
{{item}}
</li>
</ul>
</li>
<ul>
-->
</div>
</div>
</div>
</div>
<script src="js/shared/db.js"></script>
<script src="js/shared/highlighter.js"></script>
<script src="js/shared/chrome_tabs.js"></script>
<script src="js/shared/chrome_storage.js"></script>
<script src="js/shared/chrome_highlight_storage.js"></script>
<script src="js/shared/style_sheet_manager.js"></script>
<script src="js/shared/utils.js"></script>
<script src="js/shared/ng-modules/i18n_filters.js"></script>
<script src="js/options/app.js"></script>
<script src="js/options/filters.js"></script>
<script src="js/options/controllers/styles.js"></script>
<script src="js/options/controllers/bookmarks.js"></script>
<script src="js/options/controllers/advanced.js"></script>
<script src="js/options/controllers/about.js"></script>
</body>
</html>