Move loading tranlations out of an inline script, to make CSP happy.

This commit is contained in:
Mike Cooper 2015-08-18 14:58:58 -07:00
Родитель b0d903dbfc
Коммит 1a20cc25e4
10 изменённых файлов: 9 добавлений и 62 удалений

Просмотреть файл

@ -57,12 +57,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>
<script src="js/libs/async_storage.js"></script>

Просмотреть файл

@ -41,11 +41,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/async_storage.js"></script>

Просмотреть файл

@ -23,15 +23,6 @@
<!-- localization -->
<link rel="prefetch" type="application/l10n" href="data/locales.ini" />
<link rel="prefetch" type="application/l10n" href="data/date/date.ini" />
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/libs/l10n.js" defer></script>
<script src="js/libs/l10n_date.js" defer></script>
</head>
<body class="skin-organic">
<section role="region" class="vbox fit">
@ -72,12 +63,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>
<script src="js/libs/async_storage.js"></script>

Просмотреть файл

@ -1,4 +1,3 @@
console.log('l10n.js loaded');
'use strict';
(function() {

Просмотреть файл

@ -58,12 +58,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>
<script src="js/libs/async_storage.js"></script>

Просмотреть файл

@ -42,11 +42,7 @@
<main id="my-profile" class="fit scroll"></main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>

Просмотреть файл

@ -95,12 +95,7 @@
</menu>
</form>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/async_storage.js" defer></script>
<script src="js/libs/nunjucks-slim.js" defer></script>

Просмотреть файл

@ -41,12 +41,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>
<script src="js/libs/async_storage.js" defer></script>

Просмотреть файл

@ -75,12 +75,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>
<script src="js/libs/async_storage.js" defer></script>

Просмотреть файл

@ -58,12 +58,7 @@
</main>
</section>
<script>
var url = 'translations/' + navigator.language + '.js';
// I'm sorry.
document.write('<script src="' + url + '"><' + '/script>');
</script>
<script src="js/load_translations.js"></script>
<script src="js/settings.js"></script>
<script src="js/libs/async_storage.js"></script>
<script src="js/libs/lodash.custom.min.js"></script>