Skip to content

Commit

Permalink
add: disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmanlk committed Feb 4, 2020
1 parent 7bc6100 commit ff5583c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions www/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ons.ready(() => init());
const init = () => {
setGlobalVars();
loadSettings();
showDisclaimer();
if (!checkLang()) return;
initOnsenComponents();
loadNewsSources().then(() => {
Expand Down Expand Up @@ -453,6 +454,20 @@ const onOffline = () => {
}
}

const showDisclaimer = () => {
if (data.disclaimerAccepted) return;

const msg =
`The content of this app comes from publicly available feeds of news sites and they retain all copyrights.\n\nThus, this app is not to be held responsible for any of the content displayed.\n\nThe owners of these sites can exclude their feeds with or without reason from this app by sending an email to me.\n\nIf you wish to continue, press "OK". Otherwise, press "CANCEL" to exit the app.`;

if (window.confirm(msg)) {
data.disclaimerAccepted = true;
saveSettings();
} else {
exitApp();
}
}

const sendRequest = (data = {}, method = "get") => {
return new Promise((resolve, reject) => {
$.ajax({
Expand Down

0 comments on commit ff5583c

Please sign in to comment.