Jira & SVN & Chrome extensions

Plugins

SVN & Jira Plugins

ok

selector bug

document.querySelector(`[id="description-val"]`).firstElementChild.innerText.trim();



!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, });

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, });

Chrome extensions


"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,
};

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 数据
// [提交类型] 优化
// [需要测试] 是
// "
*/

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


// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. function click(e) {
chrome.tabs.executeScript(null,{
code: "document.body.style.backgroundColor='" + e.target.id + "'",
});
window.close();
} document.addEventListener('DOMContentLoaded', function () {
var divs = document.querySelectorAll('div');
for (var i = 0; i < divs.length; i++) {
divs[i].addEventListener('click', click);
}
});

manifest.json


{
"name": "A browser action with a popup that changes the page color",
"description": "Change the current page color",
"version": "1.0",
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"browser_action": {
"default_title": "Set this page's color.",
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"manifest_version": 2
}

popup.html

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Set Page Color Popup</title>
<link rel="stylesheet" href="popup.css">
</head> <body>
<div id="red">red</div>
<div id="blue">blue</div>
<div id="green">green</div>
<div id="yellow">yellow</div>
<script src="popup.js"></script>
</body> </html>

popup.css

body {
overflow: hidden;
margin: 0px;
padding: 0px;
background: white;
} div:first-child {
margin-top: 0px;
} div {
cursor: pointer;
text-align: center;
padding: 1px 3px;
font-family: sans-serif;
font-size: 0.8em;
width: 100px;
margin-top: 1px;
background: #cccccc;
} div:hover {
background: #aaaaaa;
} #red {
border: 1px solid red;
color: red;
} #blue {
border: 1px solid blue;
color: blue;
} #green {
border: 1px solid green;
color: green;
} #yellow {
border: 1px solid yellow;
color: yellow;
}

Jira & SVN & Chrome extensions的更多相关文章

  1. Best Chrome Extensions

    Best Chrome Extensions chrome://extensions/ # ghelper chrome-extension://cieikaeocafmceoapfogpffaalk ...

  2. Chrome Extensions API & options

    Chrome Extensions API options https://developer.chrome.com/extensions https://developer.chrome.com/e ...

  3. chrome extensions & debug

    chrome extensions & debug debug background.js debug popup.js debug content_script.js chrome.stor ...

  4. Do Chrome extensions access iframes? chrome扩展插件访问所有iframes

    32down voteaccepted Yes, a Chrome Extension "content script" can run in all iframes (that ...

  5. chrome extensions notifications

    developer.chrome.comhttps://developer.chrome.com/extensions/notifications notification | MDNhttps:// ...

  6. 【解决Jira】Chrome提示Java插件因过期而遭到阻止(JIRA上传截屏截图)

    最近经常被这个问题所困扰:用Chrome访问JIRA上传截屏截图时,地址栏下面弹出通知,提示JAVA插件已过期.但是由于公司要求统一开发环境和设置,不能更新到最新版,就像这样: 结果网页上的Java就 ...

  7. chrome extensions

        chrome web store   AppsGamesExtensionsThemes   CATEGORIES   All FEATURESClear   Runs Offline By ...

  8. Chrome插件(Extensions)开发攻略

    本文将从个人经验出发,讲述为什么需要Chrome插件,如何开发,如何调试,到哪里找资料,会遇到怎样的问题以及如何解决等,同时给出一个个人认为的比较典型的例子——获取网页内容,和服务器交互,再把信息反馈 ...

  9. Re-enable extensions not coming from Chrome Web Store on Chrome v35+ (with enhanced security)

    1. Add the --enable-easy-off-store-extension-install flag when you start chrome (create shortcut, ed ...

随机推荐

  1. 小程序开发-11-Promise正确用法与函数签名设计技巧

    配置taBar "tabBar": { "selectedColor": "#000000", "backgroundColor& ...

  2. 给无符号数赋值负数(有符号数)的理解(unsigned\signedf)

    无符号数赋负数(有符号数)就类似于给字符型变量赋数值(char word=0x56),对相同的值不同的类型解析 //s16:signed short; u16:unsigned short s16 t ...

  3. 20154327 Exp7 网络欺诈防范

    基础问题回答 (1)通常在什么场景下容易受到DNS spoof攻击. 乱连公共场合的免费WiFi容易受到攻击,比如酒店.商场的免费WiFi (2)在日常生活工作中如何防范以上两攻击方法 对于第一种,我 ...

  4. APP支付 + 退款(JAVA实现)

    首先,你得先有微信开发平台账号密码还需要开通应用,然后还有微信服务商平台商户版账号(这些我都是给产品经理拿的) 其次我认为你先去看一看微信开发平台的文档!  https://pay.weixin.qq ...

  5. Prism for WPF 搭建一个简单的模块化开发框架(四)异步调用WCF服务、WCF消息头添加安全验证Token

    原文:Prism for WPF 搭建一个简单的模块化开发框架(四)异步调用WCF服务.WCF消息头添加安全验证Token 为什么选择wcf?   因为好像wcf和wpf就是哥俩,,, 为什么选择异步 ...

  6. 成都Uber优步司机奖励政策(2月19日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  7. 天津Uber优步司机奖励政策(1月4日~1月10日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  8. c/c++链表的实现

    #include<iostream> #include<string> #define SIZE 3 using std::cout; using std::endl; usi ...

  9. springboot整合kafka应用

    1.kafka在消息传递的使用非常普遍,相对于activemq来说kafka的分布式管理和使用更加灵活. 2.activemq的搭建和使用可以参考: activemq搭建和springmvc的整合:h ...

  10. MyBatis-参数处理

    1.单个参数 mybatis不会做特殊处理. #{参数名/任意名}:取出参数值. 2.多个参数 mybatis会做特殊处理. 多个参数会被封装成 一个map. key:param1...paramN, ...