Greasy Fork

Greasy Fork is available in English.

wus_uic

wus UI 控制管理

当前为 2018-01-13 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/37317/242873/wus_uic.js

(function(){
  $("body").prepend("<div id='wusdiv'></div>")
})();


function addinputext(callback,dtext='......',id='wusinput',btext="Start"){
       $("#wusdiv").prepend(`<textarea rows="3" cols="80" id='${id}'>${dtext}</textarea>&nbsp;&nbsp;<button id='b${id}'>${btext}</button></br>`)
       $(`#b${id}`).click(function(){
         val=$(`#${id}`).val()
         if(val==dtext){
           alert("you can input some vaild text for youself!")
           return
         }
         console.log(`get the val: "${val}" ,then and run the callback`)
         callback(val)
       })
}

/*
addinputext(function(val){
  alert(val)
})
*