-
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) · 20.7 KB
/
Copy pathindex.html
File metadata and controls
315 lines (287 loc) · 20.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>P3P</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://www.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 2, "name": "https://youtube.com", "value": "CP='This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en for more info.'"},{"id": 3, "name": "https://microsoft.com", "value": "CP='CAO CONi OTR OUR DEM ONL'"},{"id": 4, "name": "https://support.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.', CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 5, "name": "https://en.wikipedia.org", "value": "CP='See https://en.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 6, "name": "https://vimeo.com", "value": "CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'"},{"id": 7, "name": "https://youtu.be", "value": "CP='This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en for more info.'"},{"id": 8, "name": "https://es.wikipedia.org", "value": "CP='See https://es.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 9, "name": "https://google.fr", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 10, "name": "https://google.co.uk", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 11, "name": "https://policies.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 12, "name": "https://pt.wikipedia.org", "value": "CP='See https://pt.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 13, "name": "https://fr.wikipedia.org", "value": "CP='See https://fr.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 14, "name": "https://slideshare.net", "value": "CP='OTI DSP COR CUR ADM DEV PSD IVD CONo OUR IND'"},{"id": 15, "name": "https://google.es", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 16, "name": "https://google.de", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 17, "name": "https://www.yahoo.com", "value": "policyref='https://policies.yahoo.com/w3c/p3p.xml', CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV'"},{"id": 18, "name": "https://aliexpress.com", "value": "CP='CAO PSA OUR'"},{"id": 19, "name": "https://google.com.br", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 20, "name": "https://google.co.jp", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 21, "name": "https://networkadvertising.org", "value": "CP='NON DSP COR CUR ADMi DEV OUR BUS NAV'"},{"id": 22, "name": "https://news.yahoo.com", "value": "policyref='http://info.yahoo.com/w3c/p3p.xml, CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"},{"id": 23, "name": "https://google.ru", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 24, "name": "https://bit.ly", "value": "CP='CAO PSA OUR'"},{"id": 25, "name": "https://books.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 26, "name": "https://ipv4.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 27, "name": "https://get.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 28, "name": "https://pinterest.com", "value": "CP='This is not a P3P policy. See https://www.pinterest.com/_/_/help/articles/pinterest-and-p3p for more info.'"},{"id": 29, "name": "https://translate.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 30, "name": "https://bing.com", "value": "CP='NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND'"},{"id": 31, "name": "https://google.it", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 32, "name": "https://de.wikipedia.org", "value": "CP='See https://de.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 33, "name": "https://gravatar.com", "value": "CP='CAO PSA'"},{"id": 34, "name": "https://search.google.com", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 35, "name": "https://it.wikipedia.org", "value": "CP='See https://it.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 36, "name": "https://e-recht24.de", "value": "CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"},{"id": 37, "name": "https://google.pl", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 38, "name": "https://dell.com", "value": "CP=' BUS CAO CNT COM CUR DEV DSP INT NAV OUR PSA PSD SAM STA TAI UNI '"},{"id": 39, "name": "https://yandex.ru", "value": "policyref='/w3c/p3p.xml', CP='NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI'"},{"id": 40, "name": "https://ja.wikipedia.org", "value": "CP='See https://ja.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 41, "name": "https://google.co.in", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 42, "name": "https://id.wikipedia.org", "value": "CP='See https://id.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 43, "name": "https://naver.jp", "value": "CP='ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC'"},{"id": 44, "name": "https://scoop.it", "value": "CP='CAO DSP COR CURa ADMa DEVa PSAa PSDa IVAi IVDi CONi OUR OTRi IND PHY ONL UNI FIN COM NAV INT DEM STA', CP='CAO DSP COR CURa ADMa DEVa PSAa PSDa IVAi IVDi CONi OUR OTRi IND PHY ONL UNI FIN COM NAV INT DEM STA'"},{"id": 45, "name": "https://godaddy.com", "value": "policyref='/w3c/p3p.xml', CP='COM CNT DEM FIN GOV INT NAV ONL PHY PRE PUR STA UNI IDC CAO OTI DSP COR CUR OUR IND', policyref='/w3c/p3p.xml', CP='COM CNT DEM FIN GOV INT NAV ONL PHY PRE PUR STA UNI IDC CAO OTI DSP COR CUR i OUR IND'"},{"id": 46, "name": "https://rambler.ru", "value": "CP='NON DSP NID ADMa DEVa TAIa PSAa PSDa OUR IND UNI COM NAV'"},{"id": 47, "name": "https://eventbrite.com", "value": "CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"},{"id": 48, "name": "https://researchgate.net", "value": "CP='IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA'"},{"id": 49, "name": "https://disqus.com", "value": "CP='DSP IDC CUR ADM DELi STP NAV COM UNI INT PHY DEM'"},{"id": 50, "name": "https://google.com.tw", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 51, "name": "https://pl.wikipedia.org", "value": "CP='See https://pl.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 52, "name": "https://tripadvisor.com", "value": "CP='NOI CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT DSP COR CAO PSA IDC ADM DEVi TAIi PSD IVAi IVDi CONi HIS CNT'"},{"id": 53, "name": "https://finance.yahoo.com", "value": "policyref='http://info.yahoo.com/w3c/p3p.xml, CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"},{"id": 54, "name": "https://naver.com", "value": "CP='CAO DSP CURa ADMa TAIa PSAa OUR LAW STP PHY ONL UNI PUR FIN COM NAV INT DEM STA PRE'"},{"id": 55, "name": "https://my.yahoo.com", "value": "policyref='https://policies.yahoo.com/w3c/p3p.xml', CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV'"},{"id": 56, "name": "https://deezer.com", "value": "policyref='/w3c/p3p.xml' CP='IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA'"},{"id": 57, "name": "https://ru.wikipedia.org", "value": "CP='See https://ru.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.'"},{"id": 58, "name": "https://alibaba.com", "value": "CP='CAO PSA OUR'"},{"id": 59, "name": "https://google.co.id", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 60, "name": "https://google.nl", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 61, "name": "https://google.ca", "value": "CP='This is not a P3P policy! See g.co/p3phelp for more info.'"},{"id": 62, "name": "https://daum.net", "value": "CP='ALL DSP COR MON LAW IVDi HIS IVAi DELi SAMi OUR LEG PHY UNI ONL DEM STA INT NAV PUR FIN OTC GOV'"},{"id": 63, "name": "https://groups.yahoo.com", "value": "policyref='https://policies.yahoo.com/w3c/p3p.xml', CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV'"},{"id": 64, "name": "https://answers.yahoo.com", "value": "policyref='https://policies.yahoo.com/w3c/p3p.xml', CP='CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV'"},{"id": 65, "name": "https://pinterest.co.uk", "value": "CP='This is not a P3P policy. See https://www.pinterest.com/_/_/help/articles/pinterest-and-p3p for more info.'"},{"id": 66, "name": "https://www.glassdoor.com", "value": "CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'"},{"id": 67, "name": "https://zoom.us", "value": "CP='NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM'"}],
lookup: { "1": "https://www.google.com", "2": "https://youtube.com", "3": "https://microsoft.com", "4": "https://support.google.com", "5": "https://en.wikipedia.org", "6": "https://vimeo.com", "7": "https://youtu.be", "8": "https://es.wikipedia.org", "9": "https://google.fr", "10": "https://google.co.uk", "11": "https://policies.google.com", "12": "https://pt.wikipedia.org", "13": "https://fr.wikipedia.org", "14": "https://slideshare.net", "15": "https://google.es", "16": "https://google.de", "17": "https://www.yahoo.com", "18": "https://aliexpress.com", "19": "https://google.com.br", "20": "https://google.co.jp", "21": "https://networkadvertising.org", "22": "https://news.yahoo.com", "23": "https://google.ru", "24": "https://bit.ly", "25": "https://books.google.com", "26": "https://ipv4.google.com", "27": "https://get.google.com", "28": "https://pinterest.com", "29": "https://translate.google.com", "30": "https://bing.com", "31": "https://google.it", "32": "https://de.wikipedia.org", "33": "https://gravatar.com", "34": "https://search.google.com", "35": "https://it.wikipedia.org", "36": "https://e-recht24.de", "37": "https://google.pl", "38": "https://dell.com", "39": "https://yandex.ru", "40": "https://ja.wikipedia.org", "41": "https://google.co.in", "42": "https://id.wikipedia.org", "43": "https://naver.jp", "44": "https://scoop.it", "45": "https://godaddy.com", "46": "https://rambler.ru", "47": "https://eventbrite.com", "48": "https://researchgate.net", "49": "https://disqus.com", "50": "https://google.com.tw", "51": "https://pl.wikipedia.org", "52": "https://tripadvisor.com", "53": "https://finance.yahoo.com", "54": "https://naver.com", "55": "https://my.yahoo.com", "56": "https://deezer.com", "57": "https://ru.wikipedia.org", "58": "https://alibaba.com", "59": "https://google.co.id", "60": "https://google.nl", "61": "https://google.ca", "62": "https://daum.net", "63": "https://groups.yahoo.com", "64": "https://answers.yahoo.com", "65": "https://pinterest.co.uk", "66": "https://www.glassdoor.com", "67": "https://zoom.us" },
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>