Guzik

jsfoidfsdgs

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
        }
    });
})();