moving the sign.js in the main refine block as this is potentially useful for all extensions that use the oauth mechanics
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2511 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
bccea8cebe
commit
b634a03dbb
@ -91,7 +91,6 @@ function init() {
|
|||||||
[
|
[
|
||||||
"scripts/extension.js",
|
"scripts/extension.js",
|
||||||
|
|
||||||
"scripts/util/sign.js",
|
|
||||||
"scripts/util/freebase.js",
|
"scripts/util/freebase.js",
|
||||||
|
|
||||||
"scripts/dialogs/freebase-loading-dialog.js",
|
"scripts/dialogs/freebase-loading-dialog.js",
|
||||||
|
@ -47,7 +47,8 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
|
|||||||
var loadButton = this._elmts.loadButton;
|
var loadButton = this._elmts.loadButton;
|
||||||
|
|
||||||
var check_authorization = function(cont) {
|
var check_authorization = function(cont) {
|
||||||
$.get("/command/freebase/check-authorization/" + provider, function(data) {
|
var check_authorization_url = "/command/freebase/check-authorization/" + provider;
|
||||||
|
$.get(check_authorization_url, function(data) {
|
||||||
if ("status" in data && data.code == "/api/status/ok") {
|
if ("status" in data && data.code == "/api/status/ok") {
|
||||||
authorization.html('Signed in as: <a target="_new" href="http://www.freebase.com/view/user/' + data.username + '">' + data.username + '</a> | <a href="javascript:{}" bind="signout">Sign Out</a>').show();
|
authorization.html('Signed in as: <a target="_new" href="http://www.freebase.com/view/user/' + data.username + '">' + data.username + '</a> | <a href="javascript:{}" bind="signout">Sign Out</a>').show();
|
||||||
DOM.bind(authorization).signout.click(function() {
|
DOM.bind(authorization).signout.click(function() {
|
||||||
@ -73,7 +74,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
|
|||||||
DOM.bind(authorization).signin.click(function() {
|
DOM.bind(authorization).signin.click(function() {
|
||||||
Sign.signin(function() {
|
Sign.signin(function() {
|
||||||
check_authorization(cont);
|
check_authorization(cont);
|
||||||
},provider);
|
},provider,check_authorization_url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},"json");
|
},"json");
|
||||||
|
@ -322,6 +322,7 @@ function init() {
|
|||||||
"scripts/util/dom.js",
|
"scripts/util/dom.js",
|
||||||
"scripts/util/date-time.js",
|
"scripts/util/date-time.js",
|
||||||
"scripts/util/encoding.js",
|
"scripts/util/encoding.js",
|
||||||
|
"scripts/util/sign.js",
|
||||||
|
|
||||||
"scripts/index.js",
|
"scripts/index.js",
|
||||||
"scripts/index/create-project-ui.js",
|
"scripts/index/create-project-ui.js",
|
||||||
@ -399,6 +400,7 @@ function init() {
|
|||||||
"scripts/util/date-time.js",
|
"scripts/util/date-time.js",
|
||||||
"scripts/util/custom-suggest.js",
|
"scripts/util/custom-suggest.js",
|
||||||
"scripts/util/encoding.js",
|
"scripts/util/encoding.js",
|
||||||
|
"scripts/util/sign.js",
|
||||||
|
|
||||||
"scripts/widgets/histogram-widget.js",
|
"scripts/widgets/histogram-widget.js",
|
||||||
"scripts/widgets/slider-widget.js",
|
"scripts/widgets/slider-widget.js",
|
||||||
|
@ -95,13 +95,10 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
signintize : function(cont) {
|
signintize : function(cont) {
|
||||||
$('.signedin').show();
|
$('.signedin').show();
|
||||||
$('.signedout').hide();
|
$('.signedout').hide();
|
||||||
if (window.user) {
|
|
||||||
$('.user').html('<a href="http://freebase.com/view' + window.user.id + '">' + window.user.username + '</a>');
|
|
||||||
}
|
|
||||||
if (typeof cont == 'function') cont();
|
if (typeof cont == 'function') cont();
|
||||||
},
|
},
|
||||||
|
|
||||||
signin : function(success, provider, 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);
|
||||||
|
|
||||||
if (newwin !== null) {
|
if (newwin !== null) {
|
||||||
@ -113,7 +110,7 @@ if (typeof window.Sign == 'undefined') {
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/command/freebase/check-authorization/" + provider,
|
url: check_authorization_url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
window.user = data;
|
window.user = data;
|
Loading…
Reference in New Issue
Block a user