nomeprogetto persistente

This commit is contained in:
redup nomade 2016-12-10 22:52:07 +01:00
parent f856cc5c34
commit e022df0575
2 changed files with 114 additions and 105 deletions

View file

@ -41,13 +41,23 @@
<script src="vendor/jquery.min.js"></script>
<script src="vendor/jquery.mobile-1.4.5.min.js"></script>
<script src="js/spesefurga.js"></script>
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>share fine</title>
</head>
<script>
//$(function(){
$( document ).on( "mobileinit", function(){
$("#popup").popup();
$( ".list" ).listview({
defaults: true
});
});
/*$.mobile.document.on("click", "#open-popup", function (evt) {
$("#popup").popup("open", {
@ -56,12 +66,13 @@
});
evt.preventDefault();
});*/
$(function () {
console.log("nome progetto");
initStorage();
initProgetto();
});
</script>
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>share fine</title>
</head>
<body>
<div data-role="page" id="menu" data-theme="a">

View file

@ -1,4 +1,4 @@
var prog_name=["furgahhh"];
//var prog_name = ["furgahhh"];
var prog_data = []; //serve?
var prog_indice = 0; //serve?
@ -133,33 +133,31 @@ function initStorage(){
};
function initProgetto() {
if(initStorage())
if (initStorage()) {
if(initStorage())
localStorage.setItem(prog_name, name);
//localStorage.setItem(spese, valori);
if(localStorage.getItem(prog_name)!=null)
console.log(prog_name+"nome progetto");
$('.prog-name').text(prog_name);
$('#prog-0').text(prog_name);
var nome_del_progetto = localStorage.getItem("key_progetto")
console.log(nome_del_progetto + "nome progetto");
$('.prog-name').text(nome_del_progetto);
$('#prog-0').text(nome_del_progetto);
}
}
$( function(){
initStorage();
initProgetto();
});
function cambianomeprogetto() {
prog_name = $("#p-name").val();
localStorage.setItem(prog_name, name);
$('.prog-name').text(prog_name);
$('#prog-0').text(prog_name);
var a_prog_name = $("#p-name").val();
localStorage.setItem("key_progetto", a_prog_name);
$('.prog-name').text(a_prog_name);
$('#prog-0').text(a_prog_name);
$("#popup1").popup("close");
}