implementing searchprovider
This commit is contained in:
parent
1253c560f3
commit
be3953d06f
@ -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();
|
||||
|
18
js/main.js
18
js/main.js
@ -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);
|
||||
});
|
||||
|
11
settings.php
11
settings.php
@ -1,11 +0,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,18 +24,12 @@
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
<div id="app-content">
|
||||
<div id="app-content-files" class="viewcontainer">
|
||||
<table id="filestable" data-preview-x="32" data-preview-y="32">
|
||||
|
@ -1,8 +0,0 @@
|
||||
<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>
|
Loading…
Reference in New Issue
Block a user