ETN Ticketing custom script

pro ticketing

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/8030/36430/ETN%20Ticketing%20custom%20script.js

  1. // ==UserScript==
  2. // @name ETN Ticketing custom script
  3. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
  4. // @author Milan K.
  5. // @include https://ticket.etnetera.cz/*
  6. // @version 1
  7. // ==/UserScript==
  8.  
  9.  
  10. /*
  11. --// Changelog //--
  12. 10.8.2011 - Verze 1
  13. - skript obsahuje funkcionalitu predesleho skriptu s vyuzitim jQuery (krome zakomentovanych casti)
  14. */
  15.  
  16.  
  17. // definice promennych
  18. var userName = 'JSz'; //jmeno uzivatele
  19.  
  20. // definice barev
  21. var col_pink = '#ff8888';
  22. var col_red = '#ff0000';
  23. var col_green = '#00ff00';
  24. var col_grey = '#666666';
  25.  
  26. $(document).ready(function(){
  27. // Notes - prevod textu na klikatelne odkazy
  28. $('.noteText').each(function(){
  29. var txt_original = $(this).html();
  30. $(this).html(replaceHTMLlinks($(this).html()));
  31. $(this).html(replaceBUGlinks($(this).html()));
  32. $(this).html(replaceTICKETlinks($(this).html()));
  33. });
  34. // Ticket info - zvyrazneni nevyplnene hodnoty Product
  35. $('#ticketInfo .form th').each(function(){
  36. if ($(this).html() == 'Product:'){
  37. var productVal = $(this).parent().find('td');
  38. if (productVal.html() == ''){
  39. productVal.css('background', col_pink);
  40. }
  41. }
  42. });
  43. // 'lepsi' citelnost nekterych udaju
  44. $('.TITLE, .HANDLERTAG, .type, .REFERENCE, .assignee').css('font-family', 'monospace');
  45. // barevne odliseni garancnich a projektovych tiketu
  46. $('td.type:contains("Gar"), td:contains("Fau")').css('color', col_red);
  47. $('td.type:contains("Pro")').css('color', col_green);
  48.  
  49. // barevne odliseni tiketu supportaka, ktere jsou predane dal do vyroby
  50. $('td.TITLE:contains("::")').css('color', col_red);
  51. // klikatelne tikety ve vyuctovani
  52. $('td[class=""]').each(function(){
  53. if ($(this).html().match(/^[A-Za-z2]{2,3}\d{5,6}$/)){
  54. $(this).html('<a target="_blank" href="/support/showTicket/' + $(this).html() + '">' + $(this).html() + '</a>');
  55. }
  56. });
  57.  
  58. // na zaklade uzivatelova 3-pismenneho ETN id zvyraznuje v urcitych prehledech prislusne tikety
  59. $('td.HANDLERTAG').each(function(){
  60. var curElm = $(this).find(':first-child').data.match(userName);
  61. curElm.css('color', col_grey);
  62. });
  63.  
  64. $('td.assignee').each(function(){
  65. var curElm = $(this).find(':first-child').data.match(userName);
  66. curElm.css('color', col_red);
  67. });
  68. // SUPPORT - tikety, ktere jsou assignovane jinemu oddeleni
  69. $('td.TITLE').each(function(){
  70. var curElm = $(this).find(':first-child').data.match('::');
  71. curElm.css('color', col_red);
  72. });
  73. });
  74.  
  75. // FUNKCE
  76. // konverze textovych URL na klikatelne odkazy
  77. function replaceHTMLlinks(text){
  78. var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
  79. return text.replace(exp, "<a target='_blank' href='$1'>$1</a>");
  80. }
  81.  
  82. // konverze textovych bugu na klikatelne odkazy do Bugzilly
  83. function replaceBUGlinks(text){
  84. var exp = /([^\w]+)(BUG[u# ]{0,3})(\d{1,6})([^\w]+)/ig;
  85. return text.replace(exp, "$1<a href='http://bugzilla.etnetera.cz/show_bug.cgi?id=$3'>$2$3</a>$4");
  86. }
  87.  
  88. // konverze textovych tiketu na klikatelne odkazy
  89. function replaceTICKETlinks(text){
  90. var exp = /([^\w\/>]+)(TICKET#)?([A-Z]{2,3}\d{5,6})([^\w]+)/ig;
  91. return text.replace(exp, "$1<a target='_blank' href='https://ticket.etnetera.cz/support/showTicket/$3'>#$3</a>$4");
  92. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址