Skip to content

Commit

Permalink
Merge pull request #208 from shankari/release_181
Browse files Browse the repository at this point in the history
Fit and finish issues
  • Loading branch information
shankari authored Feb 12, 2017
2 parents faf8339 + 343c466 commit de7252b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="edu.berkeley.eecs.emission"
version="1.8.0"
android-versionCode="22"
ios-CFBundleVersion="22"
version="1.8.1"
android-versionCode="23"
ios-CFBundleVersion="23"
xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>emission</name>
<description>
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.1",
"description": "Automatic tracker",
"dependencies": {
"fs-extra": "^2.0.0",
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-imagemin": "^2.4.0",
Expand All @@ -11,6 +12,7 @@
"gulp-sass": "^2.0.4",
"gulp.spritesmith": "^4.1.0",
"image-size": "^0.3.2",
"klaw-sync": "^1.1.1",
"lodash": "^3.10.1",
"merge-stream": "^1.0.0",
"rimraf": "^2.4.3"
Expand Down
4 changes: 2 additions & 2 deletions www/js/goals.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ angular.module('emission.main.goals',['emission.services', 'emission.plugin.logg
$scope.leaderboardModal = modal;
});


var joinGroupSuccess = function() {
refreshInfo();
var alertPopup = $ionicPopup.alert({
Expand Down Expand Up @@ -148,7 +147,8 @@ angular.module('emission.main.goals',['emission.services', 'emission.plugin.logg

$rootScope.$on('$cordovaInAppBrowser:loadstop', function(e, event){
// insert Javascript via code / file
if (event.url == 'https://em-game.eecs.berkeley.edu/static/front#/tasks') {
if (event.url == 'https://em-game.eecs.berkeley.edu/static/front' ||
event.url == 'https://em-game.eecs.berkeley.edu/static/front#/tasks') {
$cordovaInAppBrowser.executeScript({
code: "localStorage.setItem('habit-mobile-settings', '" + settings + "');"
+ "window.location.href = 'https://em-game.eecs.berkeley.edu/#/tasks';"
Expand Down
28 changes: 26 additions & 2 deletions www/js/incident/post-trip-map-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ angular.module('emission.incident.posttrip.map',['ui-leaflet', 'ng-walkthrough',
'emission.main.diary.services',
'emission.incident.posttrip.manual'])

.controller("PostTripMapCtrl", function($scope, $window,
$stateParams, $ionicActionSheet,
.controller("PostTripMapCtrl", function($scope, $window, $state,
$stateParams, $ionicActionSheet, $ionicLoading,
leafletData, leafletMapEvents, nzTour, storage,
Logger, Timeline, DiaryHelper, Config,
UnifiedDataLoader, PostTripManualMarker) {
Expand Down Expand Up @@ -53,10 +53,16 @@ angular.module('emission.incident.posttrip.map',['ui-leaflet', 'ng-walkthrough',
}
};
Logger.log("About to query buffer for "+JSON.stringify(tq));
$ionicLoading.show({
template: 'Loading...'
});
UnifiedDataLoader.getUnifiedSensorDataForInterval(LOC_KEY, tq)
// .then(PostTripManualMarker.addLatLng)
.then(function(resultList) {
Logger.log("Read data of length "+resultList.length);
$ionicLoading.show({
template: 'Mapping '+resultList.length+' points'
});
if (resultList.length > 0) {
// $scope.mapCtrl.cache.points = PostTripManualMarker.addLatLng(resultList);
// $scope.mapCtrl.cache.points = resultList;
Expand Down Expand Up @@ -126,13 +132,27 @@ angular.module('emission.incident.posttrip.map',['ui-leaflet', 'ng-walkthrough',
$scope.mapCtrl.cache.features));
});
}
$ionicLoading.hide();
})
.catch(function(error) {
var errStr = JSON.stringify(error);
$ionicLoading.hide();
Logger.log(errStr);
$ionicPopup.alert({
title: "Unable to retrieve data",
template: errStr
});
});
}

$scope.refreshWholeMap = function() {
$scope.refreshMap($scope.mapCtrl.start_ts, $scope.mapCtrl.end_ts);
}

$scope.refreshTiles = function() {
$scope.$broadcast('invalidateSize');
};

$scope.getFormattedDate = DiaryHelper.getFormattedDate;
$scope.getFormattedTime = DiaryHelper.getFormattedTime;
$scope.refreshMap($scope.mapCtrl.start_ts, $scope.mapCtrl.end_ts);
Expand Down Expand Up @@ -174,6 +194,10 @@ angular.module('emission.incident.posttrip.map',['ui-leaflet', 'ng-walkthrough',
startWalkthrough();
}

$scope.closeView = function () {
$state.go('root.main.control');
}

$scope.$on('$ionicView.afterEnter', function(ev) {
// Workaround from
// https://github.com/driftyco/ionic/issues/3433#issuecomment-195775629
Expand Down
7 changes: 5 additions & 2 deletions www/templates/incident/map.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<ion-view view-title="Incident" class="ion-view-background">
<ion-nav-buttons side="right">
<button class="button button-icon ion-help" ng-click="startWalkthrough()"></button>
<ion-nav-buttons side="right">
<button class="button button-icon ion-help" ng-click="startWalkthrough()"></button>
</ion-nav-buttons>
<ion-nav-buttons side="left">
<button class="button button-icon ion-close" ng-click="closeView()"></button>
</ion-nav-buttons>
<ion-nav-title>{{ getFormattedDate(mapCtrl.start_ts) }}</ion-nav-title>
<ion-content class="has-header" overflow-scroll="true" padding="true">
Expand Down

0 comments on commit de7252b

Please sign in to comment.