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 ( {
baseUrl : 'js/cryptalk_modules/' ,
paths : {
websocket : 'https://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js' ,
2014-09-21 19:04:52 -04:00
// Newer version:
// We'll have to fix the Access Control issue first though (https://github.com/Automattic/socket.io-client/issues/641).
// websocket: 'https://cdn.socket.io/socket.io-1.1.0.js',
2014-09-18 12:21:07 -04:00
aes : 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js' ,
domReady : 'https://cdnjs.cloudflare.com/ajax/libs/require-domReady/2.0.1/domReady.min.js'
} ,
// 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-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 ;
} ) ;