2015-02-20 23:15:48 +00:00
|
|
|
(function() {
|
|
|
|
/**
|
|
|
|
* Landing page.
|
|
|
|
*/
|
|
|
|
angular.module('quayPages').config(['pages', function(pages) {
|
|
|
|
pages.create('landing', 'landing.html', LandingCtrl, {
|
|
|
|
'pageClass': 'landing-page'
|
|
|
|
});
|
|
|
|
}]);
|
|
|
|
|
2015-04-08 19:15:21 +00:00
|
|
|
function LandingCtrl($scope, $location, UserService, ApiService, Features, Config) {
|
2015-02-20 23:15:48 +00:00
|
|
|
$scope.currentScreenshot = 'repo-view';
|
2015-07-14 11:00:29 +00:00
|
|
|
$scope.userRegistered = false;
|
2015-02-20 23:15:48 +00:00
|
|
|
|
2015-04-08 19:15:21 +00:00
|
|
|
UserService.updateUserIn($scope, function(user) {
|
2015-06-29 09:33:00 +00:00
|
|
|
if (!user.anonymous) {
|
2015-04-08 19:15:21 +00:00
|
|
|
$location.path('/repository');
|
|
|
|
return;
|
|
|
|
}
|
2015-02-20 23:15:48 +00:00
|
|
|
});
|
|
|
|
|
2015-07-14 11:00:29 +00:00
|
|
|
$scope.handleUserRegistered = function() {
|
|
|
|
$scope.userRegistered = true;
|
|
|
|
};
|
|
|
|
|
2015-02-20 23:15:48 +00:00
|
|
|
$scope.changeScreenshot = function(screenshot) {
|
|
|
|
$scope.currentScreenshot = screenshot;
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.chromify = function() {
|
|
|
|
browserchrome.update();
|
|
|
|
|
|
|
|
var jcarousel = $('.jcarousel');
|
|
|
|
|
|
|
|
jcarousel
|
|
|
|
.on('jcarousel:reload jcarousel:create', function () {
|
|
|
|
var width = jcarousel.innerWidth();
|
|
|
|
jcarousel.jcarousel('items').css('width', width + 'px');
|
|
|
|
})
|
|
|
|
.jcarousel({
|
|
|
|
wrap: 'circular'
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.jcarousel-control-prev')
|
|
|
|
.on('jcarouselcontrol:active', function() {
|
|
|
|
$(this).removeClass('inactive');
|
|
|
|
})
|
|
|
|
.on('jcarouselcontrol:inactive', function() {
|
|
|
|
$(this).addClass('inactive');
|
|
|
|
})
|
|
|
|
.jcarouselControl({
|
|
|
|
target: '-=1'
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.jcarousel-control-next')
|
|
|
|
.on('jcarouselcontrol:active', function() {
|
|
|
|
$(this).removeClass('inactive');
|
|
|
|
})
|
|
|
|
.on('jcarouselcontrol:inactive', function() {
|
|
|
|
$(this).addClass('inactive');
|
|
|
|
})
|
|
|
|
.jcarouselControl({
|
|
|
|
target: '+=1'
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.jcarousel-pagination')
|
|
|
|
.on('jcarouselpagination:active', 'a', function() {
|
|
|
|
$(this).addClass('active');
|
|
|
|
})
|
|
|
|
.on('jcarouselpagination:inactive', 'a', function() {
|
|
|
|
$(this).removeClass('active');
|
|
|
|
})
|
|
|
|
.jcarouselPagination({
|
|
|
|
'item': function(page, carouselItems) {
|
|
|
|
return '<a href="javascript:void(0)" class="jcarousel-page"></a>';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.getEnterpriseLogo = function() {
|
|
|
|
if (!Config.ENTERPRISE_LOGO_URL) {
|
|
|
|
return '/static/img/quay-logo.png';
|
|
|
|
}
|
|
|
|
|
|
|
|
return Config.ENTERPRISE_LOGO_URL;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
})();
|