JKFORUM

enter something useful

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name JKFORUM
// @namespace http://your.homepage/
// @version 0.5
// @description enter something useful
// @author You
// @match https://www.jkforum.net/forum-*.html
// @match https://www.jkforum.net/thread-*.html
// @match https://www.jkforum.net/forum.php?mod=viewthread&*
// @grant none
// ==/UserScript==

function forEach(elems, func) {
for (var i = 0; i < elems.length; i++) {
func(elems[i]);
}
return elems.length > 0;
}

function automate() {
forEach(document.querySelectorAll('p'), 
function(i) { if (i.textContent.trim()=='已經感謝過此篇文章') location.reload(); });
forEach(document.querySelectorAll('#fwin_k_thankauthor'), 
function(i) { hideWindow('k_thankauthor'); });
forEach(document.querySelectorAll('#fwin_dialog #periodaggre18'), 
function(i) { i.checked=true; });
forEach(document.querySelectorAll('#fwin_dialog #fwin_dialog_submit'), function(i) { i.click(); });
if (document.querySelectorAll('.status_loginned').length) {
forEach(document.querySelectorAll('.like_locked #k_thankauthor'), function(i) {
if (i.offsetHeight) i.click();
});
}
}

var func = function() {
automate();
setTimeout(func, 1000);
};

setTimeout(func, 1000);

(function(){
    var e = document.createElement('div');
    e.setAttribute('style','padding:5px;border:1px solid black;background:white;position:fixed;right:5px;bottom:5px;');
    var b = document.createElement('button');
    b.innerHTML='Open all thread';
    b.onclick = function() {
        var i = 0;
        var list = [];
forEach(document.querySelectorAll('#threadlist a'), function(a) {
var href = a.href;
    if (href.match(/thread.*html$/) && list.indexOf(href) == -1) {
        list.push(href);
        window.open(href,'_blank');
        i++;
    }
});
        console.log(i);
    };
    e.appendChild(b);
    document.body.appendChild(e);
})();