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 == &quot;submit&quot; || wgAction == &quot;edit&quot; ) &amp;&amp; wgNamespaceNumber == 0 ) { addOnloadHook ( less_...</p> <p><b>Neue Seite</b></p><div>if ( ( wgAction == &quot;submit&quot; || wgAction == &quot;edit&quot; ) &amp;&amp; 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 ( &#039;wpSave&#039; ) ;<br /> less_edit_clutter_hook_button ( &#039;wpPreview&#039; ) ;<br /> less_edit_clutter_hook_button ( &#039;wpDiff&#039; ) ;<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 == &#039;0&#039;) {<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 ( &#039; : &#039; ) ;<br /> var value = text.shift() ;<br /> text = text.join ( &#039; : &#039; ) ;<br /> text = text.split ( &#039; | &#039; ) ;<br /> var refstuff = text.shift() ;<br /> text = text.join ( &#039; | &#039; ) ;<br /> <br /> var key = &#039;&lt;&lt;REF&#039; + value + &#039;&gt;&gt;&#039; ;<br /> lec_tb_top.value = lec_tb_top.value.split(key).join(&#039;&#039;) ;<br /> lec_tb1.value = lec_tb1.value.split(key).join(&#039;&#039;) ;<br /> lec_tb_bt.value = lec_tb_bt.value.split(key).join(&#039;&#039;) ;<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 ( &quot;Enter reference name:&quot; , &#039;&#039; ) ;<br /> if ( null == refstuff ) return ; // Cancel<br /> var text = prompt ( &quot;Enter reference contents:&quot; , &#039;&#039; ) ;<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 , &#039;&lt;&lt;REF&#039; + max + &#039;&gt;&gt;&#039; ) ;<br /> <br /> text = max + &#039; : &#039; + refstuff + &#039; | &#039; + text ;<br /> <br /> var opt = document.createElement ( &#039;option&#039; ) ;<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 ( &#039;character&#039;, from ) ;<br /> range.moveStart ( &#039;character&#039;, 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 ( ! /^\&lt;*REF\d+\&gt;*$/.test ( selection ) ) return ;<br /> var num = selection.match ( /^\&lt;*REF(\d+)\&gt;*$/ ) ;<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 &lt; 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 = &#039;&lt;&lt;REF&#039; + si + &#039;&gt;&gt;&#039; ;<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 ( &quot;Something&#039;s wrong - could not find reference &quot; + key + &quot;! Better reload this edit in the standard edit box!&quot; ) ;<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 ( &#039; : &#039; ) ;<br /> var value = text.shift() ;<br /> text = text.join ( &#039; : &#039; ) ;<br /> text = text.split ( &#039; | &#039; ) ;<br /> var refstuff = text.shift() ;<br /> text = text.join ( &#039; | &#039; ) ;<br /> refstuff = prompt ( &quot;Enter reference name:&quot; , refstuff ) ;<br /> if ( null == refstuff ) return ; // Cancel<br /> text = prompt ( &quot;Enter reference contents:&quot; , text ) ;<br /> if ( null == text ) return ; // Cancel<br /> lec_tb_ref[si].firstChild.nodeValue = value + &#039; : &#039; + refstuff + &#039; | &#039; + 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,&quot;&quot;) ;<br /> if ( v != &#039;&#039; ) v += &quot;\n&quot; ;<br /> v += lec_tb1.value ;<br /> v = v.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( v != &#039;&#039; ) v += &quot;\n\n&quot; ;<br /> v += lec_tb_bt.value ;<br /> v = v.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( v != &#039;&#039; ) v += &quot;\n\n&quot; ;<br /> <br /> // Categories<br /> n = lec_tb_cat.value.split ( &quot;\n&quot; ) ;<br /> n = n.sort() ;<br /> for ( i = 0 ; i &lt; n.length ; i++ ) {<br /> s = n[i].replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( s == &#039;&#039; ) continue ;<br /> v += &#039;[[Category:&#039; + <br /> s + &quot;]]\n&quot; ;<br /> }<br /> v = v.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( v != &#039;&#039; ) v += &quot;\n\n&quot; ;<br /> <br /> // Interlanguage links<br /> n = lec_tb_ill.value.split ( &quot;\n&quot; ) ;<br /> n = n.sort() ;<br /> for ( i = 0 ; i &lt; n.length ; i++ ) {<br /> s = n[i].replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( s == &#039;&#039; ) continue ;<br /> v += &#039;[[&#039; + s + &quot;]]\n&quot; ;<br /> }<br /> v = v.replace(/^\s+|\s+$/g,&quot;&quot;) ;<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 ( &#039; : &#039; ) ;<br /> var value = text.shift() ;<br /> text = text.join ( &#039; : &#039; ) ;<br /> text = text.split ( &#039; | &#039; ) ;<br /> var refstuff = text.shift() ;<br /> text = text.join ( &#039; | &#039; ) ;<br /> if ( refstuff != &#039;&#039; ) refstuff = &#039; name=&quot;&#039; + refstuff + &#039;&quot;&#039; ;<br /> text = &#039;&lt;ref&#039; + refstuff + &#039;&gt;&#039; + text + &#039;&lt;/ref&gt;&#039; ;<br /> var key = &#039;&lt;&lt;REF&#039; + value + &#039;&gt;&gt;&#039; ;<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 ( &#039;wpTextbox1&#039; ) ;<br /> lec_parent = lec_tb1.parentNode ;<br /> <br /> lec_tb_top = document.createElement ( &#039;textarea&#039; ) ;<br /> lec_tb_top.id = &#039;lec_tb_top&#039; ;<br /> lec_tb_top.name = &#039;lec_tb_top&#039; ;<br /> lec_tb_top.cols = 80 ;<br /> lec_tb_top.rows = 5 ;<br /> <br /> lec_tb_ill = document.createElement ( &#039;textarea&#039; ) ;<br /> lec_tb_ill.id = &#039;lec_tb_ill&#039; ;<br /> lec_tb_ill.name = &#039;lec_tb_ill&#039; ;<br /> lec_tb_ill.cols = 30 ;<br /> lec_tb_ill.rows = 5 ;<br /> <br /> lec_tb_cat = document.createElement ( &#039;textarea&#039; ) ;<br /> lec_tb_cat.id = &#039;lec_tb_cat&#039; ;<br /> lec_tb_cat.name = &#039;lec_tb_cat&#039; ;<br /> lec_tb_cat.cols = 30 ;<br /> lec_tb_cat.rows = 5 ;<br /> <br /> lec_tb_bt = document.createElement ( &#039;textarea&#039; ) ;<br /> lec_tb_bt.id = &#039;lec_tb_bt&#039; ;<br /> lec_tb_bt.name = &#039;lec_tb_bt&#039; ;<br /> lec_tb_bt.cols = 30 ;<br /> lec_tb_bt.rows = 5 ;<br /> <br /> lec_bottom_table = document.createElement ( &#039;table&#039; ) ;<br /> lec_bottom_tbody = document.createElement ( &#039;tbody&#039; ) ;<br /> lec_bottom_tr = document.createElement ( &#039;tr&#039; ) ;<br /> lec_bottom_tr2 = document.createElement ( &#039;tr&#039; ) ;<br /> lec_bottom_td1 = document.createElement ( &#039;td&#039; ) ;<br /> lec_bottom_td2 = document.createElement ( &#039;td&#039; ) ;<br /> lec_bottom_td3 = document.createElement ( &#039;td&#039; ) ;<br /> <br /> lec_bottom_td1.style.width = &#039;40%&#039; ;<br /> lec_bottom_td2.style.width = &#039;30%&#039; ;<br /> lec_bottom_td3.style.width = &#039;30%&#039; ;<br /> <br /> lec_bottom_td1.appendChild ( document.createTextNode ( &#039;End templates and magic words&#039; ) ) ;<br /> lec_bottom_td1.appendChild ( document.createElement ( &#039;br&#039; ) ) ;<br /> lec_bottom_td1.appendChild ( lec_tb_bt ) ;<br /> <br /> lec_bottom_td2.appendChild ( document.createTextNode ( &#039;Categories&#039; ) ) ;<br /> lec_bottom_td2.appendChild ( document.createElement ( &#039;br&#039; ) ) ;<br /> lec_bottom_td2.appendChild ( lec_tb_cat ) ;<br /> <br /> lec_bottom_td3.appendChild ( document.createTextNode ( &#039;Interlanguage links&#039; ) ) ;<br /> lec_bottom_td3.appendChild ( document.createElement ( &#039;br&#039; ) ) ;<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 ( &#039;select&#039; ) ;<br /> lec_tb_ref.id = &#039;lec_tb_ref&#039; ;<br /> lec_tb_ref.name = &#039;lec_tb_ref&#039; ;<br /> lec_tb_ref.size = 5 ;<br /> lec_tb_ref.style.width = &#039;100%&#039; ;<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 ( &#039;a&#039; ) ;<br /> a_new_reference.appendChild ( document.createTextNode ( &#039;insert new reference&#039; ) ) ;<br /> a_new_reference.href = &#039;#&#039; ;<br /> a_new_reference.onclick = less_edit_clutter_insert_new_reference ;<br /> <br /> var a_delete_reference = document.createElement ( &#039;a&#039; ) ;<br /> a_delete_reference.appendChild ( document.createTextNode ( &#039;delete reference&#039; ) ) ;<br /> a_delete_reference.href = &#039;#&#039; ;<br /> a_delete_reference.onclick = less_edit_clutter_delete_reference ;<br /> <br /> lec_bottom_td4 = document.createElement ( &#039;td&#039; ) ;<br /> lec_bottom_td4.appendChild ( document.createTextNode ( &#039;References (&#039; ) ) ;<br /> lec_bottom_td4.appendChild ( a_new_reference ) ;<br /> lec_bottom_td4.appendChild ( document.createTextNode ( &#039; | &#039; ) ) ;<br /> lec_bottom_td4.appendChild ( a_delete_reference ) ;<br /> lec_bottom_td4.appendChild ( document.createTextNode ( &#039;)&#039; ) ) ;<br /> lec_bottom_td4.appendChild ( document.createElement ( &#039;br&#039; ) ) ;<br /> lec_bottom_td4.appendChild ( lec_tb_ref ) ;<br /> lec_bottom_td4.colSpan = &#039;3&#039; ;<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 ( &#039;a&#039; ) ;<br /> a.href = &#039;#&#039; ;<br /> a.appendChild ( document.createTextNode ( &quot;reload in standard edit box&quot; ) ) ;<br /> a.onclick = function () {<br /> u = document.getElementById(&#039;lec_div_top&#039;) ;<br /> u.parentNode.removeChild ( u ) ;<br /> u = document.getElementById(&#039;lec_div_bottom&#039;) ;<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 ( &#039;a&#039; ) ;<br /> b.href = &#039;#&#039; ;<br /> b.appendChild ( document.createTextNode ( &quot;redo for current contents&quot; ) ) ;<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 ( &#039;div&#039; ) ;<br /> top.id = &#039;lec_div_top&#039; ;<br /> <br /> var adiv = document.createElement ( &#039;div&#039; ) ;<br /> adiv.style.display = &#039;block&#039; ;<br /> adiv.appendChild ( document.createTextNode ( &quot;Main text (&quot; ) ) ;<br /> adiv.appendChild ( a ) ;<br /> adiv.appendChild ( document.createTextNode ( &quot; | &quot; ) ) ;<br /> adiv.appendChild ( b ) ;<br /> adiv.appendChild ( document.createTextNode ( &quot;)&quot; ) ) ;<br /> <br /> top.appendChild ( document.createTextNode ( &quot;Header templates and images&quot; ) ) ;<br /> top.appendChild ( lec_tb_top ) ;<br /> top.appendChild ( adiv ) ;<br /> <br /> var bottom = document.createElement ( &#039;div&#039; ) ;<br /> bottom.id = &#039;lec_div_bottom&#039; ;<br /> <br /> bottom.appendChild ( document.createTextNode ( &#039;Elements at the end&#039; ) ) ;<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 = &#039;lec_tb_bottom&#039; ;<br /> lec_bottom_table.style.width = &#039;100%&#039; ;<br /> lec_bottom_table.style.cellSpacing = &#039;2&#039; ;<br /> lec_bottom_table.style.cellPadding = &#039;2&#039; ;<br /> <br /> <br /> less_edit_clutter_append_show_hide ( &#039;lec_tb_top&#039; ) ;<br /> less_edit_clutter_append_show_hide ( &#039;lec_tb_bottom&#039; ) ;<br /> }<br /> <br /> function less_edit_clutter_toggle_show_hide ( id , a ) {<br /> var x = document.getElementById ( id ) ;<br /> if ( x.style.display == &#039;none&#039; ) {<br /> x.style.display = &#039;&#039; ;<br /> while ( a.firstChild ) a.removeChild ( a.firstChild ) ;<br /> a.appendChild ( document.createTextNode ( &#039;hide&#039; ) ) ;<br /> } else {<br /> x.style.display = &#039;none&#039; ;<br /> while ( a.firstChild ) a.removeChild ( a.firstChild ) ;<br /> a.appendChild ( document.createTextNode ( &#039;show&#039; ) ) ;<br /> }<br /> }<br /> <br /> function less_edit_clutter_append_show_hide ( id ) {<br /> var x = document.getElementById ( id ) ;<br /> var n = document.createElement ( &#039;span&#039; ) ;<br /> <br /> var a = document.createElement ( &#039;a&#039; ) ;<br /> a.href = &#039;#&#039; ;<br /> a.onclick = function () { less_edit_clutter_toggle_show_hide ( id , this ) ; return false ; }<br /> a.appendChild ( document.createTextNode ( &#039;hide&#039; ) ) ;<br /> <br /> n.appendChild ( document.createTextNode ( &#039; (&#039; ) ) ;<br /> n.appendChild ( a ) ;<br /> n.appendChild ( document.createTextNode ( &#039;)&#039; ) ) ;<br /> n.appendChild ( document.createElement ( &#039;br&#039; ) ) ;<br /> <br /> x.parentNode.insertBefore ( n , x ) ;<br /> // x.style.display = &#039;none&#039; ;<br /> }<br /> <br /> function less_edit_clutter_parse_main_textbox () {<br /> lec_original = lec_tb1.value ;<br /> var lines = lec_original.split(&quot;\n&quot;) ;<br /> var in_template = 0 ;<br /> var begin_templates = &quot;&quot; ;<br /> <br /> // References<br /> if ( lec_parse_references &amp;&amp; /\&lt;\&lt;REF\d+\&gt;\&gt;/.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 ( /\&lt;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 &lt; v.length ; i++ ) {<br /> if ( v[i].substr(0,1) != &#039; &#039; &amp;&amp; v[i].substr(0,1) != &#039;&gt;&#039; ) { // Something that is not a reference tag<br /> o += &#039;&lt;ref&#039; + v[i] ;<br /> continue ;<br /> }<br /> n = v[i].split ( &#039;&gt;&#039; ) ;<br /> if ( n.length &lt; 2 ) { o += &#039;&lt;ref&#039; + v[i] ; continue ; }<br /> refstuff = n.shift() ;<br /> refstuff = refstuff.match ( /name=\&quot;(.*)\&quot;\s*$/ ) ;<br /> if ( null == refstuff ) refstuff = &#039;&#039; ;<br /> else refstuff = refstuff.pop() ;<br /> n = n.join ( &#039;&gt;&#039; ) ;<br /> n = n.split ( &#039;&lt;/ref&gt;&#039; ) ;<br /> if ( n.length &lt; 2 ) { o += &#039;&lt;ref&#039; + v[i] ; continue ; }<br /> refcontents = n.shift() ;<br /> // if ( n.length &gt; 1 ) { o += &#039;&lt;ref&#039; + v[i] ; continue ; }<br /> n = n.join ( &#039;&lt;/ref&gt;&#039; ) ;<br /> o += &#039;&lt;&lt;REF&#039; + cnt + &#039;&gt;&gt;&#039; + n ;<br /> refs.push ( cnt + &#039; : &#039; + refstuff + &#039; | &#039; + refcontents ) ;<br /> cnt++ ;<br /> }<br /> for ( i = 0 ; i &lt; refs.length ; i++ ) {<br /> var opt = document.createElement ( &#039;option&#039; ) ;<br /> opt.value = i ;<br /> opt.appendChild ( document.createTextNode ( refs[i] ) ) ;<br /> lec_tb_ref.appendChild ( opt ) ;<br /> }<br /> lines = o.split(&quot;\n&quot;) ;<br /> }<br /> <br /> // Begin of text<br /> while ( lines.length &gt; 0 ) {<br /> var no_ws = lines[0].replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> var lc = no_ws.toLowerCase() ;<br /> if ( lc == &quot;&quot; ) {<br /> lines.shift() ;<br /> if ( begin_templates != &#039;&#039; ) begin_templates += &quot;\n&quot; ;<br /> } else if ( lc.match(/^\{\{[^\{\}]*\}\}$/) ) {<br /> lines.shift() ;<br /> begin_templates = begin_templates + no_ws + &quot;\n&quot; ;<br /> } else if ( lc.match(/^\{\{[^\{\}]*$/) ) {<br /> begin_templates = begin_templates + lines.shift() + &quot;\n&quot; ;<br /> in_template++ ;<br /> } else if ( in_template &amp;&amp; lc.match(/^[^\}\{]*\}\}\s*$/) ) {<br /> begin_templates = begin_templates + lines.shift() + &quot;\n&quot; ;<br /> in_template-- ;<br /> } else if ( in_template &gt; 0 ) {<br /> begin_templates = begin_templates + lines.shift() + &quot;\n&quot; ;<br /> } else if ( lc.match(/^[-_]+$/) || lc.match(/^\s*\&lt;hr\s*\/*\&gt;\s*$/) ) {<br /> begin_templates = begin_templates + lines.shift() + &quot;\n&quot; ;<br /> } else if ( lc.match(/^\[\[image\:.*\]\]$/) ) {<br /> begin_templates = begin_templates + lines.shift() + &quot;\n&quot; ;<br /> } else break ;<br /> }<br /> <br /> begin_templates = begin_templates.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> <br /> <br /> var categories = new Array () ;<br /> var languages = new Array () ;<br /> var end_templates = &quot;&quot; ;<br /> <br /> // End of text<br /> in_template = 0 ;<br /> end_templates_append = &quot;&quot; ;<br /> while ( lines.length &gt; 0 ) {<br /> var lp = lines.length - 1 ;<br /> var no_ws = lines[lp].replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> var lc = no_ws.toLowerCase() ;<br /> if ( lc == &quot;&quot; ) {<br /> lines.pop() ;<br /> if ( end_templates != &#039;&#039; ) end_templates = &quot;\n&quot; + end_templates ;<br /> } else if ( lc.substr ( 0 , 11 ) == &quot;[[category:&quot; ) {<br /> lines.pop() ;<br /> var s = no_ws.substr ( 11 ) ;<br /> s = s.replace ( /\]\]$/ , &quot;&quot; ) ;<br /> categories.push ( s ) ;<br /> } else if ( lc.match(/^\[\[\w+\:.*\]\]$/) ) {<br /> lines.pop() ;<br /> var s = no_ws.substr ( 2 ) ;<br /> s = s.replace ( /\]\]$/ , &quot;&quot; ) ;<br /> languages.push ( s ) ;<br /> } else if ( lc.match(/^\{\{defaultsort\s*[\|\:].*\}\}$/) ) {<br /> end_templates_append += &quot;\n\n&quot; + lines.pop() ;<br /> } else if ( lc.match(/^\&lt;!--.*--&gt;$/) ) {<br /> end_templates = lines.pop() + &quot;\n&quot; + end_templates ;<br /> } else if ( lc.match(/^\{\{.*\}\}$/) ) {<br /> end_templates = lines.pop() + &quot;\n&quot; + end_templates ;<br /> } else if ( lc.match(/^[^\{\}]*\}\}$/) ) {<br /> end_templates = lines.pop() + &quot;\n&quot; + end_templates ;<br /> in_template++ ;<br /> } else if ( lc.match(/^\{\{[^\{\}]*$/) ) {<br /> end_templates = lines.pop() + &quot;\n&quot; + end_templates ;<br /> in_template-- ;<br /> } else if ( in_template &gt; 0 ) {<br /> end_templates = lines.pop() + &quot;\n&quot; + end_templates ;<br /> } else break ;<br /> }<br /> <br /> var oet ;<br /> do {<br /> oet = end_templates ;<br /> end_templates = end_templates.split(&quot;\n\n\n&quot;).join(&quot;\n\n&quot;) ;<br /> } while ( end_templates != oet ) ;<br /> end_templates = end_templates.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> end_templates_append = end_templates_append.replace(/^\s+|\s+$/g,&quot;&quot;) ;<br /> if ( end_templates != &#039;&#039; &amp;&amp; end_templates_append != &#039;&#039; ) end_templates += &quot;\n\n&quot; ;<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(&quot;\n&quot;) ;<br /> lec_tb_ill.value = languages.sort().join(&quot;\n&quot;) ;<br /> lec_tb_bt.value = end_templates ;<br /> lec_tb1.value = lines.join(&quot;\n&quot;) ;<br /> }</div> Magnus Manske