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
d0ac8107
Commit
d0ac8107
authored
May 31, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: copy object will now clone object instead of clone object root only.
parent
e159ec00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
OfficeJS/src/jio.js
OfficeJS/src/jio.js
+22
-22
No files found.
OfficeJS/src/jio.js
View file @
d0ac8107
/**
* JavaScript Input/Output
* @namespace JIO
* @module JIO
*/
var
JIO
=
(
function
()
{
var
jio_loader_function
=
function
(
localOrCookieStorage
,
$
)
{
...
...
@@ -166,13 +170,6 @@ var JIO =
////////////////////////////////////////////////////////////////////////////
// Tools
extend
=
function
(
o1
,
o2
)
{
var
key
;
for
(
key
in
o2
)
{
o1
[
key
]
=
o2
[
key
];
}
return
o1
;
},
// end Tools
////////////////////////////////////////////////////////////////////////////
...
...
@@ -226,7 +223,7 @@ var JIO =
newJob
=
function
(
spec
,
my
)
{
// Job constructor
var
job
=
extend
(
{},
spec
);
var
job
=
$
.
extend
(
true
,
{},
spec
);
job
[
'
id
'
]
=
0
;
job
[
'
status
'
]
=
'
initial
'
;
job
[
'
date
'
]
=
Date
.
now
();
...
...
@@ -438,8 +435,8 @@ var JIO =
// options.job = the job object containing at least {id:..}.
// options.where = remove values where options.where(job) === true
var
settings
=
extend
({
where
:
function
(
job
)
{
return
true
;}},
options
),
andwhere
,
found
=
false
,
k
=
'
key
'
;
var
settings
=
$
.
extend
({
where
:
function
(
job
)
{
return
true
;}},
options
),
andwhere
,
found
=
false
,
k
=
'
key
'
;
//// modify the job list
if
(
settings
.
job
)
{
...
...
@@ -553,7 +550,7 @@ var JIO =
// It is a callback function called just before user callback.
// It is called to manage job_object according to the ended job.
var
job
=
extend
(
{},
endedjob
);
// copy
var
job
=
$
.
extend
(
true
,
{},
endedjob
);
// copy
// This job is supposed terminated, we can remove it from queue.
that
.
removeJob
({
'
job
'
:
job
});
...
...
@@ -797,7 +794,7 @@ var JIO =
//// Getters Setters
that
.
cloneJob
=
function
()
{
return
extend
(
{},
priv
.
job
);
return
$
.
extend
(
true
,
{},
priv
.
job
);
};
that
.
getUserName
=
function
()
{
return
priv
.
job
.
userName
||
''
;
...
...
@@ -814,6 +811,9 @@ var JIO =
that
.
getStorageLocation
=
function
()
{
return
priv
.
job
.
storage
.
location
||
''
;
};
that
.
getSecondStorage
=
function
()
{
return
priv
.
job
.
storage
.
storage
||
{};
};
that
.
getStorageArray
=
function
()
{
return
priv
.
job
.
storage
.
storageArray
||
[];
};
...
...
@@ -824,7 +824,7 @@ var JIO =
return
priv
.
job
.
fileContent
||
''
;
};
that
.
cloneOptionObject
=
function
()
{
return
extend
(
{},
priv
.
job
.
options
);
return
$
.
extend
(
true
,
{},
priv
.
job
.
options
);
};
that
.
getMaxTries
=
function
()
{
return
priv
.
job
.
maxtries
;
...
...
@@ -1143,7 +1143,7 @@ var JIO =
// } else { } // Error
// }});
var
settings
=
extend
(
{
var
settings
=
$
.
extend
(
true
,
{
'
userName
'
:
priv
.
storage
.
userName
,
'
storage
'
:
priv
.
storage
,
'
applicant
'
:
priv
.
applicant
,
...
...
@@ -1176,7 +1176,7 @@ var JIO =
// } else { } // Error
// }});
var
settings
=
extend
(
{
var
settings
=
$
.
extend
(
true
,
{
'
storage
'
:
priv
.
storage
,
'
applicant
'
:
priv
.
applicant
,
'
fileContent
'
:
''
,
...
...
@@ -1214,7 +1214,7 @@ var JIO =
// fileName:'string',fileContent:'string',
// creationDate:123,lastModified:456 }
var
settings
=
extend
(
{
var
settings
=
$
.
extend
(
true
,
{
'
storage
'
:
priv
.
storage
,
'
applicant
'
:
priv
.
applicant
,
'
method
'
:
'
loadDocument
'
,
...
...
@@ -1248,7 +1248,7 @@ var JIO =
// result.return_value is an Array that contains documents objects.
var
settings
=
extend
(
{
var
settings
=
$
.
extend
(
true
,
{
'
storage
'
:
priv
.
storage
,
'
applicant
'
:
priv
.
applicant
,
'
method
'
:
'
getDocumentList
'
,
...
...
@@ -1278,7 +1278,7 @@ var JIO =
// } else { } // Not Removed
// }});
var
settings
=
extend
(
{
var
settings
=
$
.
extend
(
true
,
{
'
storage
'
:
priv
.
storage
,
'
applicant
'
:
priv
.
applicant
,
'
method
'
:
'
removeDocument
'
,
...
...
@@ -1293,7 +1293,7 @@ var JIO =
//// end Methods
//// Initialize
var
settings
=
extend
(
{
'
use_local_storage
'
:
true
},
spec
.
options
);
var
settings
=
$
.
extend
(
true
,
{
'
use_local_storage
'
:
true
},
spec
.
options
);
// objectify storage and applicant
if
(
typeof
spec
.
storage
===
'
string
'
)
{
...
...
@@ -1346,7 +1346,7 @@ var JIO =
// applicant: the applicant object or json string
// options.useLocalStorage: if true, save job queue on localStorage.
var
settings
=
extend
(
{
'
use_local_storage
'
:
true
},
options
);
var
settings
=
$
.
extend
(
true
,
{
'
use_local_storage
'
:
true
},
options
);
return
newJioConstructor
({
storage
:
storage
,
applicant
:
applicant
,
...
...
@@ -1377,7 +1377,7 @@ var JIO =
};
that
.
getConstObject
=
function
()
{
// Returns a copy of the constants
return
extend
(
{},
jio_const_obj
);
return
$
.
extend
(
true
,
{},
jio_const_obj
);
};
return
that
;
};
...
...
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