|
2743 | 2743 | } |
2744 | 2744 | #search-jumper-tileInput { |
2745 | 2745 | display: none; |
2746 | | - opacity: 0.3; |
| 2746 | + opacity: 0.1; |
2747 | 2747 | user-select: all; |
2748 | 2748 | background-color: #212022; |
2749 | 2749 | color: #adadad; |
|
10173 | 10173 | } |
10174 | 10174 | let host = location.host; |
10175 | 10175 | let href = location.href; |
| 10176 | + let targetName; |
10176 | 10177 | let customReplaceSingle = (str, key, value, after) => { |
10177 | 10178 | if (str.indexOf(key + "[") !== -1) { |
10178 | 10179 | let multiMatch = str.match(keyToReg(key, "", "\\[(.*?)(\\|(.+))?\\]")), valueArr; |
|
10215 | 10216 | let keywordsU = "", keywordsL = "", keywordsR = "", keywordsSC = "", keywordsTC = ""; |
10216 | 10217 | let customReplaceKeywords = str => { |
10217 | 10218 | let _str = str; |
| 10219 | + _str = customReplaceSingle(_str, "%n", targetName); |
10218 | 10220 | _str = customReplaceSingle(_str, "%su", keywordsU); |
10219 | 10221 | _str = customReplaceSingle(_str, "%sl", keywordsL); |
10220 | 10222 | _str = customReplaceSingle(_str, "%sr", showTips ? keywordsR.replace(/\n/g, "【SearchJumperBreak】") : keywordsR); |
|
10362 | 10364 | ele.dataset.url = tempUrl.replace(/%e\b/g, document.characterSet).replace(/%c\b/g, (isMobile?"mobile":"pc")); |
10363 | 10365 | } |
10364 | 10366 | let targetUrl = '', targetLink = ''; |
10365 | | - let targetName = inputString || document.title; |
| 10367 | + targetName = inputString || document.title; |
10366 | 10368 | let imgBase64 = '', resultUrl = customVariable(ele.dataset.url); |
10367 | 10369 | if (targetElement && targetElement.nodeName) { |
10368 | 10370 | targetUrl = targetElement.href || (targetElement.parentNode && targetElement.parentNode.href) || ''; |
|
10615 | 10617 | let pairArr = pair.split("SJ^PARAM"); |
10616 | 10618 | if (pairArr.length === 2) { |
10617 | 10619 | let k = pairArr[0]; |
10618 | | - let v = customReplaceKeywords(pairArr[1].replace(/\\([\=&])/g, "$1").replace(/%e\b/g, document.characterSet).replace(/%i\b/g, imgBase64).replace(/%c\b/g, (isMobile?"mobile":"pc")).replace(/%U\b/g, encodeURIComponent(href)).replace(/%υ\b/g, encodeURIComponent(encodeURIComponent(href))).replace(/%h\b/g, _host).replace(/%T\b/g, encodeURIComponent(targetUrl)).replace(/%τ\b/g, encodeURIComponent(encodeURIComponent(targetUrl))).replace(/%b\b/g, targetBaseUrl).replace(/%B\b/g, encodeURIComponent(targetBaseUrl)).replace(/%β\b/g, encodeURIComponent(encodeURIComponent(targetBaseUrl))).replace(/%n\b/g, targetName)); |
| 10620 | + let v = customReplaceKeywords(pairArr[1].replace(/\\([\=&])/g, "$1").replace(/%e\b/g, document.characterSet).replace(/%i\b/g, imgBase64).replace(/%c\b/g, (isMobile?"mobile":"pc")).replace(/%U\b/g, encodeURIComponent(href)).replace(/%υ\b/g, encodeURIComponent(encodeURIComponent(href))).replace(/%h\b/g, _host).replace(/%T\b/g, encodeURIComponent(targetUrl)).replace(/%τ\b/g, encodeURIComponent(encodeURIComponent(targetUrl))).replace(/%b\b/g, targetBaseUrl).replace(/%B\b/g, encodeURIComponent(targetBaseUrl)).replace(/%β\b/g, encodeURIComponent(encodeURIComponent(targetBaseUrl)))); |
10619 | 10621 | v = customReplaceSingle(v, "%t", targetUrl); |
10620 | 10622 | v = customReplaceSingle(v, "%u", href); |
10621 | 10623 | postParams.push([k, v]); |
|
10638 | 10640 | resultUrl = customReplaceSingle(resultUrl, "%h", _host); |
10639 | 10641 | resultUrl = customReplaceSingle(resultUrl, "%t", targetUrl); |
10640 | 10642 | resultUrl = customReplaceSingle(resultUrl, "%u", href); |
10641 | | - resultUrl = customReplaceKeywords(resultUrl.replace(/%U\b/g, encodeURIComponent(href)).replace(/%υ\b/g, encodeURIComponent(encodeURIComponent(href))).replace(/%T\b/g, encodeURIComponent(targetUrl)).replace(/%τ\b/g, encodeURIComponent(encodeURIComponent(targetUrl))).replace(/%b\b/g, targetBaseUrl).replace(/%B\b/g, encodeURIComponent(targetBaseUrl)).replace(/%β\b/g, encodeURIComponent(encodeURIComponent(targetBaseUrl))).replace(/%n\b/g, targetName)); |
| 10643 | + resultUrl = customReplaceKeywords(resultUrl.replace(/%U\b/g, encodeURIComponent(href)).replace(/%υ\b/g, encodeURIComponent(encodeURIComponent(href))).replace(/%T\b/g, encodeURIComponent(targetUrl)).replace(/%τ\b/g, encodeURIComponent(encodeURIComponent(targetUrl))).replace(/%b\b/g, targetBaseUrl).replace(/%B\b/g, encodeURIComponent(targetBaseUrl)).replace(/%β\b/g, encodeURIComponent(encodeURIComponent(targetBaseUrl)))); |
10642 | 10644 | if (openInNewTab && /^(https?|ftp):/.test(resultUrl)) { |
10643 | 10645 | ele.setAttribute("target", "_blank"); |
10644 | 10646 | ele.dataset.target = 1; |
|
10796 | 10798 | if (window.getSelection().toString()) { |
10797 | 10799 | target = targetElement || ele; |
10798 | 10800 | } else target = getBody(document); |
| 10801 | + self.tileInput.parentNode && self.tileInput.parentNode.removeChild(self.tileInput); |
10799 | 10802 | } |
10800 | 10803 | self.tipsPos(target, i18n('copyOver')); |
10801 | 10804 | clearTimeout(self.hideTips); |
|
0 commit comments