Skip to content

Commit

Permalink
folder ...
Browse files Browse the repository at this point in the history
  • Loading branch information
willhelm-mueller committed Aug 5, 2016
1 parent de5a3c8 commit be7ef18
Show file tree
Hide file tree
Showing 20 changed files with 644 additions and 0 deletions.
25 changes: 25 additions & 0 deletions chrome/chrome.js
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);
}
});
});
});
73 changes: 73 additions & 0 deletions chrome/icons/draft16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions chrome/icons/draft32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions chrome/icons/draft64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/k16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/k32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/k64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions chrome/manifest.json
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/"
]
}
36 changes: 36 additions & 0 deletions chrome/options/chrome.html
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>
27 changes: 27 additions & 0 deletions chrome/options/chrome.js
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 added chrome/playitonkodi.crx
Binary file not shown.
4 changes: 4 additions & 0 deletions chrome/rsc/jquery.js

Large diffs are not rendered by default.

Loading

0 comments on commit be7ef18

Please sign in to comment.