From 88361427baaaf24f0c3a94ca63baae13160169cf Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 19:30:35 +0200 Subject: [PATCH 1/6] Preselect option https://github.com/OpenSeaMap/depth_webfrontend/issues/113 --- src/js/oseam-models-offset.js | 3 ++- src/js/oseam-views-depthsensorpage.js | 1 + src/js/oseam.js | 13 ++++++++++--- src/js/templates/depthsensoroffset-de.handlebars | 14 ++++++++------ src/js/templates/depthsensoroffset-en.handlebars | 10 +++++----- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/js/oseam-models-offset.js b/src/js/oseam-models-offset.js index 2a705ff..4f2c2c3 100644 --- a/src/js/oseam-models-offset.js +++ b/src/js/oseam-models-offset.js @@ -18,6 +18,7 @@ OSeaM.models.Offset = Backbone.Model.extend({ distanceWaterline : '', offsetKeel : '', manufacturer : '', - model : '' + model : '', + offsetType : '' } }); diff --git a/src/js/oseam-views-depthsensorpage.js b/src/js/oseam-views-depthsensorpage.js index 2c64ffe..5002e2f 100644 --- a/src/js/oseam-views-depthsensorpage.js +++ b/src/js/oseam-views-depthsensorpage.js @@ -67,6 +67,7 @@ OSeaM.views.depthsensorpage = OSeaM.View.extend({ depth_offsetKeel : depthoffset.get('offsetKeel'), depth_manufacturer : depthoffset.get('manufacturer'), depth_model : depthoffset.get('model'), + depthmeasurement : depthoffset.get('offsetType'), top : topY, left : leftX })); diff --git a/src/js/oseam.js b/src/js/oseam.js index 2b41f30..30c7679 100644 --- a/src/js/oseam.js +++ b/src/js/oseam.js @@ -19,9 +19,9 @@ OSeaM = { container: null, frontend: null, router: null, -// apiUrl: 'http://192.168.1.29:8100/org.osm.depth.upload/api2/', - apiUrl: 'http://depth.openseamap.org:8080/org.osm.depth.upload/api2/', -// apiUrl: 'http://testdepth.openseamap.org:8080/org.osm.depth.upload.stage/api2/', +// apiUrl: 'http://192.168.0.11:8080/org.osm.depth.upload/api2/', +// apiUrl: 'http://depth.openseamap.org:8080/org.osm.depth.upload/api2/', + apiUrl: 'http://testdepth.openseamap.org:8080/org.osm.depth.upload.stage/api2/', // apiUrl: 'http://localhost:8080/org.osm.depth.upload/api2/', autoId: 0, init: function() { @@ -34,6 +34,13 @@ OSeaM = { this.container = $('.oseam-container'); this.router = new OSeaM.routers.Router(); Backbone.history.start(); + + // helper for setting default option + window.Handlebars.registerHelper('select', function( value, options ){ + var $el = $(' - - - - + {{#select depthmeasurement}} + + + + {{/select}}

- + m
@@ -54,6 +55,7 @@
+ diff --git a/src/js/templates/depthsensoroffset-en.handlebars b/src/js/templates/depthsensoroffset-en.handlebars index 84e516e..f420af1 100644 --- a/src/js/templates/depthsensoroffset-en.handlebars +++ b/src/js/templates/depthsensoroffset-en.handlebars @@ -33,11 +33,10 @@

- + + +
@@ -54,6 +53,7 @@
+ From 551b5965c9f247c72d30f51848f8c42da914c30d Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 19:35:53 +0200 Subject: [PATCH 2/6] Fix english handlebar https://github.com/OpenSeaMap/depth_webfrontend/issues/113 --- src/js/templates/depthsensoroffset-en.handlebars | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/templates/depthsensoroffset-en.handlebars b/src/js/templates/depthsensoroffset-en.handlebars index f420af1..88c4c52 100644 --- a/src/js/templates/depthsensoroffset-en.handlebars +++ b/src/js/templates/depthsensoroffset-en.handlebars @@ -33,10 +33,12 @@

