fixed global search timeout, pumped nextcloud max-version, further work on db backend
This commit is contained in:
parent
664cb06e61
commit
1ad95f672f
@ -1,25 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
||||||
<database>
|
<database>
|
||||||
<name>*dbname*</name>
|
<name>*dbname*</name>
|
||||||
<create>true</create>
|
<create>true</create>
|
||||||
<overwrite>false</overwrite>
|
<overwrite>false</overwrite>
|
||||||
<charset>utf8</charset>
|
<charset>utf8</charset>
|
||||||
<table>
|
<table>
|
||||||
<name>*dbprefix*radio_stations</name>
|
<name>*dbprefix*radio_stations</name>
|
||||||
<declaration>
|
<declaration>
|
||||||
<field>
|
<field>
|
||||||
<name>id</name>
|
<name>id</name>
|
||||||
<type>integer</type>
|
<type>integer</type>
|
||||||
<notnull>true</notnull>
|
<notnull>true</notnull>
|
||||||
<length>6</length>
|
<autoincrement>true</autoincrement>
|
||||||
</field>
|
<unsigned>true</unsigned>
|
||||||
<field>
|
<primary>true</primary>
|
||||||
<name>user_id</name>
|
<length>8</length>
|
||||||
<type>text</type>
|
</field>
|
||||||
<length>200</length>
|
<field>
|
||||||
<default></default>
|
<name>stationid</name>
|
||||||
<notnull>true</notnull>
|
<type>text</type>
|
||||||
</field>
|
<length>200</length>
|
||||||
</declaration>
|
<default></default>
|
||||||
</table>
|
<notnull>true</notnull>
|
||||||
|
</field>
|
||||||
|
<field>
|
||||||
|
<name>user_id</name>
|
||||||
|
<type>text</type>
|
||||||
|
<length>200</length>
|
||||||
|
<default></default>
|
||||||
|
<notnull>true</notnull>
|
||||||
|
</field>
|
||||||
|
</declaration>
|
||||||
|
</table>
|
||||||
</database>
|
</database>
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
<id>radio</id>
|
<id>radio</id>
|
||||||
<name>Radio</name>
|
<name>Radio</name>
|
||||||
<description>Listening to your favorite radio stations in Nextcloud</description>
|
<description>Listening to your favorite radio stations in Nextcloud</description>
|
||||||
<version>0.3</version>
|
<version>0.4</version>
|
||||||
<licence>MIT</licence>
|
<licence>MIT</licence>
|
||||||
<author>Jonas Heinrich</author>
|
<author>Jonas Heinrich</author>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<owncloud min-version="9.1" max-version="9.2"/>
|
<owncloud min-version="9.1" max-version="9.2"/>
|
||||||
<nextcloud min-version="10" max-version="11"/>
|
<nextcloud min-version="10" max-version="12"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</info>
|
</info>
|
||||||
|
36
js/main.js
36
js/main.js
@ -1,8 +1,18 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
$('body').on('click', 'tr', function() {
|
searchTimeout = null;
|
||||||
|
|
||||||
|
/*$('body').on('click', 'tr', function() {
|
||||||
var stationid = $(this).attr('data-id');
|
var stationid = $(this).attr('data-id');
|
||||||
play_station(stationid);
|
play_station(stationid);
|
||||||
|
}); */
|
||||||
|
|
||||||
|
$('body').on('click', 'tr .icon', function() {
|
||||||
|
alert('test');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.icon-star').click(function (){
|
||||||
|
alert('test');
|
||||||
});
|
});
|
||||||
|
|
||||||
function play_station(stationid){
|
function play_station(stationid){
|
||||||
@ -39,11 +49,19 @@ $(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_station_ids(){
|
function get_station_ids(){
|
||||||
|
var stations = []
|
||||||
var baseUrl = OC.generateUrl('/apps/radio');
|
var baseUrl = OC.generateUrl('/apps/radio');
|
||||||
|
var station = {
|
||||||
|
"id": 16,
|
||||||
|
"stationid": "89920",
|
||||||
|
"active": true
|
||||||
|
};
|
||||||
$.get(baseUrl + '/stations', function ( data ) {
|
$.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){
|
function render_stations(station_ids){
|
||||||
@ -95,8 +113,7 @@ $(function(){
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$('li.nav-favorite').addClass('active');
|
$('li.nav-favorite').addClass('active');
|
||||||
station_ids = get_station_ids()
|
get_station_ids();
|
||||||
render_stations(station_ids)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,8 +131,13 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
function mySearch(query){
|
function mySearch(query){
|
||||||
$("tbody > tr").remove();
|
if (query != "") {
|
||||||
radio_query(0, query);
|
clearTimeout(searchTimeout);
|
||||||
|
searchTimeout = setTimeout(function(){
|
||||||
|
$("tbody > tr").remove();
|
||||||
|
radio_query(0, query);
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
OC.Plugins.register('OCA.Search', {
|
OC.Plugins.register('OCA.Search', {
|
||||||
|
Loading…
Reference in New Issue
Block a user