Teams Tag Comment [GTP]

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Teams Tag Comment [GTP]
// @namespace    https://realitygaming.fr/
// @version      1.0
// @description  Script permettant d'ajouter un tag sur chaque commentaire et de citer l'auteur de celui-ci.
// @author       Rivals GTP
// @match        https://realitygaming.fr/teams/*
// @grant        none
// ==/UserScript==

$(document).ready(function(){
    $("<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");
    $('.messageContent .username[dir=auto]').before('<i class="fa fa-tag tagComment" aria-hidden="true"></i>');

    var tagComment = $('.tagComment');

    tagComment.click(function(){
      var authorCommentUsername = $(this).parent().children()[1].text;
      var postComment = $('textarea[placeholder="Poster un commentaire..."]');

      if(postComment.val() !== '') {
        postComment.val(postComment.val() + '@' + authorCommentUsername + ' ');
        postComment.focus();
      }

      else {
        postComment.val('@' + authorCommentUsername + ' ');
        postComment.focus();
      }
   });

});