Greasy Fork

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)
})
*