mirror of https://github.com/FongMi/TV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
function search() {
|
|
doAction('search', { text: $('#keyword').val() });
|
|
}
|
|
|
|
function update(branch) {
|
|
doAction('update', { text: branch });
|
|
}
|
|
|
|
function push() {
|
|
doAction('push', { text: $('#push_url').val() });
|
|
}
|
|
|
|
function api() {
|
|
doAction('api', { text: $('#api_url').val() });
|
|
}
|
|
|
|
function doAction(action, kv) {
|
|
kv['do'] = action;
|
|
$.post('/action', kv, function (data) {
|
|
console.log(data);
|
|
});
|
|
return false;
|
|
}
|
|
|
|
function warnToast(msg) {
|
|
$('#warnToastContent').html(msg);
|
|
$('#warnToast').show();
|
|
setTimeout(() => {
|
|
$('#warnToast').hide();
|
|
}, 1000);
|
|
}
|
|
|
|
function showPanel(id) {
|
|
let tab = $('#tab' + id)[0];
|
|
$(tab).attr('aria-selected', 'true').addClass('weui-bar__item_on');
|
|
$(tab).siblings('.weui-bar__item_on').removeClass('weui-bar__item_on').attr('aria-selected', 'false');
|
|
var panelId = '#' + $(tab).attr('aria-controls');
|
|
$(panelId).css('display', 'block');
|
|
$(panelId).siblings('.weui-tab__panel').css('display', 'none');
|
|
}
|
|
|
|
$(function () {
|
|
$('.weui-tabbar__item').on('click', function () {
|
|
showPanel(parseInt($(this).attr('id').substr(3)));
|
|
});
|
|
}); |