~scirocco22/lsgcontrolpanel/0.1

« back to all changes in this revision

Viewing changes to assets/www/functions_phonegap.js

  • Committer: scirocco101 at googlemail
  • Date: 2011-12-21 18:08:48 UTC
  • Revision ID: scirocco101@googlemail.com-20111221180848-ogut4zi1ljdptwbz
*hope to have fixed redirect error on blackberry

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
var auth;
2
2
function settings() {
3
 
 $(".ui-btn-left").show();
4
3
 try {
5
4
   var storage = window.localStorage;
6
5
   if(storage.getItem("user") != null && storage.getItem("password") != null && storage.getItem("wifi") != null) {
8
7
     login();
9
8
    }
10
9
   else {
11
 
     $(".ui-btn-left").hide();
12
10
     $.mobile.changePage("#settings", {transition: 'pop', role: 'dialog'});
13
11
    }
14
12
  }
15
13
 catch(e) {
16
 
   alert(e);
 
14
   //alert(e);
17
15
   alert("Device doesn`t support localstorage:-(");
18
 
   location.href = "http://linux.lsg.musin.de/cp";
 
16
   window.location.href = "http://linux.lsg.musin.de/cp";
19
17
  }
20
18
}
21
19
function savesettings() {
131
129
document.addEventListener("deviceready", ondeviceready, false);
132
130
}
133
131
function reload() {
134
 
  $.mobile.showPageLoadingMsg();
 
132
  //$.mobile.showPageLoadingMsg();
135
133
  if(is_logged_in()) {
136
134
    $.ajax({
137
135
     url: "http://linux.lsg.musin.de/cp/vp_mobile.php",
169
167
    });
170
168
    if(location.hash == "#login" || location.hash == "")
171
169
      $.mobile.changePage("#home");
172
 
    $.mobile.hidePageLoadingMsg();
173
170
   }
174
171
  else {
175
172
    $.mobile.changePage("#login");
176
 
    $.mobile.hidePageLoadingMsg();
177
173
   }
178
174
  //if(location.hash == "#vertretungsplan")
179
175
    try {
182
178
     } catch(err) {
183
179
      //console.log(err);
184
180
     }
 
181
  //$.mobile.hidePageLoadingMsg();
185
182
}