Guzik

jsfoidfsdgs

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

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name       Guzik
// @version    0.0.1
// @description jsfoidfsdgs
// @match      https://ufs.pt/index.php?threads*
// @require    https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
// @namespace https://greasyfork.org/users/1254921
// ==/UserScript==

(function() {
    const css = `
        .wheatButton {
            padding: 5px 10px;
            display: inline-block;
            color: black !important;
            font-size: 11px;
            font-weight: bold;
            font-variant: small-caps;
            text-decoration: none !important;
            background-color: #606060;
            border-radius: 2px;
            cursor: pointer;
            -webkit-font-smoothing: antialiased;
            box-sizing: border-box;
            box-shadow: -2px 2px 1px black;
            border: 1px solid #1b1b1b;
            transition: all 250ms;
            position: fixed;
            right: 5px;
            z-index: 9999; 
        }
        .wheatButton:hover {
            background-color: #1b1b1b;
            color: #d35400 !important;
            box-shadow: -4px 4px 5px black !important;
            border: 1px solid #606060;
            transition: all 250ms;
        }
    `;

    // Add styles to the page
    const node = document.createElement("style");
    node.type = "text/css";
    node.appendChild(document.createTextNode(css));
    document.head.appendChild(node);

    $(document).ready(function () {
        const buttonPositions = [
            { id: "PostTwo", text: "Edytuj Watek", top: 5 },
            { id: "sprawdzam", text: "Edytuj Post ", top: 33 },
        ];

        // Create and append buttons
        buttonPositions.forEach(button => {
            $("<a>", {
                "class": "wheatButton",
                text: button.text,
                id: button.id,
                value: "up",
                type: "button",
                style: `top: ${button.top}px;`
            }).appendTo("body");
        });

        $('#PostTwo').click(testy);
        $('#sprawdzam').click(sprawdzam);
        $('#stamp').click(stamp);


       function testy() {
  $('h4.menu-header:contains("Więcej opcji")').click();

  setTimeout(function() {
    const editLink = $('a.menu-linkRow:contains("Edytuj wątek")');
    if (editLink.length > 0) {
      window.location.href = editLink.attr('href'); 
    } else {
      console.error('error edit');
    }
  }, 500);
}

      function sprawdzam() {
  const editLink = $('a.actionBar-action.actionBar-action--edit').first();

  if (editLink.length > 0) {
    window.location.href = editLink.attr('href');
  } else {
    console.error('error sprawdzam');
  }
}

        function addHide() {
            $(".editpost").first().click();
            setTimeout(() => {
                const editor = $('.cke_enable_context_menu').first();
                editor.val('[hide] ' + editor.val() + '[/hide]');
                $("input[value='Zapisz']").first().click();
            }, 2000);
        }
    });
})();