|
8 | 8 | // @namespace http://tampermonkey.net/ |
9 | 9 | // @require https://cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js |
10 | 10 | // @require https://cdn.jsdelivr.net/hi-base64/0.2.0/base64.min.js |
11 | | -// @version 1.2.3 |
| 11 | +// @version 1.2.4 |
12 | 12 | // @author Hoothin |
13 | 13 | // @mail rixixi@gmail.com |
14 | 14 | // @include http*://*/* |
|
403 | 403 | <div id="configContent" style="display: none;"> |
404 | 404 | <div style="width:300px;height:300px;position:fixed;left:50%;top:50%;margin-top:-150px;margin-left:-150px;z-index:100000;background-color:#ffffff;border:1px solid #afb3b6;border-radius:10px;opacity:0.95;filter:alpha(opacity=95);box-shadow:5px 5px 20px 0px #000;"> |
405 | 405 | <div style="text-align:center;font-size: 12px;margin-top: 28px;">自定义需要启用一键下载的链接正则,一行一条</div> |
406 | | - <textarea id="configInput" placeholder="例:http:.*\\.php\\?getRes=\\d+" style="position:absolute;left:20px;top:50px;width:260px;height:150px"></textarea> |
| 406 | + <textarea id="configInput" placeholder="例:http:.*\\.php\\?getRes=\\d+" style="position:absolute;left:20px;top:50px;width:260px;height:110px"></textarea> |
| 407 | + <div style="text-align:center;font-size:12px;margin-top:125px;" title="不需要加'我的网盘/全部文件'">度盘存储路径:<input id="baiduPath" placeholder="例:/av" style="width:170px;"></div> |
407 | 408 | <div id="icons" style="position:absolute;left:3px;top:202px"></div> |
408 | 409 | <label style="position:absolute;left:60px;top:230px;"><input id="showType" type="checkbox"/>仅当鼠标经过时显示图标</label> |
409 | 410 | <button id="configSave" class="whx-btn" type="button" style="position:absolute;left:110px;top:260px;width:80px;height:30px;color:white;border-radius:5px;border:0px;outline:none;">设置</button> |
|
416 | 417 | var configQuit=document.querySelector("#configQuit"); |
417 | 418 | var configSave=document.querySelector("#configSave"); |
418 | 419 | var showTypeCheck=document.querySelector("#showType"); |
| 420 | + var baiduPath=document.querySelector("#baiduPath"); |
419 | 421 | var icons=$("#icons"); |
420 | 422 | for(var x = 0; x < Object.keys(sites).length; x++){ |
421 | 423 | let siteConfig=sites[x]; |
|
437 | 439 | configContent=document.querySelector("#configContent"); |
438 | 440 | configContent.style.display="block"; |
439 | 441 | if(GM_getValue("eoReg"))$(configInput).val(GM_getValue("eoReg").join("\n")); |
| 442 | + if(GM_getValue("baiduPath"))$(baiduPath).val(GM_getValue("baiduPath")); |
440 | 443 | if(GM_getValue("showType"))showTypeCheck.checked=true; |
441 | 444 | $(configQuit).click(function (event) {configContent.style.display="none";}); |
442 | 445 | $(configSave).click(function (event) { |
443 | 446 | var regStr=$(configInput).val(); |
| 447 | + var baiduPathStr=$(baiduPath).val(); |
| 448 | + console.log(baiduPathStr); |
| 449 | + if(baiduPathStr)GM_setValue("baiduPath",baiduPathStr); |
444 | 450 | if(!/^\s*$/.test(regStr)){ |
445 | 451 | var regStrs=regStr.split("\n"); |
446 | 452 | for(var reg of regStrs){ |
|
486 | 492 | if(offLink){ |
487 | 493 | clearInterval(bsl); |
488 | 494 | offLink.value = curlink; |
| 495 | + var baiduPathStr=GM_getValue("baiduPath"); |
| 496 | + if(baiduPathStr){ |
| 497 | + unsafeWindow.require("function-widget-1:offlineDownload/util/newOfflineDialog.js").obtain()._checkPath=baiduPathStr; |
| 498 | + } |
489 | 499 | document.querySelectorAll('#newoffline-dialog>.dialog-footer>.g-button')[1].click(); |
490 | 500 | if(/^magnet|torrent$/.test(curlink)) |
491 | 501 | var i=0, bsb = setInterval(function(){ |
|
0 commit comments