-
Notifications
You must be signed in to change notification settings - Fork 0
/
drive-aux.js
66 lines (49 loc) · 1.8 KB
/
drive-aux.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
define([
"jwebkit",
"jwebdesk"
], function(jwk, jwebdesk) {
function AUXDrive () {
jwk.Node.call(this);
}
AUXDrive.prototype = new jwebdesk.Drive();
AUXDrive.prototype.constructor = AUXDrive;
// -------------------------------------------------------------------------------------------
AUXDrive.prototype.assert_acls = function (node) {
return jwk.Deferred().resolve(self, this._owner).promise();
}
AUXDrive.prototype.login = function (do_popup) {}
AUXDrive.prototype.logout = function () { }
AUXDrive.prototype.user = function () {}
AUXDrive.prototype.root = function () {}
AUXDrive.prototype.writeFile = function (node, data, params) {
return this.assert_acls(node).then(function (self, drive){
return drive.writeFile(node, data, params);
});
}
AUXDrive.prototype.readFile = function (node) {
return this.assert_acls(node).then(function (self, drive){
return drive.readFile(node);
});
}
AUXDrive.prototype.readdir = function (node) {
return this.assert_acls(node).then(function (self, drive){
return drive.readdir(node);
});
}
AUXDrive.prototype.createChild = function (node, entry) {
return this.assert_acls(node).then(function (self, drive){
return drive.createChild(node, entry);
});
}
AUXDrive.prototype.link = function (node) {
return this.assert_acls(node).then(function (self, drive){
return drive.link(node);
});
}
AUXDrive.prototype.thumbnail = function () {
return this.assert_acls(node).then(function (self, drive){
return drive.thumbnail(node);
});
}
return AUXDrive;
});