Commit 1ad95f67 authored by onny's avatar onny

fixed global search timeout, pumped nextcloud max-version, further work on db backend

parent 664cb06e
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*radio_stations</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<notnull>true</notnull>
<length>6</length>
</field>
<field>
<name>user_id</name>
<type>text</type>
<length>200</length>
<default></default>
<notnull>true</notnull>
</field>
</declaration>
</table>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*radio_stations</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<notnull>true</notnull>
<autoincrement>true</autoincrement>
<unsigned>true</unsigned>
<primary>true</primary>
<length>8</length>
</field>
<field>
<name>stationid</name>
<type>text</type>
<length>200</length>
<default></default>
<notnull>true</notnull>
</field>
<field>
<name>user_id</name>
<type>text</type>
<length>200</length>
<default></default>
<notnull>true</notnull>
</field>
</declaration>
</table>
</database>
......@@ -3,11 +3,11 @@
<id>radio</id>
<name>Radio</name>
<description>Listening to your favorite radio stations in Nextcloud</description>
<version>0.3</version>
<version>0.4</version>
<licence>MIT</licence>
<author>Jonas Heinrich</author>
<dependencies>
<owncloud min-version="9.1" max-version="9.2"/>
<nextcloud min-version="10" max-version="11"/>
<nextcloud min-version="10" max-version="12"/>
</dependencies>
</info>
$(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', {
......
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