Diferencia entre revisiones de «MediaWiki:RefToolbarConfig.js»

De Bioeticawiki
(Página creada con «/* Sitewide options for the the Cite toolbar button: * All options should be specified * * "date format" sets the date format used for the function to insert the current da...»)
 
Línea 20: Línea 20:
*
*
* "autoparse" - if true, previewing a ref will automatically trigger a preview of the parsed wikitext.
* "autoparse" - if true, previewing a ref will automatically trigger a preview of the parsed wikitext.
* Its not recommended to set this to true as a global setting as it may slow the script down for people
* It is not recommended to set this to true as a global setting as it may slow the script down for
* with slow connections
* people with slow connections.
*
*
* "expandtemplates" - if true, templates and parser functions will be expanded when getting page text
* "expandtemplates" - if true, templates and parser functions will be expanded when getting page text
Línea 28: Línea 28:
* This may slow loading the named refs and error check dialogs.
* This may slow loading the named refs and error check dialogs.
*/
*/
 
CiteTB.Options = {
CiteTB.Options = {
"date format" : "<date> de <monthname> de <year>",
"date format" : "<date> <monthname> <year>",
"autodate fields" : ['fechaacceso'],
"autodate fields" : ['accessdate'],
"months" : ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
"months" : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
"modal" : true,
"modal" : true,
"autoparse" : false,
"autoparse" : true,
"expandtemplates" : false
"expandtemplates" : false
};
};
 
// Cite template definitions
// Cite template definitions
new citeTemplate('cita web', 'Cita web',
new citeTemplate('cite web', 'web',
[ // Basic fields
[ // Basic fields
{"field": "autor"},  
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "título"},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true},  
{"field": "url", "label":"URL"},
{"field": "title", "autofillprop":"title"},
{"field": "fechaacceso"},
{"field": "url", "autofillid":"url"},
{"field": "obra", "tooltip": "cite-work-tooltip", "autofillprop":"revista"},
{"field": "website", "autofillprop":"journal"},
{"field": "fecha"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "idioma"},
{"field": "accessdate"},
{"field": "cita"}
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
],
[ // Expanded fields
[ // Expanded fields
{"field": "apellido", "label":"Apellido"},
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "nombre", "label":"Nombre"},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "enlaceautor", "label":"Artículo del autor", "tooltip":"cite-authorlink-tooltip"},
{"field": "archiveurl"},
{"field": "coautores"},
{"field": "archivedate"},
{"field": "urltrad"},
{"field": "location"},
{"field": "urlarchivo"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "fechaarchivo"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "editor"},
{"field": "language", "autofillprop":"language"},
{"field": "editorial"},
{"field": "format"},
{"field": "ubicación"},
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "página"},
{"field": "date", "autofillprop":"date"},
{"field": "páginas"},
{"field": "quote"}
{"field": "doi", "label":"DOI"},
{"field": "mes"},
{"field": "año"},
{"field": "formato"}
]);
]);
 
new citeTemplate('cita noticia', 'Cita noticia',
new citeTemplate('cite news', 'news',
[ // Basic fields
[ // Basic fields
{"field": "nombre", "label":"Nombre"},  
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "apellidos", "label":"Apellidos"},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true},  
{"field": "coautores", 'label': "Coautores"},
{"field": "title", "autofillprop":"title"},
{"field": "título"},
{"field": "url", "autofillid":"url"},
{"field": "url", "label":"URL"},
{"field": "accessdate"},
{"field": "obra"},
{"field": "work", "tooltip":"cite-work-tooltip", "autofillprop":"journal"},
{"field": "editorial"},
{"field": "agency"},
{"field": "fecha"},
{"field": "issue"},
{"field": "fechaacceso"}
{"field": "publisher", "autofillprop":"publisher"},
{"field": "date", "autofillprop":"date"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
],
[ // Expanded fields
[ // Expanded fields
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "autor"},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "enlaceautor", "label":"Artículo del autor", "tooltip":"cite-authorlink-tooltip"},
{"field": "archiveurl"},
{"field": "agencia"},
{"field": "archivedate"},
{"field": "página"},
{"field": "location"},
{"field": "páginas"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "idioma"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "formato"},
{"field": "language", "autofillprop":"language"},
{"field": "id", "label":"ID"},
{"field": "format"},
{"field": "cita"}
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "quote"}
]);
]);
 
