<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-Edittools.js</id>
	<title>MediaWiki:Gadget-Edittools.js - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-Edittools.js"/>
	<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MediaWiki:Gadget-Edittools.js&amp;action=history"/>
	<updated>2026-04-28T22:19:48Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=MediaWiki:Gadget-Edittools.js&amp;diff=3446&amp;oldid=prev</id>
		<title>2021年5月15日 (六) 18:47 Eijux</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MediaWiki:Gadget-Edittools.js&amp;diff=3446&amp;oldid=prev"/>
		<updated>2021-05-15T18:47:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年5月16日 (日) 02:47的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/**&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; * by eijux&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; * 2021/05/16&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; */&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/**&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/**&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * EditTools support: add a selector, change &amp;lt;a&amp;gt; into buttons.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * EditTools support: add a selector, change &amp;lt;a&amp;gt; into buttons.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=MediaWiki:Gadget-Edittools.js&amp;diff=3432&amp;oldid=prev</id>
		<title>Eijux：​建立内容为“/**  * EditTools support: add a selector, change &lt;a&gt; into buttons.  * The special characters to insert are defined at MediaWiki:Edittools.  *  * @author Arnom…”的新页面</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MediaWiki:Gadget-Edittools.js&amp;diff=3432&amp;oldid=prev"/>
		<updated>2021-05-15T17:54:24Z</updated>

		<summary type="html">&lt;p&gt;建立内容为“/**  * EditTools support: add a selector, change &amp;lt;a&amp;gt; into buttons.  * The special characters to insert are defined at &lt;a href=&quot;/MediaWiki:Edittools&quot; title=&quot;MediaWiki:Edittools&quot;&gt;MediaWiki:Edittools&lt;/a&gt;.  *  * @author Arnom…”的新页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * EditTools support: add a selector, change &amp;lt;a&amp;gt; into buttons.&lt;br /&gt;
 * The special characters to insert are defined at [[MediaWiki:Edittools]].&lt;br /&gt;
 *&lt;br /&gt;
 * @author Arnomane, 2006 (on the commons.wikimedia.org/wiki/MediaWiki:Edittools.js)&lt;br /&gt;
 * @author Kaganer, 2007 (adapting to www.mediawiki.org)&lt;br /&gt;
 * @author Krinkle, 2012&lt;br /&gt;
 * @source www.mediawiki.org/wiki/MediaWiki:Gadget-Edittools.js&lt;br /&gt;
 * @revision 2019-12-17&lt;br /&gt;
 */&lt;br /&gt;
