Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jswork/alo7-develop-assistant

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jswork/alo7-develop-assistant - npm Package Compare versions

Comparing version 1.0.57 to 1.0.58

6

dist/index.js

@@ -5,7 +5,7 @@ /**

* homepage: https://github.com/afeiship
* version: 1.0.57
* date: 2021-01-09T09:12:57.527Z
* version: 1.0.58
* date: 2021-01-11T07:08:06.746Z
* license: MIT
*/
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){$(document).ready(()=>{var t=document.URL,n=["1. 需要登录自己的 EHR","2. 使用F12打开开发者工具","3. 切换到 Console 这个 Tab","4. 刷新页面,等待统计结果","当前版本: 1.0.57","更新时间: 2021-01-09 17:12:57"].join("<br/>");if(!t.includes("hr.saybot.net"))return!1;var e=nx.declare({statics:{help(){$.toast({icon:"info",heading:"EHR小助手",position:"top-right",stack:!1,hideAfter:5e4,text:n})}},methods:{start(){if(t.includes("/Alo7HR/login"))return!1;console.log("🍏 等待统计....");var n=this.params(),e=nx.rangeDate.apply(null,n);Promise.all(e.map(t=>this.api(t))).then(t=>{this.stat=t.map(t=>{if(t.length<2)return null;var n=t[0],e=t[t.length-1],a=this.sub(e.CARDTIME),i=new Date(n.CARDTIME),o=new Date(e.CARDTIME)-i-a,s=this.ottime(i,o);return{start:n.CARDTIME,end:e.CARDTIME,subed:a,day:i,duration:o,ot:s}}).filter(Boolean);var e=this.stat.map(t=>{var n=`周${nx.Weeks.day(t.day,"cn")}:${nx.Weeks.day(t.day,"emoji")}`;return{"上班":t.start,"下班":t.end,"工作日":n,"扣除":this.humanize(t.subed),"实际加班":this.humanize(t.ot),"实际工作":this.humanize(t.duration)}}),a=this.stat.map(t=>t.ot),i=this.stat.map(t=>t.duration);e.push({"上班":"开始时间: "+n[0],"下班":"结束时间: "+n[1],"工作日":0,"扣除":0,"实际加班":this.humanize(nx.sum(a)),"实际工作":this.humanize(nx.sum(i))}),console.table(e)})},ottime(t,n){var e=n-(nx.Date.isWeekend(t)?0:288e5);return e>0?e:0},humanize(t){var{hour:n,minute:e}=nx.timeFormat(t);return`${n}小时${e}分钟`},params(){var t,n,e=new Date,a=e.getDate(),i=e.getMonth();return a<=16?(t=new Date((new Date).setMonth(i-1)),n=e):(t=e,n=new Date((new Date).setMonth(i+1))),[nx.Date.format(t,"yyyy-mm-15"),nx.Date.format(n,"yyyy-mm-16"),!0]},sub(t){var[n,e]=t.split(" "),a=new Date(n+" 18:30:00"),i=new Date(n+" 19:30:00"),o=new Date(t);return o>i?72e5:o>a&&o<i?o-a+36e5:o<a?36e5:void 0},apiKey:()=>$(".essPolication2 .submenu li").eq(1).attr("id"),api(t){var n=`https://hr.saybot.net:8443/Alo7HR/ajax/function/alist!${this.apiKey()}.SE0302`;return gmsdk.http.post({url:n,data:{appParam:{TERM:t},appFnKey:"SE0301",formData:{}}})}}});e.help(),nx.waitToDisplay("#portal_ehr",1e3,t=>{(new e).start()})}),$(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),a=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="${a}"\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)}),$(document).ready(()=>{const t=$("body"),n={beta:"https://kellis-ng.beta.saybot.net/",prod:"https://kellis-ng.alo7.com/"};gmsdk.addStyle("\n .kellis-url-toolkit{\n z-index: 1001;\n position:fixed;\n right: 10px;\n top: 330px;\n width: 120px;\n text-align: center;\n }\n "),t.prepend('\n <section class="kellis-url-toolkit">\n <div class="gm-btn-group">\n <button data-gm-action="beta" class="gm-btn gm-btn-default">🍏</button>\n <button data-gm-action="prod" class="gm-btn gm-btn-default">🚗</button>\n <button data-gm-action="close" class="gm-btn gm-btn-default">❌</button>\n </div>\n </section>\n '),t.find("[data-gm-action]").click(t=>{let e=$(t.target).data("gm-action");"close"===e?$(".kellis-url-toolkit").remove():window.open(n[e])})});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(),[a,i]=e.split(" #"),o=$("#content h3").eq(0).text(),s=""+(n[a]||"feat"),r=`${o} - (REDMINE-${i})`;$("#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">${r}</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=r;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}: ${r}`,n=$(".fixed-version").text();if(n.includes(".")){var e=n.split(":")[1].toLowerCase();t=`${s}(${e}): ${r}`}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("/"),a=e[e.length-1];$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:a}),gmsdk.setClipboard(a)})}})),$(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 a=$(n).find("td:eq(1)").text();a&&e.push(`${t}. ${a}`)}),$("#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.57"}),gmsdk.slog({title:"更新时间:",content:"2021-01-09 17:12:57"})}));
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){$(document).ready(()=>{var t=document.URL,n=["1. 需要登录自己的 EHR","2. 使用F12打开开发者工具","3. 切换到 Console 这个 Tab","4. 刷新页面,等待统计结果","当前版本: 1.0.58","更新时间: 2021-01-11 15:08:06"].join("<br/>");if(!t.includes("hr.saybot.net"))return!1;var e=nx.declare({statics:{help(){$.toast({icon:"info",heading:"EHR小助手",position:"top-right",stack:!1,hideAfter:5e4,text:n})}},methods:{start(){if(t.includes("/Alo7HR/login"))return!1;console.log("🍏 等待统计....");var n=this.params(),e=nx.rangeDate.apply(null,n);Promise.all(e.map(t=>this.api(t))).then(t=>{this.stat=t.map(t=>{if(t.length<2)return null;var n=t[0],e=t[t.length-1],a=this.sub(e.CARDTIME),i=new Date(n.CARDTIME),o=new Date(e.CARDTIME)-i-a,s=this.ottime(i,o);return{start:n.CARDTIME,end:e.CARDTIME,subed:a,day:i,duration:o,ot:s}}).filter(Boolean);var e=this.stat.map(t=>{var n=`周${nx.Weeks.day(t.day,"cn")}:${nx.Weeks.day(t.day,"emoji")}`;return{"上班":t.start,"下班":t.end,"工作日":n,"扣除":this.humanize(t.subed),"实际加班":this.humanize(t.ot),"实际工作":this.humanize(t.duration)}}),a=this.stat.map(t=>t.ot),i=this.stat.map(t=>t.duration);e.push({"上班":"开始时间: "+n[0],"下班":"结束时间: "+n[1],"工作日":0,"扣除":0,"实际加班":this.humanize(nx.sum(a)),"实际工作":this.humanize(nx.sum(i))}),console.table(e)})},ottime(t,n){var e=n-(nx.Date.isWeekend(t)?0:288e5);return e>0?e:0},humanize(t){var{hour:n,minute:e}=nx.timeFormat(t);return`${n}小时${e}分钟`},params(){var t,n,e=new Date,a=e.getDate(),i=e.getMonth();return a<=16?(t=new Date((new Date).setMonth(i-1)),n=e):(t=e,n=new Date((new Date).setMonth(i+1))),[nx.Date.format(t,"yyyy-mm-16"),nx.Date.format(n,"yyyy-mm-15"),!0]},sub(t){var[n,e]=t.split(" "),a=new Date(n+" 18:30:00"),i=new Date(n+" 19:30:00"),o=new Date(t);return o>i?72e5:o>a&&o<i?o-a+36e5:o<a?36e5:void 0},apiKey:()=>$(".essPolication2 .submenu li").eq(1).attr("id"),api(t){var n=`https://hr.saybot.net:8443/Alo7HR/ajax/function/alist!${this.apiKey()}.SE0302`;return gmsdk.http.post({url:n,data:{appParam:{TERM:t},appFnKey:"SE0301",formData:{}}})}}});e.help(),nx.waitToDisplay("#portal_ehr",1e3,t=>{(new e).start()})}),$(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),a=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="${a}"\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)}),$(document).ready(()=>{const t=$("body"),n={beta:"https://kellis-ng.beta.saybot.net/",prod:"https://kellis-ng.alo7.com/"};gmsdk.addStyle("\n .kellis-url-toolkit{\n z-index: 1001;\n position:fixed;\n right: 10px;\n top: 330px;\n width: 120px;\n text-align: center;\n }\n "),t.prepend('\n <section class="kellis-url-toolkit">\n <div class="gm-btn-group">\n <button data-gm-action="beta" class="gm-btn gm-btn-default">🍏</button>\n <button data-gm-action="prod" class="gm-btn gm-btn-default">🚗</button>\n <button data-gm-action="close" class="gm-btn gm-btn-default">❌</button>\n </div>\n </section>\n '),t.find("[data-gm-action]").click(t=>{let e=$(t.target).data("gm-action");"close"===e?$(".kellis-url-toolkit").remove():window.open(n[e])})});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(),[a,i]=e.split(" #"),o=$("#content h3").eq(0).text(),s=""+(n[a]||"feat"),r=`${o} - (REDMINE-${i})`;$("#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">${r}</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=r;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}: ${r}`,n=$(".fixed-version").text();if(n.includes(".")){var e=n.split(":")[1].toLowerCase();t=`${s}(${e}): ${r}`}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("/"),a=e[e.length-1];$.toast({icon:"success",heading:"复制成功",position:"top-right",stack:!1,hideAfter:1e3,text:a}),gmsdk.setClipboard(a)})}})),$(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 a=$(n).find("td:eq(1)").text();a&&e.push(`${t}. ${a}`)}),$("#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.58"}),gmsdk.slog({title:"更新时间:",content:"2021-01-11 15:08:06"})}));
// ==UserScript==
// @name alo7-develop-assistant
// @namespace https://github.com/afeiship/alo7-develop-assistant
// @version 1.0.57
// @version 1.0.58
// @description Develop assistant for alo7.

@@ -17,3 +17,3 @@ // @author aric.zheng

// @require https://cdn.jsdelivr.net/npm/@jswork/gm-sdk@1.0.14
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.57
// @require https://cdn.jsdelivr.net/npm/@jswork/alo7-develop-assistant@1.0.58
// @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.57",
"version": "1.0.58",
"description": "Develop assistant for alo7.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/afeiship",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc