Commit 0c3d021b authored by Valentin Samir's avatar Valentin Samir

[tv] css et javascript dans des fichiers séparés

parent 9560405f
.isResizable {
resize: both;
min-width: 120px;
min-height: 90px;
}
.player {
background-color: black;
border: 1px solid black;
overflow: hidden;
width: 281px;
height: 144px;
padding:5px;
margin: auto;
position: fixed;
margin-left: 0px;
top: 0px;
left: 0;
z-index: 50;
visibility: hidden;
}
.chaines {
max-width:900px;
margin-right:auto;
margin-left:auto;
border: 0px;
background-color: transparent;
overflow: auto;
}
div.image_tv {
position: relative;
width: 100%; /* for IE 6 */
}
h2 {
width: 100%;
}
div.image_tv img {
width:98px;
height: auto;
}
span.image_tv {
position: absolute;
top: 0px;
left: 0;
z-index: 10;
color: white;
letter-spacing: -1px;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
}
.tv{
float:left;
}
var playing = null
function stop(){
var vlc = document.getElementById("vlc");
document.getElementById('player_div').style.visibility="hidden";
playing = null;
try{
vlc.playlist.stop();
vlc.playlist.items.clear();
}catch(e){}
return false;
}
function add(url, vlc){
try{
vlc.playlist.stop();
vlc.playlist.items.clear();
id = vlc.playlist.add(url);
vlc.playlist.playItem(id); // forward compatibility
vlc.playlist.play(); // retro compatibility
setTimeout(function() {vlc.audio.volume = parseInt(document.getElementById("volume_slide").value);},1250);
}catch(e){}
}
function play(url){
if(url==playing){
return false;
} else {
playing = url;
}
if(!test_vlc_plugin()){
playing = false;
return true;
}
var vlc = document.getElementById("vlc");
document.getElementById('player_div').style.visibility="inherit";
add(url, vlc);
volume(document.getElementById("volume_slide").value);
volume(document.getElementById("volume_slide").value);
try{vlc.video.deinterlace.enable("linear");}
catch(e){}
return false;
}
function test_vlc_plugin(){
var vlc = document.getElementById("vlc");
if(typeof vlc.playlist != 'undefined'){
unwarn_vlc_plugin();
return true;
} else {
warn_vlc_plugin();
return false;
}
}
function warn_vlc_plugin(){
if(!document.getElementById("warning_vlc_plugin")){
var ul = document.getElementById("errors_list");
var a = document.createElement("a");
a.setAttribute("href", "http://kiss92.free.fr/applications/Aide-pour-installer-VLC-PLUG-IN-sur-PC-Linux.html");
a.appendChild(document.createTextNode('plugin vlc'));
var li = document.createElement("li");
li.appendChild(document.createTextNode('Le '));
li.appendChild(a);
li.appendChild(document.createTextNode(' est nécessaire pour regarder la télévision ou écouter la radio dans votre navigateur.'));
li.setAttribute("class","error");
li.setAttribute("id","warning_vlc_plugin");
ul.appendChild(li);
}
}
function unwarn_vlc_plugin(){
if(document.getElementById("warning_vlc_plugin")){
document.getElementById("warning_vlc_plugin").remove();
}
}
function play_radio(url){
document.getElementById('player_div').style.visibility="hidden";
if(url==playing){
return false;
} else {
playing = url;
}
if(!test_vlc_plugin()){
playing = false;
return true;
}
var vlc = document.getElementById("vlc");
add(url, vlc);
volume(document.getElementById("volume_slide").value);
volume(document.getElementById("volume_slide").value);
return false;
}
function volume(i){
var vlc = document.getElementById("vlc");
try{vlc.audio.volume = parseInt(i);}
catch(e){}
document.getElementById("range").innerHTML=i + '%';
document.getElementById("range2").innerHTML=i + "%";
document.getElementById("volume_slide2").value=i;
document.getElementById("volume_slide").value=i;
}
function init(){
stop();
document.getElementById("range").innerHTML= document.getElementById("volume_slide").value + "%";
document.getElementById("range2").innerHTML= document.getElementById("volume_slide").value + "%";
document.getElementById("volume_slide2").innerHTML= document.getElementById("volume_slide").value;
test_vlc_plugin();
}
{% extends "template.html" %}
{% block title %} TV - RADIO {% endblock %}
{% block head %}
<style type="text/css">
.isResizable {
resize: both;
min-width: 120px;
min-height: 90px;
}
.player {
background-color: black;
border: 1px solid black;
overflow: hidden;
width: 281px;
height: 144px;
padding:5px;
margin: auto;
position: fixed;
margin-left: 0px;
top: 0px;
left: 0;
z-index: 50;
visibility: hidden;
}
.chaines {
max-width:900px;
margin-right:auto;
margin-left:auto;
border: 0px;
background-color: transparent;
overflow: auto;
}
div.image_tv {
position: relative;
width: 100%; /* for IE 6 */
}
h2 {
width: 100%;
}
div.image_tv img {
width:98px;
height: auto;
}
span.image_tv {
position: absolute;
top: 0px;
left: 0;
z-index: 10;
color: white;
letter-spacing: -1px;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
}
.tv{
float:left;
}
</style>
<script language="Javascript">
var playing = null
function stop(){
var vlc = document.getElementById("vlc");
document.getElementById('player_div').style.visibility="hidden";
playing = null;
try{
vlc.playlist.stop();
vlc.playlist.items.clear();
}catch(e){}
return false;
}
function add(url, vlc){
try{
vlc.playlist.stop();
vlc.playlist.items.clear();
id = vlc.playlist.add(url);
vlc.playlist.playItem(id); // forward compatibility
vlc.playlist.play(); // retro compatibility
setTimeout(function() {vlc.audio.volume = parseInt(document.getElementById("volume_slide").value);},1250);
}catch(e){}
}
function play(url){
if(url==playing){
return false;
} else {
playing = url;
}
if(!test_vlc_plugin()){
playing = false;
return true;
}
var vlc = document.getElementById("vlc");
document.getElementById('player_div').style.visibility="inherit";
add(url, vlc);
volume(document.getElementById("volume_slide").value);
volume(document.getElementById("volume_slide").value);
try{vlc.video.deinterlace.enable("linear");}
catch(e){}
return false;
}
function test_vlc_plugin(){
var vlc = document.getElementById("vlc");
if(typeof vlc.playlist != 'undefined'){
unwarn_vlc_plugin();
return true;
} else {
warn_vlc_plugin();
return false;
}
}
function warn_vlc_plugin(){
if(!document.getElementById("warning_vlc_plugin")){
var ul = document.getElementById("errors_list");
var a = document.createElement("a");
a.setAttribute("href", "http://kiss92.free.fr/applications/Aide-pour-installer-VLC-PLUG-IN-sur-PC-Linux.html");
a.appendChild(document.createTextNode('plugin vlc'));
var li = document.createElement("li");
li.appendChild(document.createTextNode('Le '));
li.appendChild(a);
li.appendChild(document.createTextNode(' est nécessaire pour regarder la télévision ou écouter la radio dans votre navigateur.'));
li.setAttribute("class","error");
li.setAttribute("id","warning_vlc_plugin");
ul.appendChild(li);
}
}
function unwarn_vlc_plugin(){
if(document.getElementById("warning_vlc_plugin")){
document.getElementById("warning_vlc_plugin").remove();
}
}
function play_radio(url){
document.getElementById('player_div').style.visibility="hidden";
if(url==playing){
return false;
} else {
playing = url;
}
if(!test_vlc_plugin()){
playing = false;
return true;
}
var vlc = document.getElementById("vlc");
add(url, vlc);
volume(document.getElementById("volume_slide").value);
volume(document.getElementById("volume_slide").value);
return false;
}
function volume(i){
var vlc = document.getElementById("vlc");
try{vlc.audio.volume = parseInt(i);}
catch(e){}
document.getElementById("range").innerHTML=i + '%';
document.getElementById("range2").innerHTML=i + "%";
document.getElementById("volume_slide2").value=i;
document.getElementById("volume_slide").value=i;
}
function init(){
stop();
document.getElementById("range").innerHTML= document.getElementById("volume_slide").value + "%";
document.getElementById("range2").innerHTML= document.getElementById("volume_slide").value + "%";
document.getElementById("volume_slide2").innerHTML= document.getElementById("volume_slide").value;
test_vlc_plugin();
}
</script>
<script src="/static/js/tv.js"></script>
<link href="/static/css/tv.css" rel="stylesheet"/>
{% endblock %}
{% block content %}
<div class="main_tv">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment