RobloxDev to Roblox Wiki API Reference

Adds a button to view the API reference on the Roblox Wiki instead of RobloxDev

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name     RobloxDev to Roblox Wiki API Reference
// @description Adds a button to view the API reference on the Roblox Wiki instead of RobloxDev
// @version  1.3
// @grant    none
// @match  *://www.robloxdev.com/api-reference/*
// @namespace Blupo
// ==/UserScript==

(function () {
	"use strict";
	
	var buttonAlreadyExists = document.getElementById("robloxwiki-btn");
	if (buttonAlreadyExists) { return true };
	
	var text = "View on the Roblox Wiki";
	
	var button = document.createElement("a");
	button.setAttribute("class", "btn secondary-btn");
	button.setAttribute("id", "robloxwiki-btn");
	button.setAttribute("style", "border-radius: 2px; color: #00a2ff;");
	button.setAttribute("href", "https://wiki.roblox.com/index.php?title=API:Class/" + window.location.href.match('api\-reference\/(property|class|event|function|callback)\/(.+)')[2] + "&studiomode=true");
	
	var buttonText = document.createTextNode(text);
	button.appendChild(buttonText);
	
	var apiContent = document.getElementsByClassName("api-content")[0];
	if (!apiContent) { return true };
	
	apiContent.insertAdjacentElement("beforebegin", button);
}());