Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio_mebibou
Commits
5b97a6a9
Commit
5b97a6a9
authored
Dec 24, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localstorage.js allDocs method redesigned
parent
974cac47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
36 deletions
+10
-36
src/jio.storage/localstorage.js
src/jio.storage/localstorage.js
+10
-36
No files found.
src/jio.storage/localstorage.js
View file @
5b97a6a9
...
...
@@ -206,45 +206,19 @@ var newLocalStorage = function (spec, my) {
};
/**
*
g
et all filenames belonging to a user from the document index
* @method
allDocs
*
G
et all filenames belonging to a user from the document index
* @method allDocs
* @param {object} command The JIO command
*
* Available options:
* - {boolean} conflicts Add a conflicts object to the response
* - {boolean} revs Add the revisions history of the document
* - {boolean} revs_info Add revisions informations
* - {boolean} include_docs Include documents with index
*/
that
.
_
allDocs
=
function
(
command
)
{
that
.
allDocs
=
function
(
command
)
{
setTimeout
(
function
()
{
var
new_array
=
[],
array
=
priv
.
getFileNameArray
(),
i
,
l
,
path
=
'
jio/local/
'
+
priv
.
username
+
'
/
'
+
priv
.
applicationname
,
include_docs
=
command
.
getOption
(
'
include_docs
'
),
doc
,
item
;
for
(
i
=
0
,
l
=
array
.
length
;
i
<
l
;
i
+=
1
)
{
item
=
array
[
i
];
if
(
include_docs
===
true
){
doc
=
that
.
_get
(
path
+
'
/
'
+
item
.
id
+
'
/
'
+
item
.
value
.
key
);
new_array
.
push
({
"
id
"
:
item
.
id
,
"
key
"
:
item
.
key
,
"
value
"
:
item
.
value
,
"
doc
"
:
doc
});
}
else
{
new_array
.
push
({
"
id
"
:
item
.
id
,
"
key
"
:
item
.
key
,
"
value
"
:
item
.
value
});
}
}
that
.
success
({
total_rows
:
new_array
.
length
,
rows
:
new_array
});
that
.
error
({
"
status
"
:
405
,
"
statusText
"
:
"
Method Not Allowed
"
,
"
error
"
:
"
method_not_allowed
"
,
"
message
"
:
"
Your are not allowed to use this command
"
,
"
reason
"
:
"
LocalStorage forbids AllDocs command executions
"
});
});
};
...
...
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