Jump to content

User:9cfilorux/sectionsummaries2.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(document.getElementsByClassName("comment")[0]) {
    var comment = document.getElementsByClassName("comment");
    var i;
    for (i = 0; i < comment.length; i++) {
        if(comment[i].getElementsByTagName("a")[0]) {
            if(comment[i].getElementsByTagName("a")[0].innerHTML.indexOf("→") == 0) {
                comment[i].getElementsByTagName("a")[0].innerHTML =
                comment[i].getElementsByTagName("a")[0].innerHTML.slice(0, 1)
                + '<span class="autocomment">'
                + comment[i].getElementsByTagName("a")[0].innerHTML.slice(1)
                + '</span>';
            }
        }
    }
}