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
Hide 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 */
/*jslint
maxlen:80, nomen: true
*/
/*jslint
nomen: true
*/
(
function
(
window
,
rJS
)
{
"
use strict
"
;
rJS
(
window
).
ready
(
function
(
g
)
{
// First, load the progress gadget
var
div_context
=
g
.
__element
.
getElementsByTagName
(
'
div
'
)[
0
];
var
input_context
=
g
.
__element
.
getElementsByTagName
(
'
input
'
)[
0
];
g
.
declareGadget
(
'
../audioplayer_progress/index.html
'
,
{
element
:
div_context
// sandbox: 'iframe'
}
'
../audioplayer_control/index.html
'
)
.
then
(
function
(
progress
)
{
progress
.
setValue
(
50
);
progress
.
setMax
(
100
);
return
[
50
,
100
];
})
.
then
(
function
(
e
)
{
console
.
log
(
e
[
0
]
+
e
[
1
]);
.
then
(
function
(
control
)
{
input_context
.
onchange
=
function
()
{
control
.
setSong
(
input_context
.
files
[
0
]);
control
.
playSong
();
};
})
.
fail
(
function
(
e
)
{
console
.
log
(
"
error
"
+
e
);
console
.
log
(
"
[ERROR]:
"
+
e
);
});
});
}(
window
,
rJS
));
src/audioplayer/index.html
View file @
09977a82
...
...
@@ -15,12 +15,8 @@
</head>
<body>
<input
type=
"file"
id=
"file"
name=
"file"
multiple
/>
<div
style=
"color:#00FF00"
id=
"div"
>
</div>
</body>
</html>
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