GitLab Modify Project Desc Length

try to take over the worldGitLab Modify Project Desc Length!

  1. // ==UserScript==
  2. // @name GitLab Modify Project Desc Length
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description try to take over the worldGitLab Modify Project Desc Length!
  6. // @author Sean
  7. // @match http://192.168.0.200/fe3project/*
  8. // @icon http://192.168.0.200/assets/favicon-7901bd695fb93edb07975966062049829afb56cf11511236e61bcf425070e36e.png
  9. // @grant none
  10. // @run-at document-start
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. let tryTimes = 6;
  18. let changed = false;
  19.  
  20. // 增加项目描述的输入长度
  21. function modifyTextareaLen() {
  22. if(tryTimes > 0 && !changed) {
  23. setTimeout(() => {
  24. let textarea = document.getElementById('project_description');
  25. tryTimes--;
  26. if(textarea) {
  27. textarea.setAttribute("maxlength", "1000");
  28. changed = true;
  29. } else {
  30. modifyTextareaLen();
  31. }
  32. }, 1000);
  33. }
  34. }
  35.  
  36. window.onload = function() {
  37. modifyTextareaLen();
  38. }
  39. })();