@jswork/alo7-develop-assistant
Advanced tools
Comparing version 1.0.59 to 1.0.60
@@ -5,7 +5,7 @@ /** | ||
* homepage: https://github.com/afeiship | ||
* version: 1.0.59 | ||
* date: 2021-02-19T01:05:55.512Z | ||
* version: 1.0.60 | ||
* date: 2021-07-15T09:05:48.094Z | ||
* license: MIT | ||
*/ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$("#contentContainer").find('[class^="Course__ContentLeftList"]').find('[data-component="react-card"]').each((t,n)=>{var e=$(n),i=e.data("uuid");e.find(".title").css({display:"flex"}),e.find(".title").addClass("gm-row gm-row-center gm-row-justify-between"),e.find(".title").append(`<button\n data-uuid="${i}"\n data-action="copy-course-uuid"\n class="gm-btn is-small gm-btn-default">🐠</button>`)}),$('[data-action="copy-course-uuid"]').click(t=>{var n=$(t.target).data("uuid");gmsdk.setClipboard(n),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3}),t.stopPropagation()})}}});nx.waitToDisplay("#contentContainer .alo7-pagination",1e3,n=>{(new t).start()})}),$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$(".alo7-layout-header .alo7-dropdown-trigger").after('<button id="copy-token" class="alo7-btn alo7-btn-primary">复制Token</button>'),this.attachEvents()},attachEvents(){$("#copy-token").click(()=>{var t=alo7Account.token;gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})})}}});setTimeout(()=>{(new t).start()},1e3)});var t=/redmine.*\/issues\/(\d+)/,n={Bug:"fix",Task:"feat"},e=GM_getResourceText("JQ_TOAST");GM_addStyle(e),gmsdk.addStyle('\n #git_msg{\n display: flex;\n align-items: center;\n justify-content:space-between;\n cursor: pointer;\n background: #f9f9f9;\n transition: all 0.3s;\n }\n #git_msg:hover {\n border:1px solid #ccc;\n background: #f1f1f1;\n }\n #git_msg:active{\n background: #eee;\n }\n\n #git_msg>.left{\n flex: 1;\n }\n\n #git_msg>.right{\n text-align: right;\n color: #999;\n font-size: 12px;\n }\n\n .git_action{\n display: inline-block;\n width: auto;\n min-width: 1em;\n margin-top: 3px;\n padding: 1px 8px;\n border-radius: 3px;\n color: #fff;\n font-size: .86em;\n font-weight: bold;\n text-align: center;\n text-transform: uppercase;\n }\n\n\n .git_action[data-git-action="feat"]{\n background-color: #584492;\n }\n\n .git_action[data-git-action="fix"]{\n background-color: #e74c3c;\n }\n'),$(document).ready((function(){if(t.exec(location.href)){var e=$("#content h2").text(),[i,a]=e.split(" #"),o=$("#content h3").eq(0).text(),s=""+(n[i]||"feat"),c=`${o} - (REDMINE-${a})`;$("#content h2").after(`\n <header id="git_msg" class="issue tracker-58 1-2 priority-4 priority-default details left">\n <div class="left">\n <span class="git_action" data-git-action="${s}">${s}</span>\n :\n <span class="git_msg">${c}</span>\n </div>\n <div class="right">\n <span class="icon icon-copy">[ 点击/右键 ]</span> 可以复制内容到简体板\n </div>\n </header>\n `),$("#content #git_msg").contextmenu((function(t){var n=c;t.preventDefault(),gmsdk.setClipboard(n),$.toast({icon:"info",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:n})})),$("#content #git_msg").click((function(){var t=`${s}: ${c}`,n=$(".fixed-version").text();if(n.includes(".")){var e=n.split(":")[1].toLowerCase();t=`${s}(${e}): ${c}`}gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:t})})),$("#content .contextual").prepend('<a id="copy-issue-id" class="icon icon-copy">复制Issue ID</a>'),$("#copy-issue-id").click(()=>{const t=new URL(location.href),{pathname:n}=t,e=n.split("/"),i=e[e.length-1];$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:i}),gmsdk.setClipboard(i)})}})),$(document).ready(()=>{if($(".page-metadata .author").text().includes("Tinny Tao")){var t=$('h1:contains("功能描述")');t.css({display:"flex","align-items":"center","justify-content":"space-between"}),t.append('<button id="rnotes-copy" class="aui-button aui-button-primary">Release Notes</button>');var n=t.next(".table-wrap").find(".relative-table tbody tr"),e=[];n.each((t,n)=>{var i=$(n).find("td:eq(1)").text();i&&e.push(`${t}. ${i}`)}),$("#rnotes-copy").click(()=>{gmsdk.setClipboard(e.join("\n")),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})})}}),$(document).ready(()=>{gmsdk.addStyle("\n #resources .circle-index{\n padding: 5px;\n background: #547e03;\n color: #fff;\n border-radius: 50px;\n }\n #resources .resource .heading > h2{\n font-size: 14px;\n }\n .operations li .heading .options li{\n display: flex;\n align-items: center;\n }\n .operations li .heading .options li a{\n margin-left: 10px;\n width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n "),setTimeout(()=>{$("#resources .resource .heading > h2").each((t,n)=>{var e="0"+(t+1);$(n).prepend(`<i class="circle-index">${e.slice(-2)}</i>`),$(n).append('<button class="clipboard items">Copy</button>')}),$(".operations li .heading .options li").prepend('<button class="clipboard item">Copy</button>'),$(".clipboard.item").click(t=>{var n=$(t.target).parents(".heading").find(".path").text().trim(),e=$(t.target).parents(".heading").find(".http_method a").text().trim();gmsdk.setClipboard(`['${e.toLowerCase()}', '${n}']`)}),$(".clipboard.items").click(t=>{var n=$(t.target).parents(".heading").next(".endpoints").find(".operation > div.heading > h3 > span.path").text().split("\n").map(t=>t.trim()).filter(Boolean);gmsdk.setClipboard(JSON.stringify(n,null,2))})},1e3)}),gmsdk.slog({title:"当前版本:",content:"1.0.59"}),gmsdk.slog({title:"更新时间:",content:"2021-02-19 09:05:55"})})); | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$("#contentContainer").find('[class^="Course__ContentLeftList"]').find('[data-component="react-card"]').each((t,n)=>{var e=$(n),i=e.data("uuid");e.find(".title").css({display:"flex"}),e.find(".title").addClass("gm-row gm-row-center gm-row-justify-between"),e.find(".title").append(`<button\n data-uuid="${i}"\n data-action="copy-course-uuid"\n class="gm-btn is-small gm-btn-default">🐠</button>`)}),$('[data-action="copy-course-uuid"]').click(t=>{var n=$(t.target).data("uuid");gmsdk.setClipboard(n),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3}),t.stopPropagation()})}}});nx.waitToDisplay("#contentContainer .alo7-pagination",1e3,n=>{(new t).start()})}),$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$(".alo7-layout-header .alo7-dropdown-trigger").after('<button id="copy-token" class="alo7-btn alo7-btn-primary">复制Token</button>'),this.attachEvents()},attachEvents(){$("#copy-token").click(()=>{var t=alo7Account.token;gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})})}}});setTimeout(()=>{(new t).start()},1e3)});var t=/redmine.*\/issues\/(\d+)/,n={Bug:"fix",Task:"feat"},e={Bug:"bug",Task:"issue"},i=GM_getResourceText("JQ_TOAST");GM_addStyle(i),gmsdk.addStyle('\n #git_msg{\n display: flex;\n align-items: center;\n justify-content:space-between;\n background: #f9f9f9;\n transition: all 0.3s;\n }\n\n #git_msg>.left{\n flex: 1;\n }\n\n #git_msg>.right{\n text-align: right;\n color: #999;\n font-size: 12px;\n }\n\n .git_action{\n display: inline-block;\n width: auto;\n min-width: 1em;\n margin-top: 3px;\n padding: 1px 8px;\n border-radius: 3px;\n color: #fff;\n font-size: .86em;\n font-weight: bold;\n text-align: center;\n text-transform: uppercase;\n }\n\n\n .git_action[data-git-action="feat"]{\n background-color: #584492;\n }\n\n .git_action[data-git-action="fix"]{\n background-color: #e74c3c;\n }\n\n .btn:last-child{\n border-color: #e74c3c;\n background-color: #e74c3c;\n }\n'),$(document).ready((function(){if(t.exec(location.href)){var i=$("#content h2").text(),[a,o]=i.split(" #"),s=$("#content h3").eq(0).text(),r=""+(n[a]||"feat"),d=`${s} - (REDMINE-${o})`,c=$(".fixed-version .value").text();$("#content h2").after(`\n <header id="git_msg" class="issue tracker-58 1-2 priority-4 priority-default details left">\n <div class="left">\n <span class="git_action" data-git-action="${r}">${r}</span>\n :\n <span class="git_msg">${d}</span>\n </div>\n <div class="right">\n <button id="gitflow" class="btn btn-small">复制: gitflow branch name</button>\n <button id="gitmsg" class="btn btn-small">复制: git message </button>\n </div>\n </header>\n `),$("#gitmsg").click((function(){var t=`${r}: ${d}`,n=$(".fixed-version").text();if(n.includes(".")){var e=n.split(":")[1].toLowerCase();t=`${r}(${e}): ${d}`}gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:t})})),$("#gitflow").click((function(){var t=`${nx.kebabCase(c.replace(/[._()]/g,""))}/redmine-${e[a]||"issue"}-${o}`;gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:t})}))}})),$(document).ready(()=>{if($(".page-metadata .author").text().includes("Tinny Tao")){var t=$('h1:contains("功能描述")');t.css({display:"flex","align-items":"center","justify-content":"space-between"}),t.append('<button id="rnotes-copy" class="aui-button aui-button-primary">Release Notes</button>');var n=t.next(".table-wrap").find(".relative-table tbody tr"),e=[];n.each((t,n)=>{var i=$(n).find("td:eq(1)").text();i&&e.push(`${t}. ${i}`)}),$("#rnotes-copy").click(()=>{gmsdk.setClipboard(e.join("\n")),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})})}}),$(document).ready(()=>{gmsdk.addStyle("\n #resources .circle-index{\n padding: 5px;\n background: #547e03;\n color: #fff;\n border-radius: 50px;\n }\n #resources .resource .heading > h2{\n font-size: 14px;\n }\n .operations li .heading .options li{\n display: flex;\n align-items: center;\n }\n .operations li .heading .options li a{\n margin-left: 10px;\n width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n "),setTimeout(()=>{$("#resources .resource .heading > h2").each((t,n)=>{var e="0"+(t+1);$(n).prepend(`<i class="circle-index">${e.slice(-2)}</i>`),$(n).append('<button class="clipboard items">Copy</button>')}),$(".operations li .heading .options li").prepend('<button class="clipboard item">Copy</button>'),$(".clipboard.item").click(t=>{var n=$(t.target).parents(".heading").find(".path").text().trim(),e=$(t.target).parents(".heading").find(".http_method a").text().trim();gmsdk.setClipboard(`['${e.toLowerCase()}', '${n}']`)}),$(".clipboard.items").click(t=>{var n=$(t.target).parents(".heading").next(".endpoints").find(".operation > div.heading > h3 > span.path").text().split("\n").map(t=>t.trim()).filter(Boolean);gmsdk.setClipboard(JSON.stringify(n,null,2))})},1e3)})})); |
// ==UserScript== | ||
// @name alo7-develop-assistant | ||
// @namespace https://github.com/afeiship/alo7-develop-assistant | ||
// @version 1.0.59 | ||
// @version 1.0.60 | ||
// @description Develop assistant for alo7. | ||
@@ -16,4 +16,4 @@ // @author aric.zheng | ||
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/gm-sdk@1.0.14 | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.59 | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/gm-sdk@1.0.15 | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.60 | ||
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js | ||
@@ -20,0 +20,0 @@ // @resource JQ_TOAST https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.css |
{ | ||
"name": "@jswork/alo7-develop-assistant", | ||
"version": "1.0.59", | ||
"version": "1.0.60", | ||
"description": "Develop assistant for alo7.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/afeiship", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9523
74