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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aurel
jio
Commits
72133321
Commit
72133321
authored
Jun 20, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example.html updated
parent
935d3e28
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
38 deletions
+54
-38
examples/example.html
examples/example.html
+54
-38
No files found.
examples/example.html
View file @
72133321
...
@@ -21,58 +21,74 @@ var log = function (o) {
...
@@ -21,58 +21,74 @@ var log = function (o) {
<script
type=
"text/javascript"
src=
"../src/jio.storage/localstorage.js"
>
<script
type=
"text/javascript"
src=
"../src/jio.storage/localstorage.js"
>
</script>
</script>
<script
type=
"text/javascript"
src=
"../lib/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/base64/base64.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/davstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../lib/jsSha2/sha2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/revisionstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../lib/sjcl/sjcl.min.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
<!--
<!--
var
my_jio
=
null
;
var
jio_instance
=
null
;
log
(
'
Welcome to the jIO example.html!
'
)
log
(
'
Welcome to the jIO example.html!
'
)
log
(
'
-> Create jIO instance
'
);
log
(
'
-> Create jIO instance
'
);
my_jio
=
jIO
.
newJio
({
jio_instance
=
jIO
.
newJio
({
type
:
'
local
'
,
username
:
'
jIOtest
'
,
applicationname
:
'
example
'
"
type
"
:
'
local
'
,
"
username
"
:
'
jIOtest
'
,
"
applicationname
"
:
'
example
'
});
});
// careful ! asynchronous methods
// Careful! These are asynchronous methods!
log
(
'
-> post "video" document metadata to localStorage
'
);
log
(
'
-> post "video" document metadata to localStorage
'
);
my_jio
.
post
({
_id
:
'
video
'
,
title
:
'
My Video Title
'
,
codec
:
'
vorbis
'
,
language
:
'
en
'
,
description
:
'
Image compilation
'
},
function
(
val
)
{
jio_instance
.
post
({
"
_id
"
:
'
video
'
,
"
title
"
:
'
My Video Title
'
,
"
codec
"
:
'
vorbis
'
,
"
language
"
:
'
en
'
,
"
description
"
:
'
Image compilation
'
},
function
(
response
)
{
log
(
'
-> put "thumbnail" attachment to localStorage
'
);
log
(
'
-> put "thumbnail" attachment to localStorage
'
);
jio_instance
.
putAttachment
({
my_jio
.
putAttachment
({
id
:
"
video/thumb.jpg
"
,
data
:
"
BASE64DATA
"
,
mimetype
:
'
image/jpeg
'
},
function
(
val
)
{
"
_id
"
:
"
video
"
,
"
_attachment
"
:
"
thumb.jpg
"
,
"
_data
"
:
"
BASE64DATA
"
,
"
_mimetype
"
:
'
image/jpeg
'
},
function
(
response
)
{
log
(
'
-> put "video" attachment to localStorage
'
);
log
(
'
-> put "video" attachment to localStorage
'
);
my_jio
.
putAttachment
({
id
:
"
video/myvideo.ogg
"
,
data
:
"
BASE64DATATOO
"
,
mimetype
:
'
video/ogg
'
},
function
(
val
)
{
log
(
'
Done! Refresh the page to see get and remove command.
'
);
jio_instance
.
putAttachment
({
"
_id
"
:
"
video
"
,
"
_attachment
"
:
"
myvideo.ogg
"
,
"
_data
"
:
"
BASE64DATATOO
"
,
"
_mimetype
"
:
'
video/ogg
'
},
function
(
val
)
{
log
(
'
Done! Refresh the page to see get and remove command.
'
);
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
reason
);
});
});
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
reason
);
});
});
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
-> get "video" document metadata from localStorage
'
);
log
(
'
Error!
'
+
err
.
reason
);
my_jio
.
get
(
'
video
'
,
function
(
val
)
{
log
(
'
-> get "video" document metadata from localStorage
'
);
log
(
'
Title is: "
'
+
val
[
"
title
"
]
+
'
"
'
);
jio_instance
.
get
(
'
video
'
,
function
(
val
)
{
log
(
'
Title is: "
'
+
val
[
"
title
"
]
+
'
"
'
);
log
(
'
-> remove "video" document from localStorage
'
);
log
(
'
-> remove "video" document from localStorage
'
);
jio_instance
.
remove
({
"
_id
"
:
'
video
'
},
function
(
val
)
{
my_jio
.
remove
({
_id
:
'
video
'
},
function
(
val
)
{
log
(
'
Done! Refresh the page to see post and putAttachment command.
'
);
log
(
'
Done! Refresh the page to see post and putAttachment command.
'
);
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
reason
);
});
});
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
reason
);
});
});
});
});
...
...
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