j1-template 2023.0.3 → 2023.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_collection.html +26 -74
  3. data/_includes/themes/j1/procedures/collections/create_collection_article_preview.proc +64 -19
  4. data/_includes/themes/j1/procedures/collections/pager.proc +127 -0
  5. data/_includes/themes/j1/procedures/posts/pager.proc +4 -4
  6. data/assets/data/banner.html +2 -2
  7. data/assets/data/panel.html +130 -141
  8. data/assets/themes/j1/adapter/js/themer.js +106 -85
  9. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +4 -6
  10. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  11. data/assets/themes/j1/modules/themeSwitcher/js/_unsued/switcher.1.js +454 -0
  12. data/lib/j1/version.rb +1 -1
  13. data/lib/starter_web/Gemfile +1 -1
  14. data/lib/starter_web/README.md +5 -5
  15. data/lib/starter_web/_config.yml +23 -22
  16. data/lib/starter_web/_data/blocks/banner.yml +11 -11
  17. data/lib/starter_web/_data/blocks/footer.yml +6 -5
  18. data/lib/starter_web/_data/blocks/panel.yml +1 -1
  19. data/lib/starter_web/_data/modules/attics.yml +2 -2
  20. data/lib/starter_web/_data/modules/scroller.yml +5 -5
  21. data/lib/starter_web/_data/templates/feed.xml +1 -1
  22. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  23. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  24. data/lib/starter_web/assets/images/{triangles-bg.png → backgrounds/triangles-bg.png} +0 -0
  25. data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/facebook.svg +0 -0
  26. data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/google.svg +0 -0
  27. data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/ibm.svg +0 -0
  28. data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/microsoft.svg +0 -0
  29. data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +98 -0
  30. data/lib/starter_web/collections/_biography/becoming.adoc +89 -0
  31. data/lib/starter_web/collections/_biography/born-to-run.adoc +92 -0
  32. data/lib/starter_web/collections/_biography/forty-autumns.adoc +91 -0
  33. data/lib/starter_web/collections/_biography/not-dead-yet.adoc +85 -0
  34. data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +88 -0
  35. data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +90 -0
  36. data/lib/starter_web/index.html +7 -8
  37. data/lib/starter_web/package.json +1 -1
  38. data/lib/starter_web/pages/public/about/features.adoc +5 -6
  39. data/lib/starter_web/pages/public/about/reporting_issues.adoc +13 -14
  40. data/lib/starter_web/pages/public/about/site.adoc +3 -5
  41. data/lib/starter_web/pages/public/blog/navigator/archive/allview.html +1 -0
  42. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -0
  43. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -0
  44. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -0
  45. data/lib/starter_web/pages/public/blog/navigator/index.html +1 -0
  46. data/lib/starter_web/pages/public/bookshelf/viewer_biography.adoc +62 -0
  47. data/lib/starter_web/pages/public/bookshelf/whats_up.adoc +287 -0
  48. data/lib/starter_web/pages/public/learn/roundtrip/bootstrap_themes.adoc +10 -10
  49. data/lib/starter_web/pages/public/learn/roundtrip/lunr_search.adoc +1 -1
  50. data/lib/starter_web/pages/public/plans/plans.adoc +2 -2
  51. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1 -0
  52. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  53. data/lib/starter_web/utilsrv/package.json +1 -1
  54. metadata +18 -36
  55. data/lib/starter_web/_includes/custom/agency/portfolio.html +0 -67
  56. data/lib/starter_web/_includes/custom/agency/services.html +0 -35
  57. data/lib/starter_web/_includes/custom/agency/team.html +0 -29
  58. data/lib/starter_web/assets/images/agency/img/about/1.jpg +0 -0
  59. data/lib/starter_web/assets/images/agency/img/about/2.jpg +0 -0
  60. data/lib/starter_web/assets/images/agency/img/about/3.jpg +0 -0
  61. data/lib/starter_web/assets/images/agency/img/about/4.jpg +0 -0
  62. data/lib/starter_web/assets/images/agency/img/close-icon.svg +0 -1
  63. data/lib/starter_web/assets/images/agency/img/header-bg.jpg +0 -0
  64. data/lib/starter_web/assets/images/agency/img/map-image.png +0 -0
  65. data/lib/starter_web/assets/images/agency/img/navbar-logo.svg +0 -1
  66. data/lib/starter_web/assets/images/agency/img/portfolio/1.jpg +0 -0
  67. data/lib/starter_web/assets/images/agency/img/portfolio/2.jpg +0 -0
  68. data/lib/starter_web/assets/images/agency/img/portfolio/3.jpg +0 -0
  69. data/lib/starter_web/assets/images/agency/img/portfolio/4.jpg +0 -0
  70. data/lib/starter_web/assets/images/agency/img/portfolio/5.jpg +0 -0
  71. data/lib/starter_web/assets/images/agency/img/portfolio/6.jpg +0 -0
  72. data/lib/starter_web/assets/images/agency/img/screenshot.png +0 -0
  73. data/lib/starter_web/assets/images/agency/img/team/1.jpg +0 -0
  74. data/lib/starter_web/assets/images/agency/img/team/2.jpg +0 -0
  75. data/lib/starter_web/assets/images/agency/img/team/3.jpg +0 -0
  76. data/lib/starter_web/pages/public/learn/mweb/mweb-tester.adoc +0 -299
  77. data/lib/starter_web/pages/public/learn/mweb/static/index.css +0 -237
  78. data/lib/starter_web/pages/public/learn/mweb/static/index.js +0 -1138
  79. data/lib/starter_web/pages/public/learn/mweb/static/lodash.min.js +0 -140
  80. data/lib/starter_web/pages/public/learn/mweb/static/socket.io/socket.io.js +0 -4570
  81. data/lib/starter_web/pages/public/learn/mweb/static/socket.io/socket.io.min.js +0 -7
  82. data/lib/starter_web/pages/public/learn/mweb/static/video-js.min.css +0 -1
  83. data/lib/starter_web/pages/public/learn/mweb/static/video.min.js +0 -26
