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;
|
||||
loadButton.attr("disabled","disabled");
|
||||
$("#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() {
|
||||
self._load();
|
||||
@ -73,6 +77,8 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
|
||||
|
||||
DOM.bind(authorization).signin.click(function() {
|
||||
Sign.signin(function() {
|
||||
$('.signedout').hide();
|
||||
$('.signedin').show();
|
||||
check_authorization(cont);
|
||||
},provider,check_authorization_url);
|
||||
});
|
||||
|
@ -92,12 +92,6 @@ if (typeof window.Sign == 'undefined') {
|
||||
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) {
|
||||
var newwin = window.Sign.popup("/command/core/authorize/" + provider, width, height);
|
||||
|
||||
@ -114,7 +108,7 @@ if (typeof window.Sign == 'undefined') {
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
window.user = data;
|
||||
window.Sign.signintize(success);
|
||||
if (typeof success == 'function') success();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -127,12 +121,6 @@ if (typeof window.Sign == 'undefined') {
|
||||
return false;
|
||||
},
|
||||
|
||||
signoutize : function(cont) {
|
||||
$('.signedin').hide();
|
||||
$('.signedout').show();
|
||||
if (typeof cont == 'function') cont();
|
||||
},
|
||||
|
||||
signout : function(success,provider) {
|
||||
$.ajax({
|
||||
url: "/command/core/deauthorize/" + provider,
|
||||
@ -140,7 +128,7 @@ if (typeof window.Sign == 'undefined') {
|
||||
if (typeof success == 'undefined') {
|
||||
window.location.reload();
|
||||
} else {
|
||||
window.Sign.signoutize(success);
|
||||
if (typeof success == 'function') success();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user