https://de.dbg-web.de/w/index.php?title=MediaWiki:Gadget-Edittools.js&feed=atom&action=history
MediaWiki:Gadget-Edittools.js - Versionsgeschichte
2024-03-29T11:52:29Z
Versionsgeschichte dieser Seite in Deutsche Bromelien-Gesellschaft e. V.
MediaWiki 1.39.6
https://de.dbg-web.de/w/index.php?title=MediaWiki:Gadget-Edittools.js&diff=4681&oldid=prev
de>Testkonto: korr
2020-04-03T10:00:53Z
<p>korr</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 3. April 2020, 11:00 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l7">Zeile 7:</td>
<td colspan="2" class="diff-lineno">Zeile 7:</td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> * @author Krinkle, 2012</div></td><td class="diff-marker"></td><td style="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;"><div> * @author Krinkle, 2012</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> * @source www.mediawiki.org/wiki/MediaWiki:Gadget-Edittools.js</div></td><td class="diff-marker"></td><td style="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;"><div> * @source www.mediawiki.org/wiki/MediaWiki:Gadget-Edittools.js</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> * @revision <del style="font-weight: bold; text-decoration: none;">2012</del>-<del style="font-weight: bold; text-decoration: none;">02</del>-<del style="font-weight: bold; text-decoration: none;">29</del></div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> * @revision <ins style="font-weight: bold; text-decoration: none;">2018</ins>-<ins style="font-weight: bold; text-decoration: none;">12</ins>-<ins style="font-weight: bold; text-decoration: none;">17</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> */</div></td><td class="diff-marker"></td><td style="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;"><div> */</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div>/*jslint browser: true*/</div></td><td class="diff-marker"></td><td style="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;"><div>/*jslint browser: true*/</div></td></tr>
</table>
de>Testkonto
https://de.dbg-web.de/w/index.php?title=MediaWiki:Gadget-Edittools.js&diff=4680&oldid=prev
de>Testkonto: akt
2020-04-03T09:49:55Z
<p>akt</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 3. April 2020, 10:49 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l125">Zeile 125:</td>
<td colspan="2" class="diff-lineno">Zeile 125:</td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> $button.click( function( e ) {</div></td><td class="diff-marker"></td><td style="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;"><div> $button.click( function( e ) {</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> e.preventDefault();</div></td><td class="diff-marker"></td><td style="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;"><div> e.preventDefault();</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">mw</del>.<del style="font-weight: bold; text-decoration: none;">toolbar.insertTags</del>( start, end<del style="font-weight: bold; text-decoration: none;">, '' </del>);</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> <ins style="font-weight: bold; text-decoration: none;">$('#wpTextbox1')</ins>.<ins style="font-weight: bold; text-decoration: none;">textSelection</ins>(<ins style="font-weight: bold; text-decoration: none;">'encapsulateSelection', {pre: </ins>start, <ins style="font-weight: bold; text-decoration: none;">post: </ins>end<ins style="font-weight: bold; text-decoration: none;">}</ins>);</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> } );</div></td><td class="diff-marker"></td><td style="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;"><div> } );</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> } else {</div></td><td class="diff-marker"></td><td style="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;"><div> } else {</div></td></tr>
</table>
de>Testkonto
https://de.dbg-web.de/w/index.php?title=MediaWiki:Gadget-Edittools.js&diff=4679&oldid=prev
Timm Stolten am 5. Dezember 2016 um 14:48 Uhr
2016-12-05T14:48:05Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 5. Dezember 2016, 15:48 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l117">Zeile 117:</td>
<td colspan="2" class="diff-lineno">Zeile 117:</td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> $links = $section.find('a');</div></td><td class="diff-marker"></td><td style="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;"><div> $links = $section.find('a');</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> $links.each(function (i, a) {</div></td><td class="diff-marker"></td><td style="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;"><div> $links.each(function (i, a) {</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> var $a, button;</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> var $a, <ins style="font-weight: bold; text-decoration: none;">$</ins>button<ins style="font-weight: bold; text-decoration: none;">, start, end</ins>;</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> $a = $(a);</div></td><td class="diff-marker"></td><td style="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;"><div> $a = $(a);</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> button = <del style="font-weight: bold; text-decoration: none;">document</del>.<del style="font-weight: bold; text-decoration: none;">createElement</del>('<del style="font-weight: bold; text-decoration: none;">input</del>');</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> <ins style="font-weight: bold; text-decoration: none;">$</ins>button = <ins style="font-weight: bold; text-decoration: none;">$( '<input>' )</ins>.<ins style="font-weight: bold; text-decoration: none;">attr</ins>( '<ins style="font-weight: bold; text-decoration: none;">type', 'button</ins>' );</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">button</del>.<del style="font-weight: bold; text-decoration: none;">type </del>= 'button';</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> <ins style="font-weight: bold; text-decoration: none;">start = $a</ins>.<ins style="font-weight: bold; text-decoration: none;">data( 'mw-charinsert-start' );</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> button.onclick = a.onclick;</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> end </ins>= <ins style="font-weight: bold; text-decoration: none;">$a.data( 'mw-charinsert-end</ins>' <ins style="font-weight: bold; text-decoration: none;">);</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> button.value = $a.text();</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> if ( start !== undefined && end !== undefined ) {</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $a.replaceWith(button);</div></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> $</ins>button<ins style="font-weight: bold; text-decoration: none;">.click( function( e ) {</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> e.preventDefault();</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> mw.toolbar.insertTags( start, end, '</ins>' <ins style="font-weight: bold; text-decoration: none;">);</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> } )</ins>;</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> <ins style="font-weight: bold; text-decoration: none;">} else {</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> $</ins>button<ins style="font-weight: bold; text-decoration: none;">[0]</ins>.onclick = a.onclick;</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"> }</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> <ins style="font-weight: bold; text-decoration: none;">$</ins>button<ins style="font-weight: bold; text-decoration: none;">[0]</ins>.value = $a.text();</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="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;"><div> $a.replaceWith(<ins style="font-weight: bold; text-decoration: none;">$</ins>button);</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> });</div></td><td class="diff-marker"></td><td style="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;"><div> });</div></td></tr>
<tr><td class="diff-marker"></td><td style="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;"><div> }</div></td><td class="diff-marker"></td><td style="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;"><div> }</div></td></tr>
</table>
Timm Stolten
https://de.dbg-web.de/w/index.php?title=MediaWiki:Gadget-Edittools.js&diff=4678&oldid=prev
Timm Stolten: Die Seite wurde neu angelegt: „/** * EditTools support: add a selector, change <a> into buttons. * The special characters to insert are defined at MediaWiki:Edittools. * * @author Ar…“
2016-03-03T01:17:05Z
<p>Die Seite wurde neu angelegt: „/** * EditTools support: add a selector, change <a> into buttons. * The special characters to insert are defined at <a href="/MediaWiki:Edittools" title="MediaWiki:Edittools">MediaWiki:Edittools</a>. * * @author Ar…“</p>
<p><b>Neue Seite</b></p><div>/**<br />
* EditTools support: add a selector, change <a> into buttons.<br />
* The special characters to insert are defined at [[MediaWiki:Edittools]].<br />
*<br />
* @author Arnomane, 2006 (on the commons.wikimedia.org/wiki/MediaWiki:Edittools.js)<br />
* @author Kaganer, 2007 (adapting to www.mediawiki.org)<br />
* @author Krinkle, 2012<br />
* @source www.mediawiki.org/wiki/MediaWiki:Gadget-Edittools.js<br />
* @revision 2012-02-29<br />
*/<br />
/*jslint browser: true*/<br />
/*global jQuery, mediaWiki*/<br />
(function ($, mw) {<br />
"use strict";<br />
<br />
var conf, editTools, $sections;<br />
<br />
conf = {<br />
initialSubset: window.EditTools_initial_subset === undefined ? window.EditTools_initial_subset : 0<br />
};<br />
<br />
editTools = {<br />
<br />
/**<br />
* Creates the selector<br />
*/<br />
setup: function () {<br />
var $container, $select, initial;<br />
<br />
$container = $('#mw-edittools-charinsert');<br />
if (!$container.length) {<br />
return;<br />
}<br />
$sections = $container.find('.mw-edittools-section');<br />
if ($sections.length <= 1) {<br />
// Only care if there is more than one<br />
return;<br />
}<br />
<br />
$select = $('<select>').css('display', 'inline');<br />
<br />
initial = conf.initialSubset;<br />
if (isNaN(initial) || initial < 0 || initial >= $select.length) {<br />
initial = 0;<br />
}<br />
<br />
$sections.each(function (i, el) {<br />
var $section, sectionTitle, $option;<br />
<br />
$section = $(el);<br />
sectionTitle = $section.data('sectionTitle');<br />
<br />
$option = $('<option>')<br />
.text(sectionTitle)<br />
.prop('value', i)<br />
.prop('selected', i === initial);<br />
<br />
$select.append($option);<br />
});<br />
<br />
$select.change(editTools.handleOnchange);<br />
$container.prepend($select);<br />
<br />
editTools.chooseSection(initial);<br />
},<br />
<br />
/**<br />
* Handle onchange event of the <select><br />
*<br />
* @context {Element}<br />
* @param e {jQuery.Event}<br />
*/<br />
handleOnchange: function () {<br />
editTools.chooseSection(Number($(this).val()));<br />
<br />
return true;<br />
},<br />
<br />
/**<br />
* Toggle the currently visible section<br />
*<br />
* @param sectionNr {Number}<br />
* @param setFocus {Boolean}<br />
*/<br />
chooseSection: function (sectionNr) {<br />
var $choise = $sections.eq(sectionNr);<br />
if ($choise.length !== 1) {<br />
return;<br />
}<br />
<br />
// Making these buttons is a little slow,<br />
// If we made them all at once the browser would hang<br />
// for over 2 seconds, so instead we're doing it on-demand<br />
// for each section. No need to do it twice thoguh, so remember<br />
// in data whether it was done already<br />
if (!$choise.data('charInsert.buttonsMade')) {<br />
$choise.data('charInsert.buttonsMade', true);<br />
editTools.makeButtons($choise);<br />
}<br />
<br />
$choise.show();<br />
$sections.not($choise).hide();<br />
},<br />
<br />
/**<br />
* Convert the <a onclick> links to buttons in a given section.<br />
*<br />
* @param $section {jQuery}<br />
*/<br />
makeButtons: function ($section) {<br />
var $links;<br />
<br />
if (!$section.length) {<br />
return;<br />
}<br />
<br />
$links = $section.find('a');<br />
$links.each(function (i, a) {<br />
var $a, button;<br />
$a = $(a);<br />
button = document.createElement('input');<br />
button.type = 'button';<br />
button.onclick = a.onclick;<br />
button.value = $a.text();<br />
$a.replaceWith(button);<br />
});<br />
}<br />
<br />
};<br />
<br />
$(document).ready(editTools.setup);<br />
<br />
}(jQuery, mediaWiki));</div>
Timm Stolten