git-svn-id: https://msi/svn/firstRepo/WebClient/trunk@15 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2014-12-10 15:06:13 +00:00
parent 876ee18579
commit f57f55e2a9
58 changed files with 873 additions and 487 deletions
+7 -19
View File
@@ -1,26 +1,14 @@
AddHandler application/x-httpd-php .html .htm AddHandler application/x-httpd-php .html .htm
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
<ifModule mod_rewrite.c> <ifModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
RewriteRule ^index.html$ index.php [L] RewriteRule ^index.html$ /NewMobileWebSite/index.php [L]
RewriteRule ^js/libs/(.*)\.[0-9]+\.js$ /IlLievitarioManut/js/libs/$1.js [L] RewriteRule ^js/libs/(.*)\.[0-9]+\.js$ /NewMobileWebSite/js/libs/$1.js [L]
RewriteRule ^js/(.*)\.[0-9]+\.js$ /IlLievitarioManut/js/$1.js [L] RewriteRule ^js/(.*)\.[0-9]+\.js$ /NewMobileWebSite/js/$1.js [L]
RewriteRule ^css/(.*)\.[0-9]+\.css$ /IlLievitarioManut/css/$1.css [L] RewriteRule ^css/(.*)\.[0-9]+\.css$ /NewMobileWebSite/css/$1.css [L]
RewriteRule ^Resources/img/(.*)\.[0-9]+\.png$ /IlLievitarioManut/Resources/img/$1.png [L] RewriteRule ^Resources/img/(.*)\.[0-9]+\.png$ /NewMobileWebSite/Resources/img/$1.png [L]
RewriteRule ^Resources/img/(.*)\.[0-9]+\.gif$ /IlLievitarioManut/Resources/img/$1.gif [L] RewriteRule ^Resources/img/(.*)\.[0-9]+\.gif$ /NewMobileWebSite/Resources/img/$1.gif [L]
RewriteRule ^Resources/icons/(.*)\.[0-9]+\.png$ /IlLievitarioManut/Resources/icons/$1.png [L] RewriteRule ^Resources/icons/(.*)\.[0-9]+\.png$ /NewMobileWebSite/Resources/icons/$1.png [L]
</ifModule> </ifModule>
<ifModule mod_headers.c> <ifModule mod_headers.c>
Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+1 -2
View File
@@ -1,5 +1,4 @@
REM node r.js -o app.build_dev.js REM node r.js -o app.build_dev.js
node r.js -o app.build_prod.js node r.js -o app.build_prod.js
REM call cleancss -o .\css\loadingStyle.min.css .\css\loadingStyle.css REM call cleancss -o .\css\loadingStyle.min.css .\css\loadingStyle.css
call cleancss -o .\css\style.min.css .\css\style.css call cleancss -o .\css\style.min.css .\css\style.css
pause
+57 -7
View File
@@ -3,18 +3,68 @@
height: 400px; height: 400px;
} }
.circle
{
position: relative;
top: -6px;
left: 15px;
width: 12px;
height: 12px;
border-radius: 12px;
font-size: 10px;
color: #fff;
line-height: 12px;
text-align: center;
background: red;
z-index: 1;
text-indent: 0;
}
.nav-glyphish-example .ui-btn { padding-top: 35px !important; } .nav-glyphish-example .ui-btn { padding-top: 35px !important; }
.nav-glyphish-example .ui-btn:after { width: 30px!important; height: 30px!important; margin-left: -15px !important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important; } .nav-glyphish-example .ui-btn:after { width: 30px!important; height: 30px!important; margin-left: -15px !important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
.ui-icon-myHome:after { .ui-icon-myHome:after {
background: url("https://dl.dropboxusercontent.com/s/w5evmv0suijf2jd/house.png") 50% 50% no-repeat; background-size: 22px 22px; background: url("https://dl.dropboxusercontent.com/s/w5evmv0suijf2jd/house.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important; margin-top: -15px !important;
width: 30px!important; height: 30px!important; margin-left: -15px !important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important; width: 30px!important; height: 30px!important; margin-left: -15px !important;
box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
.notification:after {
background: url("https://dl.dropboxusercontent.com/s/afsciy4lipub4hf/notification.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; margin-left: -15px !important;
box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#optionBtn:after {
background: url("https://dl.dropboxusercontent.com/s/gnlhujh5a86qdhi/property.png?dl=0") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; margin-left: -15px !important;
box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#favoriteBtn:after {
background: url("https://dl.dropboxusercontent.com/s/ptt4475xkrv0chu/favorite.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#scattaPhotoBtn:after {
background: url("https://dl.dropboxusercontent.com/s/kou4hv3nzau9161/camera.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#uploadPhotoBtn:after {
background: url("https://dl.dropboxusercontent.com/s/k65p3k0frglitu2/photo.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#backBtn:after { background: url("https://dl.dropboxusercontent.com/s/b5feph9hnl1wvep/previous.png") 50% 50% no-repeat; background-size: 22px 22px;
margin-top: -15px !important;
width: 30px!important; height: 30px!important; margin-left: -15px !important;
box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;
} }
#favoriteBtn:after { background: url("https://dl.dropboxusercontent.com/s/ptt4475xkrv0chu/favorite.png") 50% 50% no-repeat; background-size: 22px 22px; }
#infoBtn:after { background: url("https://dl.dropboxusercontent.com/s/uoe0goxll3anh3x/info.png") 50% 50% no-repeat; background-size: 22px 22px; } #infoBtn:after { background: url("https://dl.dropboxusercontent.com/s/uoe0goxll3anh3x/info.png") 50% 50% no-repeat; background-size: 22px 22px; }
#backBtn:after { background: url("https://dl.dropboxusercontent.com/s/b5feph9hnl1wvep/previous.png") 50% 50% no-repeat; background-size: 16px 16px; }
#noteBtn:after { background: url("https://dl.dropboxusercontent.com/s/vtl7zq0b144aiep/blocco.png") 50% 50% no-repeat; background-size: 22px 22px; } #noteBtn:after { background: url("https://dl.dropboxusercontent.com/s/vtl7zq0b144aiep/blocco.png") 50% 50% no-repeat; background-size: 22px 22px; }
#indexBtn:after { background: url("https://dl.dropboxusercontent.com/s/pn37wqdw6z1rd8s/ricette.png") 50% 50% no-repeat; background-size: 22px 22px; } #indexBtn:after { background: url("https://dl.dropboxusercontent.com/s/pn37wqdw6z1rd8s/ricette.png") 50% 50% no-repeat; background-size: 22px 22px; }
#toolsBtn:after { background: url("https://dl.dropboxusercontent.com/s/8n0npemivbc6kuy/toolbox.png") 50% 50% no-repeat; background-size: 22px 22px; } #toolsBtn:after { background: url("https://dl.dropboxusercontent.com/s/8n0npemivbc6kuy/toolbox.png") 50% 50% no-repeat; background-size: 22px 22px; }
@@ -27,22 +77,22 @@
box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;} box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important;}
.loginfb { .loginfb {
content: url('https://www.dropbox.com/s/vsc19gan0ihjptr/fblogin.png'); content: url('https://dl.dropboxusercontent.com/s/vsc19gan0ihjptr/fblogin.png');
width: 200px; width: 200px;
} }
.logoutfb { .logoutfb {
content: url('https://www.dropbox.com/s/sdbe56vqxeqevph/fblogout.png'); content: url('https://dl.dropboxusercontent.com/s/sdbe56vqxeqevph/fblogout.png');
width: 200px; width: 200px;
} }
.logingplus { .logingplus {
content: url('https://www.dropbox.com/s/k43w3cfzowlynhk/gpluslogin.png'); content: url('https://dl.dropboxusercontent.com/s/k43w3cfzowlynhk/gpluslogin.png');
width: 200px; width: 200px;
} }
.logoutgplus { .logoutgplus {
content: url('https://www.dropbox.com/s/nnprsunm8zg31en/gpluslogout.png'); content: url('https://dl.dropboxusercontent.com/s/nnprsunm8zg31en/gpluslogout.png');
width: 200px; width: 200px;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+39 -39
View File
@@ -1,15 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Il Lievitario</title> <title>Il Lievitario</title>
<meta name="google" value="notranslate" /> <meta name="google" value="notranslate" />
<meta http-equiv="expires" content="0"> <meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="X-UA-Compatible" content="IE=9"> <meta http-equiv="X-UA-Compatible" content="IE=9">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.structure.min.css" > <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" >
<link rel="stylesheet" href="css/jquery.mobile.icons.min.<?php echo filemtime('css/jquery.mobile.icons.min.css'); ?>.css"> <link rel="stylesheet" href="css/jquery.mobile.icons.min.<?php echo filemtime('css/jquery.mobile.icons.min.css'); ?>.css">
<link rel="stylesheet" href="css/IlLievitario.min.<?php echo filemtime('css/IlLievitario.min.css'); ?>.css"> <link rel="stylesheet" href="css/IlLievitario.min.<?php echo filemtime('css/IlLievitario.min.css'); ?>.css">
<link rel="stylesheet" href="css/style.min.<?php echo filemtime('css/style.min.css'); ?>.css"> <link rel="stylesheet" href="css/style.min.<?php echo filemtime('css/style.min.css'); ?>.css">
@@ -18,37 +18,37 @@
<link rel="apple-touch-icon" sizes="72x72" href="https://dl.dropboxusercontent.com/s/onehseqh6cusbo0/Icon~ipad.png" /> <link rel="apple-touch-icon" sizes="72x72" href="https://dl.dropboxusercontent.com/s/onehseqh6cusbo0/Icon~ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="https://dl.dropboxusercontent.com/s/tcxl91zd502mapa/Icon%402x.png" /> <link rel="apple-touch-icon" sizes="114x114" href="https://dl.dropboxusercontent.com/s/tcxl91zd502mapa/Icon%402x.png" />
<link rel="apple-touch-icon" sizes="144x144" href="https://dl.dropboxusercontent.com/s/pj3fk1lgc4cefwx/Icon~ipad%402x.png" /> <link rel="apple-touch-icon" sizes="144x144" href="https://dl.dropboxusercontent.com/s/pj3fk1lgc4cefwx/Icon~ipad%402x.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui"/> <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui"/>
<meta http-equiv="Access-Control-Allow-Origin" content="*"/> <meta http-equiv="Access-Control-Allow-Origin" content="*"/>
<script type='text/javascript' src="js/libs/ua-parser.min.<?php echo filemtime('js/libs/ua-parser.min.js'); ?>.js"></script> <script type='text/javascript' src="js/libs/ua-parser.min.<?php echo filemtime('js/libs/ua-parser.min.js'); ?>.js"></script>
<script type='text/javascript' src="js/openfb.<?php echo filemtime('js/openfb.js'); ?>.js"></script> <script type='text/javascript' src="js/openfb.<?php echo filemtime('js/openfb.js'); ?>.js"></script>
<script type='text/javascript' src="js/opengplus.<?php echo filemtime('js/opengplus.js'); ?>.js"></script> <script type='text/javascript' src="js/opengplus.<?php echo filemtime('js/opengplus.js'); ?>.js"></script>
<script type='text/javascript'> <script type='text/javascript'>
if(openFB && window.location && if (openFB && window.location &&
window.location.href.indexOf("access_token") != -1 && window.location.href.indexOf("access_token") != -1 &&
window.localStorage.getItem("tryLogin")=="fb") { window.localStorage.getItem("tryLogin") == "fb") {
openFB.oauthCallback(window.location.href); openFB.oauthCallback(window.location.href);
window.location.href = "#syncView/tokenFound"; window.location.href = "#syncView/tokenFound";
} }
else if(openGPlus && window.location && else if (openGPlus && window.location &&
window.location.href.indexOf("access_token") != -1 && window.location.href.indexOf("access_token") != -1 &&
window.localStorage.getItem("tryLogin")=="gplus") { window.localStorage.getItem("tryLogin") == "gplus") {
openGPlus.oauthCallback(window.location.href); openGPlus.oauthCallback(window.location.href);
window.location.href = "#syncView/tokenFound"; window.location.href = "#syncView/tokenFound";
} }
<?php echo file_get_contents("js/manifest.js"); ?> <?php echo file_get_contents("js/manifest.js"); ?>
</script> </script>
<!--<script type='text/javascript' src="js/manifest.<?php echo filemtime('js/manifest.js'); ?>.js"></script>--> <!--<script type='text/javascript' src="js/manifest.<?php echo filemtime('js/manifest.js'); ?>.js"></script>-->
<script data-main="js/config" src="js/libs/require.<?php echo filemtime('js/libs/require.js'); ?>.js"></script> <script data-main="js/config" src="js/libs/require.<?php echo filemtime('js/libs/require.js'); ?>.js"></script>
</head> </head>
<body style="background-color: #1d1d1d;"> <body style="background-color: #1d1d1d;">
<?php include_once("analyticstracking.php") ?> <?php include_once("analyticstracking.php") ?>
<div id="loadingFrm" style="text-align: center;"> <div id="loadingFrm" style="text-align: center;">
<img src="https://dl.dropboxusercontent.com/s/6qrdp9mbi1rb92k/sfondo.png" class="loadingSfondo"> <img src="https://dl.dropboxusercontent.com/s/6qrdp9mbi1rb92k/sfondo.png" class="loadingSfondo">
<div class="loadingText"> <div class="loadingText">
<div style="color: #ffffff;"><b>Caricamento...</b></div> <div style="color: #ffffff;"><b>Caricamento...</b></div>
<img src="https://dl.dropboxusercontent.com/s/mw90t9oay2v9jev/loading.gif"> <img src="https://dl.dropboxusercontent.com/s/mw90t9oay2v9jev/loading.gif">
</div>
</div> </div>
</div> </body>
</body>
</html> </html>
+28 -24
View File
@@ -1,29 +1,33 @@
define(['jquery','underscore', 'backbone', 'router', 'classes/profile'],function define(['jquery','underscore', 'backbone', 'router', 'classes/profile'],
($, _, Backbone,Router, Profile) { function($, _, Backbone, Router, Profile) {
'use strict';
var init=function(){ var Application={
//create backbone router _retThis: function() {
var router=new Router(); return this;
Backbone.history.start(); },
Backbone.emulateJSON = true; router: null,
var origin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + (location.pathname?location.pathname:''); initialize:function(){
openFB.init('1466942266882168', origin, window.localStorage); //create backbone router
openGPlus.init('319140243944-qk0lfhgmi8shi4go97r83l69f1k0gdf4.apps.googleusercontent.com', origin, window.localStorage); this.router=new Router();
//console.log("Backbone history start"); Backbone.history.start();
// Trigger 'route' event on router instance. Backbone.emulateJSON = true;
router.on('route', function(name, args) { var origin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + (location.pathname?location.pathname:'');
//alert(name); openFB.init('1466942266882168', origin, window.localStorage);
}); openGPlus.init('319140243944-qk0lfhgmi8shi4go97r83l69f1k0gdf4.apps.googleusercontent.com', origin, window.localStorage);
//console.log("Backbone history start");
// Trigger 'route' event on router instance.
this.router.on('route', function(name, args) {
//alert(name);
});
if( Profile.isConnected()) { if( Profile.isConnected()) {
Profile.loadProfile(); Profile.loadProfile();
}
$('body').css('background-color', '');
$('#loadingFrm').remove();
} }
$('body').css('background-color', '');
$('#loadingFrm').remove();
}; };
return { return Application._retThis();
initialize:init
};
}); });
+6 -1
View File
@@ -27,7 +27,8 @@ define(['jquery', 'backbone'],
"gender":null, "gender":null,
"tema": 'b', "tema": 'b',
"risRic": '10', "risRic": '10',
"type": null "type": null,
"lastNumRicette": null
}, },
isConnected: function(){ isConnected: function(){
@@ -64,12 +65,16 @@ define(['jquery', 'backbone'],
self.data.tema = response[0].TemaUI; self.data.tema = response[0].TemaUI;
self.data.risRic = response[0].RisultatiRicerca; self.data.risRic = response[0].RisultatiRicerca;
self.data.type = response[0].TipoAccesso; self.data.type = response[0].TipoAccesso;
self.data.lastNumRicette = response[0].NumRicette;
retBool = true; retBool = true;
} }
if(successFn) if(successFn)
successFn(retBool); successFn(retBool);
}, },
getLastNumRicette: function(){
return this.data.lastNumRicette;
},
getKeySave: function(){ getKeySave: function(){
return window.localStorage.getItem("KeySave"); return window.localStorage.getItem("KeySave");
}, },
+50
View File
@@ -0,0 +1,50 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Created by Denis on 19/06/2014.
*/
define(['jquery', 'backbone','libs/fastclick', 'jqm', 'jQueryPlugins'],
function($, Backbone, FastClick){
var Utility = {
retMe: function(){
return this;
},
changePage: function(view){
//append to dom
$('body').append(view.$el);
$.mobile.pageContainer.pagecontainer ("change", $(view.el), {changeHash:false});
FastClick.attach(document.body);
$(":jqmData(role='page'):last").on("pageshow", function (event) {
if (view.onShowed !== null)
view.onShowed();
});
$('input[type=radio].star').rating({
callback: function(value, link){
var tip = $('#hover-test');
if(value === undefined)
{
$('#hover-test').html("Nessuna" || 'value: ' );
}
else
$('#hover-test').html(link.title || 'value: ' + value);
},
focus: function(value, link){
var tip = $('#hover-test');
tip[0].data = tip[0].data || tip.html();
tip.html(link.title || 'value: ' + value);
}
});
}
};
return Utility.retMe();
});
+2 -1
View File
@@ -1,5 +1,6 @@
var pathJquery = "http://ajax.googleapis.com/ajax/libs/jquery/" + myManifest.Settings.JQueryVersion + "/jquery.min"; var pathJquery = "http://ajax.googleapis.com/ajax/libs/jquery/" + myManifest.Settings.JQueryVersion + "/jquery.min";
var pathJqueryMobile = "http://ajax.googleapis.com/ajax/libs/jquerymobile/"+ myManifest.Settings.JQueryMobileVersion + "/jquery.mobile.min"; var pathJqueryMobile = "http://code.jquery.com/mobile/" + myManifest.Settings.JQueryMobileVersion + "/jquery.mobile-" + myManifest.Settings.JQueryMobileVersion + ".min";
// "http://ajax.googleapis.com/ajax/libs/jquerymobile/"+ myManifest.Settings.JQueryMobileVersion + "/jquery.mobile.min";
requirejs.config({ requirejs.config({
baseUrl: 'js', baseUrl: 'js',
+3 -2
View File
@@ -1,5 +1,5 @@
define(['jquery', 'underscore', 'backbone','text!controls/header/headerTemplate.html'], define(['jquery', 'underscore', 'backbone','text!controls/header/headerTemplate.html', 'classes/profile'],
function($, _, Backbone, headerTemplate){ function($, _, Backbone, headerTemplate, Profile){
var header = Backbone.View.extend({ var header = Backbone.View.extend({
@@ -22,6 +22,7 @@ define(['jquery', 'underscore', 'backbone','text!controls/header/headerTemplate.
//append the compiled template into view div container //append the compiled template into view div container
this.$el.append(this.template( { "title":this.title } )); this.$el.append(this.template( { "title":this.title } ));
this.$el.find('#notifyBtn').closest('.ui-btn').hide();
//return to enable chained calls //return to enable chained calls
return this; return this;
} }
+3 -2
View File
@@ -1,2 +1,3 @@
<a href="#homeView" class="nav-glyphish-example ui-btn ui-icon-myHome ui-btn-icon-notext">Home</a> <a id="homeBtn" href="#homeView" class="nav-glyphish-example ui-btn ui-icon-myHome ui-btn-icon-notext">Home</a>
<h4><%= title %></h4> <h4><%= title %></h4>
<a href="#newsView" id="notifyBtn" class="ui-btn ui-icon-withoutCorner ui-btn-icon-notext">News<div class="circle">3</div></a>
+2 -1
View File
@@ -1,7 +1,8 @@
//1. load app.js, //1. load app.js,
//2. configure jquery mobile to prevent default JQM ajax navigation //2. configure jquery mobile to prevent default JQM ajax navigation
//3. bootstrapping application //3. bootstrapping application
define(["app", "jqm", "jqm-config", 'jQueryPlugins'], function( app ){ define(["app", "jqm", "jqm-config", 'jQueryPlugins'],
function( app ){
if(myManifest.Agent.browser.name == "IE Mobile" && myManifest.Agent.browser.version <= 9 ) { if(myManifest.Agent.browser.name == "IE Mobile" && myManifest.Agent.browser.version <= 9 ) {
window.location.href = "http://old.gruppolapastamadre.it"; window.location.href = "http://old.gruppolapastamadre.it";
} }
+7 -7
View File
@@ -1,20 +1,20 @@
var myManifest = { var myManifest = {
Debug: false, Debug: false,
Name: "Il Lievitario", Name: "Il Lievitario",
Version: "2.2.3", Version: "3.0.0.0",
Author: "Denis Ironi", Author: "Denis Ironi",
Settings: { Settings: {
//DefaultURL: "http://localhost:8081/Service", DefaultURL: "http://localhost:8081/Service",
DefaultURL: "http://app.gruppolapastamadre.it/Service", //DefaultURL: "http://dev.gruppolapastamadre.it/Service",
JQueryVersion: "1.11.1", JQueryVersion: "1.11.1",
JQueryMobileVersion: "1.4.3", JQueryMobileVersion: "1.4.5",
Device:{ Device: {
Width: (window.innerWidth > 0) ? window.innerWidth : screen.width, Width: (window.innerWidth > 0) ? window.innerWidth : screen.width,
Height: (window.innerHeight > 0) ? window.innerHeight : screen.height Height: (window.innerHeight > 0) ? window.innerHeight : screen.height
} }
}, },
Agent: (new UAParser()).getResult(), Agent: (new UAParser()).getResult(),
getUrlArg: function(){ getUrlArg: function() {
return (this.Debug ? this.Version + "." + (Math.random() * 1000) : this.Version); return (this.Debug ? this.Version + "." + (Math.random() * 1000) : this.Version);
} }
}; };
@@ -11,7 +11,7 @@ var CategoryItems=Backbone.Collection.extend({
model:Category, model:Category,
url: function() { url: function() {
return myManifest.Settings.DefaultURL + "/api/categoryitems/" + this.categoryId; return myManifest.Settings.DefaultURL + "/api/ricette/" + this.categoryId;
} }
}); });
+3 -3
View File
@@ -1,5 +1,5 @@
define(['jquery', 'underscore', 'backbone'], define(['jquery', 'underscore', 'backbone'],
function ($, _, Backbone){ function($, _, Backbone) {
var CategoryItem = Backbone.Model.extend({ var CategoryItem = Backbone.Model.extend({
//default attributes //default attributes
@@ -13,6 +13,6 @@ function ($, _, Backbone){
} }
}); });
return CategoryItem; return CategoryItem;
}); });
+1 -1
View File
@@ -17,7 +17,7 @@ define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryI
model:Category, model:Category,
url: function() { url: function() {
var u = myManifest.Settings.DefaultURL + "/api/categoryitems/search/" + this.numItems + var u = myManifest.Settings.DefaultURL + "/api/ricette/search/" + this.numItems +
"/" + this.dataFilter.categoryId + "/" + this.dataFilter.categoryId +
"/" + this.dataFilter.difficolta; "/" + this.dataFilter.difficolta;
if(this.dataFilter.titolo !== null) if(this.dataFilter.titolo !== null)
@@ -0,0 +1,21 @@
define(['app', 'jquery', 'underscore', 'backbone', 'model/lastRicette/lastRicetteModel'],
function (app, $, _, Backbone, LastRicette){
var lastRicette=Backbone.Collection.extend({
profileID: null,
initialize: function (options) {
this.profileID = options.profileID;
},
// Book is the model of the collection
model:LastRicette,
url: function() {
return myManifest.Settings.DefaultURL + "/api/ricette/lastinserted/" + this.profileID;
}
});
return lastRicette;
});
+18
View File
@@ -0,0 +1,18 @@
define(['jquery', 'underscore', 'backbone'],
function($, _, Backbone) {
var LastRicette = Backbone.Model.extend({
//default attributes
defaults: {
ricetta_id: "",
titolo: '',
autore: '',
valutazione: 0,
difficolta: 0,
categoria_name: ''
}
});
return LastRicette;
});
+48 -52
View File
@@ -1,54 +1,50 @@
define(['jquery', 'underscore', 'backbone','text!modules/category/categoryViewTemplate.html', 'text!modules/category/categoryItemTemplate.html', 'modules/base/baseView'], define(['jquery', 'underscore', 'backbone', 'text!modules/category/categoryViewTemplate.html', 'text!modules/category/categoryItemTemplate.html', 'modules/base/baseView'],
function($, _, Backbone, categoryViewTemplate, categoryItemTemplate, BaseView){ function($, _, Backbone, categoryViewTemplate, categoryItemTemplate, BaseView) {
var CategoryView = BaseView.extend({ var CategoryView = BaseView.extend({
collection: null,
categoryName: null,
//initialize template
template: _.template(categoryViewTemplate),
itemtemplate: _.template(categoryItemTemplate),
initialize: function(options) {
var self = this;
CategoryView.__super__.initialize.call(this);
this.collection = options.collection;
this.categoryName = options.categoryName;
this.collection.fetch({
success: function(data, textStatus, jqXHR) {
self.renderItem();
}
//success: function(){ self.renderItem(); }
});
},
renderItem: function() {
var $ul = $('#allRicette');
collection: null, var items = this.itemtemplate({data: this.collection.toJSON()});
categoryName: null,
//initialize template $ul.html(items);
template:_.template(categoryViewTemplate), $ul.listview("refresh");
itemtemplate:_.template(categoryItemTemplate), $ul.trigger("updatelayout");
initialize: function (options) { $.mobile.loading('hide');
var self = this; //$( '[data-alpha="true"]' ).alphascroll();
CategoryView.__super__.initialize.call(this); },
this.collection = options.collection; //render the content into div of view
this.categoryName = options.categoryName; render: function() {
this.collection.fetch({ //this.header.title = "pippo";
success: function(data, textStatus, jqXHR){ CategoryView.__super__.render.call(this);
self.renderItem(); //this.el is the root element of Backbone.View. By default, it is a div.
} //$el is cached jQuery object for the view's element.
//success: function(){ self.renderItem(); } //append the compiled template into view div container
}); this.$el.append(this.header.$el);
}, this.$el.append(this.template({categoryName: this.categoryName}));
this.$el.append(this.footer.$el);
renderItem: function(){ //return to enable chained calls
var $ul = $('#allRicette'); this.$el.find("#indexBtn").addClass("ui-btn-active");
return this;
var items = this.itemtemplate({data:this.collection.toJSON()}); }
});
$ul.html( items ); return CategoryView;
$ul.listview( "refresh" ); });
$ul.trigger( "updatelayout");
$.mobile.loading( 'hide' );
//$( '[data-alpha="true"]' ).alphascroll();
},
//render the content into div of view
render: function(){
//this.header.title = "pippo";
CategoryView.__super__.render.call(this);
//this.el is the root element of Backbone.View. By default, it is a div.
//$el is cached jQuery object for the view's element.
//append the compiled template into view div container
this.$el.append(this.header.$el);
this.$el.append(this.template({ categoryName: this.categoryName }));
this.$el.append(this.footer.$el);
//return to enable chained calls
this.$el.find("#indexBtn").addClass("ui-btn-active");
return this;
}
});
return CategoryView;
});
+21 -3
View File
@@ -1,5 +1,7 @@
define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.html', 'modules/base/baseView', 'classes/profile'], define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.html',
function($, _, Backbone, homeViewTemplate, BaseView, Profile){ 'modules/base/baseView', 'classes/profile', 'classes/utility', 'model/lastRicette/lastRicetteCollection', 'modules/lastricette/lastRicette'],
function($, _, Backbone, homeViewTemplate,
BaseView, Profile, Utility, LastRicetteCollection, LastRicette ){
var HomeView = BaseView.extend({ var HomeView = BaseView.extend({
@@ -12,7 +14,8 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
}, },
events: { events: {
"click #goFbGroup": "goFbGroup" "click #goFbGroup": "goFbGroup",
"click #notifyBtn": "onNotifyBtn"
}, },
goFbGroup: function(){ goFbGroup: function(){
@@ -20,6 +23,14 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
window.location.href = "https://www.facebook.com/groups/732844273469518/"; window.location.href = "https://www.facebook.com/groups/732844273469518/";
}, },
onNotifyBtn:function(){
var lastricette = new LastRicetteCollection();
// will render home view and navigate to homeView
var lastRicetteView=new LastRicette({ collection: lastricette});
//indexView.render();
lastRicetteView.bind('renderCompleted:Categories',Utility.changePage,this);
},
onShowed: function() onShowed: function()
{ {
if(window.localStorage.getItem("goFbGroup") !== "1") if(window.localStorage.getItem("goFbGroup") !== "1")
@@ -38,6 +49,13 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
this.$el.append(this.footer.$el); this.$el.append(this.footer.$el);
this.$el.find("#homeBtn").addClass("ui-btn-active"); this.$el.find("#homeBtn").addClass("ui-btn-active");
var lastNumRicette = Profile.getLastNumRicette();
//if( lastNumRicette > 0)
{
this.$el.find('#notifyBtn').closest('.ui-btn').show();
this.$el.find('#notifyBtn').addClass("notification");
this.$el.find('.circle').text(12);
}
//$("#homeBtn").addClass("ui-btn-active"); //$("#homeBtn").addClass("ui-btn-active");
//return to enable chained calls //return to enable chained calls
return this; return this;
+3 -3
View File
@@ -1,15 +1,15 @@
<div data-role="content"> <div data-role="content">
<div style="text-align: center;"> <div style="text-align: center;">
<% if(profile.data.name){ %> <% if(profile.data.name){ %>
<h2 id="benvenuto">Bentornat<% if(profile.data.gender=="male"){%>o<%}else{%>a<%}%> <h2 id="benvenuto">Bentornat<% if(profile.data.gender=="male"){%>o<%}else{%>a<%}%>
<br><%=profile.data.name %></h2> <br><%=profile.data.name %></h2>
<% } %> <% } %>
<img id="sfondo" src="https://dl.dropboxusercontent.com/s/6qrdp9mbi1rb92k/sfondo.png"> <img id="sfondo" src="https://dl.dropboxusercontent.com/s/6qrdp9mbi1rb92k/sfondo.png">
</div> </div>
</div> </div>
<div data-role="popup" id="nuovoGruppo" data-history="false" data-dismissible="false"> <div data-role="popup" id="nuovoGruppo" data-history="false" data-dismissible="false">
<div data-role="header"><h1>IMPORTANTE</h1></div> <div data-role="header"><h1>IMPORTANTE</h1></div>
    <div role="main" class="ui-content"> <div role="main" class="ui-content">
<p style="text-align: center;font-style: italic;"> <p style="text-align: center;font-style: italic;">
<img src="https://dl.dropboxusercontent.com/s/xnbrbbe7eejkfv2/festa.png"><br><br> <img src="https://dl.dropboxusercontent.com/s/xnbrbbe7eejkfv2/festa.png"><br><br>
Le admin <br><br><b>Alessia, Elena e Francesca</b><br><br>hanno RIFONDATO IL GRUPPO!!<br> Le admin <br><br><b>Alessia, Elena e Francesca</b><br><br>hanno RIFONDATO IL GRUPPO!!<br>
+166 -98
View File
@@ -1,21 +1,18 @@
define(['jquery', 'underscore', 'backbone','text!modules/item/itemViewTemplate.html', 'modules/base/baseView', 'classes/profile'], define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.html', 'modules/base/baseView', 'classes/profile'],
function($, _, Backbone, itemViewTemplate, BaseView, Profile){ function($, _, Backbone, itemViewTemplate, BaseView, Profile) {
var ItemView = BaseView.extend({ var ItemView = BaseView.extend({
collRicetta: null,
collRicetta: null, collIngredienti: null,
collIngredienti: null, fetchedRicetta: false,
fetchedIngredienti: false,
fetchedRicetta: false, //initialize template
fetchedIngredienti: false, template: _.template(itemViewTemplate),
//initialize template initialize: function(options) {
template:_.template(itemViewTemplate), var self = this;
ItemView.__super__.initialize.call(this);
initialize: function (options) { this.collRicetta = options.collRicetta;
var self = this; this.collIngredienti = options.collIngredienti;
ItemView.__super__.initialize.call(this);
this.collRicetta = options.collRicetta;
this.collIngredienti = options.collIngredienti;
this.collRicetta.fetch({success: function() { this.collRicetta.fetch({success: function() {
self.fetchedRicetta = true; self.fetchedRicetta = true;
@@ -26,88 +23,160 @@ define(['jquery', 'underscore', 'backbone','text!modules/item/itemViewTemplate.h
self.render(); self.render();
}}); }});
}, },
events: {
events: { "click #favoriteBtn": "favBtn",
"click #favoriteBtn": "favBtn", "click #optionBtn": "optionBtn",
"click #backBtn": "backBtn" "click #backBtn": "backBtn",
}, "click #scattaPhotoBtn": "scattaPhotoBtn",
"change #cameraFile": "cameraFileChanged",
backBtn:function(e){ "click #uploadPhotoBtn": "uploadPhotoBtn",
e.preventDefault(); "change #galleyFile": "galleyFileChanged"
window.history.back(); },
}, backBtn: function(e) {
e.preventDefault();
favBtn:function(e){ window.history.back();
e.preventDefault(); },
var self = this; optionBtn: function(e) {
var ric = this.collRicetta.toJSON()[0]; e.preventDefault();
var self = this;
if(!Profile.isConnected()) self.$el.find('#optionPopupDialog').popup("open");
{ },
self.$el.find('#popupDialog').popup("open"); scattaPhotoBtn: function(e) {
return; e.preventDefault();
}
Profile.addRicettaBloccoNote(ric.ricetta_id,
function(msg) {
var favBtn = self.$el.find('#favoriteBtn');
favBtn.addClass('ui-disabled');
}
);
},
//render the content into div of view
render: function(){
if(this.fetchedIngredienti && this.fetchedRicetta )
{
ItemView.__super__.render.call(this);
var self = this; var self = this;
var ric = self.collRicetta.toJSON()[0]; if (!Profile.isConnected())
{
self.$el.find('#popupDialog').popup("open");
return;
}
Profile.existRicettaBloccoNote(ric.ricetta_id, $("#cameraFile").click();
function(exist) { },
self.$el.append(self.template({ uploadPhotoBtn: function(e) {
ricetta: self.collRicetta.toJSON()[0], e.preventDefault();
ingredienti: self.collIngredienti.toJSON() var self = this;
}));
self.$arrayContent = self.$el.find('div[data-role="content"]'); if (!Profile.isConnected())
self.$arrayNavBar = self.$el.find('div[data-role="navbar"] a'); {
self.$el.find('#popupDialog').popup("open");
return;
}
var favBtn = self.$el.find('#favoriteBtn'); $("#galleyFile").click();
if(exist > 0) },
favBtn.addClass('ui-disabled'); loadPhoto: function(objInputFile){
var self = this;
self.$el.find('#optionPopupDialog').popup("close");
$.mobile.loading( "show", {
text: "Caricamento immagine in corso...",
textVisible: true,
theme: "a",
textonly: false
});
var ric = this.collRicetta.toJSON()[0];
self.$arrayNavBar.on("click", function(e){ var data = new FormData();
e.preventDefault(); data.append("ricetta_id", ric.ricetta_id);
var index = jQuery.inArray( this , self.$arrayNavBar); data.append("image", objInputFile[0].files[0]);
self.goToContent(index); data.append("keyStore", Profile.getKeySave());
});
self.$arrayContent.on("swipeleft", function(e) { $.ajax({
var index = jQuery.inArray(this, self.$arrayContent); url: myManifest.Settings.DefaultURL + "/api/photos",
self.goToContent(index + 1 ); cache: false,
}); contentType: false,
self.$arrayContent.on("swiperight", function(e) { processData: false,
var index = jQuery.inArray(this, self.$arrayContent); type: 'POST',
self.goToContent(index - 1 ); data: data,
}); success: function(msg) {
self.trigger("renderCompleted:Item",self); $.mobile.loading( "hide" );
alert("Immagine inviata con successo\n\nSarà cura degl'admin di validare la foto inviata");
objInputFile.val("");
} }
});
},
galleyFileChanged: function(e) {
e.preventDefault();
this.loadPhoto($("#galleyFile"));
},
cameraFileChanged: function(e) {
e.preventDefault();
this.loadPhoto($("#cameraFile"));
},
favBtn: function(e) {
e.preventDefault();
var self = this;
var ric = this.collRicetta.toJSON()[0];
if (!Profile.isConnected())
{
self.$el.find('#popupDialog').popup("open");
return;
}
Profile.addRicettaBloccoNote(ric.ricetta_id,
function(msg) {
var favBtn = self.$el.find('#favoriteBtn');
favBtn.addClass('ui-disabled');
}
); );
},
//render the content into div of view
render: function() {
if (this.fetchedIngredienti && this.fetchedRicetta)
{
ItemView.__super__.render.call(this);
var self = this;
var ric = self.collRicetta.toJSON()[0];
Profile.existRicettaBloccoNote(ric.ricetta_id,
function(exist) {
self.$el.append(self.template({
ricetta: self.collRicetta.toJSON()[0],
ingredienti: self.collIngredienti.toJSON()
}));
self.$arrayContent = self.$el.find('div[data-role="content"]');
self.$arrayNavBar = self.$el.find('div[data-role="navbar"] a');
var favBtn = self.$el.find('#favoriteBtn');
if (exist > 0)
favBtn.addClass('ui-disabled');
self.$arrayNavBar.on("click", function(e) {
e.preventDefault();
var index = jQuery.inArray(this, self.$arrayNavBar);
self.goToContent(index);
});
self.$arrayContent.on("swipeleft", function(e) {
var index = jQuery.inArray(this, self.$arrayContent);
self.goToContent(index + 1 );
});
self.$arrayContent.on("swiperight", function(e) {
var index = jQuery.inArray(this, self.$arrayContent);
self.goToContent(index - 1 );
});
// self.$arrayContent.on("tap", function(e) {
// self.optionBtn(e);
// });
self.trigger("renderCompleted:Item", self);
}
);
//this.el is the root element of Backbone.View. By default, it is a div. //this.el is the root element of Backbone.View. By default, it is a div.
//$el is cached jQuery object for the view's element. //$el is cached jQuery object for the view's element.
//append the compiled template into view div container //append the compiled template into view div container
//return to enable chained calls //return to enable chained calls
return this; return this;
} }
}, },
goToContent: function(newIndex)
goToContent:function(newIndex)
{ {
if(this.$arrayContent.length > newIndex && newIndex >= 0) if(this.$arrayContent.length > newIndex && newIndex >= 0)
{ {
@@ -115,15 +184,14 @@ define(['jquery', 'underscore', 'backbone','text!modules/item/itemViewTemplate.h
this.switchContent(); this.switchContent();
} }
}, },
switchContent: function() {
switchContent: function(){ this.$arrayContent.hide();
this.$arrayContent.hide(); this.$arrayNavBar.removeClass('ui-btn-active');
this.$arrayNavBar.removeClass('ui-btn-active'); this.$arrayNavBar.removeClass('ui-state-persist');
this.$arrayNavBar.removeClass('ui-state-persist'); $(this.$arrayContent[this.indexContent]).show();
$(this.$arrayContent[this.indexContent]).show(); $(this.$arrayNavBar[this.indexContent]).addClass('ui-btn-active');
$(this.$arrayNavBar[this.indexContent]).addClass('ui-btn-active'); $(this.$arrayNavBar[this.indexContent]).addClass('ui-state-persist');
$(this.$arrayNavBar[this.indexContent]).addClass('ui-state-persist'); }
} });
}); return ItemView;
return ItemView; });
});
+14 -2
View File
@@ -1,7 +1,7 @@
<div data-role="header" data-position="fixed" data-tap-toggle="false"> <div data-role="header" data-position="fixed" data-tap-toggle="false">
<a id="favoriteBtn" href="" data-role="button" class="ui-btn-left" data-icon="custom" style="font-size: x-small;">Agg. al Blocco</a> <a id="optionBtn" href="" class="ui-btn ui-icon-withoutCorner ui-btn-icon-notext"></a>
<h3 id='titoloRicetta'><%= unescape(ricetta.titolo)%></h3> <h3 id='titoloRicetta'><%= unescape(ricetta.titolo)%></h3>
<a id="backBtn" href="" data-role="button" class="ui-btn-right" data-icon="custom">Indietro</a> <a id="backBtn" href="" class="ui-btn ui-icon-withoutCorner ui-btn-icon-notext">Indietro</a>
</div> </div>
<div id="contentIngredienti" data-role="content"> <div id="contentIngredienti" data-role="content">
<h1>Ingredienti</h1> <h1>Ingredienti</h1>
@@ -46,6 +46,18 @@
<h1 id="linkFonte" style="padding: 0px;"><a target="_blank" href="<%= ricetta.link_fonte%>">Link Fonte</a></h1> <h1 id="linkFonte" style="padding: 0px;"><a target="_blank" href="<%= ricetta.link_fonte%>">Link Fonte</a></h1>
<% }%> <% }%>
</div> </div>
<div data-role="popup" id="optionPopupDialog">
<div data-role="header">
<h1>Opzioni</h1>
</div>
<div role="main" class="ui-content">
<a id="favoriteBtn" href="" class="ui-btn ui-icon-withoutCorner ui-btn-icon-left">Agg. al Blocco</a>
<a id="scattaPhotoBtn" href="" class="ui-btn ui-icon-withoutCorner ui-btn-icon-left">Scatta Foto</a>
<a id="uploadPhotoBtn" href="" class="ui-btn ui-icon-withoutCorner ui-btn-icon-left">Carica Foto</a>
<input id="cameraFile" type="file" accept="image/*" capture style="position:absolute; top:-100px; visibility: hidden;">
<input id="galleyFile" type="file" accept="image/*" style="position:absolute; top:-100px; visibility: hidden;">
</div>
</div>
<div data-role="popup" id="popupDialog"> <div data-role="popup" id="popupDialog">
<div data-role="header"> <div data-role="header">
<h1>Informazione</h1> <h1>Informazione</h1>
+49
View File
@@ -0,0 +1,49 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/lastRicette/lastRicetteViewTemplate.html',
'text!modules/lastRicette/lastRicetteItemTemplate.html', 'modules/base/baseView'],
function($, _, Backbone, lastRicetteViewTemplate, lastRicetteItemTemplate, BaseView) {
var LastRicetteView = BaseView.extend({
collection: null,
//initialize template
template: _.template(lastRicetteViewTemplate),
itemtemplate: _.template(lastRicetteItemTemplate),
initialize: function(options) {
var self = this;
LastRicetteView.__super__.initialize.call(this);
this.collection = options.collection;
this.collection.fetch({
success: function(data, textStatus, jqXHR) {
self.renderItem();
}
//success: function(){ self.renderItem(); }
});
},
renderItem: function() {
var $ul = $('#allRicette');
var items = this.itemtemplate({data: this.collection.toJSON()});
$ul.html(items);
$ul.listview("refresh");
$ul.trigger("updatelayout");
$.mobile.loading('hide');
//$( '[data-alpha="true"]' ).alphascroll();
},
//render the content into div of view
render: function() {
//this.header.title = "pippo";
LastRicetteView.__super__.render.call(this);
//this.el is the root element of Backbone.View. By default, it is a div.
//$el is cached jQuery object for the view's element.
//append the compiled template into view div container
this.$el.append(this.header.$el);
this.$el.append(this.template());
this.$el.append(this.footer.$el);
//return to enable chained calls
//this.$el.find("#indexBtn").addClass("ui-btn-active");
return this;
}
});
return LastRicetteView;
});
@@ -0,0 +1,6 @@
<% if(data.length == 0){ %>
<h1>Nessuna ricetta trovata</h1>
<%} else { for (var i = 0; i < data.length; i++) { %>
<% var item = data[i]; %>
<li><a href="#ricetta/<%= item.ricetta_id%>" class="ui-btn ui-btn-icon-right ui-icon-carat-r"><div class='ricettaTitolo'><%= unescape(item.titolo) %></div><div class='ricettaAutore'><%= unescape(item.autore) %></div></a></li>
<% }} %>
@@ -0,0 +1,5 @@
<div id="lastRicetteListContent" data-role="content">
<h1>Ultime Ricette Inserite</h1>
<ul id="allRicette" data-role="listview" data-autodividers="true" data-alpha="true" data-inset="true">
</ul>
</div>
+173 -194
View File
@@ -1,203 +1,182 @@
define(['jquery', 'underscore', 'backbone', define(['jquery', 'underscore', 'backbone',
'modules/home/home', 'modules/faq/faq', 'modules/index/index', 'modules/category/category', 'modules/item/item', 'modules/home/home','modules/faq/faq','modules/index/index', 'modules/category/category', 'modules/item/item',
'modules/about/about', 'modules/search/search', 'modules/search/found', 'modules/more/more', 'modules/note/note', 'modules/about/about', 'modules/search/search', 'modules/search/found', 'modules/more/more', 'modules/note/note',
'modules/sync/sync', 'modules/converter/converter', 'modules/donation/donation', 'modules/settings/settings', 'modules/sync/sync', 'modules/donation/donation','modules/settings/settings',
'model/note/noteCollection', 'model/category/categoryCollection', 'model/categoryItem/categoryItemCollection', 'model/note/noteCollection', 'model/category/categoryCollection','model/categoryItem/categoryItemCollection',
'model/item/itemCollection', 'model/item/ingredientiCollection', 'model/categoryItem/foundItemCollection', 'model/item/itemCollection','model/item/ingredientiCollection','model/categoryItem/foundItemCollection',
'libs/fastclick', 'jqm', 'jQueryPlugins'], 'classes/utility', 'jqm', 'jQueryPlugins'],
function ($, _, Backbone, function($, _, Backbone,
HomeView, FaqView, IndexView, CategoryView, ItemView, HomeView, FaqView, IndexView, CategoryView, ItemView,
AboutView, SearchView, FoundView, MoreView, NoteView, AboutView, SearchView, FoundView, MoreView, NoteView,
SyncView, ConverterView, DonationView, SettingsView, SyncView, DonationView, SettingsView,
NoteCollection, CategoryCollection, CategoryItemCollection, NoteCollection, CategoryCollection, CategoryItemCollection,
ItemCollection, IngredientiCollection, FoundItemCollection, ItemCollection, IngredientiCollection, FoundItemCollection,
FastClick) { Utility) {
'use strict';
var Router = Backbone.Router.extend({
//define routes and mapping route to the function
routes: {
'': 'showHome', //home view
'homeView': 'showHome', //home view as well
'faqView': 'showFaq', //home view as well
'indexView': 'showIndex', //home view as well
'category/:categoryName/:categoryId' : 'showCategory',
'ricetta/:itemId' : 'showItem',
'aboutView' : 'showAbout',
'syncView(/)*founded' : 'showSync',
'noteView': 'showNote',
'searchView': 'showSearch',
'settingsView': 'showSettings',
'donationView': 'showDonation',
'search/:nresult/:categoria/:difficolta/*titolo': 'searchFn',
'converterView': 'showConverter',
'moreView': 'showMore',
'*actions': 'defaultAction' //default action
},
defaultAction: function(actions){
this.showHome(actions);
},
'use strict'; showHome:function(actions){
var Router = Backbone.Router.extend({ // will render home view and navigate to homeView
//define routes and mapping route to the function var homeView=new HomeView();
routes: { homeView.render();
'': 'showHome', //home view this.changePage(homeView);
'homeView': 'showHome', //home view as well },
'faqView': 'showFaq', //home view as well
'indexView': 'showIndex', //home view as well
'category/:categoryName/:categoryId': 'showCategory',
'ricetta/:itemId': 'showItem',
'aboutView': 'showAbout',
'syncView(/)*founded': 'showSync',
'noteView': 'showNote',
'searchView': 'showSearch',
'settingsView': 'showSettings',
'donationView': 'showDonation',
'search/:nresult/:categoria/:difficolta/*titolo': 'searchFn',
'converterView': 'showConverter',
'moreView': 'showMore',
'*actions': 'defaultAction' //default action
},
defaultAction: function (actions) {
this.showHome(actions);
},
showHome: function (actions) {
// will render home view and navigate to homeView
var homeView = new HomeView();
homeView.render();
this.changePage(homeView);
},
showSettings: function (actions) {
var settingsView = new SettingsView();
settingsView.render();
this.changePage(settingsView);
},
showDonation: function (actions) {
var donationView = new DonationView();
donationView.render();
this.changePage(donationView);
},
showAbout: function (actions) {
// will render home view and navigate to homeView
var aboutView = new AboutView();
aboutView.render();
this.changePage(aboutView);
},
showSync: function (actions) {
var option = {};
if (actions)
{
option = {tokenFound: 1};
}
// will render home view and navigate to homeView
var syncView = new SyncView(option);
syncView.render();
this.changePage(syncView);
},
showNote: function (actions) {
var notes = new NoteCollection();
// will render home view and navigate to homeView
var noteView = new NoteView({collection: notes});
noteView.render();
this.changePage(noteView);
},
showFaq: function (actions) {
// will render home view and navigate to homeView
var faqView = new FaqView();
faqView.render();
this.changePage(faqView);
},
showIndex: function (actions) {
var categories = new CategoryCollection();
// will render home view and navigate to homeView
var indexView = new IndexView({collection: categories});
//indexView.render();
indexView.bind('renderCompleted:Categories', this.changePage, this);
},
showCategory: function (categoryName, categoryId) {
var categories = new CategoryItemCollection({categoryId: categoryId});
// will render home view and navigate to homeView
var categoryView = new CategoryView({categoryName: categoryName, collection: categories});
categoryView.render(); showSettings:function(actions){
this.changePage(categoryView); var settingsView=new SettingsView();
settingsView.render();
this.changePage(settingsView);
},
$.mobile.loading('show', { showDonation:function(actions){
text: 'Caricamento categoria ' + categoryName + '...', var donationView=new DonationView();
textVisible: true, donationView.render();
//theme: 'z', this.changePage(donationView);
html: "" },
});
//categoryView.bind('renderCompleted:Category',this.changePage,this); showAbout:function(actions){
}, // will render home view and navigate to homeView
showItem: function (itemId) { var aboutView=new AboutView();
var item = new ItemCollection({ricettaId: itemId}); aboutView.render();
var ingr = new IngredientiCollection({ricettaId: itemId}); this.changePage(aboutView);
// will render home view and navigate to homeView },
var itemView = new ItemView({
collRicetta: item,
collIngredienti: ingr
});
//indexView.render();
itemView.bind('renderCompleted:Item', this.changePage, this);
},
showConverter: function () {
var converterView = new ConverterView();
converterView.render();
this.changePage(converterView);
},
showMore: function () {
var moreView = new MoreView();
moreView.render();
this.changePage(moreView);
},
showSearch: function () {
var categories = new CategoryCollection();
// will render home view and navigate to homeView
var searchView = new SearchView({collection: categories});
//indexView.render();
searchView.bind('renderCompleted:Search', this.changePage, this);
},
searchFn: function (nresult, categoria, difficolta, titolo) {
//console.log("Search by Titolo: " + titolo + ", Categoria: " + categoria + ", Difficoltà: " + difficolta); showSync:function(actions){
var foundedItems = new FoundItemCollection({categoryId: categoria, difficolta: difficolta, titolo: titolo, nResult: nresult}); var option = {};
var foundView = new FoundView({collection: foundedItems}); if(actions)
{
option = { tokenFound: 1 };
}
// will render home view and navigate to homeView
var syncView=new SyncView(option);
syncView.render();
this.changePage(syncView);
},
foundView.render(); showNote:function(actions){
this.changePage(foundView); var notes = new NoteCollection();
// will render home view and navigate to homeView
$.mobile.loading('show', { var noteView=new NoteView({collection: notes});
text: 'Caricamento ricerca ricette...', noteView.render();
textVisible: true, this.changePage(noteView);
//theme: 'z', },
html: ""
}); showFaq:function(actions){
}, // will render home view and navigate to homeView
init: true, var faqView=new FaqView();
//1. changePage will insert view into DOM and then call changePage to enhance and transition faqView.render();
//2. for the first page, jQuery mobile will present and enhance automatically this.changePage(faqView);
//3. for the other page, we will call $.mobile.changePage() to enhance page and make transition },
//4. argument 'view' is passed from event trigger
changePage: function (view) { showIndex:function(actions){
var categories = new CategoryCollection();
//append to dom // will render home view and navigate to homeView
$('body').append(view.$el); var indexView=new IndexView({ collection: categories});
//indexView.render();
$.mobile.pageContainer.pagecontainer("change", $(view.el), {changeHash: false}); indexView.bind('renderCompleted:Categories',this.changePage,this);
},
FastClick.attach(document.body);
showCategory: function(categoryName, categoryId){
$(":jqmData(role='page'):last").on("pageshow", function (event) { var categories = new CategoryItemCollection({ categoryId: categoryId });
if (view.onShowed !== null) // will render home view and navigate to homeView
view.onShowed(); var categoryView=new CategoryView({ categoryName: categoryName, collection: categories});
});
categoryView.render();
$('input[type=radio].star').rating({ this.changePage(categoryView);
callback: function (value, link) {
var tip = $('#hover-test'); $.mobile.loading( 'show', {
if (value == undefined) text: 'Caricamento categoria ' + categoryName + '...',
{ textVisible: true,
$('#hover-test').html("Nessuna" || 'value: '); //theme: 'z',
} html: ""
else
$('#hover-test').html(link.title || 'value: ' + value);
},
focus: function (value, link) {
var tip = $('#hover-test');
tip[0].data = tip[0].data || tip.html();
tip.html(link.title || 'value: ' + value);
}
// ,
// blur: function(value, link){
// var tip = $('#hover-test');
// $('#hover-test').html(tip[0].data || '');
// }
});
if (!this.init) {
} else {
this.init = false;
}
}
}); });
//categoryView.bind('renderCompleted:Category',this.changePage,this);
},
showItem: function(itemId){
var item = new ItemCollection({ ricettaId: itemId });
var ingr = new IngredientiCollection({ ricettaId: itemId });
// will render home view and navigate to homeView
var itemView=new ItemView({
collRicetta: item,
collIngredienti: ingr
});
//indexView.render();
itemView.bind('renderCompleted:Item',this.changePage,this);
},
return Router; showMore: function(){
}); var moreView = new MoreView();
moreView.render();
this.changePage(moreView);
},
showSearch: function(){
var categories = new CategoryCollection();
// will render home view and navigate to homeView
var searchView=new SearchView({ collection: categories});
//indexView.render();
searchView.bind('renderCompleted:Search',this.changePage,this);
},
searchFn: function(nresult, categoria, difficolta, titolo){
//console.log("Search by Titolo: " + titolo + ", Categoria: " + categoria + ", Difficoltà: " + difficolta);
var foundedItems = new FoundItemCollection({ categoryId: categoria, difficolta: difficolta, titolo: titolo, nResult:nresult });
var foundView = new FoundView({ collection: foundedItems });
foundView.render();
this.changePage(foundView);
$.mobile.loading( 'show', {
text: 'Caricamento ricerca ricette...',
textVisible: true,
//theme: 'z',
html: ""
});
},
init:true,
//1. changePage will insert view into DOM and then call changePage to enhance and transition
//2. for the first page, jQuery mobile will present and enhance automatically
//3. for the other page, we will call $.mobile.changePage() to enhance page and make transition
//4. argument 'view' is passed from event trigger
changePage:function (view) {
Utility.changePage(view);
if(!this.init){
}else{
this.init = false;
}
}
});
return Router;
});
+2
View File
@@ -1 +1,3 @@
browser=Chrome.INTEGRATED browser=Chrome.INTEGRATED
external.project.url=
server=INTERNAL
+13 -1
View File
@@ -2,6 +2,18 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/> <group>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/manifest.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/config.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/modules/lastricette/lastRicetteViewTemplate.html</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/router.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/app.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/classes/profile.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/jqm-config.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/modules/lastricette/lastRicette.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/main.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/modules/home/home.js</file>
<file>file:/E:/Sviluppo/IlLievitario/WebClient/js/modules/lastricette/lastRicetteItemTemplate.html</file>
</group>
</open-files> </open-files>
</project-private> </project-private>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<system systemId="http://www.sitemaps.org/schemas/sitemap/0.9" uri="www.sitemaps.org/schemas/sitemap/0.9/index"/>
</catalog>
@@ -0,0 +1,3 @@
<html><head><title>www.sitemaps.org - /schemas/sitemap/0.9/</title></head><body><H1>www.sitemaps.org - /schemas/sitemap/0.9/</H1><hr>
<pre><A HREF="/schemas/sitemap/">[To Parent Directory]</A><br><br> 2/1/2013 8:18 PM 2591 <A HREF="/schemas/sitemap/0.9/siteindex.xsd">siteindex.xsd</A><br> 2/1/2013 8:19 PM 4451 <A HREF="/schemas/sitemap/0.9/sitemap.xsd">sitemap.xsd</A><br></pre><hr></body></html>
+16 -2
View File
@@ -1,3 +1,17 @@
file.reference.IlLievitario-WebClient_210=. auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options=
auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false
auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css
auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options=
auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false
auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css
auxiliary.org-netbeans-modules-javascript2-requirejs.enabled=true
auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=app-build_prod/libs
browser.autorefresh.SL[/Browsers/webviewBrowser=true
browser.highlightselection.SL[/Browsers/webviewBrowser=true
config.folder=
file.reference.IlLievitario-WebClient=.
files.encoding=UTF-8 files.encoding=UTF-8
site.root.folder=${file.reference.IlLievitario-WebClient_210} site.root.folder=${file.reference.IlLievitario-WebClient}
start.file=index.php
test.folder=
web.context.root=/WebClient
+1 -1
View File
@@ -3,7 +3,7 @@
<type>org.netbeans.modules.web.clientproject</type> <type>org.netbeans.modules.web.clientproject</type>
<configuration> <configuration>
<data xmlns="http://www.netbeans.org/ns/clientside-project/1"> <data xmlns="http://www.netbeans.org/ns/clientside-project/1">
<name>WebClient_Manut</name> <name>Il Lievitario</name>
</data> </data>
</configuration> </configuration>
</project> </project>
+21 -20
View File
@@ -1,5 +1,5 @@
/** /**
* @license r.js 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. * @license r.js 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license. * Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details * see: http://github.com/jrburke/requirejs for details
*/ */
@@ -20,7 +20,7 @@ var requirejs, require, define, xpcUtil;
(function (console, args, readFileFunc) { (function (console, args, readFileFunc) {
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire, var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci, nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
version = '2.1.14', version = '2.1.15',
jsSuffixRegExp = /\.js$/, jsSuffixRegExp = /\.js$/,
commandOption = '', commandOption = '',
useLibLoaded = {}, useLibLoaded = {},
@@ -238,7 +238,7 @@ var requirejs, require, define, xpcUtil;
} }
/** vim: et:ts=4:sw=4:sts=4 /** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. * @license RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license. * Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details * see: http://github.com/jrburke/requirejs for details
*/ */
@@ -251,7 +251,7 @@ var requirejs, require, define, xpcUtil;
(function (global) { (function (global) {
var req, s, head, baseElement, dataMain, src, var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath, interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.14', version = '2.1.15',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/, jsSuffixRegExp = /\.js$/,
@@ -22949,7 +22949,7 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
//Like traverse, but skips if branches that would not be processed //Like traverse, but skips if branches that would not be processed
//after has application that results in tests of true or false boolean //after has application that results in tests of true or false boolean
//literal values. //literal values.
var key, child, result, i, params, param, var key, child, result, i, params, param, tempObject,
hasHas = options && options.has; hasHas = options && options.has;
fnExpScope = fnExpScope || emptyScope; fnExpScope = fnExpScope || emptyScope;
@@ -22979,23 +22979,23 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
//Build up a "scope" object that informs nested recurse calls if //Build up a "scope" object that informs nested recurse calls if
//the define call references an identifier that is likely a UMD //the define call references an identifier that is likely a UMD
//wrapped function expresion argument. //wrapped function expression argument.
if (object.type === 'ExpressionStatement' && object.expression && if (object.type === 'ExpressionStatement' && object.expression &&
object.expression.type === 'CallExpression' && object.expression.callee && object.expression.type === 'CallExpression' && object.expression.callee &&
object.expression.callee.type === 'FunctionExpression') { object.expression.callee.type === 'FunctionExpression') {
object = object.expression.callee; tempObject = object.expression.callee;
if (object.params && object.params.length) { if (tempObject.params && tempObject.params.length) {
params = object.params; params = tempObject.params;
fnExpScope = mixin({}, fnExpScope, true); fnExpScope = mixin({}, fnExpScope, true);
for (i = 0; i < params.length; i++) { for (i = 0; i < params.length; i++) {
param = params[i]; param = params[i];
if (param.type === 'Identifier') { if (param.type === 'Identifier') {
fnExpScope[param.name] = true; fnExpScope[param.name] = true;
}
} }
} }
} }
}
for (key in object) { for (key in object) {
if (object.hasOwnProperty(key)) { if (object.hasOwnProperty(key)) {
@@ -23014,12 +23014,12 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
//wrapping. //wrapping.
if (typeof result === 'string') { if (typeof result === 'string') {
if (hasProp(fnExpScope, result)) { if (hasProp(fnExpScope, result)) {
//Just a plain return, parsing can continue past this //result still in scope, keep jumping out indicating the
//point. //identifier still in use.
return; return result;
} }
return result; return;
} }
} }
}; };
@@ -26539,7 +26539,8 @@ define('build', function (require) {
"excludeShallow": true, "excludeShallow": true,
"insertRequire": true, "insertRequire": true,
"stubModules": true, "stubModules": true,
"deps": true "deps": true,
"mainConfigFile": true
}; };
for (i = 0; i < ary.length; i++) { for (i = 0; i < ary.length; i++) {
+63
View File
@@ -0,0 +1,63 @@
<?php
/**
* XML Sitemap PHP Script
* For more info, see: http://yoast.com/xml-sitemap-php-script/
* Copyright (C), 2011 - 2012 - Joost de Valk, [email protected]
*/
// inclusione del file contenente la classe
require_once "./Service/MySqlClass.php";
require_once "./Service/utility.php";
// Get the keys so we can check quickly
// Sent the correct header so browsers display properly, with or without XSL.
header( 'Content-Type: application/xml' );
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
$url = "http://app.gruppolapastamadre.it/";
$blog_timezone = 'UTC';
$timezone_offset = '+01:00';
$W3C_datetime_format_php = 'Y-m-d\Th:i:s'; // See http://www.w3.org/TR/NOTE-datetime
function dinamicSite() {
global $url, $blog_timezone, $timezone_offset, $W3C_datetime_format_php;
$mysqlconnetion = new MysqlClass;
//$mysqlconneti on->connetti();
$retObj = $mysqlconnetion->queryToObject("select ID as category_id, NAME as name from categorie order by name");
foreach ($retObj as $key => $value)
{
$catStr = "#category/". $value["name"] ."/" . $value["category_id"];
$lastModified = $mysqlconnetion->queryToObject("select MAX(Data_creazione) as lastModified from ricette where ID_CATEGORIA = ". $value["category_id"]);
$date = DateTime::createFromFormat('Y-m-d H:i:s', $lastModified[0]["lastModified"], new DateTimeZone("Europe/Rome"));
$lastDate = date_format($date, $W3C_datetime_format_php) . $timezone_offset;
?>
<url>
<loc><?php echo $url . $catStr; ?></loc>
<lastmod><?php echo $lastDate; ?></lastmod>
</url><?php
$query = "select ID as ricetta_id, titolo from ricette where ID_CATEGORIA = " . $value["category_id"] . " order by titolo, autore";
$ricItems = $mysqlconnetion->queryToObject($query);
foreach ($ricItems as $keyRic => $valueRic)
{
$itemStr= "#ricetta/" . $valueRic["ricetta_id"];
?>
<url>
<loc><?php echo $url . $itemStr; ?></loc>
</url><?php
}
}
$mysqlconnetion->disconnetti();
}
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><?php
dinamicSite();
?>
</urlset>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://app.gruppolapastamadre.it/</loc>
<lastmod>2014-04-09</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://app.gruppolapastamadre.it/</loc>
<lastmod>2014-04-09</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>