Gitlab 集成 event

集成自动勾选所有选择复选 event

  1. // ==UserScript==
  2. // @name Gitlab 集成 event
  3. // @namespace mouyong
  4. // @description 集成自动勾选所有选择复选 event
  5. // @match https://git.cblink.net/*/hooks*
  6. // @match https://git.cblink.net/*/settings/integrations
  7. // @match https://git.cblink.net/*/*/merge_requests/*
  8. // @license LGPL
  9. // @grant none
  10. // @version 0.0.1.20191014053154
  11. // ==/UserScript==
  12. document.querySelectorAll("input[name*='events']").forEach(function (_) {
  13. _.setAttribute('checked', true);
  14. });
  15.  
  16. function addPubliskLink() {
  17. var currentSection = document.querySelector('.mr-info-list');
  18. if (currentSection === null) return;
  19. var publishLink = document.createElement("a");
  20. publishLink.setAttribute('href', location.href.substring(0, location.href.indexOf('merge_requests'))+'compare');
  21. publishLink.innerText = '发布到正式分支';
  22. publishLink.style.marginRight = '10px';
  23. var walleLink = document.createElement("a");
  24. walleLink.setAttribute('href', 'http://walle.cblink.net/task/submit/');
  25. walleLink.innerText = '前往瓦力部署';
  26. walleLink.style.marginRight = '10px';
  27.  
  28. var piplinLink = document.createElement("a");
  29. piplinLink.setAttribute('href', 'http://piplin.tongxinghui.com/deploy-plan/1');
  30. piplinLink.innerText = '前往 piplin 部署';
  31. piplinLink.style.marginRight = '10px';
  32. currentSection.appendChild(publishLink);
  33. currentSection.appendChild(walleLink);
  34. currentSection.appendChild(piplinLink);
  35. }
  36.  
  37. window.onload = function () {
  38. addPubliskLink();
  39. }