MediaWiki:RefToolbarNoDialogs.js
Piezīme: Lai redzētu izmaiņas, pēc publicēšanas var nākties iztīrīt sava pārlūka kešatmiņu.
- Firefox / Safari: Pieturi Shift un klikšķini uz Pārlādēt vai nospied Ctrl-F5 vai Ctrl-R (⌘-R uz Mac)
- Google Chrome: Nospied Ctrl-Shift-R (⌘-Shift-R uz Mac)
- Internet Explorer / Edge: Pieturi Ctrl un klikšķini uz Pārlādēt vai nospied Ctrl-F5
- Opera: Nospied Ctrl-F5.
var numforms = 0;
var wikEdAutoUpdateUrl;
function refbuttons() {
if (mw.toolbar && (document.getElementById('toolbar') || document.getElementById('wikiEditor-section-main'))/* && wikEdAutoUpdateUrl == null*/) {
if (document.getElementById('toolbar')) {
button = document.createElement('a');
button.href = "javascript:easyCiteMain()";
button.title = "Ievietot atsauci";
buttonimage = document.createElement('img');
buttonimage.src = "//upload.wikimedia.org/wikipedia/commons/0/00/Button_easy_cite_%281%29.png";
buttonimage.alt = "Insert footnote";
button.appendChild(buttonimage);
document.getElementById('toolbar').appendChild(button);
} else {
button = document.createElement('a');
button.href = "#";
button.title = "Ievietot atsauci";
button.id = 'reftoolbar-button';
buttonimage = document.createElement('img');
buttonimage.src = "//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Curly_Brackets.svg/22px-Curly_Brackets.svg.png";
buttonimage.alt = "Ievietot atsauci";
button.classname = "tool tool-button";
buttonimage.style.width = "22px";
buttonimage.style.height = "17px";
buttonimage.style.paddingTop = "5px";
buttonimage.style.paddingLeft = "3px";
button.appendChild(buttonimage);
$('#wikiEditor-section-main .group-insert').append( button );
$(button).click( function() { easyCiteMain(); });
}
if (navigator.userAgent.indexOf('MSIE') == -1) {
citemain = document.createElement('div');
citemain.style.display = 'none';
citemain.setAttribute('Id', 'citeselect');
citemain.appendChild( addOption("citeWeb()", "Tīmekļa atsauce") );
citemain.appendChild( addOption("citeBook()", "Grāmatas atsauce") );
citemain.appendChild( addOption("citeJournal()", "Laikraksta atsauce") );
citemain.appendChild( addOption("citeNews()", "Ziņu atsauce") );
citemain.appendChild( addOption("citeNamedRef()", "Nosauktās atsauces") );
citemain.appendChild( addOption("dispErrors()", "Kļūdu pārbaude") );
citemain.appendChild( addOption("hideInitial()", "Atcelt") );
document.getElementById('wpTextbox1').parentNode.insertBefore(citemain, document.getElementById('wpTextbox1'));
}
else {
selection = '<div id="citeselect" style="display:none"><input type="button" value="Tīmekļa atsauce" onclick="citeWeb()" />'+
'<input type="button" value="Grāmatas atsauce" onclick="citeBook()" />'+
'<input type="button" value="Laikraksta atsauce" onclick="citeJournal()" />'+
'<input type="button" value="Ziņu atsauce" onclick="citeNews()" />'+
'<input type="button" value="Nosauktās atsauces" onclick="citeNamedRef()" />'+
'<input type="button" value="Kļūdu pārbaude" onclick="dispErrors()" />'+
'<input type="button" value="Atcelt" onclick="hideInitial()" /></div>';
document.getElementById('editform').innerHTML = selection + document.getElementById('editform').innerHTML;
}
}
}
function addOption(script, text) {
option = document.createElement('input');
option.setAttribute('type', 'button');
option.setAttribute('onclick', script);
option.setAttribute("value", text);
return option;
}
function hideInitial() {
document.getElementById('citeselect').style.display = 'none';
oldFormHide();
}
function oldFormHide() {
if (numforms != 0) {
document.getElementById('citediv'+numforms).style.display = 'none';
}
if (document.getElementById('errorform') != null) {
document.getElementById('citeselect').removeChild(document.getElementById('errorform'));
}
}
function easyCiteMain() {
document.getElementById('citeselect').style.display = '';
}
var months = ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs',
'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'];
var citeGlobalDateFormat = "{{dat|<year>|<month>|<date>||bez}}";
function getTime() {
var datestr = '';
if (typeof citeUserDateFormat != 'undefined') {
datestr = citeUserDateFormat;
} else {
datestr = citeGlobalDateFormat;
}
var DT = new Date();
var zmonth = '';
var month = DT.getUTCMonth()+1;
if (month < 10) {
zmonth = "0"+month.toString();
} else {
zmonth = month.toString();
}
month = month.toString();
var zdate = '';
var date = DT.getUTCDate()
if (date < 10) {
zdate = "0"+date.toString();
} else {
zdate = date.toString();
}
date = date.toString()
datestr = datestr.replace('<date>', date);
datestr = datestr.replace('<month>', month);
datestr = datestr.replace('<zdate>', zdate);
datestr = datestr.replace('<zmonth>', zmonth);
datestr = datestr.replace('<monthname>', months[DT.getUTCMonth()]);
datestr = datestr.replace('<year>', DT.getUTCFullYear().toString());
return (datestr);
}
function citeWeb() {
citeNewsWeb("tīmekļa atsauce");
}
function citeNews() {
citeNewsWeb("ziņu atsauce");
}
function citeNewsWeb(templatename) {
oldFormHide();
template = templatename;
var legend;
if (template == "tīmekļa atsauce") {
legend = "Tīmekļa atsauce";
} else {
legend = "Ziņu atsauce";
}
newtime = getTime();
numforms++;
form = '<div id="citediv'+numforms+'">'+
'<fieldset><legend>'+legend+'</legend>'+
'<table cellspacing="5">'+
'<input type="hidden" value="'+template+'" id="template">'+
'<tr><td width="120"><label for="url"> URL: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+
'<td width="120"><label for="title"> Nosaukums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td></tr>'+
'<tr><td width="120"><label for="last"> Uzvārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+
'<td width="120"><label for="first"> Vārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+
'<tr><td width="120"><label for="coauthors"> Līdzautori: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+
'<td width="120"><label for="date"> Datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td></tr>'+
'<tr><td width="120"><label for="work"> Darbs: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="work"></td>'+
'<td width="120"><label for="publisher"> Publicētājs: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td></tr>'+
'<tr><td width="120"><label for="pages"> Lappuses: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+
'<td width="120"><label for="language"> Valoda: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td></tr>'+
'<tr><td width="120"><label for="accessdate"> Skat. datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate" value="'+ newtime +'"></td>'+
'<td width="120"><label for="location"> Atrašanās vieta: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+
'<tr><td width="120"><label for="refname"> Atsauces nos.: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+
'</table>'+
'<input type="button" value="Pievienot atsauci" onClick="addcites()">'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
function citeBook() {
oldFormHide();
template = "grāmatas atsauce";
numforms++;
form = '<div id="citediv'+numforms+'">'+
'<fieldset><legend>Grāmatas atsauce</legend>'+
'<table cellspacing="5">'+
'<input type="hidden" value="'+template+'" id="template">'+
'<tr><td width="120"><label for="last"> Uzvārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+
'<td width="120"><label for="first"> Vārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+
'<tr><td width="120"><label for="coauthors"> Līdzautori: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+
'<td width="120"><label for="others"> Citi: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="others"></td></tr>'+
'<tr><td width="120"><label for="title"> Nosaukums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+
'<td width="120"><label for="editor"> Redaktors: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="editor"></td></tr>'+
'<tr><td width="120"><label for="publisher"> Publicētājs: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td>'+
'<td width="120"><label for="location"> Vieta: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+
'<tr><td width="120"><label for="date"> Datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td>'+
'<td width="120"><label for="edition"> Izdevums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="edition"></td></tr>'+
'<tr><td width="120"><label for="series"> Sērija: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="series"></td>'+
'<td width="120"><label for="volume"> Sējums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="volume"></td></tr>'+
'<tr><td width="120"><label for="pages"> Lappuses: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+
'<td width="120"><label for="chapter"> Nodaļa: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="chapter"></td></tr>'+
'<tr><td width="120"><label for="isbn"> ISBN: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="isbn"></td>'+
'<td width="120"><label for="oclc"> OCLC: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="oclc"></td></tr>'+
'<tr><td width="120"><label for="url"> URL: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+
'<td width="120"><label for="accessdate"> Skat. datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate"></td></tr>'+
'<tr><td width="120"><label for="language"> Valoda: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td>'+
'<td width="120"><label for="refname"> Ats. nosaukums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+
'</table>'+
'<input type="button" value="Pievienot atsauci" onClick="addcites()">'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
function citeJournal() {
oldFormHide();
template = "žurnāla atsauce";
numforms++;
form = '<div id="citediv'+numforms+'">'+
'<fieldset><legend>Laikraksta atsauce</legend>'+
'<table cellspacing="5">'+
'<input type="hidden" value="'+template+'" id="template">'+
'<tr><td width="120"><label for="last"> Uzvārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="last"></td>'+
'<td width="120"><label for="first"> Vārds: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="first"></td></tr>'+
'<tr><td width="120"><label for="coauthors"> Līdzautori: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="coauthors"></td>'+
'<td width="120"><label for="date"> Datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="date"></td></tr>'+
'<tr><td width="120"><label for="title"> Nosaukums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="title"></td>'+
'<td width="120"><label for="journal"> Laikraksts: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="journal"></td></tr>'+
'<tr><td width="120"><label for="publisher"> Publicētājs: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="publisher"></td>'+
'<td width="120"><label for="location"> Vieta: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="location"></td></tr>'+
'<tr><td width="120"><label for="volume"> Numurs: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="volume"></td>'+
'<td width="120"><label for="issue"> Izdevums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="issue"></td></tr>'+
'<tr><td width="120"><label for="pages"> Lappuses: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="pages"></td>'+
'<td width="120"><label for="issn"> ISSN: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="issn"></td></tr>'+
'<tr><td width="120"><label for="oclc"> OCLC: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="oclc"></td>'+
'<td width="120"><label for="language"> Valoda: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="language"></td></tr>'+
'<tr><td width="120"><label for="url"> URL: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="url"></td>'+
'<td width="120"><label for="accessdate"> Skat. datums: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="accessdate"></td></tr>'+
'<tr><td width="120"><label for="refname"> Atsauces nos.: </label></td>'+
'<td width="400"><input type="text" tabindex=1 style="width:100%" id="refname"></td></tr>'+
'</table>'+
'<input type="button" value="Pievienot atsauci" onClick="addcites()">'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
function addcites(template) {
cites = document.getElementById('citediv'+numforms).getElementsByTagName('input');
var citebegin = '<ref';
var citename = '';
var citeinner = '';
for (var i=0; i<cites.length-1; i++) {
if (cites[i].value != '' && cites[i].id != "refname" && cites[i].id != "template") {
citeinner += "|" + cites[i].id + "=" + cites[i].value;
}
else if (cites[i].value != '' && cites[i].id == "refname" && cites[i].id != "template") {
citebegin += ' name="' + cites[i].value + '"';
}
else if (cites[i].value != '' && cites[i].id != "refname" && cites[i].id == "template") {
citename = '>{{' + cites[i].value;
}
}
cite = citebegin + citename + citeinner + "}}</ref>";
$("#wpTextbox1").focus();
insertTags(cite, '', '');
document.getElementById('citediv'+numforms).style.display = 'none';
}
function getNamedRefs(calls) {
if (typeof(wikEdUseWikEd) != 'undefined') {
if (wikEdUseWikEd == true) {
WikEdUpdateTextarea();
}
}
text = document.getElementById('wpTextbox1').value;
var regex;
if (calls) {
regex = /< *?ref +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)) *?\/ *?>/gi //'
} else {
regex = /< *?ref +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)) *?>/gi //'
}
var namedrefs = [];
var i=0;
var nr=true;
do {
ref = regex.exec(text);
if(ref != null){
if (ref[5]) {
namedrefs[i] = ref[5];
} else if (ref[3]) {
namedrefs[i] = ref[3];
} else {
namedrefs[i] = ref[6];
}
i++;
} else {
nr=false;
}
} while (nr==true);
return namedrefs;
}
function citeNamedRef() {
namedrefs = getNamedRefs(false);
if (namedrefs == '') {
oldFormHide();
numforms++;
out = '<div id="citediv'+numforms+'"><fieldset>'+
'<legend>Atsauces tekstā</legend>Tekstā nav nosaukto atsauču (<tt><ref name="nosaukums"></tt>)</fieldset></div>';
document.getElementById('citeselect').innerHTML += out;
}
else {
oldFormHide();
numforms++;
form = '<div id="citediv'+numforms+'">'+
'<fieldset><legend>Atsauces tekstā</legend>'+
'<table cellspacing="5">'+
'<tr><td><label for="namedrefs"> Nosauktās atsauces tekstā</label></td>'+
'<td><select name="namedrefs" id="namedrefs">';
for (var i=0;i<namedrefs.length;i++) {
form+= '<option value="'+namedrefs[i]+'">'+namedrefs[i]+'</option>';
}
form+= '</select>'+
'</td></tr></table>'+
'<input type="button" value="Pievienot atsauci" onClick="addnamedcite()">'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
}
function addnamedcite() {
name = document.getElementById('citediv'+numforms).getElementsByTagName('select')[0].value;
ref = '<ref name="'+name+'" />';
$("#wpTextbox1").focus();
insertTags(ref, '', '');
document.getElementById('citediv'+numforms).style.display = 'none';
}
function getAllRefs() {
if (typeof(wikEdUseWikEd) != 'undefined') {
if (wikEdUseWikEd == true) {
WikEdUpdateTextarea();
}
}
text = document.getElementById('wpTextbox1').value;
regex = /< *?ref( +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)))? *?>((.|\n)*?)< *?\/? *?ref *?>/gim //"
var allrefs = [];
var i=0;
var nr=true;
do {
ref = regex.exec(text);
if(ref != null){
if (ref[0].search(/[^\s]{150}/) != -1) {
ref[0] = ref[0].replace(/\|([^\s])/g, "| $1");
}
ref[0] = ref[0].replace(/</g, "<");
ref[0] = ref[0].replace(/>/g, ">");
allrefs[i] = ref[0];
i++;
} else {
nr=false;
}
} while (nr==true);
return allrefs;
}
function NRcallError(namedrefs, refname) {
for (var i=0; i<namedrefs.length; i++) {
if (namedrefs[i] == refname) {
return true;
}
}
return false;
}
function errorCheck() {
var allrefs = getAllRefs();
var allrefscontent = [];
var samecontentexclude = [];
var sx=0;
var templateexclude = [];
var tx=0;
var skipcheck = false;
var namedrefcalls = getNamedRefs(true);
for (var i=0; i<allrefs.length; i++) {
allrefscontent[i] = allrefs[i].replace(/< *?ref( +?name *?= *?(('([^']*?)')|("([^"]*?)")|([^'"\s]*?[^\/]\b)))? *?>((.|\n)*?)< *?\/? *?ref *?>/gim, "$8"); //"
}
var namedrefs = getNamedRefs(false);
var errorlist = [];
var q=0;
unclosed = document.getElementById('unclosed').checked;
samecontent = document.getElementById('samecontent').checked;
templates = document.getElementById('templates').checked;
repeated = document.getElementById('repeated').checked;
undef = document.getElementById('undef').checked;
for (var i=0; i<allrefs.length; i++) {
if (allrefs[i].search(/< *?\/ *?ref *?>/) == -1 && unclosed) {
errorlist[q] = '<tr><td width="75%"><tt>'+allrefs[i]+'</tt></td>';
errorlist[q] += '<td width="25%">Neaizvērti <tt><ref></tt> tagi</td></tr>';
q++;
}
if (samecontent) {
for (var d=0; d<samecontentexclude.length; d++) {
if (allrefscontent[i] == samecontentexclude[d]) {
skipcheck = true;
}
}
var p=0;
while (p<allrefs.length && !skipcheck) {
if (allrefscontent[i] == allrefscontent[p] && i != p) {
errorlist[q] = '<tr><td width="75%"><tt>'+allrefscontent[i]+'</tt></td>';
errorlist[q] += '<td width="25%">Vairākām atsaucēm ir vienāds saturs, to vietā jāizmanto nosauktā atsauce</td></tr>';
q++;
samecontentexclude[sx] = allrefscontent[i]
sx++;
break;
}
p++;
}
skipcheck=false;
}
if (templates) {
if (allrefscontent[i].search(/atsauce/i) == -1 && 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) {
for (var x=0; x<templateexclude.length; x++) {
if (allrefscontent[i] == templateexclude[x]) {
skipcheck = true;
}
}
if (!skipcheck) {
errorlist[q] = '<tr><td width="75%"><tt>'+allrefs[i]+'</tt></td>';
errorlist[q] += '<td width="25%">Netiek izmantotas atsauču veidnes</td></tr>';
q++;
templateexclude[tx] = allrefscontent[i];
tx++;
}
skipcheck = false;
}
}
}
if (repeated) {
var repeatnameexclude = [];
var rx=0;
for (var k=0; k<namedrefs.length; k++) {
for (var d=0; d<repeatnameexclude.length; d++) {
if (namedrefs[k] == repeatnameexclude[d]) {
skipcheck = true;
}
}
var z=0;
while (z<namedrefs.length && !skipcheck) {
if (namedrefs[k] == namedrefs[z] && k != z) {
errorlist[q] = '<tr><td width="75%"><tt>'+namedrefs[k]+'</tt></td>';
errorlist[q] += '<td width="25%">Vairākām atsaucēm piešķirts vienāds nosaukums</td></tr>';
q++;
repeatnameexclude[rx] = namedrefs[z];
rx++;
break;
}
z++;
}
skipcheck = false;
}
}
if (undef) {
var undefexclude = [];
var ux=0;
for (var p=0; p<namedrefcalls.length; p++) {
for (var d=0; d<undefexclude.length; d++) {
if (allrefscontent[i] == undefexclude[d]) {
skipcheck = true;
}
}
if (!skipcheck) {
if (!NRcallError(namedrefs, namedrefcalls[p])) {
errorlist[q] = '<tr><td width="75%"><tt>'+namedrefcalls[p]+'</tt></td>';
errorlist[q] += '<td width="25%">Tiek izmantota nosaukta atsauce, bet tā nav definēta</td></tr>';
q++;
undefexclude[ux] = namedrefs[p];
ux++;
}
}
skipcheck = false;
}
}
if (q > 0) {
return errorlist;
} else {
return 0;
}
}
function dispErrors() {
oldFormHide();
form = '<div id="errorform"><fieldset>'+
'<legend>Kļūdu pārbaude</legend>'+
'<b>Pārbaudīt:</b><br/>'+
'<input type="checkbox" id="unclosed" />Neaizvērti <tt><ref></tt> tagi<br/>'+
'<input type="checkbox" id="samecontent" />Atsauces ar vienādu saturu<br/>'+
'<input type="checkbox" id="templates" />Atsauces, kas neizmanto atsauču veidnes<br/>'+
'<input type="checkbox" id="repeated" />Vairākas atsauces, kam piešķirts vienāds nosaukums<br/>'+
'<input type="checkbox" id="undef" />Nedefinētu nosaukto atsauču izmantojums<br/>'+
'<input type="button" id="errorchecksubmit" value="Pārbaudīt izvēlētās kļūdas" onclick="doErrorCheck()"/>'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
function doErrorCheck() {
var errors = errorCheck();
document.getElementById('citeselect').removeChild(document.getElementById('errorform'));
if (errors == 0) {
if (numforms != 0) {
document.getElementById('citediv'+numforms).style.display = 'none';
}
numforms++;
out = '<div id="citediv'+numforms+'"><fieldset>'+
'<legend>Kļūdu pārbaude</legend>Netika atrasta neviena kļūda</fieldset></div>';
document.getElementById('citeselect').innerHTML += out;
}
else {
if (numforms != 0) {
document.getElementById('citediv'+numforms).style.display = 'none';
}
numforms++;
form = '<div id="citediv'+numforms+'">'+
'<fieldset><legend>Kļūdu pārbaude</legend>'+
'<table border="1px">';
for (var i=0; i<errors.length; i++) {
form+=errors[i];
}
form+= '</table>'+
'</fieldset></div>';
document.getElementById('citeselect').innerHTML += form;
}
}
$( refbuttons );