From d11f973311060020c6cc760f7304488155f40dd7 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sun, 01 Oct 2006 21:12:03 +0000 Subject: moved UI authorization code from flickr object git-svn-id: http://svn.klever.net/kin/fireflix/trunk@176 fe716a7a-6dde-0310-88d9-d003556173a8 --- diff --git a/content/fireflix.js b/content/fireflix.js index 0f01d26..f180379 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -54,7 +54,9 @@ var fireflix = { on_cmd_auth: function() { var _this = this; this.flickr.authorize_0( - function() { + 'delete', + function(x,f,u) { + _this.openTab(u); _this.set_auth_state(_this.flickr.token,true); }, function(x,s,c,m) { _this.flickr_failure(x,s,c,m); diff --git a/content/flickr.js b/content/flickr.js index add628a..b5bfa43 100644 --- a/content/flickr.js +++ b/content/flickr.js @@ -145,21 +145,15 @@ Flickr.prototype = { }, frob: null, - authorize_0: function(on_s, on_f) { + authorize_0: function(perms, on_s, on_f) { var _this = this; this.api_call( { method: 'flickr.auth.getFrob' }, function(x) { _this.frob = xp_str('/rsp/frob',x.responseXML); var u = _this.api_call_url( - { frob: _this.frob, perms: 'delete' }, _this.auth_url ); - var wm = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService( - Components.interfaces.nsIWindowMediator ); - var bw = wm.getMostRecentWindow('navigator:browser'); - var b = bw.getBrowser(); - var t = b.addTab(u); - b.selectedTab = t; - if(on_s) on_s(); + { frob: _this.frob, perms: perms?perms:'delete' }, _this.auth_url ); + if(on_s) on_s(x,_this.frob,u); }, function(x,s,c,m) { if(on_f) on_f(x,s,c,m); } -- cgit v0.9.0.2