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
Stefane Fermigier
jio
Commits
dba374fb
Commit
dba374fb
authored
Aug 29, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example.html updated
parent
3701d2c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
34 deletions
+48
-34
examples/example.html
examples/example.html
+48
-34
No files found.
examples/example.html
View file @
dba374fb
...
@@ -16,11 +16,10 @@ var log = function (o) {
...
@@ -16,11 +16,10 @@ var log = function (o) {
</script>
</script>
<div
id=
"log"
>
<div
id=
"log"
>
</div>
</div>
<script
type=
"text/javascript"
src=
"../lib/md5/md5.js"
></script>
<script
src=
"../src/sha256.amd.js"
></script>
<script
type=
"text/javascript"
src=
"../jio.js"
></script>
<script
src=
"../jio.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/localstorage.js"
>
<script
src=
"../complex_queries.js"
></script>
</script>
<script
src=
"../src/jio.storage/localstorage.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
<!--
<!--
var
jio_instance
=
null
;
var
jio_instance
=
null
;
...
@@ -28,7 +27,7 @@ var jio_instance = null;
...
@@ -28,7 +27,7 @@ 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
'
);
jio_instance
=
jIO
.
newJio
({
jio_instance
=
jIO
.
createJIO
({
"
type
"
:
'
local
'
,
"
type
"
:
'
local
'
,
"
username
"
:
'
jIOtest
'
,
"
username
"
:
'
jIOtest
'
,
"
applicationname
"
:
'
example
'
"
applicationname
"
:
'
example
'
...
@@ -43,52 +42,67 @@ jio_instance.post({
...
@@ -43,52 +42,67 @@ jio_instance.post({
"
codec
"
:
'
vorbis
'
,
"
codec
"
:
'
vorbis
'
,
"
language
"
:
'
en
'
,
"
language
"
:
'
en
'
,
"
description
"
:
'
Image compilation
'
"
description
"
:
'
Image compilation
'
}
,
function
(
response
)
{
}
).
then
(
function
(
)
{
log
(
'
-> put "thumbnail" attachment to localStorage
'
);
log
(
'
-> put "thumbnail" attachment to localStorage
'
);
jio_instance
.
putAttachment
({
return
jio_instance
.
putAttachment
({
"
_id
"
:
"
video
"
,
"
_id
"
:
"
video
"
,
"
_attachment
"
:
"
thumb.jpg
"
,
"
_attachment
"
:
"
thumb.jpg
"
,
"
_data
"
:
"
BASE64DATA
"
,
"
_data
"
:
"
This is the thumbnail content
"
,
"
_mimetype
"
:
'
image/jpeg
'
"
_mimetype
"
:
'
image/jpeg
'
},
function
(
response
)
{
});
log
(
'
-> put "video" attachment to localStorage
'
);
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
)
{
log
(
'
Error!
'
+
err
.
reason
);
});
},
function
(
err
)
{
}).
then
(
function
()
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
-> put "video" attachment to localStorage
'
);
return
jio_instance
.
putAttachment
({
"
_id
"
:
"
video
"
,
"
_attachment
"
:
"
myvideo.ogg
"
,
"
_data
"
:
new
Blob
([
"
This is the video content
"
],
{
"
type
"
:
"
video/ogg
"
})
});
});
}).
then
(
function
(
response
)
{
log
(
'
Done! Refresh the page to see get and remove command.
'
);
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
statusText
+
"
:
"
+
err
.
reason
+
"
,
"
+
err
.
message
);
log
(
'
-> get "video" document metadata from localStorage
'
);
log
(
'
-> get "video" document metadata from localStorage
'
);
jio_instance
.
get
(
'
video
'
,
function
(
val
)
{
jio_instance
.
get
({
"
_id
"
:
"
video
"
}).
then
(
function
(
response
)
{
log
(
'
Title is: "
'
+
val
[
"
title
"
]
+
'
"
'
);
log
(
'
Title is: "
'
+
response
.
data
.
title
+
'
"
'
);
log
(
'
->
remove "video" document from localStorage
'
);
log
(
'
->
get "video" attachment content
'
);
jio_instance
.
remove
({
"
_id
"
:
'
video
'
},
function
(
val
)
{
return
jio_instance
.
getAttachment
({
log
(
'
Done! Refresh the page to see post and putAttachment command.
'
);
"
_id
"
:
"
video
"
,
},
function
(
err
)
{
"
_attachment
"
:
"
myvideo.ogg
"
log
(
'
Error!
'
+
err
.
reason
);
});
});
}).
then
(
function
(
response
)
{
return
jIO
.
util
.
blobAsBinaryString
(
response
.
data
);
}).
then
(
function
(
binary_string
)
{
log
(
'
Video content is:
'
+
binary_string
);
log
(
'
-> remove "video" document from localStorage
'
);
return
jio_instance
.
remove
({
"
_id
"
:
'
video
'
});
}).
then
(
function
(
response
)
{
log
(
'
Done! Refresh the page to see post and putAttachment command.
'
);
},
function
(
err
)
{
},
function
(
err
)
{
log
(
'
Error!
'
+
err
.
reason
);
log
(
'
Error!
'
+
err
.
statusText
+
"
:
"
+
err
.
reason
+
"
,
"
+
err
.
message
);
});
});
});
});
...
...
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