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
6fc714bf
Commit
6fc714bf
authored
Jul 16, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loop music switch
parent
b4faed88
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
5 deletions
+38
-5
src/audioplayer_control/control.js
src/audioplayer_control/control.js
+25
-4
src/audioplayer_control/control.less
src/audioplayer_control/control.less
+3
-0
src/audioplayer_control/index.html
src/audioplayer_control/index.html
+5
-0
src/audioplayer_playlist_local/index.html
src/audioplayer_playlist_local/index.html
+3
-0
src/audioplayer_playlist_local/playlist.js
src/audioplayer_playlist_local/playlist.js
+2
-1
No files found.
src/audioplayer_control/control.js
View file @
6fc714bf
...
...
@@ -235,6 +235,8 @@
box_context
=
g
.
__element
.
getElementsByClassName
(
"
box
"
)[
0
],
filter_context
=
g
.
__element
.
getElementsByClassName
(
"
filter
"
)[
0
],
filter_type
=
$
(
'
select
'
),
loop_context
=
g
.
__element
.
getElementsByClassName
(
"
loop
"
)[
0
],
loop
=
false
,
time_context
=
g
.
__element
.
getElementsByClassName
(
"
time
"
)[
0
];
bar_context
.
value
=
0
;
return
new
RSVP
.
Queue
()
...
...
@@ -244,9 +246,18 @@
})
.
push
(
function
()
{
bar_context
.
max
=
g
.
audio
.
duration
;
return
g
.
plEnablePage
();
return
RSVP
.
all
([
g
.
plEnablePage
(),
g
.
plGive
(
"
loop
"
)
]);
})
.
push
(
function
()
{
.
push
(
function
(
list
)
{
if
(
list
[
1
])
{
loop
=
true
;
loop_context
.
innerHTML
=
"
loop on
"
;
}
else
{
loop_context
.
innerHTML
=
"
loop off
"
;
}
time_context
.
style
.
left
=
bar_context
.
style
.
left
;
$
(
time_context
).
offset
().
top
=
$
(
bar_context
).
offset
().
top
+
3
;
time_context
.
innerHTML
=
timeFormat
(
g
.
audio
.
duration
);
...
...
@@ -257,8 +268,13 @@
}),
loopEventListener
(
g
.
audio
,
"
ended
"
,
false
,
function
()
{
window
.
location
=
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
;
if
(
loop
)
{
g
.
audio
.
load
();
g
.
audio
.
play
();
}
else
{
window
.
location
=
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
;
}
}),
loopEventListener
(
command_context
,
"
click
"
,
false
,
function
()
{
...
...
@@ -289,6 +305,11 @@
false
,
function
()
{
box_context
.
style
.
display
=
"
none
"
;
}),
loopEventListener
(
loop_context
,
"
click
"
,
false
,
function
()
{
loop_context
.
innerHTML
=
loop
?
"
loop off
"
:
"
loop on
"
;
loop
=
!
loop
;
return
g
.
plSave
({
"
loop
"
:
loop
});
}),
myLoopEventListener
(
$
(
filter_context
),
"
change
"
,
function
()
{
g
.
filter
.
frequency
.
value
=
filter_context
.
value
;
...
...
src/audioplayer_control/control.less
View file @
6fc714bf
button.loop {
width : 6em;
}
#visualizer {
text-align: center;
}
...
...
src/audioplayer_control/index.html
View file @
6fc714bf
...
...
@@ -27,6 +27,11 @@
<div
class=
"time"
style=
"position:relative;"
>
</div>
<button
type=
"button"
class=
"loop"
></button>
<div
id=
"visualizer"
>
<canvas
id=
"can"
width=
"800"
height=
"350"
>
!Canvas not supported by your browser
...
...
src/audioplayer_playlist_local/index.html
View file @
6fc714bf
...
...
@@ -32,6 +32,9 @@
</ul>
</div>
<div
class=
"info"
>
</div>
<div
data-role=
"footer"
data-position=
"fixed"
data-theme=
"b"
>
<div
data-role=
"navbar"
>
...
...
src/audioplayer_playlist_local/playlist.js
View file @
6fc714bf
...
...
@@ -60,7 +60,8 @@
})
.
fail
(
function
(
error
)
{
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
console
.
log
(
"
error
"
);
gadget
.
__element
.
getElementsByClassName
(
'
info
'
)[
0
].
innerHTML
=
"
please enable local server
"
;
}
});
})
...
...
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