Greasy Fork is available in English.

MRQZ deploy URL helper

try to take over the world!

Verze ze dne 24. 03. 2021. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name MRQZ deploy URL helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://gitlab.com/marquiz/*/-/merge_requests/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var info = window.location.pathname.split('/')
  15. var repName = info[2]
  16. var label = '`' + repName + '` '
  17. var deployUrl = 'https://deploy-preview-' + info.reverse()[0] + '--marquiz-'+ repName +'.netlify.app/\n\n'
  18.  
  19. var text = label + window.location.href + ' \n \r '
  20. text += label + deployUrl
  21. navigator.clipboard.writeText(text)
  22.  
  23. var descriptionBlock = document.querySelector('.detail-page-description .qa-description .md p')
  24. if(!descriptionBlock) return
  25.  
  26. descriptionBlock.innerText = text + descriptionBlock.innerText
  27. descriptionBlock.innerHTML = '<button class="btn gl-button"><a href=' + deployUrl +
  28. ' target="_blank"> Открыть деплой в новой вкладке </a></button><br><br>' +
  29. descriptionBlock.innerHTML
  30.  
  31. })();