fixed global search timeout, pumped nextcloud max-version, further work on db backend
This commit is contained in:
parent
664cb06e61
commit
1ad95f672f
@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<database>
|
||||
<name>*dbname*</name>
|
||||
<create>true</create>
|
||||
@ -11,7 +10,17 @@
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>6</length>
|
||||
<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>
|
||||
|
@ -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>
|
||||
|
32
js/main.js
32
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){
|
||||
if (query != "") {
|
||||
clearTimeout(searchTimeout);
|
||||
searchTimeout = setTimeout(function(){
|
||||
$("tbody > tr").remove();
|
||||
radio_query(0, query);
|
||||
}, 500);
|
||||
};
|
||||
};
|
||||
|
||||
OC.Plugins.register('OCA.Search', {
|
||||
|
Loading…
Reference in New Issue
Block a user