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 @@
...
@@ -18,7 +18,8 @@
<div
class =
"audioplayer"
>
<div
class =
"audioplayer"
>
<a
class =
"next"
>
next
</a>
<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" -->
<!-- data-gadget-sandbox="iframe" -->
<div
class =
"control"
data-gadget-url=
"../audioplayer_control/index.html"
data-gadget-scope=
"control"
>
<div
class =
"control"
data-gadget-url=
"../audioplayer_control/index.html"
data-gadget-scope=
"control"
>
</div>
</div>
...
...
src/audioplayer/audioplayer.js
View file @
e7be7c4a
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
totalId
=
-
1
,
totalId
=
-
1
,
that
,
that
,
next_context
,
next_context
,
command_context
,
play_context
,
stop_context
,
currentId
,
currentId
,
initializeFlag
=
false
;
initializeFlag
=
false
;
function
nextId
()
{
function
nextId
()
{
...
@@ -77,7 +78,8 @@
...
@@ -77,7 +78,8 @@
})
})
.
ready
(
function
(
g
)
{
.
ready
(
function
(
g
)
{
next_context
=
g
.
__element
.
getElementsByTagName
(
'
a
'
)[
0
];
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
;
that
=
g
;
initializeFlag
=
false
;
initializeFlag
=
false
;
RSVP
.
all
([
RSVP
.
all
([
...
@@ -110,15 +112,12 @@
...
@@ -110,15 +112,12 @@
});
});
},
1000
);
},
1000
);
volume
.
setMax
(
3
);
volume
.
setMax
(
3
);
command_context
.
onclick
=
function
()
{
that
.
showPage
(
"
play
"
).
then
(
function
(
result
)
{
control
.
isPaused
().
then
(
function
(
paused
)
{
play_context
.
href
=
result
;
if
(
paused
)
{
});
control
.
playSong
();
that
.
showPage
(
"
stop
"
).
then
(
function
(
result
)
{
}
else
{
stop_context
.
href
=
result
;
control
.
stopSong
();
});
}
});
};
//volume configure
//volume configure
control
.
getVolume
().
then
(
function
(
value
)
{
control
.
getVolume
().
then
(
function
(
value
)
{
volume
.
setValue
(
value
);
volume
.
setValue
(
value
);
...
@@ -148,6 +147,14 @@
...
@@ -148,6 +147,14 @@
});
});
});
});
if
(
options
.
page
!==
undefined
)
{
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
)
{
control
.
setSong
(
options
.
page
).
then
(
function
(
result
)
{
if
(
result
===
-
1
)
{
if
(
result
===
-
1
)
{
control
.
stopSong
()
control
.
stopSong
()
...
...
src/audioplayer/interface.js
View file @
e7be7c4a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
top
;
top
;
rJS
(
window
)
rJS
(
window
)
.
allowPublicAcquisition
(
"
ErrorPage
"
,
function
()
{
.
allowPublicAcquisition
(
"
ErrorPage
"
,
function
()
{
top
.
__element
.
innerHTML
=
"
ERROR
"
;
top
.
__element
.
innerHTML
=
"
ERROR
:music does't exist
"
;
top
.
error
=
true
;
top
.
error
=
true
;
})
})
.
allowPublicAcquisition
(
"
showPage
"
,
function
(
param_list
)
{
.
allowPublicAcquisition
(
"
showPage
"
,
function
(
param_list
)
{
...
@@ -27,8 +27,7 @@
...
@@ -27,8 +27,7 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
if
(
top
.
error
===
true
)
{
if
(
top
.
error
===
true
)
{
top
.
__element
.
innerHTML
=
"
"
;
top
.
__element
.
innerHTML
=
"
"
;
top
.
dropGadget
(
"
audioplayer
"
).
then
(
function
(
e
)
{
top
.
dropGadget
(
"
audioplayer
"
).
then
(
function
()
{
console
.
log
(
e
);
top
.
declareGadget
(
"
./audioplayer.html
"
,
top
.
declareGadget
(
"
./audioplayer.html
"
,
{
element
:
top
.
__element
,
{
element
:
top
.
__element
,
scope
:
"
audioplayer
"
}
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