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

This commit is contained in:
Jonas Heinrich 2017-08-04 20:29:08 +02:00
parent 664cb06e61
commit 1ad95f672f
3 changed files with 63 additions and 32 deletions

View File

@ -1,25 +1,34 @@
<?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>

View File

@ -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>

View File

@ -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', {