User:Till034/GW2WikiToolbar.js

From Guild Wars 2 Wiki
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// <nowiki>
var button = {
        "imageFile": "images/e/e1/User_Till034_button-gold.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "gold icon", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{gold}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button);

var button2 = {
        "imageFile": "images/0/00/User_Till034_button-silver.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "silver icon", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{silver}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button2);

var button3 = {
        "imageFile": "images/7/79/User_Till034_button-bronze.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "bronze icon", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{bronze}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button3);

var button4 = {
        "imageFile": "images/9/9f/User_Till034_button-karma.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "karma icon", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{karma}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button4);

var button5 = {
        "imageFile": "images/d/d7/User_Till034_button-exp.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "exp icon", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{experience}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button5);


var button6 = {
        "imageFile": "images/f/f5/User_Till034_button-br.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "new line", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "<br>", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button6);

var button7 = {
        "imageFile": "images/e/e2/User_Till034_button-npc.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "NPC infobox", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{NPC infobox\n| race = \n| level = NA\n| region = NA\n}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button7);

var button8 = {
        "imageFile": "images/3/3e/User_Till034_button-item.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "Item infobox", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{Item infobox\n| rarity =\n| type =\n| value =\n}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button8);

var button9 = {
        "imageFile": "images/5/56/User_Till034_button-skill.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "Skill infobox", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "{{Skill infobox\n| description =\n| recharge=\n| profession = \n| slot = \n| twohand = \n| weapon_slot =\n}}", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button9);


var button10 = {
        "imageFile": "images/e/eb/User_Till034_button-DPL-type.png", // image to be shown on the button (may be a full URL too),22x22 pixels
        "speedTip": "Type listing DPL for NPC type pages e.g. Bat", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "<DPL>\ncategory=\nuses=Template:NPC infobox\nsuppresserrors=yes\n</DPL>", // the text to use to mark the beginning of the block
        "tagClose": "",      // the text to use to mark the end of the block (if any)
        "sampleText": ""  // the sample text to place inside the block
};
mwCustomEditButtons.push(button10);

var a = document.getElementById("mw-htmlform-description");

if(a){
	var row = document.createElement("tr");
	var td = document.createElement("td");

	
	var a1 = document.createElement("a");
	var a1_text = document.createTextNode("User image");
	a1.setAttribute("href","javascript:userImageTag()");
	a1.setAttribute("style","margin:10px;");
	a1.appendChild(a1_text);
	
	var a2 = document.createElement("a");
	var a2_text = document.createTextNode("ArenaNet image icon");
	a2.setAttribute("href","javascript:arenaNetImageIcon()");
	a2.setAttribute("style","margin:10px;");
	a2.appendChild(a2_text);

	td.appendChild(a1);
	td.appendChild(a2);
	row.appendChild(td);
	
	a.childNodes[0].insertBefore(row, a.childNodes[0].childNodes[4]); 

	function userImageTag() {
		var a = document.getElementById("wpUploadDescription");
		var user = document.getElementById("pt-userpage").childNodes[0].childNodes[0].data;
		a.innerHTML = a.innerHTML+"{{User image|"+user+"}}\n";
	}

	function arenaNetImageIcon() {
		var a = document.getElementById("wpUploadDescription");
		a.innerHTML = a.innerHTML+"{{Arenanet image|icon}}\n";
	}

}
// </nowiki>