diff --git a/www/index.html b/www/index.html index 3f51bbe..3eef26c 100644 --- a/www/index.html +++ b/www/index.html @@ -63,8 +63,6 @@ - - diff --git a/www/js/app.js b/www/js/app.js index b6c1f57..9fe6de6 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -9,13 +9,11 @@ angular.module('emission', ['ionic', 'emission.controllers','emission.services', 'emission.plugin.logger', - 'emission.splash.customURLScheme', 'emission.splash.referral', 'emission.services.email', 'emission.intro', 'emission.main', 'pascalprecht.translate']) -.run(function($ionicPlatform, $rootScope, $http, Logger, - CustomURLScheme, ReferralHandler) { +.run(function($ionicPlatform, $rootScope, $http, Logger) { console.log("Starting run"); // alert("Starting run"); $ionicPlatform.ready(function() { diff --git a/www/js/splash/customURL.js b/www/js/splash/customURL.js deleted file mode 100644 index 17f3385..0000000 --- a/www/js/splash/customURL.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -angular.module('emission.splash.customURLScheme', []) - -.factory('CustomURLScheme', function($rootScope) { - var cus = {}; - - var parseURL = function(url) { - var addr = url.split('//')[1]; - var route = addr.split('?')[0]; - var params = addr.split('?')[1]; - var paramsList = params.split('&'); - var rtn = {route: route}; - for (var i = 0; i < paramsList.length; i++) { - var splitList = paramsList[i].split('='); - rtn[splitList[0]] = splitList[1]; - } - return rtn; - }; - - /* - * Register a custom URL handler. - * handler arguments are: - * - * event: - * url: the url that was passed in - * urlComponents: the URL parsed into multiple components - */ - cus.onLaunch = function(handler) { - console.log("onLaunch method from factory called"); - $rootScope.$on("CUSTOM_URL_LAUNCH", function(event, url) { - var urlComponents = parseURL(url); - handler(event, url, urlComponents); - }); - }; - - return cus; -}); - -function handleOpenURL(url) { - console.log("onLaunch method from external function called"); - var c = document.querySelectorAll("[ng-app]")[0]; - var scope = angular.element(c).scope(); - scope.$broadcast("CUSTOM_URL_LAUNCH", url); -}; - diff --git a/www/js/splash/referral.js b/www/js/splash/referral.js deleted file mode 100644 index acafb59..0000000 --- a/www/js/splash/referral.js +++ /dev/null @@ -1,41 +0,0 @@ -angular.module('emission.splash.referral', ['emission.plugin.kvstore']) - -.factory('ReferralHandler', function($window, KVStore) { - var referralHandler = {}; - - var REFERRAL_NAVIGATION_KEY = 'referral_navigation'; - var REFERRED_KEY = 'referred'; - var REFERRED_GROUP_ID = 'referred_group_id'; - var REFERRED_USER_ID = 'referred_user_id'; - - referralHandler.getReferralNavigation = function() { - toReturn = KVStore.getDirect(REFERRAL_NAVIGATION_KEY); - KVStore.remove(REFERRAL_NAVIGATION_KEY); - return toReturn; - } - - referralHandler.setupGroupReferral = function(kvList) { - KVStore.set(REFERRED_KEY, true); - KVStore.set(REFERRED_GROUP_ID, kvList['groupid']); - KVStore.set(REFERRED_USER_ID, kvList['userid']); - KVStore.set(REFERRAL_NAVIGATION_KEY, 'goals'); - }; - - referralHandler.clearGroupReferral = function(kvList) { - KVStore.remove(REFERRED_KEY); - KVStore.remove(REFERRED_GROUP_ID); - KVStore.remove(REFERRED_USER_ID); - KVStore.remove(REFERRAL_NAVIGATION_KEY); - }; - - referralHandler.getReferralParams = function(kvList) { - return [KVStore.getDirect(REFERRED_GROUP_ID), - KVStore.getDirect(REFERRED_USER_ID)]; - } - - referralHandler.hasPendingRegistration = function() { - return KVStore.getDirect(REFERRED_KEY) - }; - - return referralHandler; -}); diff --git a/www/js/splash/startprefs.js b/www/js/splash/startprefs.js index 1682c50..90ee88a 100644 --- a/www/js/splash/startprefs.js +++ b/www/js/splash/startprefs.js @@ -1,9 +1,8 @@ angular.module('emission.splash.startprefs', ['emission.plugin.logger', - 'emission.splash.referral', 'emission.plugin.kvstore']) .factory('StartPrefs', function($window, $state, $interval, $rootScope, $ionicPlatform, - $ionicPopup, KVStore, storage, $http, Logger, ReferralHandler) { + $ionicPopup, KVStore, storage, $http, Logger) { var logger = Logger; var nTimesCalled = 0; var startprefs = {}; @@ -164,7 +163,6 @@ angular.module('emission.splash.startprefs', ['emission.plugin.logger', startprefs.getNextState = function() { return startprefs.getPendingOnboardingState().then(function(result){ if (result == null) { - var temp = ReferralHandler.getReferralNavigation(); if ($rootScope.tripConfirmParams) { logger.log("Showing tripconfirm from startprefs"); var startEndParams = $rootScope.tripConfirmParams; @@ -186,16 +184,8 @@ angular.module('emission.splash.startprefs', ['emission.plugin.logger', var changeState = function(destState) { logger.log('changing state to '+destState); console.log("loading "+destState); - // TODO: Fix this the right way when we fix the FSM - // https://github.com/e-mission/e-mission-phone/issues/146#issuecomment-251061736 - var reload = false; - if (($state.$current == destState.state) && ($state.$current.name == 'root.main.goals')) { - reload = true; - } $state.go(destState.state, destState.params).then(function() { - if (reload) { - $rootScope.$broadcast("RELOAD_GOAL_PAGE_FOR_REFERRAL") - } + logger.log("state change to "+destState+" was successful"); }); }; diff --git a/www/templates/main-goals.html b/www/templates/main-goals.html deleted file mode 100644 index 29eb225..0000000 --- a/www/templates/main-goals.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - -
-
- - -

{{gainedGold}}

- -

{{gainedExp}}

-
-
- - -

{{lossHp}}

-
-
- - -
-
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- - -
-

{{hp}}/{{profile.stats.maxHealth}}

-

Health

-
-
-
- - -
-

{{profile.stats.exp}}/{{profile.stats.toNextLevel}}

-

Experience

-
-
-
-

{{gold}}

-

{{silver}}

-

{{gem}}

-
-
-
- - -

{{profile.profile.name}}

-
-

Level: {{profile.stats.lvl}}

-
-
-
-
-
- - - -
-
-
-
- - - -
-

{{challenge.name}}

-

{{challenge.description}}

-

Prize: {{challenge.prize}} gems

- - -

Scroll down

-
-
-
-
-
-
- -
- Create a party - - -
- -
- Your group leader has requested you to join a quest. -
- - -
-
- -
- Please wait for the next quest to start... - - -
-
-
- -
- Please wait for your members to accept the quest. - -
-
-
- -

{{partyName}}

-
- -
-
-
{{bossName}}
- -

{{bossHp}}/{{bossMaxHealth}}

- -
-
-

{{questNote}}

-
-
-
-
-
- - - - - -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-

{{goal.name}}

-

{{goal.note}}

-
- - Delete -
-
-
-
-
-
-

Signup

- - - - -
-
-
- diff --git a/www/templates/main.html b/www/templates/main.html index afb6cf0..1a0f830 100644 --- a/www/templates/main.html +++ b/www/templates/main.html @@ -11,11 +11,6 @@ - -