Added function for disabling remote

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-18 15:23:37 +01:00
parent d96dbe99a9
commit cb5cb40d73
4 changed files with 29 additions and 8 deletions

View File

@@ -109,12 +109,22 @@
<div class="collapsible-body">
<ul>
<li>
<span class="switch-text">
Enable Remote
</span>
<div class="switch"><label>
Disabled
<input name="remote_switch" type="checkbox" class="remote_switch_class" checked /><span class="lever"></span>
Enabled
</label>
</div>
<a id="code-link" target="_blank">
<img id="code-qr" alt="QR code for control" title="Link to control this Zöff player" src="https://chart.googleapis.com/chart?chs=221x221&amp;cht=qr&amp;choe=UTF-8&amp;chld=L%7C1&amp;chl=http://zoff.no" />
<h4 id="code-text">ABBADUR</h4>
</a>
<a>
You can control this Zöff instance from another device by going to <b>http://zoff.no/remote</b>
</a>
</li>
</ul>
@@ -126,7 +136,7 @@
<li class="no-padding remote-panel">
<ul class="collapsible collapsible-accordion">
<li>
<a class="collapsible-header bold waves-effect">Import Playlist
<a class="collapsible-header bold waves-effect import-a">Import Playlist
<i class="mdi-communication-import-export"></i>
</a>
<div class="collapsible-body">

View File

@@ -129,6 +129,10 @@ nav .brand-logo{
background-color:rgba(45,45,45,1);
}
.import-a{
width:100%;
}
#nav-mobile .green:hover{
background-color: #38803C !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,10 @@
var Hostcontroller = {
host_listener: function() {
var old_id;
var enabled = true;
socket.on("id", function(id)
{
@@ -22,14 +24,13 @@ var Hostcontroller = {
began = true;
socket.on(id, function(arr)
{
if(arr[0] == "volume")
{
if(enabled){
if(arr[0] == "volume"){
$("#volume").slider("value", arr[1]);
ytplayer.setVolume(arr[1]);
localStorage.setItem("volume", arr[1]);
Playercontrols.choose_button(arr[1], false);
}else if(arr[0] == "channel")
{
}else if(arr[0] == "channel"){
socket.emit("change_channel");
chan = arr[1].toLowerCase();
@@ -38,8 +39,7 @@ var Hostcontroller = {
w_p = true;
socket.emit("list", chan.toLowerCase());
if(localStorage[chan.toLowerCase()])
{
if(localStorage[chan.toLowerCase()]){
//localStorage.removeItem(chan.toLowerCase());
if(localStorage[chan.toLowerCase()].length != 64)
localStorage.removeItem(chan.toLowerCase());
@@ -54,8 +54,15 @@ var Hostcontroller = {
ytplayer.playVideo();
else if(arr[0] == "skip")
List.skip();
}
});
}
});
$('input[class=remote_switch_class]').change(function()
{
enabled = document.getElementsByName("remote_switch")[0].checked;
});
}
}