Made remote to onepage site, and changed the pingTimeout serverside

This commit is contained in:
Kasper Rynning-Tønnesen
2015-08-03 19:17:24 +02:00
parent 766f09e3ef
commit 4aa0fc101a
4 changed files with 12 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ catch(err){
server = http.createServer(handler);
}
var io = require('socket.io')(server);
var io = require('socket.io')(server, {'pingTimeout': 25000});
//db
var mongojs = require('mongojs');

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(){var e,t=!0;$(document).ready(function(){document.title="Zöff Remote",setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":3000"),e=window.location.pathname.split("/")[2],e&&(e=e.toLowerCase(),o.control())}),$("#playbutton").on("click",function(){socket.emit("id",[e,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[e,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[e,"skip","mock"])}),$("#remoteform").on("submit",function(){t?window.location.href="/remote/"+document.getElementById("remoteform").chan.value:o.control()});var o={control:function(){t?(e||(e=$("#code-input").val().toLowerCase()),$("#code-input").val(""),t=!1,$(".rc").css("display","block"),$("#remote-text").text("Controlling "+e.toUpperCase()),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(t,o){socket.emit("id",[e,"volume",o.value]),console.log("volume")}})):(socket.emit("id",[e,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}}}();
!function(){var e=!0;$(document).ready(function(){document.title="Zöff Remote",setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":3000"),id=window.location.pathname.split("/")[2],id&&(id=id.toLowerCase(),t.control())}),$("#playbutton").on("click",function(){socket.emit("id",[id,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[id,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[id,"skip","mock"])}),$("#remoteform").on("submit",function(){t.control()});var t={control:function(){e?(id||(id=document.getElementById("remoteform").chan.value,window.history.pushState("object or string","Title","/remote/"+id)),document.getElementById("remoteform").chan.value="",e=!1,$(".rc").css("display","block"),$("#remote-text").text("Controlling "+id.toUpperCase()),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(e,t){socket.emit("id",[id,"volume",t.value]),console.log("volume")}})):(socket.emit("id",[id,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}}}();

View File

@@ -1,5 +1,4 @@
var start = true;
var id;
$(document).ready(function (){
document.title = "Zöff Remote";
@@ -30,10 +29,13 @@ $("#skipbutton").on("click", function()
$("#remoteform").on("submit", function()
{
/*
if(start)
window.location.href = '/remote/'+document.getElementById("remoteform").chan.value;
else
Remotecontroller.control();
*/
Remotecontroller.control();
});
var Remotecontroller = {
@@ -42,8 +44,12 @@ var Remotecontroller = {
{
if(start)
{
if(!id)id = $("#code-input").val().toLowerCase();
$("#code-input").val("");
if(!id)
{
id = document.getElementById("remoteform").chan.value;
window.history.pushState("object or string", "Title", "/remote/"+id);
}
document.getElementById("remoteform").chan.value = "";
start = false;
$(".rc").css("display", "block");