Skip to content
This repository was archived by the owner on Oct 7, 2019. It is now read-only.

Commit 63a9c3a

Browse files
committed
added some GP feedback
1 parent 593a40f commit 63a9c3a

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

project/static/css/main.css

+11
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,15 @@ body {
138138
.alert-none {
139139
background-color: rgb(231, 231, 231);
140140
color: rgb(75, 75, 75);
141+
}
142+
143+
.has-feedback .form-control-feedback {
144+
position: absolute;
145+
top: 0;
146+
left: 0;
147+
display: block;
148+
width: 34px;
149+
height: 34px;
150+
line-height: 34px;
151+
text-align: center;
141152
}

project/static/js/calcControl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ var Param = function(primary_class, defaultValue, validLower, validUpper, switch
290290
c = "has-error";
291291
} else if (validation === "warning") {
292292
c = "has-warning";
293+
} else {
294+
resetParamStatus();
293295
}
294296
this.s().closest('div', 'form-group').addClass(c);
295297
},
@@ -623,7 +625,7 @@ var paramControl = {
623625
$('.results').empty();
624626
},
625627
/**
626-
* parameter validation alert generation
628+
* parameter messages alert generation
627629
*/
628630
notifications: {
629631
id: '#params-notification',

project/static/js/geoControl.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ var gpControl = {
139139
* @param L.Layer drawnPolyline the polyline drawn with Leaflet.Draw
140140
*/
141141
gpElevProfile: function (drawnPolyline) {
142-
//Hydropower.params.head.setOnForm('Calculating...');
142+
Hydropower.params.head.resetParamStatus();
143+
$('#gp-msg-head').fadeIn();
143144
var elevProfileService = L.esri.GP.service({
144145
url: "http://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer/Profile",
145146
useCors: true,
@@ -161,6 +162,7 @@ var gpControl = {
161162
//$('#'+messageControl.messages.elevprofile.id).show();
162163
// run the task
163164
elevProfileTask.run(function(error, result, response) {
165+
$('#gp-msg-head').fadeOut();
164166
if (error) {
165167
// messages
166168
msg = "Elevation Profile: " + error.message + "(code:" + error.code + ")";
@@ -180,6 +182,8 @@ var gpControl = {
180182
});
181183
},
182184
gpWatershed: function(drawnPoint) {
185+
Hydropower.params.area.resetParamStatus();
186+
$('#gp-msg-area').fadeIn();
183187
//Hydropower.params.area.setOnForm('Calculating...');
184188
var watershedService = L.esri.GP.service({
185189
url: "http://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed",
@@ -208,6 +212,7 @@ var gpControl = {
208212
//messageControl.messages.watershed.addMsg(msg, 'info');
209213
//$('#'+messageControl.messages.watershed.id).show();
210214
watershedTask.run(function(error, result, response) {
215+
$('#gp-msg-area').fadeOut();
211216
// show the message window
212217
if (error) {
213218
// messages

project/static/js/ready.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ $(document).on("ready", function() {
3232
// set up the draw control
3333
drawControl.initDrawListeners(map);
3434

35+
$(".gp-msg").hide();
3536

3637
console.log("document is ready");
3738
console.log("*****************************");
@@ -42,5 +43,6 @@ $(document).on("ready", function() {
4243
*/
4344
$(document).on("load", function() {
4445
$("#loading").hide();
46+
4547
console.log("window is loaded");
4648
});

project/templates/pages/map.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,29 @@ <h4>Head & Area</h4>
100100

101101
<br>
102102

103-
<div class="form-group">
103+
<div class="form-group has-feedback">
104104
<label class="control-label col-sm-2" for="head-form-field">Head</label>
105105
<div class="col-sm-3">
106106
<input id="head-form-check" type="checkbox" data-on="Form&nbsp;" data-off="Map" class="switch params-head" data-toggle="toggle">
107107
</div>
108108
<div class="col-sm-7">
109109
<div class="input-group">
110110
<input disabled id="head-form-field" type="text" class="form-control params params-head" aria-describedby="head-form-units" placeholder="Sketch a microhydro installation on the map to derive this parameter">
111+
<span id="gp-msg-head" class="gp-msg fa fa-2x fa-cog fa-spin fa-fw form-control-feedback"></span>
111112
<span class="input-group-addon" id="head-form-units"><small>Meters</small></span>
112113
</div>
113114
</div>
114115
</div>
115116

116-
<div class="form-group">
117+
<div class="form-group has-feedback">
117118
<label class="control-label col-sm-2" for="area-form-field">Area</label>
118119
<div class="col-sm-3">
119120
<input id="area-form-check" type="checkbox" data-on="Form&nbsp;" data-off="Map" class="switch params-area" data-toggle="toggle">
120121
</div>
121122
<div class="col-sm-7">
122123
<div class="input-group">
123124
<input disabled id="area-form-field" type="text" class="form-control params params-area" aria-describedby="area-form-units" placeholder="Sketch a microhydro installation on the map to derive this parameter">
125+
<span id="gp-msg-area" class="gp-msg fa fa-2x fa-cog fa-spin fa-fw form-control-feedback"></span>
124126
<span class="input-group-addon" id="area-form-units"><small>Sq. Km.</small></span>
125127
</div>
126128
</div>

0 commit comments

Comments
 (0)