Flower_thz

方便赏桃花

Από την 04/07/2020. Δείτε την τελευταία έκδοση.

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Flower_thz
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  方便赏桃花
// @author       xy969
// @match        *://thzd.cc/forum-*.html
// @grant        none
// @require      https://code.jquery.com/jquery-1.12.4.min.js
// ==/UserScript==

(function() {


     $.each($("tbody[id^='normalthread']"), function(i){
         $(this).on('click',function(){
         //alert(this.id);
             if($("ul#picA_"+i+"").length!=0){
              $("ul#picA_"+i+"").remove();
             }else{
              var $yy = $(this);

        var url = $yy.children().find('a.s.xst').attr('href');

        htmlobj=$.ajax({url:url,async:false});console.log(htmlobj.responseText)
        var rspTxt = htmlobj.responseText
        //console.log(htmlobj);

        var tr1 = document.createElement("ul");
        $(tr1).attr('id','picA_'+i);
        var td_1 = document.createElement("li");
        $(td_1).attr('width','300');
        $(td_1).attr('class','common');
        td_1.innerHTML ='<div><img src="'+/(?<=zoomfile=")\S*(?=")/.exec(rspTxt).toString()+'"  width=600></img></div>';
        tr1.append(td_1);

        var tr2 = document.createElement("ul");
        $(tr2).attr('id','picB_'+i);

        var td_2 = document.createElement("li");
        $(td_2).attr('width','300');
        $(td_2).attr('colspan','2');
        $(td_2).attr('class','common');
        td_2.innerHTML ='<div><img src="'+/(?<=class="zoom" file=")\S*(?=")/.exec(rspTxt).toString()+'" width=600></img></div>';
        tr1.append(td_2);

        this.append(tr1);
        this.append(tr2);
             }
         })
     })

})();