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
ad4a0869
Commit
ad4a0869
authored
May 02, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Replicate storage
parent
eb1e3767
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
8 deletions
+65
-8
jiotest/debug.html
jiotest/debug.html
+10
-7
jiotest/unhosted/jio.js
jiotest/unhosted/jio.js
+2
-1
jiotest/unhosted/jio.storage.js
jiotest/unhosted/jio.storage.js
+53
-0
No files found.
jiotest/debug.html
View file @
ad4a0869
...
@@ -13,13 +13,16 @@
...
@@ -13,13 +13,16 @@
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
getXML
=
function
(
lol
)
{
$
.
ajax
({
var
tmp
=
''
;
url
:
'
responsexml/davsave
'
,
$
.
ajax
({
url
:
lol
,
async
:
false
,
dataType
:
'
text
'
,
dataType
:
'
text
'
,
success
:
function
(
xml
){
tmp
=
xml
}});
success
:
function
()
{
return
tmp
;
console
.
log
(
'
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
'
);
}
}
alert
(
getXML
(
'
responsexml/davlist
'
));
});
for
(
var
i
=
0
;
i
<
300
;
i
++
)
{
console
.
log
(
'
a
'
);
}
</script>
</script>
</body>
</body>
</html>
</html>
jiotest/unhosted/jio.js
View file @
ad4a0869
...
@@ -282,7 +282,8 @@
...
@@ -282,7 +282,8 @@
// Create a storage object and use it to save,load,...!
// Create a storage object and use it to save,load,...!
var
t
=
this
;
var
t
=
this
;
createStorageObject
(
createStorageObject
(
{
'
storage
'
:
job
.
storage
,
{
'
queue
'
:
this
,
'
storage
'
:
job
.
storage
,
'
applicant
'
:
jioGlobalObj
.
applicant
})[
job
.
method
](
'
applicant
'
:
jioGlobalObj
.
applicant
})[
job
.
method
](
job
,
function
(
endedjob
){
job
,
function
(
endedjob
){
t
.
ended
(
endedjob
);
t
.
ended
(
endedjob
);
...
...
jiotest/unhosted/jio.storage.js
View file @
ad4a0869
// Adds 3 storages for Jio
// type:
// - local
// - dav
// - replicate
;(
function
(
Jio
)
{
;(
function
(
Jio
)
{
// check dependencies
// check dependencies
...
@@ -698,4 +703,52 @@
...
@@ -698,4 +703,52 @@
// end DAVStorage
// end DAVStorage
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// ReplicateStorage
var
ReplicateStorage
=
function
(
options
)
{
this
.
queue
=
options
.
queue
;
this
.
id
=
null
;
this
.
length
=
options
.
storage
.
list
.
length
;
this
.
returnsValuesArray
=
[];
};
ReplicateStorage
.
prototype
=
{
checkNameAvailability
:
function
(
job
,
jobendcallback
)
{
var
t
=
this
;
for
(
var
i
in
job
.
storage
.
list
)
{
var
newjob
=
$
.
extend
({},
job
);
newjob
.
storage
=
job
.
storage
.
list
[
i
];
newjob
.
callback
=
function
(
result
){
t
.
returnsValuesArray
.
push
(
result
);
};
this
.
queue
.
addJob
(
newjob
);
}
//// callback listener
this
.
id
=
setInterval
(
function
()
{
if
(
t
.
returnsValuesArray
.
length
>=
t
.
length
)
{
var
res
=
{};
// TODO
jobendcallback
(
job
);
job
.
callback
(
res
);
clearInterval
(
t
.
id
);
}
},
100
);
//// end call back listener
},
saveDocument
:
function
(
job
,
jobendcallback
)
{
},
loadDocument
:
function
(
job
,
jobendcallback
)
{
},
getDocumentList
:
function
(
job
,
jobendcallback
)
{
},
removeDocument
:
function
(
job
,
jobendcallback
)
{
}
};
// add key to storageObject
Jio
.
addStorageType
(
'
replicate
'
,
function
(
options
)
{
return
new
ReplicateStorage
(
options
);
});
// end ReplicateStorage
////////////////////////////////////////////////////////////////////////////
})(
JIO
);
})(
JIO
);
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