|
@@ -72,12 +72,6 @@ function alterContent(url) {
|
|
// store the data-foo attribute information with the url
|
|
// store the data-foo attribute information with the url
|
|
$.mobile.navigate(url);
|
|
$.mobile.navigate(url);
|
|
|
|
|
|
- //Se si lancia il loader prima che sia cambiata pagina il loader scompare,
|
|
|
|
- // ritardando invece che appaia, quando appare è già sulla pagina in cambiata
|
|
|
|
-// setTimeout(function () {
|
|
|
|
-// $.mobile.loading('show');
|
|
|
|
-// }, 300);
|
|
|
|
-
|
|
|
|
switch (oldUrl) {
|
|
switch (oldUrl) {
|
|
case '#index':
|
|
case '#index':
|
|
$("#navheader").addClass("hide");
|
|
$("#navheader").addClass("hide");
|
|
@@ -95,17 +89,25 @@ function alterContent(url) {
|
|
case '#ilove':
|
|
case '#ilove':
|
|
$("#navheader").removeClass("hide");
|
|
$("#navheader").removeClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
- postsUpdate(FONTE.categories.ilove);
|
|
|
|
|
|
+ if(checkConnection()) {
|
|
|
|
+ postsUpdate(FONTE.categories.ilove);
|
|
|
|
+ } else {
|
|
|
|
+ renderLastNews(FONTE.contentListClass, FONTE.categories.ilove);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case '#info':
|
|
case '#info':
|
|
$("#navheader").removeClass("hide");
|
|
$("#navheader").removeClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
- postsUpdate(FONTE.categories.info);
|
|
|
|
|
|
+ if(checkConnection()) {
|
|
|
|
+ postsUpdate(FONTE.categories.info);
|
|
|
|
+ } else {
|
|
|
|
+ renderLastNews(FONTE.contentListClass, FONTE.categories.info);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case '#events':
|
|
case '#events':
|
|
$("#navheader").removeClass("hide");
|
|
$("#navheader").removeClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
$("#navfooter").addClass("hide");
|
|
- EVENTS.render();
|
|
|
|
|
|
+ EVENTS.render(); //il checkconenction è fatto dentro
|
|
break;
|
|
break;
|
|
case '#laboratori':
|
|
case '#laboratori':
|
|
$("#navheader").removeClass("hide");
|
|
$("#navheader").removeClass("hide");
|
|
@@ -128,10 +130,6 @@ function alterContent(url) {
|
|
myJsonRandomPost('#titolosingleR', '#mostracontentsingleR');
|
|
myJsonRandomPost('#titolosingleR', '#mostracontentsingleR');
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-// $( "#outside" ).panel( "close" );
|
|
|
|
-// // Alter the url according to the anchor's href attribute, and
|
|
|
|
-// // store the data-foo attribute information with the url
|
|
|
|
-// $.mobile.navigate(url);
|
|
|
|
}
|
|
}
|
|
/*///////////////utilities//////////////http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript*/
|
|
/*///////////////utilities//////////////http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript*/
|
|
function getParameterByName(name, url) {
|
|
function getParameterByName(name, url) {
|
|
@@ -242,13 +240,6 @@ Site.prototype.init = function () {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-// On document ready
|
|
|
|
-$(function () {
|
|
|
|
- // intercettaUrl();
|
|
|
|
- // new Site();
|
|
|
|
- // $(".minibox").click(function () {});
|
|
|
|
-});
|
|
|
|
-
|
|
|
|
function onDeviceReady() {
|
|
function onDeviceReady() {
|
|
// console.log('deviceready');
|
|
// console.log('deviceready');
|
|
createDB();
|
|
createDB();
|