66 lines
No EOL
1.9 KiB
TypeScript
66 lines
No EOL
1.9 KiB
TypeScript
import * as Raven from 'raven-js';
|
|
|
|
|
|
quayConfig.$inject = [
|
|
'$provide',
|
|
'cfpLoadingBarProvider',
|
|
'$tooltipProvider',
|
|
'$compileProvider',
|
|
'RestangularProvider',
|
|
'$analyticsProvider',
|
|
];
|
|
|
|
export function quayConfig(
|
|
$provide,
|
|
cfpLoadingBarProvider,
|
|
$tooltipProvider,
|
|
$compileProvider,
|
|
RestangularProvider,
|
|
$analyticsProvider) {
|
|
cfpLoadingBarProvider.includeSpinner = false;
|
|
|
|
// decorate the tooltip getter
|
|
var tooltipFactory = $tooltipProvider.$get[$tooltipProvider.$get.length - 1];
|
|
$tooltipProvider.$get[$tooltipProvider.$get.length - 1] = function($window: ng.IWindowService) {
|
|
if ('ontouchstart' in $window) {
|
|
var existing = tooltipFactory.apply(this, arguments);
|
|
return function(element) {
|
|
// Note: We only disable bs-tooltip's themselves. $tooltip is used for other things
|
|
// (such as the datepicker), so we need to be specific when canceling it.
|
|
if (element.attr('bs-tooltip') == null) {
|
|
return existing.apply(this, arguments);
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
}
|
|
|
|
return tooltipFactory.apply(this, arguments);
|
|
};
|
|
|
|
if (!(<any>window).__config['DEBUG']) {
|
|
$compileProvider.debugInfoEnabled(false);
|
|
}
|
|
|
|
// Configure compile provider to add additional URL prefixes to the sanitization list. We use
|
|
// these on the Contact page.
|
|
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|irc):/);
|
|
|
|
// Configure the API provider.
|
|
RestangularProvider.setBaseUrl('/api/v1/');
|
|
|
|
// Configure analytics.
|
|
if ((<any>window).__config && (<any>window).__config.MIXPANEL_KEY) {
|
|
$analyticsProvider.virtualPageviews(true);
|
|
}
|
|
|
|
// Configure sentry.
|
|
if ((<any>window).__config && (<any>window).__config.SENTRY_PUBLIC_DSN) {
|
|
$provide.decorator("$exceptionHandler", function($delegate) {
|
|
return function(ex, cause) {
|
|
$delegate(ex, cause);
|
|
Raven.captureException(ex, {extra: {cause: cause}});
|
|
};
|
|
});
|
|
}
|
|
} |