http://en.demopaedia.org/w/index.php?title=MediaWiki:RefToolbarNoDialogs.js&feed=atom&action=history
MediaWiki:RefToolbarNoDialogs.js - Revision history
2024-03-29T11:41:58Z
Revision history for this page on the wiki
MediaWiki 1.28.0
http://en.demopaedia.org/w/index.php?title=MediaWiki:RefToolbarNoDialogs.js&diff=519&oldid=prev
Nicolas Brouard: Adding cite encyclopedia (inBook)
2012-10-02T09:28:31Z
<p>Adding cite encyclopedia (inBook)</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 09:28, 2 October 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l36" >Line 36:</td>
<td colspan="2" class="diff-lineno">Line 36:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeWeb()", "Cite web") );</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeWeb()", "Cite web") );</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeBook()", "Cite book") );</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeBook()", "Cite book") );</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      citemain.appendChild( addOption("citeEncyclopedia()", "Cite encyclopedia") );</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeJournal()", "Cite journal") );</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeJournal()", "Cite journal") );</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeNews()", "Cite news") );</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       citemain.appendChild( addOption("citeNews()", "Cite news") );</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l46" >Line 46:</td>
<td colspan="2" class="diff-lineno">Line 47:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     selection = '<div id="citeselect" style="display:none"><input type="button" value="Cite web" onclick="citeWeb()" />'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     selection = '<div id="citeselect" style="display:none"><input type="button" value="Cite web" onclick="citeWeb()" />'+</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite book" onclick="citeBook()" />'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite book" onclick="citeBook()" />'+</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<input type="button" value="Cite encyclopedia" onclick="citeEncyclopedia()" />'+</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite journal" onclick="citeJournal()" />'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite journal" onclick="citeJournal()" />'+</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite news" onclick="citeNews()" />'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<input type="button" value="Cite news" onclick="citeNews()" />'+</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l190" >Line 190:</td>
<td colspan="2" class="diff-lineno">Line 192:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     '<tr><td width="120"><label for="title">&nbsp;Title: </label></td>'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     '<tr><td width="120"><label for="title">&nbsp;Title: </label></td>'+</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="editor">&nbsp;Editor: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="editor"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="publisher">&nbsp;Publisher: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="location">&nbsp;Location: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="date">&nbsp;Publication date: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="edition">&nbsp;Edition: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="edition"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="series">&nbsp;Series: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="series"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="volume">&nbsp;Volume: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="volume"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="pages">&nbsp;Pages: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="chapter">&nbsp;Chapter: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="chapter"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="isbn">&nbsp;ISBN: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="isbn"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="oclc">&nbsp;OCLC: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="oclc"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="url">&nbsp;URL: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="accessdate">&nbsp;Access date: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="language">&nbsp;Language: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="refname">&nbsp;Reference name: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '</table>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<input type="button" value="Add citation" onClick="addcites()">'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;"> '</fieldset></div>';</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">  document.getElementById('citeselect').innerHTML += form;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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"> </td><td class='diff-marker'>+</td><td style="color:black; 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"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">function citeEncyclopedia() {</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">  oldFormHide();</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">  template = "cite encyclopedia";</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">  numforms++;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">  form = '<div id="citediv'+numforms+'">'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<fieldset><legend>Cite encyclopedia source</legend>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<table cellspacing="5">'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<input type="hidden" value="'+template+'" id="template">'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="last">&nbsp;Last name: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="first">&nbsp;First name: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="coauthors">&nbsp;Coauthors: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<td width="120"><label for="others">&nbsp;Others: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="others"></td></tr>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="title">&nbsp;Title: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">    '<tr><td width="120"><label for="encyclopedia">&nbsp;Encyclopedia: </label></td>'+</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;">      '<td width="400"><input type="text" tabindex=1 style="width:100%" id="encyclopedia"></td>'+</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     '<td width="120"><label for="editor">&nbsp;Editor: </label></td>'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     '<td width="120"><label for="editor">&nbsp;Editor: </label></td>'+</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<td width="400"><input type="text" tabindex=1 style="width:100%" id="editor"></td></tr>'+</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>       '<td width="400"><input type="text" tabindex=1 style="width:100%" id="editor"></td></tr>'+</div></td></tr>
</table>
Nicolas Brouard
http://en.demopaedia.org/w/index.php?title=MediaWiki:RefToolbarNoDialogs.js&diff=514&oldid=prev
Nicolas Brouard: From en.wikipedia.org
2012-10-02T09:12:35Z
<p>From en.wikipedia.org</p>
<p><b>New page</b></p><div>var numforms = 0;<br />
var wikEdAutoUpdateUrl;<br />
function refbuttons() {<br />
if (mwCustomEditButtons && (document.getElementById('toolbar') || document.getElementById('wikiEditor-ui-toolbar'))/* && wikEdAutoUpdateUrl == null*/) {<br />
if (document.getElementById('toolbar')) {<br />
button = document.createElement('a');<br />
button.href = "javascript:easyCiteMain()";<br />
button.title = "Insert citation";<br />
buttonimage = document.createElement('img');<br />
buttonimage.src = "//upload.wikimedia.org/wikipedia/commons/0/00/Button_easy_cite_%281%29.png";<br />
buttonimage.alt = "Insert footnote";<br />
button.appendChild(buttonimage);<br />
document.getElementById('toolbar').appendChild(button);<br />
} else {<br />
button = document.createElement('a');<br />
button.href = "#";<br />
button.title = "Insert citation";<br />
button.id = 'reftoolbar-button';<br />
buttonimage = document.createElement('img');<br />
buttonimage.src = "//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Curly_Brackets.svg/22px-Curly_Brackets.svg.png";<br />
buttonimage.alt = "Insert citation";<br />
button.classname = "tool tool-button";<br />
buttonimage.style.width = "22px";<br />
buttonimage.style.height = "17px";<br />
buttonimage.style.paddingTop = "5px";<br />
buttonimage.style.paddingLeft = "3px";<br />
button.appendChild(buttonimage)<br />
document.getElementById('wikiEditor-ui-toolbar').childNodes[0].childNodes[1].appendChild(button);<br />
//document.getElementById('reftoolbar-button').onclick = easyCiteMain;<br />
$j('#reftoolbar-button').live('click', function() { easyCiteMain(); });<br />
}<br />
if (navigator.userAgent.indexOf('MSIE') == -1) {<br />
citemain = document.createElement('div');<br />
citemain.style.display = 'none';<br />
citemain.setAttribute('Id', 'citeselect');<br />
citemain.appendChild( addOption("citeWeb()", "Cite web") );<br />
citemain.appendChild( addOption("citeBook()", "Cite book") );<br />
citemain.appendChild( addOption("citeJournal()", "Cite journal") );<br />
citemain.appendChild( addOption("citeNews()", "Cite news") );<br />
citemain.appendChild( addOption("citeNamedRef()", "Named ref") );<br />
citemain.appendChild( addOption("dispErrors()", "Error check") );<br />
citemain.appendChild( addOption("hideInitial()", "Cancel") );<br />
document.getElementById('wpTextbox1').parentNode.insertBefore(citemain, document.getElementById('wpTextbox1'));<br />
}<br />
else {<br />
selection = '<div id="citeselect" style="display:none"><input type="button" value="Cite web" onclick="citeWeb()" />'+<br />
'<input type="button" value="Cite book" onclick="citeBook()" />'+<br />
'<input type="button" value="Cite journal" onclick="citeJournal()" />'+<br />
'<input type="button" value="Cite news" onclick="citeNews()" />'+<br />
'<input type="button" value="Named ref" onclick="citeNamedRef()" />'+<br />
'<input type="button" value="Error check" onclick="dispErrors()" />'+<br />
'<input type="button" value="Cancel" onclick="hideInitial()" /></div>';<br />
document.getElementById('editform').innerHTML = selection + document.getElementById('editform').innerHTML;<br />
}<br />
}<br />
}<br />
<br />
function addOption(script, text) {<br />
option = document.createElement('input');<br />
option.setAttribute('type', 'button');<br />
option.setAttribute('onclick', script);<br />
option.setAttribute("value", text);<br />
return option;<br />
}<br />
<br />
function hideInitial() {<br />
document.getElementById('citeselect').style.display = 'none';<br />
oldFormHide();<br />
}<br />
<br />
function oldFormHide() {<br />
if (numforms != 0) {<br />
document.getElementById('citediv'+numforms).style.display = 'none';<br />
}<br />
if (document.getElementById('errorform') != null) {<br />
document.getElementById('citeselect').removeChild(document.getElementById('errorform'));<br />
}<br />
} <br />
<br />
function easyCiteMain() {<br />
document.getElementById('citeselect').style.display = '';<br />
}<br />
<br />
var months = ['January', 'February', 'March', 'April', 'May', 'June',<br />
'July', 'August', 'September', 'October', 'November', 'December'];<br />
var citeGlobalDateFormat = "<date> <monthname> <year>";<br />
function getTime() {<br />
var datestr = '';<br />
if (typeof citeUserDateFormat != 'undefined') {<br />
datestr = citeUserDateFormat;<br />
} else {<br />
datestr = citeGlobalDateFormat;<br />
}<br />
var DT = new Date();<br />
var zmonth = '';<br />
var month = DT.getUTCMonth()+1;<br />
if (month < 10) {<br />
zmonth = "0"+month.toString();<br />
} else {<br />
zmonth = month.toString();<br />
}<br />
month = month.toString();<br />
var zdate = '';<br />
var date = DT.getUTCDate()<br />
if (date < 10) {<br />
zdate = "0"+date.toString();<br />
} else {<br />
zdate = date.toString();<br />
}<br />
date = date.toString()<br />
datestr = datestr.replace('<date>', date);<br />
datestr = datestr.replace('<month>', month);<br />
datestr = datestr.replace('<zdate>', zdate);<br />
datestr = datestr.replace('<zmonth>', zmonth);<br />
datestr = datestr.replace('<monthname>', months[DT.getUTCMonth()]);<br />
datestr = datestr.replace('<year>', DT.getUTCFullYear().toString());<br />
return (datestr);<br />
}<br />
<br />
function citeWeb() {<br />
citeNewsWeb("cite web");<br />
}<br />
function citeNews() {<br />
citeNewsWeb("cite news");<br />
}<br />
<br />
function citeNewsWeb(templatename) {<br />
oldFormHide();<br />
template = templatename;<br />
var legend;<br />
if (template == "cite web") {<br />
legend = "Cite web source";<br />
} else {<br />
legend = "Cite news source";<br />
}<br />
newtime = getTime();<br />
numforms++;<br />
form = '<div id="citediv'+numforms+'">'+<br />
'<fieldset><legend>'+legend+'</legend>'+<br />
'<table cellspacing="5">'+<br />
'<input type="hidden" value="'+template+'" id="template">'+<br />
'<tr><td width="120"><label for="url">&nbsp;URL: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+<br />
'<td width="120"><label for="title">&nbsp;Title: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td></tr>'+<br />
'<tr><td width="120"><label for="last">&nbsp;Last name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+<br />
'<td width="120"><label for="first">&nbsp;First name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+<br />
'<tr><td width="120"><label for="coauthors">&nbsp;Coauthors: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+<br />
'<td width="120"><label for="date">&nbsp;Publication date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td></tr>'+<br />
'<tr><td width="120"><label for="work">&nbsp;Work: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="work"></td>'+<br />
'<td width="120"><label for="publisher">&nbsp;Publisher: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td></tr>'+<br />
'<tr><td width="120"><label for="pages">&nbsp;Pages: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+<br />
'<td width="120"><label for="language">&nbsp;Language: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td></tr>'+<br />
'<tr><td width="120"><label for="accessdate">&nbsp;Access date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate" value="'+ newtime +'"></td>'+<br />
'<td width="120"><label for="location">&nbsp;Location: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+<br />
'<tr><td width="120"><label for="refname">&nbsp;Reference name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+<br />
'</table>'+<br />
'<input type="button" value="Add citation" onClick="addcites()">'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
<br />
function citeBook() {<br />
oldFormHide();<br />
template = "cite book";<br />
numforms++;<br />
form = '<div id="citediv'+numforms+'">'+<br />
'<fieldset><legend>Cite book source</legend>'+<br />
'<table cellspacing="5">'+<br />
'<input type="hidden" value="'+template+'" id="template">'+<br />
'<tr><td width="120"><label for="last">&nbsp;Last name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+<br />
'<td width="120"><label for="first">&nbsp;First name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+<br />
'<tr><td width="120"><label for="coauthors">&nbsp;Coauthors: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+<br />
'<td width="120"><label for="others">&nbsp;Others: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="others"></td></tr>'+<br />
'<tr><td width="120"><label for="title">&nbsp;Title: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+<br />
'<td width="120"><label for="editor">&nbsp;Editor: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="editor"></td></tr>'+<br />
'<tr><td width="120"><label for="publisher">&nbsp;Publisher: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td>'+<br />
'<td width="120"><label for="location">&nbsp;Location: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+<br />
'<tr><td width="120"><label for="date">&nbsp;Publication date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td>'+<br />
'<td width="120"><label for="edition">&nbsp;Edition: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="edition"></td></tr>'+<br />
'<tr><td width="120"><label for="series">&nbsp;Series: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="series"></td>'+<br />
'<td width="120"><label for="volume">&nbsp;Volume: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="volume"></td></tr>'+<br />
'<tr><td width="120"><label for="pages">&nbsp;Pages: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+<br />
'<td width="120"><label for="chapter">&nbsp;Chapter: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="chapter"></td></tr>'+<br />
'<tr><td width="120"><label for="isbn">&nbsp;ISBN: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="isbn"></td>'+<br />
'<td width="120"><label for="oclc">&nbsp;OCLC: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="oclc"></td></tr>'+<br />
'<tr><td width="120"><label for="url">&nbsp;URL: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+<br />
'<td width="120"><label for="accessdate">&nbsp;Access date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate"></td></tr>'+<br />
'<tr><td width="120"><label for="language">&nbsp;Language: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td>'+<br />
'<td width="120"><label for="refname">&nbsp;Reference name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+<br />
'</table>'+<br />
'<input type="button" value="Add citation" onClick="addcites()">'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
<br />
function citeJournal() {<br />
oldFormHide();<br />
template = "cite journal";<br />
numforms++;<br />
form = '<div id="citediv'+numforms+'">'+<br />
'<fieldset><legend>Cite book source</legend>'+<br />
'<table cellspacing="5">'+<br />
'<input type="hidden" value="'+template+'" id="template">'+<br />
'<tr><td width="120"><label for="last">&nbsp;Last name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+<br />
'<td width="120"><label for="first">&nbsp;First name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+<br />
'<tr><td width="120"><label for="coauthors">&nbsp;Coauthors: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+<br />
'<td width="120"><label for="date">&nbsp;Publication date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td></tr>'+<br />
'<tr><td width="120"><label for="title">&nbsp;Title: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+<br />
'<td width="120"><label for="journal">&nbsp;Journal: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="journal"></td></tr>'+<br />
'<tr><td width="120"><label for="publisher">&nbsp;Publisher: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td>'+<br />
'<td width="120"><label for="location">&nbsp;Location: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+<br />
'<tr><td width="120"><label for="volume">&nbsp;Volume: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="volume"></td>'+<br />
'<td width="120"><label for="issue">&nbsp;Issue: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="issue"></td></tr>'+<br />
'<tr><td width="120"><label for="pages">&nbsp;Pages: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+<br />
'<td width="120"><label for="issn">&nbsp;ISSN: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="issn"></td></tr>'+<br />
'<tr><td width="120"><label for="oclc">&nbsp;OCLC: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="oclc"></td>'+<br />
'<td width="120"><label for="language">&nbsp;Language: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td></tr>'+<br />
'<tr><td width="120"><label for="url">&nbsp;URL: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+<br />
'<td width="120"><label for="accessdate">&nbsp;Access date: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate"></td></tr>'+<br />
'<tr><td width="120"><label for="refname">&nbsp;Reference name: </label></td>'+<br />
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+<br />
'</table>'+<br />
'<input type="button" value="Add citation" onClick="addcites()">'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
<br />
function addcites(template) {<br />
cites = document.getElementById('citediv'+numforms).getElementsByTagName('input');<br />
var citebegin = '<ref';<br />
var citename = '';<br />
var citeinner = '';<br />
for (var i=0; i<cites.length-1; i++) {<br />
if (cites[i].value != '' && cites[i].id != "refname" && cites[i].id != "template") {<br />
citeinner += "|" + cites[i].id + "=" + cites[i].value;<br />
}<br />
else if (cites[i].value != '' && cites[i].id == "refname" && cites[i].id != "template") {<br />
citebegin += ' name="' + cites[i].value + '"';<br />
}<br />
else if (cites[i].value != '' && cites[i].id != "refname" && cites[i].id == "template") {<br />
citename = '>{{' + cites[i].value;<br />
}<br />
}<br />
cite = citebegin + citename + citeinner + "}}</ref>";<br />
insertTags(cite, '', '');<br />
document.getElementById('citediv'+numforms).style.display = 'none';<br />
}<br />
<br />
function getNamedRefs(calls) {<br />
if (typeof(wikEdUseWikEd) != 'undefined') {<br />
if (wikEdUseWikEd == true) {<br />
WikEdUpdateTextarea();<br />
}<br />
}<br />
text = document.getElementById('wpTextbox1').value;<br />
var regex;<br />
if (calls) {<br />
regex = /< *?ref +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)) *?\/ *?>/gi //'<br />
} else {<br />
regex = /< *?ref +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)) *?>/gi //'<br />
}<br />
var namedrefs = new Array();<br />
var i=0;<br />
var nr=true;<br />
do {<br />
ref = regex.exec(text);<br />
if(ref != null){<br />
if (ref[5]) {<br />
namedrefs[i] = ref[5];<br />
} else if (ref[3]) {<br />
namedrefs[i] = ref[3];<br />
} else {<br />
namedrefs[i] = ref[6];<br />
}<br />
i++;<br />
} else {<br />
nr=false;<br />
}<br />
} while (nr==true);<br />
return namedrefs;<br />
}<br />
<br />
function citeNamedRef() {<br />
namedrefs = getNamedRefs(false);<br />
if (namedrefs == '') {<br />
oldFormHide();<br />
numforms++;<br />
out = '<div id="citediv'+numforms+'"><fieldset>'+<br />
'<legend>References in text</legend>There are no named refs (<tt>&lt;ref name="Name"&gt;</tt>) in the text</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += out;<br />
}<br />
else {<br />
oldFormHide();<br />
numforms++;<br />
form = '<div id="citediv'+numforms+'">'+<br />
'<fieldset><legend>References in article</legend>'+<br />
'<table cellspacing="5">'+<br />
'<tr><td><label for="namedrefs">&nbsp;Named references in text</label></td>'+<br />
'<td><select name="namedrefs" id="namedrefs">';<br />
for (var i=0;i<namedrefs.length;i++) {<br />
form+= '<option value="'+namedrefs[i]+'">'+namedrefs[i]+'</option>';<br />
}<br />
form+= '</select>'+<br />
'</td></tr></table>'+<br />
'<input type="button" value="Add citation" onClick="addnamedcite()">'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
}<br />
<br />
function addnamedcite() {<br />
name = document.getElementById('citediv'+numforms).getElementsByTagName('select')[0].value;<br />
ref = '<ref name="'+name+'" />';<br />
insertTags(ref, '', '');<br />
document.getElementById('citediv'+numforms).style.display = 'none';<br />
}<br />
<br />
function getAllRefs() {<br />
if (typeof(wikEdUseWikEd) != 'undefined') {<br />
if (wikEdUseWikEd == true) {<br />
WikEdUpdateTextarea();<br />
}<br />
}<br />
text = document.getElementById('wpTextbox1').value;<br />
regex = /< *?ref( +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)))? *?>((.|\n)*?)< *?\/? *?ref *?>/gim //"<br />
var allrefs = new Array();<br />
var i=0;<br />
var nr=true;<br />
do {<br />
ref = regex.exec(text);<br />
if(ref != null){<br />
if (ref[0].search(/[^\s]{150}/) != -1) {<br />
ref[0] = ref[0].replace(/\|([^\s])/g, "| $1");<br />
}<br />
ref[0] = ref[0].replace(/</g, "&lt;");<br />
ref[0] = ref[0].replace(/>/g, "&gt;");<br />
allrefs[i] = ref[0];<br />
i++;<br />
} else {<br />
nr=false;<br />
}<br />
} while (nr==true);<br />
return allrefs;<br />
}<br />
<br />
function NRcallError(namedrefs, refname) {<br />
for (var i=0; i<namedrefs.length; i++) {<br />
if (namedrefs[i] == refname) {<br />
return true;<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
function errorCheck() {<br />
var allrefs = getAllRefs();<br />
var allrefscontent = new Array();<br />
var samecontentexclude = new Array();<br />
var sx=0;<br />
var templateexclude = new Array();<br />
var tx=0;<br />
var skipcheck = false;<br />
var namedrefcalls = getNamedRefs(true);<br />
for (var i=0; i<allrefs.length; i++) {<br />
allrefscontent[i] = allrefs[i].replace(/&lt; *?ref( +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)))? *?&gt;((.|\n)*?)&lt; *?\/? *?ref *?&gt;/gim, "$8"); //"<br />
}<br />
var namedrefs = getNamedRefs(false);<br />
var errorlist = new Array();<br />
var q=0;<br />
unclosed = document.getElementById('unclosed').checked;<br />
samecontent = document.getElementById('samecontent').checked;<br />
templates = document.getElementById('templates').checked;<br />
repeated = document.getElementById('repeated').checked;<br />
undef = document.getElementById('undef').checked;<br />
for (var i=0; i<allrefs.length; i++) {<br />
if (allrefs[i].search(/&lt; *?\/ *?ref *?&gt;/) == -1 && unclosed) {<br />
errorlist[q] = '<tr><td width="75%"><tt>'+allrefs[i]+'</tt></td>';<br />
errorlist[q] += '<td width="25%">Unclosed <tt>&lt;ref&gt;</tt> tag</td></tr>';<br />
q++;<br />
}<br />
if (samecontent) {<br />
for (var d=0; d<samecontentexclude.length; d++) {<br />
if (allrefscontent[i] == samecontentexclude[d]) {<br />
skipcheck = true;<br />
}<br />
}<br />
var p=0;<br />
while (p<allrefs.length && !skipcheck) {<br />
if (allrefscontent[i] == allrefscontent[p] && i != p) {<br />
errorlist[q] = '<tr><td width="75%"><tt>'+allrefscontent[i]+'</tt></td>';<br />
errorlist[q] += '<td width="25%">Multiple refs contain this content, a <a href="//en.wikipedia.org/wiki/Wikipedia:Footnotes#Naming_a_ref_tag_so_it_can_be_used_more_than_once">named reference</a> should be used instead</td></tr>';<br />
q++;<br />
samecontentexclude[sx] = allrefscontent[i]<br />
sx++;<br />
break;<br />
}<br />
p++;<br />
}<br />
skipcheck=false;<br />
}<br />
if (templates) {<br />
if (allrefscontent[i].search(/\{\{cite/i) == -1 && allrefscontent[i].search(/\{\{citation/i) == -1 && allrefscontent[i].search(/\{\{Comic (book|strip) reference/i) == -1 && allrefscontent[i].search(/\{\{Editorial cartoon reference/i) == -1 && allrefscontent[i].search(/\{\{harv/i) == -1) {<br />
for (var x=0; x<templateexclude.length; x++) {<br />
if (allrefscontent[i] == templateexclude[x]) {<br />
skipcheck = true;<br />
}<br />
}<br />
if (!skipcheck) {<br />
errorlist[q] = '<tr><td width="75%"><tt>'+allrefs[i]+'</tt></td>';<br />
errorlist[q] += '<td width="25%">Does not use a <a href="//en.wikipedia.org/wiki/Wikipedia:Citation_templates">citation template</a></td></tr>';<br />
q++;<br />
templateexclude[tx] = allrefscontent[i];<br />
tx++;<br />
}<br />
skipcheck = false;<br />
}<br />
}<br />
}<br />
if (repeated) {<br />
var repeatnameexclude = new Array();<br />
var rx=0;<br />
for (var k=0; k<namedrefs.length; k++) {<br />
for (var d=0; d<repeatnameexclude.length; d++) {<br />
if (namedrefs[k] == repeatnameexclude[d]) {<br />
skipcheck = true;<br />
}<br />
}<br />
var z=0;<br />
while (z<namedrefs.length && !skipcheck) {<br />
if (namedrefs[k] == namedrefs[z] && k != z) {<br />
errorlist[q] = '<tr><td width="75%"><tt>'+namedrefs[k]+'</tt></td>';<br />
errorlist[q] += '<td width="25%">Multiple references are given the same <a href="//en.wikipedia.org/wiki/Wikipedia:Footnotes#Naming_a_ref_tag_so_it_can_be_used_more_than_once">name</a></td></tr>';<br />
q++;<br />
repeatnameexclude[rx] = namedrefs[z];<br />
rx++;<br />
break;<br />
}<br />
z++;<br />
}<br />
skipcheck = false;<br />
}<br />
}<br />
if (undef) {<br />
var undefexclude = new Array();<br />
var ux=0;<br />
for (var p=0; p<namedrefcalls.length; p++) {<br />
for (var d=0; d<undefexclude.length; d++) {<br />
if (allrefscontent[i] == undefexclude[d]) {<br />
skipcheck = true;<br />
}<br />
}<br />
if (!skipcheck) {<br />
if (!NRcallError(namedrefs, namedrefcalls[p])) {<br />
errorlist[q] = '<tr><td width="75%"><tt>'+namedrefcalls[p]+'</tt></td>';<br />
errorlist[q] += '<td width="25%">A <a href="//en.wikipedia.org/wiki/Wikipedia:Footnotes#Naming_a_ref_tag_so_it_can_be_used_more_than_once">named reference</a> is used but not defined</td></tr>';<br />
q++;<br />
undefexclude[ux] = namedrefs[p];<br />
ux++;<br />
}<br />
}<br />
skipcheck = false;<br />
}<br />
}<br />
if (q > 0) {<br />
return errorlist;<br />
} else {<br />
return 0;<br />
}<br />
}<br />
<br />
function dispErrors() {<br />
oldFormHide();<br />
form = '<div id="errorform"><fieldset>'+<br />
'<legend>Error checking</legend>'+<br />
'<b>Check for:</b><br/>'+<br />
'<input type="checkbox" id="unclosed" /> Unclosed <tt>&lt;ref&gt;</tt> tags<br/>'+<br />
'<input type="checkbox" id="samecontent" /> References with the same content<br/>'+<br />
'<input type="checkbox" id="templates" /> References not using a <a href="//en.wikipedia.org/wiki/Wikipedia:Citation_templates">citation template</a><br/>'+<br />
'<input type="checkbox" id="repeated" /> Multiple references with the same name<br/>'+<br />
'<input type="checkbox" id="undef" /> Usage of undefined named references<br/>'+<br />
'<input type="button" id="errorchecksubmit" value="Check for selected errors" onclick="doErrorCheck()"/>'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
<br />
function doErrorCheck() {<br />
var errors = errorCheck();<br />
document.getElementById('citeselect').removeChild(document.getElementById('errorform'));<br />
if (errors == 0) {<br />
if (numforms != 0) {<br />
document.getElementById('citediv'+numforms).style.display = 'none';<br />
}<br />
numforms++;<br />
out = '<div id="citediv'+numforms+'"><fieldset>'+<br />
'<legend>Error checking</legend>No errors found.</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += out;<br />
}<br />
else {<br />
if (numforms != 0) {<br />
document.getElementById('citediv'+numforms).style.display = 'none';<br />
}<br />
numforms++;<br />
form = '<div id="citediv'+numforms+'">'+<br />
'<fieldset><legend>Error checking</legend>'+<br />
'<table border="1px">';<br />
for (var i=0; i<errors.length; i++) {<br />
form+=errors[i];<br />
}<br />
form+= '</table>'+<br />
'</fieldset></div>';<br />
document.getElementById('citeselect').innerHTML += form;<br />
}<br />
}<br />
<br />
$( refbuttons );</div>
Nicolas Brouard