From f4e6f84153fa79a717cca32e3a700b5e10056d7b Mon Sep 17 00:00:00 2001 From: Loomis Date: Tue, 7 Mar 2017 16:58:34 -0500 Subject: [PATCH 1/5] add showNotesOnMap setting to tab class, and code to remove notes from displaying in MapViewController --- gpx_locations/Western Campus.gpx | 22 +++++++++++++++++++++ src/data_objects/Tab.h | 2 ++ src/data_objects/Tab.m | 3 +++ src/tab_controllers/map/MapViewController.m | 4 ++++ 4 files changed, 31 insertions(+) create mode 100644 gpx_locations/Western Campus.gpx diff --git a/gpx_locations/Western Campus.gpx b/gpx_locations/Western Campus.gpx new file mode 100644 index 000000000..e74c0d88c --- /dev/null +++ b/gpx_locations/Western Campus.gpx @@ -0,0 +1,22 @@ + + + + + + Cupertino + + + + + + diff --git a/src/data_objects/Tab.h b/src/data_objects/Tab.h index cc4fe25f3..6a7eb9a47 100644 --- a/src/data_objects/Tab.h +++ b/src/data_objects/Tab.h @@ -18,6 +18,7 @@ NSString *info; long sort_index; long requirement_root_package_id; + bool showNotesOnMap; } @property (nonatomic, assign) long tab_id; @@ -28,6 +29,7 @@ @property (nonatomic, strong) NSString *info; @property (nonatomic, assign) long sort_index; @property (nonatomic, assign) long requirement_root_package_id; +@property (nonatomic, assign) bool showNotesOnMap; - (id) initWithDictionary:(NSDictionary *)dict; - (NSString *) serialize; diff --git a/src/data_objects/Tab.m b/src/data_objects/Tab.m index 22f168929..b84e5214a 100644 --- a/src/data_objects/Tab.m +++ b/src/data_objects/Tab.m @@ -20,6 +20,7 @@ @implementation Tab @synthesize info; @synthesize sort_index; @synthesize requirement_root_package_id; +@synthesize showNotesOnMap; - (id) init { @@ -33,6 +34,7 @@ - (id) init self.info = @""; self.sort_index = 0; self.requirement_root_package_id = 0; + self.showNotesOnMap = false; } return self; } @@ -49,6 +51,7 @@ - (id) initWithDictionary:(NSDictionary *)dict self.info = [dict validStringForKey:@"info"]; self.sort_index = [dict validIntForKey:@"sort_index"]; self.requirement_root_package_id = [dict validIntForKey:@"requirement_root_package_id"]; + self.showNotesOnMap = false; } return self; } diff --git a/src/tab_controllers/map/MapViewController.m b/src/tab_controllers/map/MapViewController.m index 17963cc7b..10020822a 100644 --- a/src/tab_controllers/map/MapViewController.m +++ b/src/tab_controllers/map/MapViewController.m @@ -314,6 +314,10 @@ - (void) refreshViewFromModel !modelInstance.infinite_qty && modelInstance.qty <= 0 ) + || + ( + [modelInstance.object_type isEqualToString:@"NOTE"] && !tab.showNotesOnMap + ) ) continue; shouldAdd = YES; From 5d8b55a41fc17b0867e6d816ce420d5b0f12629f Mon Sep 17 00:00:00 2001 From: Loomis Date: Mon, 13 Mar 2017 17:13:01 -0400 Subject: [PATCH 2/5] add non-working JS code --- src/ARISWebView.m | 13 +++++++++++++ src/arisjs.js | 6 ++++++ src/data_objects/Tab.m | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/ARISWebView.m b/src/ARISWebView.m index bb6ba79aa..81c602bbe 100644 --- a/src/ARISWebView.m +++ b/src/ARISWebView.m @@ -325,6 +325,19 @@ - (void) handleARISRequest:(NSURLRequest *)request } else if([mainCommand isEqualToString:@"instances"]) { + if(components.count > 1 && [components[1] isEqualToString:@"map"]) { + if(components.count > 2 && [components[2] isEqualToString:@"showNotesOnMap"]) { + if(components.count > 3 && [components[3] isEqualToString:@"get"]) { + //Tab *t = [_MODEL_TABS_ tabForId:components[4]]; + + } + if(components.count > 3 && [components[3] isEqualToString:@"set"]) { + Tab *t = [_MODEL_TABS_ tabForId:components[4]]; + bool showNotes = [components[5] boolValue]; + t.showNotesOnMap = showNotes; + } + } + } if(components.count > 1 && [components[1] isEqualToString:@"player"]) { if(components.count > 2 && [components[2] isEqualToString:@"get"]) diff --git a/src/arisjs.js b/src/arisjs.js index cd5ae234a..549c23a96 100755 --- a/src/arisjs.js +++ b/src/arisjs.js @@ -73,6 +73,12 @@ var ARISJS = function(_ARIS) _ARIS.setScene = function(scene_id) { _ARIS.enqueueRequest("aris://scene/set/" + scene_id); } _ARIS.getPlayer = function() { _ARIS.enqueueRequest("aris://player"); } _ARIS.getTriggerLocation = function() { _ARIS.enqueueRequest("aris://trigger"); } + _ARIS.getShowNotesOnMap = function(tab_id) { + _ARIS.enqueueRequest("aris://instances/map/showNotesOnMap/get/" + tab_id + "/"); + } + _ARIS.setShowNotesOnMap = function(tab_id, show_notes) { + _ARIS.enqueueRequest("aris://instances/map/showNotesOnMap/set/" + tab_id + "/" + show_notes + "/"); + } //Call ARIS API directly (USE WITH CAUTION) _ARIS.callService = function(serviceName, body, auth, callback) diff --git a/src/data_objects/Tab.m b/src/data_objects/Tab.m index b84e5214a..2fb227614 100644 --- a/src/data_objects/Tab.m +++ b/src/data_objects/Tab.m @@ -34,7 +34,7 @@ - (id) init self.info = @""; self.sort_index = 0; self.requirement_root_package_id = 0; - self.showNotesOnMap = false; + self.showNotesOnMap = true; } return self; } @@ -51,7 +51,7 @@ - (id) initWithDictionary:(NSDictionary *)dict self.info = [dict validStringForKey:@"info"]; self.sort_index = [dict validIntForKey:@"sort_index"]; self.requirement_root_package_id = [dict validIntForKey:@"requirement_root_package_id"]; - self.showNotesOnMap = false; + self.showNotesOnMap = true; } return self; } From 8f684f45046d313ddc1a9ba802ce70807a74270d Mon Sep 17 00:00:00 2001 From: Loomis Date: Thu, 4 May 2017 13:20:25 -0400 Subject: [PATCH 3/5] change note toggle arisjs signature --- src/arisjs.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/arisjs.js b/src/arisjs.js index 549c23a96..4b1b01d3a 100755 --- a/src/arisjs.js +++ b/src/arisjs.js @@ -73,11 +73,8 @@ var ARISJS = function(_ARIS) _ARIS.setScene = function(scene_id) { _ARIS.enqueueRequest("aris://scene/set/" + scene_id); } _ARIS.getPlayer = function() { _ARIS.enqueueRequest("aris://player"); } _ARIS.getTriggerLocation = function() { _ARIS.enqueueRequest("aris://trigger"); } - _ARIS.getShowNotesOnMap = function(tab_id) { - _ARIS.enqueueRequest("aris://instances/map/showNotesOnMap/get/" + tab_id + "/"); - } - _ARIS.setShowNotesOnMap = function(tab_id, show_notes) { - _ARIS.enqueueRequest("aris://instances/map/showNotesOnMap/set/" + tab_id + "/" + show_notes + "/"); + _ARIS.showNotesOnMap = function(showNotes) { + _ARIS.enqueueRequest("aris://instances/map/showNotesOnMap/set/" + showNotes); } //Call ARIS API directly (USE WITH CAUTION) From 20afddf4738a1a38d23ee4426399e4069cb63524 Mon Sep 17 00:00:00 2001 From: Loomis Date: Thu, 4 May 2017 13:41:42 -0400 Subject: [PATCH 4/5] toggle notes in ARISWebView --- src/ARISWebView.m | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ARISWebView.m b/src/ARISWebView.m index 81c602bbe..8b79524a4 100644 --- a/src/ARISWebView.m +++ b/src/ARISWebView.m @@ -327,15 +327,9 @@ - (void) handleARISRequest:(NSURLRequest *)request { if(components.count > 1 && [components[1] isEqualToString:@"map"]) { if(components.count > 2 && [components[2] isEqualToString:@"showNotesOnMap"]) { - if(components.count > 3 && [components[3] isEqualToString:@"get"]) { - //Tab *t = [_MODEL_TABS_ tabForId:components[4]]; - - } - if(components.count > 3 && [components[3] isEqualToString:@"set"]) { - Tab *t = [_MODEL_TABS_ tabForId:components[4]]; - bool showNotes = [components[5] boolValue]; - t.showNotesOnMap = showNotes; - } + Tab *t = [_MODEL_TABS_ tabForType:(@"MAP")]; + bool showNotes = [components[4] boolValue]; + t.showNotesOnMap = showNotes; } } if(components.count > 1 && [components[1] isEqualToString:@"player"]) From dfe5cc140c3d26c1e9843820328e8f791be70687 Mon Sep 17 00:00:00 2001 From: Loomis Date: Thu, 4 May 2017 13:47:58 -0400 Subject: [PATCH 5/5] remove western campus gpx location --- gpx_locations/Western Campus.gpx | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 gpx_locations/Western Campus.gpx diff --git a/gpx_locations/Western Campus.gpx b/gpx_locations/Western Campus.gpx deleted file mode 100644 index e74c0d88c..000000000 --- a/gpx_locations/Western Campus.gpx +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Cupertino - - - - - -