diff --git a/appinfo/database.xml b/appinfo/database.xml
index 78ff613..11332f4 100755
--- a/appinfo/database.xml
+++ b/appinfo/database.xml
@@ -1,25 +1,34 @@
-
- *dbname*
- true
- false
- utf8
-
- *dbprefix*radio_stations
-
-
- id
- integer
- true
- 6
-
-
- user_id
- text
- 200
-
- true
-
-
-
+ *dbname*
+ true
+ false
+ utf8
+
+ *dbprefix*radio_stations
+
+
+ id
+ integer
+ true
+ true
+ true
+ true
+ 8
+
+
+ stationid
+ text
+ 200
+
+ true
+
+
+ user_id
+ text
+ 200
+
+ true
+
+
+
diff --git a/appinfo/info.xml b/appinfo/info.xml
index bee0a19..9814a6d 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -3,11 +3,11 @@
radio
Radio
Listening to your favorite radio stations in Nextcloud
- 0.3
+ 0.4
MIT
Jonas Heinrich
-
+
diff --git a/js/main.js b/js/main.js
index f943feb..ea8951a 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1,8 +1,18 @@
$(function(){
- $('body').on('click', 'tr', function() {
+ searchTimeout = null;
+
+ /*$('body').on('click', 'tr', function() {
var stationid = $(this).attr('data-id');
play_station(stationid);
+ }); */
+
+ $('body').on('click', 'tr .icon', function() {
+ alert('test');
+ });
+
+ $('.icon-star').click(function (){
+ alert('test');
});
function play_station(stationid){
@@ -39,11 +49,19 @@ $(function(){
}
function get_station_ids(){
+ var stations = []
var baseUrl = OC.generateUrl('/apps/radio');
+ var station = {
+ "id": 16,
+ "stationid": "89920",
+ "active": true
+ };
$.get(baseUrl + '/stations', function ( data ) {
- alert(JSON.stringify(data));
+ for (var station in data) {
+ stations.push(data[station]["stationid"]);
+ };
+ render_stations(stations);
});
- return ["89920","44707","91101","85755","45281","78011","91102"]
};
function render_stations(station_ids){
@@ -95,8 +113,7 @@ $(function(){
break;
case 2:
$('li.nav-favorite').addClass('active');
- station_ids = get_station_ids()
- render_stations(station_ids)
+ get_station_ids();
break;
}
}
@@ -114,8 +131,13 @@ $(function(){
});
function mySearch(query){
- $("tbody > tr").remove();
- radio_query(0, query);
+ if (query != "") {
+ clearTimeout(searchTimeout);
+ searchTimeout = setTimeout(function(){
+ $("tbody > tr").remove();
+ radio_query(0, query);
+ }, 500);
+ };
};
OC.Plugins.register('OCA.Search', {