From 8ba6571a7b6d02fff8f9a6d3f640404a4fe4535e Mon Sep 17 00:00:00 2001 From: hexstudy Date: Sun, 6 Mar 2016 22:02:12 +0000 Subject: [PATCH] git-svn-id: https://msi/svn/firstRepo/WebClient/branches/Manut_3.0.1@77 0f545695-f87b-41b6-9a03-7f16563b5454 --- .htaccess | 21 +++++---- index.php | 35 ++------------- js/manifest.js | 3 +- js/modules/home/home.js | 16 +++++-- js/modules/home/homeViewTemplate.html | 16 +++---- js/modules/settings/settings.js | 45 ++++++++++++++++++- js/modules/settings/settingsViewTemplate.html | 1 + js/router.js | 8 ++-- 8 files changed, 87 insertions(+), 58 deletions(-) diff --git a/.htaccess b/.htaccess index 255e99e..73e5cec 100644 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,4 @@ -AddHandler application/x-httpd-php .html .htm +#AddHandler application/x-httpd-php .html .htm mod_gzip_on Yes mod_gzip_dechunk Yes @@ -24,13 +24,18 @@ AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/r RewriteEngine On - RewriteRule ^index.html$ index.php [L] - RewriteRule ^js/libs/(.*)\.[0-9]+\.js$ /WebClient_Manut/js/libs/$1.js [L] - RewriteRule ^js/(.*)\.[0-9]+\.js$ /WebClient_Manut/js/$1.js [L] - RewriteRule ^css/(.*)\.[0-9]+\.css$ /WebClient_Manut/css/$1.css [L] - RewriteRule ^Resources/img/(.*)\.[0-9]+\.png$ /WebClient_Manut/Resources/img/$1.png [L] - RewriteRule ^Resources/img/(.*)\.[0-9]+\.gif$ /WebClient_Manut/Resources/img/$1.gif [L] - RewriteRule ^Resources/icons/(.*)\.[0-9]+\.png$ /WebClient_Manut/Resources/icons/$1.png [L] + RewriteBase / + #RewriteRule ^index.html$ index.php [L] + RewriteRule ^.*js/libs/(.*)\.[0-9]+\.js$ /WebClient_Manut/js/libs/$1.js [L] + RewriteRule ^.*js/(.*)\.[0-9]+\.js$ /WebClient_Manut/js/$1.js [L] + RewriteRule ^r.*/.*js/(.*).js$ /WebClient_Manut/js/$1.js [L] + RewriteRule ^r.*/.*js/(.*).html$ /WebClient_Manut/js/$1.html [L] + RewriteRule ^.*css/(.*)\.[0-9]+\.css$ /WebClient_Manut/css/$1.css [L] + RewriteRule ^r.*/.*css/(.*).gif$ /WebClient_Manut/css/$1.gif [L] + #RewriteRule ^/Resources/img/(.*)\.[0-9]+\.png$ /WebClient_Manut/Resources/img/$1.png [L] + #RewriteRule ^/Resources/img/(.*)\.[0-9]+\.gif$ /WebClient_Manut/Resources/img/$1.gif [L] + #RewriteRule ^/Resources/icons/(.*)\.[0-9]+\.png$ /WebClient_Manut/Resources/icons/$1.png [L] + RewriteRule ^r(.*)/$ /WebClient_Manut/index.php?ricetta=$1 [L] diff --git a/index.php b/index.php index 8e1c5bb..1baaf56 100644 --- a/index.php +++ b/index.php @@ -12,41 +12,12 @@ -queryToObject($query); - $ogFbTitle = html_entity_decode($retObj[0]["titolo"], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'); - $ogFbTitle = $ogFbTitle . " di " . html_entity_decode($retObj[0]["autore"], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'); - $ogFbDescription = substr(html_entity_decode($retObj[0]["procedimento"], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'), 0, 30); - } + $ogFbDescription = "Ricettario web del il Gruppo la pasta madre"; ?> diff --git a/js/manifest.js b/js/manifest.js index 29c3604..fef4a7f 100644 --- a/js/manifest.js +++ b/js/manifest.js @@ -1,9 +1,10 @@ var myManifest = { Debug: (window.location.port !== ""), Name: "Il Lievitario", - Version: "3.0.3.8", + Version: "3.0.4.1", Author: "Denis Ironi", Settings: { + ShowStartMessage: true, DefaultURL: (window.location.port === "" ? "http://" + window.location.host + "/Service": "http://" + window.location.hostname + ":" + window.location.port + "/Service_Manut"), JQueryVersion: "1.11.1", JQueryMobileVersion: "1.4.5", diff --git a/js/modules/home/home.js b/js/modules/home/home.js index ad4e59a..1357405 100644 --- a/js/modules/home/home.js +++ b/js/modules/home/home.js @@ -23,10 +23,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate. } }, events: { + "click #noSpacc": "noSpacc", }, freeWall: null, + noSpacc: function(){ + window.localStorage.setItem("noSpacc", 1); + }, + calculateSize: function(){ var size = 100; var widthDevice = (window.innerWidth > 0) ? window.innerWidth : screen.width; @@ -125,8 +130,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate. } }); this.freeWall.fitWidth(); - }, - + }, onShowed: function () { var self = this; @@ -137,7 +141,13 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate. { this.changePicture(Profile.data.picture); } - + if(myManifest.Settings.ShowStartMessage && + Profile.data.isSpacc === "0" && + window.localStorage.getItem("noSpacc") === null) + { + this.$el.find("#nomeUtente").text(Profile.data.name); + this.$el.find("#messaggioSpacciatore").popup("open"); + } //Debug.writeMessage(myManifest.Agent.ua); }, onClosing: function () { diff --git a/js/modules/home/homeViewTemplate.html b/js/modules/home/homeViewTemplate.html index 905c282..4f4588d 100644 --- a/js/modules/home/homeViewTemplate.html +++ b/js/modules/home/homeViewTemplate.html @@ -46,19 +46,15 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/js/modules/settings/settings.js b/js/modules/settings/settings.js index a97b08d..d74a02c 100644 --- a/js/modules/settings/settings.js +++ b/js/modules/settings/settings.js @@ -6,10 +6,12 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe //initialize template template:_.template(settingsViewTemplate), _flagSave: false, + activateTab: 0, - initialize: function () { + initialize: function (tab) { var self = this; this.id = "SettingsView"; + this.activateTab = tab; SettingsView.__super__.initialize.call(this); }, @@ -133,8 +135,45 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe }); } }, + onShowing: function (){ + if (!Profile.isConnected()) { + $('h1').hide(); + $('[data-role="tabs"]').hide(); + $('#saveBtn').hide(); + return; + } + if(this.activateTab === "1"){ + var contents = this.$el.find('div[data-role="tabs"] > .ui-content'); + var navbars = this.$el.find('div[data-role="navbar"] a'); + $(contents[0]).hide(); + $(navbars[0]).removeClass('ui-btn-active'); + $(navbars[0]).removeClass('ui-state-persist'); + + $(contents[1]).show(); + $(navbars[1]).addClass('ui-btn-active'); + $(navbars[1]).addClass('ui-state-persist'); + } + }, onShowed: function(){ var self = this; + + if(this.activateTab === "1"){ + + var intervalID = setInterval(function(){ + $('[for="spacc-PMChk"]').attr("style", "border: 4px red solid; border-style: dashed;"); + }, 500); + + var intervalID2 = setInterval(function(){ + $('[for="spacc-PMChk"]').attr("style", "border: 4px red solid; border-style: solid;"); + }, 1000); + + setTimeout(function(){ + clearInterval(intervalID); + clearInterval(intervalID2); + $('[for="spacc-PMChk"]').attr("style", ""); + }, 5000); + } + if(Profile.data.isSpacc==="0"){ this.$el.find('#mapSpacc > :not(.ui-checkbox:has(#spacc-PMChk))').hide(); } @@ -218,6 +257,10 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe this.$el.append(this.template()); this.$el.append(this.footer.$el); } + + var navbars = this.$el.find('div[data-role="navbar"] a'); + $(navbars[0]).addClass('ui-btn-active'); + $(navbars[0]).addClass('ui-state-persist'); this.$el.find('#nResult').val(Profile.data.risRic); this.$el.find('#theme').val(Profile.data.tema); diff --git a/js/modules/settings/settingsViewTemplate.html b/js/modules/settings/settingsViewTemplate.html index a7cc5db..161450c 100644 --- a/js/modules/settings/settingsViewTemplate.html +++ b/js/modules/settings/settingsViewTemplate.html @@ -60,6 +60,7 @@ + diff --git a/js/router.js b/js/router.js index ae5f692..d6ebe5b 100644 --- a/js/router.js +++ b/js/router.js @@ -55,7 +55,7 @@ define(['jquery', 'underscore', 'backbone', 'searchView': 'showSearch', 'mapsView': 'showMaps', 'debugView': 'showDebug', - 'settingsView': 'showSettings', + 'settingsView(:tab)': 'showSettings', 'donationView': 'showDonation', 'search/:nresult/:categoria/:difficolta/:autore/*titolo': 'searchFn', 'converterView': 'showConverter', @@ -71,8 +71,10 @@ define(['jquery', 'underscore', 'backbone', homeView.render(); this.changePage(homeView); }, - showSettings: function (actions) { - var settingsView = new SettingsView(); + showSettings: function (tab) { + if(tab==null) + tab = 0; + var settingsView = new SettingsView(tab); settingsView.render(); this.changePage(settingsView); },