git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@33 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -1,25 +1,28 @@
|
||||
define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classes/cache'], function
|
||||
($, _, Backbone, Router, Profile, Cache) {
|
||||
define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classes/cache', 'libs/fastclick'], function
|
||||
($, _, Backbone, Router, Profile, Cache, FastClick) {
|
||||
'use strict';
|
||||
var init = function () {
|
||||
//create backbone router
|
||||
var router = new Router();
|
||||
|
||||
Backbone.history.start();
|
||||
Backbone.emulateJSON = true;
|
||||
|
||||
|
||||
hello.init({
|
||||
facebook: '1466942266882168',
|
||||
google: '319140243944-qk0lfhgmi8shi4go97r83l69f1k0gdf4.apps.googleusercontent.com'
|
||||
}, {display: 'page', scope: 'email'});
|
||||
|
||||
|
||||
//console.log("Backbone history start");
|
||||
// Trigger 'route' event on router instance.
|
||||
router.on('route', function (name, args) {
|
||||
//alert(name);
|
||||
});
|
||||
|
||||
|
||||
Cache.checkCacheFromServer();
|
||||
|
||||
|
||||
if (Profile.isConnected()) {
|
||||
Profile.loadProfile();
|
||||
}
|
||||
@@ -47,22 +50,22 @@ define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classe
|
||||
email = json.email;
|
||||
gender = json.gender;
|
||||
}
|
||||
Profile.internalLoadProfile(id, function(retVal){
|
||||
if(retVal === false)
|
||||
Profile._loadProfile(id, function (retVal) {
|
||||
if (retVal === false)
|
||||
{
|
||||
Profile.createProfile(
|
||||
id,
|
||||
auth.network,
|
||||
displayName,
|
||||
email,
|
||||
gender,
|
||||
function () {
|
||||
window.location.href = "#syncView/tokenFound";
|
||||
}
|
||||
id,
|
||||
auth.network,
|
||||
displayName,
|
||||
email,
|
||||
gender,
|
||||
function () {
|
||||
window.location.href = "";
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
window.location.href = "#syncView/tokenFound";
|
||||
window.location.href = "";
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user