new citeTemplate('cita libro', 'Cita libro',
new citeTemplate('cite book', 'book',
[ // Basic fields
[ // Basic fields
{"field": "apellidos", "label":"Apellidos"},
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "nombre", "label":"Nombre"},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true},  
{"field": "título"},
{"field": "title", "autofillprop":"title"},
{"field": "año"},
{"field": "date", "autofillprop":"year"},
{"field": "editorial"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "editor"},
{"field": "location", "autofillprop":"location"},
{"field": "autor", "label":"Autor", "tooltip":"Solo se utiliza si no especificaste el nombre y apellidos del autor."},
{"field": "isbn", "autofillid":"isbn", "autofillprop":"isbn"},
{"field": "enlaceautor", "label":"Artículo del autor", "tooltip":"cite-authorlink-tooltip"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "isbn", "label":"ISBN"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "páginas"},
{"field": "edition", "autofillprop":"edition"},
{"field": "ubicación"}
{"field": "url", "autofillid":"url"},
{"field": "accessdate"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
 
],
],
[ // Expanded fields
[ // Expanded fields
{"field": "apellidos2", "label":"Apellidos del segundo autor"},
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "nombre2", 'label': "Nombre del segundo autor"},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "apellidos3", "label":"Apellidos tercer autor"},
{"field": "editor<N>-last", "increment_group":"editor"},
{"field": "nombre3", 'label': "Nombre del tercer autor"},
{"field": "editor<N>-first", "increment_group":"editor", "increment_button":true},
{"field": "apellidos4", "label":"Apellidos del cuarto autor"},
{"field": "editor<N>-link", 'increment_group':'editorlink', 'increment_button':true},
{"field": "nombre4", 'label': "Nombre del cuarto autor"},
{"field": "archiveurl"},
{"field": "apellidos5", "label":"Apellidos del quinto autor"},
{"field": "archivedate"},
{"field": "nombre5", 'label': "Nombre del quinto autor"},
{"field": "language", "autofillprop":"language"},
{"field": "apellidos6", "label":"Apellidos del sexto autor"},
{"field": "format"},
{"field": "nombre6", 'label': "Nombre del sexto autor"},
{"field": "chapter", "autofillprop":"chapter"},
{"field": "apellidos7", "label":"Apellidos del séptimo autor"},
{"field": "quote"}
{"field": "nombre7", 'label': "Nombre del séptimo autor"},
{"field": "apellidos8", "label":"Apellidos del octavo autor"},
{"field": "nombre8", 'label': "Nombre del octavo autor"},
{"field": "apellidos9", "label":"Apellidos del noveno autor"},
{"field": "nombre9", 'label': "Nombre del noveno autor"},
{"field": "url", "label":"URL"},
{"field": "fechaacceso"},
//{"field": "archiveurl"}, //El parámetro no existe en Cita libro
//{"field": "archivedate"}, //El parámetro no existe en Cita libro
{"field": "página"},
{"field": "idioma"},
{"field": "formato"},
{"field": "capítulo"},
{"field": "fecha"},
{"field": "mes"},
{"field": "cita"}
]);
]);
 
