diff --git a/app/static/js/script.js b/app/static/js/script.js index da9a9a8e..32ac7520 100644 --- a/app/static/js/script.js +++ b/app/static/js/script.js @@ -1198,66 +1198,66 @@ function show_version() { } ); NProgress.configure({showSpinner: true}); } -function statAgriment() { - var cur_url = window.location.href.split('/').pop(); - cur_url = cur_url.split('/'); - if (localStorage.getItem('statistic') == null && cur_url != 'login') { - var titles = new Map() - var body = new Map() - var yes_ans = new Map() - var no_ans = new Map() - var ver_question = randomIntFromInterval(1, 2); - titles.set(1, 'Help us improve Roxy-WI'); - titles.set(2, 'Data collection agreement'); - body.set(1, 'We want to improve the user experience by collecting anonymous statistics. No marketing.'); - body.set(2, 'We’d like to improve your experience in Roxy-WI, so we ask for statistics collection. No personal data is collected.'); - yes_ans.set(1, 'Yes'); - yes_ans.set(2, 'Agree and help the Roxy-WI team'); - no_ans.set(1, 'No'); - no_ans.set(2, 'Disagree'); - $("#statistic").dialog({ - autoOpen: true, - resizable: false, - height: "auto", - width: 600, - modal: true, - title: titles.get(ver_question), - show: { - effect: "fade", - duration: 200 - }, - hide: { - effect: "fade", - duration: 200 - }, - buttons: [{ - "id": "statYesBut", - text: "Yes", - click: function () { - localStorage.setItem('statistic', '1'); - $(this).dialog("close"); - sendGet('page/ans/1/' + ver_question); - statAgriment(); - }, - }, { - "id": "statNoBut", - text: "No", - click: function () { - localStorage.setItem('statistic', '0'); - $(this).dialog("close"); - sendGet('page/ans/0/' + ver_question); - } - }] - }); - $("#statYesBut").html('
'); - $("#statNoBut").html(' '); - $("#statistic-body").html(body.get(ver_question)); - } - if (localStorage.getItem('statistic') == 1) { - cur_url = btoa(cur_url); - sendGet('/page/send/'+cur_url); - } -} +// function statAgriment() { +// var cur_url = window.location.href.split('/').pop(); +// cur_url = cur_url.split('/'); +// if (localStorage.getItem('statistic') == null && cur_url != 'login') { +// var titles = new Map() +// var body = new Map() +// var yes_ans = new Map() +// var no_ans = new Map() +// var ver_question = randomIntFromInterval(1, 2); +// titles.set(1, 'Help us improve Roxy-WI'); +// titles.set(2, 'Data collection agreement'); +// body.set(1, 'We want to improve the user experience by collecting anonymous statistics. No marketing.'); +// body.set(2, 'We’d like to improve your experience in Roxy-WI, so we ask for statistics collection. No personal data is collected.'); +// yes_ans.set(1, 'Yes'); +// yes_ans.set(2, 'Agree and help the Roxy-WI team'); +// no_ans.set(1, 'No'); +// no_ans.set(2, 'Disagree'); +// $("#statistic").dialog({ +// autoOpen: true, +// resizable: false, +// height: "auto", +// width: 600, +// modal: true, +// title: titles.get(ver_question), +// show: { +// effect: "fade", +// duration: 200 +// }, +// hide: { +// effect: "fade", +// duration: 200 +// }, +// buttons: [{ +// "id": "statYesBut", +// text: "Yes", +// click: function () { +// localStorage.setItem('statistic', '1'); +// $(this).dialog("close"); +// sendGet('page/ans/1/' + ver_question); +// statAgriment(); +// }, +// }, { +// "id": "statNoBut", +// text: "No", +// click: function () { +// localStorage.setItem('statistic', '0'); +// $(this).dialog("close"); +// sendGet('page/ans/0/' + ver_question); +// } +// }] +// }); +// $("#statYesBut").html(' '); +// $("#statNoBut").html(' '); +// $("#statistic-body").html(body.get(ver_question)); +// } +// if (localStorage.getItem('statistic') == 1) { +// cur_url = btoa(cur_url); +// sendGet('/page/send/'+cur_url); +// } +// } function startIntro(intro) { intro = intro.setOptions({'exitOnOverlayClick': false}); var intro_url = cur_url[0].split('#')[0]; @@ -1318,19 +1318,19 @@ function startIntro(intro) { } } } -document.addEventListener("DOMContentLoaded", function(event){ - statAgriment(); -}); +// document.addEventListener("DOMContentLoaded", function(event){ +// statAgriment(); +// }); function sendGet(page) { - var xmlHttp = new XMLHttpRequest(); - var theUrl = 'https://roxy-wi.org/' + page; + let xmlHttp = new XMLHttpRequest(); + let theUrl = 'https://roxy-wi.org/' + page; xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(null); } function show_pretty_ansible_error(data) { try { data = data.split('error: '); - var p_err = JSON.parse(data[1]); + let p_err = JSON.parse(data[1]); return p_err['msg']; } catch (e) { return data; @@ -1340,12 +1340,12 @@ function openTab(tabId) { $( "#tabs" ).tabs( "option", "active", tabId ); } function showPassword(input) { - var x = document.getElementById(input); - if (x.type === "password") { - x.type = "text"; - } else { - x.type = "password"; - } + let x = document.getElementById(input); + if (x.type === "password") { + x.type = "text"; + } else { + x.type = "password"; + } } function removeData() { for (let i = 0; i < charts.length; i++) { @@ -1377,7 +1377,7 @@ function getAllGroups() { return groups; } function openUserSettings(user_id) { - if (localStorage.getItem('disabled_alert') == '1') { + if (localStorage.getItem('disabled_alert') === '1') { $('#disable_alerting').prop('checked', false).checkboxradio('refresh'); } else { $('#disable_alerting').prop('checked', true).checkboxradio('refresh'); diff --git a/app/templates/add.html b/app/templates/add.html index ecd3b427..5c708f1c 100644 --- a/app/templates/add.html +++ b/app/templates/add.html @@ -18,6 +18,7 @@ {% set force_close = {'0':'Off','1':'Server only','2':'Force close','3':'Pretend keep alive'} %} +