@jswork/alo7-develop-assistant
Advanced tools
Comparing version 1.0.68 to 1.0.69
@@ -5,7 +5,7 @@ /** | ||
* homepage: https://github.com/afeiship | ||
* version: 1.0.68 | ||
* date: 2021-08-06T07:07:33.805Z | ||
* version: 1.0.69 | ||
* date: 2021-08-25T09:12:09.585Z | ||
* 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,e)=>{var n=$(e),i=n.data("uuid");n.find(".title").css({display:"flex"}),n.find(".title").addClass("gm-row gm-row-center gm-row-justify-between"),n.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 e=$(t.target).data("uuid");gmsdk.setClipboard(e),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3}),t.stopPropagation()})}}});nx.waitToDisplay("#contentContainer .alo7-pagination",1e3,e=>{(new t).start()})}),$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$('[class^="Dashboard__HeaderOption"]').after('<button id="copy-token" class="ant-btn ant-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+)/,e={Bug:"fix",TechTask:"refactor",Task:"feat"},n={Bug:"bug",TechTask:"refactor",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="refactor"]{\n background-color: #f71692;\n }\n\n .git_action[data-git-action="fix"]{\n background-color: #e74c3c;\n }\n'),$(document).ready((function(){if(t.exec(location.href)){var i=$("#content h2").eq(0).text(),[a,o]=i.split(" #"),s=$("#content h3").eq(0).text(),r=""+(e[a]||"feat"),c=`${s} - (REDMINE-${o})`,d=$(".fixed-version .value").text();$("#content h2").eq(0).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">${c}</span>\n </div>\n <div class="right">\n <button id="gitmsg" class="gm-btn gm-btn-positive is-large">\n <i class="icon icon-comment"></i>\n 复制: git message\n </button>\n <button id="gitflow" class="gm-btn gm-btn-negative is-large">\n <i class="icon icon-projects"></i>\n 复制: gitflow branch name\n </button>\n </div>\n </header>\n `),$("#gitmsg").click((function(){var t=`${r}: ${c}`,e=$(".fixed-version").text();if(e.includes(".")){var n=e.split(":")[1].toLowerCase();t=`${r}(${n}): ${c}`}gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:t})})),$("#gitflow").click((function(){var t=nx.kebabCase(d.replace(/[._()-]/g,"")),e=`${t?t+"/":""}redmine-${n[a]||"issue"}-${o}`;gmsdk.setClipboard(e),$.toast({icon:"info",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:e})}))}})),$(document).ready((function(){var t=location.host,e=$(".page-metadata .author").text();if("confluence.alo7.cn"!==t||!e.includes("Issa Li"))return;var n=$('h1:contains("功能描述")'),i=n.next(".table-wrap").find(".relative-table tbody tr"),a=[];i.each((t,e)=>{var n=$(e).find("td:eq(1)").text();n&&a.push(n)});const o=a.map((t,e)=>{const n="rdm-issue-"+e;return`\n <tr>\n <td><input name="redmine-issue" data-index=${e} id="${n}" type="checkbox" /></td>\n <td><label style="padding:5px; display:block;" for="${n}">${e+1}. ${t}</label></td>\n </tr>`});n.after(`\n <form style="border:1px solid #ccc; margin: 10px auto;">\n <table class="gm-table gm-table-striped">\n <thead>\n <tr>\n <td align="center" width="20">\n <div class="gm-row gm-row-center">\n <input id="batch-checked" type="checkbox" />\n <label id="batch-select" for="batch-checked">\n <strong>创建?</strong>\n </label>\n </div>\n </td>\n <td><strong>功能点</strong></td>\n </tr>\n </thead>\n <tbody>\n ${o.join("\n")}\n </tbody>\n </table>\n <footer style="padding:10px;">\n <button type="button" data-action="unselect-all" class="gm-btn gm-btn-primary">反选</button>\n <button type="button" data-action="issues-create" class="gm-btn gm-btn-negative">一键复制JSON</button>\n <button type="button" data-action="release-notes" class="gm-btn gm-btn-positive">复制ReleaseNotes</button>\n </footer>\n </form>\n `),$("#batch-select").click(t=>{t.stopPropagation();const e=$("#batch-select").prev("input").prop("checked");$('[name="redmine-issue"]').prop("checked",!e)}),$('[data-action="unselect-all"]').click(t=>{$('[name="redmine-issue"]').each((function(t,e){const n=$(e).prop("checked");$(e).prop("checked",!n)}))}),$('[data-action="issues-create"]').click(t=>{const e=$('[name="redmine-issue"]:checked'),n=nx.slice(e).map(t=>{const e=$(t).data("index");return{index:e,text:a[e]}});if(!e.length)return $.toast({icon:"error",position:"top-right",heading:"请选中要创建的task"});gmsdk.setClipboard(JSON.stringify(n)),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})}),$('[data-action="release-notes"]').click((function(t){const e=a.map((t,e)=>`${e+1}. ${t}`);gmsdk.setClipboard(e.join("\n")),$.toast({icon:"info",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})}))})),$(document).ready((function(){if("redmine.saybot.net"!==location.host)return;const t=$("#header h1"),e={"x-redmine-api-key":"7d0d1e1e5b59da84cd4974395e764b0a36894318","content-type":"application/json"},n={frontend:"【前端】",backend:"【后端】"},i=t=>{const i=nx.hashlize(),a=$("#bfend-selector").val(),o=$("#version-selector").val(),s=String(t.index+1).padStart(2,"0"),r=`${n[a]}${s}. ${t.text}`,c=nx.Date.format(null,"date"),d={issue:{project_id:155,tracker_id:5,subject:r,status_id:2,was_default_status:2,priority_id:4,assigned_to_id:i.assigned_to_id||858,fixed_version_id:o,start_date:c}};fetch("https://redmine.saybot.net/issues.json",{method:"POST",headers:e,body:JSON.stringify(d)})};t.append('\n <div style="display: inline-flex;" class="row-center">\n <select data-action="version-select" style="margin:0 10px;" class="gm-form-control" id="version-selector"></select>\n <select data-action="bfend-select" style="margin-right:10px;" class="gm-form-control" id="bfend-selector">\n <option value="frontend">前端</option>\n <option value="backend">后端</option>\n </select>\n <button data-action="issue-create" type="button" class="gm-btn gm-btn-primary">一键创建Issues</button>\n </div>\n '),fetch("https://redmine.saybot.net/projects/155/versions.json",{method:"GET",headers:e}).then(t=>t.json()).then(t=>{const e=$("#version-selector"),n=t.versions.slice(-5),i=n.map(t=>`<option value="${t.id}">${t.name}</option>`);e.html(i),e.val(n[n.length-1].id)}),$('[data-action="issue-create"]').click((async function(t){const e=await navigator.clipboard.readText(),n=nx.parse(e);if(!Array.isArray(n))return $.toast({icon:"error",position:"top-right",heading:"无合适的task可以创建"});for(const t of n)i(t);$.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,e)=>{var n="0"+(t+1);$(e).prepend(`<i class="circle-index">${n.slice(-2)}</i>`),$(e).append('<button class="clipboard items">Copy</button>')}),$(".operations li .heading .options li").prepend('<button class="clipboard item">Copy</button>'),$(".clipboard.item").click(t=>{var e=$(t.target).parents(".heading").find(".path").text().trim(),n=$(t.target).parents(".heading").find(".http_method a").text().trim();gmsdk.setClipboard(`['${n.toLowerCase()}', '${e}']`)}),$(".clipboard.items").click(t=>{var e=$(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(e,null,2))})},1e3)})})); | ||
!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,e)=>{var n=$(e),i=n.data("uuid");n.find(".title").css({display:"flex"}),n.find(".title").addClass("gm-row gm-row-center gm-row-justify-between"),n.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 e=$(t.target).data("uuid");gmsdk.setClipboard(e),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3}),t.stopPropagation()})}}});nx.waitToDisplay("#contentContainer .alo7-pagination",1e3,e=>{(new t).start()})}),$(document).ready(()=>{if(!document.URL.includes("kellis-ng."))return!1;var t=nx.declare({methods:{start(){$('[class^="Dashboard__HeaderOption"]').after('<button id="copy-token" class="ant-btn ant-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+)/,e={Bug:"fix",TechTask:"refactor",Task:"feat"},n={Bug:"bug",TechTask:"refactor",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="refactor"]{\n background-color: #f71692;\n }\n\n .git_action[data-git-action="fix"]{\n background-color: #e74c3c;\n }\n'),$(document).ready((function(){if(t.exec(location.href)){var i=$("#content h2").eq(0).text(),[a,o]=i.split(" #"),s=$("#content h3").eq(0).text(),r=""+(e[a]||"feat"),c=`${s} - (REDMINE-${o})`,d=$(".fixed-version .value").text();$("#content h2").eq(0).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">${c}</span>\n </div>\n <div class="right">\n <button id="gitmsg" class="gm-btn gm-btn-positive is-large">\n <i class="icon icon-comment"></i>\n 复制: git message\n </button>\n <button id="gitflow" class="gm-btn gm-btn-negative is-large">\n <i class="icon icon-projects"></i>\n 复制: gitflow branch name\n </button>\n </div>\n </header>\n `),$("#gitmsg").click((function(){var t=`${r}: ${c}`,e=$(".fixed-version").text();if(e.includes(".")){var n=e.split(":")[1].toLowerCase();t=`${r}(${n}): ${c}`}gmsdk.setClipboard(t),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:t})})),$("#gitflow").click((function(){var t=nx.kebabCase(d.replace(/[._()-]/g,"")),e=`${t?t+"/":""}redmine-${n[a]||"issue"}-${o}`;gmsdk.setClipboard(e),$.toast({icon:"info",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:e})}))}})),$(document).ready((function(){var t=location.host,e=$(".page-metadata .author").text();if("confluence.alo7.cn"!==t||!e.includes("Issa Li"))return;var n=$('h1:contains("功能描述")'),i=n.next(".table-wrap").find(".relative-table tbody tr"),a=[];i.each((t,e)=>{var n=$(e).find("td:eq(1)").text();n&&a.push(n)});const o=a.map((t,e)=>{const n="rdm-issue-"+e;return`\n <tr>\n <td><input name="redmine-issue" data-index=${e} id="${n}" type="checkbox" /></td>\n <td><label style="padding:5px; display:block;" for="${n}">${e+1}. ${t}</label></td>\n </tr>`});n.after(`\n <form style="border:1px solid #ccc; margin: 10px auto;">\n <table class="gm-table gm-table-striped">\n <thead>\n <tr>\n <td align="center" width="20">\n <div class="gm-row gm-row-center">\n <input id="batch-checked" type="checkbox" />\n <label id="batch-select" for="batch-checked">\n <strong>创建?</strong>\n </label>\n </div>\n </td>\n <td><strong>功能点</strong></td>\n </tr>\n </thead>\n <tbody>\n ${o.join("\n")}\n </tbody>\n </table>\n <footer style="padding:10px;">\n <button type="button" data-action="unselect-all" class="gm-btn gm-btn-primary">反选</button>\n <button type="button" data-action="issues-create" class="gm-btn gm-btn-negative">一键复制JSON</button>\n <button type="button" data-action="release-notes" class="gm-btn gm-btn-positive">复制ReleaseNotes</button>\n </footer>\n </form>\n `),$("#batch-select").click(t=>{t.stopPropagation();const e=$("#batch-select").prev("input").prop("checked");$('[name="redmine-issue"]').prop("checked",!e)}),$('[data-action="unselect-all"]').click(t=>{$('[name="redmine-issue"]').each((function(t,e){const n=$(e).prop("checked");$(e).prop("checked",!n)}))}),$('[data-action="issues-create"]').click(t=>{const e=$('[name="redmine-issue"]:checked'),n=nx.slice(e).map(t=>{const e=$(t).data("index");return{index:e,text:a[e]}});if(!e.length)return $.toast({icon:"error",position:"top-right",heading:"请选中要创建的task"});gmsdk.setClipboard(JSON.stringify(n)),$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3})}),$('[data-action="release-notes"]').click((function(t){const e=$('[name="redmine-issue"]:checked'),n=nx.slice(e).map(t=>{const e=$(t).data("index");return`${e+1}. ${a[e]}`});gmsdk.setClipboard(n.join("\n")),$.toast({icon:"info",heading:"复制成功11",position:"top-right",stack:!1,hideAfter:1e3})}))})),$(document).ready((function(){if("redmine.saybot.net"!==location.host)return;const t=$("#header h1"),e={"x-redmine-api-key":"7d0d1e1e5b59da84cd4974395e764b0a36894318","content-type":"application/json"},n={frontend:"【前端】",backend:"【后端】"},i=t=>{const i=nx.hashlize(),a=$("#bfend-selector").val(),o=$("#version-selector").val(),s=String(t.index+1).padStart(2,"0"),r=`${n[a]}${s}. ${t.text}`,c=nx.Date.format(null,"date"),d={issue:{project_id:155,tracker_id:5,subject:r,status_id:2,was_default_status:2,priority_id:4,assigned_to_id:i.assigned_to_id||858,fixed_version_id:o,start_date:c}};fetch("https://redmine.saybot.net/issues.json",{method:"POST",headers:e,body:JSON.stringify(d)})};t.append('\n <div style="display: inline-flex;" class="row-center">\n <select data-action="version-select" style="margin:0 10px;" class="gm-form-control" id="version-selector"></select>\n <select data-action="bfend-select" style="margin-right:10px;" class="gm-form-control" id="bfend-selector">\n <option value="frontend">前端</option>\n <option value="backend">后端</option>\n </select>\n <button data-action="issue-create" type="button" class="gm-btn gm-btn-primary">一键创建Issues</button>\n </div>\n '),fetch("https://redmine.saybot.net/projects/155/versions.json",{method:"GET",headers:e}).then(t=>t.json()).then(t=>{const e=$("#version-selector"),n=t.versions.slice(-5),i=n.map(t=>`<option value="${t.id}">${t.name}</option>`);e.html(i),e.val(n[n.length-1].id)}),$('[data-action="issue-create"]').click((async function(t){const e=await navigator.clipboard.readText(),n=nx.parse(e);if(!Array.isArray(n))return $.toast({icon:"error",position:"top-right",heading:"无合适的task可以创建"});for(const t of n)i(t);$.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,e)=>{var n="0"+(t+1);$(e).prepend(`<i class="circle-index">${n.slice(-2)}</i>`),$(e).append('<button class="clipboard items">Copy</button>')}),$(".operations li .heading .options li").prepend('<button class="clipboard item">Copy</button>'),$(".clipboard.item").click(t=>{var e=$(t.target).parents(".heading").find(".path").text().trim(),n=$(t.target).parents(".heading").find(".http_method a").text().trim();gmsdk.setClipboard(`['${n.toLowerCase()}', '${e}']`)}),$(".clipboard.items").click(t=>{var e=$(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(e,null,2))})},1e3)})})); |
// ==UserScript== | ||
// @name alo7-develop-assistant | ||
// @namespace https://github.com/afeiship/alo7-develop-assistant | ||
// @version 1.0.68 | ||
// @version 1.0.69 | ||
// @description Develop assistant for alo7. | ||
@@ -17,3 +17,3 @@ // @author aric.zheng | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/gm-sdk@1.0.18 | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.68 | ||
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.69 | ||
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js | ||
@@ -20,0 +20,0 @@ // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js |
{ | ||
"name": "@jswork/alo7-develop-assistant", | ||
"version": "1.0.68", | ||
"version": "1.0.69", | ||
"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
14070
98