Commit be3953d0 authored by onny's avatar onny

implementing searchprovider

parent 1253c560
......@@ -23,8 +23,6 @@
*
*/
OCP\App::registerAdmin( 'radio', 'settings' );
OCP\App::addNavigationEntry( array(
'id' => 'radio',
'order' => 74,
......
......@@ -8,8 +8,6 @@
/** @var $this \OCP\Route\IRouter */
$this->create('radio_index', '/')
->actionInclude('radio/index.php');
$this->create('radio_ajax_seturl', 'ajax/seturl.php')
->actionInclude('radio/ajax/seturl.php');
return [
'resources' => [
......
......@@ -26,8 +26,6 @@
// Check if we are a user
OCP\User::checkLoggedIn();
$somesetting = OCP\Config::getSystemValue( "somesetting", '' );
OCP\App::setActiveNavigationEntry( 'radio' );
$tmpl = new OCP\Template( 'radio', 'main', 'user' );
$tmpl->assign( 'somesetting', $somesetting );
$tmpl->printPage();
......@@ -5,6 +5,10 @@ $(window).on('load', function(){
play_station(stationid);
});
function station_fav(stationid){
alert("faving");
};
function play_station(stationid){
$.ajax({
method: "GET",
......@@ -23,7 +27,7 @@ $(window).on('load', function(){
$.each(data, function(i, station) {
$('tbody').append('<tr data-src='+station['url']+' data-id='+station['id']+'>\
<td class="filename">\
<a href="#" class="action action-favorite" data-original-title="" title="">\
<a href="#" class="action action-favorite" onclick="station_fav();">\
<span class="icon icon-star"></span>\
<span class="hidden-visually">Favorite</span>\
</a>\
......@@ -39,7 +43,7 @@ $(window).on('load', function(){
}
function get_station_ids(){
return ["89920","44707"]
return ["89920","44707","91101","85755","45281","78011","91102"]
};
function render_stations(station_ids){
......@@ -114,5 +118,15 @@ $(window).on('load', function(){
switch_menu(2);
});
function mySearch(query){
alert('test');
};
OC.Plugins.register('OCA.Search', {
attach: function(search) {
search.setFilter('radio', mySearch);
}
});
switch_menu(0);
});
<?php
OCP\User::checkAdminUser();
OCP\Util::addScript( "radio", "admin" );
$tmpl = new OCP\Template( 'radio', 'settings');
$tmpl->assign('url', OCP\Config::getSystemValue( "somesetting", '' ));
return $tmpl->fetchPage();
......@@ -24,16 +24,10 @@
</li>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
Settings </button>
</div>
<div id="app-settings-content">
<audio id="player" src="" controls></audio>
<form id="radiosearch" action="javascript:void(0);">
<input id="radioquery" placeholder="Search for name" autofocus required></input>
</form>
</div>
<audio id="player" src="" controls></audio>
<form id="radiosearch" action="javascript:void(0);">
<input id="radioquery" placeholder="Search for name" autofocus required></input>
</form>
</div>
</div>
<div id="app-content">
......
<form id="radio">
<div class="section">
<h2><?php p($l->t('App Template'));?></h2>
<input type="text" name="somesetting" id="somesetting" value="<?php p($_['url']); ?>" placeholder="<?php p($l->t('Some Setting'));?>" />
<br />
<span class="msg"></span>
</div>
</form>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment