// ==UserScript== // @name LZTCommentLink // @namespace MeloniuM/LZT // @version 1.3 // @description Add clickable link on comment date // @author MeloniuM // @license MIT // @match http*://zelenka.guru/* // @match http*://lolz.live/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; if (!$('.thread_view, .member_view').length) return;//включаем только в темах и в профиле let profile = false; if ($('.member_view').length) profile = true; //в профиле не подключён https://zelenka.guru/js/lolzteam/thread_improvements/core.min.js поэтому назначим функцию сами. if (XenForo.animateBackgroundColor == undefined){ XenForo.animateBackgroundColor = function(e) { var t = e.css("background-color"); e.animate({ backgroundColor: "rgb(45,45,45)" }, 300, function() { setTimeout(function() { e.animate({ backgroundColor: t }, 300) }, 2e3) }) } } function addLink(elem){ const link = location.origin + location.pathname + '#' + $(elem).closest('.comment').attr('id'); $(elem).wrap(''); $(elem).on('click', function(event){ event.preventDefault(); const $target = $(event.target).closest('a.messageDateInBottom'); if (profile){//в профилях ссылка динамическая, поэтому просто копируем в буфер Clipboard.copy(encodeURI($target[0].href), $target[0]); return; } let html = '