Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Hardik Juneja
jio-main
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
Show 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) {
...
@@ -206,45 +206,19 @@ var newLocalStorage = function (spec, my) {
};
};
/**
/**
*
g
et all filenames belonging to a user from the document index
*
G
et all filenames belonging to a user from the document index
* @method allDocs
* @method allDocs
* @param {object} command The JIO command
* @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
()
{
setTimeout
(
function
()
{
var
new_array
=
[],
that
.
error
({
array
=
priv
.
getFileNameArray
(),
"
status
"
:
405
,
i
,
l
,
"
statusText
"
:
"
Method Not Allowed
"
,
path
=
'
jio/local/
'
+
priv
.
username
+
'
/
'
+
priv
.
applicationname
,
"
error
"
:
"
method_not_allowed
"
,
include_docs
=
command
.
getOption
(
'
include_docs
'
),
"
message
"
:
"
Your are not allowed to use this command
"
,
doc
,
item
;
"
reason
"
:
"
LocalStorage forbids AllDocs command executions
"
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
});
});
});
};
};
...
...
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