Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Jul 8, 2014
1 parent 13c180f commit 7a89131
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
13 changes: 8 additions & 5 deletions js/dijit/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ <h2>${nls.user.locationInformationText}</h2>
<div id="address" class="tab-pane">
<div class="input-group">
<input data-dojo-attach-point="searchInput" type="text" class="form-control">
<span class="input-group-btn">
<button data-dojo-attach-point="searchSubmit" class="btn btn-default" type="button"><span id="geocoder_spinner" class="glyphicon glyphicon-search"></span></button>
</span>
</div>
<span class="input-group-btn">
<button data-dojo-attach-point="searchSubmit" class="btn btn-default" type="button"><span id="geocoder_spinner" class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
<div id="coordinates" class="tab-pane">
<form role="form">
Expand All @@ -54,7 +55,9 @@ <h2>${nls.user.locationInformationText}</h2>
<label>${nls.user.placeholderLongitude}</label>
<input type="text" pattern="-?\d{1,3}\.\d+" data-dojo-attach-point="YCoordinate" class="form-control" type="text" placeholder="-117" />
</div>
<div><button data-dojo-attach-point="cordsSubmit" type="button" class="btn btn-default">${nls.user.setLocation}</button></div>
<div>
<button data-dojo-attach-point="cordsSubmit" type="button" class="btn btn-default">${nls.user.setLocation}</button>
</div>
</form>
</div>
</div>
Expand Down
48 changes: 23 additions & 25 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ define([
}));
//Handle case where edit is first url parameter we'll use the same logic we used in sharedialog.js
var url = window.location.protocol + '//' + window.location.host + window.location.pathname;
if(window.location.href.indexOf("?") > -1){
var queryUrl = window.location.href;
var urlParams = ioQuery.queryToObject(window.location.search.substring(1)),
if (window.location.href.indexOf("?") > -1) {
var queryUrl = window.location.href;
var urlParams = ioQuery.queryToObject(window.location.search.substring(1)),
newParams = lang.clone(urlParams);
delete newParams.edit; //Remove edit parameter
url = queryUrl.substring(0, queryUrl.indexOf("?") + 1) + ioQuery.objectToQuery(newParams);
}
delete newParams.edit; //Remove edit parameter
url = queryUrl.substring(0, queryUrl.indexOf("?") + 1) + ioQuery.objectToQuery(newParams);
}
node.src = url;


node.onload = function () {
domConstruct.place(cssStyle, $("#iframeContainer").contents().find('head')[0], "last");
};
Expand Down Expand Up @@ -700,7 +700,7 @@ define([
}
}), this.reportError);
},
_evaluateCoordinates: function(){
_evaluateCoordinates: function () {
this._clearSubmissionGraphic();
if (this.XCoordinate.value === "") {
this._showErrorMessageDiv(nls.user.emptylatitudeAlertMessage);
Expand All @@ -724,17 +724,16 @@ define([
}, domConstruct.create('div'));
currentLocation.startup();
on(currentLocation, "locate", lang.hitch(this, function (evt) {
if(evt.error){
if (evt.error) {
alert(nls.user.locationNotFound);
}
else{
} else {
var pt = webMercatorUtils.geographicToWebMercator(evt.graphic.geometry);
evt.graphic.setGeometry(pt);
this.addressGeometry = pt;
this.map.infoWindow.setTitle(nls.user.myLocationTitleText);
this.map.infoWindow.setContent(nls.user.addressSearchText);
this.map.infoWindow.show(this.addressGeometry);
this._setSymbol(evt.graphic.geometry);
this._setSymbol(evt.graphic.geometry);
}
$('#geolocate_button').button('reset');
}));
Expand All @@ -744,20 +743,19 @@ define([
currentLocation.locate();
}));
},
_searchGeocoder: function(){
_searchGeocoder: function () {
this._clearSubmissionGraphic();
var value = this.searchInput.value;
var node = dom.byId('geocoder_spinner');
if(value){
if (value) {
domClass.remove(node, 'glyphicon glyphicon-search');
domClass.add(node, 'fa fa-spinner fa-spin');
this.geocodeAddress.find(value).then(lang.hitch(this, function(evt){
this.geocodeAddress.find(value).then(lang.hitch(this, function (evt) {
domClass.remove(node, 'fa fa-spinner fa-spin');
domClass.add(node, 'glyphicon glyphicon-search');
if(evt.results && evt.results.length){
if (evt.results && evt.results.length) {
this.geocodeAddress.select(evt.results[0]);
}
else{
} else {
alert(nls.user.locationNotFound);
}
}));
Expand All @@ -768,18 +766,18 @@ define([
map: this.map
}, domConstruct.create('div'));
this.geocodeAddress.startup();
on(this.searchInput, 'keyup', lang.hitch(this, function(evt){

on(this.searchInput, 'keyup', lang.hitch(this, function (evt) {
var keyCode = evt.charCode || evt.keyCode;
if (keyCode === 13) {
this._searchGeocoder();
}
}));
on(this.searchSubmit, 'click', lang.hitch(this, function(){

on(this.searchSubmit, 'click', lang.hitch(this, function () {
this._searchGeocoder();
}));

on(this.geocodeAddress, "select", lang.hitch(this, function (evt) {
this.addressGeometry = evt.result.feature.geometry;
this._setSymbol(evt.result.feature.geometry);
Expand Down Expand Up @@ -839,7 +837,7 @@ define([
this._showErrorMessageDiv(nls.user.selectLocation);
}
},
_clearSubmissionGraphic: function(){
_clearSubmissionGraphic: function () {
this.addressGeometry = null;
this.map.graphics.clear();
if (this.map.infoWindow.isShowing) {
Expand Down Expand Up @@ -964,4 +962,4 @@ define([
}));
}
});
});
});

0 comments on commit 7a89131

Please sign in to comment.