Skip to content

Commit 3a4dfd7

Browse files
committed
fix
1 parent eee81c3 commit 3a4dfd7

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Easy offline/Easy offline.user.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// @namespace http://tampermonkey.net/
99
// @require https://cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js
1010
// @require https://cdn.jsdelivr.net/hi-base64/0.2.0/base64.min.js
11-
// @version 1.2.3
11+
// @version 1.2.4
1212
// @author Hoothin
1313
// @mail rixixi@gmail.com
1414
// @include http*://*/*
@@ -403,7 +403,8 @@
403403
<div id="configContent" style="display: none;">
404404
<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;">
405405
<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>
407408
<div id="icons" style="position:absolute;left:3px;top:202px"></div>
408409
<label style="position:absolute;left:60px;top:230px;"><input id="showType" type="checkbox"/>仅当鼠标经过时显示图标</label>
409410
<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,6 +417,7 @@
416417
var configQuit=document.querySelector("#configQuit");
417418
var configSave=document.querySelector("#configSave");
418419
var showTypeCheck=document.querySelector("#showType");
420+
var baiduPath=document.querySelector("#baiduPath");
419421
var icons=$("#icons");
420422
for(var x = 0; x < Object.keys(sites).length; x++){
421423
let siteConfig=sites[x];
@@ -437,10 +439,14 @@
437439
configContent=document.querySelector("#configContent");
438440
configContent.style.display="block";
439441
if(GM_getValue("eoReg"))$(configInput).val(GM_getValue("eoReg").join("\n"));
442+
if(GM_getValue("baiduPath"))$(baiduPath).val(GM_getValue("baiduPath"));
440443
if(GM_getValue("showType"))showTypeCheck.checked=true;
441444
$(configQuit).click(function (event) {configContent.style.display="none";});
442445
$(configSave).click(function (event) {
443446
var regStr=$(configInput).val();
447+
var baiduPathStr=$(baiduPath).val();
448+
console.log(baiduPathStr);
449+
if(baiduPathStr)GM_setValue("baiduPath",baiduPathStr);
444450
if(!/^\s*$/.test(regStr)){
445451
var regStrs=regStr.split("\n");
446452
for(var reg of regStrs){
@@ -486,6 +492,10 @@
486492
if(offLink){
487493
clearInterval(bsl);
488494
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+
}
489499
document.querySelectorAll('#newoffline-dialog>.dialog-footer>.g-button')[1].click();
490500
if(/^magnet|torrent$/.test(curlink))
491501
var i=0, bsb = setInterval(function(){

0 commit comments

Comments
 (0)