Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
d1b6f52f
Commit
d1b6f52f
authored
Aug 29, 2013
by
Simon Daron
Browse files
Some log and style onAdd sound
parent
cbc04e15
Changes
3
Hide whitespace changes
Inline
Side-by-side
panikweb_templates/static/css/specifics.css
View file @
d1b6f52f
...
...
@@ -117,21 +117,35 @@ body{
z-index
:
2000
;
position
:
fixed
;
bottom
:
0px
;
right
:
0px
;
}
#userLog
.log
{
margin
:
0.
2
em
;
margin
:
0.
3
em
;
-moz-box-shadow
:
0px
0px
3px
#000
;
-webkit-box-shadow
:
0px
0px
3px
#000
;
box-shadow
:
0px
0px
3px
#000
;
border-radius
:
0.5em
;
-moz-border-radius
:
0.5em
;
-webkit-border-radius
:
0.5em
;
text-align
:
center
;
padding
:
0.
2
em
;
padding
:
0.
3
em
;
font-size
:
0.9em
;
color
:
black
;
background-color
:
orange
;
border
:
2px
solid
yellow
;
border
:
2px
solid
black
;
background-image
:
linear-gradient
(
135deg
,
rgba
(
0
,
0
,
0
,
0.04
)
25%
,
transparent
25%
,
transparent
50%
,
rgba
(
0
,
0
,
0
,
0.04
)
50%
,
rgba
(
0
,
0
,
0
,
0.04
)
75%
,
transparent
75%
,
transparent
);
}
#userLog
.log.info
{
background-color
:
grey
;
color
:
white
;
}
#userLog
.log.ok
{
background-color
:
green
;
border-color
:
black
;
color
:
white
;
}
#userLog
.log.error
{
background-color
:
orange
;
border-color
:
yellow
;
}
#main
{}
#mainLegend
{
width
:
30%
;
...
...
@@ -273,6 +287,9 @@ body{
}
#player
.playlist
.item
img
{
float
:
left
;}
/*Playlist*/
#Playlist
{
}
#Playlist
.playlistControls
{
padding
:
0.5em
;
text-align
:
center
;
...
...
@@ -287,10 +304,10 @@ body{
margin
:
0
0.5em
0
0.5em
;
}
#Playlist
.soundControls
{
font-size
:
8px
;
clear
:
right
;
float
:
right
;
}
#Playlist
.soundControls
button
{}
#Playlist
.active
.title
{
font-weight
:
bold
;
}
...
...
panikweb_templates/static/js/audioPlayer.js
View file @
d1b6f52f
...
...
@@ -18,6 +18,7 @@
classes
:
""
,
itemClasses
:
""
,
playlistContainer
:
$
(
'
<ol>
'
),
onAdd
:
function
(){},
},
_create
:
function
()
{
// Initialization logic here
...
...
@@ -42,9 +43,9 @@
_update
:
function
()
{
this
.
playlist
=
[];
this
.
playlistContainer
.
find
(
'
audio
'
).
each
(
function
(){
thePlaylist
.
playlist
.
push
(
thePlaylist
.
jsonifyAudio
(
$
(
this
)));
});
if
(
this
.
playlist
.
lenght
>=
1
){
this
.
playlistContainer
.
show
();}
this
.
savePlaylist
();
this
.
debugContainer
.
text
(
JSON
.
stringify
(
this
.
playlist
,
null
,
'
\t
'
)
...
...
@@ -132,14 +133,19 @@
return
container
;
},
// Create a public method.
registerAudio
:
function
(
audio
)
{
registerAudio
:
function
(
audio
,
success
=
function
(){}
)
{
var
htmlAudio
=
this
.
_htmlifyJsonSound
(
this
.
jsonifyAudio
(
audio
));
this
.
playlistContainer
.
append
(
htmlAudio
);
this
.
options
.
onAdd
();
success
();
this
.
_update
();
},
// Build controls
buildPlaylistControls
:
function
()
{
this
.
controls
=
$
(
'
<div>
'
,{
class
:
'
playlistControls controls
'
});
this
.
toggleList
=
$
(
'
<button>
'
,{
class
:
"
icon-list
"
,
click
:
function
(){
thePlaylist
.
playlistContainer
.
toggle
();
}});
this
.
playpause
=
$
(
'
<button>
'
,{
class
:
"
icon-play
"
,
click
:
function
(){
thePlaylist
.
playPauseList
();
}});
...
...
@@ -152,7 +158,7 @@
this
.
previous
=
$
(
'
<button>
'
,{
class
:
"
icon-step-backward
"
,
click
:
function
(){
thePlaylist
.
playPrevious
();
}});
this
.
controls
.
append
(
this
.
previous
).
append
(
this
.
stop
).
append
(
this
.
playpause
).
append
(
this
.
next
);
this
.
controls
.
append
(
this
.
toggleList
).
append
(
this
.
previous
).
append
(
this
.
stop
).
append
(
this
.
playpause
).
append
(
this
.
next
);
this
.
controlContainer
.
append
(
this
.
controls
);
return
true
;
},
...
...
panikweb_templates/static/js/specifics.js
View file @
d1b6f52f
$
(
function
()
{
var
$main
=
$
(
"
#Changing
"
);
var
$log
=
$
(
"
#userLog
"
);
var
$localList
=
$
(
'
#localList
'
).
playlist
({
playlistContainer
:
$
(
'
<ol>
'
,{
class
:
"
custom
"
}).
sortable
()});
doLog
=
function
(
aTextToLog
,
type
){
var
aLog
=
$
(
'
<div>
'
,{
class
:
"
log
"
,
html
:
'
<div class=
'
+
type
+
'
>
'
+
aTextToLog
+
'
</div>
'
});
var
aLog
=
$
(
'
<div>
'
,{
class
:
"
log
"
+
type
,
html
:
aTextToLog
});
aLog
.
hide
().
prependTo
(
$log
).
show
(
'
fast
'
).
delay
(
10000
).
hide
(
'
fast
'
,
function
()
{
$
(
this
).
remove
();
});
}
var
$main
=
$
(
"
#Changing
"
);
var
$log
=
$
(
"
#userLog
"
);
var
$localList
=
$
(
'
#localList
'
).
playlist
({
playlistContainer
:
$
(
'
<ol>
'
,{
class
:
"
custom
"
}).
sortable
()
});
String
.
prototype
.
decodeHTML
=
function
()
{
return
$
(
"
<div>
"
,
{
html
:
""
+
this
}).
html
();
};
...
...
@@ -101,7 +104,7 @@ $(function() {
});
$
(
'
[data-playlist-add]
'
).
on
(
'
click
'
,
function
(){
var
audio
=
$
(
$
(
this
).
attr
(
'
data-playlist-add
'
));
$localList
.
playlist
(
"
registerAudio
"
,
audio
);
$localList
.
playlist
(
"
registerAudio
"
,
audio
,
doLog
(
audio
.
attr
(
'
title
'
)
+
'
has been added to your playlist.
'
,
'
ok
'
)
);
/*
try {
...
...
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