| 1397 | } |
| 1398 | |
| 1399 | function setting(){ |
| 1400 | init(); |
| 1401 | if(!configContent){ |
| 1402 | $('head').append(` |
| 1403 | <style> |
| 1404 | .whx-btn{ |
| 1405 | background-color:#3892ed; |
| 1406 | transition:background-color 0.15s ease; |
| 1407 | } |
| 1408 | .whx-btn:hover{ |
| 1409 | background-color:#83c1ff; |
| 1410 | } |
| 1411 | #configContent a{ |
| 1412 | color:#5c5c5c; |
| 1413 | transition: color 0.25s ease-out; |
| 1414 | } |
| 1415 | #configContent a:hover{ |
| 1416 | color:red; |
| 1417 | } |
| 1418 | </style>`); |
| 1419 | configContent=document.createElement("div"); |
| 1420 | configContent.id="configContent"; |
| 1421 | configContent.style.display="none"; |
| 1422 | document.body.appendChild(configContent); |
| 1423 | configContent.innerHTML=` |
| 1424 | <div style="text-align: center;width:300px;min-height:300px;position:fixed;left:50%;top:50%;margin-top:-250px;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;color:#6e7070;"> |
| 1425 | <a href="https://greasyfork.org/scripts/22590#additional-info" style="font-size: large;position: absolute; width: 100%; left: 0; text-decoration: underline;"><h3 style="padding: 0; margin: 0;">${i18n("settingTitle")}</h3></a> |
| 1426 | <a id="easyOfflineDisable" href="#" style="color: red;top: 18px; position: absolute; width: 100%; left: 0; text-decoration: underline;display:none;">${i18n("disableOnSite")}</a> |
| 1427 | <div style="text-align:center;font-size: 12px;margin-top: 38px;">${i18n("urlRegexpTips")}</div> |
| 1428 | <textarea id="configInput" placeholder="http:.*\\.php\\?getRes=\\d+\n\\.doc$\n\\.xls$\n\\.ppt$" style="position:absolute;left:18px;top:60px;width:260px;height:110px;background-color:white;color:black;"></textarea> |
| 1429 | <div style="text-align:center;font-size:12px;margin-top:125px;" title="${i18n("bdPathTips")}">${i18n("bdPathTitle")}<input id="baiduPath" placeholder="例:/av" style="width:170px;border-width:1px;border:solid 1px;"></div> |
| 1430 | <div id="icons" style="position: static; display: inline-block; margin-top: 10px;width: 100%;margin-left: 10px;"></div> |
| 1431 | <label style="position: static; width: 300px;"><input id="showType" type="checkbox"/>${i18n("settingMouseOver")}</label> |
| 1432 | <select style="position: static;width: 80px;margin: 10px 110px 10px;" id="funcKey"> |
| 1433 | <option value="alt">Alt key</option> |
| 1434 | <option value="ctrl">Ctrl key</option> |
| 1435 | <option value="shift">Shift key</option> |
| 1436 | <option value="meta">Meta key</option> |
| 1437 | <option value="noKey">No key</option> |
| 1438 | </select> |
| 1439 | <div style="text-align:center;font-size:12px;">${i18n("seekKey")}<input id="seekKey" placeholder="x" style="width:20px;border-width:1px;border:solid 1px;" value="x"></div> |
| 1440 | <button id="configSave" class="whx-btn" type="button" style="position:static;width:80px;height:30px;color:white;border-radius:5px;border:0px;outline:none;cursor:pointer;margin: 10px 110px 10px;">${i18n("settingBtn")}</button> |
| 1441 | <div id="configQuit" class="whx-btn" style="width:28px;height:28px;border-radius:14px;position:absolute;right:2px;top:2px;cursor:pointer;"> |
| 1442 | <span style="height:28px;line-height:28px;display:block;color:#FFF;text-align:center;font-size:10px;">╳</span> |
| 1443 | </div> |
| 1444 | </div>`; |
| 1445 | var configInput=configContent.querySelector("#configInput"); |
| 1446 | var configQuit=configContent.querySelector("#configQuit"); |
| 1447 | var configSave=configContent.querySelector("#configSave"); |
| 1448 | var showTypeCheck=configContent.querySelector("#showType"); |
| 1449 | var baiduPath=configContent.querySelector("#baiduPath"); |
| 1450 | var funcKeySelect=configContent.querySelector("#funcKey"); |
| 1451 | var seekKeyInput=configContent.querySelector("#seekKey"); |
| 1452 | var icons=$("#icons"),dragIcon; |
| 1453 | easyOfflineDisable = configContent.querySelector("#easyOfflineDisable"); |
| 1454 | $(easyOfflineDisable).click(function (event) { |
| 1455 | easyOfflineDisable.style.display="none"; |
| 1456 | toggleIcon("enable"); |