stiamo merge-ando da fix-home

This commit is contained in:
Andrea Condoluci 2017-03-18 17:50:12 +01:00
commit e9e4f5e4aa
3 changed files with 382 additions and 343 deletions

File diff suppressed because it is too large Load diff

View file

@ -25,13 +25,13 @@
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<!--meta http-equiv="Content-Security-Policy" content="default-src * 'self' gap: ; frame-src * 'self' gap: http: ; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; " /-->
<title>I love xm24</title>
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link rel="stylesheet" type="text/css" href="css/toastr.css" />
<link rel="stylesheet" href="css/themes/default/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="js/vendor/jquery-1.10.2.min.js"></script>
<!--script src="js/swipe-page.js"></script-->
@ -46,89 +46,18 @@
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/push.js"></script>
<script type="text/javascript" src="js/share.js"></script>
<script type="text/javascript">
$(document).on("mobileinit", function () {
$("body").pagecontainer({
defaults: true
});
$(".ui-loader").loader({
defaults: true
});
$("input").button();
});
$(document).on("pagecontainerchange", function () {    
var current = $(".ui-page-active").prop("id");     // Remove active class from nav buttons
    
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");        
}    
});
});
$(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();
});
/*per inizio navigazione*/
var Site = function () {
this.homepage = "#index"; // the default page that is loaded
this.init();
};
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;
});
};
// On document ready
$(function () {
intercettaUrl();
new Site();
$(".minibox").click(function () {
});
});
</script>
</head>
<body>
<!--panel -->
<div data-role="panel" data-position="right" id="outside" data-theme="a" data-position-fixed="true" data-display="overlay" data-swipe-close="true">
<p><img src="image/xm-logo.png" class="rwd" /></p>
<p><img src="image/ilovexm24_puzzle-300x300.jpg" class="panel_logo" /></p>
<ul data-role="listview">
<li><a class="nav" href="#ilove">I love XM24</a></li>
<li><a class="nav" href="#info">Info</a></li>
<li><a class="nav" href="#ilove">I love XM24</a></li>
<li><a class="nav" href="#events">Events</a></li>
<li><a class="nav" href="#about">About</a></li>
<li>
<input type="text" class="cerca" value="" placeholder="Cerca" data-clear-btn="true" />
</li>
@ -151,18 +80,20 @@
</div>
<!--/navbar -->
<div data-role="header" data-position="fixed" id="navheader" class="hide">
<div data-role="header" data-position="fixed" id="navheader">
<div data-role="navbar" id="nav2" data-iconpos="left" data-theme="a">
<ul class="downnav">
<li><a class="ui-mini nav" href="#index">Home</a> </li>
<li><a class="ui-mini" href="#outside">Menù</a> </li>
<li><a class="ui-mini" href="#outside" data-icon="bars">
<img src="image/xm-logo.png" class="rwd" />
</a>
</li>
</ul>
</div>
</div>
<!-- /header -->
<!-- Home page -->
<div data-role="page" id="index" data-dom-cache="true" data-theme="a" class="ui-page">
<!-- <div data-role="page" id="index" data-dom-cache="true" data-theme="a" class="ui-page">
<center><p><img src="image/xm-logo.png" class="rwd" /></p>
<ul data-role="listview" data-inset="true">
<li>
@ -170,7 +101,7 @@
<img src="./image/ilovexm24_puzzle-300x300.jpg" class="ui-li-thumb">
<h2>I love XM24</h2>
<p>Bla blabla</p>
<!--p class="ui-li-aside">iOS</p-->
<!-p class="ui-li-aside">iOS</p-=>
</a>
</li>
<li>
@ -178,7 +109,7 @@
<img src="./image/xm24-particolare2.jpeg" class="ui-li-thumb">
<h2>Info e comunicati</h2>
<p>Bla Bla blabla</p>
<!--p class="ui-li-aside">BlackBerry</p-->
<!--p class="ui-li-aside">BlackBerry</p-=>
</a>
</li>
<li>
@ -190,11 +121,11 @@
</li>
</ul>
</center>
<!--a class="minibox orange nav" href="#eventi"> Eventi</a>
<!=-a class="minibox orange nav" href="#eventi"> Eventi</a>
<a class="minibox green nav" href="#lab"> Laboratori</a>
<a class="minibox green nav" href="#ultime"> News</a>
<a class="minibox green nav" href="#tag"> Tag</a>
<a class="minibox blue nav" href="#quotidiano"> Un post a caso</a-->
<a class="minibox blue nav" href="#quotidiano"> Un post a caso</a ==>
<br/ style="clear:both;">
<div id="aggiornahome">Aggiorna i contenuti dal sito XM24 di tanto in tanto.
@ -225,8 +156,21 @@
<input type="button" value="OK" onclick='$("#benvenuta").popup("close");alterContent(#info);' />
</div>
</div>
</div> -->
<div data-role="page" id="info" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
<!-- <center><p><img src="image/xm-logo.png" class="rwd" /></p></center> -->
<div class="ui-body">
<p class="introlettera">Info e comunicati</p>
<p id="mostralistainfo" class="listatovirgole listevoci">
<img class="gifloader" src="./image/ajax_loader_red_512.gif" />
</p>
</div>
<!-- chiude body-->
</div>
<!--chiude content -->
</div>
</div>
<div data-role="page" id="events" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
@ -256,20 +200,7 @@
<!--chiude content -->
</div>
<!-- chiude pagina -->
<div data-role="page" id="info" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
<div class="ui-body">
<p class="introlettera">Info e comunicati</p>
<p id="mostralistainfo" class="listatovirgole listevoci">
<img class="gifloader" src="./image/ajax_loader_red_512.gif" />
</p>
</div>
<!-- chiude body-->
</div>
<!--chiude content -->
</div>
<!-- chiude pagina -->
<div data-role="page" id="quotidiano" data-transition="slide" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
@ -295,7 +226,7 @@
<p>
Aggiorna i contenuti dal sito XM24 di tanto in tanto.
<br/> Per iniziare da capo e riscaricare tutti i contenuti clicca su reset. </p>
<center>
<img src="./image/icona_aggiorna.png" id="aggiorna" />
@ -312,14 +243,14 @@
</fieldset>
</center>
<p id="boxdata" style="display:none;">I tuoi diritti sono stati aggiornati l'ultima volta il <span id="datadiritti">2016/07/18</span> alle <span id="datadirittiora">00:00</span>.</p>
<img src="image/icona_aggiorna.gif" style="visibility:hidden;" id="aggiornamento" />
</div>
</div>
</div>
chiude pagina -->
<div data-role="page" id="singleQpost" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">

