cryptalk/public/js/bootstrap.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-09-18 12:21:07 -04:00
// This Javascript file is the only file besides fandango.js that will be fetched through DOM.
// Setup fandango
fandango.defaults({
2014-09-18 12:21:07 -04:00
baseUrl: 'js/cryptalk_modules/',
2014-09-18 12:21:07 -04:00
paths: {
websocket: '/socket.io/socket.io.js',
2014-09-18 12:21:07 -04:00
aes: 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js',
SHA1: 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/sha1.js'
2014-09-18 12:21:07 -04:00
},
// CryptoJs AES does not support AMD modules. We'll have to create a shim.
shim: {
aes: {
exports: function () { // String (the global variable name) or a function; returning the desired variable.
return CryptoJS.AES;
}
2014-09-25 04:00:42 -04:00
},
2014-09-25 04:15:41 -04:00
SHA1: {
2014-09-25 04:00:42 -04:00
exports: function () {
2014-09-25 04:15:41 -04:00
return CryptoJS.SHA1;
2014-09-25 04:00:42 -04:00
}
2014-09-18 12:21:07 -04:00
}
}
});
2014-09-21 13:53:57 -04:00
// Require main cryptalk module.
require(['cryptalk'], function () {}, function (e) {
document.getElementById('chat').innerHTML = '<li><i class="fatal">Fatal: An error was thrown during initialization causing the application to stop.<br>Examine the logs for more details.</i></li>';
2014-09-24 11:20:20 -04:00
if (console.log) {
console.log(e);
}
2014-09-21 13:53:57 -04:00
throw e;
2014-09-25 04:00:42 -04:00
});