- + {{#select depthmeasurement}} + {{/select}}
From 8d06ea3f182a20a258869b68513acb1abb471bf3 Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 20:54:11 +0200 Subject: [PATCH 3/6] Fix english handlebar https://github.com/OpenSeaMap/depth_webfrontend/issues/113 --- src/js/oseam-models-vessels.js | 1 + src/js/oseam-views-depthsensorpage.js | 2 +- src/js/templates/depthsensoroffset-de.handlebars | 4 ++-- src/js/templates/depthsensoroffset-en.handlebars | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/oseam-models-vessels.js b/src/js/oseam-models-vessels.js index 3bf83b6..7c2af84 100644 --- a/src/js/oseam-models-vessels.js +++ b/src/js/oseam-models-vessels.js @@ -33,6 +33,7 @@ OSeaM.models.Vessels = Backbone.Collection.extend({ newdepthoffset.set('distanceFromCenter', y['distanceFromCenter']); newdepthoffset.set('distanceWaterline', y['distanceWaterline']); newdepthoffset.set('offsetKeel', y['offsetKeel']); + newdepthoffset.set('offsetType', y['offsetType']); newdepthoffset.set('manufacturer', y['manufacturer']); newdepthoffset.set('model', y['model']); diff --git a/src/js/oseam-views-depthsensorpage.js b/src/js/oseam-views-depthsensorpage.js index 5002e2f..e3aab8b 100644 --- a/src/js/oseam-views-depthsensorpage.js +++ b/src/js/oseam-views-depthsensorpage.js @@ -67,7 +67,7 @@ OSeaM.views.depthsensorpage = OSeaM.View.extend({ depth_offsetKeel : depthoffset.get('offsetKeel'), depth_manufacturer : depthoffset.get('manufacturer'), depth_model : depthoffset.get('model'), - depthmeasurement : depthoffset.get('offsetType'), + depth_offsetType : depthoffset.get('offsetType'), top : topY, left : leftX })); diff --git a/src/js/templates/depthsensoroffset-de.handlebars b/src/js/templates/depthsensoroffset-de.handlebars index 832fcd9..b07e3fe 100644 --- a/src/js/templates/depthsensoroffset-de.handlebars +++ b/src/js/templates/depthsensoroffset-de.handlebars @@ -33,8 +33,8 @@

- + {{#select depth_offsetType}} diff --git a/src/js/templates/depthsensoroffset-en.handlebars b/src/js/templates/depthsensoroffset-en.handlebars index f420af1..09e4c1d 100644 --- a/src/js/templates/depthsensoroffset-en.handlebars +++ b/src/js/templates/depthsensoroffset-en.handlebars @@ -33,10 +33,12 @@

- + {{#select depth_offsetType}} + {{/select}}
From d5011af9df1a65ccf5a1ce95326059293402f139 Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 20:55:49 +0200 Subject: [PATCH 4/6] Fix english handlebar https://github.com/OpenSeaMap/depth_webfrontend/issues/113 --- src/js/oseam-views-gauges.js | 12 ++++++++++++ src/js/templates/gauges-de.handlebars | 2 ++ src/js/templates/gauges-en.handlebars | 1 + 3 files changed, 15 insertions(+) diff --git a/src/js/oseam-views-gauges.js b/src/js/oseam-views-gauges.js index 241ae4a..36fef9d 100644 --- a/src/js/oseam-views-gauges.js +++ b/src/js/oseam-views-gauges.js @@ -12,6 +12,9 @@ // ------------------------------------------------------------------------------------------------- OSeaM.views.Gauges = OSeaM.View.extend({ + events: { + 'click .oseam-add' : 'addNewGauge', + }, initialize: function() { this.listenTo(this.collection, 'reset', this.refreshGauges); this.render(); @@ -26,6 +29,15 @@ OSeaM.views.Gauges = OSeaM.View.extend({ this.initOpenLayers(); return this; }, + addNewGauge: function(evt) { + var gauge = new OSeaM.models.Gauge(); + view = new OSeaM.views.GaugeDialog({ + el: this.$el, + model : vessel, + collection : this.collection + }); + view.render().modal('show'); + }, initOpenLayers: function() { var self = this; diff --git a/src/js/templates/gauges-de.handlebars b/src/js/templates/gauges-de.handlebars index 2721a98..bb4f81f 100644 --- a/src/js/templates/gauges-de.handlebars +++ b/src/js/templates/gauges-de.handlebars @@ -1,5 +1,7 @@
+ +
diff --git a/src/js/templates/gauges-en.handlebars b/src/js/templates/gauges-en.handlebars index f67579d..eaf9feb 100644 --- a/src/js/templates/gauges-en.handlebars +++ b/src/js/templates/gauges-en.handlebars @@ -1,5 +1,6 @@
+
From 501b5c1b3ce8f532bb86fc3df264bcb7485305fa Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 21:17:50 +0200 Subject: [PATCH 5/6] F: Notify on select as well --- src/js/oseam-views-vessel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/oseam-views-vessel.js b/src/js/oseam-views-vessel.js index 2378d60..4daed04 100644 --- a/src/js/oseam-views-vessel.js +++ b/src/js/oseam-views-vessel.js @@ -20,6 +20,7 @@ OSeaM.views.Vessel = OSeaM.View.extend({ "click #next_step_button" : "nextStep", "click #prev_step_button" : "prevStep", 'change input' : 'modify', + 'change select' : 'modify', 'change textarea' : 'modify' }, initialize : function() { From 8213c61507b3955334d84099881f131df05dcb17 Mon Sep 17 00:00:00 2001 From: cleanerx Date: Wed, 24 Jun 2015 21:23:27 +0200 Subject: [PATCH 6/6] Relocate Repository --- src/js/oseam.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/oseam.js b/src/js/oseam.js index 30c7679..ab6aaa0 100644 --- a/src/js/oseam.js +++ b/src/js/oseam.js @@ -20,8 +20,8 @@ OSeaM = { frontend: null, router: null, // apiUrl: 'http://192.168.0.11:8080/org.osm.depth.upload/api2/', -// apiUrl: 'http://depth.openseamap.org:8080/org.osm.depth.upload/api2/', - apiUrl: 'http://testdepth.openseamap.org:8080/org.osm.depth.upload.stage/api2/', + apiUrl: 'http://depth.openseamap.org:8080/org.osm.depth.upload/api2/', +// apiUrl: 'http://testdepth.openseamap.org:8080/org.osm.depth.upload.stage/api2/', // apiUrl: 'http://localhost:8080/org.osm.depth.upload/api2/', autoId: 0, init: function() {