Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
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
Ivan Tyagov
jio
Commits
c048fd03
Commit
c048fd03
authored
Mar 08, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complex Example updated
parent
32db8461
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
66 deletions
+17
-66
examples/complex_example.html
examples/complex_example.html
+17
-66
No files found.
examples/complex_example.html
View file @
c048fd03
...
@@ -86,45 +86,33 @@ var clearlog = function () {
...
@@ -86,45 +86,33 @@ var clearlog = function () {
<br
/>
<br
/>
<table
border=
"1"
style=
"width: 100%;"
>
<table
border=
"1"
style=
"width: 100%;"
>
<tr>
<tr>
<td
style=
"width: 50%;"
>
<td
colspan=
"1"
style=
"width: 50%;"
>
<label
for=
"metadata"
>
Metadata or document id:
</label>
<label
for=
"metadata"
>
Metadata or document id:
</label>
<textarea
id=
"metadata"
rows=
"3"
style=
"width: 98%;"
>
{}
</textarea>
<textarea
id=
"metadata"
rows=
"3"
style=
"width: 98%;"
>
{}
</textarea>
</td>
</td>
<td
style=
"width: 50%;"
>
<td
colspan=
"1"
style=
"text-align: center;"
>
<label
for=
"document_id"
>
Document Id:
</label>
<input
type=
"text"
id=
"document_id"
value=
""
/>
<label
for=
"mimetype"
>
Mime Type:
</label>
<input
type=
"text"
id=
"mimetype"
value=
""
/><br
/>
<label
for=
"content"
>
Content:
</label>
<textarea
id=
"content"
rows=
"3"
style=
"width: 98%;"
></textarea><br
/>
</td>
</tr>
<tr>
<td
colspan=
"2"
style=
"text-align: center;"
>
Options:
<br
/>
Options:
<br
/>
<label
for=
"prev_rev"
>
Previous revision:
</label>
<label
for=
"show_conflicts"
>
Get Conflicts
</label>
<input
type=
"text"
id=
"prev_rev"
value=
""
style=
"width: 40em;"
/><br
/>
<input
type=
"checkbox"
id=
"show_conflicts"
/><br
/>
<label
for=
"show_conflicts"
>
Show Conflicts
</label>
<label
for=
"show_revision_history"
>
Get Revision History
</label>
<input
type=
"checkbox"
id=
"show_conflicts"
/>
,
<input
type=
"checkbox"
id=
"show_revision_history"
/><br
/>
<label
for=
"show_revision_history"
>
Show Revision History
</label>
<label
for=
"show_revision_info"
>
Get Revision Info
</label>
<input
type=
"checkbox"
id=
"show_revision_history"
/>
,
<input
type=
"checkbox"
id=
"show_revision_info"
/><br
/>
<label
for=
"show_revision_info"
>
Show Revision Info
</label>
<input
type=
"checkbox"
id=
"show_revision_info"
/>
,
<br
/>
<label
for=
"max_retry"
>
Max Retry
</label>
<label
for=
"max_retry"
>
Max Retry
</label>
<input
type=
"number"
id=
"max_retry"
value=
"0"
style=
"width:30px;"
/>
<input
type=
"number"
id=
"max_retry"
value=
"0"
style=
"width:30px;"
/>
(0 = infinite)
(0 = infinite)
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td
style=
"text-align: center;"
>
<td
colspan=
"2"
style=
"text-align: center;"
>
<button
onclick=
"post()"
>
post
</button>
<button
onclick=
"post()"
>
post
</button>
<button
onclick=
"put()"
>
put
</button>
<button
onclick=
"put()"
>
put
</button>
<button
onclick=
"get()"
>
get
</button>
<button
onclick=
"get()"
>
get
</button>
<button
onclick=
"remove()"
>
remove
</button>
<button
onclick=
"remove()"
>
remove
</button>
<button
onclick=
"allDocs()"
>
allDocs
</button>
<button
onclick=
"allDocs()"
>
allDocs
</button>
<
/td
>
<
!-- </td> --
>
<
td
style=
"text-align: center;"
>
<
!-- <td style="text-align: center;"> --
>
<button
onclick=
"putAttachment()"
>
putAttachment
</button>
-
<button
onclick=
"putAttachment()"
>
putAttachment
</button>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
@@ -233,50 +221,13 @@ var command = function (method) {
...
@@ -233,50 +221,13 @@ var command = function (method) {
opts
.
revs_info
=
$
(
'
#show_revision_info
'
).
attr
(
'
checked
'
)?
true
:
false
;
opts
.
revs_info
=
$
(
'
#show_revision_info
'
).
attr
(
'
checked
'
)?
true
:
false
;
opts
.
max_retry
=
parseInt
(
$
(
'
#max_retry
'
).
attr
(
'
value
'
)
||
'
0
'
);
opts
.
max_retry
=
parseInt
(
$
(
'
#max_retry
'
).
attr
(
'
value
'
)
||
'
0
'
);
switch
(
method
)
{
case
'
putAttachment
'
:
doc
.
id
=
$
(
'
#document_id
'
).
attr
(
'
value
'
);
doc
.
rev
=
$
(
'
#prev_rev
'
).
attr
(
'
value
'
);
doc
.
data
=
$
(
'
#content
'
).
attr
(
'
value
'
);
doc
.
mimetype
=
$
(
'
#mimetype
'
).
attr
(
'
value
'
);
log
(
'
attachment:
'
+
JSON
.
stringify
(
doc
));
break
;
case
'
post
'
:
case
'
put
'
:
doc
=
JSON
.
parse
(
$
(
'
#metadata
'
).
attr
(
'
value
'
));
doc
=
JSON
.
parse
(
$
(
'
#metadata
'
).
attr
(
'
value
'
));
log
(
'
doc:
'
+
JSON
.
stringify
(
doc
));
log
(
'
doc:
'
+
JSON
.
stringify
(
doc
));
break
;
case
'
remove
'
:
doc
=
JSON
.
parse
(
$
(
'
#metadata
'
).
attr
(
'
value
'
));
opts
.
rev
=
(
$
(
'
#last_revision
'
).
attr
(
'
checked
'
)?
'
last
'
:
undefined
)
||
$
(
'
#prev_rev
'
).
attr
(
'
value
'
)
||
undefined
;
log
(
'
doc:
'
+
JSON
.
stringify
(
doc
));
break
;
case
'
get
'
:
doc
=
$
(
'
#metadata
'
).
attr
(
'
value
'
);
log
(
'
docid:
'
+
doc
)
case
'
allDocs
'
:
break
;
}
log
(
'
opts:
'
+
JSON
.
stringify
(
opts
));
log
(
'
opts:
'
+
JSON
.
stringify
(
opts
));
switch
(
method
)
{
case
"
putAttachment
"
:
case
'
remove
'
:
case
'
post
'
:
case
'
put
'
:
case
'
get
'
:
my_jio
[
method
](
doc
,
opts
,
function
(
err
,
val
)
{
my_jio
[
method
](
doc
,
opts
,
function
(
err
,
val
)
{
callback
(
err
,
val
,
begin_date
);
callback
(
err
,
val
,
begin_date
);
});
});
break
;
case
'
allDocs
'
:
my_jio
[
method
](
opts
,
function
(
err
,
val
)
{
callback
(
err
,
val
,
begin_date
);
});
break
;
}
};
};
var
post
=
function
()
{
var
post
=
function
()
{
command
(
'
post
'
);
command
(
'
post
'
);
...
...
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