updated readme

This commit is contained in:
Jonas Heinrich 2016-11-18 22:45:53 +01:00
parent bed210be45
commit 14ba308ea6
4 changed files with 27 additions and 16 deletions

View File

@ -1,6 +1 @@
* https://doc.owncloud.org/server/9.0/developer_manual/app/tutorial.html This experimental app uses the radio-browser.info api and offers radio stations right in your Nextcloud!
* https://github.com/owncloud/app-tutorial#tutorial
* http://127.0.0.1/index.php/settings/apps
* https://mvigil-cs263-technology-project.readthedocs.io/en/latest/apptutorial.html
* docker run -v /home/onny/projects/owncloud-app-radio:/var/www/html/apps/radio -d -p 80:80 owncloud:latestdocker run -v /home/onny/projects/owncloud-app-radio:/var/www/html/apps/radio -d -p 80:80 owncloud:latest

View File

@ -1,8 +1,15 @@
body { * {
box-sizing: border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing: border-box;
}
#radiocontainer {
width: 100%;
padding: 20px; padding: 20px;
} }
input { #radioquery {
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
} }

View File

@ -9,14 +9,19 @@ $(window).on('load', function(){
function show_result(data){ function show_result(data){
$("tbody > tr").remove(); $("tbody > tr").remove();
$.each(data, function(i, station) { $.each(data, function(i, station) {
$('tbody').append('<tr src='+station['url']+'><td width=60px align=center><img width=20px height=20px src=img/fav.png></td><td width=60px align=center><img width=40px height=40px src='+station['favicon']+'></td><td>'+station['name']+'</td><td width=60px align=center><a href="'+station['homepage']+'" target="_blank"><img width=20px height=20px src=img/homepage.png></a></td></tr>'); $('tbody').append('<tr src='+station['url']+'>\
<td width=60px align=center><img width=20px height=20px src='+OC.imagePath('radio','fav.png')+'></td>\
<td width=60px align=center><img width=40px height=40px src='+station['favicon']+'></td>\
<td>'+station['name']+'</td>\
<td width=60px align=center><a href="'+station['homepage']+'" target="_blank"><img width=20px height=20px src='+OC.imagePath('radio','homepage.png')+'></a></td>\
</tr>');
}); });
} }
function search(query){ function search(query){
$.ajax({ $.ajax({
method: "POST", method: "POST",
url: 'http://www.radio-browser.info/webservice/json/stations/search', url: 'https://www.radio-browser.info/webservice/json/stations/search',
data: { data: {
name: query name: query
}, },
@ -25,9 +30,8 @@ $(window).on('load', function(){
}); });
}; };
$('form').submit(function() { $('#radiosearch').submit(function() {
var query = $('input').val(); var query = $('#radioquery').val();
search(query); search(query);
return false;
}); });
}); });

View File

@ -3,9 +3,10 @@
script('radio', 'main'); script('radio', 'main');
?> ?>
<audio id="player" src="" controls></audio> <div id=radiocontainer>
<form>
<input placeholder="Search for name" autofocus required></input> <form id="radiosearch" action="javascript:void(0);">
<input id="radioquery" placeholder="Search for name" autofocus required></input>
</form> </form>
<table> <table>
@ -19,4 +20,8 @@
</tbody> </tbody>
</table> </table>
<audio id="player" src="" controls></audio>
<!-- <?php p($l->t('Some Setting'));?>: "<?php p($_['somesetting']); ?>" --> <!-- <?php p($l->t('Some Setting'));?>: "<?php p($_['somesetting']); ?>" -->
</div>