泥頭車工坊

出自DOLLARS
於 2022年8月11日 (四) 21:32 由 蛤猹鸣泣之时留言 | 貢獻 所做的修訂
跳至導覽 跳至搜尋
 用以进行一些简(ruo)单(zhi)聊天室小功能开发的房间,本界面用以存放某猹写出来的屎山
   虽然是屎山但还是能用的     ——by 哈茶

!TSOP按鈕

這個功能用來在 "POST!" 按鈕的邊上增加一個 "!TSOP" 按鈕


如按鈕的字面意思所言,這個按鈕的作用是把輸入框裡的內容倒著發送出去。

var oon = $("#message> div.room-submit-wrap> input")

function fan(a1,b=[""]){
 //将字符串颠倒 
     a = a1+"";
     mes2 = a.length-1;
        while (mes2>=0){
            b.push(a[mes2]);
            mes2 = mes2-1;
        }
    back1 = b.join("");
    return back1;
}

function fan2(){
    mes = document.querySelector("#message > div.room-input-wrap > textarea").value;
        
    $.post("#",{message: "/me"+fan(mes)});
    $("[name='message']").val("");
}

$("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon);

時間標記

這個功能用來在每條聊天內容下方標記它被發出來的時間。

當然,只有自己能看到。

(意義不明)

$('#talks').bind('DOMNodeInserted',function(){
	var TIm =  new Date();
	var tim5 = ("↑"+TIm.getHours()+"点"+TIm.getMinutes()+"分"+TIm.getSeconds()+"秒↑");
	var hua = $("div#talks>:first-child");
		if ($("div#talks>:eq(1)").attr("class") == "nope"){}
		else{
			$("<span id='dema' class ='nope' ></span>").insertAfter(hua);
			document.getElementById("dema").innerHTML=tim5
		}
});

說書腳本

這個功能用來將長文本分割開來並逐句發送。

在輸入框下方新增加的輸入框內放入文本。

可設置分割符與說書速度。

//由于存在被用来刷屏的风险,此脚本被削除







//

冒泡君這個功能用來每20分鐘生成一串隨機的泡泡。

(?)

作用類似報時。

pao = [ "O", "o", "〇","·","0",".",""];
ran2 =0
ran3 = ""
x =() => {
    
    while (ran2 <= 40){
        ran1 = pao[Math.floor(Math.random()*pao.length)];
        ran3 = ran3+ran1;
        ran2 = ran2+1;
    }
    $.post("#",{message: "/me冒泡"+ran3});
    ran2 = 0
    ran3 = ""
};
 x();
 setInterval(function(){ x()},20*60*1000);