User:Gangleri/monobook.js
维基百科,自由的百科全书
注意:在保存以后,您必须清除浏览器的缓存才能看到所作出的改变:
- Mozilla: 点击刷新(或ctrl-r), IE / Opera: ctrl-f5, Safari: cmd-r, Konqueror ctrl-r。
// Live Preview customization, // edit this to your own liking. wpShowImages = true; // Enable downloading and displaying of images // Include Live Preview... document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>'); // Now set everything up window.onload = Main; function Main() { LivePreviewInstall(); // You may include here other "extensions" } /* This is to keep track of who is using the Live Preview: [[User:Pilaf/livepreview.js]] */ function bidiSwitchSetup() { var editform = document.getElementById("editform"); if (editform == null) { return; } bidiAddButton(editform, "Default", function(style) { style.direction = "inherit"; style.unicodeBidi = "inherit"; }); bidiAddButton(editform, "dir=ltr", function(style) { style.direction = "ltr"; }); bidiAddButton(editform, "dir=rtl", function(style) { style.direction = "rtl"; }); bidiAddButton(editform, "bidi=normal", function(style) { style.unicodeBidi = "normal"; }); bidiAddButton(editform, "bidi=override", function(style) { style.unicodeBidi = "bidi-override"; }); } function bidiAddButton(before, label, action) { var button = document.createElement("input"); button.type = "button"; button.value = label; button.onclick = function(event) { var box = document.getElementById("wpTextbox1"); if (box == null) { alert("Broken! Edit box missing."); } else { //var style = document.getOverrideStyle(box, null); var style = box.style; action(style); } } before.parentNode.insertBefore(button, before); } hookEvent('load', bidiSwitchSetup);