git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@82 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -130,8 +130,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
}
|
||||
});
|
||||
this.freeWall.fitWidth();
|
||||
},
|
||||
|
||||
},
|
||||
onShowed: function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
+40
-6
@@ -30,7 +30,23 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
},
|
||||
events: {
|
||||
"click #favoriteBtn": "favBtn",
|
||||
"click #backBtn": "backBtn"
|
||||
"click #backBtn": "backBtn",
|
||||
"click #optionBtn": "optionBtn",
|
||||
"click #copyBtn": "copyBtn"
|
||||
},
|
||||
copyBtn: function(e) {
|
||||
e.preventDefault();
|
||||
},
|
||||
optionBtn: function(e) {
|
||||
e.preventDefault();
|
||||
var self = this;
|
||||
self.$el.find('#optionPopupDialog').popup("open");
|
||||
|
||||
if(myManifest.Agent.browser.name == "Safari" || myManifest.Agent.browser.name == "Mobile Safari"){
|
||||
var field = self.$el.find('#copyField');
|
||||
field.val(window.location.href);
|
||||
field[0].setSelectionRange(0, field[0].value.length);
|
||||
}
|
||||
},
|
||||
backBtn: function (e) {
|
||||
e.preventDefault();
|
||||
@@ -51,6 +67,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
function (msg) {
|
||||
var favBtn = self.$el.find('#favoriteBtn');
|
||||
favBtn.addClass('ui-disabled');
|
||||
self.$el.find('#optionPopupDialog').popup("close");
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -74,7 +91,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
self.galleryWall.fitWidth();
|
||||
});
|
||||
|
||||
|
||||
self.indexContent = 0;
|
||||
self.switchContent();
|
||||
$.mobile.loading('hide');
|
||||
},
|
||||
//render the content into div of view
|
||||
@@ -149,7 +167,17 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
self.$arrayContent.on("swiperight", function (e) {
|
||||
var index = jQuery.inArray(this, self.$arrayContent);
|
||||
self.goToContent(index - 1);
|
||||
});
|
||||
});
|
||||
|
||||
if(myManifest.Agent.browser.name != "Safari" || myManifest.Agent.browser.name != "Mobile Safari"){
|
||||
new Clipboard('#copyBtn', {
|
||||
text: function(trigger) {
|
||||
self.$el.find('#optionPopupDialog').popup("close");
|
||||
return window.location.href;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
self.trigger("renderCompleted:Item", self);
|
||||
}
|
||||
);
|
||||
@@ -178,9 +206,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
this.$arrayContent.hide();
|
||||
this.$arrayNavBar.removeClass('ui-btn-active');
|
||||
this.$arrayNavBar.removeClass('ui-state-persist');
|
||||
$(this.$arrayContent[this.indexContent]).show();
|
||||
$(this.$arrayNavBar[this.indexContent]).addClass('ui-btn-active');
|
||||
$(this.$arrayNavBar[this.indexContent]).addClass('ui-state-persist');
|
||||
var content = $(this.$arrayContent[this.indexContent]);
|
||||
if(content.css('min-height') == "0px" || content.css('min-height') == ""){
|
||||
var minHeight = myManifest.Settings.Device.Height - $('[data-role="header"]').height() - $('[data-role="footer"]').height() - 37;
|
||||
content.css('min-height', minHeight);
|
||||
}
|
||||
content.show();
|
||||
var navBarItem = $(this.$arrayNavBar[this.indexContent]);
|
||||
navBarItem.addClass('ui-btn-active');
|
||||
navBarItem.addClass('ui-state-persist');
|
||||
if(this.indexContent == 2)
|
||||
this.galleryWall.fitWidth();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a id="favoriteBtn" href="#" class="nav-glyphish-example ui-btn ui-icon-myHome ui-btn-icon-notext ui-btn-left" data-icon="custom"></a>
|
||||
<a id="optionBtn" href="#" class="nav-glyphish-example ui-btn ui-icon-myHome ui-btn-icon-notext ui-btn-left" data-icon="custom"></a>
|
||||
<h3 id='titoloRicetta'><%= unescape(ricetta.titolo)%></h3>
|
||||
<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>
|
||||
@@ -39,10 +39,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<% }%>
|
||||
<div id="contentVideo" data-role="content" data-theme="d" style="display: none;" data-iscroll>
|
||||
<!-- <div id="contentVideo" data-role="content" data-theme="d" style="display: none;" data-iscroll>
|
||||
<h1>Video</h1>
|
||||
<p id='video'></p>
|
||||
</div>
|
||||
</div> -->
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
@@ -52,16 +52,16 @@
|
||||
<!--<li><a href="">Video</a></li>-->
|
||||
</ul>
|
||||
</div><!-- /navbar -->
|
||||
<div data-role="none" style="text-align: center;">
|
||||
<% if(ricetta.autore.length > 0){ %>
|
||||
<div data-role="none" style="display: inline-block;">
|
||||
<p id="autore" style="padding: 0px;display: inline;">Autore: <%= unescape(ricetta.autore)%></p>
|
||||
</div>
|
||||
<% } if(ricetta.link_fonte.length > 0){ %>
|
||||
<div data-role="none" style="display: inline-block;">
|
||||
<div data-role="none">
|
||||
<% if(ricetta.link_fonte.length > 0){ %>
|
||||
<div data-role="none" style="display: inline-block;margin-right: 5px;margin-top: 4px;margin-left: 5px;">
|
||||
<a data-role="none" target="_blank" href="<%= ricetta.link_fonte%>"><div id="linkFonte"></div></a>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } if(ricetta.autore.length > 0){ %>
|
||||
<div data-role="none" style="display: inline-block;vertical-align: super;margin-left: 5px;">
|
||||
<p id="autore" style="padding: 0px;display: inline;">Autore: <%= unescape(ricetta.autore)%></p>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="popup" id="fullPhotoPopupDialog">
|
||||
@@ -70,6 +70,20 @@
|
||||
<img id="photoFull" src='' style="width: 100%;">
|
||||
</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-btn-icon-left">Agg. al Blocco</a>
|
||||
<% if(myManifest.Agent.browser.name != "Safari" && myManifest.Agent.browser.name != "Mobile Safari"){%>
|
||||
<a id="copyBtn" href="" class="ui-btn ui-btn-icon-left">Copia Link</a>
|
||||
<%}else{%>
|
||||
<p>Link da condividere</p>
|
||||
<input type="text" id="copyField" />
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="popup" id="popupDialog">
|
||||
<div data-role="header">
|
||||
<h1>Informazione</h1>
|
||||
|
||||
+73
-32
@@ -5,6 +5,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
|
||||
map: null,
|
||||
markers: [],
|
||||
openedInfoWindows: [],
|
||||
markerClicked: false,
|
||||
//initialize template
|
||||
template: _.template(mapsViewTemplate),
|
||||
infoWindowtemplate: _.template(infoWindowTemplate),
|
||||
@@ -76,12 +78,16 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
mapTypeControl: false,
|
||||
zoomControlOptions: {
|
||||
position: google.maps.ControlPosition.RIGHT_CENTER
|
||||
},
|
||||
}
|
||||
};
|
||||
self.$el.find("#map-canvas").width(document.documentElement.clientWidth - 32/*Padding content*/);
|
||||
self.$el.find("#map-canvas").height(document.documentElement.clientHeight - 151 - self.$el.find('#searchPanel').height());
|
||||
self.map = new google.maps.Map(self.$el.find("#map-canvas")[0], myOptions);
|
||||
|
||||
self.map.addListener("dragend", function(){
|
||||
self.markerClicked = true;
|
||||
});
|
||||
|
||||
// Create the search box and link it to the UI element.
|
||||
var input = $('<input id="pac-input" data-role="none" class="controls" type="text" placeholder="Ricerca località..." style="display:none;">')[0];
|
||||
self.$el.find('div[data-role="content"]')[0].appendChild(input);
|
||||
@@ -140,32 +146,47 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
|
||||
self.map.addListener('bounds_changed', function() {
|
||||
var bound = self.map.getBounds();
|
||||
searchBox.setBounds(bound);
|
||||
var latLngFrom = bound.getNorthEast();
|
||||
var latLngTo = bound.getSouthWest();
|
||||
$.ajax({
|
||||
url: myManifest.Settings.DefaultURL + "/api/spacciatori/bound/" + latLngFrom.lat() + "/"+ latLngFrom.lng() + "/" + latLngTo.lat() + "/"+ latLngTo.lng(),
|
||||
//dataType: "json",
|
||||
//async: false,
|
||||
type: 'GET',
|
||||
success: function (resp) {
|
||||
resp.forEach(function(ele, index){
|
||||
var key = "|" + ele.Latitudine+ "|" + ele.Longitudine+ "|";
|
||||
if(!self.markers[key])
|
||||
{
|
||||
self._makeMarker(ele, key);
|
||||
}
|
||||
else if(!self.markers[key][ele.ID])
|
||||
{
|
||||
ele.Latitudine = parseFloat(ele.Latitudine) + (Math.random() / 500);
|
||||
ele.Longitudine = parseFloat(ele.Longitudine) + (Math.random() / 500);
|
||||
self._makeMarker(ele, key);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
searchBox.setBounds(bound);
|
||||
});
|
||||
$("#pac-input").show();
|
||||
|
||||
var markersArray = [];
|
||||
var latLngFrom = new google.maps.LatLng(85, -180);
|
||||
var latLngTo = new google.maps.LatLng(-85, 180);
|
||||
$.ajax({
|
||||
url: myManifest.Settings.DefaultURL + "/api/spacciatori/bound/" + latLngFrom.lat() + "/"+ latLngFrom.lng() + "/" + latLngTo.lat() + "/"+ latLngTo.lng(),
|
||||
//dataType: "json",
|
||||
//async: false,
|
||||
type: 'GET',
|
||||
success: function (resp) {
|
||||
resp.forEach(function(ele, index){
|
||||
var key = "|" + ele.Latitudine+ "|" + ele.Longitudine+ "|";
|
||||
if(!self.markers[key])
|
||||
{
|
||||
markersArray.push(self._makeMarker(ele, key));
|
||||
}
|
||||
else if(!self.markers[key][ele.ID])
|
||||
{
|
||||
ele.Latitudine = parseFloat(ele.Latitudine) + (Math.random() / 500);
|
||||
ele.Longitudine = parseFloat(ele.Longitudine) + (Math.random() / 500);
|
||||
markersArray.push(self._makeMarker(ele, key));
|
||||
}
|
||||
});
|
||||
|
||||
markerClusterer = new MarkerClusterer(self.map, markersArray, {
|
||||
maxZoom: 15
|
||||
// ,styles: {
|
||||
// url: '../images/pin.png',
|
||||
// height: 48,
|
||||
// width: 30,
|
||||
// anchor: [-18, 0],
|
||||
// textColor: '#ffffff',
|
||||
// textSize: 10,
|
||||
// iconAnchor: [15, 48]
|
||||
// }
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
_makeMarker: function(ele,key){
|
||||
var self = this;
|
||||
@@ -174,7 +195,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
icon: ele.TipoPM == "4"?self.iconPMGF:self.iconPM,
|
||||
//label: ele.Name,
|
||||
title: $("<div/>").html(unescape(ele.Name)).text(),
|
||||
map: self.map
|
||||
//map: self.map
|
||||
});
|
||||
|
||||
if(!self.markers[key])
|
||||
@@ -183,26 +204,34 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
self.markers[key][ele.ID] = marker;
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: self.infoWindowtemplate({item: ele})
|
||||
content: self.infoWindowtemplate({item: ele}),
|
||||
closeclick: function(){
|
||||
var index = openedInfoWindows.indexOf(this);
|
||||
if (index > -1) {
|
||||
self.openedInfoWindows.splice(index, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
marker.addListener('click', function() {
|
||||
self.markerClicked = true;
|
||||
self.openedInfoWindows.push(infowindow);
|
||||
infowindow.open(self.map, marker);
|
||||
});
|
||||
|
||||
return marker;
|
||||
},
|
||||
onShowed: function(){
|
||||
if(this.map)
|
||||
return;
|
||||
return;
|
||||
|
||||
var self = this;
|
||||
|
||||
$( window ).resize( function(){
|
||||
$("#map-canvas").width(document.documentElement.clientWidth - 32/*Padding content*/);
|
||||
$("#map-canvas").height(document.documentElement.clientHeight - 151 - self.$el.find('#searchPanel').height());
|
||||
});
|
||||
},
|
||||
onShowing: function(){
|
||||
var self = this;
|
||||
});
|
||||
|
||||
if ( navigator.geolocation ) {
|
||||
function success(pos) {
|
||||
// Location found, show map with these coordinates
|
||||
@@ -216,6 +245,18 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
} else {
|
||||
self._drawMap(self.defaultLatLng); // No geolocation support, show default map
|
||||
}
|
||||
|
||||
$("#map-canvas").click(function(){
|
||||
if(self.markerClicked){
|
||||
self.markerClicked = false;
|
||||
return;
|
||||
}
|
||||
self.openedInfoWindows.forEach(function(item, index){
|
||||
item.close();
|
||||
});
|
||||
|
||||
self.openedInfoWindows = [];
|
||||
});
|
||||
},
|
||||
onClosing: function(){
|
||||
var self = this;
|
||||
|
||||
@@ -63,7 +63,8 @@ define(['jquery', 'underscore', 'backbone','text!modules/search/searchViewTempla
|
||||
this.$el.append(this.template());
|
||||
this.$el.append(this.footer.$el);
|
||||
}
|
||||
this.$el.find('#nResult').val(Profile.data.risRic);
|
||||
if(Profile.data.risRic)
|
||||
this.$el.find('#nResult').val(Profile.data.risRic);
|
||||
this.trigger("renderCompleted:Search", this);
|
||||
this.$el.find("#searchBtn").addClass("ui-btn-active");
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user