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
6f672beb
Commit
6f672beb
authored
May 21, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Array browsing bug fixed.
parent
586cee4e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
24 deletions
+26
-24
OfficeJS/src/jio.js
OfficeJS/src/jio.js
+10
-8
OfficeJS/src/jio.storage.js
OfficeJS/src/jio.storage.js
+8
-8
OfficeJS/src/localorcookiestorage.js
OfficeJS/src/localorcookiestorage.js
+8
-8
No files found.
OfficeJS/src/jio.js
View file @
6f672beb
...
...
@@ -290,7 +290,7 @@ var JIO =
var
k
=
null
,
id
=
0
,
jioIdArray
=
jioGlobalObj
.
localStorage
.
getItem
(
jioIdArrayName
);
for
(
k
in
jioIdArray
)
{
for
(
k
=
0
;
k
<
jioIdArray
.
length
;
k
+=
1
)
{
if
(
jioIdArray
[
k
]
>=
jioGlobalObj
.
queueID
)
{
jioGlobalObj
.
queueID
=
jioIdArray
[
k
]
+
1
;
}
...
...
@@ -304,7 +304,7 @@ var JIO =
var
k
=
null
,
newJioIdArray
=
[],
jioIdArrayChanged
=
false
,
jioIdArray
=
jioGlobalObj
.
localStorage
.
getItem
(
jioIdArrayName
);
for
(
k
in
jioIdArray
)
{
for
(
k
=
0
;
k
<
jioIdArray
.
length
;
k
+=
1
)
{
if
(
jioGlobalObj
.
localStorage
.
getItem
(
'
jio/id/
'
+
jioIdArray
[
k
])
<
Date
.
now
()
-
10000
)
{
// remove id from jioIdArray
...
...
@@ -405,7 +405,7 @@ var JIO =
if
(
res
.
newone
)
{
// if it is a new job, we can eliminate deprecated jobs and
// set this job dependencies.
for
(
id
in
res
.
elimArray
)
{
for
(
id
=
0
;
id
<
res
.
elimArray
.
length
;
id
+=
1
)
{
basestorage
=
new
BaseStorage
(
{
'
queue
'
:
that
,
'
job
'
:
priv
.
jobObject
[
res
.
elimArray
[
id
]]});
basestorage
.
eliminate
();
...
...
@@ -413,13 +413,13 @@ var JIO =
if
(
res
.
waitArray
.
length
>
0
)
{
job
.
status
=
'
wait
'
;
job
.
waitingFor
=
{
'
jobIdArray
'
:
res
.
waitArray
};
for
(
id
in
res
.
waitArray
)
{
for
(
id
=
0
;
id
<
res
.
waitArray
.
length
;
id
+=
1
)
{
if
(
priv
.
jobObject
[
res
.
waitArray
[
id
]])
{
priv
.
jobObject
[
res
.
waitArray
[
id
]].
maxtries
=
1
;
}
}
}
for
(
id
in
res
.
removeArray
)
{
for
(
id
=
0
;
id
<
res
.
removeArray
.
length
;
id
+=
1
)
{
that
.
removeJob
(
priv
.
jobObject
[
res
.
removeArray
[
id
]]);
}
// set job id
...
...
@@ -481,7 +481,7 @@ var JIO =
that
.
invokeAll
=
function
()
{
// Do all jobs in the queue.
var
i
=
'
id
'
,
ok
;
var
i
=
'
id
'
,
j
,
ok
;
//// do All jobs
for
(
i
in
priv
.
jobObject
)
{
ok
=
false
;
...
...
@@ -495,7 +495,9 @@ var JIO =
if
(
priv
.
jobObject
[
i
].
waitingFor
.
jobIdArray
)
{
// wait job
// browsing job id array
for
(
var
j
in
priv
.
jobObject
[
i
].
waitingFor
.
jobIdArray
)
{
for
(
j
=
0
;
j
<
priv
.
jobObject
[
i
].
waitingFor
.
jobIdArray
.
length
;
j
+=
1
)
{
if
(
priv
.
jobObject
[
priv
.
jobObject
[
i
].
waitingFor
.
jobIdArray
[
j
]])
{
// if a job is still exist, don't invoke
...
...
@@ -743,7 +745,7 @@ var JIO =
var
i
;
priv
.
res
.
message
=
'
Document list received.
'
;
priv
.
res
.
list
=
documentlist
;
for
(
i
in
priv
.
res
.
list
)
{
for
(
i
=
0
;
i
<
priv
.
res
.
list
.
length
;
i
+=
1
)
{
priv
.
res
.
list
[
i
].
lastModified
=
new
Date
(
priv
.
res
.
list
[
i
].
lastModified
).
getTime
();
priv
.
res
.
list
[
i
].
creationDate
=
...
...
OfficeJS/src/jio.storage.js
View file @
6f672beb
...
...
@@ -42,11 +42,11 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
// wait a little in order to simulate asynchronous operation
setTimeout
(
function
()
{
var
localStorageObject
=
null
;
var
localStorageObject
=
null
,
k
,
splitk
;
localStorageObject
=
LocalOrCookieStorage
.
getAll
();
for
(
var
k
in
localStorageObject
)
{
var
splitk
=
k
.
split
(
'
/
'
);
for
(
k
in
localStorageObject
)
{
splitk
=
k
.
split
(
'
/
'
);
if
(
splitk
[
0
]
===
'
jio
'
&&
splitk
[
1
]
===
'
local
'
&&
splitk
[
2
]
===
that
.
getUserName
())
{
...
...
@@ -522,7 +522,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
}
};
for
(
i
in
priv
.
storageArray
)
{
for
(
i
=
0
;
i
<
priv
.
storageArray
.
length
;
i
+=
1
)
{
newjob
=
that
.
cloneJob
();
newjob
.
maxtries
=
priv
.
maxtries
;
newjob
.
storage
=
priv
.
storageArray
[
i
];
...
...
@@ -557,7 +557,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
}
};
for
(
i
in
priv
.
storageArray
)
{
for
(
i
=
0
;
i
<
priv
.
storageArray
.
length
;
i
+=
1
)
{
newjob
=
that
.
cloneJob
();
newjob
.
maxtries
=
priv
.
maxtries
;
newjob
.
storage
=
priv
.
storageArray
[
i
];
...
...
@@ -630,7 +630,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
}
};
for
(
i
in
priv
.
storageArray
)
{
for
(
i
=
0
;
i
<
priv
.
storageArray
.
length
;
i
+=
1
)
{
newjob
=
that
.
cloneJob
();
newjob
.
maxtries
=
priv
.
maxtries
;
newjob
.
storage
=
priv
.
storageArray
[
i
];
...
...
@@ -668,7 +668,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
}
};
for
(
i
in
priv
.
storageArray
)
{
for
(
i
=
0
;
i
<
priv
.
storageArray
.
length
;
i
+=
1
)
{
newjob
=
that
.
cloneJob
();
newjob
.
maxtries
=
priv
.
maxtries
;
newjob
.
storage
=
priv
.
storageArray
[
i
];
...
...
@@ -703,7 +703,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
}
};
for
(
i
in
priv
.
storageArray
)
{
for
(
i
=
0
;
i
<
priv
.
storageArray
.
length
;
i
+=
1
)
{
newjob
=
that
.
cloneJob
();
newjob
.
maxtries
=
priv
.
maxtries
;
newjob
.
storage
=
priv
.
storageArray
[
i
];
...
...
OfficeJS/src/localorcookiestorage.js
View file @
6f672beb
...
...
@@ -40,10 +40,10 @@ var LocalOrCookieStorage =
};
CookieStorage
.
prototype
=
{
getItem
:
function
(
name
)
{
var
cookies
=
document
.
cookie
.
split
(
'
;
'
);
for
(
var
i
in
cookies
)
{
var
x
=
cookies
[
i
].
substr
(
0
,
cookies
[
i
].
indexOf
(
'
=
'
))
;
var
y
=
cookies
[
i
].
substr
(
cookies
[
i
].
indexOf
(
'
=
'
)
+
1
);
var
cookies
=
document
.
cookie
.
split
(
'
;
'
)
,
i
;
for
(
i
=
0
;
i
<
cookies
.
length
;
i
+=
1
)
{
var
x
=
cookies
[
i
].
substr
(
0
,
cookies
[
i
].
indexOf
(
'
=
'
))
,
y
=
cookies
[
i
].
substr
(
cookies
[
i
].
indexOf
(
'
=
'
)
+
1
);
x
=
x
.
replace
(
/^
\s
+|
\s
+$/g
,
""
);
if
(
x
===
name
)
{
return
unescape
(
y
);
}
}
...
...
@@ -60,11 +60,11 @@ var LocalOrCookieStorage =
return
false
;
},
getAll
:
function
()
{
var
retObject
=
{}
;
var
retObject
=
{}
,
i
,
var
cookies
=
document
.
cookie
.
split
(
'
:
'
);
for
(
var
i
in
cookies
)
{
var
x
=
cookies
[
i
].
substr
(
0
,
cookies
[
i
].
indexOf
(
'
=
'
))
;
var
y
=
cookies
[
i
].
substr
(
cookies
[
i
].
indexOf
(
'
=
'
)
+
1
);
for
(
i
=
0
;
i
<
cookies
.
length
;
i
+=
1
)
{
var
x
=
cookies
[
i
].
substr
(
0
,
cookies
[
i
].
indexOf
(
'
=
'
))
,
y
=
cookies
[
i
].
substr
(
cookies
[
i
].
indexOf
(
'
=
'
)
+
1
);
x
=
x
.
replace
(
/^
\s
+|
\s
+$/g
,
""
);
retObject
[
x
]
=
unescape
(
y
);
}
...
...
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