User:Guillom/monobook.js

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
  • Konqueror: simply click the Reload button, or press F5;
  • Opera users may need to completely clear their cache in Tools→Preferences.
/*  <pre><nowiki> */
document.write('<script type="text/javascript" src="' 
             + 'http://fr.wikipedia.org/w/index.php?title=Utilisateur:GôTô/objects.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// ======================================================================================
// Deluxe bar piquée à Dake & GôTô - adapted from http://fr.wikipedia.org/wiki/Utilisateur:Guillom/monobook/deluxeBar.js
// ======================================================================================

function setSummary(str)
{
	document.editform.wpSummary.value = str
}

function DeluxeBar()
{
	if (document.createTextNode)
	{
		var toolbar = document.getElementById("toolbar")
		if (!toolbar)
			return
	
		///// zone personnalisable ////

		// Response header with "modified" status
                img = document.createElement("img")
                img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png")
                ref = document.createElement("a")
		ref.setAttribute("href", "javascript:insertTags(\'' + '<source ' + 'lang=' + '"latex">'" + "setSummary(\"" + "latex source" + "\");" );
                ref.setAttribute("title", "latex source")
                ref.appendChild(img)
                toolbar.appendChild(ref)

		// Response footer
                img = document.createElement("img")
                img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/commons/2/21/Button_invalid_template.png")
                ref = document.createElement("a")
		ref.setAttribute("href", "javascript:insertTags(\"" + "</source>", '', '');");
                ref.setAttribute("title", "end source")
                ref.appendChild(img)
                toolbar.appendChild(ref)


	}
}

$(DeluxeBar);

/* </nowiki></pre> */