From 23ef4c369263251645fd6b09f0657abfde8cf63c Mon Sep 17 00:00:00 2001 From: PJ568 Date: Fri, 16 Jun 2023 14:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A1=B5=E5=86=85=E9=A1=B5?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/tool_type.css | 3 --- index.html | 6 +++--- js/contextmenu.js | 6 +++++- js/openLink.js | 27 +++++++++++++++++++-------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/css/tool_type.css b/css/tool_type.css index 874b2b1e..00e60df2 100644 --- a/css/tool_type.css +++ b/css/tool_type.css @@ -402,7 +402,4 @@ ins.adsbygoogle[data-ad-status="unfilled"]{ } #rcb_menu>#rcb_t6{ display: none -} -#rcb_menu>#rcb_t7{ - display: none } \ No newline at end of file diff --git a/index.html b/index.html index edda3266..ed4bb31a 100644 --- a/index.html +++ b/index.html @@ -44,11 +44,11 @@
  • ↪ 前进
  • ↻ 重载
  • 🆕 新标签页打开
  • -
  • 📖 在页内页打开
  • + - - \ No newline at end of file + + \ No newline at end of file diff --git a/js/contextmenu.js b/js/contextmenu.js index bb41ab13..6f837646 100644 --- a/js/contextmenu.js +++ b/js/contextmenu.js @@ -6,7 +6,8 @@ function RightClickMenu(e) { rightMenu.style.display = 'block'; if (e.target.closest('a')) { newTab.style.display = 'block'; - if (document.write(location.href)=='https://tools.pj568.eu.org/') {document.querySelector('#rcb_t7').style.display = 'block'} + // if (document.write(location.href)=='https://tools.pj568.eu.org/') {document.querySelector('#rcb_t7').style.display = 'block'} + document.querySelector('#rcb_t7').style.display = 'block'; } else { newTab.style.display = 'none'; document.querySelector('#rcb_t7').style.display = 'none'; @@ -46,6 +47,9 @@ rightMenu.addEventListener('click', function (e) { window.open(url); } break; + case "rcb_t7": + openBtnLink(); + break; default: console.error(e.target.id); break; diff --git a/js/openLink.js b/js/openLink.js index 29664c6f..a4da4f9d 100644 --- a/js/openLink.js +++ b/js/openLink.js @@ -1,8 +1,19 @@ -function openLink() { - var iframe = document.getElementById("myFrame"); - var iframeSrc = iframe.getAttribute("src"); - var encodedSrc = encodeURIComponent(iframeSrc); - - var link = "/incert/?link=" + encodedSrc; - window.location.assign(link) - } \ No newline at end of file +function openLink () { + var iframe = document.getElementById("myFrame"); + var iframeSrc = iframe.getAttribute("src"); + encode_and_open (iframeSrc) +} +function openBtnLink () { + var a = document.closest ('a'); + var aSrc = a.getAttribute ("src"); + + var encodedaSrc = encodeURIComponent (aSrc); + var url = "/incert/?link=" + encodedaSrc; + document.querySelector('#myFrame').src = url; + document.querySelector('#myFrame').scrollIntoView({ behavior: 'smooth' }); +} +function encode_and_open (event) { + var encodedSrc = encodeURIComponent (event); + var link = "/incert/?link=" + encodedSrc; + window.location.assign (link) +} \ No newline at end of file