init
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
[roomsexplore]
|
||||
no_local = No chatrooms found locally
|
||||
global_title = Channels
|
||||
no_global = No chatrooms found globally
|
||||
find_more = Find more channels
|
||||
find_more_text = "%s in total"
|
||||
@@ -0,0 +1,29 @@
|
||||
var RoomsExplore = {
|
||||
timer: null,
|
||||
|
||||
init: function () {
|
||||
if (window.matchMedia("(min-width: 1025px)").matches) {
|
||||
document.querySelector('#roomsexplore_bar input[name=keyword]').focus();
|
||||
}
|
||||
},
|
||||
|
||||
setKeyword: function (keyword) {
|
||||
document.querySelector('#roomsexplore_bar input[name=keyword]').value = keyword;
|
||||
},
|
||||
|
||||
searchSomething: function (value) {
|
||||
clearTimeout(RoomsExplore.timer);
|
||||
|
||||
if (value !== '') {
|
||||
document.querySelector('#roomsexplore_bar li.search').classList.add('searching');
|
||||
}
|
||||
|
||||
RoomsExplore.timer = setTimeout(() => {
|
||||
RoomsExplore_ajaxSearchRooms(value);
|
||||
}, 700);
|
||||
},
|
||||
|
||||
searchClear: function () {
|
||||
document.querySelector('#roomsexplore_bar li.search').classList.remove('searching');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user