Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
panikweb
Commits
2f7722ea
Commit
2f7722ea
authored
Apr 21, 2016
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display chatrooms when open
parent
3a0bc4d7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
6 deletions
+44
-6
panikweb/views.py
panikweb/views.py
+6
-2
panikweb_templates/static/css/specifics.css
panikweb_templates/static/css/specifics.css
+15
-0
panikweb_templates/static/js/specifics.js
panikweb_templates/static/js/specifics.js
+9
-4
panikweb_templates/templates/chat.html
panikweb_templates/templates/chat.html
+11
-0
panikweb_templates/templates/includes/player.html
panikweb_templates/templates/includes/player.html
+3
-0
No files found.
panikweb/views.py
View file @
2f7722ea
...
...
@@ -5,9 +5,9 @@ import os
import
stat
import
time
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
django.http
import
Http404
from
django.views.decorators.cache
import
cache_control
from
django.views.generic.base
import
TemplateView
from
django.views.generic.detail
import
DetailView
...
...
@@ -627,9 +627,13 @@ def onair(request):
'url'
:
d
[
'episode'
].
get_absolute_url
()
}
if
d
.
get
(
'emission'
):
chat_url
=
None
if
d
[
'emission'
].
chat_open
:
chat_url
=
reverse
(
'emission-chat'
,
kwargs
=
{
'slug'
:
d
[
'emission'
].
slug
})
d
[
'emission'
]
=
{
'title'
:
d
[
'emission'
].
title
,
'url'
:
d
[
'emission'
].
get_absolute_url
()
'url'
:
d
[
'emission'
].
get_absolute_url
(),
'chat'
:
chat_url
,
}
if
d
.
get
(
'nonstop'
):
d
[
'nonstop'
]
=
{
...
...
panikweb_templates/static/css/specifics.css
View file @
2f7722ea
...
...
@@ -1951,3 +1951,18 @@ div.top-logo img {
max-width
:
none
;
}
}
div
#CurrentlyChatting
{
margin-top
:
1em
;
}
div
#CurrentlyChatting
a
{
border-radius
:
5px
;
padding
:
1ex
0
0.5ex
0
;
display
:
block
;
box-sizing
:
border-box
;
text-align
:
center
;
width
:
100%
;
background
:
#FF6633
;
color
:
white
!important
;
}
panikweb_templates/static/js/specifics.js
View file @
2f7722ea
...
...
@@ -220,6 +220,12 @@ $(function() {
else
{
onairContainer
=
$
(
'
<span>Unknown (Probably Non-Stop)</span>
'
);
}
if
(
onair
.
data
.
emission
.
chat
)
{
$
(
'
#CurrentlyChatting a
'
).
attr
(
'
href
'
,
onair
.
data
.
emission
.
chat
);
$
(
'
#CurrentlyChatting
'
).
show
();
}
else
{
$
(
'
#CurrentlyChatting
'
).
hide
();
}
var
current_html
=
WhatsOnAir
.
html
();
var
new_html
=
'
<span>
'
+
onairContainer
.
html
()
+
'
</span>
'
;
if
(
new_html
!==
current_html
)
{
...
...
@@ -545,8 +551,7 @@ $(function() {
});
/* CHAT */
var
$chat
=
$
(
'
#chat
'
);
if
(
$chat
.
length
)
{
if
(
$
(
'
#chat
'
).
length
)
{
var
$msg
=
$
(
'
input#msg
'
);
var
$send
=
$
(
'
button#send
'
);
var
chat_roster
=
Object
();
...
...
@@ -600,7 +605,7 @@ $(function() {
}
else
{
klass
=
'
msg-in
'
;
}
var
new_msg
=
$
(
'
<div class="msg new
'
+
klass
+
'
"><span class="from">
'
+
from
+
'
</span> <span class="content">
'
+
msg
.
textContent
+
'
</span></div>
'
).
prependTo
(
$chat
);
var
new_msg
=
$
(
'
<div class="msg new
'
+
klass
+
'
"><span class="from">
'
+
from
+
'
</span> <span class="content">
'
+
msg
.
textContent
+
'
</span></div>
'
).
prependTo
(
$
(
'
#
chat
'
)
);
new_msg
[
0
].
offsetHeight
;
/* trigger reflow */
new_msg
.
removeClass
(
'
new
'
);
$
(
'
div#chat div:nth-child(20)
'
).
remove
()
...
...
@@ -619,7 +624,7 @@ $(function() {
if
(
chat_roster
[
nick
]
==
true
)
{
for
(
contact
in
roster
)
{
if
(
chat_roster
[
contact
]
!==
true
)
{
var
new_msg
=
$
(
'
<div class="msg info new"><span class="content">
'
+
contact
+
'
est dans la place.</span></div>
'
).
prependTo
(
$chat
);
var
new_msg
=
$
(
'
<div class="msg info new"><span class="content">
'
+
contact
+
'
est dans la place.</span></div>
'
).
prependTo
(
$
(
'
#
chat
'
)
);
new_msg
[
0
].
offsetHeight
;
/* trigger reflow */
new_msg
.
removeClass
(
'
new
'
);
}
...
...
panikweb_templates/templates/chat.html
View file @
2f7722ea
...
...
@@ -26,6 +26,8 @@
<div
class=
"wrapper navigation"
>
<div
class=
""
>
{% if emission.chat_open %}
<div
class=
"chat-area"
>
<div
class=
"nick"
>
Pseudo ?
<input
name=
"nick"
>
<button>
Se connecter
</button></div>
...
...
@@ -37,6 +39,15 @@
<div
id=
"chat"
data-chatroom=
"{{emission.slug}}"
>
</div>
</div>
<!-- .chat-area -->
{% else %}
<p
class=
"info"
>
Ce chat n'est pour le moment pas ouvert.
</p>
{% endif %}
</div>
<!-- .leftPart -->
</div>
...
...
panikweb_templates/templates/includes/player.html
View file @
2f7722ea
...
...
@@ -17,6 +17,9 @@
<span
id=
"WhatsOnAir"
></span>
<button
class=
"icon-refresh"
id=
"RefreshWhatsOnAir"
></button>
</div>
<div
id=
"CurrentlyChatting"
style=
"display: none"
;
>
<a
href=
""
>
CHAT
</a>
</div>
<audio
id=
"DirectStreamPanik"
preload=
"none"
...
...
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