Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
139ab0be
Commit
139ab0be
authored
Sep 01, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propose different storage nodes not tested yet
parent
ad9d385a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
282 additions
and
219 deletions
+282
-219
UNGProject/unhosted/jio.js
UNGProject/unhosted/jio.js
+282
-219
No files found.
UNGProject/unhosted/jio.js
View file @
139ab0be
...
@@ -552,248 +552,311 @@
...
@@ -552,248 +552,311 @@
}
}
getIndex
:
function
()
{
return
this
.
index
},
/***************************************************************
save
:
function
()
{
*********************** CryptedStorage *************************/
this
.
storage
.
saveDocument
(
JSON
.
stringify
(
this
.
getIndex
()),
"
jio.index
"
,
"
text
"
,
true
);
/**
* Class CryptedStorage
* @class provides usual API to encrypte data storing documents
* @param data : object containing every element needed to build the storage
* "storage" : the storage to encrypt
* "password" : the key to encrypt/decrypt data
* "method" : (optional) the algorythm to use - Only sjcl available for the moment
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
JIO
.
CryptedStorage
=
function
(
data
,
applicant
)
{
this
.
storage
=
createStorage
(
data
.
storage
,
applicant
);
this
.
password
=
data
.
password
;
}
JIO
.
CryptedStorage
.
prototype
=
{
userNameAvailable
:
function
(
name
,
option
)
{
return
this
.
storage
.
userNameAvailable
.
apply
(
this
.
storage
,
arguments
)},
loadDocument
:
function
(
fileName
,
option
)
{
var
cryptedStorage
=
this
;
var
newOption
=
copy
(
option
);
newOption
.
success
=
function
(
data
)
{
if
(
option
.
success
)
{
option
.
success
(
sjcl
.
decrypt
(
cryptedStorage
.
password
,
data
))}
//case asynchronous
}
}
var
data
=
this
.
storage
.
loadDocument
(
fileName
,
newOption
);
return
data
?
sjcl
.
decrypt
(
cryptedStorage
.
password
,
data
)
:
data
//case synchronous
},
saveDocument
:
function
(
data
,
fileName
,
option
)
{
var
encryptedData
=
sjcl
.
encrypt
(
this
.
password
,
data
);
return
this
.
storage
.
saveDocument
(
encryptedData
,
fileName
,
option
)
},
deleteDocument
:
function
(
file
,
option
)
{
return
this
.
storage
.
deleteDocument
.
apply
(
this
.
storage
,
arguments
)},
getDocumentList
:
function
(
option
)
{
return
this
.
storage
.
getDocumentList
.
apply
(
this
.
storage
,
arguments
)}
}
/***************************************************************
*********************** AsynchronousStorage *************************/
/**
* Class AsynchronousStorage
* @class manage the pending list of requests
* @param data : object containing every element needed to build the storage :
* "storage" : the storage to manage
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
JIO
.
AsynchronousStorage
=
function
(
data
,
applicant
)
{
this
.
storage
=
createStorage
(
data
.
storage
,
applicant
);
this
.
pendingList
=
{};
//contains the list of pending actions
}
JIO
.
AsynchronousStorage
.
prototype
=
{
userNameAvailable
:
function
(
name
,
option
)
{
var
asynchronousStorage
=
this
;
var
requestID
=
this
.
addPendingAction
(
this
.
userNameAvailable
,
arguments
);
var
instruction
=
function
()
{
asynchronousStorage
.
removePendingAction
(
requestID
)}
option
.
success
=
addInstruction
(
instruction
,
option
.
success
,
true
);
option
.
errorHandler
=
addInstruction
(
instruction
,
option
.
errorHandler
,
true
);
return
this
.
storage
.
userNameAvailable
(
name
,
option
);
},
loadDocument
:
function
(
fileName
,
option
)
{
var
asynchronousStorage
=
this
;
var
requestID
=
this
.
addPendingAction
(
this
.
loadDocument
,
arguments
);
var
instruction
=
function
()
{
asynchronousStorage
.
removePendingAction
(
requestID
)}
option
.
success
=
addInstruction
(
instruction
,
option
.
success
,
true
);
option
.
errorHandler
=
addInstruction
(
instruction
,
option
.
errorHandler
,
true
);
return
this
.
storage
.
loadDocument
(
fileName
,
option
);
},
saveDocument
:
function
(
data
,
fileName
,
option
)
{
var
asynchronousStorage
=
this
;
var
requestID
=
this
.
addPendingAction
(
this
.
saveDocument
,
arguments
);
var
instruction
=
function
()
{
asynchronousStorage
.
removePendingAction
(
requestID
)}
option
.
success
=
addInstruction
(
instruction
,
option
.
success
,
true
);
option
.
errorHandler
=
addInstruction
(
instruction
,
option
.
errorHandler
,
true
);
return
this
.
storage
.
saveDocument
(
data
,
fileName
,
option
);
},
deleteDocument
:
function
(
file
,
option
)
{
var
asynchronousStorage
=
this
;
var
requestID
=
this
.
addPendingAction
(
this
.
deleteDocument
,
arguments
);
var
instruction
=
function
()
{
asynchronousStorage
.
removePendingAction
(
requestID
)}
option
.
success
=
addInstruction
(
instruction
,
option
.
success
,
true
);
option
.
errorHandler
=
addInstruction
(
instruction
,
option
.
errorHandler
,
true
);
return
this
.
storage
.
deleteDocument
(
file
,
option
);
},
getDocumentList
:
function
(
option
)
{
var
asynchronousStorage
=
this
;
var
requestID
=
this
.
addPendingAction
(
this
.
getDocumentList
,
arguments
);
var
instruction
=
function
()
{
asynchronousStorage
.
removePendingAction
(
requestID
)}
option
.
success
=
addInstruction
(
instruction
,
option
.
success
,
true
);
option
.
errorHandler
=
addInstruction
(
instruction
,
option
.
errorHandler
,
true
);
return
this
.
storage
.
getDocumentList
(
option
);
},
addPendingAction
:
function
(
action
,
argument
)
{
var
ID
=
Date
.
now
();
var
task
=
{
action
:
action
,
arguments
:
argument
}
this
.
getPendingList
()[
ID
]
=
task
;
return
ID
;
},
removePendingAction
:
function
(
ID
)
{
delete
this
.
getPendingList
()[
ID
];
},
getPendingList
:
function
()
{
return
this
.
pendingList
}
}
/***************************************************************
*********************** ReplicateStorage *************************/
/**
* Class ReplicateStorage
* @class provides usual API to replicate save/load/delete in a list of storages
* @param data : object containing every element needed to build the storage :
* "storageList" : an array containing the different storages ([{"storage1":{...},...])
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
JIO
.
ReplicateStorage
=
function
(
data
,
applicant
)
{
this
.
storageList
=
[];
for
(
var
i
=
0
;
i
<
data
.
storageList
.
length
;
i
++
)
{
//create each storage from the list
this
.
storageList
[
i
]
=
createStorage
(
data
.
storageList
[
i
],
applicant
);
}
}
}
JIO
.
ReplicateStorage
.
prototype
=
{
/**
* check if an user already exists
* @param name : the name you want to check
* @param option : optional object containing
* "errorHandler" : the function to execute if an error occures
* @return the answer of the first storage able to answer
*/
userNameAvailable
:
function
(
name
,
option
)
{
return
tryCheckUser
(
this
.
storageList
.
slice
());
function
tryCheckUser
(
storageList
)
{
var
storage
=
storageList
.
pop
();
var
newOption
=
copy
(
option
);
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
return
storage
.
userNameAvailable
(
name
,
newOption
);
}
function
generateErrorHandler
(
storageList
)
{
return
storageList
.
length
>
0
?
function
()
{
tryCheckUser
(
storageList
);}
:
option
.
errorHandler
;
}
},
/***************************************************************
*********************** CryptedStorage *************************/
/**
/**
* Class CryptedStorage
* load a document in the storage
* @class provides usual API to encrypte data storing documents
* @param fileName : the name of the file where the data will be stored
* @param data : object containing every element needed to build the storage
* @param option : optional object containing
* "storage" : the storage to encrypt
* "errorHandler" : the function to execute if an error occures
* "password" : the key to encrypt/decrypt data
* @return the content of the document sent by the first storage able to
* "method" : (optional) the algorythm to use - Only sjcl available for the moment
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
*/
JIO
.
ReplicateStorage
=
function
(
data
,
applicant
)
{
loadDocument
:
function
(
fileName
,
option
)
{
this
.
storage
=
createStorage
(
data
.
storage
,
applicant
);
return
tryLoadDocument
(
this
.
storageList
.
slice
());
this
.
password
=
data
.
password
;
}
function
tryLoadDocument
(
storageList
)
{
JIO
.
ReplicateStorage
.
prototype
=
{
var
storage
=
storageList
.
pop
();
userNameAvailable
:
function
(
name
,
option
)
{
return
this
.
storage
.
userNameAvailable
.
apply
(
this
.
storage
,
arguments
)},
loadDocument
:
function
(
fileName
,
option
)
{
var
cryptedStorage
=
this
;
var
newOption
=
copy
(
option
);
var
newOption
=
copy
(
option
);
newOption
.
success
=
function
(
data
)
{
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
if
(
option
.
success
)
{
option
.
success
(
sjcl
.
decrypt
(
data
,
cryptedStorage
.
password
))}
//case asynchronous
return
storage
.
loadDocument
(
fileName
,
newOption
);
}
}
var
data
=
this
.
storage
.
loadDocument
(
fileName
,
newOption
);
function
generateErrorHandler
(
storageList
)
{
return
data
?
sjcl
.
decrypt
(
data
,
cryptedStorage
.
password
)
:
data
//case synchronous
return
storageList
.
length
>
0
?
function
()
{
tryLoadDocument
(
storageList
);}
:
option
.
errorHandler
;
},
}
saveDocument
:
function
(
data
,
fileName
,
option
)
{
},
return
this
.
storage
.
saveDocument
(
sjcl
.
encrypt
(
data
,
this
.
password
),
fileName
,
option
)
},
deleteDocument
:
function
(
file
,
option
)
{
return
this
.
storage
.
deleteDocument
.
apply
(
this
.
storage
,
arguments
)},
getDocumentList
:
function
(
option
)
{
return
this
.
storage
.
getDocumentList
.
apply
(
this
.
storage
,
arguments
)}
}
/***************************************************************
*********************** ReplicateStorage *************************/
/**
/**
* Class ReplicateStorage
* save the document in each storage (simply delegate the call to each storage. Perhaps the success function sould be executed only once?)
* @class provides usual API to replicate save/load/delete in a list of storages
* @param data : the data to store
* @param data : object containing every element needed to build the storage :
* @param fileName : the name of the file where the data will be stored
* "storageList" : an array containing the different storages ([{"storage1":{...},...])
* @param option : optional object
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
*/
JIO
.
ReplicateStorage
=
function
(
data
,
applicant
)
{
saveDocument
:
function
(
data
,
fileName
,
option
)
{
this
.
storageList
=
[];
for
(
var
element
in
this
.
storageList
)
{
for
(
var
i
=
0
;
i
<
data
.
storageList
.
length
;
i
++
)
{
//create each storage from the list
this
.
storageList
[
element
].
saveDocument
(
data
,
fileName
,
option
);
this
.
storageList
[
i
]
=
createStorage
(
data
.
storageList
[
i
],
applicant
);
}
}
}
},
JIO
.
ReplicateStorage
.
prototype
=
{
/**
* check if an user already exists
* @param name : the name you want to check
* @param option : optional object containing
* "errorHandler" : the function to execute if an error occures
* @return the answer of the first storage able to answer
*/
userNameAvailable
:
function
(
name
,
option
)
{
return
tryCheckUser
(
this
.
storageList
.
slice
());
function
tryCheckUser
(
storageList
)
{
var
storage
=
storageList
.
pop
();
var
newOption
=
copy
(
option
);
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
return
storage
.
userNameAvailable
(
name
,
newOption
);
}
function
generateErrorHandler
(
storageList
)
{
return
storageList
.
length
>
0
?
function
()
{
tryCheckUser
(
storageList
);}
:
option
.
errorHandler
;
}
},
/**
* load a document in the storage
* @param fileName : the name of the file where the data will be stored
* @param option : optional object containing
* "errorHandler" : the function to execute if an error occures
* @return the content of the document sent by the first storage able to
*/
loadDocument
:
function
(
fileName
,
option
)
{
return
tryLoadDocument
(
this
.
storageList
.
slice
());
function
tryLoadDocument
(
storageList
)
{
var
storage
=
storageList
.
pop
();
var
newOption
=
copy
(
option
);
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
return
storage
.
loadDocument
(
fileName
,
newOption
);
}
function
generateErrorHandler
(
storageList
)
{
return
storageList
.
length
>
0
?
function
()
{
tryLoadDocument
(
storageList
);}
:
option
.
errorHandler
;
}
},
/**
* save the document in each storage (simply delegate the call to each storage. Perhaps the success function sould be executed only once?)
* @param data : the data to store
* @param fileName : the name of the file where the data will be stored
* @param option : optional object
*/
saveDocument
:
function
(
data
,
fileName
,
option
)
{
for
(
var
element
in
this
.
storageList
)
{
this
.
storageList
[
element
].
saveDocument
(
data
,
fileName
,
option
);
}
},
/**
/**
* delete the document in each storage (simply delegate the call to each storage. Perhaps the success function sould be executed only once?)
* delete the document in each storage (simply delegate the call to each storage. Perhaps the success function sould be executed only once?)
* @param file : fileName or array of fileNames to delete
* @param file : fileName or array of fileNames to delete
* @param option : optional object
* @param option : optional object
*/
*/
deleteDocument
:
function
(
file
,
option
)
{
deleteDocument
:
function
(
file
,
option
)
{
for
(
var
element
in
this
.
storageList
)
{
for
(
var
element
in
this
.
storageList
)
{
this
.
storageList
[
element
].
deleteDocument
(
file
,
option
);
this
.
storageList
[
element
].
deleteDocument
(
file
,
option
);
}
},
/**
* load the list of the documents in this storage
* @param option : optional object containing
* "errorHandler" : the function to execute if an error occures
* @return the answer of the first storage able to answer
* @example {"file1":{fileName:"file1",creationDate:"Tue, 23 Aug 2011 15:18:32 GMT",lastModified:"Tue, 23 Aug 2011 15:18:32 GMT"},...}
*/
getDocumentList
:
function
(
option
)
{
return
tryGetDocumentList
(
this
.
storageList
.
slice
());
function
tryGetDocumentList
(
storageList
)
{
var
storage
=
storageList
.
pop
();
var
newOption
=
copy
(
option
);
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
return
storage
.
getDocumentList
(
newOption
);
}
function
generateErrorHandler
(
storageList
)
{
return
storageList
.
length
>
0
?
function
()
{
tryGetDocumentList
(
storageList
);}
:
option
.
errorHandler
;
}
}
}
}
},
/***************************************************************
*********************** MultipleStorage *************************/
/**
/**
*
Class MultipleS
torage
*
load the list of the documents in this s
torage
* @
class provides usual API to save/load/delete documents in a list of storages
* @
param option : optional object containing
*
@param data : object containing every element needed to build the storage :
*
"errorHandler" : the function to execute if an error occures
*
"storageList" : an object containing the different storages ({"storage1":{...},...})
*
@return the answer of the first storage able to answer
* @
param applicant : object containing inforamtion about the person/application needing this JIO object
* @
example {"file1":{fileName:"file1",creationDate:"Tue, 23 Aug 2011 15:18:32 GMT",lastModified:"Tue, 23 Aug 2011 15:18:32 GMT"},...}
*/
*/
JIO
.
MultipleStorage
=
function
(
data
,
applicant
)
{
getDocumentList
:
function
(
option
)
{
this
.
storageList
=
{};
//contains the different storages
return
tryGetDocumentList
(
this
.
storageList
.
slice
());
this
.
documentList
=
{};
//contains the document list of each storage
for
(
var
storage
in
data
.
storageList
)
{
//create each storage from the list
function
tryGetDocumentList
(
storageList
)
{
this
.
storageList
[
storage
]
=
createStorage
(
data
.
storageList
[
storage
],
applicant
);
var
storage
=
storageList
.
pop
();
var
newOption
=
copy
(
option
);
newOption
.
errorHandler
=
generateErrorHandler
(
storageList
);
return
storage
.
getDocumentList
(
newOption
);
}
function
generateErrorHandler
(
storageList
)
{
return
storageList
.
length
>
0
?
function
()
{
tryGetDocumentList
(
storageList
);}
:
option
.
errorHandler
;
}
}
}
}
JIO
.
MultipleStorage
.
prototype
=
{
}
userNameAvailable
:
function
(
userName
,
option
)
{
var
path
=
userName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
userNameAvailable
(
name
,
option
)
}
else
{
//TODO
}
},
//TODO /return this.storage.userNameAvailable.apply(this.storage,arguments)},
loadDocument
:
function
(
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
loadDocument
(
name
,
option
)
}
else
{
//TODO : handle name conflicts
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
if
(
multipleStorage
.
documentList
[
storage
][
fileName
])
{
multipleStorage
.
storageList
[
storage
].
loadDocument
(
fileName
,
option
)
}
});
}
},
saveDocument
:
function
(
data
,
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
saveDocument
(
data
,
name
,
option
)
}
else
{
//TODO : decide how to choose between storages
}
},
deleteDocument
:
function
(
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
deleteDocument
(
name
,
option
)
}
else
{
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
if
(
multipleStorage
.
documentList
[
storage
][
fileName
])
{
multipleStorage
.
storageList
[
storage
].
deleteDocument
(
fileName
,
option
);
delete
multipleStorage
.
documentList
[
storage
][
fileName
]
}
});
}
},
getDocumentList
:
function
(
option
)
{
if
(
option
.
location
)
{
this
.
storageList
[
option
.
location
].
getDocumentList
(
option
)
}
else
{
var
finalList
=
{};
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
var
documentList
=
multipleStorage
.
documentList
[
storage
];
$
.
each
(
documentList
,
function
(
fileName
)
{
finalList
[
storage
+
"
/
"
+
fileName
]
=
copy
(
documentList
[
fileName
]);
finalList
[
storage
+
"
/
"
+
fileName
].
fileName
=
storage
+
"
/
"
+
fileName
;
})
});
}
},
updateDocumentList
:
function
()
{
/***************************************************************
for
(
var
storage
in
this
.
storageList
)
{
this
.
documentList
[
storage
]
=
this
.
storageList
[
storage
].
getDocumentList
()
}
*********************** MultipleStorage *************************/
},
/**
analysePath
:
function
(
path
)
{
* Class MultipleStorage
* @class provides usual API to save/load/delete documents in a list of storages
* @param data : object containing every element needed to build the storage :
* "storageList" : an object containing the different storages ({"storage1":{...},...})
* @param applicant : object containing inforamtion about the person/application needing this JIO object
*/
JIO
.
MultipleStorage
=
function
(
data
,
applicant
)
{
this
.
storageList
=
{};
//contains the different storages
this
.
documentList
=
{};
//contains the document list of each storage
for
(
var
storage
in
data
.
storageList
)
{
//create each storage from the list
this
.
storageList
[
storage
]
=
createStorage
(
data
.
storageList
[
storage
],
applicant
);
}
}
JIO
.
MultipleStorage
.
prototype
=
{
userNameAvailable
:
function
(
userName
,
option
)
{
var
path
=
userName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
userNameAvailable
(
name
,
option
)
}
else
{
//TODO
}
},
//TODO /return this.storage.userNameAvailable.apply(this.storage,arguments)},
loadDocument
:
function
(
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
storage
=
path
.
shift
();
var
address
=
path
.
join
(
"
/
"
);
var
name
=
path
.
join
(
"
/
"
);
return
{
storage
:
storage
,
address
:
address
}
this
.
storageList
[
storage
].
loadDocument
(
name
,
option
)
}
else
{
//TODO : handle name conflicts
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
if
(
multipleStorage
.
documentList
[
storage
][
fileName
])
{
multipleStorage
.
storageList
[
storage
].
loadDocument
(
fileName
,
option
)
}
});
}
}
},
saveDocument
:
function
(
data
,
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
saveDocument
(
data
,
name
,
option
)
}
else
{
//TODO : decide how to choose between storages
}
},
deleteDocument
:
function
(
fileName
,
option
)
{
var
path
=
fileName
.
split
(
"
/
"
);
if
(
path
.
length
>
1
)
{
var
storage
=
path
.
shift
();
var
name
=
path
.
join
(
"
/
"
);
this
.
storageList
[
storage
].
deleteDocument
(
name
,
option
)
}
else
{
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
if
(
multipleStorage
.
documentList
[
storage
][
fileName
])
{
multipleStorage
.
storageList
[
storage
].
deleteDocument
(
fileName
,
option
);
delete
multipleStorage
.
documentList
[
storage
][
fileName
]
}
});
}
},
getDocumentList
:
function
(
option
)
{
if
(
option
.
location
)
{
this
.
storageList
[
option
.
location
].
getDocumentList
(
option
)
}
else
{
var
finalList
=
{};
var
multipleStorage
=
this
;
$
.
each
(
this
.
storageList
,
function
(
storage
){
var
documentList
=
multipleStorage
.
documentList
[
storage
];
$
.
each
(
documentList
,
function
(
fileName
)
{
finalList
[
storage
+
"
/
"
+
fileName
]
=
copy
(
documentList
[
fileName
]);
finalList
[
storage
+
"
/
"
+
fileName
].
fileName
=
storage
+
"
/
"
+
fileName
;
})
});
}
},
updateDocumentList
:
function
()
{
for
(
var
storage
in
this
.
storageList
)
{
this
.
documentList
[
storage
]
=
this
.
storageList
[
storage
].
getDocumentList
()}
},
analysePath
:
function
(
path
)
{
var
storage
=
path
.
shift
();
var
address
=
path
.
join
(
"
/
"
);
return
{
storage
:
storage
,
address
:
address
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment