bilibilibar

为吧主管理提供便捷功能

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         bilibilibar
// @namespace    https://greasyfork.org/zh-CN/scripts/21000-bilibilibar
// @version      0.1.2.1
// @description  为吧主管理提供便捷功能
// @author       winoros
// @match        http://tieba.baidu.com/f?kw=bilibili*
// @grant        none
// ==/UserScript==

(function() {
    let lists = $('.j_thread_list');
    lists.each(function() {
        let left = $(this).find('.j_threadlist_li_left');
        let magic = $($(left).find('span')[0]).clone();
        magic.attr('title', '删除');
        magic.text('删帖');
        magic.addClass('delete_by_click');
        magic.data('tid', $(this).data('field').id);
        $(left).append(magic);
    });
    $('.delete_by_click').on('click', function() {
        console.log($(this).data('tid'));
        $.post('http://tieba.baidu.com/f/commit/thread/delete', {'ie': 'utf-8', 'commit_fr': 'pb', 'kw': PageData.forum.forum_name,
                                                                     'fid': PageData.forum.forum_id,
                                                                     'tid': $(this).data('tid'), 'rich_text': 1, 'tbs': PageData.tbs}, function(data) {
            if(JSON.parse(data).no !== 0) {
            alert('删帖不能了喵~');
            } else {
            alert('删帖成功了喵~');
            }
        });
    });
})();