function prepareUsageMenu() {
		var usedProgress = $('#usage-menu-entry > :first-child');
		var freeProgress = $('#usage-menu-entry > :last-child');
		$('.nimbus-menu').on('show.bs.dropdown', function() {
			usedProgress.text('').removeClass('bg-danger bg-warning bg-primary').addClass('progress-bar-striped progress-bar-animated');
			freeProgress.text('');
			$.get('/items/quota').then(function(result) {
				var usedPct = Math.round(result.usedSpace * 100.0 / result.maxSpace);
				var freePct = Math.round(result.freeSpace * 100.0 / result.maxSpace);
				var statusClass = usedPct > result.clientQuotaDanger ? 'bg-danger' : usedPct > result.clientQuotaWarning ? 'bg-warning' : 'bg-primary';
				usedProgress
					.css('width', usedPct + '%')
					.text(usedPct >= 20 ? NIMBUS.translate('MainToolbarUsageUsed', NIMBUS.formatLength(result.usedSpace)) : '')
					.addClass(statusClass).removeClass('progress-bar-striped progress-bar-animated');
				freeProgress
					.css('width', freePct + '%')
					.text(freePct >= 20 ? NIMBUS.translate('MainToolbarUsageFree', NIMBUS.formatLength(result.freeSpace)) : '');
			});
		});
	}
/** Afficher le quota dans le menu */
Afficher le quota dans le menu
Afficher le quota dans le menu
function prepareUsageMenu() {
		var usedProgress = $('#usage-menu-entry > :first-child');
		var freeProgress = $('#usage-menu-entry > :last-child');
		$('.nimbus-menu').on('show.bs.dropdown', function() {
			usedProgress.text('').removeClass('bg-danger bg-warning bg-primary').addClass('progress-bar-striped progress-bar-animated');
			freeProgress.text('');
			$.get('/items/quota').then(function(result) {
				var usedPct = Math.round(result.usedSpace * 100.0 / result.maxSpace);
				var freePct = Math.round(result.freeSpace * 100.0 / result.maxSpace);
				var statusClass = usedPct > result.clientQuotaDanger ? 'bg-danger' : usedPct > result.clientQuotaWarning ? 'bg-warning' : 'bg-primary';
				usedProgress
					.css('width', usedPct + '%')
					.text(usedPct >= 20 ? NIMBUS.translate('MainToolbarUsageUsed', NIMBUS.formatLength(result.usedSpace)) : '')
					.addClass(statusClass).removeClass('progress-bar-striped progress-bar-animated');
				freeProgress
					.css('width', freePct + '%')
					.text(freePct >= 20 ? NIMBUS.translate('MainToolbarUsageFree', NIMBUS.formatLength(result.freeSpace)) : '');
			});
		});
	}
function prepareUsageMenu ( ) { var usedProgress = $ ( '#usage-menu-entry > :first-child' ) ; var freeProgress = $ ( '#usage-menu-entry > :last-child' ) ; $ ( '.nimbus-menu' ) . on ( 'show.bs.dropdown' , function ( ) { usedProgress . text ( '' ) . removeClass ( 'bg-danger bg-warning bg-primary' ) . addClass ( 'progress-bar-striped progress-bar-animated' ) ; freeProgress . text ( '' ) ; $ . get ( '/items/quota' ) . then ( function ( result ) { var usedPct = Math . round ( result . usedSpace * 100.0 / result . maxSpace ) ; var freePct = Math . round ( result . freeSpace * 100.0 / result . maxSpace ) ; var statusClass = usedPct > result . clientQuotaDanger ? 'bg-danger' : usedPct > result . clientQuotaWarning ? 'bg-warning' : 'bg-primary' ; usedProgress . css ( 'width' , usedPct + '%' ) . text ( usedPct >= 20 ? NIMBUS . translate ( 'MainToolbarUsageUsed' , NIMBUS . formatLength ( result . usedSpace ) ) : '' ) . addClass ( statusClass ) . removeClass ( 'progress-bar-striped progress-bar-animated' ) ; freeProgress . css ( 'width' , freePct + '%' ) . text ( freePct >= 20 ? NIMBUS . translate ( 'MainToolbarUsageFree' , NIMBUS . formatLength ( result . freeSpace ) ) : '' ) ; } ) ; } ) ; }
Afficher le quota dans le menu
Afficher le quota dans le menu