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
9868b256
Commit
9868b256
authored
Sep 01, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tools usedin the code
parent
139ab0be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
UNGProject/unhosted/jio.js
UNGProject/unhosted/jio.js
+40
-1
No files found.
UNGProject/unhosted/jio.js
View file @
9868b256
...
@@ -911,9 +911,48 @@
...
@@ -911,9 +911,48 @@
}
}
}
}
window
.
JIO
=
JIO
;
//the name to use for the framework. Ex : JIO.initialize(...), JIO.loadDocument...
/**
* delegate a function to a non-object element, or to each element of an array of non-object elements
* this function is used to delete a file or a list of files for example
* @param element : a non-object element, or an array of non-object elements
* @param f : function to apply
*/
function
oneOrEach
(
element
,
f
)
{
typeof
element
!=
"
object
"
?
f
(
element
)
:
$
.
each
(
element
,
function
(
index
,
fileName
)
{
f
(
fileName
);})
}
/**
* return a shallow copy of the object parameter
* @param object : the object to copy
* @return a shallow copy of the object
*/
function
copy
(
object
)
{
return
$
.
extend
({},
object
);
}
}
/**
* add an instruction to a function
* @param instruction : the instruction to add to the function
* @param f : the function
* @param before : (optional) set to true if you want the instruction to be executed before f
* @return a new function executing f & instruction
*/
function
addInstruction
(
instruction
,
f
,
before
)
{
return
before
?
function
()
{
var
result
=
instruction
.
apply
(
this
,
arguments
);
if
(
f
)
{
return
f
.
apply
(
this
,
arguments
);}
return
result
;
}
:
function
()
{
if
(
f
)
{
f
.
apply
(
this
,
arguments
);}
return
instruction
.
apply
(
this
,
arguments
);
};
}
window
.
JIO
=
JIO
;
//the name to use for the framework. Ex : JIO.initialize(...), JIO.loadDocument...
/****************************************************************
/****************************************************************
*************************** Loader *****************************/
*************************** Loader *****************************/
...
...
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