93 lines
2.4 KiB
JavaScript
93 lines
2.4 KiB
JavaScript
(function() {
|
|
/**
|
|
* Landing page.
|
|
*/
|
|
angular.module('quayPages').config(['pages', function(pages) {
|
|
pages.create('landing', 'landing.html', LandingCtrl, {
|
|
'pageClass': 'landing-page'
|
|
});
|
|
}]);
|
|
|
|
function LandingCtrl($scope, $location, UserService, ApiService, Features, Config) {
|
|
$scope.currentScreenshot = 'repo-view';
|
|
$scope.userRegistered = false;
|
|
|
|
if (!Config['SETUP_COMPLETE'] && !Features.BILLING) {
|
|
$location.path('/setup');
|
|
return;
|
|
}
|
|
|
|
UserService.updateUserIn($scope, function(user) {
|
|
if (!user.anonymous) {
|
|
$location.path('/repository');
|
|
return;
|
|
}
|
|
});
|
|
|
|
$scope.handleUserRegistered = function() {
|
|
$scope.userRegistered = true;
|
|
};
|
|
|
|
$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/QuayEnterprise_horizontal_color.svg';
|
|
}
|
|
|
|
return Config.ENTERPRISE_LOGO_URL;
|
|
};
|
|
}
|
|
})();
|