מדיה ויקי:RefToolbar.js – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
Kaldari (שיחה | תרומות)
adding url lookup
Kaldari (שיחה | תרומות)
make sure data.authors is defined before trying to use
שורה 488:
var i,j, coauthors;
$('.'+cl+'title').val(data.title);
// Fill varin authors = [];
if ($('.'+cl+'last-incr-1').length != 0) {
if (data.authors) {
var classes = $('.'+cl+'last-incr-1').eq(0).attr('class').split(/\s+/);
if ($('.'+cl+'last-incr-1').length != 0) {
var group = false;
var pattclasses = /cite-[^-]*?$('.'+cl+'last-incr-1').eq(0).*attr('class').split(/\s+/);
var group = false;
for (var c=0; c<classes.length; c++) {
ifvar (patt.exec(classes = /cite-[c^-]*?-incr-(.*)) {/
groupfor (var c=0; patt.exec(c<classes[.length; c]++)[1]; {
if (patt.exec(classes[c])) {
break;
group = patt.exec(classes[c])[1];
}
break;
}
}
$('.'+cl+'last-incr-1').val(data.authors[0][0])
}
$('.'+cl+'first-incr-1').val(data.authors[0][1])
$('.'+cl+'last-incr-1').val(data.authors[0][0])
elemid = '#cite-incr-'+template+'-'+group;
for $('.'+cl+'first-incr-1').val(var i=2; i<data.authors.length+[0][1; i++]) {
elemid = '#cite-incr-'+template+'-'+group;
$(elemid).click();
$for ('.'+cl+'last-incr-'+var i=2; i.toString()).val(<data.authors[.length+1; i-1][0]++) {
$(elemid).click();
$('.'+cl+'firstlast-incr-'+i.toString()).val(data.authors[i-1][10])
$('.'+cl+'first-incr-1'+i.toString()).val(data.authors[0i-1][1])
}
} else if ($('.'+cl+'author-incr-1').length != 0) {
var classes =} else if ($('.'+cl+'author-incr-1').eq(length != 0).attr('class').split(/\s+/); {
var classes = $('.'+cl+'lastauthor-incr-1').eq(0).attr('class').split(/\s+/);
var group = false;
var group = false;
var patt = /cite-[^-]*?-incr-(.*)/
for (var c=0; c<classes.length; c++) {
if (patt.exec(classes[c])) {
group = patt.exec(classes[c])[1];
break;
}
}
$('.'+cl+'author-incr-1').val(data.authors[0].join(', '))
elemid = '#cite-incr-'+template+'-'+group;
for (var i=2; i<data.authors.length+1; i++) {
$(elemid).click();
$('.'+cl+'author-incr-'+i.toString()).val(data.authors[i-1].join(', '))
}
} else if ($('.'+cl+'last1').length != 0) {
for(i=0; data.authors && i<data.authors.length; i++) {
if ($('.'+cl+'last'+(i+1)).length) {
$('.'+cl+'last'+(i+1)).val(data.authors[i][0]);
$('.'+cl+'first'+(i+1)).val(data.authors[i][1]);
} else {
coauthors = [];
for(j=i; j<data.authors.length; j++) {
coauthors.push(data.authors[j].join(', '));
}
$('.'+cl+'coauthors').val(coauthors.join('; '));
break;
}
}
} else if ($('.'+cl+'author-incr-1author1').length !== 0) {
for(i=0; data.authors && i<data.authors.length; i++) {
if ($('.'+cl+'author'+(i+1)).length) {
$('.'+cl+'author'+(i+1)).val(data.authors[i].join(', '));
} else {
coauthors = [];
for (var cj=0i; cj<classesdata.authors.length; cj++) {
authorscoauthors.push(data.authors[ij].join(', '));
}
$('.'+cl+'authorscoauthors').val(authorscoauthors.join('; '));
break;
}
}
$('.'+cl+'coauthors').val(coauthors.join('; '));
break;
}
}
} else if($('.'+cl+'author1').length !== 0) {
for(i=0; data.authors && i<data.authors.length; i++) {
if ($('.'+cl+'author'+(i+1)).length) {
$('.'+cl+'author'+(i+1)).val(data.authors[i].join(', '));
} else {
var coauthorsauthors = [];
for(j=i=0; jdata.authors && i<data.authors.length; ji++) {
coauthorsauthors.push(data.authors[ji].join(', '));
}
$('.'+cl+'coauthorsauthors').val(coauthorsauthors.join('; '));
break;
}
}
} else {
var authors = [];
for(i=0; data.authors && i<data.authors.length; i++) {
authors.push(data.authors[i].join(', '));
}
$('.'+cl+'authors').val(authors.join('; '));
}
 
if (type === 'pmid' || type === 'doi') {
if (data.fulldate || !$('.'+cl+'month').length) {