Setup modules, Gruntfile, File Structure, etc
This commit is contained in:
29
template/js/app.js
Normal file
29
template/js/app.js
Normal file
@ -0,0 +1,29 @@
|
||||
// DOMContentLoaded is fired once the document has been loaded and parsed,
|
||||
// but without waiting for other external resources to load (css/images/etc)
|
||||
// That makes the app more responsive and perceived as faster.
|
||||
// https://developer.mozilla.org/Web/Reference/Events/DOMContentLoaded
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// We'll ask the browser to use strict code to help us catch errors earlier.
|
||||
// https://developer.mozilla.org/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode
|
||||
'use strict';
|
||||
|
||||
var translate = navigator.mozL10n.get;
|
||||
|
||||
// We want to wait until the localisations library has loaded all the strings.
|
||||
// So we'll tell it to let us know once it's ready.
|
||||
navigator.mozL10n.once(start);
|
||||
|
||||
// ---
|
||||
|
||||
function start() {
|
||||
|
||||
var message = document.getElementById('message');
|
||||
|
||||
// We're using textContent because inserting content from external sources into your page using innerHTML can be dangerous.
|
||||
// https://developer.mozilla.org/Web/API/Element.innerHTML#Security_considerations
|
||||
message.textContent = translate('message');
|
||||
|
||||
}
|
||||
|
||||
});
|
1571
template/js/libs/l10n.js
Normal file
1571
template/js/libs/l10n.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user