mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added install link for zoff remote
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
|
||||
<?php include("header.php"); ?>
|
||||
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/jemjlblambcgjmmhheaklfnphncdmfmb" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
@@ -98,7 +99,7 @@
|
||||
</main>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
|
||||
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
|
||||
<script type="text/javascript" src="/static/dist/remote.min.js"></script>
|
||||
</body>
|
||||
|
||||
2
static/dist/main.min.js
vendored
2
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/remote.min.js
vendored
2
static/dist/remote.min.js
vendored
@@ -1 +1 @@
|
||||
!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()),git_info=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,git_info=$.parseJSON(git_info),$("#latest-commit").html("Latest Commit: <br>"+git_info[0].commit.author.date.substring(0,10)+": "+git_info[0].committer.login+"<br><a href='"+git_info[0].html_url+"'>"+git_info[0].sha.substring(0,10)+"</a>: "+git_info[0].commit.message+"<br")}),$("#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(""))}}}();
|
||||
!function(){function e(){chrome.webstore.install("",o,t)}function t(e){console.log(e)}function o(){console.log("Successfully installed")}var n=!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(),a.control()),git_info=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,git_info=$.parseJSON(git_info),$("#latest-commit").html("Latest Commit: <br>"+git_info[0].commit.author.date.substring(0,10)+": "+git_info[0].committer.login+"<br><a href='"+git_info[0].html_url+"'>"+git_info[0].sha.substring(0,10)+"</a>: "+git_info[0].commit.message+"<br");var n=navigator.userAgent.toLowerCase().indexOf("chrome")>-1,i=n.app.isInstalled;n&&!i&&Materialize.toast("<a href='#' onclick='installRemote();' style='pointer-events:all;color:white;'>Install the extension!</a>",1e5),window.installRemote=e,window.failed=t,window.success=o}),$("#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(){a.control()});var a={control:function(){n?(id||(id=document.getElementById("remoteform").chan.value,window.history.pushState("object or string","Title","/remote/"+id)),document.getElementById("remoteform").chan.value="",n=!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(""))}}}();
|
||||
@@ -24,8 +24,32 @@ $(document).ready(function (){
|
||||
+ git_info[0].sha.substring(0,10) + "</a>: "
|
||||
+ git_info[0].commit.message+"<br");
|
||||
|
||||
var chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
||||
var isInstalled = chrome.app.isInstalled;
|
||||
|
||||
if (chrome && !isInstalled)
|
||||
Materialize.toast("<a href='#' onclick='installRemote();' style='pointer-events:all;color:white;'>Install the extension!</a>", 100000);
|
||||
|
||||
window.installRemote = installRemote;
|
||||
window.failed = failed;
|
||||
window.success = success;
|
||||
});
|
||||
|
||||
function installRemote()
|
||||
{
|
||||
chrome.webstore.install("", success, failed);
|
||||
}
|
||||
|
||||
function failed(e)
|
||||
{
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function success()
|
||||
{
|
||||
console.log("Successfully installed");
|
||||
}
|
||||
|
||||
$("#playbutton").on("click", function()
|
||||
{
|
||||
socket.emit("id", [id, "play", "mock"]);
|
||||
|
||||
Reference in New Issue
Block a user