Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
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
Guillaume Royer
jio
Commits
eec60f02
Commit
eec60f02
authored
Feb 18, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio.js updated
parent
60eac4f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
jio.js
jio.js
+7
-18
No files found.
jio.js
View file @
eec60f02
...
@@ -284,16 +284,10 @@ var storage = function (spec, my) {
...
@@ -284,16 +284,10 @@ var storage = function (spec, my) {
that
.
addJob
=
function
(
method
,
storage_spec
,
doc
,
option
,
success
,
error
)
{
that
.
addJob
=
function
(
method
,
storage_spec
,
doc
,
option
,
success
,
error
)
{
var
command_opt
=
{
var
command_opt
=
{
doc
:
doc
,
options
:
option
,
options
:
option
,
callbacks
:
{
success
:
success
,
error
:
error
}
callbacks
:
{
success
:
success
,
error
:
error
}
};
};
if
(
doc
)
{
if
(
method
===
'
get
'
)
{
command_opt
.
docid
=
doc
;
}
else
{
command_opt
.
doc
=
doc
;
}
}
jobManager
.
addJob
(
job
({
jobManager
.
addJob
(
job
({
storage
:
priv
.
storage
(
storage_spec
||
{}),
storage
:
priv
.
storage
(
storage_spec
||
{}),
command
:
priv
.
newCommand
(
method
,
command_opt
)
command
:
priv
.
newCommand
(
method
,
command_opt
)
...
@@ -2302,7 +2296,8 @@ Object.defineProperty(that, "put", {
...
@@ -2302,7 +2296,8 @@ Object.defineProperty(that, "put", {
/**
/**
* Get a document.
* Get a document.
* @method get
* @method get
* @param {string} docid The document id: "doc_id" or "doc_id/attachmt_id".
* @param {string} doc The document object. Contains at least:
* - {string} _id The document id: "doc_id" or "doc_id/attachment_id"
* @param {object} options (optional) Contains some options:
* @param {object} options (optional) Contains some options:
* - {number} max_retry The number max of retries, 0 = infinity.
* - {number} max_retry The number max of retries, 0 = infinity.
* - {string} rev The revision we want to get.
* - {string} rev The revision we want to get.
...
@@ -2318,14 +2313,14 @@ Object.defineProperty(that, "get", {
...
@@ -2318,14 +2313,14 @@ Object.defineProperty(that, "get", {
configurable
:
false
,
configurable
:
false
,
enumerable
:
false
,
enumerable
:
false
,
writable
:
false
,
writable
:
false
,
value
:
function
(
id
,
options
,
success
,
error
)
{
value
:
function
(
doc
,
options
,
success
,
error
)
{
var
param
=
priv
.
parametersToObject
(
var
param
=
priv
.
parametersToObject
(
[
options
,
success
,
error
],
[
options
,
success
,
error
],
{
max_retry
:
3
}
{
max_retry
:
3
}
);
);
priv
.
addJob
(
getCommand
,
{
priv
.
addJob
(
getCommand
,
{
doc
id
:
id
,
doc
:
doc
,
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:
{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:
{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
...
@@ -2419,19 +2414,13 @@ Object.defineProperty(that, "putAttachment", {
...
@@ -2419,19 +2414,13 @@ Object.defineProperty(that, "putAttachment", {
enumerable
:
false
,
enumerable
:
false
,
writable
:
false
,
writable
:
false
,
value
:
function
(
doc
,
options
,
success
,
error
)
{
value
:
function
(
doc
,
options
,
success
,
error
)
{
var
param
,
k
,
doc_with_underscores
=
{};
var
param
=
priv
.
parametersToObject
(
param
=
priv
.
parametersToObject
(
[
options
,
success
,
error
],
[
options
,
success
,
error
],
{
max_retry
:
0
}
{
max_retry
:
0
}
);
);
for
(
k
in
doc
)
{
if
(
doc
.
hasOwnProperty
(
k
)
&&
k
.
match
(
'
[^_].*
'
))
{
doc_with_underscores
[
"
_
"
+
k
]
=
doc
[
k
];
}
}
priv
.
addJob
(
putAttachmentCommand
,
{
priv
.
addJob
(
putAttachmentCommand
,
{
doc
:
doc
_with_underscores
,
doc
:
doc
,
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:
{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:
{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
...
...
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