summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-11-10 14:46:23 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-11-10 14:46:23 -0500
commitfa336e58a6cf20814f5bad252d2b5aa49014abfe (patch)
treebd4fa2c868aef8b10be0e1c371e343174a995549
parentedc8404f49bada3f8105f129afba887c39aaa207 (diff)
#756 - warm and fuzzy first use display
Former-commit-id: 6e2d23af7e58b7239e82090edb6f835f145e7389
-rw-r--r--www/js/FirstUseCtrl.js33
-rw-r--r--www/js/LoginCtrl.js1
-rw-r--r--www/js/PortalLoginCtrl.js11
-rw-r--r--www/js/app.js9
-rw-r--r--www/templates/first-use.html31
5 files changed, 83 insertions, 2 deletions
diff --git a/www/js/FirstUseCtrl.js b/www/js/FirstUseCtrl.js
new file mode 100644
index 00000000..3a31bb71
--- /dev/null
+++ b/www/js/FirstUseCtrl.js
@@ -0,0 +1,33 @@
+/* jshint -W041 */
+/* jslint browser: true*/
+/* global cordova,StatusBar,angular,console */
+
+angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state) {
+$scope.openMenu = function () {
+ $ionicSideMenuDelegate.toggleLeft();
+ };
+
+
+
+ //-------------------------------------------------------------------------
+ // Controller Main
+ //------------------------------------------------------------------------
+ $scope.$on('$ionicView.enter', function () {
+ console.log("**VIEW ** FirstUse Ctrl Entered");
+ $ionicSideMenuDelegate.canDragContent(false);
+
+
+ });
+
+ $scope.goToLogin = function()
+ {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: false,
+ disableBack: true
+ });
+ $state.go ("login");
+ };
+
+
+
+}]);
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 89bde3c0..17a6daf0 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -153,6 +153,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
function saveItems()
{
console.log('Saving login');
+ ZMDataModel.setFirstUse(false);
/*if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) {
$ionicPopup.alert({
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index 2ea43f21..60782dcf 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -126,8 +126,15 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
} else {
ZMDataModel.zmDebug("PortalLogin: Not logged in, so going to login");
- $state.go('login');
-
+ if (ZMDataModel.isFirstUse())
+ {
+ ZMDataModel.zmDebug ("First use, showing warm and fuzzy...");
+ $state.go('first-use');
+ }
+ else
+ {
+ $state.go('login');
+ }
}
});
diff --git a/www/js/app.js b/www/js/app.js
index 4d076f30..47bda7e5 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -981,6 +981,15 @@ angular.module('zmApp', [
templateUrl: "templates/zm-portal-login.html",
controller: 'zmApp.PortalLoginCtrl',
})
+
+ .state('first-use', {
+ data: {
+ requireLogin: false
+ },
+ url: "/first-use",
+ templateUrl: "templates/first-use.html",
+ controller: 'zmApp.FirstUseCtrl',
+ })
.state('montage', {
data: {
diff --git a/www/templates/first-use.html b/www/templates/first-use.html
new file mode 100644
index 00000000..81132395
--- /dev/null
+++ b/www/templates/first-use.html
@@ -0,0 +1,31 @@
+<ion-view view-title="zmNinja" hide-nav-bar="true" hide-back-button="true" cache-view="false">
+ <ion-content class="pin-background">
+ <div style="margin-left:20px; margin-right:20px">
+ <center>
+ <br/>
+ <br/>
+ <div id="responsive-image">
+ <img src="img/authlogo.png">
+ </div>
+
+
+ <br/>
+ <span style="color:white">
+ <h2 style="color:white" >Hi There!</h2>
+ <br/>
+ <h4 style="color:white">Thanks for using zmNinja. <br/><br/>
+ I need to know your ZoneMinder login and path details to get started.</h4>
+ <br/>
+
+ </span>
+ <br/>
+ <button id="firstuse" class="button button-stable animated bounceInUp" ng-click="goToLogin()">
+ Let's Get Started!
+ </button>
+
+ </div>
+ </center>
+ </div>
+
+ </ion-content>
+</ion-view> \ No newline at end of file