Add UI polishing to the token auth stuff

This commit is contained in:
Joseph Schorr 2013-10-17 14:46:23 -04:00
parent 283f9b81ae
commit faf6a5c497
6 changed files with 152 additions and 34 deletions

View file

@ -1,3 +1,17 @@
$.fn.clipboardCopy = function() {
var clip = new ZeroClipboard($(this), { 'moviePath': 'static/lib/ZeroClipboard.swf' });
clip.on('complete', function() {
// Resets the animation.
var elem = $('#clipboardCopied')[0];
elem.style.display = 'none';
// Show the notification.
setTimeout(function() {
elem.style.display = 'inline-block';
}, 1);
});
};
function getFirstTextLine(commentString) {
if (!commentString) { return; }
@ -354,18 +368,7 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
$scope.currentTag = repo.tags[tag] || repo.tags['latest'];
$scope.setImage($scope.currentTag.image);
var clip = new ZeroClipboard($('#copyClipboard'), { 'moviePath': 'static/lib/ZeroClipboard.swf' });
clip.on('complete', function() {
// Resets the animation.
var elem = $('#clipboardCopied')[0];
elem.style.display = 'none';
// Show the notification.
setTimeout(function() {
elem.style.display = 'block';
}, 1);
});
$('#copyClipboard').clipboardCopy();
$scope.loading = false;
}, function() {
$scope.repo = null;
@ -378,6 +381,13 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
}
function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
$('.info-icon').popover({
'trigger': 'hover',
'html': true
});
$('#copyClipboard').clipboardCopy();
var namespace = $routeParams.namespace;
var name = $routeParams.name;