From be3953d06fba1ad5445359bc76da24bf4fa8bcc6 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 9 Jan 2017 14:36:07 +0100 Subject: [PATCH] implementing searchprovider --- appinfo/app.php | 2 -- appinfo/routes.php | 2 -- index.php | 2 -- js/main.js | 18 ++++++++++++++++-- settings.php | 11 ----------- templates/main.php | 14 ++++---------- templates/settings.php | 8 -------- 7 files changed, 20 insertions(+), 37 deletions(-) delete mode 100755 settings.php delete mode 100755 templates/settings.php diff --git a/appinfo/app.php b/appinfo/app.php index c8963fe..8c1ba22 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -23,8 +23,6 @@ * */ -OCP\App::registerAdmin( 'radio', 'settings' ); - OCP\App::addNavigationEntry( array( 'id' => 'radio', 'order' => 74, diff --git a/appinfo/routes.php b/appinfo/routes.php index ef20c69..c368069 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -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' => [ diff --git a/index.php b/index.php index ca97156..cb1da9c 100755 --- a/index.php +++ b/index.php @@ -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(); diff --git a/js/main.js b/js/main.js index f5a82dd..1a8a347 100644 --- a/js/main.js +++ b/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('\ \ - \ + \ \ Favorite\ \ @@ -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); }); diff --git a/settings.php b/settings.php deleted file mode 100755 index 24c07ee..0000000 --- a/settings.php +++ /dev/null @@ -1,11 +0,0 @@ -assign('url', OCP\Config::getSystemValue( "somesetting", '' )); - -return $tmpl->fetchPage(); diff --git a/templates/main.php b/templates/main.php index 66ec327..ff1e285 100755 --- a/templates/main.php +++ b/templates/main.php @@ -24,16 +24,10 @@
-
- -
-
- -
- -
-
+ +
+ +
diff --git a/templates/settings.php b/templates/settings.php deleted file mode 100755 index ffe05fb..0000000 --- a/templates/settings.php +++ /dev/null @@ -1,8 +0,0 @@ -
-
-

t('App Template'));?>

- -
- -
-