View file

@ -108,6 +108,7 @@ function getParameterByName(name, url) {
function display_results(contenitore, messaggio) {
$(contenitore).text(messaggio);
};
$(function () {
$("form").submit(function () {
return false;
@ -135,23 +136,98 @@ function setFirstRun() {
}
}
};
/*per link in browser di default */
document.addEventListener("deviceready", onDeviceReady, false);
//le cose all'inizio
$(document).on("mobileinit", function () {
$("body").pagecontainer({
defaults: true
});
$(".ui-loader").loader({
defaults: true
});
$("input").button();
});
$(document).on("pagecontainerchange", function () {    
var current = $(".ui-page-active").prop("id");     // Remove active class from nav buttons
    
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");        
}    
});
});
$(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();
});
/*per inizio navigazione*/
var Site = function () {
this.homepage = "#index"; // the default page that is loaded
this.init();
};
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;
});
};
// On document ready
$(function () {
// intercettaUrl();
// new Site();
// $(".minibox").click(function () {});
});
function onDeviceReady() {
// console.log('deviceready');
createDB();
setFirstRun();
$("#navheader").addClass("hide");
$("#navfooter").addClass("hide");
$("a.nav").on("click", function (event) {
// Prevent the usual navigation behavior
event.preventDefault();
hrefseguente = $(this).attr("href");
alterContent(hrefseguente);
});
// eliminare le due righe:
$("body > [data-role='header']").toolbar();
$("[data-role='navbar']").navbar();
alterContent("#info");
};
function overlayblock() {
$(".overlaynero").toggleClass("hide");
}
@ -159,7 +235,7 @@ function overlayblock() {
function checkConnection(code, msgConnect) {
var msgTitle = "Non sei connesso";
msgConnect = msgConnect || "Occore essere connessi per poter ricevere i nuovi articoli";
var networkState = navigator.connection.type;
var states = {};
states[Connection.UNKNOWN] = 'Unknown connection';
@ -575,11 +651,11 @@ function JSONErrorHandler(jqXHR, textStatus, errorThrown) {
function cerca() {
var ret = checkConnection('ERR_CERCA');
if (ret) {
cercaMe();
}
}
return ret;
};
@ -592,7 +668,7 @@ function mostraEsperto() {
if (ret) {
myJsonPage(2167, '#espertotitle', '#mostraesperto');
}
return ret;
};
@ -601,7 +677,7 @@ function checkAndUpdate() {
if (ret) {
update();
}
return ret;
};
@ -609,7 +685,7 @@ function checkAndReset() {
var ret = checkConnection('ERR_ESPERTO');
if (ret) {
resetAndUpdate();
}
}
return ret;
};