/*jslint browser: true*/&lt;br /&gt;
/*global jQuery, mediaWiki*/&lt;br /&gt;
(function ($, mw) {&lt;br /&gt;
	&amp;quot;use strict&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	var conf, editTools, $sections;&lt;br /&gt;
&lt;br /&gt;
	conf = {&lt;br /&gt;
		initialSubset: window.EditTools_initial_subset === undefined ? window.EditTools_initial_subset : 0&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	editTools = {&lt;br /&gt;
&lt;br /&gt;
		/**&lt;br /&gt;
		 * Creates the selector&lt;br /&gt;
		 */&lt;br /&gt;
		setup: function () {&lt;br /&gt;
			var $container, $select, initial;&lt;br /&gt;
&lt;br /&gt;
			$container = $('#mw-edittools-charinsert');&lt;br /&gt;
			if (!$container.length) {&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
			$sections = $container.find('.mw-edittools-section');&lt;br /&gt;
			if ($sections.length &amp;lt;= 1) {&lt;br /&gt;
				// Only care if there is more than one&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			$select = $('&amp;lt;select&amp;gt;').css('display', 'inline');&lt;br /&gt;
&lt;br /&gt;
			initial = conf.initialSubset;&lt;br /&gt;
			if (isNaN(initial) || initial &amp;lt; 0 || initial &amp;gt;= $select.length) {&lt;br /&gt;
				initial = 0;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			$sections.each(function (i, el) {&lt;br /&gt;
				var $section, sectionTitle, $option;&lt;br /&gt;
&lt;br /&gt;
				$section = $(el);&lt;br /&gt;
				sectionTitle = $section.data('sectionTitle');&lt;br /&gt;
&lt;br /&gt;
				$option = $('&amp;lt;option&amp;gt;')&lt;br /&gt;
					.text(sectionTitle)&lt;br /&gt;
					.prop('value', i)&lt;br /&gt;
					.prop('selected', i === initial);&lt;br /&gt;
&lt;br /&gt;
				$select.append($option);&lt;br /&gt;
			});&lt;br /&gt;
&lt;br /&gt;
			$select.change(editTools.handleOnchange);&lt;br /&gt;
			$container.prepend($select);&lt;br /&gt;
&lt;br /&gt;
			editTools.chooseSection(initial);&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		/**&lt;br /&gt;
		 * Handle onchange event of the &amp;lt;select&amp;gt;&lt;br /&gt;
		 *&lt;br /&gt;
		 * @context {Element}&lt;br /&gt;
		 * @param e {jQuery.Event}&lt;br /&gt;
		 */&lt;br /&gt;
		handleOnchange: function () {&lt;br /&gt;
			editTools.chooseSection(Number($(this).val()));&lt;br /&gt;
&lt;br /&gt;
			return true;&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		/**&lt;br /&gt;
		 * Toggle the currently visible section&lt;br /&gt;
		 *&lt;br /&gt;
		 * @param sectionNr {Number}&lt;br /&gt;
		 * @param setFocus {Boolean}&lt;br /&gt;
		 */&lt;br /&gt;
		chooseSection: function (sectionNr) {&lt;br /&gt;
			var $choise = $sections.eq(sectionNr);&lt;br /&gt;
			if ($choise.length !== 1) {&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			// Making these buttons is a little slow,&lt;br /&gt;
			// If we made them all at once the browser would hang&lt;br /&gt;
			// for over 2 seconds, so instead we're doing it on-demand&lt;br /&gt;
			// for each section. No need to do it twice thoguh, so remember&lt;br /&gt;
			// in data whether it was done already&lt;br /&gt;
			if (!$choise.data('charInsert.buttonsMade')) {&lt;br /&gt;
				$choise.data('charInsert.buttonsMade', true);&lt;br /&gt;
				editTools.makeButtons($choise);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			$choise.show();&lt;br /&gt;
			$sections.not($choise).hide();&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		/**&lt;br /&gt;
		 * Convert the &amp;lt;a onclick&amp;gt; links to buttons in a given section.&lt;br /&gt;
		 *&lt;br /&gt;
		 * @param $section {jQuery}&lt;br /&gt;
		 */&lt;br /&gt;
		makeButtons: function ($section) {&lt;br /&gt;
			var $links;&lt;br /&gt;
&lt;br /&gt;
			if (!$section.length) {&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			$links = $section.find('a');&lt;br /&gt;
			$links.each(function (i, a) {&lt;br /&gt;
				var $a, $button, start, end;&lt;br /&gt;
				$a = $(a);&lt;br /&gt;
				$button = $( '&amp;lt;input&amp;gt;' ).attr( 'type', 'button' );&lt;br /&gt;
				start = $a.data( 'mw-charinsert-start' );&lt;br /&gt;
				end = $a.data( 'mw-charinsert-end' );&lt;br /&gt;
				if ( start !== undefined &amp;amp;&amp;amp; end !== undefined ) {&lt;br /&gt;
					$button.click( function( e ) {&lt;br /&gt;
						e.preventDefault();&lt;br /&gt;
						$('#wpTextbox1').textSelection('encapsulateSelection', {pre: start, post: end});&lt;br /&gt;
					} );&lt;br /&gt;
				} else {&lt;br /&gt;
					$button[0].onclick = a.onclick;&lt;br /&gt;
                                }&lt;br /&gt;
				$button[0].value = $a.text();&lt;br /&gt;
				$a.replaceWith($button);&lt;br /&gt;
			});&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	$(document).ready(editTools.setup);&lt;br /&gt;
&lt;br /&gt;
}(jQuery, mediaWiki));&lt;/div&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
</feed>