-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
315 lines (287 loc) · 24.7 KB
/
Copy pathindex.html
File metadata and controls
315 lines (287 loc) · 24.7 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
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
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>HTML Header Counts</title>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'>
<link rel="stylesheet" href="/static/css/style.css">
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
<style>
/* Colors for badges */
h1 { font-family: 'Bebas Neue', cursive;}
.badge-red {
background-color: #d54625;
}
.badge-green {
background-color: #35bd4a;
}
.badge-blue {
background-color: #357ebd;
}
.table-sortable > thead > tr > th {
cursor: pointer;
}
.table-sortable > thead > tr > th[data-sorting="disabled"] {
cursor: default;
}
.table-sortable > thead > tr > th[data-sorting="disabled"]:hover,
.table-sortable > thead > tr > th[data-sorting="disabled"]:active {
background: inherit;
}
.table-sortable > thead > tr > th:hover,
.table-sortable > thead > tr > th:active {
background: #F5F5F5;
}
.table-sortable > tbody > tr > td mark,
.table-sortable > tbody > tr > td .mark {
padding-left: 0;
padding-right: 0;
}
</style>
</head>
<body>
<div class='container-fluid'>
<div class='row'>
<div class='col-sm-12'>
<br>
<div class='form-horizontal'>
<div class='form-group has-feedback'>
<div class='col-sm-12'>
<input class='form-control table-sortable-search' placeholder='Search...' type='search'>
<span class='glyphicon glyphicon-remove form-control-feedback search-cancel-button'></span>
</div>
</div>
</div>
<br>
<div class='panel panel-default'>
<div class='table-responsive' id="app">
<h1 style="margin-left:5px">Sites for <b>VIA</b> ⭐️</h1>
<hr>
<label>Rows per page</label>
<select v-model="pageSizeModel">
<option value="3">3</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="25">25</option>
</select>
<table class="table table-sortable">
<thead>
<tr>
<th :class="{ sorted: sort === 'id' }" @click="sortBy('id')">
Id
</th>
<th :class="{ sorted: sort === 'name' }" @click="sortBy('name')">
Name
</th>
<th :class="{ sorted: sort === 'value' }" @click="sortBy('value')" >
Value
</th>
</tr>
</thead>
<tbody>
<tr v-for="row in sortedRows">
<td>{{ row.id }}</td>
<td>{{ row.name }}</td>
<td>{{ row.value }}</td>
<td data-id="{{ row.id }}">
<div class='btn-group btn-group-xs'>
<button v-on:click="viewRow" class="btn btn-default" title="View">
<span class="glyphicon glyphicon-eye-open"></span>
</button>
</div>
</td>
</tr>
</tbody>
</table>
<div class="controls">
<button class="btn btn-sm" :disabled="!hasPage(-1)" @click="prevPage">←</button>
<button class="btn btn-sm" :disabled="!hasPage(1)" @click="nextPage">→</button>
<span style="float:right; margin-right:30px; margin-top:20px" class="badge badge-primary"><span class="glyphicon glyphicon-heart"></span> vsoch</span>
</div>
<hr>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js'></script>
<script>
// Handle socket to send /receive messages from server without refresh
$(document).ready(function(){
});
// tables.js
function preg_quote( str ) {
// http://kevin.vanzonneveld.net
// + original by: booeyOH
// + improved by: Ates Goral (http://magnetiq.com)
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// * example 1: preg_quote("$40");
// * returns 1: '\$40'
// * example 2: preg_quote("*RRRING* Hello?");
// * returns 2: '\*RRRING\* Hello\?'
// * example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
// * returns 3: '\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:'
return (str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
}
function highlight(data, search){
return data.replace(new RegExp( "(" + preg_quote( search ) + ")" , 'gi' ), "<mark>$1</mark>" );
}
// Table
function Table($table,$input){
$table.find("th").each(function($key, el){
if ($(el).attr("data-sorting")!="disabled"){
$("<span/>").attr("class","fa").attr("row-id",$key+1).appendTo(el);
}}).click(function(){
var asc=true;
if ($(this).find("span.fa").attr("class")=="fa"||$(this).find("span.fa").attr("class")=="fa fa-caret-up fa-fw"){
$table.find("th[data-sorting!=disabled] span.fa").attr("class","fa");
$(this).find("span.fa").attr("class","fa fa-caret-down fa-fw");
asc=true;
}
else if ($(this).find("span.fa").attr("class")=="fa fa-caret-down fa-fw"){
$table.find("th[data-sorting!=disabled] span.fa").attr("class","fa");
$(this).find("span.fa").attr("class","fa fa-caret-up fa-fw");
asc=false
}
value=$.map($table.find("td:nth-child("+($(this).find("span.fa").attr("row-id"))+")"),function(el){
return {text:$(el).text().trim(),row:$(el).parent()};
});
value.sort(function(x, y){
if (asc){
if (x.text < y.text) {
return -1;
}
if (x.text > y.text) {
return 1;
}
} else {
if (x.text < y.text) {
return 1;
}
if (x.text > y.text) {
return -1;
}
}
return 0;
});
$table.find("tr:gt(0)").remove();
$.each(value,function(key,value){
$(value.row).appendTo($table);
});
});
$table.find("th:first").click();
$input.on("keyup change",function(){
var newText=$(this).val();
$table.find("span.text-wrap").each(function(key,value){
$(value).html($(value).text());
$(value).contents().unwrap();
});
if (newText.trim()!=""){
$table.find("tr:gt(0)").hide();
var textNode=$table.find("tr:gt(0) *")
.contents()
.filter(function() {
return this.nodeType === 3; //Node.TEXT_NODE
}).each(function(key,value){
var nodeText=value.data;
if (nodeText.toLowerCase().indexOf(newText.toLowerCase())!=-1){
$(value).closest("tr").show();
if ($(value).parent().attr("class")!="text-wrap")
$(value).wrap("<span class='text-wrap'></span>");
$(value).parent().html(highlight(nodeText ,newText));
}
});;
}else{
$table.find("tr").show();
}
});
}
$(function(){
Table($(".table-sortable"),$(".table-sortable-search"));
});
// Search
$('input[type="search"]').keyup(function () {
var t = $(this);
t.next('span').toggle(Boolean(t.val()));
});
$('input[type="search"] + .search-cancel-button').hide($(this).prev('input').val()).click(function () {
$(this).prev('input').val('').focus();
$(this).hide();
});
const app = new Vue({
data: () => ({
rows: [{"id": 1, "name": "https://vimeo.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 2, "name": "https://mozilla.org", "value": "1.1 google"},{"id": 3, "name": "https://istockphoto.com", "value": "1.1 016de4084b3995907681c203a7d5af44.cloudfront.net (CloudFront)"},{"id": 4, "name": "https://amazon.com", "value": "1.1 5e3f4627de97deab81963915d14a9755.cloudfront.net (CloudFront)"},{"id": 5, "name": "https://bbc.co.uk", "value": "1.1 BBC-GTM"},{"id": 6, "name": "https://cnn.com", "value": "1.1 varnish"},{"id": 7, "name": "https://jimdofree.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 8, "name": "https://who.int", "value": "1.1 336e3c5e609a1115b5bba6aaccd0ce62.cloudfront.net (CloudFront)"},{"id": 9, "name": "https://bbc.com", "value": "1.1 varnish"},{"id": 10, "name": "https://nih.gov", "value": "varnish"},{"id": 11, "name": "https://reuters.com", "value": "1.1 00a6984ddd0afc8c5e9cbafc895ce680.cloudfront.net (CloudFront)"},{"id": 12, "name": "https://uol.com.br", "value": "1.1 b5bce7fabeec0dac262b157c938965fd.cloudfront.net (CloudFront)"},{"id": 13, "name": "https://creativecommons.org", "value": "1.1 varnish (Varnish/5.0)"},{"id": 14, "name": "https://imdb.com", "value": "1.1 72b77c557ac4c265c32d99bdef4e9d6a.cloudfront.net (CloudFront)"},{"id": 15, "name": "https://forbes.com", "value": "1.1 google, 1.1 varnish"},{"id": 16, "name": "https://businessinsider.com", "value": "1.1 varnish"},{"id": 17, "name": "https://www.nasa.gov", "value": "1.1 03efa14de61e5d90be5300eba235f561.cloudfront.net (CloudFront)"},{"id": 18, "name": "https://wikia.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 19, "name": "https://wsj.com", "value": "1.1 c30e2e24424040c28e96664ae03f9685.cloudfront.net (CloudFront)"},{"id": 20, "name": "https://bit.ly", "value": "1.1 google"},{"id": 21, "name": "https://wired.com", "value": "1.1 varnish"},{"id": 22, "name": "https://amazon.de", "value": "1.1 f8d44a9ae8d015e27eeaa90810b99a87.cloudfront.net (CloudFront)"},{"id": 23, "name": "https://independent.co.uk", "value": "1.1 varnish"},{"id": 24, "name": "https://harvard.edu", "value": "1.1 varnish"},{"id": 25, "name": "https://latimes.com", "value": "1.1 8918721f9949345e08455e61518a59ed.cloudfront.net (CloudFront)"},{"id": 26, "name": "https://mirror.co.uk", "value": "1.1 varnish, 1.1 9fb7397504a65afc778db3eb0ee0bfa4.cloudfront.net (CloudFront)"},{"id": 27, "name": "https://abcnews.go.com", "value": "1.1 varnish-v4, 1.1 336e3c5e609a1115b5bba6aaccd0ce62.cloudfront.net (CloudFront)"},{"id": 28, "name": "https://scribd.com", "value": "1.1 varnish"},{"id": 29, "name": "https://fandom.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 30, "name": "https://amazon.co.uk", "value": "1.1 7d5b81244bd8116fcbcfa4c6fef02f93.cloudfront.net (CloudFront)"},{"id": 31, "name": "https://www.gov.uk", "value": "2.0 router, 1.1 varnish, 1.1 varnish"},{"id": 32, "name": "https://time.com", "value": "1.1 5c70ae1eac1857f85c7660495d949095.cloudfront.net (CloudFront)"},{"id": 33, "name": "https://a8.net", "value": "1.1 252359bfdb9b0b4042648b4d2c0d4853.cloudfront.net (CloudFront)"},{"id": 34, "name": "https://bandcamp.com", "value": "1.1 varnish"},{"id": 35, "name": "https://sciencedaily.com", "value": "1.1 b5bce7fabeec0dac262b157c938965fd.cloudfront.net (CloudFront)"},{"id": 36, "name": "https://www.noaa.gov", "value": "1.1 c0.w1.woc (squid), 1.1 6cd0c0044dcb8647a34da0aaacb1ff94.cloudfront.net (CloudFront)"},{"id": 37, "name": "https://blackberry.com", "value": "1.1 5da5773a6acab8f3aabf385b38683f20.cloudfront.net (CloudFront)"},{"id": 38, "name": "https://soundcloud.com", "value": "1.1 ec9b50c7bee8c251b0724c3c8490c1e4.cloudfront.net (CloudFront)"},{"id": 39, "name": "https://sciencemag.org", "value": "1.1 varnish"},{"id": 40, "name": "https://pbs.org", "value": "1.1 2159b07a5dc01058f6b0620d8e160feb.cloudfront.net (CloudFront)"},{"id": 41, "name": "https://vox.com", "value": "1.1 varnish"},{"id": 42, "name": "https://stackoverflow.com", "value": "1.1 varnish"},{"id": 43, "name": "https://theatlantic.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 44, "name": "https://ox.ac.uk", "value": "1.1 varnish"},{"id": 45, "name": "https://fortune.com", "value": "1.1 b5a3a07d269412210ea111017ec1157f.cloudfront.net (CloudFront)"},{"id": 46, "name": "https://foursquare.com", "value": "1.1 varnish"},{"id": 47, "name": "https://www.worldbank.org/", "value": "1.1 e1cdefd358f463eaddffcac2b749d60f.cloudfront.net (CloudFront)"},{"id": 48, "name": "https://lemonde.fr", "value": "1.1 google, 1.1 varnish, 1.1 varnish"},{"id": 49, "name": "https://spotify.com", "value": "HTTP/2 edgeproxy, 1.1 google"},{"id": 50, "name": "https://imageshack.us", "value": "1.1 varnish"},{"id": 51, "name": "https://yale.edu", "value": "1.1 varnish, 1.1 varnish"},{"id": 52, "name": "https://express.co.uk", "value": "1.1 798fb06c416f07d7eaba25e2728dc5ac.cloudfront.net (CloudFront)"},{"id": 53, "name": "https://tes.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 54, "name": "https://smh.com.au", "value": "1.1 varnish, 1.1 varnish"},{"id": 55, "name": "https://hollywoodreporter.com", "value": "1.1 varnish (Varnish/5.2)"},{"id": 56, "name": "https://surveymonkey.com", "value": "1.1 170a9cb5b4951d3141f3cdf6b50b780c.cloudfront.net (CloudFront)"},{"id": 57, "name": "https://sfgate.com", "value": "1.1 varnish"},{"id": 58, "name": "https://addtoany.com", "value": "e3s"},{"id": 59, "name": "https://amazon.fr", "value": "1.1 0173aeb09060ae0dd8c77e399d9e5634.cloudfront.net (CloudFront)"},{"id": 60, "name": "https://yelp.com", "value": "1.1 varnish"},{"id": 61, "name": "https://psychologytoday.com", "value": "1.1 varnish-v4, 1.1 ZZ"},{"id": 62, "name": "https://espn.com", "value": "1.1 varnish-v4, 1.1 426461ac6e9a3bd7fa011ad672ee0063.cloudfront.net (CloudFront)"},{"id": 63, "name": "https://www.khanacademy.org", "value": "1.1 varnish, 1.1 varnish"},{"id": 64, "name": "https://gofundme.com", "value": "1.1 9cdf83ac92372e14c2c11c5760f6d17a.cloudfront.net (CloudFront)"},{"id": 65, "name": "https://cbsnews.com", "value": "1.1 varnish-v4, 1.1 varnish"},{"id": 66, "name": "https://fastcompany.com", "value": "1.1 varnish"},{"id": 67, "name": "https://yahoo.co.jp", "value": "http/1.1 edge2566.img.umd.yahoo.co.jp (ApacheTrafficServer [c sSf ])"},{"id": 68, "name": "https://nature.com", "value": "1.1 google, 1.1 varnish"},{"id": 69, "name": "https://spiegel.de", "value": "1.1 google"},{"id": 70, "name": "https://twitch.tv", "value": "1.1 varnish"},{"id": 71, "name": "https://bloglovin.com", "value": "1.1 varnish (Varnish/5.2)"},{"id": 72, "name": "https://eventbrite.com", "value": "1.1 varnish (Varnish/5.1)"},{"id": 73, "name": "https://princeton.edu", "value": "varnish"},{"id": 74, "name": "https://urbandictionary.com", "value": "1.1 varnish"},{"id": 75, "name": "https://vice.com", "value": "1.1 varnish"},{"id": 76, "name": "https://ted.com", "value": "1.1 varnish"},{"id": 77, "name": "https://kickstarter.com", "value": "1.1 varnish"},{"id": 78, "name": "https://theverge.com", "value": "1.1 varnish"},{"id": 79, "name": "https://about.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 80, "name": "https://netflix.com", "value": "1.1 i-0b7b5d641965dbaae (us-east-1)"},{"id": 81, "name": "https://standard.co.uk", "value": "1.1 varnish"},{"id": 82, "name": "https://gizmodo.com", "value": "1.1 varnish"},{"id": 83, "name": "https://instructables.com", "value": "1.1 varnish"},{"id": 84, "name": "https://imageshack.com", "value": "1.1 varnish"},{"id": 85, "name": "https://quora.com", "value": "1.1 varnish"},{"id": 86, "name": "https://economist.com", "value": "1.1 72b77c557ac4c265c32d99bdef4e9d6a.cloudfront.net (CloudFront)"},{"id": 87, "name": "https://zendesk.com", "value": "1.1 vegur"},{"id": 88, "name": "https://utexas.edu", "value": "1.1 varnish"},{"id": 89, "name": "https://boston.com", "value": "1.1 varnish"},{"id": 90, "name": "https://sina.com.cn", "value": "https/1.1 ctc.guangzhou.union.180 (ApacheTrafficServer/6.2.1 [cRs f ]), https/1.1 hgc.hk.union.78 (ApacheTrafficServer/6.2.1 [cHs f ])"},{"id": 91, "name": "https://corriere.it", "value": "1.1 varnish, 1.1 varnish"},{"id": 92, "name": "https://chron.com", "value": "1.1 varnish"},{"id": 93, "name": "https://airbnb.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 94, "name": "https://thoughtco.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 95, "name": "https://evernote.com", "value": "1.1 google"},{"id": 96, "name": "https://history.com", "value": "1.1 varnish"},{"id": 97, "name": "https://ap.org", "value": "1.1 e1cdefd358f463eaddffcac2b749d60f.cloudfront.net (CloudFront)"},{"id": 98, "name": "https://biblegateway.com", "value": "1.1 6f70804d483d6d4c1e564e18fcd2c96d.cloudfront.net (CloudFront)"},{"id": 99, "name": "https://dictionary.com", "value": "1.1 varnish"},{"id": 100, "name": "https://etsy.com", "value": "1.1 google, 1.1 varnish"},{"id": 101, "name": "https://espn.go.com", "value": "1.1 varnish-v4, 1.1 5e0bea4d92b914cdc7fbc1bb38a17464.cloudfront.net (CloudFront)"},{"id": 102, "name": "https://inc.com", "value": "1.1 varnish, 1.1 varnish, 1.1 varnish"},{"id": 103, "name": "https://trustpilot.com", "value": "1.1 64f48913f84e52a7792094a73a889c99.cloudfront.net (CloudFront)"},{"id": 104, "name": "https://newyorker.com", "value": "1.1 varnish"},{"id": 105, "name": "https://politico.com", "value": "1.1 politico.com, 1.1 varnish-v4"},{"id": 106, "name": "https://wiley.com", "value": "1.1 1df382f2345322fac115f7931b894fdb.cloudfront.net (CloudFront)"},{"id": 107, "name": "https://usgs.gov", "value": "1.1 b9000056a3f3bea176a66c137dbb6b9d.cloudfront.net (CloudFront)"},{"id": 108, "name": "https://dribbble.com", "value": "1.1 varnish"},{"id": 109, "name": "https://coursera.org", "value": "1.1 336e3c5e609a1115b5bba6aaccd0ce62.cloudfront.net (CloudFront)"},{"id": 110, "name": "https://upenn.edu", "value": "1.1 varnish, 1.1 varnish"},{"id": 111, "name": "https://csmonitor.com", "value": "1.1 25d430acaef0ba8e2a9fff8bf278cedb.cloudfront.net (CloudFront)"},{"id": 112, "name": "https://20minutos.es", "value": "1.1 426461ac6e9a3bd7fa011ad672ee0063.cloudfront.net (CloudFront)"},{"id": 113, "name": "https://mystrikingly.com", "value": "1.1 cd3b189d4dff15bd0a2ccf14f97ffda2.cloudfront.net (CloudFront)"},{"id": 114, "name": "https://mozilla.com", "value": "1.1 google"},{"id": 115, "name": "https://behance.net", "value": "1.1 varnish, 1.1 varnish"},{"id": 116, "name": "https://scientificamerican.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 117, "name": "https://timeout.com", "value": "1.1 eb9474b59027c3531e9fe4ca132f8d87.cloudfront.net (CloudFront)"},{"id": 118, "name": "https://softonic.com", "value": "1.1 google"},{"id": 119, "name": "https://entrepreneur.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 120, "name": "https://gitlab.com", "value": "1.1 varnish"},{"id": 121, "name": "https://sylabs.io", "value": "1.1 varnish"},{"id": 122, "name": "https://www.observe.ai", "value": "1.1 varnish, 1.1 varnish"},{"id": 123, "name": "https://www.lyft.com", "value": "1.1 016de4084b3995907681c203a7d5af44.cloudfront.net (CloudFront)"},{"id": 124, "name": "https://www.hellosign.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 125, "name": "https://www.docusign.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 126, "name": "https://www.ultimatesoftware.com", "value": "1.1 dca1-bit8001"},{"id": 127, "name": "https://www.fastly.com", "value": "1.1 varnish, 1.1 varnish"},{"id": 128, "name": "https://www.docker.com", "value": "1.1 15cde442051269a0307a638d23683c8c.cloudfront.net (CloudFront)"},{"id": 129, "name": "https://www.rust-lang.org", "value": "1.1 vegur, 1.1 f8d44a9ae8d015e27eeaa90810b99a87.cloudfront.net (CloudFront)"},{"id": 130, "name": "https://us-rse.org", "value": "1.1 varnish"}],
lookup: { "1": "https://vimeo.com", "2": "https://mozilla.org", "3": "https://istockphoto.com", "4": "https://amazon.com", "5": "https://bbc.co.uk", "6": "https://cnn.com", "7": "https://jimdofree.com", "8": "https://who.int", "9": "https://bbc.com", "10": "https://nih.gov", "11": "https://reuters.com", "12": "https://uol.com.br", "13": "https://creativecommons.org", "14": "https://imdb.com", "15": "https://forbes.com", "16": "https://businessinsider.com", "17": "https://www.nasa.gov", "18": "https://wikia.com", "19": "https://wsj.com", "20": "https://bit.ly", "21": "https://wired.com", "22": "https://amazon.de", "23": "https://independent.co.uk", "24": "https://harvard.edu", "25": "https://latimes.com", "26": "https://mirror.co.uk", "27": "https://abcnews.go.com", "28": "https://scribd.com", "29": "https://fandom.com", "30": "https://amazon.co.uk", "31": "https://www.gov.uk", "32": "https://time.com", "33": "https://a8.net", "34": "https://bandcamp.com", "35": "https://sciencedaily.com", "36": "https://www.noaa.gov", "37": "https://blackberry.com", "38": "https://soundcloud.com", "39": "https://sciencemag.org", "40": "https://pbs.org", "41": "https://vox.com", "42": "https://stackoverflow.com", "43": "https://theatlantic.com", "44": "https://ox.ac.uk", "45": "https://fortune.com", "46": "https://foursquare.com", "47": "https://www.worldbank.org/", "48": "https://lemonde.fr", "49": "https://spotify.com", "50": "https://imageshack.us", "51": "https://yale.edu", "52": "https://express.co.uk", "53": "https://tes.com", "54": "https://smh.com.au", "55": "https://hollywoodreporter.com", "56": "https://surveymonkey.com", "57": "https://sfgate.com", "58": "https://addtoany.com", "59": "https://amazon.fr", "60": "https://yelp.com", "61": "https://psychologytoday.com", "62": "https://espn.com", "63": "https://www.khanacademy.org", "64": "https://gofundme.com", "65": "https://cbsnews.com", "66": "https://fastcompany.com", "67": "https://yahoo.co.jp", "68": "https://nature.com", "69": "https://spiegel.de", "70": "https://twitch.tv", "71": "https://bloglovin.com", "72": "https://eventbrite.com", "73": "https://princeton.edu", "74": "https://urbandictionary.com", "75": "https://vice.com", "76": "https://ted.com", "77": "https://kickstarter.com", "78": "https://theverge.com", "79": "https://about.com", "80": "https://netflix.com", "81": "https://standard.co.uk", "82": "https://gizmodo.com", "83": "https://instructables.com", "84": "https://imageshack.com", "85": "https://quora.com", "86": "https://economist.com", "87": "https://zendesk.com", "88": "https://utexas.edu", "89": "https://boston.com", "90": "https://sina.com.cn", "91": "https://corriere.it", "92": "https://chron.com", "93": "https://airbnb.com", "94": "https://thoughtco.com", "95": "https://evernote.com", "96": "https://history.com", "97": "https://ap.org", "98": "https://biblegateway.com", "99": "https://dictionary.com", "100": "https://etsy.com", "101": "https://espn.go.com", "102": "https://inc.com", "103": "https://trustpilot.com", "104": "https://newyorker.com", "105": "https://politico.com", "106": "https://wiley.com", "107": "https://usgs.gov", "108": "https://dribbble.com", "109": "https://coursera.org", "110": "https://upenn.edu", "111": "https://csmonitor.com", "112": "https://20minutos.es", "113": "https://mystrikingly.com", "114": "https://mozilla.com", "115": "https://behance.net", "116": "https://scientificamerican.com", "117": "https://timeout.com", "118": "https://softonic.com", "119": "https://entrepreneur.com", "120": "https://gitlab.com", "121": "https://sylabs.io", "122": "https://www.observe.ai", "123": "https://www.lyft.com", "124": "https://www.hellosign.com", "125": "https://www.docusign.com", "126": "https://www.ultimatesoftware.com", "127": "https://www.fastly.com", "128": "https://www.docker.com", "129": "https://www.rust-lang.org", "130": "https://us-rse.org" },
sort: 'id',
sortDir:'asc',
page: 0,
pageSize: 25
}),
methods: {
viewRow: function(event) {
var rowId = $(event.target).closest('tr').find('td:first').text()
var site = this.lookup[rowId].replace(/(^\w+:|^)\/\//, '');
document.location = "/url-headers/site/" + site
},
sortBy: function(s) {
if (s === this.sort) {
this.sortDir = (this.sortDir === 'asc') ? 'desc' : 'asc';
} else {
this.sortDir = 'asc';
}
this.sort = s;
},
isActiveSort: function(s) {
return this.sort === s;
},
hasPage: function(dir) {
if (dir === -1 && (this.page > 0)) return true;
if (dir === 1 && (((this.page+1)*this.pageSize) < this.rows.length)) return true;
return false;
},
prevPage: function() {
if (this.hasPage(-1)) this.page--;
},
nextPage: function() {
if (this.hasPage(1)) this.page++;
}
},
computed: {
sortedRows: function() {
return this.rows.sort((a, b) => {
let dir = (this.sortDir === 'asc') ? 1 : -1;
if (a[this.sort] < b[this.sort]) {
return -1 * dir;
} else if (a[this.sort] > b[this.sort]) {
return 1 * dir;
} else {
return 0;
}
}).filter((row, idx) => {
let s = this.page*this.pageSize;
let e = (this.page+1)*this.pageSize;
return (idx >= s && idx < e);
});
},
pageSizeModel: {
get() {
return this.pageSize;
},
set(v) {
this.pageSize = v;
this.page = 0;
}
}
},
filters: {
capitalize: function (v) {
if (!v) return ''
v = v.toString()
return v.charAt(0).toUpperCase() + v.slice(1)
}
}
}).$mount('#app');
</script>
</body>
</html>