Files

33 lines
1.2 KiB
JavaScript

define(['jquery','underscore', 'backbone', 'router', 'classes/profile'],
function($, _, Backbone, Router, Profile) {
var Application={
_retThis: function() {
return this;
},
router: null,
initialize:function(){
//create backbone router
this.router=new Router();
Backbone.history.start();
Backbone.emulateJSON = true;
var origin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + (location.pathname?location.pathname:'');
openFB.init('1466942266882168', origin, window.localStorage);
openGPlus.init('319140243944-qk0lfhgmi8shi4go97r83l69f1k0gdf4.apps.googleusercontent.com', origin, window.localStorage);
//console.log("Backbone history start");
// Trigger 'route' event on router instance.
this.router.on('route', function(name, args) {
//alert(name);
});
if( Profile.isConnected()) {
Profile.loadProfile();
}
$('body').css('background-color', '');
$('#loadingFrm').remove();
}
};
return Application._retThis();
});