new citeTemplate('cita publicación', 'Cita publicación',
new citeTemplate('cite journal', 'journal',
[ // Basic fields
[ // Basic fields
{"field": "apellido", "label":"Apellido"},
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "nombre", "label":"Nombre"},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true},  
{"field": "coautores"},
{"field": "title", "autofillprop":"title"},
{"field": "título"},
{"field": "journal", "autofillprop":"journal"},
{"field": "publicación"},
{"field": "date", "autofillprop":"date"},
{"field": "fecha"},
{"field": "volume", "autofillprop":"volume"},
{"field": "año"},
{"field": "issue", "autofillprop":"issue"},
{"field": "mes"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "volumen"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "serie"},
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "número"},
{"field": "pmid", "autofillid":"pmid"},
{"field": "páginas"},
{"field": "url", "autofillid":"url"},
{"field": "doi", "label":"DOI"},
{"field": "accessdate"},
{"field": "pmid", "label":"PMID"},
{"field": "ref", "tooltip":"cite-ref-tooltip"},
{"field": "url", "label":"URL"},
{"field": "fechaacceso"}
],
],
[ // Expanded fields
[ // Expanded fields
{"field": "autor"},
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "enlaceautor", "label":"Artículo del autor"},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "nombre-editor", "label":"Nombre del editor"},
{"field": "editor<N>-last", "increment_group":"editor"},
{"field": "apellidos-editor", "label":"Apellido del editor"},
{"field": "editor<N>-first", "increment_group":"editor", "increment_button":true},
{"field": "enlace-editor", "label":"Artículo del editor"},
{"field": "editor<N>-link", 'increment_group':'editorlink', 'increment_button':true},
{"field": "página"},
{"field": "series"},
{"field": "en", "tooltip":"cite-at-tooltip"},
{"field": "at", "tooltip":"cite-at-tooltip"},
{"field": "títulotrad", "label":"Título traducido"},
{"field": "trans-title"},
{"field": "editorial"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "ubicación"},
{"field": "location"},
{"field": "idioma"},
{"field": "language", "autofillprop":"language"},
{"field": "formato"},
{"field": "format"},
{"field": "issn", "label":"ISSN"},
{"field": "issn", "autofillprop":"issn"},
{"field": "pmc", "label":"PMC"},
{"field": "pmc"},
{"field": "oclc", "label":"OCLC"},
{"field": "oclc"},
{"field": "bibcode"},
{"field": "bibcode"},
{"field": "id", "label":"ID"},
{"field": "id"},
{"field": "resumen", "label":"Resumen"},
{"field": "quote"},
{"field": "fuenteresumen", "label":"Fuente del resumen"},
{"field": "fecharesumen", "label":"Fecha del resumen"},
{"field": "cita"},
{"field": "ref", "tooltip":"cite-ref-tooltip"},
{"field": "postscript", "tooltip":"cite-postscript-tooltip"}
{"field": "postscript", "tooltip":"cite-postscript-tooltip"}
]);
]);
 
