-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de5a3c8
commit be7ef18
Showing
20 changed files
with
644 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
chrome.browserAction.onClicked.addListener(function(tab) { | ||
chrome.storage.local.get(["kodi_url", "kodi_port"], function(storage){ | ||
kodi_url = "http://" + storage["kodi_url"] + ":" + storage["kodi_port"] + "/PlayIt"; | ||
console.log(kodi_url); | ||
datastring = JSON.stringify({ | ||
"version":"1.1", | ||
"method": "playHostedVideo", | ||
"id" : "1", | ||
"params": {"videoLink" : tab.url} | ||
}); | ||
$.ajax({ | ||
url: kodi_url, | ||
traditional: true, | ||
method: "POST", | ||
data: datastring, | ||
success: function(response){ | ||
alert("Sent request to " + kodi_url + "."); | ||
console.log(response); | ||
}, | ||
error: function(res){ | ||
console.log(res); | ||
} | ||
}); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"manifest_version": 2, | ||
|
||
"name": "PlayIt on Kodi", | ||
"description": "Pushes links to PlayIt listener on a local Kodi mediacenter", | ||
"version": "0.1", | ||
|
||
"browser_action": { | ||
"default_icon": "icons/k64.png" | ||
}, | ||
|
||
"background":{ | ||
"scripts": ["rsc/jquery.js", "chrome.js"] | ||
}, | ||
|
||
"options_page": "options/chrome.html", | ||
|
||
"permissions": [ | ||
"activeTab", | ||
"tabs", | ||
"storage", | ||
"http://*/", | ||
"https://ajax.googleapis.com/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html> | ||
<head> | ||
<script src="../rsc/jquery.js"></script> | ||
<script src="chrome.js"></script> | ||
<style> | ||
body:{ | ||
margin: 20px; | ||
} | ||
.option{ | ||
width: 20%; | ||
margin-bottom: 10px; | ||
} | ||
br{ | ||
clear: both; | ||
} | ||
.option label{ | ||
float: left; | ||
} | ||
.option input{ | ||
width: 60%; | ||
float: right; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="option"> | ||
<label>Kodi URL:</label><input type="text" value="kodiurl" class="kodi-url"/> | ||
<br> | ||
</div> | ||
<div class="option"> | ||
<label>Kodi port:</label><input type="text" value="8181" class="kodi-port"/> | ||
<br> | ||
</div> | ||
<div class="status"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
$(document).ready(function(){ | ||
|
||
chrome.storage.local.get(["kodi_url", "kodi_port"], function(storage){ | ||
$(".kodi-url").val(storage["kodi_url"]); | ||
$(".kodi-port").val(storage["kodi_port"]); | ||
}); | ||
|
||
timer = null; | ||
save = function(){ | ||
chrome.storage.local.set({ | ||
kodi_url: $(".kodi-url").val(), | ||
kodi_port: $(".kodi-port").val() | ||
}, function() { | ||
$(".status").html("Options were saved."); | ||
} | ||
); | ||
} | ||
|
||
$(".kodi-url, .kodi-port").on("input", function(){ | ||
$(".status").html(""); | ||
if(timer != null){ | ||
clearTimeout(timer); | ||
} | ||
timer = setTimeout(save, 1000); | ||
}); | ||
|
||
}); |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.