-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit-fandubbers.user.js
43 lines (37 loc) · 1.48 KB
/
edit-fandubbers.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ==UserScript==
// @name Shikimori edit fandubbers button
// @namespace http://tampermonkey.net/
// @version 2024-10-27
// @description Добавляет кнопку быстрого перехода на редактирование озвучки
// @author [email protected]
// @match *://shikimori.local/*
// @match *://shikimori.one/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=shikimori.one
// @downloadURL https://raw.githubusercontent.com/shikimori/userscripts/refs/heads/master/edit-external_links.user.js
// @updateURL https://raw.githubusercontent.com/shikimori/userscripts/refs/heads/master/edit-external_links.user.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
const $ = window.$;
$(document).on('turbolinks:load', ready);
ready();
function ready() {
if (!window.location.pathname.startsWith('/animes/')) { return; }
const $container = $('.b-subposter-actions');
if (!$container.length) { return; }
$('.b-subposter-action[data-userscript="fandubbers"]').remove();
$(`
<a
href="${$container.find('a.edit').attr('href')}/fandubbers"
class="b-subposter-action edit-alt b-tooltipped unprocessed"
title="Озвучка"
data-userscript="fandubbers"
data-direction="top"
>
</a>
`)
.appendTo($container)
.process();
}
})();