recommendAllComments

Recommend all comments in a diary - this version also handles checkboxes

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @author         InsultComicDog
// @version        2012-09-29
// @name           recommendAllComments
// @namespace      http://www.dailykos.com
// @description    Recommend all comments in a diary - this version also handles checkboxes
// @include        *
// ==/UserScript==

var j=0;
var i=0;
var rbuttons;

function innerloop() {
    if (rbuttons[i].type == 'radio' &&
        rbuttons[i].value == 4 && 
        rbuttons[i].id[0]=='r' &&
        rbuttons[i].checked == false)
    {
        rbuttons[i].checked = true;
        rbuttons[i].click();
        j++;
    }
    else
    {
        if (rbuttons[i].type == 'checkbox' &&
            rbuttons[i].checked == false &&
            rbuttons[i].id[0] == 'r')
        {
            rbuttons[i].checked = true;
            rbuttons[i].click();
            j++;
        }
    }
}
function recommendAllComments2() {
    rbuttons = document.getElementsByTagName('input');
    if (rbuttons.length)
    {
        
        for (i = 0; 
             i < rbuttons.length;
             i++) 
        { 
            var x = setTimeout(innerloop(), 0);
        }
        alert("recommended "+j+" comments");
        
    } 
}
function recommendAllComments() {
    setTimeout(recommendAllComments2(), 0);
}

GM_registerMenuCommand("Recommend All", recommendAllComments, null, "R","R");