https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=User%3AMagnus_Manske%2Fless_edit_clutter.js
Benutzer:Magnus Manske/less edit clutter.js - Versionsgeschichte
2025-06-05T04:42:16Z
Versionsgeschichte dieser Seite in Wikipedia
MediaWiki 1.45.0-wmf.3
https://de.wikipedia.org/w/index.php?title=Benutzer:Magnus_Manske/less_edit_clutter.js&diff=55687458&oldid=prev
Magnus Manske am 22. Januar 2009 um 17:00 Uhr
2009-01-22T17:00:44Z
<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 22. Januar 2009, 19:00 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 161:</td>
<td colspan="2" class="diff-lineno">Zeile 161:</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> s = n[i].replace(/^\s+|\s+$/g,"") ;</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> s = n[i].replace(/^\s+|\s+$/g,"") ;</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> if ( s == '' ) continue ;</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> if ( s == '' ) continue ;</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> v += '[[<del style="font-weight: bold; text-decoration: none;">kategorie</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> v += '[[<ins style="font-weight: bold; text-decoration: none;">Kategorie</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> s + "]]\n" ;</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> s + "]]\n" ;</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>
Magnus Manske
https://de.wikipedia.org/w/index.php?title=Benutzer:Magnus_Manske/less_edit_clutter.js&diff=55687201&oldid=prev
Magnus Manske am 22. Januar 2009 um 16:55 Uhr
2009-01-22T16:55:41Z
<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 22. Januar 2009, 18:55 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 470:</td>
<td colspan="2" class="diff-lineno">Zeile 470:</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 if ( lc.substr ( 0 , 12 ) == "[[kategorie:" ) {</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 if ( lc.substr ( 0 , 12 ) == "[[kategorie:" ) {</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> lines.pop() ;</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> lines.pop() ;</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 s = no_ws.substr ( <del style="font-weight: bold; text-decoration: none;">11</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> var s = no_ws.substr ( <ins style="font-weight: bold; text-decoration: none;">12</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> s = s.replace ( /\]\]$/ , "" ) ;</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> s = s.replace ( /\]\]$/ , "" ) ;</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> categories.push ( s ) ;</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> categories.push ( s ) ;</div></td>
</tr>
</table>
Magnus Manske
https://de.wikipedia.org/w/index.php?title=Benutzer:Magnus_Manske/less_edit_clutter.js&diff=55687171&oldid=prev
Magnus Manske am 22. Januar 2009 um 16:55 Uhr
2009-01-22T16:55:10Z
<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 22. Januar 2009, 18:55 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 468:</td>
<td colspan="2" class="diff-lineno">Zeile 468:</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> lines.pop() ;</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> lines.pop() ;</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> if ( end_templates != '' ) end_templates = "\n" + end_templates ;</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> if ( end_templates != '' ) end_templates = "\n" + end_templates ;</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> } else if ( lc.substr ( 0 , <del style="font-weight: bold; text-decoration: none;">11</del> ) == "[[kategorie:" ) {</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> } else if ( lc.substr ( 0 , <ins style="font-weight: bold; text-decoration: none;">12</ins> ) == "[[kategorie:" ) {</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> lines.pop() ;</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> lines.pop() ;</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> var s = no_ws.substr ( 11 ) ;</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> var s = no_ws.substr ( 11 ) ;</div></td>
</tr>
</table>
Magnus Manske
https://de.wikipedia.org/w/index.php?title=Benutzer:Magnus_Manske/less_edit_clutter.js&diff=55686714&oldid=prev
Magnus Manske am 22. Januar 2009 um 16:46 Uhr
2009-01-22T16:46:20Z
<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 22. Januar 2009, 18:46 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 161:</td>
<td colspan="2" class="diff-lineno">Zeile 161:</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> s = n[i].replace(/^\s+|\s+$/g,"") ;</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> s = n[i].replace(/^\s+|\s+$/g,"") ;</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> if ( s == '' ) continue ;</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> if ( s == '' ) continue ;</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> v += '[[<del style="font-weight: bold; text-decoration: none;">Category</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> v += '[[<ins style="font-weight: bold; text-decoration: none;">kategorie</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> s + "]]\n" ;</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> s + "]]\n" ;</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 colspan="2" class="diff-lineno">Zeile 468:</td>
<td colspan="2" class="diff-lineno">Zeile 468:</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> lines.pop() ;</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> lines.pop() ;</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> if ( end_templates != '' ) end_templates = "\n" + end_templates ;</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> if ( end_templates != '' ) end_templates = "\n" + end_templates ;</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> } else if ( lc.substr ( 0 , 11 ) == "[[<del style="font-weight: bold; text-decoration: none;">category</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> } else if ( lc.substr ( 0 , 11 ) == "[[<ins style="font-weight: bold; text-decoration: none;">kategorie</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> lines.pop() ;</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> lines.pop() ;</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> var s = no_ws.substr ( 11 ) ;</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> var s = no_ws.substr ( 11 ) ;</div></td>
</tr>
</table>
Magnus Manske
https://de.wikipedia.org/w/index.php?title=Benutzer:Magnus_Manske/less_edit_clutter.js&diff=55686575&oldid=prev
Magnus Manske: AZ: Die Seite wurde neu angelegt: if ( ( wgAction == "submit" || wgAction == "edit" ) && wgNamespaceNumber == 0 ) { addOnloadHook ( less_...
2009-01-22T16:43:10Z
<p><a href="/wiki/Hilfe:Zusammenfassung_und_Quellen#Auto-Zusammenfassung" title="Hilfe:Zusammenfassung und Quellen">AZ</a>: Die Seite wurde neu angelegt: if ( ( wgAction == "submit" || wgAction == "edit" ) && wgNamespaceNumber == 0 ) { addOnloadHook ( less_...</p>
<p><b>Neue Seite</b></p><div>if ( ( wgAction == "submit" || wgAction == "edit" ) && wgNamespaceNumber == 0 ) {<br />
addOnloadHook ( less_edit_clutter_init ) ;<br />
}<br />
<br />
var lec_parse_references = 1 ;<br />
<br />
var lec_parent ;<br />
var lec_tb1 ;<br />
var lec_original ;<br />
var lec_tb_top ;<br />
var lec_tb_ill ;<br />
var lec_tb_cat ;<br />
var lec_tb_bt ;<br />
var lec_tb_ref ;<br />
var lec_active ;<br />
var lec_last_edited = null ;<br />
<br />
<br />
function less_edit_clutter_init () {<br />
lec_active = 1 ;<br />
less_edit_clutter_create_elements () ;<br />
less_edit_clutter_hook_button ( 'wpSave' ) ;<br />
less_edit_clutter_hook_button ( 'wpPreview' ) ;<br />
less_edit_clutter_hook_button ( 'wpDiff' ) ;<br />
less_edit_clutter_parse_main_textbox () ;<br />
}<br />
<br />
function less_edit_clutter_insert_at_cursor ( field , value ) {<br />
if (document.selection) {<br />
field.focus();<br />
sel = document.selection.createRange();<br />
sel.text = value;<br />
} else if (field.selectionStart || field.selectionStart == '0') {<br />
var startPos = field.selectionStart;<br />
var endPos = field.selectionEnd;<br />
field.value = field.value.substring(0, startPos)+ value+ field.value.substring(endPos, field.value.length);<br />
}<br />
}<br />
<br />
function less_edit_clutter_hook_button ( id ) {<br />
var b = document.getElementById ( id ) ;<br />
b.onclick = function () { less_edit_clutter_rejoin() ; return true ; } ;<br />
}<br />
<br />
function less_edit_clutter_delete_reference () {<br />
var si = lec_tb_ref.selectedIndex ;<br />
if ( !si || si == null ) return ; // Nothing selected<br />
var text = lec_tb_ref[si].firstChild.nodeValue ;<br />
text = text.split ( ' : ' ) ;<br />
var value = text.shift() ;<br />
text = text.join ( ' : ' ) ;<br />
text = text.split ( ' | ' ) ;<br />
var refstuff = text.shift() ;<br />
text = text.join ( ' | ' ) ;<br />
<br />
var key = '<<REF' + value + '>>' ;<br />
lec_tb_top.value = lec_tb_top.value.split(key).join('') ;<br />
lec_tb1.value = lec_tb1.value.split(key).join('') ;<br />
lec_tb_bt.value = lec_tb_bt.value.split(key).join('') ;<br />
less_edit_clutter_rejoin () ;<br />
less_edit_clutter_parse_main_textbox () ;<br />
return false ;<br />
}<br />
<br />
function less_edit_clutter_insert_new_reference () {<br />
if ( lec_last_edited == null ) return ;<br />
<br />
var refstuff = prompt ( "Enter reference name:" , '' ) ;<br />
if ( null == refstuff ) return ; // Cancel<br />
var text = prompt ( "Enter reference contents:" , '' ) ;<br />
if ( null == text ) return ; // Cancel<br />
<br />
var max = lec_tb_ref.length + 2 ;<br />
<br />
less_edit_clutter_insert_at_cursor ( lec_last_edited , '<<REF' + max + '>>' ) ;<br />
<br />
text = max + ' : ' + refstuff + ' | ' + text ;<br />
<br />
var opt = document.createElement ( 'option' ) ;<br />
opt.value = max-1 ;<br />
opt.appendChild ( document.createTextNode ( text ) ) ;<br />
lec_tb_ref.appendChild ( opt ) ;<br />
<br />
less_edit_clutter_rejoin () ;<br />
less_edit_clutter_parse_main_textbox () ;<br />
return false ;<br />
}<br />
<br />
function less_edit_clutter_mark_text_range ( ctrl , from , to ) {<br />
if(ctrl.setSelectionRange) {<br />
ctrl.focus();<br />
ctrl.setSelectionRange ( from , to ) ;<br />
}<br />
else if (ctrl.createTextRange) {<br />
var range = ctrl.createTextRange();<br />
range.collapse ( true ) ;<br />
range.moveEnd ( 'character', from ) ;<br />
range.moveStart ( 'character', to ) ;<br />
range.select();<br />
}<br />
}<br />
<br />
function less_edit_clutter_tb1_select ( ta ) {<br />
var selection = ta.value.substr(ta.selectionStart, ta.selectionEnd - ta.selectionStart);<br />
if ( ! /^\<*REF\d+\>*$/.test ( selection ) ) return ;<br />
var num = selection.match ( /^\<*REF(\d+)\>*$/ ) ;<br />
num = num.pop() ;<br />
num-- ;<br />
lec_tb_ref[num].selected = true ;<br />
}<br />
<br />
function less_edit_clutter_find_and_mark ( text , ctrl ) {<br />
var pos = ctrl.value.search ( text ) ;<br />
if ( pos < 0 ) return true ; // Continue search<br />
less_edit_clutter_mark_text_range ( ctrl , pos , pos + text.length ) ;<br />
return false ;<br />
}<br />
<br />
function less_edit_clutter_refsel_changed () {<br />
var si = lec_tb_ref.selectedIndex + 1 ;<br />
var key = '<<REF' + si + '>>' ;<br />
var cont = true ;<br />
if ( cont ) cont = less_edit_clutter_find_and_mark ( key , lec_tb_top ) ;<br />
if ( cont ) cont = less_edit_clutter_find_and_mark ( key , lec_tb1 ) ;<br />
if ( cont ) cont = less_edit_clutter_find_and_mark ( key , lec_tb_bt ) ;<br />
if ( cont ) alert ( "Something's wrong - could not find reference " + key + "! Better reload this edit in the standard edit box!" ) ;<br />
}<br />
<br />
function less_edit_clutter_refsel_double_clicked () {<br />
var si = lec_tb_ref.selectedIndex ;<br />
var text = lec_tb_ref[si].firstChild.nodeValue ;<br />
text = text.split ( ' : ' ) ;<br />
var value = text.shift() ;<br />
text = text.join ( ' : ' ) ;<br />
text = text.split ( ' | ' ) ;<br />
var refstuff = text.shift() ;<br />
text = text.join ( ' | ' ) ;<br />
refstuff = prompt ( "Enter reference name:" , refstuff ) ;<br />
if ( null == refstuff ) return ; // Cancel<br />
text = prompt ( "Enter reference contents:" , text ) ;<br />
if ( null == text ) return ; // Cancel<br />
lec_tb_ref[si].firstChild.nodeValue = value + ' : ' + refstuff + ' | ' + text ;<br />
}<br />
<br />
function less_edit_clutter_rejoin () {<br />
if ( lec_active != 1 ) return ;<br />
v = lec_tb_top.value ;<br />
v = v.replace(/^\s+|\s+$/g,"") ;<br />
if ( v != '' ) v += "\n" ;<br />
v += lec_tb1.value ;<br />
v = v.replace(/^\s+|\s+$/g,"") ;<br />
if ( v != '' ) v += "\n\n" ;<br />
v += lec_tb_bt.value ;<br />
v = v.replace(/^\s+|\s+$/g,"") ;<br />
if ( v != '' ) v += "\n\n" ;<br />
<br />
// Categories<br />
n = lec_tb_cat.value.split ( "\n" ) ;<br />
n = n.sort() ;<br />
for ( i = 0 ; i < n.length ; i++ ) {<br />
s = n[i].replace(/^\s+|\s+$/g,"") ;<br />
if ( s == '' ) continue ;<br />
v += '[[Category:' + <br />
s + "]]\n" ;<br />
}<br />
v = v.replace(/^\s+|\s+$/g,"") ;<br />
if ( v != '' ) v += "\n\n" ;<br />
<br />
// Interlanguage links<br />
n = lec_tb_ill.value.split ( "\n" ) ;<br />
n = n.sort() ;<br />
for ( i = 0 ; i < n.length ; i++ ) {<br />
s = n[i].replace(/^\s+|\s+$/g,"") ;<br />
if ( s == '' ) continue ;<br />
v += '[[' + s + "]]\n" ;<br />
}<br />
v = v.replace(/^\s+|\s+$/g,"") ;<br />
<br />
if ( lec_parse_references ) {<br />
for ( var n = lec_tb_ref.firstChild ; n ; n = n.nextSibling ) {<br />
var text = n.firstChild.nodeValue ;<br />
text = text.split ( ' : ' ) ;<br />
var value = text.shift() ;<br />
text = text.join ( ' : ' ) ;<br />
text = text.split ( ' | ' ) ;<br />
var refstuff = text.shift() ;<br />
text = text.join ( ' | ' ) ;<br />
if ( refstuff != '' ) refstuff = ' name="' + refstuff + '"' ;<br />
text = '<ref' + refstuff + '>' + text + '</ref>' ;<br />
var key = '<<REF' + value + '>>' ;<br />
v = v.split(key).join(text) ;<br />
}<br />
}<br />
<br />
lec_tb1.value = v ;<br />
}<br />
<br />
function less_edit_clutter_create_elements () {<br />
lec_tb1 = document.getElementById ( 'wpTextbox1' ) ;<br />
lec_parent = lec_tb1.parentNode ;<br />
<br />
lec_tb_top = document.createElement ( 'textarea' ) ;<br />
lec_tb_top.id = 'lec_tb_top' ;<br />
lec_tb_top.name = 'lec_tb_top' ;<br />
lec_tb_top.cols = 80 ;<br />
lec_tb_top.rows = 5 ;<br />
<br />
lec_tb_ill = document.createElement ( 'textarea' ) ;<br />
lec_tb_ill.id = 'lec_tb_ill' ;<br />
lec_tb_ill.name = 'lec_tb_ill' ;<br />
lec_tb_ill.cols = 30 ;<br />
lec_tb_ill.rows = 5 ;<br />
<br />
lec_tb_cat = document.createElement ( 'textarea' ) ;<br />
lec_tb_cat.id = 'lec_tb_cat' ;<br />
lec_tb_cat.name = 'lec_tb_cat' ;<br />
lec_tb_cat.cols = 30 ;<br />
lec_tb_cat.rows = 5 ;<br />
<br />
lec_tb_bt = document.createElement ( 'textarea' ) ;<br />
lec_tb_bt.id = 'lec_tb_bt' ;<br />
lec_tb_bt.name = 'lec_tb_bt' ;<br />
lec_tb_bt.cols = 30 ;<br />
lec_tb_bt.rows = 5 ;<br />
<br />
lec_bottom_table = document.createElement ( 'table' ) ;<br />
lec_bottom_tbody = document.createElement ( 'tbody' ) ;<br />
lec_bottom_tr = document.createElement ( 'tr' ) ;<br />
lec_bottom_tr2 = document.createElement ( 'tr' ) ;<br />
lec_bottom_td1 = document.createElement ( 'td' ) ;<br />
lec_bottom_td2 = document.createElement ( 'td' ) ;<br />
lec_bottom_td3 = document.createElement ( 'td' ) ;<br />
<br />
lec_bottom_td1.style.width = '40%' ;<br />
lec_bottom_td2.style.width = '30%' ;<br />
lec_bottom_td3.style.width = '30%' ;<br />
<br />
lec_bottom_td1.appendChild ( document.createTextNode ( 'End templates and magic words' ) ) ;<br />
lec_bottom_td1.appendChild ( document.createElement ( 'br' ) ) ;<br />
lec_bottom_td1.appendChild ( lec_tb_bt ) ;<br />
<br />
lec_bottom_td2.appendChild ( document.createTextNode ( 'Categories' ) ) ;<br />
lec_bottom_td2.appendChild ( document.createElement ( 'br' ) ) ;<br />
lec_bottom_td2.appendChild ( lec_tb_cat ) ;<br />
<br />
lec_bottom_td3.appendChild ( document.createTextNode ( 'Interlanguage links' ) ) ;<br />
lec_bottom_td3.appendChild ( document.createElement ( 'br' ) ) ;<br />
lec_bottom_td3.appendChild ( lec_tb_ill ) ;<br />
<br />
if ( lec_parse_references ) {<br />
lec_tb1.onselect = function () { less_edit_clutter_tb1_select ( lec_tb1 ) ; } ;<br />
lec_tb_top.onselect = function () { less_edit_clutter_tb1_select ( lec_tb_top ) ; } ;<br />
lec_tb_bt.onselect = function () { less_edit_clutter_tb1_select ( lec_tb_bt ) ; } ;<br />
<br />
lec_tb1.onfocus = function () { lec_last_edited = lec_tb1 ; } ;<br />
lec_tb_top.onfocus = function () { lec_last_edited = lec_tb_top ; } ;<br />
lec_tb_bt.onfocus = function () { lec_last_edited = lec_tb_bt ; } ;<br />
<br />
lec_tb_ref = document.createElement ( 'select' ) ;<br />
lec_tb_ref.id = 'lec_tb_ref' ;<br />
lec_tb_ref.name = 'lec_tb_ref' ;<br />
lec_tb_ref.size = 5 ;<br />
lec_tb_ref.style.width = '100%' ;<br />
lec_tb_ref.onchange = less_edit_clutter_refsel_changed ;<br />
lec_tb_ref.ondblclick = less_edit_clutter_refsel_double_clicked ;<br />
<br />
var a_new_reference = document.createElement ( 'a' ) ;<br />
a_new_reference.appendChild ( document.createTextNode ( 'insert new reference' ) ) ;<br />
a_new_reference.href = '#' ;<br />
a_new_reference.onclick = less_edit_clutter_insert_new_reference ;<br />
<br />
var a_delete_reference = document.createElement ( 'a' ) ;<br />
a_delete_reference.appendChild ( document.createTextNode ( 'delete reference' ) ) ;<br />
a_delete_reference.href = '#' ;<br />
a_delete_reference.onclick = less_edit_clutter_delete_reference ;<br />
<br />
lec_bottom_td4 = document.createElement ( 'td' ) ;<br />
lec_bottom_td4.appendChild ( document.createTextNode ( 'References (' ) ) ;<br />
lec_bottom_td4.appendChild ( a_new_reference ) ;<br />
lec_bottom_td4.appendChild ( document.createTextNode ( ' | ' ) ) ;<br />
lec_bottom_td4.appendChild ( a_delete_reference ) ;<br />
lec_bottom_td4.appendChild ( document.createTextNode ( ')' ) ) ;<br />
lec_bottom_td4.appendChild ( document.createElement ( 'br' ) ) ;<br />
lec_bottom_td4.appendChild ( lec_tb_ref ) ;<br />
lec_bottom_td4.colSpan = '3' ;<br />
<br />
lec_bottom_tr2.appendChild ( lec_bottom_td4 ) ;<br />
lec_bottom_tbody.appendChild ( lec_bottom_tr2 ) ;<br />
}<br />
<br />
lec_bottom_tr.appendChild ( lec_bottom_td1 ) ;<br />
lec_bottom_tr.appendChild ( lec_bottom_td2 ) ;<br />
lec_bottom_tr.appendChild ( lec_bottom_td3 ) ;<br />
lec_bottom_tbody.appendChild ( lec_bottom_tr ) ;<br />
lec_bottom_table.appendChild ( lec_bottom_tbody ) ;<br />
<br />
var a = document.createElement ( 'a' ) ;<br />
a.href = '#' ;<br />
a.appendChild ( document.createTextNode ( "reload in standard edit box" ) ) ;<br />
a.onclick = function () {<br />
u = document.getElementById('lec_div_top') ;<br />
u.parentNode.removeChild ( u ) ;<br />
u = document.getElementById('lec_div_bottom') ;<br />
u.parentNode.removeChild ( u ) ;<br />
lec_tb1.value = lec_original ;<br />
lec_active = 0 ;<br />
return false ;<br />
}<br />
<br />
var b = document.createElement ( 'a' ) ;<br />
b.href = '#' ;<br />
b.appendChild ( document.createTextNode ( "redo for current contents" ) ) ;<br />
b.onclick = function () {<br />
less_edit_clutter_rejoin () ;<br />
less_edit_clutter_parse_main_textbox () ;<br />
return false ;<br />
}<br />
var top = document.createElement ( 'div' ) ;<br />
top.id = 'lec_div_top' ;<br />
<br />
var adiv = document.createElement ( 'div' ) ;<br />
adiv.style.display = 'block' ;<br />
adiv.appendChild ( document.createTextNode ( "Main text (" ) ) ;<br />
adiv.appendChild ( a ) ;<br />
adiv.appendChild ( document.createTextNode ( " | " ) ) ;<br />
adiv.appendChild ( b ) ;<br />
adiv.appendChild ( document.createTextNode ( ")" ) ) ;<br />
<br />
top.appendChild ( document.createTextNode ( "Header templates and images" ) ) ;<br />
top.appendChild ( lec_tb_top ) ;<br />
top.appendChild ( adiv ) ;<br />
<br />
var bottom = document.createElement ( 'div' ) ;<br />
bottom.id = 'lec_div_bottom' ;<br />
<br />
bottom.appendChild ( document.createTextNode ( 'Elements at the end' ) ) ;<br />
bottom.appendChild ( lec_bottom_table ) ;<br />
<br />
lec_parent.insertBefore ( bottom , lec_tb1.nextSibling ) ;<br />
lec_parent.insertBefore ( top , lec_tb1 ) ;<br />
<br />
lec_bottom_table.id = 'lec_tb_bottom' ;<br />
lec_bottom_table.style.width = '100%' ;<br />
lec_bottom_table.style.cellSpacing = '2' ;<br />
lec_bottom_table.style.cellPadding = '2' ;<br />
<br />
<br />
less_edit_clutter_append_show_hide ( 'lec_tb_top' ) ;<br />
less_edit_clutter_append_show_hide ( 'lec_tb_bottom' ) ;<br />
}<br />
<br />
function less_edit_clutter_toggle_show_hide ( id , a ) {<br />
var x = document.getElementById ( id ) ;<br />
if ( x.style.display == 'none' ) {<br />
x.style.display = '' ;<br />
while ( a.firstChild ) a.removeChild ( a.firstChild ) ;<br />
a.appendChild ( document.createTextNode ( 'hide' ) ) ;<br />
} else {<br />
x.style.display = 'none' ;<br />
while ( a.firstChild ) a.removeChild ( a.firstChild ) ;<br />
a.appendChild ( document.createTextNode ( 'show' ) ) ;<br />
}<br />
}<br />
<br />
function less_edit_clutter_append_show_hide ( id ) {<br />
var x = document.getElementById ( id ) ;<br />
var n = document.createElement ( 'span' ) ;<br />
<br />
var a = document.createElement ( 'a' ) ;<br />
a.href = '#' ;<br />
a.onclick = function () { less_edit_clutter_toggle_show_hide ( id , this ) ; return false ; }<br />
a.appendChild ( document.createTextNode ( 'hide' ) ) ;<br />
<br />
n.appendChild ( document.createTextNode ( ' (' ) ) ;<br />
n.appendChild ( a ) ;<br />
n.appendChild ( document.createTextNode ( ')' ) ) ;<br />
n.appendChild ( document.createElement ( 'br' ) ) ;<br />
<br />
x.parentNode.insertBefore ( n , x ) ;<br />
// x.style.display = 'none' ;<br />
}<br />
<br />
function less_edit_clutter_parse_main_textbox () {<br />
lec_original = lec_tb1.value ;<br />
var lines = lec_original.split("\n") ;<br />
var in_template = 0 ;<br />
var begin_templates = "" ;<br />
<br />
// References<br />
if ( lec_parse_references && /\<\<REF\d+\>\>/.test ( lec_original ) ) lec_parse_references = 0 ; // Already contains pattern, aborting<br />
if ( lec_parse_references ) {<br />
cnt = 1 ;<br />
v = lec_original ;<br />
v = v.split ( /\<ref/ig ) ;<br />
o = v.shift () ;<br />
refs = new Array () ;<br />
while ( lec_tb_ref.firstChild ) lec_tb_ref.removeChild ( lec_tb_ref.firstChild ) ;<br />
for ( i = 0 ; i < v.length ; i++ ) {<br />
if ( v[i].substr(0,1) != ' ' && v[i].substr(0,1) != '>' ) { // Something that is not a reference tag<br />
o += '<ref' + v[i] ;<br />
continue ;<br />
}<br />
n = v[i].split ( '>' ) ;<br />
if ( n.length < 2 ) { o += '<ref' + v[i] ; continue ; }<br />
refstuff = n.shift() ;<br />
refstuff = refstuff.match ( /name=\"(.*)\"\s*$/ ) ;<br />
if ( null == refstuff ) refstuff = '' ;<br />
else refstuff = refstuff.pop() ;<br />
n = n.join ( '>' ) ;<br />
n = n.split ( '</ref>' ) ;<br />
if ( n.length < 2 ) { o += '<ref' + v[i] ; continue ; }<br />
refcontents = n.shift() ;<br />
// if ( n.length > 1 ) { o += '<ref' + v[i] ; continue ; }<br />
n = n.join ( '</ref>' ) ;<br />
o += '<<REF' + cnt + '>>' + n ;<br />
refs.push ( cnt + ' : ' + refstuff + ' | ' + refcontents ) ;<br />
cnt++ ;<br />
}<br />
for ( i = 0 ; i < refs.length ; i++ ) {<br />
var opt = document.createElement ( 'option' ) ;<br />
opt.value = i ;<br />
opt.appendChild ( document.createTextNode ( refs[i] ) ) ;<br />
lec_tb_ref.appendChild ( opt ) ;<br />
}<br />
lines = o.split("\n") ;<br />
}<br />
<br />
// Begin of text<br />
while ( lines.length > 0 ) {<br />
var no_ws = lines[0].replace(/^\s+|\s+$/g,"") ;<br />
var lc = no_ws.toLowerCase() ;<br />
if ( lc == "" ) {<br />
lines.shift() ;<br />
if ( begin_templates != '' ) begin_templates += "\n" ;<br />
} else if ( lc.match(/^\{\{[^\{\}]*\}\}$/) ) {<br />
lines.shift() ;<br />
begin_templates = begin_templates + no_ws + "\n" ;<br />
} else if ( lc.match(/^\{\{[^\{\}]*$/) ) {<br />
begin_templates = begin_templates + lines.shift() + "\n" ;<br />
in_template++ ;<br />
} else if ( in_template && lc.match(/^[^\}\{]*\}\}\s*$/) ) {<br />
begin_templates = begin_templates + lines.shift() + "\n" ;<br />
in_template-- ;<br />
} else if ( in_template > 0 ) {<br />
begin_templates = begin_templates + lines.shift() + "\n" ;<br />
} else if ( lc.match(/^[-_]+$/) || lc.match(/^\s*\<hr\s*\/*\>\s*$/) ) {<br />
begin_templates = begin_templates + lines.shift() + "\n" ;<br />
} else if ( lc.match(/^\[\[image\:.*\]\]$/) ) {<br />
begin_templates = begin_templates + lines.shift() + "\n" ;<br />
} else break ;<br />
}<br />
<br />
begin_templates = begin_templates.replace(/^\s+|\s+$/g,"") ;<br />
<br />
<br />
var categories = new Array () ;<br />
var languages = new Array () ;<br />
var end_templates = "" ;<br />
<br />
// End of text<br />
in_template = 0 ;<br />
end_templates_append = "" ;<br />
while ( lines.length > 0 ) {<br />
var lp = lines.length - 1 ;<br />
var no_ws = lines[lp].replace(/^\s+|\s+$/g,"") ;<br />
var lc = no_ws.toLowerCase() ;<br />
if ( lc == "" ) {<br />
lines.pop() ;<br />
if ( end_templates != '' ) end_templates = "\n" + end_templates ;<br />
} else if ( lc.substr ( 0 , 11 ) == "[[category:" ) {<br />
lines.pop() ;<br />
var s = no_ws.substr ( 11 ) ;<br />
s = s.replace ( /\]\]$/ , "" ) ;<br />
categories.push ( s ) ;<br />
} else if ( lc.match(/^\[\[\w+\:.*\]\]$/) ) {<br />
lines.pop() ;<br />
var s = no_ws.substr ( 2 ) ;<br />
s = s.replace ( /\]\]$/ , "" ) ;<br />
languages.push ( s ) ;<br />
} else if ( lc.match(/^\{\{defaultsort\s*[\|\:].*\}\}$/) ) {<br />
end_templates_append += "\n\n" + lines.pop() ;<br />
} else if ( lc.match(/^\<!--.*-->$/) ) {<br />
end_templates = lines.pop() + "\n" + end_templates ;<br />
} else if ( lc.match(/^\{\{.*\}\}$/) ) {<br />
end_templates = lines.pop() + "\n" + end_templates ;<br />
} else if ( lc.match(/^[^\{\}]*\}\}$/) ) {<br />
end_templates = lines.pop() + "\n" + end_templates ;<br />
in_template++ ;<br />
} else if ( lc.match(/^\{\{[^\{\}]*$/) ) {<br />
end_templates = lines.pop() + "\n" + end_templates ;<br />
in_template-- ;<br />
} else if ( in_template > 0 ) {<br />
end_templates = lines.pop() + "\n" + end_templates ;<br />
} else break ;<br />
}<br />
<br />
var oet ;<br />
do {<br />
oet = end_templates ;<br />
end_templates = end_templates.split("\n\n\n").join("\n\n") ;<br />
} while ( end_templates != oet ) ;<br />
end_templates = end_templates.replace(/^\s+|\s+$/g,"") ;<br />
end_templates_append = end_templates_append.replace(/^\s+|\s+$/g,"") ;<br />
if ( end_templates != '' && end_templates_append != '' ) end_templates += "\n\n" ;<br />
end_templates += end_templates_append ;<br />
<br />
// Set boxes<br />
lec_tb_top.value = begin_templates ;<br />
lec_tb_cat.value = categories.sort().join("\n") ;<br />
lec_tb_ill.value = languages.sort().join("\n") ;<br />
lec_tb_bt.value = end_templates ;<br />
lec_tb1.value = lines.join("\n") ;<br />
}</div>
Magnus Manske