Added install link for zoff remote

This commit is contained in:
Kasper Rynning-Tønnesen
2015-08-04 22:16:13 +02:00
parent 8c71a79740
commit c9c35e85a9
4 changed files with 28 additions and 3 deletions

View File

@@ -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"]);