Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
802a22f7
Commit
802a22f7
authored
Apr 19, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio.js modified in order to extends this API. And More!
parent
fe5e889f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
468 additions
and
367 deletions
+468
-367
jiotest/index.html
jiotest/index.html
+54
-44
jiotest/unhosted/jio.js
jiotest/unhosted/jio.js
+413
-323
jiotest/unhosted/jio.storage.js
jiotest/unhosted/jio.storage.js
+1
-0
No files found.
jiotest/index.html
View file @
802a22f7
...
...
@@ -4,9 +4,10 @@
<meta
charset=
"utf-8"
/>
<title>
JIO
</title>
<script
type=
"text/javascript"
src=
"js/jquery/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/sjcl.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.
storage.
js"
></script>
</head>
<body>
<div
id=
"divbody"
>
...
...
@@ -33,62 +34,71 @@ var is_array = function (v) {
////////////////////////////////////////////////////////////////////////////////
// Preparing JIO
//// Setting events reactions
JIO
.
subscribe
(
'
start_saving
'
,
function
(
o
)
{
JIO
.
subscribe
(
'
job_done
'
,
function
(
job
)
{
$
(
'
#divdebug
'
).
html
(
$
(
'
#divdebug
'
).
html
()
+
'
<br/>
'
+
job
.
method
+
'
: "
'
+
job
.
fileName
+
'
" OK!
'
);
switch
(
job
.
method
)
{
case
'
load
'
:
objectDump
(
job
);
$
(
'
#divdebug
'
).
html
(
$
(
'
#divdebug
'
).
html
()
+
'
Content : "
'
+
job
.
file
.
content
+
'
"
'
);
break
;
}
});
JIO
.
subscribe
(
'
job_fail
'
,
function
(
job
)
{
$
(
'
#diverror
'
).
html
(
$
(
'
#diverror
'
).
html
()
+
'
<br/>
'
+
job
.
method
+
'
: "
'
+
job
.
fileName
+
'
" FAILED!
'
+
job
.
message
);
});
JIO
.
subscribe
(
'
start_saving
'
,
function
()
{
console
.
log
(
'
start_saving received
'
);
objectDump
(
o
);
$
(
'
#divmessage
'
).
html
(
$
(
'
#divmessage
'
).
html
()
+
'
<br/>
'
+
'
Saving ...
'
);
// $('#divdebug').html($('#divdebug').html() + '
<
br
/>
'
+
//
'
save
remainingjobs
:
'
+ o.remaining.save);
});
JIO.subscribe(
'
stop_saving
'
, function (
o
) {
JIO.subscribe(
'
stop_saving
'
, function () {
console.log (
'
stop_saving
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Saving
ended
.
'
);
});
JIO.subscribe(
'
start_loading
'
, function (
e,o,r
) {
JIO.subscribe(
'
start_loading
'
, function () {
console.log (
'
start_loading
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Loading
"
' + o.fileName + '
"
...
'
);
$(
'
#
divdebug
'
).html($(
'
#
divdebug
'
).html() +
'
<
br
/>
'
+
'
load
remainingjobs
:
'
+ r);
'
Loading
...
'
);
});
JIO.subscribe(
'
stop_loading
'
, function (
e,o
) {
JIO.subscribe(
'
stop_loading
'
, function () {
console.log (
'
stop_loading
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Loading
ended
with
result
:
'
+ o.status +
'
,
message
:
'
+ o.message);
});
JIO.subscribe(
'
start_deleting
'
, function (e,o,r) {
console.log (
'
start_deleting
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Deleting
"
' + o.fileName + '
"
...
'
);
$(
'
#
divdebug
'
).html($(
'
#
divdebug
'
).html() +
'
<
br
/>
'
+
'
delete
remainingjobs
:
'
+ r);
});
JIO.subscribe(
'
stop_deleting
'
, function (e,o) {
console.log (
'
stop_deleting
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Deleting
ended
with
result
:
'
+ o.status +
'
,
message
:
'
+ o.message);
});
JIO.subscribe(
'
start_gettinglist
'
, function (e,o) {
console.log (
'
start_deleting
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Getting
list
...
'
);
});
JIO.subscribe(
'
stop_gettinglist
'
, function (e,o) {
console.log (
'
stop_deleting
received
'
);
objectDump(o);
$(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
'
Getting
list
ended
with
result
:
'
+ o.status +
'
,
message
:
'
+ o.message);
$(
'
#
divdebug
'
).html($(
'
#
divdebug
'
).html() +
'
<
br
/>
'
+
'
getList
:
'
+ JSON.stringify(o.list));
'
Loading
ended
.
'
);
});
// JIO.subscribe(
'
start_deleting
'
, function (e,o,r) {
// console.log (
'
start_deleting
received
'
);
// objectDump(o);
// $(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
//
'
Deleting
"
' + o.fileName + '
"
...
'
);
// $(
'
#
divdebug
'
).html($(
'
#
divdebug
'
).html() +
'
<
br
/>
'
+
//
'
delete
remainingjobs
:
'
+ r);
// });
// JIO.subscribe(
'
stop_deleting
'
, function (e,o) {
// console.log (
'
stop_deleting
received
'
);
// objectDump(o);
// $(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
//
'
Deleting
ended
with
result
:
'
+ o.status +
'
,
message
:
'
+ o.message);
// });
// JIO.subscribe(
'
start_gettinglist
'
, function (e,o) {
// console.log (
'
start_deleting
received
'
);
// objectDump(o);
// $(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
//
'
Getting
list
...
'
);
// });
// JIO.subscribe(
'
stop_gettinglist
'
, function (e,o) {
// console.log (
'
stop_deleting
received
'
);
// objectDump(o);
// $(
'
#
divmessage
'
).html($(
'
#
divmessage
'
).html() +
'
<
br
/>
'
+
//
'
Getting
list
ended
with
result
:
'
+ o.status +
'
,
message
:
'
+ o.message);
// $(
'
#
divdebug
'
).html($(
'
#
divdebug
'
).html() +
'
<
br
/>
'
+
//
'
getList
:
'
+ JSON.stringify(o.list));
// });
//// events set
//// init JIO
...
...
@@ -97,10 +107,10 @@ if ( !JIO.isReady() ) alert('Not ready');
//// end init
//// Let
'
s
test
!
//
JIO.loadDocument("SonNom");
JIO
.
saveDocument
(
"
Inside the document.
"
,
"
SonNom
"
);
JIO
.
loadDocument
(
"
SonNom
"
);
//
JIO.saveDocument("Inside the document.","SonNom");
// JIO.saveDocument("Inside the document.","SonNom");
JIO
.
saveDocument
(
"
Inside the document.
"
,
"
SonNom2
"
);
//
JIO.saveDocument("Inside the document.","SonNom2");
// JIO.getDocumentList();
// JIO.loadDocument("SonNom");
// JIO.deleteDocument("SonNom");
...
...
jiotest/unhosted/jio.js
View file @
802a22f7
This diff is collapsed.
Click to expand it.
jiotest/unhosted/jio.storage.js
0 → 100644
View file @
802a22f7
// There's only one comment at the top (and the bottom) of this file!
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