Teams Tag Comment [GTP]

Script permettant d'ajouter un tag sur chaque commentaire et de citer l'auteur de celui-ci.

  1. // ==UserScript==
  2. // @name Teams Tag Comment [GTP]
  3. // @namespace https://realitygaming.fr/
  4. // @version 1.0
  5. // @description Script permettant d'ajouter un tag sur chaque commentaire et de citer l'auteur de celui-ci.
  6. // @author Rivals GTP
  7. // @match https://realitygaming.fr/teams/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. $(document).ready(function(){
  12. $("<style type='text/css'> .tagComment { color: #9e9e9e; } .tagComment:hover { -webkit-transform: rotate(400deg); -ms-transform: rotate(400deg); transform: rotate(400deg); -webkit-transform: rotate(400deg); -moz-transform: rotate(400deg); -ms-transform: rotate(400deg); -o-transform: rotate(400deg); transition: all 0.35s; -webkit-transition: all 0.35s; -moz-transition: all 0.35s; -ms-transition: all 0.35s; -o-transition: all 0.35s; cursor: pointer; color: #3C7C95; } </style>").appendTo("head");
  13. $('.messageContent .username[dir=auto]').before('<i class="fa fa-tag tagComment" aria-hidden="true"></i>');
  14.  
  15. var tagComment = $('.tagComment');
  16.  
  17. tagComment.click(function(){
  18. var authorCommentUsername = $(this).parent().children()[1].text;
  19. var postComment = $('textarea[placeholder="Poster un commentaire..."]');
  20.  
  21. if(postComment.val() !== '') {
  22. postComment.val(postComment.val() + '@' + authorCommentUsername + ' ');
  23. postComment.focus();
  24. }
  25.  
  26. else {
  27. postComment.val('@' + authorCommentUsername + ' ');
  28. postComment.focus();
  29. }
  30. });
  31.  
  32. });