new citeErrorCheck({'type':'reflist', 'testname':'samecontent', 'desc': 'cite-samecontent-desc',
new citeErrorCheck({'type':'reflist', 'testname':'samecontent', 'desc': 'cite-samecontent-desc',
'func': function(reflist) {
'func': function(reflist) {
Línea 189: Línea 169:
   for(var i=0; i<reflist.length; i++) {
   for(var i=0; i<reflist.length; i++) {
     if (!reflist[i].shorttag) {
     if (!reflist[i].shorttag) {
       if ($j.inArray(reflist[i].content, refs2) != -1) {
       if ($.inArray(reflist[i].content, refs2) != -1) {
         if ($j.inArray(reflist[i].content, errors) == -1) {
         if ($.inArray(reflist[i].content, errors) == -1) {
           errors.push(reflist[i].content);
           errors.push(reflist[i].content);
         }
         }
Línea 205: Línea 185:
}}
}}
);
);
 
new citeErrorCheck({'type':'reflist', 'testname':'repeated', 'desc':'cite-repeated-desc',
new citeErrorCheck({'type':'reflist', 'testname':'repeated', 'desc':'cite-repeated-desc',
'func': function(reflist) {
'func': function(reflist) {
Línea 212: Línea 192:
   for(var i=0; i<reflist.length; i++) {
   for(var i=0; i<reflist.length; i++) {
     if (!reflist[i].shorttag && reflist[i].refname) {
     if (!reflist[i].shorttag && reflist[i].refname) {
       if ($j.inArray(reflist[i].refname, refs2) != -1) {
       if ($.inArray(reflist[i].refname, refs2) != -1) {
         if ($j.inArray(reflist[i].refname, errors) == -1) {
         if ($.inArray(reflist[i].refname, errors) == -1) {
           errors.push(reflist[i].refname);
           errors.push(reflist[i].refname);
         }
         }
Línea 228: Línea 208:
}}
}}
);
);
 
new citeErrorCheck({'type':'reflist', 'testname':'undefined', 'desc':'cite-undefined-desc',
new citeErrorCheck({'type':'reflist', 'testname':'undefined', 'desc':'cite-undefined-desc',
'func': function(reflist) {
'func': function(reflist) {
Línea 239: Línea 219:
   }
   }
   for(var j=0; i<reflist.length; j++) {
   for(var j=0; i<reflist.length; j++) {
     if (reflist[i].shorttag && $j.inArray(reflist[i].refname, errors) == -1 && $j.inArray(reflist[i].refname, longrefs) == -1) {
     if (reflist[i].shorttag && $.inArray(reflist[i].refname, errors) == -1 && $.inArray(reflist[i].refname, longrefs) == -1) {
       errors.push(reflist[i].refname);
       errors.push(reflist[i].refname);
     }
     }
Línea 250: Línea 230:
}}
}}
);
);
 
CiteTB.init();
CiteTB.init();

Revisión del 12:12 26 oct 2018

/* Sitewide options for the the Cite toolbar button:
* All options should be specified
*
* "date format" sets the date format used for the function to insert the current date
* Current available options:
* date - the day of the month
* zdate - day of the month, zero padded to 2 digits
* monthname - The month name
* month - The numberic month (1-12)
* zmonth - numeric month, zero padded to 2 digits
* year - The full year (4 digits)
*
* "autodate fields" is a list of template fields that should have a button to insert the current date
* 
* "months" is a list of localized month names
*
* "modal" - if true, the dialogs will be modal windows, blocking access to the rest of the window.
* See http://en.wikipedia.org/wiki/Modal_window
* All dialogs in the toolbar are modal by default
*
* "autoparse" - if true, previewing a ref will automatically trigger a preview of the parsed wikitext.
* It is not recommended to set this to true as a global setting as it may slow the script down for
* people with slow connections.
*
* "expandtemplates" - if true, templates and parser functions will be expanded when getting page text
* (templates inside of ref tags will not be expanded). This will allow references inside of templates or
* references using {{#tag:ref}} to be listed in the named refs dialog and searched by error checks.
* This may slow loading the named refs and error check dialogs.
*/

CiteTB.Options = {
"date format" : "<date> <monthname> <year>",
"autodate fields" : ['accessdate'],
"months" : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
"modal" : true,
"autoparse" : true,
"expandtemplates" : false
};

// Cite template definitions
new citeTemplate('cite web', 'web',
[ // Basic fields
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "title", "autofillprop":"title"},
{"field": "url", "autofillid":"url"},
{"field": "website", "autofillprop":"journal"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "accessdate"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
[ // Expanded fields
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "archiveurl"},
{"field": "archivedate"},
{"field": "location"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "language", "autofillprop":"language"},
{"field": "format"},
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "date", "autofillprop":"date"},
{"field": "quote"}
]);

new citeTemplate('cite news', 'news',
[ // Basic fields
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "title", "autofillprop":"title"},
{"field": "url", "autofillid":"url"},
{"field": "accessdate"},
{"field": "work", "tooltip":"cite-work-tooltip", "autofillprop":"journal"},
{"field": "agency"},
{"field": "issue"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "date", "autofillprop":"date"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
[ // Expanded fields
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "archiveurl"},
{"field": "archivedate"},
{"field": "location"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "language", "autofillprop":"language"},
{"field": "format"},
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "quote"}
]);

new citeTemplate('cite book', 'book',
[ // Basic fields
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "title", "autofillprop":"title"},
{"field": "date", "autofillprop":"year"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "location", "autofillprop":"location"},
{"field": "isbn", "autofillid":"isbn", "autofillprop":"isbn"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "edition", "autofillprop":"edition"},
{"field": "url", "autofillid":"url"},
{"field": "accessdate"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}

],
[ // Expanded fields
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "editor<N>-last", "increment_group":"editor"},
{"field": "editor<N>-first", "increment_group":"editor", "increment_button":true},
{"field": "editor<N>-link", 'increment_group':'editorlink', 'increment_button':true},
{"field": "archiveurl"},
{"field": "archivedate"},
{"field": "language", "autofillprop":"language"},
{"field": "format"},
{"field": "chapter", "autofillprop":"chapter"},
{"field": "quote"}
]);

new citeTemplate('cite journal', 'journal',
[ // Basic fields
{"field": "last<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "first<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "title", "autofillprop":"title"},
{"field": "journal", "autofillprop":"journal"},
{"field": "date", "autofillprop":"date"},
{"field": "volume", "autofillprop":"volume"},
{"field": "issue", "autofillprop":"issue"},
{"field": "page", "tooltip":"cite-page-tooltip"},
{"field": "pages", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "doi", "autofillid":"doi", "autofillprop":"doi"},
{"field": "pmid", "autofillid":"pmid"},
{"field": "url", "autofillid":"url"},
{"field": "accessdate"},
{"field": "ref", "tooltip":"cite-ref-tooltip"},
],
[ // Expanded fields
{"field": "author<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "authorlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "editor<N>-last", "increment_group":"editor"},
{"field": "editor<N>-first", "increment_group":"editor", "increment_button":true},
{"field": "editor<N>-link", 'increment_group':'editorlink', 'increment_button':true},
{"field": "series"},
{"field": "at", "tooltip":"cite-at-tooltip"},
{"field": "trans-title"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "location"},
{"field": "language", "autofillprop":"language"},
{"field": "format"},
{"field": "issn", "autofillprop":"issn"},
{"field": "pmc"},
{"field": "oclc"},
{"field": "bibcode"},
{"field": "id"},
{"field": "quote"},
{"field": "postscript", "tooltip":"cite-postscript-tooltip"}
]);

new citeErrorCheck({'type':'reflist', 'testname':'samecontent', 'desc': 'cite-samecontent-desc',
'func': function(reflist) {
  var errors = [];
  var refs2 = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag) {
      if ($.inArray(reflist[i].content, refs2) != -1) {
        if ($.inArray(reflist[i].content, errors) == -1) {
          errors.push(reflist[i].content);
        }
      } else {
        refs2.push(reflist[i].content);
      }
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-samecontent-error', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'repeated', 'desc':'cite-repeated-desc',
'func': function(reflist) {
  var errors = [];
  var refs2 = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag && reflist[i].refname) {
      if ($.inArray(reflist[i].refname, refs2) != -1) {
        if ($.inArray(reflist[i].refname, errors) == -1) {
          errors.push(reflist[i].refname);
        }
      } else {
        refs2.push(reflist[i].refname);
      }
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-repeated-error', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'undefined', 'desc':'cite-undefined-desc',
'func': function(reflist) {
  var errors = [];
  var longrefs = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag && reflist[i].refname) {
      longrefs.push(reflist[i].refname);
    }
  }
  for(var j=0; i<reflist.length; j++) {
    if (reflist[i].shorttag && $.inArray(reflist[i].refname, errors) == -1 && $.inArray(reflist[i].refname, longrefs) == -1) {
      errors.push(reflist[i].refname);
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-undefined-error', 'err':errors[j]});
  }
  return ret;
}}
);

CiteTB.init();