further cleanup, sign.js should not contain presentation-related code
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2512 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
b634a03dbb
commit
3b8701aeee
@ -55,7 +55,11 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
|
|||||||
self._signedin = false;
|
self._signedin = false;
|
||||||
loadButton.attr("disabled","disabled");
|
loadButton.attr("disabled","disabled");
|
||||||
$("#freebase-loading-graph-selector-freebase").attr("disabled","disabled").button("refresh");
|
$("#freebase-loading-graph-selector-freebase").attr("disabled","disabled").button("refresh");
|
||||||
Sign.signout(check_authorization,provider);
|
Sign.signout(function() {
|
||||||
|
$('.signedin').hide();
|
||||||
|
$('.signedout').show();
|
||||||
|
check_authorization();
|
||||||
|
},provider);
|
||||||
});
|
});
|
||||||
loadButton.unbind().click(function() {
|
loadButton.unbind().click(function() {
|
||||||
self._load();
|
self._load();
|
||||||
@ -73,6 +77,8 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
|
|||||||
|
|
||||||
DOM.bind(authorization).signin.click(function() {
|
DOM.bind(authorization).signin.click(function() {
|
||||||
Sign.signin(function() {
|
Sign.signin(function() {
|
||||||
|
$('.signedout').hide();
|
||||||
|
$('.signedin').show();
|
||||||
check_authorization(cont);
|
check_authorization(cont);
|
||||||
},provider,check_authorization_url);
|
},provider,check_authorization_url);
|
||||||
});
|
});
|
||||||
|
@ -92,12 +92,6 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
return window.open(url, windowname || "", params_list.join(","));
|
return window.open(url, windowname || "", params_list.join(","));
|
||||||
},
|
},
|
||||||
|
|
||||||
signintize : function(cont) {
|
|
||||||
$('.signedin').show();
|
|
||||||
$('.signedout').hide();
|
|
||||||
if (typeof cont == 'function') cont();
|
|
||||||
},
|
|
||||||
|
|
||||||
signin : function(success, provider, check_authorization_url, width, height) {
|
signin : function(success, provider, check_authorization_url, width, height) {
|
||||||
var newwin = window.Sign.popup("/command/core/authorize/" + provider, width, height);
|
var newwin = window.Sign.popup("/command/core/authorize/" + provider, width, height);
|
||||||
|
|
||||||
@ -114,7 +108,7 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
window.user = data;
|
window.user = data;
|
||||||
window.Sign.signintize(success);
|
if (typeof success == 'function') success();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -127,12 +121,6 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
signoutize : function(cont) {
|
|
||||||
$('.signedin').hide();
|
|
||||||
$('.signedout').show();
|
|
||||||
if (typeof cont == 'function') cont();
|
|
||||||
},
|
|
||||||
|
|
||||||
signout : function(success,provider) {
|
signout : function(success,provider) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/command/core/deauthorize/" + provider,
|
url: "/command/core/deauthorize/" + provider,
|
||||||
@ -140,7 +128,7 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
if (typeof success == 'undefined') {
|
if (typeof success == 'undefined') {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
window.Sign.signoutize(success);
|
if (typeof success == 'function') success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user