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
09977a82
Commit
09977a82
authored
May 23, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add example of using control gadget
parent
c08b51d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
21 deletions
+11
-21
src/audioplayer/audioplayer.js
src/audioplayer/audioplayer.js
+9
-15
src/audioplayer/index.html
src/audioplayer/index.html
+2
-6
No files found.
src/audioplayer/audioplayer.js
View file @
09977a82
/*global window, rJS, RSVP, console */
/*global window, rJS, RSVP, console */
/*jslint
maxlen:80, nomen: true
*/
/*jslint
nomen: true
*/
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
).
ready
(
function
(
g
)
{
rJS
(
window
).
ready
(
function
(
g
)
{
// First, load the progress gadget
// First, load the progress gadget
var
div_context
=
g
.
__element
.
getElementsByTagName
(
'
div
'
)[
0
];
var
input_context
=
g
.
__element
.
getElementsByTagName
(
'
input
'
)[
0
];
g
.
declareGadget
(
g
.
declareGadget
(
'
../audioplayer_progress/index.html
'
,
'
../audioplayer_control/index.html
'
{
element
:
div_context
// sandbox: 'iframe'
}
)
)
.
then
(
function
(
progress
)
{
.
then
(
function
(
control
)
{
progress
.
setValue
(
50
);
input_context
.
onchange
=
function
()
{
progress
.
setMax
(
100
);
control
.
setSong
(
input_context
.
files
[
0
]);
return
[
50
,
100
];
control
.
playSong
();
})
};
.
then
(
function
(
e
)
{
console
.
log
(
e
[
0
]
+
e
[
1
]);
})
})
.
fail
(
function
(
e
)
{
.
fail
(
function
(
e
)
{
console
.
log
(
"
error
"
+
e
);
console
.
log
(
"
[ERROR]:
"
+
e
);
});
});
});
});
}(
window
,
rJS
));
}(
window
,
rJS
));
src/audioplayer/index.html
View file @
09977a82
...
@@ -15,11 +15,7 @@
...
@@ -15,11 +15,7 @@
</head>
</head>
<body>
<body>
<input
type=
"file"
id=
"file"
name=
"file"
multiple
/>
<div
style=
"color:#00FF00"
id=
"div"
>
</div>
</body>
</body>
...
...
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