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: