From 13c92ffdf9b2fff377120eeb2351b11d2189dc0a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Raw=20=E5=8D=95=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=BF=AB=E6=8D=B7=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88Github=20?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 47ef486..6ff12c6 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,12 +1,13 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.0 +// @version 1.4.1 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* // @icon https://i.loli.net/2021/03/07/oUHPFSOTjKnkMzJ.png // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js +/* globals $ */ // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab @@ -120,9 +121,9 @@ html = `
`; for (let i=0;i${download_url[i][1]}` + html += `${download_url[i][1]}` } - html = html + `
` + html += `` $(this).next().after(html); }); // 修改[文件大小]元素样式 @@ -143,9 +144,9 @@ html = `
`; for (let i=0;i${download_url[i][1]}` + html += `${download_url[i][1]}` } - html = html + `
` + html += `` $(this).after(html); }); }); @@ -169,7 +170,7 @@ html = ``; for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` + html += `
  • ${svg[0]}Download ZIP ${download_url[i][1]}
  • ` } $(this).after(html); }); @@ -188,7 +189,7 @@ html = ``; for (let i=0;i
    ${svg[1]}
    ` + html += `
    ${svg[1]}
    ` } $(this).after(html); }); @@ -209,7 +210,7 @@ html = ``; for (let i=0;i${raw_url[i+1][1]}` + html += `${raw_url[i+1][1]}` } $(this).after(html); }); @@ -228,7 +229,7 @@ var mouseOverHandler = function(evt){ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), - aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); aElm_new.forEach(el=>el.style.cssText = 'display: inline'); aElm_now.forEach(el=>el.style.cssText = 'display: none'); }; @@ -237,7 +238,7 @@ var mouseOutHandler = function(evt){ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), - aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); aElm_new.forEach(el=>el.style.cssText = 'display: none'); aElm_now.forEach(el=>el.style.cssText = 'display: inline'); }; @@ -246,10 +247,11 @@ files.each(function(i,fileElm){ let trElm = fileElm.parentNode.parentNode, cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), - cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.text-gray-light'), + cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.color-icon-tertiary'), Name = cntElm_a.innerText, href = cntElm_a.attributes['href'].nodeValue.replace('https://github.com',''); let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; + console.log(cntElm_a, cntElm_svg, Name, href) switch(menu_raw_fast) { case 2: