MediaWiki:MARCimporter.js: mudanças entre as edições

De Wikincat
Ir para navegação Ir para pesquisar
imp>Jaider
(jslint, eslint e jshint)
 
Sem resumo de edição
 
(2 revisões intermediárias por um outro usuário não estão sendo mostradas)
Linha 1: Linha 1:
/* jshint esversion: 10 */
$(document).ready(function(){
const mainFunc = function () {
$("#wpRunQuery").click(function(){
const prepareRecordBtn = document.body.querySelector('#wpRunQuery');
// when query, substitute | by $ in the texarea
$("span.inputSpan").find("textarea").each(function() {
prepareRecordBtn.addEventListener('click', function () {
// when query, substitute | by $ in the textarea
let input = $(this).val();
const textarea = document.body.querySelector('textarea');
let normalizedInput = input
.replace(/\|/g, "$");
textarea.value = textarea.value.replace(/\|/g, '$');
});
$(this).val(normalizedInput);
};
});

});
document.addEventListener('DOMContentLoaded', function () {
mainFunc();
});
});

Edição atual tal como às 13h43min de 18 de março de 2024

/* jshint esversion: 10 */
const mainFunc = function () {
  const prepareRecordBtn = document.body.querySelector('#wpRunQuery');
  prepareRecordBtn.addEventListener('click', function () {
    // when query, substitute | by $ in the textarea
    const textarea = document.body.querySelector('textarea');
    textarea.value = textarea.value.replace(/\|/g, '$');
  });
};

document.addEventListener('DOMContentLoaded', function () {
  mainFunc();
});