From bcd5752f87bf22dd7c7e6c6f45ce4c2c44f43e6d Mon Sep 17 00:00:00 2001 From: hexstudy Date: Mon, 18 Jan 2016 22:18:39 +0000 Subject: [PATCH] git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@52 0f545695-f87b-41b6-9a03-7f16563b5454 --- app.build_dev.js | 1 - app.build_prod.js | 1 - js/classes/profile.js | 4 + js/libs/jQueryPluginsCollection.js | 3 - js/manifest.js | 2 +- js/modules/category/categoryItemTemplate.html | 4 +- js/modules/item/item.js | 73 +- js/modules/item/itemViewTemplate.html | 27 +- js/modules/settings/settings.js | 58 +- js/modules/settings/settingsViewTemplate.html | 33 + js/plugins/jquery.form.js | 1127 --------- js/plugins/jquery.mobile.alphascroll.min.js | 1 - js/plugins/jquery.touchSwipe.js | 2075 ----------------- js/plugins/jquery.validate.min.js | 4 - 14 files changed, 119 insertions(+), 3294 deletions(-) delete mode 100644 js/plugins/jquery.form.js delete mode 100644 js/plugins/jquery.mobile.alphascroll.min.js delete mode 100644 js/plugins/jquery.touchSwipe.js delete mode 100644 js/plugins/jquery.validate.min.js diff --git a/app.build_dev.js b/app.build_dev.js index 1102fce..2118218 100644 --- a/app.build_dev.js +++ b/app.build_dev.js @@ -50,7 +50,6 @@ name: "main", exclude: [ 'libs/jQueryPluginsCollection', - 'plugins/jquery.mobile.alphascroll.min', 'plugins/jquery.rating.pack' ] }, diff --git a/app.build_prod.js b/app.build_prod.js index 75d6db5..60e93d1 100644 --- a/app.build_prod.js +++ b/app.build_prod.js @@ -43,7 +43,6 @@ name: "main", exclude: [ 'libs/jQueryPluginsCollection', - 'plugins/jquery.mobile.alphascroll.min', 'plugins/jquery.rating.pack' ] }, diff --git a/js/classes/profile.js b/js/classes/profile.js index 9c8bb3a..7dec514 100644 --- a/js/classes/profile.js +++ b/js/classes/profile.js @@ -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, diff --git a/js/libs/jQueryPluginsCollection.js b/js/libs/jQueryPluginsCollection.js index 2f40480..8bcd9c4 100644 --- a/js/libs/jQueryPluginsCollection.js +++ b/js/libs/jQueryPluginsCollection.js @@ -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 }); \ No newline at end of file diff --git a/js/manifest.js b/js/manifest.js index 4d1e090..6942277 100644 --- a/js/manifest.js +++ b/js/manifest.js @@ -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"), diff --git a/js/modules/category/categoryItemTemplate.html b/js/modules/category/categoryItemTemplate.html index 7dd3fdd..c75078a 100644 --- a/js/modules/category/categoryItemTemplate.html +++ b/js/modules/category/categoryItemTemplate.html @@ -3,11 +3,11 @@ <%} else { for (var i = 0; i < data.length; i++) { %> <% var item = data[i]; %>
  • - <% if(item.firstImage === ""){ %> +
    <%= unescape(item.titolo) %>
    <%= unescape(item.autore) %>

    Diff.:  
    diff --git a/js/modules/item/item.js b/js/modules/item/item.js index a0ea9f0..69d2415 100644 --- a/js/modules/item/item.js +++ b/js/modules/item/item.js @@ -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]); } }, diff --git a/js/modules/item/itemViewTemplate.html b/js/modules/item/itemViewTemplate.html index a486f8f..57074c4 100644 --- a/js/modules/item/itemViewTemplate.html +++ b/js/modules/item/itemViewTemplate.html @@ -4,27 +4,12 @@
    @@ -50,9 +35,9 @@