MediaWiki:Gadget-ToolboxTray.js: Difference between revisions
Page last edited 5 months ago by Xeverything11
rm unneeded |
another |
||
Line 24: | Line 24: | ||
var TTMyContributionsIcon = document.createElement("div"); | var TTMyContributionsIcon = document.createElement("div"); | ||
var TTMyContributionsText = document.createElement("div"); | var TTMyContributionsText = document.createElement("div"); | ||
var TTSpecialPagesContainer = document.createElement("a"); | |||
var TTSpecialPagesIcon = document.createElement("div"); | |||
var TTSpecialPagesText = document.createElement("div"); | |||
TTRecentChangesContainer.className = "toolbox-container"; | TTRecentChangesContainer.className = "toolbox-container"; | ||
Line 31: | Line 35: | ||
TTMyContributionsIcon.className = "toolbox-icon"; | TTMyContributionsIcon.className = "toolbox-icon"; | ||
TTMyContributionsText.className = "toolbox-text"; | TTMyContributionsText.className = "toolbox-text"; | ||
TTSpecialPagesContainer.className = "toolbox-container"; | |||
TTSpecialPagesIcon.className = "toolbox-icon"; | |||
TTSpecialPagesText.className = "toolbox-text"; | |||
TTRecentChangesContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:RecentChanges'); | TTRecentChangesContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:RecentChanges'); | ||
Line 38: | Line 45: | ||
TTMyContributionsIcon.textContent = "history"; | TTMyContributionsIcon.textContent = "history"; | ||
TTMyContributionsText.textContent = "My contribs"; | TTMyContributionsText.textContent = "My contribs"; | ||
TTSpecialPagesContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:SpecialPages'); | |||
TTSpecialPagesIcon.textContent = "description"; | |||
TTSpecialPagesText.textContent = "Special pages"; | |||
toolboxTray.append(TTRecentChangesContainer); | toolboxTray.append(TTRecentChangesContainer); | ||
Line 45: | Line 55: | ||
TTMyContributionsContainer.append(TTMyContributionsIcon); | TTMyContributionsContainer.append(TTMyContributionsIcon); | ||
TTMyContributionsContainer.append(TTMyContributionsText); | TTMyContributionsContainer.append(TTMyContributionsText); | ||
toolboxTray.append(TTSpecialPagesContainer); | |||
TTSpecialPagesContainer.append(TTSpecialPagesIcon); | |||
TTSpecialPagesContainer.append(TTSpecialPagesText); |
Revision as of 11:04, 14 April 2025
// Define toolbox tray container
var mwWrapper = document.getElementById("mw-wrapper");
var toolboxTrayContainer = document.createElement("div");
var toolboxTrayButton = document.createElement("button");
var toolboxTrayButtonInner = document.createElement("div");
var toolboxTray = document.createElement("div");
toolboxTrayContainer.id = "toolboxTrayContainer";
toolboxTrayButton.id = "toolboxTrayButton";
toolboxTrayButtonInner.id = "toolboxTrayButtonInner";
toolboxTrayButton.setAttribute('onclick','toggleToolboxTray()');
toolboxTray.id = "toolboxTray";
toolboxTrayButtonInner.textContent = "<";
mwWrapper.append(toolboxTrayContainer);
toolboxTrayContainer.append(toolboxTrayButton);
toolboxTrayButton.append(toolboxTrayButtonInner);
toolboxTrayContainer.append(toolboxTray);
// Define links
var TTRecentChangesContainer = document.createElement("a");
var TTRecentChangesIcon = document.createElement("div");
var TTRecentChangesText = document.createElement("div");
var TTMyContributionsContainer = document.createElement("a");
var TTMyContributionsIcon = document.createElement("div");
var TTMyContributionsText = document.createElement("div");
var TTSpecialPagesContainer = document.createElement("a");
var TTSpecialPagesIcon = document.createElement("div");
var TTSpecialPagesText = document.createElement("div");
TTRecentChangesContainer.className = "toolbox-container";
TTRecentChangesIcon.className = "toolbox-icon";
TTRecentChangesText.className = "toolbox-text";
TTMyContributionsContainer.className = "toolbox-container";
TTMyContributionsIcon.className = "toolbox-icon";
TTMyContributionsText.className = "toolbox-text";
TTSpecialPagesContainer.className = "toolbox-container";
TTSpecialPagesIcon.className = "toolbox-icon";
TTSpecialPagesText.className = "toolbox-text";
TTRecentChangesContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:RecentChanges');
TTRecentChangesIcon.textContent = "schedule";
TTRecentChangesText.textContent = "Recent changes";
TTMyContributionsContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:MyContributions');
TTMyContributionsIcon.textContent = "history";
TTMyContributionsText.textContent = "My contribs";
TTSpecialPagesContainer.setAttribute('href','https://howto.skywiki.org/wiki/Special:SpecialPages');
TTSpecialPagesIcon.textContent = "description";
TTSpecialPagesText.textContent = "Special pages";
toolboxTray.append(TTRecentChangesContainer);
TTRecentChangesContainer.append(TTRecentChangesIcon);
TTRecentChangesContainer.append(TTRecentChangesText);
toolboxTray.append(TTMyContributionsContainer);
TTMyContributionsContainer.append(TTMyContributionsIcon);
TTMyContributionsContainer.append(TTMyContributionsText);
toolboxTray.append(TTSpecialPagesContainer);
TTSpecialPagesContainer.append(TTSpecialPagesIcon);
TTSpecialPagesContainer.append(TTSpecialPagesText);