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

This commit is contained in:
hexstudy committed 2016-01-18 22:18:39 +00:00
1 parent b4882d0006
commit bcd5752f87
14 files changed
+119 -3294

No files matched your search

+4
View File
@@ -25,6 +25,7 @@ define(['jquery', 'backbone'],
"picture": null,
"isSpacc": 0,
"dataSpacc": {
"stato": null,
"provincia": null,
"comune": null,
"cap": null,
@@ -77,6 +78,7 @@ define(['jquery', 'backbone'],
self.setName(self.data.name);
self.setGender(self.data.gender);
self.data.isSpacc = response[0].bSpacciatore;
self.data.dataSpacc.stato = response[0].Stato;
self.data.dataSpacc.provincia = response[0].Provincia;
self.data.dataSpacc.comune = response[0].Comune;
self.data.dataSpacc.cap = response[0].Cap;
@@ -119,6 +121,7 @@ define(['jquery', 'backbone'],
this.data.tema = 'd';
this.data.risRic = '10';
this.data.isSpacc = 0;
this.data.dataSpacc.stato = null;
this.data.dataSpacc.provincia = null;
this.data.dataSpacc.comune = null;
this.data.dataSpacc.cap = null;
@@ -244,6 +247,7 @@ define(['jquery', 'backbone'],
"type": this.data.type,
"email": this.data.email,
"isSpacc": this.data.isSpacc,
"stato": this.data.dataSpacc.stato,
"prov": this.data.dataSpacc.provincia,
"comune": this.data.dataSpacc.comune,
"cap": this.data.dataSpacc.cap,
-3
View File
@@ -1,7 +1,4 @@
define(['plugins/jquery.rating.pack',
'plugins/jquery.mobile.alphascroll.min',
'plugins/jquery.validate.min',
'plugins/jquery.touchSwipe',
'plugins/freewall'], function ($) {
// Do nothing
});
+1 -1
View File
@@ -1,7 +1,7 @@
var myManifest = {
Debug: (window.location.port !== ""),
Name: "Il Lievitario",
Version: "2.9.3.5",
Version: "2.9.4.0",
Author: "Denis Ironi",
Settings: {
DefaultURL: (window.location.port === "" ? "http://" + window.location.host + "/Service": "http://" + window.location.hostname + ":" + window.location.port + "/Service_Manut"),
@@ -3,11 +3,11 @@
<%} 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">
<% if(item.firstImage === ""){ %>
<!--<% if(item.firstImage === ""){ %>
<img src='Resources\img\ricettaND_80.png'>
<%}else{%>
<img src='<%=myManifest.Settings.DefaultURL%>/api/photo/thumbnail/<%=item.firstImage%>'>
<%}%>
<%}%>-->
<div class='ricettaTitolo'><%= unescape(item.titolo) %></div>
<div class='ricettaAutore'><%= unescape(item.autore) %></div>
<br><div class='ricettaAutore'>Diff.:&nbsp;&nbsp;</div>
+19 -54
View File
@@ -6,10 +6,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
collIngredienti: null,
fetchedRicetta: false,
fetchedIngredienti: false,
IMG_WIDTH: 500,
currentImg: 0,
maxImages: 3,
speed: 500,
galleryWall: null,
//initialize template
template: _.template(itemViewTemplate),
initialize: function (options) {
@@ -58,14 +55,24 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
);
},
onShowed: function(){
var self = this;
$('body').scrollTop(0);
this.$el.find("#Gallery").swipe({
triggerOnTouchEnd: true,
swipeStatus: this._swipeStatus,
allowPageScroll: "vertical",
threshold: 75
});
this.galleryWall = new Freewall("#Gallery");
this.galleryWall.reset({
selector: '.brick',
animate: true,
cellW: 150,
cellH: 'auto',
onResize: function() {
self.galleryWall.fitWidth();
}
});
var images = this.galleryWall.container.find('.brick');
images.find('img').load(function() {
self.galleryWall.fitWidth();
});
},
//render the content into div of view
render: function () {
@@ -76,8 +83,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
var ric = self.collRicetta.toJSON()[0];
this.maxImages = ric.foto.length;
Profile.existRicettaBloccoNote(ric.ricetta_id,
function (exist) {
self.$el.append(self.template({
@@ -125,48 +130,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
return this;
}
},
/**
* Catch each phase of the swipe.
* move : we drag the div
* cancel : we animate back to where we were
* end : we animate to the next image
*/
_swipeStatus: function (event, phase, direction, distance) {
//If we are moving before swipe, and we are going L or R in X mode, or U or D in Y mode then drag.
if (phase == "move" && (direction == "left" || direction == "right")) {
var duration = 0;
if (direction == "left") {
scrollImages((this.IMG_WIDTH * this.currentImg) + distance, duration);
} else if (direction == "right") {
scrollImages((this.IMG_WIDTH * this.currentImg) - distance, duration);
}
} else if (phase == "cancel") {
scrollImages(this.IMG_WIDTH * this.currentImg, this.speed);
} else if (phase == "end") {
if (direction == "right") {
self._previousImage();
} else if (direction == "left") {
self._nextImage();
}
}
},
_previousImage: function () {
this.currentImg = Math.max(this.currentImg - 1, 0);
scrollImages(this.IMG_WIDTH * this.currentImg, this.speed);
},
_nextImage: function() {
this.currentImg = Math.min(this.currentImg + 1, this.maxImages - 1);
this._scrollImages(this.IMG_WIDTH * this.currentImg, this.speed);
},
/**
* Manually update the position of the imgs on drag
*/
_scrollImages: function (distance, duration) {
imgs.css("transition-duration", (duration / 1000).toFixed(1) + "s");
//inverse the number we set in the css
var value = (distance < 0 ? "" : "-") + Math.abs(distance).toString();
imgs.css("transform", "translate(" + value + "px,0)");
},
goToContent: function (newIndex)
{
if (this.$arrayContent.length > newIndex && newIndex >= 0)
@@ -174,6 +137,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
this.scrollPositions[this.indexContent] = $('body').scrollTop();
this.indexContent = newIndex;
this.switchContent();
if(this.indexContent == 2)
this.galleryWall.fitWidth();
$('body').scrollTop(this.scrollPositions[this.indexContent]);
}
},
+6 -21
View File
@@ -4,27 +4,12 @@
<a id="backBtn" href="#" class="nav-glyphish-example ui-btn ui-icon-myHome ui-btn-icon-notext ui-btn-right" data-icon="custom"></a>
</div>
<style>
#Gallery {
float: left;
display: inline;
padding: 0;
margin: 0;
/*width: 1510px;*/
transition-property: transform;
transition-duration: 0.5s;
transition-timing-function: ease-out;
/*apply a transform to kick in the hardware acceleration. Without this, the first
time we add the transform you get odd rendering of the divs (half missing) */
transform: translate(0, 0);
.freewallGallery {
margin: 15px;
}
#Gallery img {
padding: 0;
.brick img {
margin: 0;
/*width: 500px;
height: 340px;*/
/*apply a transform to kick in the hardware acceleration. Without this, the first
time we add the transform you get odd rendering of the divs (half missing) */
transform: translate(0, 0);
display: block;
}
</style>
<div id="contentIngredienti" data-role="content">
@@ -50,9 +35,9 @@
</div>
<div id="contentFoto" data-role="content" style="display: none;">
<h1>Foto</h1>
<div id="Gallery">
<div id="Gallery" class="freewallGallery">
<% _.each(ricetta.foto, function(fotoID) {%>
<img src='<%=myManifest.Settings.DefaultURL%>/api/photo/<%=fotoID.ID%>'>
<div class='brick' style='width:250px;'><img src='<%=myManifest.Settings.DefaultURL%>/api/photo/<%=fotoID.ID%>' style="width: 100%;"></div>
<%});%>
</div>
</div>
+54 -4
View File
@@ -15,7 +15,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
events: {
"click #saveBtn": "saveBtn",
"change #spacc-PMChk": "spaccPMClick"
"change #spacc-PMChk": "spaccPMClick",
"change #stato": "statoChange"
},
statoChange: function(){
if(this.$el.find('#stato').val() !== "ITALIA")
{
this.$el.find('#provTxt').parent().show();
this.$el.find('#prov').parent().hide();
}
else
{
this.$el.find('#provTxt').parent().hide();
this.$el.find('#prov').parent().show();
}
},
saveBtn:function(e){
@@ -34,13 +48,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
if(Profile.data.isSpacc==="1")
{
Profile.data.email = this.$el.find('#email').val();
Profile.data.dataSpacc.provincia = this.$el.find('#prov').val();
Profile.data.dataSpacc.stato = this.$el.find('#stato').val();
if(this.$el.find('#stato').val() !== "ITALIA"){
Profile.data.dataSpacc.provincia = this.$el.find('#provTxt').val();
}
else{
Profile.data.dataSpacc.provincia = this.$el.find('#prov').val();
}
Profile.data.dataSpacc.comune = this.$el.find('#comune').val();
Profile.data.dataSpacc.cap = this.$el.find('#CAP').val();
Profile.data.dataSpacc.tipopm = this.$el.find('#tPM').val();
Profile.data.dataSpacc.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
if(Profile.data.email === "" ||
Profile.data.dataSpacc.stato === "" ||
Profile.data.dataSpacc.provincia === "" ||
Profile.data.dataSpacc.comune === "" ||
Profile.data.dataSpacc.cap === "" ||
@@ -66,7 +88,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
url: "http://maps.google.com/maps/api/geocode/json?address=" +
Profile.data.dataSpacc.comune + "+" +
Profile.data.dataSpacc.comune + "+" +
Profile.data.dataSpacc.provincia + "+italia&sensor=false",
Profile.data.dataSpacc.provincia + "+" + Profile.data.dataSpacc.stato + "&sensor=false",
                Type: "GET"
            }).then(function ( response ) {
if(response.results.length == 1)
@@ -111,7 +133,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
else
this.$el.find('#mapSpacc > :not(.ui-checkbox:has(#spacc-PMChk))').show();
if(this.$el.find('#stato').val() !== "ITALIA")
{
this.$el.find('#provTxt').parent().show();
this.$el.find('#prov').parent().hide();
}
else
{
this.$el.find('#provTxt').parent().hide();
this.$el.find('#prov').parent().show();
}
$( "#autocomplete_comune" ).on( "filterablebeforefilter", function ( e, data ) {
if(self.$el.find('#stato').val() !== "ITALIA")
return;
        var $ul = $( this ),
            $input = $( data.input ),
            value = $input.val(),
@@ -163,12 +199,26 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
this.$el.append(this.template());
this.$el.append(this.footer.$el);
}
this.$el.find('#nResult').val(Profile.data.risRic);
this.$el.find('#theme').val(Profile.data.tema);
this.$el.find('#spacc-PMChk').prop('checked', Profile.data.isSpacc==="0"?false:true);
this.$el.find('#email').val(Profile.data.email);
this.$el.find('#prov').val(Profile.data.dataSpacc.provincia);
this.$el.find('#stato').val(Profile.data.dataSpacc.stato);
if(this.$el.find('#stato').val() !== "ITALIA")
{
this.$el.find('#provTxt').parent().show();
this.$el.find('#prov').parent().hide();
this.$el.find('#provTxt').val(Profile.data.dataSpacc.provincia);
}
else
{
this.$el.find('#provTxt').parent().hide();
this.$el.find('#prov').parent().show();
this.$el.find('#prov').val(Profile.data.dataSpacc.provincia);
}
this.$el.find('#comune').val(Profile.data.dataSpacc.comune);
this.$el.find('#CAP').val(Profile.data.dataSpacc.cap);
this.$el.find('#tPM').val(Profile.data.dataSpacc.tipopm);
@@ -29,7 +29,40 @@
<input type="checkbox" name="spacc-PMChk" id="spacc-PMChk">
<label for="email">Email:</label>
<input type="text" name="email" id="email" placeholder="Inserire proprio indirizzo di posta...">
<label for="stato">Stato:</label>
<select name="stato" id="stato">
<option value='AUSTRIA'>Austria</option>
<option value='BELGIO'>Belgio</option>
<option value='BULGARIA'>Bulgaria</option>
<option value='CIPRO'>Cipro</option>
<option value='CROAZIA'>Croazia</option>
<option value='DANIMARCA'>Danimarca</option>
<option value='ESTONIA'>Estonia</option>
<option value='FINLANDIA'>Finlandia</option>
<option value='FRANCIA'>Francia</option>
<option value='GERMANIA'>Germania</option>
<option value='GRECIA'>Grecia</option>
<option value='ITALIA' selected="true">Italia</option>
<option value='IRLANDA'>Irlanda</option>
<option value='LETTONIA'>Lettonia</option>
<option value='LITUANIA'>Lituania</option>
<option value='LUSSEMBURGO'>Lussemburgo</option>
<option value='MALTA'>Malta</option>
<option value='NORVEGIA'>Norvegia</option>
<option value='PAESI BASSI'>Paesi Bassi</option>
<option value='POLONIA'>Polonia</option>
<option value='PORTOGALLO'>Portogallo</option>
<option value='REGNOUNITO'>RegnoUnito</option>
<option value='REP.CECA'>Rep.Ceca</option>
<option value='SLOVACCHIA'>Slovacchia</option>
<option value='SLOVENIA'>Slovenia</option>
<option value='ROMANIA'>Romania</option>
<option value='SPAGNA'>Spagna</option>
<option value='SVEZIA'>Svezia</option>
<option value='UNGHERIA'>Ungheria</option>
</select>
<label for="prov">Provincia:</label>
<input type="text" name="provTxt" id="provTxt" placeholder="Inserire propria provincia...">
<select name="prov" id="prov">
<option value='AG'>AG</option>
<option value='AL'>AL</option>
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1 +0,0 @@
(function($){$.fn.extend({alphascroll:function(){return this.each(function(){var content=$(this),alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],shortAlphabet=['a','d','g','j','m','p','s','w','z'],dividers=[],dividerClass,scrollbar='';$(content).find('.ui-li-divider').each(function(){dividerClass=$(this).html().toLowerCase();dividers.push(dividerClass);$(this).addClass(dividerClass);});function createScrollbar(){$(alphabet).each(function(index,value){if($.inArray(value,dividers)>-1){scrollbar+='<li id="alphascroll-'+value+'" class="alphascroll-item" unselectable="on">'+value.toUpperCase()+'</li>';}else{scrollbar+='<li id="alphascroll-'+value+'" unselectable="on">'+value.toUpperCase()+'</li>';}});$(content).wrap('<div />');var wrapper=$(content).parent();$(wrapper).prepend('<ul class="alphascroll">'+scrollbar+'</ul>');var alphascroll=$(content).closest('div').children('.alphascroll');$(alphascroll).bind('touchmove',function(event){event.preventDefault();var touch=event.originalEvent.touches[0]||event.originalEvent.changedTouches[0];alphaScroll(touch.pageY);});$(alphascroll).bind('mousedown',function(){$('.ui-page-active').bind('mousemove',function(event){$(this).css({"-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"});alphaScroll(event.pageY);});$('.ui-page-active').bind('mouseup',function(){$('.ui-page-active').unbind('mousemove');$(this).css({"-webkit-user-select":"text","-moz-user-select":"text","-ms-user-select":"text","user-select":"text"});});});if($(window).height()<=320){truncateScrollbar();}}$(window).bind('orientationchange',function(){$('.alphascroll').unwrap().remove();scrollbar='';createScrollbar();});function truncateScrollbar(){$('.alphascroll li').each(function(index,value){if($.inArray($(this).html().toLowerCase(),shortAlphabet)<0){$(this).html('&#183;').addClass('truncated');}});}function alphaScroll(y){$('.alphascroll-item').each(function(){if(!(y<=$(this).offset().top||y>=$(this).offset().top+$(this).outerHeight())){var scroll_id=$(this).attr('id'),letter=scroll_id.split('-'),target=$('.'+letter[1]),position=target.position(),header_height;if($('.ui-page-active [data-role="header"]').hasClass('ui-fixed-hidden')){header_height=0;}else{header_height=$('.ui-page-active [data-role="header"]').height();}$.mobile.silentScroll(position.top-header_height);}});}createScrollbar();});}});})(jQuery);
File diff suppressed because it is too large. Load diff
-4
View File
@@ -1,4 +0,0 @@
/*! jQuery Validation Plugin - v1.12.0 - 4/1/2014
* http://jqueryvalidation.org/
* Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
!function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLine truncated