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
e7be7c4a
Commit
e7be7c4a
authored
Jun 04, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove onclick event in audioplayer
parent
be871646
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
src/audioplayer/audioplayer.html
src/audioplayer/audioplayer.html
+2
-1
src/audioplayer/audioplayer.js
src/audioplayer/audioplayer.js
+18
-11
src/audioplayer/interface.js
src/audioplayer/interface.js
+2
-3
No files found.
src/audioplayer/audioplayer.html
View file @
e7be7c4a
...
...
@@ -18,7 +18,8 @@
<div
class =
"audioplayer"
>
<a
class =
"next"
>
next
</a>
<a
class =
"command"
>
play/pause
</a>
<a
class =
"play"
>
play
</a>
<a
class =
"stop"
>
stop
</a>
<!-- data-gadget-sandbox="iframe" -->
<div
class =
"control"
data-gadget-url=
"../audioplayer_control/index.html"
data-gadget-scope=
"control"
>
</div>
...
...
src/audioplayer/audioplayer.js
View file @
e7be7c4a
...
...
@@ -11,7 +11,8 @@
totalId
=
-
1
,
that
,
next_context
,
command_context
,
play_context
,
stop_context
,
currentId
,
initializeFlag
=
false
;
function
nextId
()
{
...
...
@@ -77,7 +78,8 @@
})
.
ready
(
function
(
g
)
{
next_context
=
g
.
__element
.
getElementsByTagName
(
'
a
'
)[
0
];
command_context
=
g
.
__element
.
getElementsByTagName
(
'
a
'
)[
1
];
play_context
=
g
.
__element
.
getElementsByTagName
(
'
a
'
)[
1
];
stop_context
=
g
.
__element
.
getElementsByTagName
(
'
a
'
)[
2
];
that
=
g
;
initializeFlag
=
false
;
RSVP
.
all
([
...
...
@@ -110,15 +112,12 @@
});
},
1000
);
volume
.
setMax
(
3
);
command_context
.
onclick
=
function
()
{
control
.
isPaused
().
then
(
function
(
paused
)
{
if
(
paused
)
{
control
.
playSong
();
}
else
{
control
.
stopSong
();
}
});
};
that
.
showPage
(
"
play
"
).
then
(
function
(
result
)
{
play_context
.
href
=
result
;
});
that
.
showPage
(
"
stop
"
).
then
(
function
(
result
)
{
stop_context
.
href
=
result
;
});
//volume configure
control
.
getVolume
().
then
(
function
(
value
)
{
volume
.
setValue
(
value
);
...
...
@@ -148,6 +147,14 @@
});
});
if
(
options
.
page
!==
undefined
)
{
if
(
options
.
page
===
"
play
"
)
{
control
.
playSong
();
return
;
}
if
(
options
.
page
===
"
stop
"
)
{
control
.
stopSong
();
return
;
}
control
.
setSong
(
options
.
page
).
then
(
function
(
result
)
{
if
(
result
===
-
1
)
{
control
.
stopSong
()
...
...
src/audioplayer/interface.js
View file @
e7be7c4a
...
...
@@ -6,7 +6,7 @@
top
;
rJS
(
window
)
.
allowPublicAcquisition
(
"
ErrorPage
"
,
function
()
{
top
.
__element
.
innerHTML
=
"
ERROR
"
;
top
.
__element
.
innerHTML
=
"
ERROR
:music does't exist
"
;
top
.
error
=
true
;
})
.
allowPublicAcquisition
(
"
showPage
"
,
function
(
param_list
)
{
...
...
@@ -27,8 +27,7 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
if
(
top
.
error
===
true
)
{
top
.
__element
.
innerHTML
=
"
"
;
top
.
dropGadget
(
"
audioplayer
"
).
then
(
function
(
e
)
{
console
.
log
(
e
);
top
.
dropGadget
(
"
audioplayer
"
).
then
(
function
()
{
top
.
declareGadget
(
"
./audioplayer.html
"
,
{
element
:
top
.
__element
,
scope
:
"
audioplayer
"
}
...
...
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