Jira & SVN & Chrome extensions
Jira & SVN & Chrome extensions
Plugins
ok
document.querySelector(`[id="description-val"]`).firstElementChild.innerText.trim();1.
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=536)}({536:function(e,t,n){"use strict";window.SVNCC=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{kind:"无提交类型",testing:!1},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.kind,o=t.testing,i=document.querySelector('[id="key-val"]').innerText.trim(),c=document.querySelector('[id="type-val"]').innerText.trim(),u=document.querySelector('[id="summary-val"]').innerText.trim(),l=document.querySelector('[id="description-val"]').firstElementChild.innerText.trim(),a=o?"是":"否";if("无提交类型"===r)switch(c){case"新需求":c="新功能";break;case"优化":c="追加递交";break;case"缺陷":c="BUG修复"}u!==l&&(u+=l),e="\n[JIRA编号] "+i+"\n[修改内容] "+u+"\n[提交类型] "+c+"\n[需要测试] "+a+"\n",n&&console.log("result =\n",e);try{window.copy(e),alert("copied!")}catch(e){console.error("auto copy failed!")}return e}}});// SVNCC({ kind: "BUG修复", testing: true, });1.2.3.4.5.6.
bug
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=536)}({536:function(e,t,n){"use strict";window.SVNCC=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{kind:"无提交类型",testing:!1},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.kind,o=t.testing,i=document.querySelector('[id="key-val"]').innerText.trim(),c=document.querySelector('[id="type-val"]').innerText.trim(),u=document.querySelector('[id="summary-val"]').innerText.trim(),l=document.querySelector('[id="description-val"]>[class="user-content-block"]').innerText.trim(),a=o?"是":"否";if("无提交类型"===r)switch(c){case"新需求":c="新功能";break;case"优化":c="追加递交";break;case"缺陷":c="BUG修复"}u!==l&&(u+=l),e="\n[JIRA编号] "+i+"\n[修改内容] "+u+"\n[提交类型] "+c+"\n[需要测试] "+a+"\n",n&&console.log("result =\n",e);try{window.copy(e),alert("copied!")}catch(e){console.error("auto copy failed!")}return e}}});// SVNCC({ kind: "BUG修复", testing: true, });1.2.3.4.5.6.
"use strict";/** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @created 2018.12.12 * @modified 2018.12.12 * * @description Jira Plugin for shit SVN template * @augments * @example * *//*[JIRA编号][修改内容]请添加文字描述[提交类型]BUG修复/新功能/需求修改/版本制作/代码整理/解决编译不过/初次提交/阶段性递交/追加递交[需要测试]是/否*/const options = { kind: "新功能",// BUG修复/新功能/需求修改/版本制作/代码整理/解决编译不过/初次提交/阶段性递交/追加递交 testing: true,};const SVNCommitCommentsAutoGenerator = (options = { kind: "无提交类型", testing: false, }, debug = false) => { let { kind, testing, } = options; let result = ``; let jiraId = document.querySelector(`[id="key-val"]`).innerText.trim(); let type = document.querySelector(`[id="type-val"]`).innerText.trim(); let summary = document.querySelector(`[id="summary-val"]`).innerText.trim(); let description = document.querySelector(`[id="description-val"]>[class="user-content-block"]`).innerText.trim(); let test = testing ? "是" : "否"; if (kind === "无提交类型") { switch (type) { case "新需求": type = "新功能"; break; case "优化": type = "追加递交"; break; case "缺陷": type = "BUG修复"; break; default: break; } } if (summary !== description) { summary += description; } result = `[JIRA编号] ${jiraId}[修改内容] ${summary}[提交类型] ${type}[需要测试] ${test} `; if (debug) { console.log(`result =\n`, result); } try { window.copy(result); alert(`copied!`); } catch (error) { console.error(`auto copy failed!`); } return result;};export default SVNCommitCommentsAutoGenerator;export { SVNCommitCommentsAutoGenerator,};1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.
OK
"use strict";/** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @created 2018.12.12 * @modified 2018.12.12 * * @description Jira Plugin for shit SVN template * @augments * @example * *//*[JIRA编号][修改内容]请添加文字描述[提交类型]BUG修复/新功能/需求修改/版本制作/代码整理/解决编译不过/初次提交/阶段性递交/追加递交[需要测试]是/否*/const options = { kind: "新功能",// BUG修复/新功能/需求修改/版本制作/代码整理/解决编译不过/初次提交/阶段性递交/追加递交 testing: true,};const SVNCommitCommentsAutoGenerator = (options = { kind: "无提交类型", testing: false, }, debug = false) => { let { kind, testing, } = options; let result = ``; let jiraId = document.querySelector(`[id="key-val"]`).innerText.trim(); let type = document.querySelector(`[id="type-val"]`).innerText.trim(); let summary = document.querySelector(`[id="summary-val"]`).innerText.trim(); let description = document.querySelector(`[id="description-val"]>[class="user-content-block"]`).innerText.trim(); let test = testing ? "是" : "否"; if (kind === "无提交类型") { switch (type) { case "新需求": type = "新功能"; break; case "优化": type = "追加递交"; break; case "缺陷": type = "BUG修复"; break; default: break; } } if (summary !== description) { summary += description; } result = `[JIRA编号] ${jiraId}[修改内容] ${summary}[提交类型] ${type}[需要测试] ${test}`; if (debug) { console.log(`result =\n`, result); } try { window.copy(result); alert(`copied!`); } catch (error) { console.error(`auto copy failed!`); } return result;};export default SVNCommitCommentsAutoGenerator;export { SVNCommitCommentsAutoGenerator,};/*SVNCommitCommentsAutoGenerator();// "// [JIRA编号] CDD-289// [修改内容] 组件化管理平台- 用户管理 tree显示 false 数据// [提交类型] 追加递交// [需要测试] 否// "SVNCommitCommentsAutoGenerator(options = { kind: "BUG修复", testing: true, });// "// [JIRA编号] CDD-289// [修改内容] 组件化管理平台- 用户管理 tree显示 false 数据// [提交类型] 优化// [需要测试] 是// "*/1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.101.102.103.104.105.106.
chrome.tabs.executeScript
https://developer.chrome.com/tabs
https://developers.chrome.com/extensions/getstarted
https://developer.chrome.com/extensions/activeTab
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript
https://www.reddit.com/r/learnprogramming/comments/1rueae/chrome_extension_chrometabsexecutescript_just/
https://stackoverflow.com/questions/28760463/how-to-use-console-log-when-debugging-tabs-executescript
Chrome & extensions & demo
chrome://extensions/
https://github.com/xgqfrms/Angular-2018/tree/master/000-xyz/Chrome/chrome-app
steps
OK
bug
H5 DnD & Error
popup.js
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删