summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-04-26 20:11:48 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-08-15 19:55:33 +0200
commit3c1962202e1d52675e5ef817e977e6a24e251837 (patch)
treeaa9357c0cb2b11b0a6a34d7186e785280f7e6821 /js
parent2c889d6b7430fd40c68fdc49058278ece63aec5d (diff)
downloadwvs-vplan-3c1962202e1d52675e5ef817e977e6a24e251837.tar.gz
wvs-vplan-3c1962202e1d52675e5ef817e977e6a24e251837.zip
füge Disclaimer und DNT hinzu
Diffstat (limited to 'js')
-rw-r--r--js/index.js40
1 files changed, 31 insertions, 9 deletions
diff --git a/js/index.js b/js/index.js
index 17ca007..88e891c 100644
--- a/js/index.js
+++ b/js/index.js
@@ -16,25 +16,41 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+function setDNT(dnt){
+ _paq.push(['setDoNotTrack', dnt])
+ window.localStorage.setItem('dnt', dnt);
+ $('#disclaimerpopup').popup('close');
+}
+
function track(what){
_paq.push(['trackPageView', what]);
}
+document.addEventListener('pause', function(){
+ track('event/pause');
+});
+
+document.addEventListener('resume', function(){
+ track('event/resume');
+});
+
// Login-Popup beim Start
-//$(document).bind('pageinit', function(){
document.addEventListener('deviceready', function(){
- _paq.push(['setCustomVariable', 0, 'Modell', device.model, 'visit']);
- _paq.push(['setCustomVariable', 1, 'Version', device.version, 'visit']);
- _paq.push(['trackPageView', 'load']);
+ _paq.push(['setCustomVariable', 1, 'Modell', device.model, 'visit']);
+ _paq.push(['setCustomVariable', 2, 'Version', device.version, 'visit']);
+ track('event/load');
- setTimeout(function(){
+ var dnt = window.localStorage.getItem('dnt');
+
+ if(dnt == 'undefined' || dnt == null || dnt == ''){
+ setTimeout(function(){
+ $('#lnkdisclaimer').click();
+ }, 2000);
+ }else{
fillform();
load();
- }, 1000);
-
- setTimeout(function(){
trylogin();
- }, 2000);
+ }
}, false);
/* der Loader wird nur angezeigt, wenn das Popup zu ist */
@@ -42,6 +58,12 @@ $('#loginpopup').on('popupafteropen', function(){
$.mobile.loading('hide');
});
+$('#disclaimerpopup').on('popupafterclose', function(){
+ fillform();
+ load();
+ trylogin();
+});
+
/* füllt die Loginform mit gespeicherten Werten */
function fillform(){
var username = window.localStorage.getItem('username');