2017-03-05 17:31:47 +01:00
|
|
|
|
/*
|
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
|
* distributed with this work for additional information
|
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
|
* under the License.
|
|
|
|
|
*/
|
|
|
|
|
///VARIABILI GLOBALI///
|
|
|
|
|
var FONTE = FONTE || {};
|
|
|
|
|
FONTE.dbName = "xm24";
|
|
|
|
|
FONTE.dbHandler;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
FONTE.updatedCategoriesCount;
|
|
|
|
|
FONTE.updatedPostsCount;
|
|
|
|
|
FONTE.neededPostsCount;
|
2017-03-05 17:31:47 +01:00
|
|
|
|
FONTE.tagsPageInitiated = false;
|
|
|
|
|
FONTE.categoriesList = [8, 497];
|
2017-03-24 02:51:21 +01:00
|
|
|
|
FONTE.categories = {
|
|
|
|
|
ilove : [497,647,590], //ilove, 4mar, solid
|
|
|
|
|
info : [8,42,68,3], //ilove, 4mar, solid
|
2017-03-25 16:32:18 +01:00
|
|
|
|
};
|
2017-03-24 02:51:21 +01:00
|
|
|
|
|
|
|
|
|
FONTE.page_loaded = {
|
|
|
|
|
ilove : 0,
|
|
|
|
|
info : 0,
|
|
|
|
|
};
|
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
FONTE.hrefseguente = "";
|
2017-03-24 02:51:21 +01:00
|
|
|
|
FONTE.contentListId = '#mostralistainfo';
|
2017-03-25 16:32:18 +01:00
|
|
|
|
FONTE.contentListClass = '.news';
|
2017-03-05 17:31:47 +01:00
|
|
|
|
FONTE.ajaxError = false;
|
2017-03-30 00:11:55 +02:00
|
|
|
|
|
|
|
|
|
FONTE.back_pressed = false;
|
2017-03-05 17:31:47 +01:00
|
|
|
|
/*
|
|
|
|
|
* data ultimo aggiornamento
|
|
|
|
|
*/
|
2017-03-23 19:51:21 +01:00
|
|
|
|
function displayLastUpdateDate() {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
var lastUpdate = window.localStorage.getItem('db_update_date');
|
|
|
|
|
if (lastUpdate) {
|
|
|
|
|
var data = lastUpdate.split('T');
|
|
|
|
|
var datagiorno = data[0];
|
|
|
|
|
var dataora = data[1];
|
|
|
|
|
$("#datadiritti").empty();
|
|
|
|
|
$("#datadirittiora").empty();
|
2017-03-25 16:32:18 +01:00
|
|
|
|
display_results("#datadiritti", datagiorno);
|
|
|
|
|
display_results("#datadirittiora", dataora);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
if (data) {
|
|
|
|
|
$("#boxdata").css("display", "block");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2017-03-18 11:54:19 +01:00
|
|
|
|
toastr.warning('Warn: manca la data del tuo ultimo aggiornamento. Aggiorna al più presto.');
|
2017-03-05 17:31:47 +01:00
|
|
|
|
}
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
function alterContent(url) {
|
2017-03-25 20:56:52 +01:00
|
|
|
|
var paginacorrente = $("body").pagecontainer("getActivePage").attr("id");
|
|
|
|
|
|
2017-03-29 23:25:34 +02:00
|
|
|
|
var oldUrl = url;
|
|
|
|
|
|
|
|
|
|
$( "#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);
|
|
|
|
|
|
|
|
|
|
switch (oldUrl) {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
case '#index':
|
|
|
|
|
$("#navheader").addClass("hide");
|
|
|
|
|
$("#navfooter").addClass("hide");
|
|
|
|
|
break;
|
2017-03-25 20:56:52 +01:00
|
|
|
|
case '#about':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").addClass("hide");
|
|
|
|
|
if(window.localStorage.getItem('app_firsttime') === "false") {
|
|
|
|
|
$("#init-btn").addClass("hide");
|
|
|
|
|
} else {
|
|
|
|
|
window.localStorage.setItem('app_firsttime', false);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2017-03-05 17:31:47 +01:00
|
|
|
|
case '#ilove':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
2017-03-25 16:32:18 +01:00
|
|
|
|
$("#navfooter").addClass("hide");
|
2017-04-08 16:19:38 +02:00
|
|
|
|
if(checkConnection()) {
|
|
|
|
|
postsUpdate(FONTE.categories.ilove);
|
|
|
|
|
} else {
|
|
|
|
|
renderLastNews(FONTE.contentListClass, FONTE.categories.ilove);
|
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
break;
|
|
|
|
|
case '#info':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$("#navfooter").addClass("hide");
|
2017-04-08 16:19:38 +02:00
|
|
|
|
if(checkConnection()) {
|
|
|
|
|
postsUpdate(FONTE.categories.info);
|
|
|
|
|
} else {
|
|
|
|
|
renderLastNews(FONTE.contentListClass, FONTE.categories.info);
|
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
break;
|
2017-03-16 18:08:23 +01:00
|
|
|
|
case '#events':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$("#navfooter").addClass("hide");
|
2017-04-08 16:19:38 +02:00
|
|
|
|
EVENTS.render(); //il checkconenction è fatto dentro
|
2017-03-16 18:08:23 +01:00
|
|
|
|
break;
|
2017-04-08 12:52:41 +02:00
|
|
|
|
case '#laboratori':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").addClass("hide");
|
|
|
|
|
PROJECT.render();
|
|
|
|
|
break;
|
2017-03-05 17:31:47 +01:00
|
|
|
|
case '#aggiorna':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").removeClass("hide");
|
|
|
|
|
// ultimoAggiornamento();
|
|
|
|
|
break;
|
|
|
|
|
case '#ultime':
|
|
|
|
|
case '#tag':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").removeClass("hide");
|
|
|
|
|
break;
|
|
|
|
|
case '#quotidiano':
|
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").removeClass("hide");
|
|
|
|
|
myJsonRandomPost('#titolosingleR', '#mostracontentsingleR');
|
|
|
|
|
break;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
/*///////////////utilities//////////////http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript*/
|
|
|
|
|
function getParameterByName(name, url) {
|
|
|
|
|
if (!url) url = window.location.href;
|
|
|
|
|
name = name.replace(/[\[\]]/g, "\\$&");
|
2017-03-25 16:32:18 +01:00
|
|
|
|
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
|
|
|
|
results = regex.exec(url);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
if (!results) return null;
|
|
|
|
|
if (!results[2]) return '';
|
|
|
|
|
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function display_results(contenitore, messaggio) {
|
|
|
|
|
$(contenitore).text(messaggio);
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
$(function () {
|
|
|
|
|
$("form").submit(function () {
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2017-03-25 20:56:52 +01:00
|
|
|
|
function initMainPage() {
|
2017-03-23 19:51:21 +01:00
|
|
|
|
if (checkConnection()) {
|
2017-03-25 16:32:18 +01:00
|
|
|
|
postsUpdate(FONTE.categories.info);
|
2017-03-23 19:51:21 +01:00
|
|
|
|
} else {
|
2017-03-25 16:32:18 +01:00
|
|
|
|
renderLastNews(FONTE.contentListClass, FONTE.categories.info);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
}
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-18 16:15:57 +01:00
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
/*per link in browser di default */
|
|
|
|
|
document.addEventListener("deviceready", onDeviceReady, false);
|
|
|
|
|
//le cose all'inizio
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-30 00:11:55 +02:00
|
|
|
|
|
|
|
|
|
$(window).on("navigate", function (event, data) {
|
|
|
|
|
var direction = data.state.direction;
|
|
|
|
|
if (direction == 'back') {
|
|
|
|
|
FONTE.back_pressed = true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
FONTE.back_pressed = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2017-03-29 23:25:34 +02:00
|
|
|
|
$(document).on("pagecontainershow", function (e, ui) {
|
2017-03-29 23:31:29 +02:00
|
|
|
|
var pageId = $('body').pagecontainer('getActivePage').prop('id');
|
2017-03-30 00:11:55 +02:00
|
|
|
|
if ((pageId == 'ilove' || pageId == 'info' || pageId == 'events') && !FONTE.back_pressed) {
|
2017-03-29 23:31:29 +02:00
|
|
|
|
$.mobile.loading('show');
|
|
|
|
|
}
|
2017-03-29 23:25:34 +02:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$(document).on("mobileinit", function () {
|
|
|
|
|
$("body").pagecontainer({
|
|
|
|
|
defaults: true
|
2017-03-18 17:14:26 +01:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$(".ui-loader").loader({
|
|
|
|
|
defaults: true
|
|
|
|
|
});
|
2017-03-25 16:32:18 +01:00
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$("input").button();
|
|
|
|
|
});
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-25 20:56:52 +01:00
|
|
|
|
$(document).on("pagecontainerchange", function () {
|
2017-03-19 12:38:23 +01:00
|
|
|
|
var current = $(".ui-page-active").prop("id"); // Remove active class from nav buttons
|
2017-04-08 12:52:41 +02:00
|
|
|
|
if(current == 'about' || current == 'info' || current == 'ilove' || current == 'events' || current == 'cerca' || current == 'laboratori'){
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$("#navfooter").addClass("hide");
|
2017-03-19 12:59:23 +01:00
|
|
|
|
} else {
|
|
|
|
|
$("#navfooter").removeClass("hide");
|
2017-03-19 12:38:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("current" + current);
|
|
|
|
|
$("[data-role='navbar'] a.ui-btn-active").removeClass("ui-btn-active"); // Add active class to current nav button
|
|
|
|
|
|
|
|
|
|
$("[data-role='navbar'] a").each(function () {
|
|
|
|
|
var href = $(this).prop("href");
|
|
|
|
|
if (href.indexOf(current, href.length - current.length) !== -1) {
|
|
|
|
|
$(this).addClass("ui-btn-active");
|
|
|
|
|
}
|
2017-03-18 17:14:26 +01:00
|
|
|
|
});
|
2017-03-19 12:38:23 +01:00
|
|
|
|
});
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$(document).on("pagecreate", function () {
|
|
|
|
|
$("body > [data-role='panel']").panel();
|
|
|
|
|
$("body > [data-role='panel'] [data-role='listview']").listview();
|
|
|
|
|
$("body > [data-role='header']").toolbar();
|
|
|
|
|
$("body > [data-role='footer']").toolbar();
|
|
|
|
|
$("body > [data-role='navbar']").navbar();
|
|
|
|
|
$("#navfooter").navbar();
|
|
|
|
|
postInList();
|
|
|
|
|
});
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
/*per inizio navigazione*/
|
|
|
|
|
var Site = function () {
|
|
|
|
|
this.homepage = "#index"; // the default page that is loaded
|
|
|
|
|
this.init();
|
|
|
|
|
};
|
2017-03-18 17:14:26 +01:00
|
|
|
|
|
2017-03-19 12:38:23 +01:00
|
|
|
|
Site.prototype.init = function () {
|
|
|
|
|
var self = this;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
// default page if no hash given
|
|
|
|
|
// this changes the hash, so the event is fired
|
|
|
|
|
// no need to call self.navigate
|
|
|
|
|
window.location.hash = self.homepage;
|
2017-03-18 17:14:26 +01:00
|
|
|
|
});
|
2017-03-19 12:38:23 +01:00
|
|
|
|
};
|
2017-03-25 16:32:18 +01:00
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
function onDeviceReady() {
|
2017-04-09 03:36:57 +02:00
|
|
|
|
//Setto il locale delle plugin delle date
|
|
|
|
|
moment.locale('it');
|
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
createDB();
|
2017-03-25 20:56:52 +01:00
|
|
|
|
initStorage();
|
|
|
|
|
|
|
|
|
|
if(window.localStorage.getItem('app_firsttime') !== "false") {
|
|
|
|
|
alterContent('#about');
|
|
|
|
|
} else {
|
|
|
|
|
initMainPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
overlayblock();
|
2017-03-05 17:31:47 +01:00
|
|
|
|
$("a.nav").on("click", function (event) {
|
|
|
|
|
// Prevent the usual navigation behavior
|
|
|
|
|
event.preventDefault();
|
2017-03-25 20:56:52 +01:00
|
|
|
|
alterContent($(this).attr("href"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("button.nav").on("click", function (event) {
|
|
|
|
|
alterContent($(this).attr("href"));
|
2017-03-05 17:31:47 +01:00
|
|
|
|
});
|
2017-03-18 17:14:26 +01:00
|
|
|
|
// eliminare le due righe:
|
|
|
|
|
$("body > [data-role='header']").toolbar();
|
|
|
|
|
$("[data-role='navbar']").navbar();
|
2017-03-25 16:32:18 +01:00
|
|
|
|
|
|
|
|
|
//Non uso pageContent per non lanciare 2 volte il recupero dei dati da internet
|
2017-03-26 17:40:41 +02:00
|
|
|
|
//per la pagina principale
|
2017-03-25 16:32:18 +01:00
|
|
|
|
$("#navheader").removeClass("hide");
|
|
|
|
|
$("#navfooter").addClass("hide");
|
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function overlayblock() {
|
|
|
|
|
$(".overlaynero").toggleClass("hide");
|
|
|
|
|
}
|
|
|
|
|
/*///////////////fine utilities//////////////*/
|
|
|
|
|
|
|
|
|
|
var weburl = "http://www.ecn.org/xm24/";
|
|
|
|
|
var arrayTag = [];
|
|
|
|
|
/*/////finite variabili globali////////*/
|
|
|
|
|
function intercettaUrl() {
|
|
|
|
|
// LETTURA - Log the results of the navigate event
|
|
|
|
|
$(window).on("navigate", function (event, data) {
|
|
|
|
|
idPost = getParameterByName('id');
|
2017-03-25 16:32:18 +01:00
|
|
|
|
if (idPost !== "") {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
myJsonPost(idPost, "#titolosingle", "#mostracontentsingle");
|
|
|
|
|
}
|
|
|
|
|
});
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function postInList() {
|
|
|
|
|
//SCRITTURA
|
|
|
|
|
$("body").on('click', '.listevoci li > a', function (event) {
|
|
|
|
|
// console.log("HUU_post in list");
|
2017-03-26 17:40:41 +02:00
|
|
|
|
if($(this).attr("rel") === 'external') {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-05 17:31:47 +01:00
|
|
|
|
var idOra = $(this).attr("data-post");
|
2017-03-19 15:14:05 +01:00
|
|
|
|
var _class = $(this).attr("class");
|
2017-03-05 17:31:47 +01:00
|
|
|
|
$("#titolosingle").empty();
|
|
|
|
|
$("#mostracontentsingle").empty();
|
|
|
|
|
//console.log(idOra);
|
2017-03-19 15:14:05 +01:00
|
|
|
|
myJsonPost(idOra, "#titolosingle", "#mostracontentsingle", _class);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
// Prevent the usual navigation behavior
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
/*se serve idTAg, mettiamolo nell'url!! e anche nella page!*/
|
2017-03-25 16:32:18 +01:00
|
|
|
|
$("#singleQpost").attr("id", '#singleQpost?id=' + idOra);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
$(":mobile-pagecontainer").pagecontainer("load", '#singleQpost' + idOra, {
|
|
|
|
|
showLoadMsg: false
|
|
|
|
|
});
|
2017-03-19 12:38:23 +01:00
|
|
|
|
$("#navfooter").removeClass("hide");
|
2017-03-05 17:31:47 +01:00
|
|
|
|
location.hash = '#singleQpost?id=' + idOra;
|
|
|
|
|
});
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function findImg(htmlString) {
|
|
|
|
|
var pos = htmlString.indexOf('<img ');
|
|
|
|
|
while (pos != -1) {
|
|
|
|
|
pos += 5;
|
|
|
|
|
htmlString = [htmlString.slice(0, pos), ' onerror="imgNotFound(this);" ', htmlString.slice(pos)].join('');
|
|
|
|
|
pos = htmlString.indexOf('<img ', pos);
|
|
|
|
|
}
|
|
|
|
|
return htmlString;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function imgNotFound(img) {
|
|
|
|
|
var parent = $(img).parent();
|
|
|
|
|
parent.empty();
|
2017-03-25 16:32:18 +01:00
|
|
|
|
parent.append('<span>Immagine disponibile online.</span>');
|
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function JSONErrorHandler(jqXHR, textStatus, errorThrown) {
|
2017-03-26 19:03:01 +02:00
|
|
|
|
$.mobile.loading('hide');
|
2017-03-05 17:31:47 +01:00
|
|
|
|
if (!FONTE.ajaxError) {
|
2017-03-18 11:44:41 +01:00
|
|
|
|
var errMsg = "Err: ";
|
2017-03-26 20:02:26 +02:00
|
|
|
|
if(jqXHR.status === 404 ) {
|
2017-03-18 11:44:41 +01:00
|
|
|
|
errMsg += "Sito non raggiungibile. ";
|
2017-03-26 20:02:26 +02:00
|
|
|
|
} else if(jqXHR.status === 0) {
|
|
|
|
|
return checkConnection(jqXHR.status, "Occore essere connessi per poter ricevere altri articoli");
|
2017-03-18 11:44:41 +01:00
|
|
|
|
}
|
|
|
|
|
toastr.error(errMsg);
|
2017-03-05 17:31:47 +01:00
|
|
|
|
FONTE.ajaxError = true;
|
|
|
|
|
}
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function segnalaBug() {
|
2017-03-18 13:48:23 +01:00
|
|
|
|
return checkConnection('ERR_SEGNALA');
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function mostraEsperto() {
|
2017-03-18 13:48:23 +01:00
|
|
|
|
var ret = checkConnection('ERR_ESPERTO');
|
|
|
|
|
if (ret) {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
myJsonPage(2167, '#espertotitle', '#mostraesperto');
|
|
|
|
|
}
|
2017-03-18 16:15:57 +01:00
|
|
|
|
|
2017-03-18 13:48:23 +01:00
|
|
|
|
return ret;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function checkAndUpdate() {
|
2017-03-18 13:48:23 +01:00
|
|
|
|
var ret = checkConnection('ERR_ESPERTO');
|
|
|
|
|
if (ret) {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
update();
|
|
|
|
|
}
|
2017-03-18 16:15:57 +01:00
|
|
|
|
|
2017-03-18 13:48:23 +01:00
|
|
|
|
return ret;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|
2017-03-05 17:31:47 +01:00
|
|
|
|
|
|
|
|
|
function checkAndReset() {
|
2017-03-18 13:48:23 +01:00
|
|
|
|
var ret = checkConnection('ERR_ESPERTO');
|
|
|
|
|
if (ret) {
|
2017-03-05 17:31:47 +01:00
|
|
|
|
resetAndUpdate();
|
2017-03-18 16:15:57 +01:00
|
|
|
|
}
|
2017-03-18 13:48:23 +01:00
|
|
|
|
|
|
|
|
|
return ret;
|
2017-03-25 16:32:18 +01:00
|
|
|
|
}
|