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
cd5ab325
Commit
cd5ab325
authored
Aug 28, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add interaction gadget example.
Follow same conventions for gadgets' root file.
parent
8e35bd3c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
0 deletions
+90
-0
OfficeJS/src/renderjs/examples/hello_world/index.html
OfficeJS/src/renderjs/examples/hello_world/index.html
+0
-0
OfficeJS/src/renderjs/examples/interactions/A.html
OfficeJS/src/renderjs/examples/interactions/A.html
+21
-0
OfficeJS/src/renderjs/examples/interactions/B.html
OfficeJS/src/renderjs/examples/interactions/B.html
+16
-0
OfficeJS/src/renderjs/examples/interactions/index.html
OfficeJS/src/renderjs/examples/interactions/index.html
+51
-0
OfficeJS/src/renderjs/test/renderjs_test.js
OfficeJS/src/renderjs/test/renderjs_test.js
+2
-0
No files found.
OfficeJS/src/renderjs/examples/hello_world/
hello_world
.html
→
OfficeJS/src/renderjs/examples/hello_world/
index
.html
View file @
cd5ab325
File moved
OfficeJS/src/renderjs/examples/interactions/A.html
0 → 100644
View file @
cd5ab325
<div>
A (gadget)
<button
onclick=
"RenderJs.GadgetIndex.getGadgetById('A').jsCall1()"
>
A.jsCall1 -> C.jsCall1
</button>
<button
onclick=
"$('#A').trigger('htmlEvent1')"
>
HTML event 1
</button>
<button
onclick=
"$('#A').trigger('htmlEvent2')"
>
HTML event 2
</button>
<p
id=
"hide"
style=
"display:none;"
>
hidden text on myownHTMlEvent1
</p>
</div>
<script
type=
"text/javascript"
language=
"javascript"
>
//
<!
[
CDATA
[
$
(
document
).
ready
(
function
()
{
gadget
=
RenderJs
.
GadgetIndex
.
getGadgetById
(
"
A
"
);
gadget
.
jsCall1
=
function
(){
alert
(
"
A.jscall1
"
);};
gadget
.
jsCall2
=
function
(){
alert
(
"
A.jscall2
"
);};
gadget
.
myOwnHtmlEvent1
=
function
(){
$
(
"
#hide
"
).
toggle
();
alert
(
"
A.myOwnHtmlEvent1
"
);
};
});
//]]>
</script>
\ No newline at end of file
OfficeJS/src/renderjs/examples/interactions/B.html
0 → 100644
View file @
cd5ab325
<div>
B (gadget)
<button
onclick=
"RenderJs.GadgetIndex.getGadgetById('B').jsCall2();"
>
B.jsCall2 -> A.jsCall2
</button>
</div>
<script
type=
"text/javascript"
language=
"javascript"
>
//
<!
[
CDATA
[
$
(
document
).
ready
(
function
()
{
gadget
=
RenderJs
.
GadgetIndex
.
getGadgetById
(
"
B
"
);
gadget
.
jsCall1
=
function
(){
alert
(
"
B.jscall1
"
);};
gadget
.
jsCall2
=
function
(){
alert
(
"
B.jscall2
"
);};
gadget
.
htmlEvent1
=
function
(){
alert
(
"
B.htmlEvent1
"
);};
gadget
.
htmlEvent2
=
function
(){
alert
(
"
B.htmlEvent2
"
);};
});
//]]>
</script>
\ No newline at end of file
OfficeJS/src/renderjs/examples/interactions/index.html
0 → 100644
View file @
cd5ab325
<html>
<head>
<script
src=
"../../../../lib/jquery/jquery.js"
>
</script>
<script
src=
"../../../../lib/jstorage/jstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../../renderjs.js"
></script>
<head>
<body>
<div
id=
"A"
data-gadget=
"A.html"
data-gadget:property=
"{"cacheable": "1", "cache_id": "A"}"
></div>
<div
id=
"B"
data-gadget=
"B.html"
data-gadget:property=
"{"cacheable": "1", "cache_id": "B"}"
></div>
<div
data-gadget=
""
id=
"main-interactor"
>
<connect
source=
"A.jsCall1"
destination=
"B.jsCall1"
></connect>
<connect
source=
"A.htmlEvent1"
destination=
"B.htmlEvent1"
></connect>
<connect
source=
"A.htmlEvent1"
destination=
"A.myOwnHtmlEvent1"
></connect>
<connect
source=
"A.htmlEvent2"
destination=
"B.htmlEvent2"
></connect>
<connect
source=
"B.jsCall2"
destination=
"A.jsCall2"
></connect>
</div>
<script
type=
"text/javascript"
language=
"javascript"
>
//
<!
[
CDATA
[
$
(
document
).
ready
(
function
()
{
// XXX: using setTimeout is ugly, see non working example below to be fixed
window
.
setTimeout
(
function
()
{
RenderJs
.
InteractionGadget
.
bind
(
$
(
"
#main-interactor
"
));},
1000
);
// RenderJs.GadgetIndex.getRootGadget().getDom().bind("ready", function () {
// RenderJs.InteractionGadget.bind($("#main-interactor"));});
});
//]]>
</script>
</body>
</html>
OfficeJS/src/renderjs/test/renderjs_test.js
View file @
cd5ab325
...
...
@@ -44,5 +44,7 @@ function setupRenderJSTest(){
equal
(
RenderJs
.
GadgetIndex
.
getGadgetList
().
length
,
1
);
});
// XXX: test InteractionGadget
};
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