@@ -1,1138 +0,0 @@
1
- /// <reference types="bootstrap" />
2
- /// <reference types="datatables.net" />
3
- /// <reference types="jquery" />
4
- /// <reference types="lodash" />
5
- /// <reference types="socket.io-client" />
6
- /// <reference types="video.js" />
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (_) try {
23
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
- var _a, _b, _c, _d, _e;
44
- var allowCookiesKey = 'allowCookies';
45
- var lastAllowCookiesAskedKey = 'allowCookiesAsked';
46
- var debugResponse = false;
47
- var socket = io();
48
- var pv_id = randomString(6);
49
- var itemsPerPage = 15;
50
- var currentPage = 0;
51
- var mediathekTable;
52
- var connectingModal;
53
- var contactModal;
54
- var cookieModal;
55
- var indexingModal;
56
- var uid;
57
- var playingInterval;
58
- var playStartTimestamp;
59
- var lastQueryString = null;
60
- var ignoreNextHashChange = false;
61
- var impressum = null;
62
- var datenschutz = null;
63
- var donate = null;
64
- var queryInputClearButtonState = 'hidden';
65
- var video;
66
- var sortBy = 'timestamp';
67
- var sortOrder = 'desc';
68
-
69
-
70
-
71
- socket.on('connect', function () {
72
- console.log('connected');
73
- });
74
- socket.on('disconnect', function () {
75
- console.log('disconnected');
76
- socket.connect();
77
- });
78
- socket.on('reconnect', function (attemptNumber) {
79
- console.log('reconnected', attemptNumber);
80
- });
81
- socket.on('reconnect_attempt', function (attemptNumber) {
82
- console.log('attempting reconnect', attemptNumber);
83
- });
84
- socket.on('reconnect_failed', function () {
85
- console.log('reconnect failed');
86
- });
87
- socket.on('reconnect_error', function (error) {
88
- console.error('reconnect_error', error);
89
- });
90
- socket.on('connect_error', function (error) {
91
- console.error('connect_error', error);
92
- });
93
-
94
- XMLHttpRequest.prototype.baseOpen = XMLHttpRequest.prototype.open;
95
- XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
96
-
97
- if (url.startsWith('http://srfvodhd-vh.akamaihd.net') || url.startsWith('http://hdvodsrforigin-f.akamaihd.net')) {
98
- url = 'https' + url.slice(4);
99
- } else if (url.startsWith('https://mediathekviewweb.de')) {
100
- this.baseOpen(method, url, async, user, password);
101
- } else if (url.startsWith('http://localhost:41000')) {
102
- url = 'https://mediathekviewweb.de/socket.io/?EIO=4&transport=polling&t=OM6fpnN&sid=Wzzj9vV-nAu1pbImBGNk';
103
- this.baseOpen(method, url, async, user, password);
104
- } else {
105
- // url = 'https://mediathekviewweb.de/socket.io/?EIO=4&transport=polling&t=OM6fpnN&sid=Wzzj9vV-nAu1pbImBGNk';
106
- // this.baseOpen(method, url, async, user, password);
107
- return false;
108
- }
109
-
110
- };
111
-
112
- /*polyfills for stupid internet explorer*/
113
- if (!String.prototype.endsWith) {
114
- String.prototype.endsWith = function (searchString, position) {
115
- var subjectString = this.toString();
116
- if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
117
- position = subjectString.length;
118
- }
119
- position -= searchString.length;
120
- var lastIndex = subjectString.indexOf(searchString, position);
121
- return lastIndex !== -1 && lastIndex === position;
122
- };
123
- }
124
- if (!String.prototype.startsWith) {
125
- String.prototype.startsWith = function (searchString, position) {
126
- position = position || 0;
127
- return this.indexOf(searchString, position) === position;
128
- };
129
- }
130
- function pad(value, size) {
131
- var stringValue = value.toString();
132
- while (stringValue.length < (size || 2)) {
133
- stringValue = "0" + stringValue;
134
- }
135
- return stringValue;
136
- }
137
- function modalIsOpen(modalDOM) {
138
- return (modalDOM.data('bs.modal') || {}).isShown;
139
- }
140
- function randomString(len) {
141
- var text = "";
142
- var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
143
- for (var i = 0; i < len; i++)
144
- text += possible.charAt(Math.floor(Math.random() * possible.length));
145
- return text;
146
- }
147
- function formatDate(epochSeconds) {
148
- return new Date(epochSeconds * 1000).toLocaleDateString('de', {
149
- year: 'numeric',
150
- month: '2-digit',
151
- day: '2-digit'
152
- });
153
- }
154
- function formatTime(epochSeconds) {
155
- return new Date(epochSeconds * 1000).toLocaleTimeString('de', {
156
- hour: '2-digit',
157
- minute: '2-digit'
158
- });
159
- }
160
- function formatDuration(seconds) {
161
- return pad(Math.floor(seconds / 60), 2) + ':' + pad(seconds % 60, 2);
162
- }
163
- function formatBytes(bytes, decimals) {
164
- if (!(parseInt(bytes) >= 0))
165
- return '?';
166
- else if (bytes == 0)
167
- return '0 Byte';
168
- var k = 1000;
169
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
170
- var i = Math.floor(Math.log(bytes) / Math.log(k));
171
- return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i];
172
- }
173
- function parseQuery(query) {
174
- var channels = [];
175
- var topics = [];
176
- var titles = [];
177
- var descriptions = [];
178
- var generics = [];
179
- var duration_min = undefined;
180
- var duration_max = undefined;
181
- var splits = query.trim().toLowerCase().split(/\s+/).filter(function (split) {
182
- return (split.length > 0);
183
- });
184
- for (var i = 0; i < splits.length; i++) {
185
- var split = splits[i];
186
- if (split[0] == '!') {
187
- var c = split.slice(1, split.length).split(',').filter(function (split) {
188
- return (split.length > 0);
189
- });
190
- if (c.length > 0) {
191
- channels.push(c);
192
- }
193
- }
194
- else if (split[0] == '#') {
195
- var t = split.slice(1, split.length).split(',').filter(function (split) {
196
- return (split.length > 0);
197
- });
198
- if (t.length > 0) {
199
- topics.push(t);
200
- }
201
- }
202
- else if (split[0] == '+') {
203
- var t = split.slice(1, split.length).split(',').filter(function (split) {
204
- return (split.length > 0);
205
- });
206
- if (t.length > 0) {
207
- titles.push(t);
208
- }
209
- }
210
- else if (split[0] == '*') {
211
- var d = split.slice(1, split.length).split(',').filter(function (split) {
212
- return (split.length > 0);
213
- });
214
- if (d.length > 0) {
215
- descriptions.push(d);
216
- }
217
- }
218
- else if (split[0] == '>') {
219
- var d = split.slice(1, split.length).split(',').filter(function (split) {
220
- return (split.length > 0);
221
- });
222
- if (d.length > 0 && !isNaN(d[0])) {
223
- duration_min = d[0] * 60;
224
- }
225
- }
226
- else if (split[0] == '<') {
227
- var d = split.slice(1, split.length).split(',').filter(function (split) {
228
- return (split.length > 0);
229
- });
230
- if (d.length > 0 && !isNaN(d[0])) {
231
- duration_max = d[0] * 60;
232
- }
233
- }
234
- else {
235
- generics = generics.concat(split.split(/\s+/));
236
- }
237
- }
238
- return {
239
- channels: channels,
240
- topics: topics,
241
- titles: titles,
242
- descriptions: descriptions,
243
- duration_min: duration_min,
244
- duration_max: duration_max,
245
- generics: generics
246
- };
247
- }
248
- function track(action) {
249
- var date = new Date();
250
- socket.emit('track', {
251
- uid: uid,
252
- pv_id: pv_id,
253
- ua: navigator.userAgent,
254
- lang: navigator.language,
255
- res: window.screen.width + "x" + window.screen.height,
256
- urlref: document.referrer,
257
- action_name: action,
258
- h: date.getHours(),
259
- m: date.getMinutes(),
260
- s: date.getSeconds(),
261
- rand: randomString(10),
262
- href: window.location.href
263
- });
264
- }
265
- uid = (_e = (_d = window.localStorage) === null || _d === void 0 ? void 0 : _d.getItem) === null || _e === void 0 ? void 0 : _e.call(_d, 'uid');
266
- if (!!uid) {
267
- uid = uid.trim();
268
- }
269
- else {
270
- uid = Cookies.get('uid');
271
- if (!!uid) {
272
- uid = uid.trim();
273
- }
274
- }
275
- if (!!uid && uid.length == 32) {
276
- track('index');
277
- }
278
- else {
279
- socket.on('uid', function (_uid) {
280
- var _a, _b;
281
- (_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem) === null || _b === void 0 ? void 0 : _b.call(_a, 'uid', _uid);
282
- Cookies.set('uid', _uid, {
283
- expires: 99999
284
- });
285
- uid = _uid;
286
- track('index');
287
- });
288
- socket.emit('requestUid');
289
- }
290
- setInterval(function () {
291
- if (socket.connected && !isVideoPlaying()) {
292
- track('heartbeat');
293
- }
294
- }, 20 * 60 * 1000); /*every 20 minutes*/
295
- socket.on('indexState', function (state) {
296
- var parsingProgress = (state.parserProgress * 100).toFixed(0);
297
- var indexingProgress = (state.indexingProgress * 100).toFixed(0);
298
- $('#parsingProgressbar').css('width', (parsingProgress + '%')).text(parsingProgress + '%');
299
- $('#indexingProgressbar').css('width', (indexingProgress + '%')).text(indexingProgress + '%');
300
- $('#indexingMessage').text(state.entries);
301
- $('#indexingTimeLabel').text((state.time / 1000).toFixed(0) + ' Sekunden');
302
- if (!state.done && !state.error) {
303
- if (!modalIsOpen(indexingModal)) {
304
- indexingModal.modal('show');
305
- }
306
- }
307
- else if (state.error) {
308
- $('#indexingMessage').text(state.error);
309
- setTimeout(function () { return indexingModal.modal('hide'); }, 3000);
310
- }
311
- else {
312
- indexingModal.modal('hide');
313
- currentPage = 0;
314
- query();
315
- }
316
- });
317
- var trackQuery = _.debounce(function () { return track('query'); }, 2000);
318
- function getQueryString() {
319
- return $('#queryInput').val().toString().trim();
320
- }
321
- function setQueryFromURIHash() {
322
- var props = parseURIHash(window.location.hash);
323
- if (props['query']) {
324
- $('#queryInput').val(props['query']).trigger('input');
325
- }
326
- else {
327
- $('#queryInput').val('').trigger('input');
328
- }
329
- if (props['everywhere'] === 'true') {
330
- $('#everywhereCheckbox').prop('checked', true);
331
- }
332
- else {
333
- $('#everywhereCheckbox').prop('checked', false);
334
- }
335
- if (props['future'] === 'false') {
336
- $('#futureCheckbox').prop('checked', false);
337
- }
338
- else {
339
- $('#futureCheckbox').prop('checked', true);
340
- }
341
- if (!isNaN(parseInt(props['page']))) {
342
- currentPage = parseInt(props['page']) - 1;
343
- }
344
- else {
345
- currentPage = 0;
346
- }
347
- }
348
- function parseURIHash(hash) {
349
- if (hash[0] == '#') {
350
- hash = hash.slice(1);
351
- }
352
- var props = hash.split('&');
353
- var elements = {};
354
- for (var i = 0; i < props.length; i++) {
355
- var element = props[i].split('=');
356
- elements[element[0]] = decodeURIComponent(element[1]);
357
- }
358
- return elements;
359
- }
360
- function createURIHash(elements) {
361
- var props = [];
362
- for (var prop in elements) {
363
- props.push(prop + '=' + encodeURIComponent(elements[prop].toString()));
364
- }
365
- return props.join('&');
366
- }
367
- var query = _.throttle(function () {
368
- var queryString = getQueryString();
369
- var future = !!$('#futureCheckbox').prop('checked');
370
- var everywhere = !!$('#everywhereCheckbox').prop('checked');
371
- currentPage = Math.min(currentPage, Math.floor(10000 / itemsPerPage - 1));
372
- var elements = {};
373
- if (queryString.length > 0) {
374
- elements['query'] = queryString;
375
- }
376
- if (everywhere === true) {
377
- elements['everywhere'] = true;
378
- }
379
- if (future === false) {
380
- elements['future'] = false;
381
- }
382
- if (currentPage > 0) {
383
- elements['page'] = currentPage + 1;
384
- }
385
- var oldHash = window.location.hash;
386
- if (oldHash[0] == '#') {
387
- oldHash = oldHash.slice(1);
388
- }
389
- var newHash = createURIHash(elements);
390
- if (oldHash !== newHash) {
391
- var url = new URL(window.location.toString());
392
- url.hash = newHash;
393
- history.replaceState(undefined, '', url.toString());
394
- ignoreNextHashChange = true;
395
- }
396
- var parsedQuery = parseQuery(queryString);
397
- var queries = [];
398
- for (var i = 0; i < parsedQuery.channels.length; i++) {
399
- queries.push({
400
- fields: ['channel'],
401
- query: parsedQuery.channels[i].join(' ')
402
- });
403
- }
404
- for (var i = 0; i < parsedQuery.topics.length; i++) {
405
- queries.push({
406
- fields: ['topic'],
407
- query: parsedQuery.topics[i].join(' ')
408
- });
409
- }
410
- for (var i = 0; i < parsedQuery.titles.length; i++) {
411
- queries.push({
412
- fields: ['title'],
413
- query: parsedQuery.titles[i].join(' ')
414
- });
415
- }
416
- for (var i = 0; i < parsedQuery.descriptions.length; i++) {
417
- queries.push({
418
- fields: ['description'],
419
- query: parsedQuery.descriptions[i].join(' ')
420
- });
421
- }
422
- if (parsedQuery.generics.length > 0) {
423
- queries.push({
424
- fields: everywhere ? ['channel', 'topic', 'title', 'description'] : ((parsedQuery.topics.length == 0) ? ['topic', 'title'] : ['title']),
425
- query: parsedQuery.generics.join(' ')
426
- });
427
- }
428
- var queryObj = {
429
- queries: queries,
430
- sortBy: sortBy,
431
- sortOrder: sortOrder,
432
- future: future,
433
- duration_min: parsedQuery.duration_min,
434
- duration_max: parsedQuery.duration_max,
435
- offset: currentPage * itemsPerPage,
436
- size: itemsPerPage
437
- };
438
- socket.emit('queryEntries', queryObj, function (message) {
439
- if (debugResponse) {
440
- console.log(message);
441
- }
442
- handleQueryResult(message.result, message.err);
443
- });
444
- trackQuery();
445
- }, 20);
446
- function handleQueryResult(result, err) {
447
- mediathekTable.clear();
448
- mediathekTable.draw();
449
- if (err) {
450
- $('#queryInfoLabel').html('Fehler:<br/>' + err.join('<br/>'));
451
- $('#pagination').empty();
452
- return;
453
- }
454
- if (!result) {
455
- return;
456
- }
457
- for (var i = 0; i < result.results.length; i++) {
458
- var data = result.results[i];
459
- if (data.timestamp == 0) {
460
- data.dateString = data.timeString = '?';
461
- }
462
- else {
463
- data.dateString = formatDate(data.timestamp);
464
- data.timeString = formatTime(data.timestamp);
465
- }
466
- data.durationString = isNaN(data.duration) ? '?' : formatDuration(data.duration);
467
- mediathekTable.row.add(data);
468
- }
469
- mediathekTable.draw();
470
- var actualPagesCount = Math.ceil(result.queryInfo.totalResults / itemsPerPage);
471
- var shownPagesCount = Math.min(actualPagesCount, Math.floor(10000 / itemsPerPage));
472
- createPagination(shownPagesCount);
473
- var filmlisteTime = "am ".concat(formatDate(result.queryInfo.filmlisteTimestamp), " um ").concat(formatTime(result.queryInfo.filmlisteTimestamp), " Uhr");
474
- $('#queryInfoLabel').html('Die Suche dauerte ' + result.queryInfo.searchEngineTime.toString().replace('.', ',') + ' ms. Zeige Treffer ' + Math.min(result.queryInfo.totalResults, (currentPage * itemsPerPage + 1)) +
475
- ' bis ' + Math.min(result.queryInfo.totalResults, ((currentPage + 1) * itemsPerPage)) + ' von insgesamt ' + result.queryInfo.totalResults + '.</br>Filmliste zuletzt ' + filmlisteTime + ' aktualisiert.');
476
- }
477
- function createPaginationButton(html, active, enabled, callback) {
478
- var button = $('<li>').addClass(active ? 'active' : '').addClass(enabled ? '' : 'disabled').append($('<a>', {
479
- href: '#',
480
- html: html,
481
- click: function () {
482
- if (enabled && !active) {
483
- callback();
484
- query();
485
- }
486
- return false;
487
- }
488
- }));
489
- return button;
490
- }
491
- function createPagination(totalPages) {
492
- var pagination = $('#pagination');
493
- pagination.empty();
494
- var backButton = createPaginationButton('<i class="material-icons" style="margin: -6px;">keyboard_arrow_left</i>', false, currentPage > 0, function () {
495
- currentPage--;
496
- });
497
- pagination.append(backButton);
498
- var pagingBegin = Math.max(0, currentPage - 2 - (2 - Math.min(2, totalPages - (currentPage + 1))));
499
- var pagingEnd = Math.min(totalPages, pagingBegin + 5);
500
- var _loop_1 = function (i) {
501
- var button = createPaginationButton(i + 1, currentPage == i, true, function () {
502
- currentPage = i;
503
- });
504
- pagination.append(button);
505
- };
506
- for (var i = pagingBegin; i < pagingEnd; i++) {
507
- _loop_1(i);
508
- }
509
- var nextButton = createPaginationButton('<i class="material-icons" style="margin: -6px">keyboard_arrow_right</i>', false, currentPage < (totalPages - 1), function () {
510
- currentPage++;
511
- });
512
- pagination.append(nextButton);
513
- }
514
- function getContentLength(url, callback) {
515
- socket.emit('getContentLength', url, function (contentLength) {
516
- callback(contentLength);
517
- });
518
- }
519
- function getDescription(id, callback) {
520
- socket.emit('getDescription', id, function (description) {
521
- callback(description);
522
- });
523
- }
524
- function createSubtitleRow(text, url, filename, filesize) {
525
- var tableRow = $('<tr>');
526
- var downloadButton = $('<a>', {
527
- target: '_blank',
528
- href: url,
529
- download: filename
530
- });
531
- downloadButton.click(function () { return track('download-subtitle'); });
532
- var downloadIcon = $('<i>').addClass('material-icons floatRight').text('save');
533
- downloadButton.append(downloadIcon);
534
- var filesizeCell = $('<td>').text((isNaN(filesize) || !filesize) ? '?' : formatBytes(filesize, 2));
535
- tableRow.append($('<td>').text(text));
536
- tableRow.append(filesizeCell);
537
- tableRow.append($('<td>').append(downloadButton));
538
- return tableRow;
539
- }
540
- function createVideoRow(text, url, videoTitle, filename, filesize) {
541
- var tableRow = $('<tr>');
542
- var watchButton = $('<a>', {
543
- target: '_blank',
544
- href: url,
545
- click: function () {
546
- playVideo(videoTitle, url);
547
- return false;
548
- }
549
- });
550
- var watchIcon = $('<i>').addClass('material-icons floatLeft').text('ondemand_video');
551
- watchButton.click(function () { watchIcon.addClass('pulse'); setTimeout(function () { return watchIcon.removeClass('pulse'); }, 500); });
552
- watchButton.append(watchIcon);
553
- var downloadButton = $('<a>', {
554
- target: '_blank',
555
- href: url,
556
- download: filename
557
- });
558
- var downloadIcon = $('<i>').addClass('material-icons floatRight').text('save');
559
- downloadButton.click(function () { downloadIcon.addClass('pulse'); setTimeout(function () { return downloadIcon.removeClass('pulse'); }, 500); track('download-video'); });
560
- downloadButton.append(downloadIcon);
561
- var clipboardButton = $('<a>', {
562
- target: '_blank',
563
- href: url,
564
- download: filename
565
- });
566
- var clipboardIcon = $('<i>').addClass('material-icons floatRight').text('assignment');
567
- clipboardButton.click(function () { copyToClipboard(url); clipboardIcon.addClass('pulse'); setTimeout(function () { return clipboardIcon.removeClass('pulse'); }, 500); return false; });
568
- clipboardButton.append(clipboardIcon);
569
- var filesizeCell = $('<td>').text((isNaN(filesize) || !filesize) ? '?' : formatBytes(filesize, 2)).addClass('filesizeCell');
570
- tableRow.append($('<td>').text(text));
571
- tableRow.append(filesizeCell);
572
- tableRow.append($('<td>').append($('<div>').append(watchButton).append(clipboardButton).append(downloadButton).addClass('watchDownloadField')));
573
- return tableRow;
574
- }
575
- function hidePopoverIfNotHovered(button, callback) {
576
- setTimeout(function () {
577
- var popoverID = button.attr('aria-describedby');
578
- var popover = $('#' + popoverID);
579
- if (popover.length) {
580
- if (!popover.is(':hover') && !button.is(':hover')) {
581
- button.popover('hide');
582
- if (typeof callback == 'function') {
583
- callback();
584
- }
585
- }
586
- }
587
- }, 150);
588
- }
589
- function createDescriptionButton(entry) {
590
- var state = false;
591
- var description = null;
592
- var icon = $('<i>').addClass('material-icons').text('expand_more');
593
- var popoverContent = $('<div>').html('<i class="material-icons spin-right" style="display: inline-flex; vertical-align: middle; font-size: 2.5em;">autorenew</i> <span style="font-size:1.2em; vertical-align: middle;">Laden...</span>');
594
- var button = $('<a>', {
595
- target: '_blank',
596
- href: '#',
597
- click: function () {
598
- if (!state) {
599
- if (description == null) {
600
- getDescription(entry.id, function (dscrp) {
601
- popoverContent.text(dscrp);
602
- if (state) {
603
- button.popover('show');
604
- }
605
- });
606
- }
607
- button.popover('show');
608
- icon.addClass('rotateLeft');
609
- state = true;
610
- }
611
- else {
612
- button.popover('hide');
613
- icon.removeClass('rotateLeft');
614
- state = false;
615
- }
616
- return false;
617
- }
618
- });
619
- button.popover({
620
- trigger: 'manual',
621
- //toggle: 'popover',
622
- placement: 'auto right',
623
- container: '#blur',
624
- template: '<div class="popover" role="tooltip"><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
625
- content: popoverContent,
626
- html: true,
627
- animation: true
628
- });
629
- button.on('mouseleave', function () {
630
- hidePopoverIfNotHovered(button, function () {
631
- state = false;
632
- icon.removeClass('rotateLeft');
633
- });
634
- });
635
- button.append(icon);
636
- return button;
637
- }
638
- function resetVideoActionButton(button) {
639
- button.removeClass('text-warning');
640
- button.children().first().removeClass('icon-big');
641
- button.clicked = false;
642
- }
643
- function createVideoActionButton(entry) {
644
- var highestQualityUrl = entry.url_video_hd ? entry.url_video_hd : (entry.url_video ? entry.url_video : entry.url_video_low);
645
- var button = $('<a>', {
646
- target: '_blank',
647
- href: highestQualityUrl,
648
- click: function () {
649
- if (!button.clicked) {
650
- button.clicked = true;
651
- button.addClass('text-warning');
652
- button.children().first().addClass('icon-big');
653
- }
654
- else {
655
- playVideo(entry.title, highestQualityUrl);
656
- }
657
- return false;
658
- }
659
- });
660
- var icon = $('<i>').addClass('material-icons movie-icon').text('movie');
661
- button.append(icon);
662
- var table = $('<table>').addClass('table-condensed');
663
- table.append("<thead>\n <tr>\n <th>Qualit\u00E4t</th>\n <th>Gr\u00F6\u00DFe</th>\n <th>Aktion</th>\n </tr>\n </thead>");
664
- var tableHead = $('<thead>');
665
- var tableBody = $('<tbody>');
666
- var filenamebase = entry.channel + ' - ' + entry.topic + ' - ' + entry.title + ' - ' + formatDate(entry.timestamp) + ' ' + formatTime(entry.timestamp);
667
- var lowRow, midRow, highRow, subtitleRow;
668
- if (entry.url_video_hd) {
669
- highRow = createVideoRow('Hoch', entry.url_video_hd, entry.title, filenamebase + '.' + entry.url_video_hd.split('.').pop());
670
- tableBody.append(highRow);
671
- }
672
- if (entry.url_video) {
673
- midRow = createVideoRow('Mittel', entry.url_video, entry.title, filenamebase + '.' + entry.url_video.split('.').pop(), entry.size);
674
- tableBody.append(midRow);
675
- }
676
- if (entry.url_video_low) {
677
- lowRow = createVideoRow('Niedrig', entry.url_video_low, entry.title, filenamebase + '.' + entry.url_video_low.split('.').pop());
678
- tableBody.append(lowRow);
679
- }
680
- if (entry.url_subtitle) {
681
- subtitleRow = createSubtitleRow('UT', entry.url_subtitle, filenamebase + '.' + entry.url_subtitle.split('.').pop());
682
- tableBody.append(subtitleRow);
683
- }
684
- table.append(tableBody);
685
- button.popover({
686
- trigger: 'manual',
687
- // toggle: 'popover',
688
- placement: 'auto right',
689
- container: '#blur',
690
- content: table,
691
- html: true,
692
- animation: true
693
- });
694
- var requestedFilesize = false;
695
- button.on('mouseenter', function () {
696
- button.popover('show');
697
- var popoverID = button.attr('aria-describedby');
698
- var popover = $('#' + popoverID);
699
- if (popover.length) {
700
- popover.on('mouseleave', function () {
701
- hidePopoverIfNotHovered(button, function () { return resetVideoActionButton(button); });
702
- });
703
- }
704
- if (!requestedFilesize) {
705
- requestedFilesize = true;
706
- if (highRow) {
707
- getContentLength(entry.url_video_hd, function (bytes) {
708
- highRow.find('td:eq(1)').text(formatBytes(bytes, 2));
709
- });
710
- }
711
- if (midRow) {
712
- getContentLength(entry.url_video, function (bytes) {
713
- midRow.find('td:eq(1)').text(formatBytes(bytes, 2));
714
- });
715
- }
716
- if (lowRow) {
717
- getContentLength(entry.url_video_low, function (bytes) {
718
- lowRow.find('td:eq(1)').text(formatBytes(bytes, 2));
719
- });
720
- }
721
- if (subtitleRow) {
722
- getContentLength(entry.url_subtitle, function (bytes) {
723
- subtitleRow.find('td:eq(1)').text(formatBytes(bytes, 2));
724
- });
725
- }
726
- }
727
- });
728
- button.on('mouseleave', function () {
729
- hidePopoverIfNotHovered(button, function () { return resetVideoActionButton(button); });
730
- });
731
- return button;
732
- }
733
- function isFullscreen() {
734
- return document.fullscreenElement
735
- || document.webkitFullscreenElement
736
- || document.mozFullScreenElement
737
- || document.msFullscreenElement;
738
- }
739
- function requestFullscreen(element) {
740
- if (element.requestFullscreen) {
741
- element.requestFullscreen();
742
- }
743
- else if (element.webkitRequestFullScreen) {
744
- element.webkitRequestFullScreen();
745
- }
746
- else if (element.mozRequestFullScreen) {
747
- element.mozRequestFullScreen();
748
- }
749
- else if (element.msRequestFullscreen) {
750
- element.msRequestFullscreen();
751
- }
752
- }
753
- function exitFullscreen() {
754
- if (document.exitFullscreen) {
755
- document.exitFullscreen();
756
- }
757
- else if (document.webkitExitFullscreen) {
758
- document.webkitExitFullscreen();
759
- }
760
- else if (document.mozCancelFullScreen) {
761
- document.mozCancelFullScreen();
762
- }
763
- else if (document.msExitFullscreen) {
764
- document.msExitFullscreen();
765
- }
766
- }
767
- function isVideoPlaying() {
768
- if (!video) {
769
- return false;
770
- }
771
- else {
772
- return !video.paused();
773
- }
774
- }
775
- function toggleVideoPause() {
776
- if (video) {
777
- video.paused() ? video.play() : video.pause();
778
- }
779
- }
780
- function playVideo(title, url) {
781
- if (url.startsWith('http://')) {
782
- playVideoInNewWindow(url);
783
- return;
784
- }
785
- $('#videooverlay').show(200, function () {
786
- $('#blur').addClass('blur');
787
- var vid = $('<video>', {
788
- "class": 'video-js vjs-default-skin vjs-big-play-centered vjs-16-9',
789
- id: 'video-player',
790
- preload: 'auto',
791
- controls: '',
792
- width: '100%'
793
- });
794
- var source = $('<source>', {
795
- src: url
796
- });
797
- if (url.endsWith('m3u8')) {
798
- source.attr('type', 'application/x-mpegURL');
799
- }
800
- vid.append(source);
801
- $('#videocontent').append(vid);
802
- video = videojs('video-player');
803
- vid.dblclick(function () {
804
- if (isFullscreen()) {
805
- exitFullscreen();
806
- }
807
- else {
808
- requestFullscreen(video);
809
- }
810
- });
811
- }).focus();
812
- clearInterval(playingInterval); /*in case it wasn't stopped for any reason*/
813
- playingInterval = setInterval(function () {
814
- if (socket.connected) {
815
- if (isVideoPlaying()) {
816
- track('playing');
817
- }
818
- else {
819
- track('paused');
820
- }
821
- }
822
- }, 1 * 60 * 1000); /*every minute*/
823
- track('play');
824
- playStartTimestamp = Date.now();
825
- }
826
- function playVideoInNewWindow(url) {
827
- return __awaiter(this, void 0, void 0, function () {
828
- var playerWindow, start, playDuration;
829
- return __generator(this, function (_a) {
830
- switch (_a.label) {
831
- case 0:
832
- playerWindow = window.open(url);
833
- start = Date.now();
834
- _a.label = 1;
835
- case 1:
836
- if (!((playerWindow === null || playerWindow === void 0 ? void 0 : playerWindow.closed) === false)) return [3 /*break*/, 3];
837
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 500); })];
838
- case 2:
839
- _a.sent();
840
- return [3 /*break*/, 1];
841
- case 3:
842
- playDuration = Date.now() - start;
843
- if (playDuration >= 1000 * 30) {
844
- location.reload();
845
- }
846
- return [2 /*return*/];
847
- }
848
- });
849
- });
850
- }
851
- function closeVideo() {
852
- var playDuration = Date.now() - playStartTimestamp;
853
- if (playDuration >= 1000 * 30) {
854
- location.reload();
855
- }
856
- video.dispose();
857
- $('#videocontent').empty();
858
- $('#videooverlay').hide(200);
859
- $('#blur').removeClass('blur');
860
- clearInterval(playingInterval);
861
- }
862
- function openContactsModal() {
863
- contactModal.modal('show');
864
- track('contact');
865
- }
866
- function returnEmptyString() {
867
- return '';
868
- }
869
- function copyToClipboard(text) {
870
- var dummy = document.createElement('textarea');
871
- document.body.appendChild(dummy);
872
- dummy.value = text;
873
- dummy.select();
874
- document.execCommand('copy');
875
- document.body.removeChild(dummy);
876
- }
877
- $(function () {
878
- var _a, _b;
879
- $.fn.dataTable.ext.errMode = 'none';
880
- $('#browserWarning').remove();
881
- cookieModal = $('#cookieModal');
882
- cookieModal.modal({
883
- backdrop: 'static',
884
- keyboard: false,
885
- show: false
886
- });
887
- connectingModal = $('#connectingModal');
888
- connectingModal.modal({
889
- backdrop: 'static',
890
- keyboard: false,
891
- show: false
892
- });
893
- indexingModal = $('#indexingModal');
894
- indexingModal.modal({
895
- backdrop: 'static',
896
- keyboard: false,
897
- show: false
898
- });
899
- contactModal = $('#contactModal');
900
- contactModal.modal({
901
- backdrop: true,
902
- keyboard: true,
903
- show: false
904
- });
905
- var allowCookies = (_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem) === null || _b === void 0 ? void 0 : _b.call(_a, allowCookiesKey);
906
- if ((allowCookies != 'true') && (allowCookies != 'false')) {
907
- cookieModal = $('#cookieModal');
908
- cookieModal.modal('show');
909
- var cookieAcceptButtonElement = document.getElementById('cookieAcceptButton');
910
- var cookieDenyButtonElement = document.getElementById('cookieDenyButton');
911
- cookieAcceptButtonElement.addEventListener('click', function () {
912
- var _a, _b, _c, _d;
913
- (_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem) === null || _b === void 0 ? void 0 : _b.call(_a, allowCookiesKey, 'true');
914
- (_d = (_c = window.localStorage) === null || _c === void 0 ? void 0 : _c.setItem) === null || _d === void 0 ? void 0 : _d.call(_c, lastAllowCookiesAskedKey, Date.now().toString());
915
- cookieModal.modal('hide');
916
- location.reload();
917
- });
918
- cookieDenyButtonElement.addEventListener('click', function () {
919
- var _a, _b, _c, _d;
920
- (_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem) === null || _b === void 0 ? void 0 : _b.call(_a, allowCookiesKey, 'false');
921
- (_d = (_c = window.localStorage) === null || _c === void 0 ? void 0 : _c.setItem) === null || _d === void 0 ? void 0 : _d.call(_c, lastAllowCookiesAskedKey, Date.now().toString());
922
- cookieModal.modal('hide');
923
- });
924
- }
925
- socket.on('connect', function () {
926
- connectingModal.modal('hide');
927
- });
928
- socket.on('disconnect', function () {
929
- indexingModal.modal('hide');
930
- if (!modalIsOpen(connectingModal)) {
931
- connectingModal.modal('show');
932
- }
933
- });
934
- setInterval(function () {
935
- if (socket.disconnected) {
936
- if (!modalIsOpen(connectingModal)) {
937
- connectingModal.modal('show');
938
- }
939
- }
940
- }, 1500);
941
- mediathekTable = $('#mediathek').DataTable({
942
- columns: [{
943
- width: '1%',
944
- data: null,
945
- render: returnEmptyString,
946
- createdCell: function (td, cellData, rowData, row, col) {
947
- var link = $('<a>', {
948
- target: '_blank',
949
- text: rowData.channel,
950
- href: rowData.url_website
951
- });
952
- $(td).append(link);
953
- }
954
- }, {
955
- width: '30%',
956
- data: 'topic'
957
- }, {
958
- width: '70%',
959
- data: 'title'
960
- }, {
961
- width: '1%',
962
- data: null,
963
- render: returnEmptyString,
964
- createdCell: function (td, cellData, rowData, row, col) {
965
- $(td).append(createDescriptionButton(rowData));
966
- }
967
- }, {
968
- width: '1%',
969
- data: 'dateString'
970
- }, {
971
- width: '1%',
972
- data: 'timeString'
973
- }, {
974
- width: '1%',
975
- data: 'durationString'
976
- }, {
977
- width: '1%',
978
- data: null,
979
- render: returnEmptyString,
980
- createdCell: function (td, cellData, rowData, row, col) {
981
- $(td).append(createVideoActionButton(rowData));
982
- }
983
- }],
984
- language: {
985
- emptyTable: 'Keine Einträge vorhanden'
986
- },
987
- searching: false,
988
- ordering: false,
989
- info: false,
990
- paging: false,
991
- scrollX: true
992
- });
993
- $('#rssFeedButton').click(function () {
994
- var search = window.location.hash.replace('#', '');
995
- window.open(window.location.origin + window.location.pathname + 'feed' + (search.length > 0 ? '?' : '') + search, '_blank');
996
- track('feed-create');
997
- });
998
- var newQuery = function () {
999
- currentPage = 0;
1000
- query();
1001
- };
1002
- $('th[data-onclick-sort]').on('click', function (e) {
1003
- var sort = $(e.target).attr("data-onclick-sort");
1004
- if (sort === sortBy && sortOrder) {
1005
- sortOrder = sortOrder === 'asc' ? 'desc' : 'asc';
1006
- }
1007
- else {
1008
- sortBy = sort;
1009
- sortOrder = sort === 'timestamp' ? 'desc' : 'asc';
1010
- }
1011
- $(e.target).parent().attr("data-sort", sortBy + '-' + sortOrder);
1012
- newQuery();
1013
- });
1014
- $('#queryInput').on('input', function () {
1015
- var currentQueryString = getQueryString();
1016
- if (currentQueryString != lastQueryString) {
1017
- newQuery();
1018
- lastQueryString = currentQueryString;
1019
- }
1020
- var clearButton = $('#queryInputClearButton');
1021
- if (currentQueryString.length == 0 && queryInputClearButtonState == 'shown') {
1022
- clearButton.animate({
1023
- opacity: 0
1024
- }, {
1025
- easing: 'swing',
1026
- duration: 20
1027
- });
1028
- queryInputClearButtonState = 'hidden';
1029
- }
1030
- else if (currentQueryString.length > 0 && queryInputClearButtonState == 'hidden') {
1031
- clearButton.animate({
1032
- opacity: 1
1033
- }, {
1034
- easing: 'swing',
1035
- duration: 20
1036
- });
1037
- queryInputClearButtonState = 'shown';
1038
- }
1039
- });
1040
- $('#queryParameters input:radio').change(function () { return newQuery(); });
1041
- $('#queryParameters input:checkbox').change(function () { return newQuery(); });
1042
- $('#videocloseButton').click(function () {
1043
- closeVideo();
1044
- });
1045
- $('#videooverlay').keydown(function (e) {
1046
- if (e.key == 'Escape' || e.keyCode == 27) {
1047
- if (isFullscreen()) {
1048
- exitFullscreen();
1049
- }
1050
- else {
1051
- closeVideo();
1052
- }
1053
- e.preventDefault();
1054
- }
1055
- else if (e.key === ' ' || e.keyCode == 32) { /*32 = Space*/
1056
- toggleVideoPause();
1057
- e.preventDefault();
1058
- }
1059
- });
1060
- $('#queryInputClearButton').click(function () {
1061
- $('#queryInput').val('').trigger('input').focus();
1062
- });
1063
- $('#contactButton').click(function () { return openContactsModal(); });
1064
- $('#githubButton').click(function () { return track('github'); });
1065
- $('#forumButton').click(function () { return track('forum'); });
1066
- $('#logo').click(function () {
1067
- $('#generic-html-view').hide(250);
1068
- $('#main-view').show(250);
1069
- return false;
1070
- });
1071
- $('#donateButton').click(function () {
1072
- track('donate');
1073
- $('#main-view').hide(250);
1074
- $('#generic-html-view').show(250);
1075
- if (donate == null) {
1076
- socket.emit('getDonate', function (response) {
1077
- donate = response;
1078
- $('#genericHtmlContent').html(response);
1079
- });
1080
- }
1081
- else {
1082
- $('#genericHtmlContent').html(donate);
1083
- }
1084
- return false;
1085
- });
1086
- $('#datenschutzButton').click(function () {
1087
- track('datenschutz');
1088
- $('#main-view').hide(250);
1089
- $('#generic-html-view').show(250);
1090
- if (datenschutz == null) {
1091
- socket.emit('getDatenschutz', function (response) {
1092
- datenschutz = response;
1093
- $('#genericHtmlContent').html(response);
1094
- });
1095
- }
1096
- else {
1097
- $('#genericHtmlContent').html(datenschutz);
1098
- }
1099
- return false;
1100
- });
1101
- $('#impressumButton').click(function () {
1102
- track('impressum');
1103
- $('#main-view').hide(250);
1104
- $('#generic-html-view').show(250);
1105
- if (impressum == null) {
1106
- socket.emit('getImpressum', function (response) {
1107
- impressum = response;
1108
- $('#genericHtmlContent').html(response);
1109
- });
1110
- }
1111
- else {
1112
- $('#genericHtmlContent').html(impressum);
1113
- }
1114
- return false;
1115
- });
1116
- $('#genericHtmlViewBackButton').click(function () {
1117
- $('#generic-html-view').hide(250);
1118
- $('#main-view').show(250);
1119
- });
1120
- window.addEventListener("hashchange", function () {
1121
- if (!ignoreNextHashChange) {
1122
- setQueryFromURIHash();
1123
- query();
1124
- }
1125
- else {
1126
- ignoreNextHashChange = false;
1127
- }
1128
- }, false);
1129
- $('#searchSpan').popover();
1130
- $('[data-onclick-return-false]').click(function () {
1131
- return false;
1132
- });
1133
- $('#helpButton').click(function () {
1134
- window.open('https://github.com/mediathekview/mediathekviewweb/blob/master/README.md', '_blank');
1135
- });
1136
- setQueryFromURIHash();
1137
- query();
1138
- });