MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

// For testing purposes TBL_GROUP = "roblox-en";

// Generating message on RW:DCP (Thundermaker300) function setGeneratedMessage { var sender = document.getElementById("messageGeneratorSenderName"); var name = document.getElementById('messageGeneratorName'); var gameName = document.getElementById('messageGeneratorGameName'); var url = document.getElementById('messageGeneratorGameUrl'); var place = document.getElementById('generatedMessage'); var copy = document.getElementById("generatorCopyToClipboard"); var includeUrl = document.getElementById("messageGeneratorPageExists"); var includeFeatured = document.getElementById("messageGeneratorIncludeFeatured"); place.innerHTML = "Hello, " + name.value + ". My name is " + sender.value + ".  I am an administrator on the [Roblox Wikia](http://roblox.wikia.com), an unofficial encyclopedia for all things Roblox.  We realized that our wiki was separated from the developer community, and as such we made [this announcement](https://roblox.wikia.com/wiki/Thread:265172).  We are working on creating a developer connection with our wiki, so that we can get the developer's side of things.  We are looking for your feedback on " + gameName.value + " development.  " + (includeUrl.checked ? "The current " + gameName.value + " page on the Roblox Wikia can be found [here](" + url.value + ")." : "We currently do not have a page for " + gameName.value + ".  However, we plan on making one after the interview.") +  "  If you have a few moments, we'd like you to answer the following questions regarding the development of " + gameName.value + ". 1. What was it like developing " + gameName.value + "? 2. What challenges did you have to overcome while developing? What was the most challenging? 3. What did you enjoy most while developing " + gameName.value + "? 4. " + (includeFeatured.checked ? "What was it like to develop a game that was featured in an official Roblox event? 5. Is there anything else you'd like to share?" : "Is there anything else you'd like to share?") + " If you'd like to join the Roblox Wikia community, our discord server can be found [here](http://discord.gg/Dj6Au47). Thank you for your time. ~Thundermaker300" copy.style.display = "block"

}

function copyGeneratedMessage { var element = document.getElementById("generatedMessage") const el = document.createElement('textarea') el.value = element.innerText; el.setAttribute('readonly', ''); el.style.position = 'absolute'; el.style.left = '-9999px'; document.body.appendChild(el); el.select; document.execCommand('copy'); document.body.removeChild(el); var success = document.getElementById("copySuccess") success.style.display = "block" setTimeout(function {       success.style.display = "none"    },1500) }

window.onload = function { var elem = document.getElementById("messageGenerator"); if(elem !== null) { elem.innerHTML = 'Fill out the following fields to generate a Roblox Wikia Development Feedback message:     Wiki Page Exists Include Featured Question  Copy Text Copied! ';		setGeneratedMessage }

};

// Import scripts for all users importArticles({   type: "script",    articles: [        "w:c:dev:InputUsername/code.js",        "w:c:dev:DisableBotMessageWalls/code.js"    ] });

// Import user group scripts (Mark Otaris) var ug = mw.config.get("wgUserGroups").join, group;

if     (/sysop/.test(ug))             group = "sysop"; else if (/content-moderator/.test(ug)) group = "content-moderator"; else if (/autoconfirmed/.test(ug))    group = "autoconfirmed";

if (group) importScript("MediaWiki:Group-" + group + ".js");