MediaWiki:IndicatorsHint.js e Wikincat:Etiquetas: mudanças entre as páginas

De Wikincat
(Diferenças entre páginas)
Ir para navegação Ir para pesquisar
(Criou página com '→‎jshint esversion: 10: const indicatorsByTags = { '022': { ind1: [ '# - Nível não especificado', '0 - Recurso contínuo de interesse internacional', '1 - Recurso contínuo sem interesse internacional', ], }, '041': { ind1: [ '# - Informação não fornecida', '0 - Não é tradução/não inclui tradução', '1 - É ou inclui tradução', ], ind2: [ '# - Código MARC para idiomas', '7 - Fonte...')
 
Sem resumo de edição
 
Linha 1: Linha 1:
{{DISPLAYTITLE:Etiquetas}}{{#ask: [[Has manifestation exemplified::B000001]]
/* jshint esversion: 10 */
|?Has call number
const indicatorsByTags = {
|?Has identifier for the item
'022': {
|?Has holding institution
ind1: [
|?Has location
'# - Nível não especificado',
|?
'0 - Recurso contínuo de interesse internacional',
|format=plainlist
'1 - Recurso contínuo sem interesse internacional',
|limit=14
],
|offset=0
},
|link=none
'041': {
|sort=
ind1: [
|order=asc
'# - Informação não fornecida',
|headers=hide
'0 - Não é tradução/não inclui tradução',
|mainlabel=-
'1 - É ou inclui tradução',
|searchlabel=… mais resultados
],
|propsep=,
ind2: [
|valuesep=,
'# - Código MARC para idiomas',
|template=CallNumberLabelStyle001
'7 - Fonte especificada no subcampo $2',
|class=sortable wikitable smwtable
],
|prefix=none
},
}}</div>
'045': {
ind1: [
'# - subcampos $b ou $c não estão presentes',
'0 - data/período únicos',
'1 - data/período múltiplos',
'2 - extensão de datas/períodos',
],
},
'080': {
ind1: ['# - Informação não fornecida', '0 - Completa', '1 - Abreviada'],
},
'082': {
ind1: [
'0 - Edição completa',
'1 - Edição abreviada',
'7 - Outra edição especificada no subcampo $2',
],
ind2: [
'# - Informação não fornecida',
'0 - Atribuído pela LC',
'4 - Atribuído por outra agência',
],
},
100: {
ind1: ['1 - Sobrenome', '0 - Prenome', '3 - Nome de família'],
},
245: {
ind1: [
'0 - Entrada principal para o título (sem entrada principal para uma autoria)',
'1 - Entrada secundária para o título (entrada principal para uma autoria)',
],
ind2: [
'0 - Caracteres a serem desprezados',
'1 - Caracteres a serem desprezados',
'2 - Caracteres a serem desprezados',
'3 - Caracteres a serem desprezados',
'4 - Caracteres a serem desprezados',
'5 - Caracteres a serem desprezados',
'6 - Caracteres a serem desprezados',
'7 - Caracteres a serem desprezados',
'8 - Caracteres a serem desprezados',
'9 - Caracteres a serem desprezados',
],
},
260: {
ind1: [
'# - Não se aplica/nenhuma informação fornecida/editor mais antigo',
'2 - Editor intermediário',
'3 - Editor atual',
],
},
650: {
ind1: [
'# - Nenhuma informação fornecida',
'0 - Nível não especificado',
'1 - Primário',
'2 - Secundário',
],
ind2: [
'4 - Fonte não especificada',
'0 - Library of Congress Subject Headings (LCSH)',
"1 - LC subject headings for children's literature",
'2 - Medical Subject Headings',
'3 - National Agricultural Library subject authority file',
'5 - Canadian Subject Headings',
'6 - Répertoire de vedettes-matière',
'7 - Fonte especificada no subcampo 2',
],
},
700: {
ind1: ['1 - Sobrenome', '0 - Prenome', '3 - Nome de família'],
ind2: ['# - Nenhuma informação fornecida', '2 - Entrada analítica'],
},
};

function setIndOptions(event, ind) {
const { target } = event;
let tagFromDropdown = '';
tagFromDropdown =
target
.closest('.instanceMain')
.querySelector('.oo-ui-inputWidget-input')
.getAttribute('title') ?? ' ';
tagFromDropdown = tagFromDropdown.substring(0, 3);

if (tagFromDropdown in indicatorsByTags) {
target.innerHTML = '';
const indArr = indicatorsByTags[tagFromDropdown][ind] ?? ['# - Indefinido'];

for (let i = 0; i < indArr.length; i += 1) {
const option = document.createElement('option');
option.setAttribute('value', indArr[i][0]);
option.innerText = indArr[i];
target.appendChild(option);
}
} else {
target.innerHTML = '';
const option = document.createElement('option');
option.setAttribute('value', '#');
option.innerText = '# - Indefinido';
target.appendChild(option);
}
}

function setIndicators() {
const inds1 = document.body.querySelectorAll('[origname="Field[ind1]"');
const inds2 = document.body.querySelectorAll('[origname="Field[ind2]"');
inds1.forEach((ind1Elem) => {
ind1Elem.addEventListener('focusin', (event) => {
setIndOptions(event, 'ind1');
});
});
inds2.forEach((elem) => {
elem.addEventListener('focusin', (event) => {
setIndOptions(event, 'ind2');
});
});
}

Edição das 17h50min de 28 de abril de 2024

576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714399 065012
Balcão de empréstimo BSCFM - Biblioteca Setorial do C...
576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714399 065029
Acervo geral BSCED - Biblioteca Setorial do C...
576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714399 065036
Periódicos BSCCJ - Biblioteca Setorial do C...
576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714399 065043
Armazém BSARA - Biblioteca Setorial do C...
REFERÊNCIA
576.12
H254s
2015
v. 1
REFERÊNCIA 576.12 H254s...000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714400 179011
Referência BC - Biblioteca Central
576.12
H254s
2015
v. 1
SUFIXO
576.12 H254s 2015 v. 1 ...000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714400 179028
Balcão de empréstimo BSCFM - Biblioteca Setorial do C...
576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714400 179035
Acervo geral BC - Biblioteca Central
576.12
H254s
2015
v. 1
576.12 H254s 2015 v. 1000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714400 179042
Acervo geral BC - Biblioteca Central
616-083-053.2(816.4)"1999"
H254s
2005
v. 1
t. 1
616-083-053.2(816.4)"19...000001
Sapiens: uma breve história da...
Zint Generated Symbol 1 714477 850011
Acervo geral BC - Biblioteca Central