請先看『使用說明』
MediaWiki:Common.js
From LEXWiKi
Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: 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.
/* 此處的JavaScript將載入於所有用戶每一個頁面。 */ /** Extra toolbar options ****************************************************** * * Description: UNDOCUMENTED * Maintainers: [[User:MarkS]]?, [[User:Voice of All]], [[User:R. Koot]] */ //This is a modified copy of a script by User:MarkS for extra features added by User:Voice of All. // This is based on the original code on Wikipedia:Tools/Editing tools // To disable this script, add <code>mwCustomEditButtons = [];<code> to [[Special:Mypage/monobook.js]] if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": "<s>", "tagClose": "</s>", "sampleText": "Strike-through text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": "<br />", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png", "speedTip": "Superscript", "tagOpen": "<sup>", "tagClose": "</sup>", "sampleText": "Superscript text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png", "speedTip": "Subscript", "tagOpen": "<sub>", "tagClose": "</sub>", "sampleText": "Subscript text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png", "speedTip": "Small", "tagOpen": "<small>", "tagClose": "</small>", "sampleText": "Small Text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/7/70/Button_comment.jpg", "speedTip": "Insert hidden Comment", "tagOpen": "<!-- ", "tagClose": " -->", "sampleText": "Comment"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png", "speedTip": "Insert a picture gallery", "tagOpen": "\n<gallery>\n", "tagClose": "\n</gallery>", "sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png", "speedTip": "Insert block of quoted text", "tagOpen": "<blockquote>\n", "tagClose": "\n</blockquote>", "sampleText": "Block quote"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Button_FAQ.png", "speedTip": "Insert a FAQ table", "tagOpen": "=== ", "tagClose": " ===\n{|\n!bgcolor = #ccccff width=\"50\" align=\"center\"|Ans:\n!bgcolor = #F3F3F3 width=\"100%\" align=\"left\"|\n\"write the answers\"\n|-\n!bgcolor = #ccccff |Patch File:\n!bgcolor = #F3F3F3 align=\"left\"|\n\"write Patch File\"\n|-\n!bgcolor = #ccccff |Defect:\n!bgcolor = #F3F3F3 align=\"left\"|\n\"write Defect\"\n|-\n!bgcolor = #ccccff |Asker:\n!bgColor = #F3F3F3 align=\"left\"|\n\"writ Asker & date\"\n|-\n!bgcolor = #ccccff |Provider:\n!bgColor = #F3F3F3 align=\"left\"|\n\"writ Provider & date\"\n|-\n|}", "sampleText": "Input a question"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Button_AllowPages.png", "speedTip": "Allow Page", "tagOpen": "[[Category:AllowPages]]", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Btn_toolbar_enum.png", "speedTip": "insert 1, 2 ,3, ......", "tagOpen": "#", "tagClose": "", "sampleText": "what you write"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Btn_toolbar_liste.png", "speedTip": "insert *, *, *, .......", "tagOpen": "*", "tagClose": "", "sampleText": "what you write"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Button_center.png", "speedTip": "let something locate center in the page", "tagOpen": "<center>", "tagClose": "</center>", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://tprd.info/lexwiki/images/pic/Button_shifting.png", "speedTip": "Shift 4 units", "tagOpen": " ", "tagClose": "", "sampleText": ""}; } /* externalLinks = function() { if (!document.getElementsByTagName) { return; } var anchors = document.getElementsByTagName("a"); for (var i = 0; i < anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") != null && (anchor.getAttribute("rel").indexOf("external") >= 0 || anchor.getAttribute("rel").indexOf("nofollow") >= 0) ) { anchor.target = "_blank"; } } } if (window.addEventListener) { window.addEventListener("load", externalLinks, false); } else if (window.attachEvent) { window.attachEvent("onload", externalLinks); } */