2013-03-02 12:01:07 +01:00
|
|
|
var webui = angular.module('webui', [
|
2013-01-29 13:47:40 +01:00
|
|
|
'webui.services.utils', 'webui.services.deps', 'webui.services.base64',
|
2014-06-02 21:36:21 +02:00
|
|
|
'webui.services.configuration', 'webui.services.rpc',
|
2013-02-22 19:28:10 +01:00
|
|
|
'webui.services.modals', 'webui.services.alerts',
|
2013-02-15 18:34:10 +01:00
|
|
|
'webui.services.settings', 'webui.services.settings.filters',
|
2015-04-28 19:31:04 +02:00
|
|
|
'webui.filters.bytes','webui.filters.url',
|
2017-07-27 12:31:18 +02:00
|
|
|
'webui.directives.chunkbar', 'webui.directives.dgraph', 'webui.directives.fselect', "webui.directives.fileselect",
|
2013-03-02 12:01:07 +01:00
|
|
|
'webui.ctrls.download', 'webui.ctrls.nav', 'webui.ctrls.modal', 'webui.ctrls.alert',
|
2013-06-23 22:01:15 +02:00
|
|
|
'webui.ctrls.props',
|
2013-03-02 12:01:07 +01:00
|
|
|
// external deps
|
2015-10-28 17:31:35 +01:00
|
|
|
'ui.bootstrap',
|
|
|
|
// translate
|
|
|
|
'pascalprecht.translate'
|
2013-01-29 13:47:40 +01:00
|
|
|
]);
|
2013-01-22 08:59:52 +01:00
|
|
|
|
2015-10-31 03:58:25 +01:00
|
|
|
function mergeTranslation(translation, base) {
|
|
|
|
for (var i in base) {
|
|
|
|
if (!base.hasOwnProperty(i)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!translation[i] || !translation[i].length) {
|
|
|
|
translation[i] = base[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return translation;
|
|
|
|
}
|
|
|
|
|
2017-12-21 18:36:30 +01:00
|
|
|
webui.config(function ($translateProvider, $locationProvider) {
|
2015-10-28 17:31:35 +01:00
|
|
|
$translateProvider
|
2015-10-30 08:42:30 +01:00
|
|
|
.translations('en_US', translations.en_US)
|
2015-10-31 03:58:25 +01:00
|
|
|
.translations('nl_NL', mergeTranslation(translations.nl_NL, translations.en_US))
|
|
|
|
.translations('th_TH', mergeTranslation(translations.th_TH, translations.en_US))
|
|
|
|
.translations('zh_CN', mergeTranslation(translations.zh_CN, translations.en_US))
|
2016-12-23 08:07:58 +01:00
|
|
|
.translations('zh_TW', mergeTranslation(translations.zh_TW, translations.en_US))
|
2016-02-02 16:30:15 +01:00
|
|
|
.translations('pl_PL', mergeTranslation(translations.pl_PL, translations.en_US))
|
2016-02-18 20:51:54 +01:00
|
|
|
.translations('fr_FR', mergeTranslation(translations.fr_FR, translations.en_US))
|
2016-04-23 12:31:50 +02:00
|
|
|
.translations('de_DE', mergeTranslation(translations.de_DE, translations.en_US))
|
2016-04-30 05:23:23 +02:00
|
|
|
.translations('es_ES', mergeTranslation(translations.es_ES, translations.en_US))
|
2016-08-24 13:17:35 +02:00
|
|
|
.translations('ru_RU', mergeTranslation(translations.ru_RU, translations.en_US))
|
2016-09-05 11:43:58 +02:00
|
|
|
.translations('it_IT', mergeTranslation(translations.it_IT, translations.en_US))
|
2016-12-24 16:18:46 +01:00
|
|
|
.translations('tr_TR', mergeTranslation(translations.tr_TR, translations.en_US))
|
2017-04-08 00:04:23 +02:00
|
|
|
.translations('cs_CZ', mergeTranslation(translations.cs_CZ, translations.en_US))
|
2018-01-14 15:13:23 +01:00
|
|
|
.translations('fa_IR', mergeTranslation(translations.fa_IR, translations.en_US))
|
2018-02-17 13:59:00 +01:00
|
|
|
.translations('id_ID', mergeTranslation(translations.id_ID, translations.en_US))
|
2018-04-09 20:49:37 +02:00
|
|
|
.translations('pt_BR', mergeTranslation(translations.pt_BR, translations.en_US))
|
2017-01-04 05:07:07 +01:00
|
|
|
.useSanitizeValueStrategy('escapeParameters')
|
2015-10-29 16:08:18 +01:00
|
|
|
.determinePreferredLanguage();
|
2017-12-21 18:36:30 +01:00
|
|
|
|
|
|
|
$locationProvider.html5Mode({
|
|
|
|
enabled: true,
|
|
|
|
requireBase: false
|
|
|
|
});
|
|
|
|
});
|
2015-10-28 17:31:35 +01:00
|
|
|
|
2013-01-15 09:24:09 +01:00
|
|
|
$(function() {
|
2014-02-28 12:39:34 +01:00
|
|
|
if (!String.prototype.startsWith) {
|
|
|
|
Object.defineProperty(String.prototype, 'startsWith', {
|
|
|
|
enumerable: false, configurable: false, writable: false,
|
|
|
|
value: function (searchString, position) {
|
|
|
|
position = position || 0;
|
|
|
|
return this.indexOf(searchString, position) === position;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2013-03-02 12:01:07 +01:00
|
|
|
angular.bootstrap(document, ['webui'])
|
2013-01-15 09:24:09 +01:00
|
|
|
});
|