diff options
| author | 2016-02-21 02:51:49 +0100 | |
|---|---|---|
| committer | 2016-02-21 02:51:49 +0100 | |
| commit | 58974f55a4bdfc8aed3454762415c8e8ac9fc6a4 (patch) | |
| tree | 62e13df9b818388aa693b530957235d1f5e334ae /p/scripts/main.js | |
| parent | 990b51745f7965a2b109a0355d4d0e7c298f6d41 (diff) | |
| parent | 64ec0708a1404e1f39a5fdc0131c89b2e4038bee (diff) | |
Merge branch 'CSP-no-inline' into dev
Diffstat (limited to 'p/scripts/main.js')
| -rw-r--r-- | p/scripts/main.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index b7522df6a..31b07721a 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -871,7 +871,7 @@ function notifs_html5_show(nb) { window.location.reload(); } - if (context['html5_notif_timeout'] !== 0){ + if (context['html5_notif_timeout'] !== 0) { setTimeout(function() { notification.close(); }, context['html5_notif_timeout'] * 1000); @@ -1246,8 +1246,9 @@ function init_configuration_alert() { } function parseJavaScriptCookie() { - var json = JSON.parse(decodeURIComponent(document.cookie.replace(/(?:(?:^|.*;\s*)FreshRSS-vars\s*\=\s*([^;]*).*$)|^.*$/, "$1"))) || {}; + var vars = decodeURIComponent(document.cookie.replace(/(?:(?:^|.*;\s*)FreshRSS-vars\s*\=\s*([^;]*).*$)|^.*$/, "$1")); document.cookie = 'FreshRSS-vars=; expires=Thu, 01 Jan 1970 00:00:00 GMT'; + var json = JSON.parse(vars); window.context = json.context; window.shortcuts = json.shortcuts; window.url = json.url; @@ -1256,7 +1257,6 @@ function parseJavaScriptCookie() { } function init_all() { - parseJavaScriptCookie(); if (!window.$) { if (window.console) { console.log('FreshRSS waiting for JS…'); @@ -1264,6 +1264,7 @@ function init_all() { window.setTimeout(init_all, 50); return; } + parseJavaScriptCookie(); init_notifications(); init_confirm_action(); $stream = $('#stream'); |
