From 3b8701aeee490db6370f6e6382b7370df9234b64 Mon Sep 17 00:00:00 2001 From: Stefano Mazzocchi Date: Thu, 12 Jul 2012 01:54:24 +0000 Subject: [PATCH] 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 --- .../scripts/dialogs/freebase-loading-dialog.js | 8 +++++++- main/webapp/modules/core/scripts/util/sign.js | 16 ++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js index a18e7791c..23438351c 100644 --- a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js +++ b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js @@ -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); }); diff --git a/main/webapp/modules/core/scripts/util/sign.js b/main/webapp/modules/core/scripts/util/sign.js index 795ea1d67..58fd32d1b 100644 --- a/main/webapp/modules/core/scripts/util/sign.js +++ b/main/webapp/modules/core/scripts/util/sign.js @@ -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(); } } });