Gfycator 500+

Dodatkowy przycisk ułatwiający szybką konwersję gifów lub obrazków do postaci gfycatów

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Gfycator 500+
// @version      1.0
// @description  Dodatkowy przycisk ułatwiający szybką konwersję gifów lub obrazków do postaci gfycatów
// @author       tRNA
// @license      GNU AGPLv3
// @match        http://*.wykop.pl/*
// @namespace    https://greasyfork.org/pl/users/56863
// @grant        none
// ==/UserScript==
    $(document).ready(function() {
        function Main() {
            $("#ButtonGfycat").remove();
            $(".nospace").find(".selectUrl").find("p").find("a").after('<button id="ButtonGfycat" type="button" class="button" tabindex="2"><i id="loading" class="fa fa-spinner fa-spin" style="display: none"></i>Gfycatuj</button>');
            document.getElementById('ButtonGfycat').onclick = function() {
                $("#loading").show();
                var SingleValues = $("input[name='url']").val();
                var StatusResponse;
                $.getJSON('http://upload.gfycat.com/transcode?fetchUrl=' + SingleValues, function(jd) {
                    if (jd.error !== undefined) {
                        StatusResponse = 'Błąd: ' + jd.error;
                    } else {
                        StatusResponse = 'https://gfycat.com/' + jd.gfyname;
                    }
                    $("input[name='url']").val(StatusResponse);
                    $("#loading").hide();
                });
            };
        }
        function ClickEvent() {
            $("fieldset.row.buttons.dnone").on("click", "a.button.openAddMediaOverlay", function(e) {
                setTimeout(Main, 10);
            });
        }
        $("div.row.elements.actions").on("click", " a.affect.btnReply", function(e) {
            setTimeout(ClickEvent, 10);
        });
        $("fieldset.row.buttons.dnone").on("click", "a.button.openAddMediaOverlay", function(e) {
            setTimeout(Main, 10);
        });
        $(document).ajaxComplete(function() {
            $("div.row.elements.actions").on("click", " a.affect.btnReply", function(e) {
                setTimeout(ClickEvent, 10);
            });
        });
    });