Skip to content

Commit

Permalink
adding version display in the ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv committed Jan 28, 2017
1 parent 81d9422 commit 8927067
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
65 changes: 35 additions & 30 deletions controllers/popup.controller.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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' );
}
});
} );
};
}]);
} ] );
4 changes: 4 additions & 0 deletions pages/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@

<div ng-view></div>

<div style="position: fixed; bottom: 2px; width: 100%;">
<center>Version {{getManifestVersion()}}</center>
</div>

</md-content>
</md-card>
</body>
Expand Down

0 comments on commit 8927067

Please sign in to comment.