29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
define(['jquery','underscore', 'backbone', 'router', 'classes/profile'],function
|
|
($, _, Backbone,Router, Profile) {
|
|
'use strict';
|
|
var init=function(){
|
|
//create backbone router
|
|
var 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.
|
|
router.on('route', function(name, args) {
|
|
//alert(name);
|
|
});
|
|
|
|
if( Profile.isConnected()) {
|
|
Profile.loadProfile();
|
|
}
|
|
|
|
$('body').css('background-color', '');
|
|
$('#loadingFrm').remove();
|
|
};
|
|
|
|
return {
|
|
initialize:init
|
|
};
|
|
}); |