From 34f9b07d46f8da3b2756f391d6e175039cdca0ce Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 5 Aug 2010 00:33:40 +0200 Subject: [PATCH] reorder functions --- OxFF/chrome/content/browser.xul | 1 - OxFF/components/OxFF.js | 55 +++++++++++++++++---------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/OxFF/chrome/content/browser.xul b/OxFF/chrome/content/browser.xul index 1b51c72..b3e1b0d 100644 --- a/OxFF/chrome/content/browser.xul +++ b/OxFF/chrome/content/browser.xul @@ -1,6 +1,5 @@ - diff --git a/OxFF/components/OxFF.js b/OxFF/components/OxFF.js index d83716b..e0a9581 100644 --- a/OxFF/components/OxFF.js +++ b/OxFF/components/OxFF.js @@ -113,24 +113,7 @@ OxFF.prototype = { //nsIOxFF version: "bzr", - login: function(user) { - if(this._user==null) { - this._user = user; - return true; - } - return false; - }, - logout: function(user) { - var _this = this; - this.api('shutdown', function() { - _this._user = null; - }); - return true; - }, - update: function() { - this.api('update', function() {}); - return true; - }, + access: function(request) { if (typeof(request) == 'undefined') request = false; var _this = this; @@ -164,10 +147,6 @@ OxFF.prototype = { } return this._access; }, - volumes: function(callback) { - return this.api('volumes', callback); - return JSON.stringify(['Test', 'Another']); - }, api: function(action, data, callback) { if (typeof(data) == 'function') { callback = data; @@ -216,15 +195,34 @@ OxFF.prototype = { req.send(formData); return true; }, + extract: function(oshash, media, callback) { + return this.api('extract', {'oshash': oshash, 'media': media}, callback); + }, files: function(callback) { return this.api('files', callback.callback); }, get: function(oshash, media, callback) { return this.api('get', {'oshash': oshash, 'media': media}, callback.callback); }, - extract: function(oshash, media, callback) { - return this.api('extract', {'oshash': oshash, 'media': media}, callback); + login: function(user) { + if(this._user==null) { + this._user = user; + return true; + } + return false; }, + logout: function(user) { + var _this = this; + this.api('shutdown', function() { + _this._user = null; + }); + return true; + }, + update: function() { + this.api('update', function() {}); + return true; + }, + addVolume: function(archive) { if(!this._access) { return false; @@ -242,6 +240,12 @@ OxFF.prototype = { } return false; }, + volumes: function(callback) { + return this.api('volumes', callback); + }, + + //private functions + /* _internal_update: function() { var new_files = []; var volumes = this.getVolumes(this._site); @@ -264,8 +268,7 @@ OxFF.prototype = { } } return JSON.stringify(new_files); - }, - //private functions + }, */ permitAccess: function() { this._access = true; var conn = ox.getDB();