From 89270677971690f90fc33c919bf40f7c1e6d82ef Mon Sep 17 00:00:00 2001 From: Dan Ziv Date: Sat, 28 Jan 2017 14:33:12 +0200 Subject: [PATCH] adding version display in the ui --- controllers/popup.controller.js | 65 ++++++++++++++++++--------------- pages/popup.html | 4 ++ 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/controllers/popup.controller.js b/controllers/popup.controller.js index a84dbe8..e3ae42e 100755 --- a/controllers/popup.controller.js +++ b/controllers/popup.controller.js @@ -1,44 +1,44 @@ // Initialize Angular -var app = angular.module('releaseVersion', ['ngMaterial', 'ngRoute', 'ig.linkHeaderParser']) - .config(['$routeProvider', - function ($routeProvider) { +var app = angular.module( 'releaseVersion', [ 'ngMaterial', 'ngRoute', 'ig.linkHeaderParser' ] ) + .config( [ '$routeProvider', + function ( $routeProvider ) { $routeProvider - // .when('/home', { - // templateUrl: 'test.html', - // controller: 'testController' - // }) - .when('/home', { + // .when('/home', { + // templateUrl: 'test.html', + // controller: 'testController' + // }) + .when( '/home', { templateUrl: 'home.html', controller: 'homeController' - }) - .when('/sign-in', { + } ) + .when( '/sign-in', { templateUrl: 'sign-in.html', controller: 'signInController' - }) - .when('/commit', { + } ) + .when( '/commit', { templateUrl: '1-commit.html', controller: 'commitController' - }) - .when('/tag-repo', { + } ) + .when( '/tag-repo', { templateUrl: '2-tag.html', controller: 'tagRepoController' - }) - .when('/release-notes-github', { + } ) + .when( '/release-notes-github', { templateUrl: '4-release-notes-github.html', controller: 'releaseNotesGitHubController', - }) - .when('/release-notes-confluence', { + } ) + .when( '/release-notes-confluence', { templateUrl: '3-release-notes-confluence.html', controller: 'releaseNotesConfluenceController', - }) - .when('/edit-tickets', { + } ) + .when( '/edit-tickets', { templateUrl: '5-edit-tickets.html', controller: 'editTicketsController', - }); - }]); + } ); + } ] ); -app.controller('popupController', ['$scope', '$location', '$timeout', 'User', - function ($scope, $location, $timeout, User) { +app.controller( 'popupController', [ '$scope', '$location', '$timeout', 'User', + function ( $scope, $location, $timeout, User ) { $scope.global = { isAuthenticated: false, @@ -49,14 +49,19 @@ app.controller('popupController', ['$scope', '$location', '$timeout', 'User', prerelease: true }; + $scope.getManifestVersion = function () { + var manifest = chrome.runtime.getManifest(); + return manifest.version; + }; + $scope.onPopupShown = function () { - User.hasToken().then(function (hasToken) { - if (hasToken) { - $location.path('/home'); + User.hasToken().then( function ( hasToken ) { + if ( hasToken ) { + $location.path( '/home' ); } else { - $location.path('/sign-in'); + $location.path( '/sign-in' ); } - }); + } ); }; - }]); + } ] ); diff --git a/pages/popup.html b/pages/popup.html index 37e6a67..15ce392 100755 --- a/pages/popup.html +++ b/pages/popup.html @@ -62,6 +62,10 @@
+
+
Version {{getManifestVersion()}}
+
+