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

Conteúdo deletado Conteúdo adicionado
m uma edição
Sem resumo de edição
Linha 1:
(function () {
// Função que gera o arquivo ISO
function download(filename, content) {
"use strict";
// Função que gera o arquivo ISO
let element = document.createElement("a");
function download(filename, content) {
element.setAttribute("href", "data:application/marc;charset=utf-8,"
let element = document.createElement("a");
+ encodeURIComponent(content));
element.setAttribute("downloadhref", filename)"data:application/marc;charset=utf-8,"
+ encodeURIComponent(content));
element.style.display = "none";
element.setAttribute("download", filename);
document.body.appendChild(element);
element.click()style.display = "none";
document.body.removeChildappendChild(element);
functionelement.click(){;
}
document.body.appendChildremoveChild(element);
// Se tiver uma div "isoFormat" na página/documento,
}
// substititua os caracteres abaixo
if (document.getElementById( // Se tiver uma div "isoFormat")) {na página/documento,
// substititua os caracteres abaixo
document.getElementById("isoFormat").innerHTML =
let isoFormat = document.getElementById("isoFormat").innerHTML.replace(/\u241D/g, String.fromCharCode(29)); // GS
document.getElementByIdif ("isoFormat").innerHTML ={
document.getElementById(" isoFormat").innerHTML.replace(/\u241E/g, String.fromCharCode(30)); // RS=
document.getElementById(" isoFormat").innerHTML.replace(/\u241D/g, String.fromCharCode(29)); // =GS
document.getElementById(" isoFormat").innerHTML.replace(/\u241F/g, String.fromCharCode(31)); // US=
document.getElementById(" isoFormat").innerHTML.replace(/\u241E/g, String.fromCharCode(30)); // =RS
document.getElementById(" isoFormat").innerHTML.replace(/ /g, String.fromCharCode(32)); // &NonBreakingSpace=
isoFormat.innerHTML.replace(/\u241F/g, String.fromCharCode(31)); // US
document.getElementById(" isoFormat").innerHTML =
isoFormat.innerHTML.replace(/ /g, String.fromCharCode(32)); // &NonBreakingSpace
 
let const content = document.getElementById("isoFormat").textContent;
let const filename = document.URL.substrslice(-7) + ".mrc";
 
// Ao clicar no botão "downloadButton", chama a função download() abaixo
document.getElementById("downloadButton").addEventListener("click",
() => download(filename, content), false);
function(){
}
download(filename, content);
 
}, false);
})();
}